From dchagin at FreeBSD.org Mon Jun 1 04:44:44 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Mon Jun 1 04:44:56 2009 Subject: svn commit: r193196 - in stable/7/sys: . amd64/linux32 compat/linux contrib/pf dev/ath/ath_hal dev/cxgb i386/linux Message-ID: <200906010444.n514ihPS064097@svn.freebsd.org> Author: dchagin Date: Mon Jun 1 04:44:43 2009 New Revision: 193196 URL: http://svn.freebsd.org/changeset/base/193196 Log: MFC r191741: Move extern variable definitions to the header file. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/linux32/linux32_sysvec.c stable/7/sys/compat/linux/linux_futex.c stable/7/sys/compat/linux/linux_futex.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/linux/linux_sysvec.c Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/7/sys/amd64/linux32/linux32_sysvec.c Mon Jun 1 02:37:06 2009 (r193195) +++ stable/7/sys/amd64/linux32/linux32_sysvec.c Mon Jun 1 04:44:43 2009 (r193196) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -126,9 +127,6 @@ static void exec_linux_setregs(struct th u_long stack, u_long ps_strings); static void linux32_fixlimit(struct rlimit *rl, int which); -extern LIST_HEAD(futex_list, futex) futex_list; -extern struct mtx futex_mtx; - static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_schedtail_tag; static eventhandler_tag linux_exec_tag; Modified: stable/7/sys/compat/linux/linux_futex.c ============================================================================== --- stable/7/sys/compat/linux/linux_futex.c Mon Jun 1 02:37:06 2009 (r193195) +++ stable/7/sys/compat/linux/linux_futex.c Mon Jun 1 04:44:43 2009 (r193196) @@ -81,7 +81,7 @@ struct futex { TAILQ_HEAD(lf_waiting_proc, waiting_proc) f_waiting_proc; }; -LIST_HEAD(futex_list, futex) futex_list; +struct futex_list futex_list; #define FUTEX_LOCK(f) sx_xlock(&(f)->f_lck) #define FUTEX_UNLOCK(f) sx_xunlock(&(f)->f_lck) Modified: stable/7/sys/compat/linux/linux_futex.h ============================================================================== --- stable/7/sys/compat/linux/linux_futex.h Mon Jun 1 02:37:06 2009 (r193195) +++ stable/7/sys/compat/linux/linux_futex.h Mon Jun 1 04:44:43 2009 (r193196) @@ -36,6 +36,9 @@ #ifndef _LINUX_FUTEX_H #define _LINUX_FUTEX_H +extern LIST_HEAD(futex_list, futex) futex_list; +extern struct mtx futex_mtx; + #define LINUX_FUTEX_WAIT 0 #define LINUX_FUTEX_WAKE 1 #define LINUX_FUTEX_FD 2 /* unused */ Modified: stable/7/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/7/sys/i386/linux/linux_sysvec.c Mon Jun 1 02:37:06 2009 (r193195) +++ stable/7/sys/i386/linux/linux_sysvec.c Mon Jun 1 04:44:43 2009 (r193196) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -110,9 +111,6 @@ static register_t *linux_copyout_strings static int linux_szplatform; const char *linux_platform; -extern LIST_HEAD(futex_list, futex) futex_list; -extern struct mtx futex_mtx; - static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_schedtail_tag; static eventhandler_tag linux_exec_tag; From maxim at FreeBSD.org Mon Jun 1 05:48:30 2009 From: maxim at FreeBSD.org (Maxim Konovalov) Date: Mon Jun 1 05:48:51 2009 Subject: svn commit: r193200 - stable/7/sbin/geom/class/journal Message-ID: <200906010548.n515mUF3065634@svn.freebsd.org> Author: maxim Date: Mon Jun 1 05:48:30 2009 New Revision: 193200 URL: http://svn.freebsd.org/changeset/base/193200 Log: MFC r192747: fix typo in the example. Modified: stable/7/sbin/geom/class/journal/gjournal.8 Modified: stable/7/sbin/geom/class/journal/gjournal.8 ============================================================================== --- stable/7/sbin/geom/class/journal/gjournal.8 Mon Jun 1 05:37:13 2009 (r193199) +++ stable/7/sbin/geom/class/journal/gjournal.8 Mon Jun 1 05:48:30 2009 (r193200) @@ -219,7 +219,7 @@ allows this (i.e., if the last sector is .Bd -literal -offset indent umount /dev/da0s1d gjournal label da0s1d da0s1e && \e - tunefs -J enable -n disable da01sd.journal && \e + tunefs -J enable -n disable da0s1d.journal && \e mount -o async /dev/da0s1d.journal /mnt || \e mount /dev/da0s1d /mnt .Ed From delphij at FreeBSD.org Mon Jun 1 10:49:09 2009 From: delphij at FreeBSD.org (Xin LI) Date: Mon Jun 1 10:49:23 2009 Subject: svn commit: r193220 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bce dev/cxgb Message-ID: <200906011049.n51An8ew076617@svn.freebsd.org> Author: delphij Date: Mon Jun 1 10:49:08 2009 New Revision: 193220 URL: http://svn.freebsd.org/changeset/base/193220 Log: DMA synchronization fixes: - In bce_rx_intr(), use BUS_DMASYNC_POSTREAD instead of BUS_DMASYNC_POSTWRITE, as we want to "read" from the rx page chain pages. - Document why we need to do PREWRITE after we have updated the rx page chain pages. - In bce_intr(), use BUS_DMASYNC_POSTREAD and BUS_DMASYNC_PREREAD when before and after CPU "reading" the status block. - Adjust some nearby style mismatches/etc. Pointed out by: yongari Approved by: davidch (no objection) but bugs are mine :) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Mon Jun 1 10:41:38 2009 (r193219) +++ stable/7/sys/dev/bce/if_bce.c Mon Jun 1 10:49:08 2009 (r193220) @@ -4884,7 +4884,7 @@ bce_get_rx_buf(struct bce_softc *sc, str KASSERT(nsegs == 1, ("%s(): Too many segments returned (%d)!", __FUNCTION__, nsegs)); - /* ToDo: Do we need bus_dmamap_sync(,,BUS_DMASYNC_PREWRITE) here? */ + /* ToDo: Do we need bus_dmamap_sync(,,BUS_DMASYNC_PREREAD) here? */ /* Setup the rx_bd for the segment. */ rxbd = &sc->rx_bd_chain[RX_PAGE(*chain_prod)][RX_IDX(*chain_prod)]; @@ -4993,7 +4993,7 @@ bce_get_pg_buf(struct bce_softc *sc, str goto bce_get_pg_buf_exit; } - /* ToDo: Do we need bus_dmamap_sync(,,BUS_DMASYNC_PREWRITE) here? */ + /* ToDo: Do we need bus_dmamap_sync(,,BUS_DMASYNC_PREREAD) here? */ /* * The page chain uses the same rx_bd data structure @@ -5270,13 +5270,11 @@ bce_init_rx_chain(struct bce_softc *sc) rxbd->rx_bd_haddr_lo = htole32(BCE_ADDR_LO(sc->rx_bd_chain_paddr[j])); } -/* Fill up the RX chain. */ + /* Fill up the RX chain. */ bce_fill_rx_chain(sc); for (i = 0; i < RX_PAGES; i++) { - bus_dmamap_sync( - sc->rx_bd_chain_tag, - sc->rx_bd_chain_map[i], + bus_dmamap_sync(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } @@ -5447,9 +5445,7 @@ bce_init_pg_chain(struct bce_softc *sc) bce_fill_pg_chain(sc); for (i = 0; i < PG_PAGES; i++) { - bus_dmamap_sync( - sc->pg_bd_chain_tag, - sc->pg_bd_chain_map[i], + bus_dmamap_sync(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } @@ -5732,13 +5728,13 @@ bce_rx_intr(struct bce_softc *sc) /* Prepare the RX chain pages to be accessed by the host CPU. */ for (int i = 0; i < RX_PAGES; i++) bus_dmamap_sync(sc->rx_bd_chain_tag, - sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTWRITE); + sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTREAD); #ifdef ZERO_COPY_SOCKETS /* Prepare the page chain pages to be accessed by the host CPU. */ for (int i = 0; i < PG_PAGES; i++) bus_dmamap_sync(sc->pg_bd_chain_tag, - sc->pg_bd_chain_map[i], BUS_DMASYNC_POSTWRITE); + sc->pg_bd_chain_map[i], BUS_DMASYNC_POSTREAD); #endif /* Get the hardware's view of the RX consumer index. */ @@ -5765,9 +5761,8 @@ bce_rx_intr(struct bce_softc *sc) sw_rx_cons_idx = RX_CHAIN_IDX(sw_rx_cons); /* Unmap the mbuf from DMA space. */ - bus_dmamap_sync(sc->rx_mbuf_tag, - sc->rx_mbuf_map[sw_rx_cons_idx], - BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->rx_mbuf_tag, sc->rx_mbuf_map[sw_rx_cons_idx], + BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->rx_mbuf_tag, sc->rx_mbuf_map[sw_rx_cons_idx]); @@ -6011,6 +6006,7 @@ bce_rx_int_next_rx: sc->rx_cons = sw_rx_cons; bce_fill_rx_chain(sc); + /* Prepare the page chain pages to be accessed by the NIC. */ for (int i = 0; i < RX_PAGES; i++) bus_dmamap_sync(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], BUS_DMASYNC_PREWRITE); @@ -7023,8 +7019,9 @@ bce_intr(void *xsc) DBRUN(sc->interrupts_generated++); + /* Synchnorize before we read from interface's status block */ bus_dmamap_sync(sc->status_tag, sc->status_map, - BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_POSTREAD); /* * If the hardware status block index @@ -7112,7 +7109,7 @@ bce_intr(void *xsc) } bus_dmamap_sync(sc->status_tag, sc->status_map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD); /* Re-enable interrupts. */ bce_enable_intr(sc, 0); From gavin at FreeBSD.org Mon Jun 1 16:15:11 2009 From: gavin at FreeBSD.org (Gavin Atkinson) Date: Mon Jun 1 16:15:18 2009 Subject: svn commit: r193220 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bce dev/cxgb In-Reply-To: <200906011049.n51An8ew076617@svn.freebsd.org> References: <200906011049.n51An8ew076617@svn.freebsd.org> Message-ID: <1243871061.57113.3.camel@buffy.york.ac.uk> On Mon, 2009-06-01 at 10:49 +0000, Xin LI wrote: > Author: delphij > Date: Mon Jun 1 10:49:08 2009 > New Revision: 193220 > URL: http://svn.freebsd.org/changeset/base/193220 > > Log: > DMA synchronization fixes: > [snip] > - In bce_intr(), use BUS_DMASYNC_POSTREAD and > BUS_DMASYNC_PREREAD when before and after CPU "reading" > the status block. > - Adjust some nearby style mismatches/etc. Is it possible that these changes will fix the issues reported with bce(4) on amd64? For example, amd64/134788? Thanks, Gavin From kmacy at FreeBSD.org Mon Jun 1 22:09:43 2009 From: kmacy at FreeBSD.org (Kip Macy) Date: Mon Jun 1 22:10:00 2009 Subject: svn commit: r193282 - stable/7/sys/libkern Message-ID: <200906012209.n51M9gTU094161@svn.freebsd.org> Author: kmacy Date: Mon Jun 1 22:09:42 2009 New Revision: 193282 URL: http://svn.freebsd.org/changeset/base/193282 Log: memmove is defined in support.S on arm - don't compile in Modified: stable/7/sys/libkern/memmove.c Modified: stable/7/sys/libkern/memmove.c ============================================================================== --- stable/7/sys/libkern/memmove.c Mon Jun 1 22:05:08 2009 (r193281) +++ stable/7/sys/libkern/memmove.c Mon Jun 1 22:09:42 2009 (r193282) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include +#if !defined(__arm__) void * memmove(void *dest, const void *src, size_t n) { @@ -36,3 +37,4 @@ memmove(void *dest, const void *src, siz bcopy(src, dest, n); return (dest); } +#endif From sobomax at FreeBSD.org Mon Jun 1 23:27:40 2009 From: sobomax at FreeBSD.org (Maxim Sobolev) Date: Mon Jun 1 23:27:47 2009 Subject: svn: stable/7: lib/libc/i386/stdlib lib/libc/i386/string lib/libc_r/arch/amd64 lib/libc_r/arch/i386 lib/libstand/i386 lib/msun/amd64 lib/msun/i387 lib/msun/ia64 tools/KSE/ksetes... In-Reply-To: <200905302327.n4UNRmxV022733@svn.freebsd.org> References: <200905302327.n4UNRmxV022733@svn.freebsd.org> Message-ID: <4A245D67.8020908@FreeBSD.org> Attilio Rao wrote: > Author: attilio > Date: Sat May 30 23:27:48 2009 > New Revision: 193134 > URL: http://svn.freebsd.org/changeset/base/193134 > > Log: > MFC r192760: > Use the END() macro appropriately in order to improve debugging for > tools (Valgrind mainly). > > Modified: stable/7/lib/libc/i386/stdlib/ldiv.S > ============================================================================== > --- stable/7/lib/libc/i386/stdlib/ldiv.S Sat May 30 23:01:27 2009 (r193133) > +++ stable/7/lib/libc/i386/stdlib/ldiv.S Sat May 30 23:27:48 2009 (r193134) > @@ -40,3 +40,4 @@ ENTRY(ldiv) > movl %edx,8(%esp) > ret > END(ldiv) > +END(ldiv) > > Modified: stable/7/lib/libc/i386/string/wcscmp.S > ============================================================================== > --- stable/7/lib/libc/i386/string/wcscmp.S Sat May 30 23:01:27 2009 (r193133) > +++ stable/7/lib/libc/i386/string/wcscmp.S Sat May 30 23:27:48 2009 (r193134) > @@ -78,3 +78,4 @@ no0: subl (%esi),%eax > popl %edi > ret > END(wcscmp) > +END(wcscmp) Are those double-ENDs intentional? -Maxim From attilio at FreeBSD.org Mon Jun 1 23:53:16 2009 From: attilio at FreeBSD.org (Attilio Rao) Date: Mon Jun 1 23:53:29 2009 Subject: svn commit: r193286 - in stable/7/lib/libc/i386: stdlib string Message-ID: <200906012353.n51NrFAd096363@svn.freebsd.org> Author: attilio Date: Mon Jun 1 23:53:15 2009 New Revision: 193286 URL: http://svn.freebsd.org/changeset/base/193286 Log: Remove double-inserted END() macros. Reported by: sobomax Modified: stable/7/lib/libc/i386/stdlib/ldiv.S stable/7/lib/libc/i386/string/wcscmp.S Modified: stable/7/lib/libc/i386/stdlib/ldiv.S ============================================================================== --- stable/7/lib/libc/i386/stdlib/ldiv.S Mon Jun 1 22:47:59 2009 (r193285) +++ stable/7/lib/libc/i386/stdlib/ldiv.S Mon Jun 1 23:53:15 2009 (r193286) @@ -40,4 +40,3 @@ ENTRY(ldiv) movl %edx,8(%esp) ret END(ldiv) -END(ldiv) Modified: stable/7/lib/libc/i386/string/wcscmp.S ============================================================================== --- stable/7/lib/libc/i386/string/wcscmp.S Mon Jun 1 22:47:59 2009 (r193285) +++ stable/7/lib/libc/i386/string/wcscmp.S Mon Jun 1 23:53:15 2009 (r193286) @@ -78,4 +78,3 @@ no0: subl (%esi),%eax popl %edi ret END(wcscmp) -END(wcscmp) From attilio at freebsd.org Tue Jun 2 00:13:48 2009 From: attilio at freebsd.org (Attilio Rao) Date: Tue Jun 2 00:13:54 2009 Subject: svn: stable/7: lib/libc/i386/stdlib lib/libc/i386/string lib/libc_r/arch/amd64 lib/libc_r/arch/i386 lib/libstand/i386 lib/msun/amd64 lib/msun/i387 lib/msun/ia64 tools/KSE/ksetes... In-Reply-To: <4A245D67.8020908@FreeBSD.org> References: <200905302327.n4UNRmxV022733@svn.freebsd.org> <4A245D67.8020908@FreeBSD.org> Message-ID: <3bbf2fe10906011651qdce77a2ya4ac09922308217d@mail.gmail.com> 2009/6/2 Maxim Sobolev : > Attilio Rao wrote: >> >> Author: attilio >> Date: Sat May 30 23:27:48 2009 >> New Revision: 193134 >> URL: http://svn.freebsd.org/changeset/base/193134 >> >> Log: >> MFC r192760: >> Use the END() macro appropriately in order to improve debugging for >> tools (Valgrind mainly). >> >> Modified: stable/7/lib/libc/i386/stdlib/ldiv.S >> >> ============================================================================== >> --- stable/7/lib/libc/i386/stdlib/ldiv.S Sat May 30 23:01:27 2009 >> (r193133) >> +++ stable/7/lib/libc/i386/stdlib/ldiv.S Sat May 30 23:27:48 2009 >> (r193134) >> @@ -40,3 +40,4 @@ ENTRY(ldiv) >> movl %edx,8(%esp) >> ret >> END(ldiv) >> +END(ldiv) >> >> Modified: stable/7/lib/libc/i386/string/wcscmp.S >> >> ============================================================================== >> --- stable/7/lib/libc/i386/string/wcscmp.S Sat May 30 23:01:27 2009 >> (r193133) >> +++ stable/7/lib/libc/i386/string/wcscmp.S Sat May 30 23:27:48 2009 >> (r193134) >> @@ -78,3 +78,4 @@ no0: subl (%esi),%eax >> popl %edi >> ret >> END(wcscmp) >> +END(wcscmp) > > Are those double-ENDs intentional? No, thanks for catching them. Attilio -- Peace can only be achieved by understanding - A. Einstein From dchagin at FreeBSD.org Tue Jun 2 04:44:39 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Tue Jun 2 04:44:51 2009 Subject: svn commit: r193295 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal dev/cxgb Message-ID: <200906020444.n524icjH002690@svn.freebsd.org> Author: dchagin Date: Tue Jun 2 04:44:38 2009 New Revision: 193295 URL: http://svn.freebsd.org/changeset/base/193295 Log: MFC r191742,r191871: Linux socketpair() call expects explicit specified protocol for AF_LOCAL domain unlike FreeBSD which expects 0 in this case. Return EAFNOSUPPORT in case when the incorrect domain argument is specified. Return EPROTONOSUPPORT instead of passing values that are not 0 to the BSD layer. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_socket.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Tue Jun 2 04:35:44 2009 (r193294) +++ stable/7/sys/compat/linux/linux_socket.c Tue Jun 2 04:44:38 2009 (r193295) @@ -812,11 +812,21 @@ linux_socketpair(struct thread *td, stru } */ bsd_args; bsd_args.domain = linux_to_bsd_domain(args->domain); - if (bsd_args.domain == -1) - return (EINVAL); + if (bsd_args.domain != PF_LOCAL) + return (EAFNOSUPPORT); bsd_args.type = args->type; - bsd_args.protocol = args->protocol; + if (args->protocol != 0 && args->protocol != PF_UNIX) + + /* + * Use of PF_UNIX as protocol argument is not right, + * but Linux does it. + * Do not map PF_UNIX as its Linux value is identical + * to FreeBSD one. + */ + return (EPROTONOSUPPORT); + else + bsd_args.protocol = 0; bsd_args.rsv = (int *)PTRIN(args->rsv); return (socketpair(td, &bsd_args)); } From dchagin at FreeBSD.org Tue Jun 2 04:47:29 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Tue Jun 2 04:47:40 2009 Subject: svn commit: r193297 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal dev/cxgb Message-ID: <200906020447.n524lSau002833@svn.freebsd.org> Author: dchagin Date: Tue Jun 2 04:47:28 2009 New Revision: 193297 URL: http://svn.freebsd.org/changeset/base/193297 Log: MFC r191875: Return EAFNOSUPPORT instead of EINVAL in case when the incorrect or unsupported domain argument to linux_socket() is specified. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_socket.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Tue Jun 2 04:45:56 2009 (r193296) +++ stable/7/sys/compat/linux/linux_socket.c Tue Jun 2 04:47:28 2009 (r193297) @@ -556,7 +556,7 @@ linux_socket(struct thread *td, struct l bsd_args.type = args->type; bsd_args.domain = linux_to_bsd_domain(args->domain); if (bsd_args.domain == -1) - return (EINVAL); + return (EAFNOSUPPORT); retval_socket = socket(td, &bsd_args); if (bsd_args.type == SOCK_RAW From brian at FreeBSD.org Tue Jun 2 09:25:57 2009 From: brian at FreeBSD.org (Brian Somers) Date: Tue Jun 2 09:26:04 2009 Subject: svn commit: r193304 - in stable/7/share/examples: . ppp Message-ID: <200906020925.n529PuA5008528@svn.freebsd.org> Author: brian Date: Tue Jun 2 09:25:56 2009 New Revision: 193304 URL: http://svn.freebsd.org/changeset/base/193304 Log: MFC: Mention the danger of running programs using ``!''. PR: 112481 Modified: stable/7/share/examples/ (props changed) stable/7/share/examples/ppp/ppp.linkup.sample Modified: stable/7/share/examples/ppp/ppp.linkup.sample ============================================================================== --- stable/7/share/examples/ppp/ppp.linkup.sample Tue Jun 2 08:02:27 2009 (r193303) +++ stable/7/share/examples/ppp/ppp.linkup.sample Tue Jun 2 09:25:56 2009 (r193304) @@ -30,11 +30,16 @@ MYADDR: 192.244.176.32: add 192.244.176.0 0 HISADDR -#You may want to execute a script after connecting. This script can do +# You may want to execute a script after connecting. This script can do # nice things such as kick off "sendmail -q", "popclient my.isp" and # "slurp -d news". It can be passed MYADDR, HISADDR and INTERFACE # as arguments too - useful for informing a DNS of your assigned IP. # +# NOTE: It's vital that you use ``!bg'' rather than ``!'' if the program +# you're running will take some time or will require network +# connectivity. Using ``!'' will delay ppp 'till the completion +# of the program being run! +# # You may also want some sound effects.... # pmdemand: From jhay at meraka.org.za Tue Jun 2 12:06:16 2009 From: jhay at meraka.org.za (John Hay) Date: Tue Jun 2 12:06:34 2009 Subject: svn2cvs down? was: svn commit: r193282 - stable/7/sys/libkern In-Reply-To: <200906012209.n51M9gTU094161@svn.freebsd.org> References: <200906012209.n51M9gTU094161@svn.freebsd.org> Message-ID: <20090602120608.GA98052@zibbi.meraka.csir.co.za> Hi Guys, Is there something wrong with the svn to cvs gateway? At least this commit has not pitched on the cvs side. Who should one contact about it? John -- John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org On Mon, Jun 01, 2009 at 10:09:42PM +0000, Kip Macy wrote: > Author: kmacy > Date: Mon Jun 1 22:09:42 2009 > New Revision: 193282 > URL: http://svn.freebsd.org/changeset/base/193282 > > Log: > memmove is defined in support.S on arm - don't compile in > > Modified: > stable/7/sys/libkern/memmove.c > > Modified: stable/7/sys/libkern/memmove.c > ============================================================================== > --- stable/7/sys/libkern/memmove.c Mon Jun 1 22:05:08 2009 (r193281) > +++ stable/7/sys/libkern/memmove.c Mon Jun 1 22:09:42 2009 (r193282) > @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); > > #include > > +#if !defined(__arm__) > void * > memmove(void *dest, const void *src, size_t n) > { > @@ -36,3 +37,4 @@ memmove(void *dest, const void *src, siz > bcopy(src, dest, n); > return (dest); > } > +#endif From peter at wemm.org Tue Jun 2 22:01:48 2009 From: peter at wemm.org (Peter Wemm) Date: Tue Jun 2 22:02:00 2009 Subject: svn2cvs down? was: svn commit: r193282 - stable/7/sys/libkern In-Reply-To: <20090602120608.GA98052@zibbi.meraka.csir.co.za> References: <200906012209.n51M9gTU094161@svn.freebsd.org> <20090602120608.GA98052@zibbi.meraka.csir.co.za> Message-ID: On Tue, Jun 2, 2009 at 5:06 AM, John Hay wrote: > Hi Guys, > > Is there something wrong with the svn to cvs gateway? At least this > commit has not pitched on the cvs side. Who should one contact about > it? > > John > -- > John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org > > On Mon, Jun 01, 2009 at 10:09:42PM +0000, Kip Macy wrote: >> Author: kmacy >> Date: Mon Jun ?1 22:09:42 2009 >> New Revision: 193282 >> URL: http://svn.freebsd.org/changeset/base/193282 >> >> Log: >> ? memmove is defined in support.S on arm - don't compile in >> >> Modified: >> ? stable/7/sys/libkern/memmove.c >> >> Modified: stable/7/sys/libkern/memmove.c >> ============================================================================== >> --- stable/7/sys/libkern/memmove.c ? ?Mon Jun ?1 22:05:08 2009 ? ? ? ?(r193281) >> +++ stable/7/sys/libkern/memmove.c ? ?Mon Jun ?1 22:09:42 2009 ? ? ? ?(r193282) >> @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); >> >> ?#include >> >> +#if !defined(__arm__) >> ?void * >> ?memmove(void *dest, const void *src, size_t n) >> ?{ >> @@ -36,3 +37,4 @@ memmove(void *dest, const void *src, siz >> ? ? ? bcopy(src, dest, n); >> ? ? ? return (dest); >> ?} >> +#endif > > It should be fixed now. I fixed another problem with a previously-missed revision as well. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From davidch at FreeBSD.org Tue Jun 2 23:30:06 2009 From: davidch at FreeBSD.org (David Christensen) Date: Tue Jun 2 23:30:18 2009 Subject: svn commit: r193358 - stable/7/sys/dev/mii Message-ID: <200906022330.n52NU2Qe031570@svn.freebsd.org> Author: davidch Date: Tue Jun 2 23:30:02 2009 New Revision: 193358 URL: http://svn.freebsd.org/changeset/base/193358 Log: - MFC BCM5709 PHY code to fix fix ukphy attachment and PHY write timeout errors. Modified: stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/miidevs Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Tue Jun 2 22:52:58 2009 (r193357) +++ stable/7/sys/dev/mii/brgphy.c Tue Jun 2 23:30:02 2009 (r193358) @@ -74,7 +74,7 @@ struct brgphy_softc { int serdes_flags; /* Keeps track of the serdes type used */ #define BRGPHY_5706S 0x0001 #define BRGPHY_5708S 0x0002 - int bce_phy_flags; /* PHY flags transferred from the MAC driver */ + int bce_phy_flags; /* PHY flags transferred from the MAC driver */ }; static device_method_t brgphy_methods[] = { @@ -131,7 +131,9 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5755), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5787), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; @@ -243,6 +245,7 @@ brgphy_attach(device_t dev) brgphy_reset(sc); + /* Read the PHY's capabilities. */ sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); @@ -279,7 +282,7 @@ brgphy_attach(device_t dev) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, sc->mii_inst), BRGPHY_S1000 | BRGPHY_BMCR_FDX); printf("1000baseSX-FDX, "); - /* 2.5G support is a software enabled feature on the 5708S */ + /* 2.5G support is a software enabled feature on the 5708S and 5709S. */ if (bce_sc && (bce_sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG)) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_2500_SX, IFM_FDX, sc->mii_inst), 0); printf("2500baseSX-FDX, "); @@ -426,6 +429,7 @@ brgphy_setmedia(struct mii_softc *sc, in struct brgphy_softc *bsc = (struct brgphy_softc *)sc; int bmcr = 0, gig; + /* Calculate the value for the BMCR register. */ switch (IFM_SUBTYPE(media)) { case IFM_2500_SX: break; @@ -441,6 +445,8 @@ brgphy_setmedia(struct mii_softc *sc, in bmcr = BRGPHY_S10; break; } + + /* Calculate duplex settings for 1000BasetT/1000BaseX. */ if ((media & IFM_GMASK) == IFM_FDX) { bmcr |= BRGPHY_BMCR_FDX; gig = BRGPHY_1000CTL_AFD; @@ -448,18 +454,27 @@ brgphy_setmedia(struct mii_softc *sc, in gig = BRGPHY_1000CTL_AHD; } + /* Force loopback to disconnect PHY for Ethernet medium. */ brgphy_enable_loopback(sc); + + /* Disable 1000BaseT advertisements. */ PHY_WRITE(sc, BRGPHY_MII_1000CTL, 0); - PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr); + /* Disable 10/100 advertisements. */ PHY_WRITE(sc, BRGPHY_MII_ANAR, BRGPHY_SEL_TYPE); + /* Write forced link speed. */ + PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr); + /* If 10/100 only then configuration is complete. */ if ((IFM_SUBTYPE(media) != IFM_1000_T) && (IFM_SUBTYPE(media) != IFM_1000_SX)) goto brgphy_setmedia_exit; + /* Set duplex speed advertisement for 1000BaseT/1000BaseX. */ PHY_WRITE(sc, BRGPHY_MII_1000CTL, gig); + /* Restart auto-negotiation for 1000BaseT/1000BaseX. */ PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr | BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG); + /* If not 5701 PHY then configuration is complete. */ if (bsc->mii_model != MII_MODEL_xxBROADCOM_BCM5701) goto brgphy_setmedia_exit; @@ -477,6 +492,7 @@ brgphy_setmedia(struct mii_softc *sc, in PHY_WRITE(sc, BRGPHY_MII_1000CTL, gig | BRGPHY_1000CTL_MSE); } + brgphy_setmedia_exit: return; } @@ -563,7 +579,6 @@ brgphy_status(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); xstat = PHY_READ(sc, BRGPHY_5708S_PG0_1000X_STAT1); - /* Todo: Create #defines for hard coded values */ switch (xstat & BRGPHY_5708S_PG0_1000X_STAT1_SPEED_MASK) { case BRGPHY_5708S_PG0_1000X_STAT1_SPEED_10: mii->mii_media_active |= IFM_10_FL; break; @@ -598,6 +613,7 @@ brgphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_FLAG0; } } + /* Todo: Add support for fiber settings too. */ #endif @@ -638,6 +654,7 @@ brgphy_mii_phy_auto(struct mii_softc *sc } + /* Enable loopback to force the link down. */ static void brgphy_enable_loopback(struct mii_softc *sc) @@ -814,6 +831,20 @@ brgphy_fixup_jitter_bug(struct mii_softc PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); } + +static void +brgphy_fixup_disable_early_dac(struct mii_softc *sc) +{ + uint32_t val; + + PHY_WRITE(sc, BRGPHY_MII_DSP_ADDR_REG, 0x0f08); + val = PHY_READ(sc, BRGPHY_MII_DSP_RW_PORT); + val &= ~(1 << 8); + PHY_WRITE(sc, BRGPHY_MII_DSP_RW_PORT, val); + +} + + static void brgphy_ethernet_wirespeed(struct mii_softc *sc) { @@ -825,6 +856,7 @@ brgphy_ethernet_wirespeed(struct mii_sof PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4)); } + static void brgphy_jumbo_settings(struct mii_softc *sc, u_long mtu) { @@ -866,9 +898,10 @@ brgphy_reset(struct mii_softc *sc) struct bce_softc *bce_sc = NULL; struct ifnet *ifp; + /* Perform a standard PHY reset. */ mii_phy_reset(sc); - /* Handle any PHY specific procedures to finish the reset. */ + /* Handle any PHY specific procedures following the reset. */ switch (bsc->mii_oui) { case MII_OUI_BROADCOM: break; @@ -935,7 +968,7 @@ brgphy_reset(struct mii_softc *sc) } else if (bce_sc) { if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5708 && - BCE_CHIP_BOND_ID(bce_sc) & BCE_CHIP_BOND_ID_SERDES_BIT) { + (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) { /* Store autoneg capabilities/results in digital block (Page 0) */ PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG3_PG2); @@ -983,6 +1016,13 @@ brgphy_reset(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); } + } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { + if ((BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Ax) || + (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) + brgphy_fixup_disable_early_dac(sc); + + brgphy_jumbo_settings(sc, ifp->if_mtu); + brgphy_ethernet_wirespeed(sc); } else { brgphy_fixup_ber_bug(sc); brgphy_jumbo_settings(sc, ifp->if_mtu); Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Tue Jun 2 22:52:58 2009 (r193357) +++ stable/7/sys/dev/mii/miidevs Tue Jun 2 23:30:02 2009 (r193358) @@ -146,7 +146,9 @@ model xxBROADCOM BCM5708C 0x0036 BCM5708 model xxBROADCOM_ALT1 BCM5755 0x000c BCM5755 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5787 0x000e BCM5787 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5708S 0x0015 BCM5708S 1000/2500BaseSX PHY +model xxBROADCOM_ALT1 BCM5709CAX 0x002c BCM5709C(AX) 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5722 0x002d BCM5722 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ From edwin at FreeBSD.org Wed Jun 3 08:05:54 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Wed Jun 3 08:06:07 2009 Subject: svn commit: r193367 - stable/7/share/zoneinfo Message-ID: <200906030805.n5385rE5042763@svn.freebsd.org> Author: edwin Date: Wed Jun 3 08:05:53 2009 New Revision: 193367 URL: http://svn.freebsd.org/changeset/base/193367 Log: MFC of tzdata2009h: - Fix coordinates of Africa/Gaborone, Pacific/Noumea, Pacific/Tongatapu, Europe/Vatican - Fix URLs (=3D -> = etc) - Jordan doesn't go at last Friday of March 00:00 but no last Thursday of March 24:00 - Specifically state license for the data: public domain Modified: stable/7/share/zoneinfo/ (props changed) stable/7/share/zoneinfo/africa stable/7/share/zoneinfo/antarctica stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/australasia stable/7/share/zoneinfo/backward stable/7/share/zoneinfo/etcetera stable/7/share/zoneinfo/europe stable/7/share/zoneinfo/factory stable/7/share/zoneinfo/leapseconds stable/7/share/zoneinfo/northamerica stable/7/share/zoneinfo/southamerica stable/7/share/zoneinfo/systemv stable/7/share/zoneinfo/zone.tab Modified: stable/7/share/zoneinfo/africa ============================================================================== --- stable/7/share/zoneinfo/africa Wed Jun 3 04:10:22 2009 (r193366) +++ stable/7/share/zoneinfo/africa Wed Jun 3 08:05:53 2009 (r193367) @@ -1,5 +1,7 @@ -# @(#)africa 8.19 #
+# @(#)africa	8.21
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -241,18 +243,18 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 # The following appeared in Red Hat bugzilla[1] (edited):
 #
 # > $ zdump -v /usr/share/zoneinfo/Africa/Cairo | grep 2009
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 21:59:59 2009 UTC =3D Thu =
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 21:59:59 2009 UTC = Thu =
 # Apr 23
-# > 23:59:59 2009 EET isdst=3D0 gmtoff=3D7200
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 22:00:00 2009 UTC =3D Fri =
+# > 23:59:59 2009 EET isdst=0 gmtoff=7200
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 22:00:00 2009 UTC = Fri =
 # Apr 24
-# > 01:00:00 2009 EEST isdst=3D1 gmtoff=3D10800
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 20:59:59 2009 UTC =3D Thu =
+# > 01:00:00 2009 EEST isdst=1 gmtoff=10800
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 20:59:59 2009 UTC = Thu =
 # Aug 27
-# > 23:59:59 2009 EEST isdst=3D1 gmtoff=3D10800
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 21:00:00 2009 UTC =3D Thu =
+# > 23:59:59 2009 EEST isdst=1 gmtoff=10800
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 21:00:00 2009 UTC = Thu =
 # Aug 27
-# > 23:00:00 2009 EET isdst=3D0 gmtoff=3D7200
+# > 23:00:00 2009 EET isdst=0 gmtoff=7200
 #
 # > end date should be Thu Sep 24 2009 (Last Thursday in September at 23:59=
 # :59)
@@ -260,11 +262,11 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 #
 # timeanddate[2] and another site I've found[3] also support that.
 #
-# [1] 
-# https://bugzilla.redhat.com/show_bug.cgi?id=3D492263
+# [1] 
+# https://bugzilla.redhat.com/show_bug.cgi?id=492263
 # 
-# [2] 
-# http://www.timeanddate.com/worldclock/clockchange.html?n=3D53
+# [2] 
+# http://www.timeanddate.com/worldclock/clockchange.html?n=53
 # 
 # [3] 
 # http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
@@ -477,8 +479,8 @@ Zone Africa/Nouakchott	-1:03:48 -	LMT	19
 
 # From Riad M. Hossen Ally (2008-08-03):
 # The Government of Mauritius weblink
-# 
-# http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=3D4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD
+# 
+# http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD
 # 
 # Cabinet Decision of July 18th, 2008 states as follows:
 #

Modified: stable/7/share/zoneinfo/antarctica
==============================================================================
--- stable/7/share/zoneinfo/antarctica	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/antarctica	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,5 +1,7 @@
-# @(#)antarctica	8.4
 # 
+# @(#)antarctica	8.5
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # From Paul Eggert (1999-11-15):
 # To keep things manageable, we list only locations occupied year-round; see

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/asia	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,5 +1,7 @@
-# @(#)asia	8.30
 # 
+# @(#)asia	8.32
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -1107,7 +1109,7 @@ Rule	Jordan	1995	1998	-	Sep	Fri>=15	0:00
 Rule	Jordan	1999	only	-	Jul	 1	0:00s	1:00	S
 Rule	Jordan	1999	2002	-	Sep	lastFri	0:00s	0	-
 Rule	Jordan	2000	2001	-	Mar	lastThu	0:00s	1:00	S
-Rule	Jordan	2002	max	-	Mar	lastFri	0:00s	1:00	S
+Rule	Jordan	2002	max	-	Mar	lastThu	24:00	1:00	S
 Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
 Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
 Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-

Modified: stable/7/share/zoneinfo/australasia
==============================================================================
--- stable/7/share/zoneinfo/australasia	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/australasia	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,5 +1,7 @@
-# @(#)australasia	8.9
 # 
+# @(#)australasia	8.11
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # This file also includes Pacific islands.
 
@@ -1119,6 +1121,27 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # From Paul Eggert (2007-07-23):
 # See "southeast Australia" above for 2008 and later.
 
+# From Steffen Thorsen (2009-04-28):
+# According to the official press release, South Australia's extended daylight 
+# saving period will continue with the same rules as used during the 2008-2009 
+# summer (southern hemisphere).
+# 
+# From
+# 
+# http://www.safework.sa.gov.au/uploaded_files/DaylightDatesSet.pdf
+# 
+# The extended daylight saving period that South Australia has been trialling 
+# for over the last year is now set to be ongoing.
+# Daylight saving will continue to start on the first Sunday in October each 
+# year and finish on the first Sunday in April the following year.
+# Industrial Relations Minister, Paul Caica, says this provides South Australia 
+# with a consistent half hour time difference with NSW, Victoria, Tasmania and 
+# the ACT for all 52 weeks of the year...
+# 
+# We have a wrap-up here:
+# 
+# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
+# 
 ###############################################################################
 
 # New Zealand

Modified: stable/7/share/zoneinfo/backward
==============================================================================
--- stable/7/share/zoneinfo/backward	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/backward	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,4 +1,7 @@
-# @(#)backward	8.7
+# 
+# @(#)backward	8.8
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # This file provides links between current names for time zones
 # and their old names.  Many names changed in late 1993.

Modified: stable/7/share/zoneinfo/etcetera
==============================================================================
--- stable/7/share/zoneinfo/etcetera	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/etcetera	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,4 +1,7 @@
-# @(#)etcetera	8.1
+# 
+# @(#)etcetera	8.2
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # These entries are mostly present for historical reasons, so that
 # people in areas not otherwise covered by the tz files could "zic -l"

Modified: stable/7/share/zoneinfo/europe
==============================================================================
--- stable/7/share/zoneinfo/europe	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/europe	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,5 +1,7 @@
-# @(#)europe	8.20
 # 
+# @(#)europe	8.21
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to

Modified: stable/7/share/zoneinfo/factory
==============================================================================
--- stable/7/share/zoneinfo/factory	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/factory	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,4 +1,7 @@
-# @(#)factory	8.1
+# 
+# @(#)factory	8.2
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # For companies who don't want to put time zone specification in
 # their installation procedures.  When users run date, they'll get the message.

Modified: stable/7/share/zoneinfo/leapseconds
==============================================================================
--- stable/7/share/zoneinfo/leapseconds	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/leapseconds	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,4 +1,7 @@
-# @(#)leapseconds	8.6
+# 
+# @(#)leapseconds	8.8
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # Allowance for leapseconds added to each timezone file.
 

Modified: stable/7/share/zoneinfo/northamerica
==============================================================================
--- stable/7/share/zoneinfo/northamerica	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/northamerica	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,5 +1,7 @@
-# @(#)northamerica	8.27
 # 
+# @(#)northamerica	8.28
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # also includes Central America and the Caribbean
 

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/southamerica	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,5 +1,7 @@
-# @(#)southamerica	8.34
 # 
+# @(#)southamerica	8.36
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -674,8 +676,8 @@ Zone	America/La_Paz	-4:32:36 -	LMT	1890
 
 # From Rodrigo Severo (2008-06-24):
 # Just correcting the URL:
-# 
-# https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=3Ddo&secao=3D1&pagina=3D1&data=3D25/04/2008
+# 
+# https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=do&secao=1&pagina=1&data=25/04/2008
 # 
 #
 # As a result of the above Decree I believe the America/Rio_Branco

Modified: stable/7/share/zoneinfo/systemv
==============================================================================
--- stable/7/share/zoneinfo/systemv	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/systemv	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,4 +1,7 @@
-# @(#)systemv	8.1
+# 
+# @(#)systemv	8.2
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 
 # Old rules, should the need arise.
 # No attempt is made to handle Newfoundland, since it cannot be expressed

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Wed Jun  3 04:10:22 2009	(r193366)
+++ stable/7/share/zoneinfo/zone.tab	Wed Jun  3 08:05:53 2009	(r193367)
@@ -1,4 +1,7 @@
-# @(#)zone.tab	8.26
+# 
+# @(#)zone.tab	8.28
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
 #
 # TZ zone descriptions
 #
@@ -101,7 +104,7 @@ BR	-0640-06952	America/Eirunepe	W Amazon
 BR	-0958-06748	America/Rio_Branco	Acre
 BS	+2505-07721	America/Nassau
 BT	+2728+08939	Asia/Thimphu
-BW	-2545+02555	Africa/Gaborone
+BW	-2439+02555	Africa/Gaborone
 BY	+5354+02734	Europe/Minsk
 BZ	+1730-08812	America/Belize
 CA	+4734-05243	America/St_Johns	Newfoundland Time, including SE Labrador
@@ -285,7 +288,7 @@ MY	+0310+10142	Asia/Kuala_Lumpur	peninsu
 MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
 MZ	-2558+03235	Africa/Maputo
 NA	-2234+01706	Africa/Windhoek
-NC	-2216+16530	Pacific/Noumea
+NC	-2216+16627	Pacific/Noumea
 NE	+1331+00207	Africa/Niamey
 NF	-2903+16758	Pacific/Norfolk
 NG	+0627+00324	Africa/Lagos
@@ -365,7 +368,7 @@ TK	-0922-17114	Pacific/Fakaofo
 TL	-0833+12535	Asia/Dili
 TM	+3757+05823	Asia/Ashgabat
 TN	+3648+01011	Africa/Tunis
-TO	-2110+17510	Pacific/Tongatapu
+TO	-2110-17510	Pacific/Tongatapu
 TR	+4101+02858	Europe/Istanbul
 TT	+1039-06131	America/Port_of_Spain
 TV	-0831+17913	Pacific/Funafuti
@@ -409,7 +412,7 @@ US	+211825-1575130	Pacific/Honolulu	Hawa
 UY	-3453-05611	America/Montevideo
 UZ	+3940+06648	Asia/Samarkand	west Uzbekistan
 UZ	+4120+06918	Asia/Tashkent	east Uzbekistan
-VA	+4154+01227	Europe/Vatican
+VA	+415408+0122711	Europe/Vatican
 VC	+1309-06114	America/St_Vincent
 VE	+1030-06656	America/Caracas
 VG	+1827-06437	America/Tortola
From gnn at FreeBSD.org  Wed Jun  3 23:01:14 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Wed Jun  3 23:01:26 2009
Subject: svn commit: r193410 - in stable/7/sys: . dev/cxgb dev/cxgb/common
Message-ID: <200906032301.n53N1D6t069743@svn.freebsd.org>

Author: gnn
Date: Wed Jun  3 23:01:13 2009
New Revision: 193410
URL: http://svn.freebsd.org/changeset/base/193410

Log:
  MFC of 186282
  
  Check in the actual module recognition code for the Chelsio
  driver.
  
  Obtained from:	Chelsio Inc.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/cxgb/common/cxgb_ael1002.c
  stable/7/sys/dev/cxgb/cxgb_main.c

Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_ael1002.c	Wed Jun  3 22:54:27 2009	(r193409)
+++ stable/7/sys/dev/cxgb/common/cxgb_ael1002.c	Wed Jun  3 23:01:13 2009	(r193410)
@@ -75,6 +75,74 @@ struct reg_val {
 	unsigned short set_bits;
 };
 
+static int ael2005_i2c_rd(struct cphy *phy, int dev_addr, int word_addr);
+
+static int get_module_type (struct cphy *phy, int hint)
+{
+	int v;
+
+	v = hint ? hint : ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0);
+	if (v < 0)
+		return v;
+
+	if (v == 0x3) {
+		/* SFP: see SFF-8472 for below */
+		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3);
+		if (v < 0)
+			return v;
+
+		if (v == 0x1)
+			return phy_modtype_twinax;
+		if (v == 0x10)
+			return phy_modtype_sr;
+		if (v == 0x20)
+			return phy_modtype_lr;
+		if (v == 0x40)
+			return phy_modtype_lrm;
+
+		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 6);
+		if (v < 0)
+			return v;
+		if (v != 4)
+			return phy_modtype_unknown;
+
+		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 10);
+		if (v < 0)
+			return v;
+
+		if (v & 0x80) {
+			v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0x12);
+			if (v < 0)
+				return v;
+			return v > 10 ? phy_modtype_twinax_long :
+			    phy_modtype_twinax;
+		}
+	} else if (v == 0x6) {
+		/* XFP: See INF-8077i for details. */
+
+		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 127);
+		if (v < 0)
+			return v;
+
+		if (v != 1) {
+			/* XXX: set page select to table 1 yourself */
+			return phy_modtype_unknown;
+		}
+
+		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 131);
+		if (v < 0)
+			return v;
+		if (v == 0x10)
+			return phy_modtype_lrm;
+		if (v == 0x40)
+			return phy_modtype_lr;
+		if (v == 0x80)
+			return phy_modtype_sr;
+	}
+
+	return phy_modtype_unknown;
+}
+
 static int set_phy_regs(struct cphy *phy, const struct reg_val *rv)
 {
 	int err;
@@ -111,6 +179,18 @@ static int ael1002_power_down(struct cph
 	return err;
 }
 
+static int ael1002_get_module_type(struct cphy *phy, int delay_ms)
+{
+	int v;
+
+	if (delay_ms)
+		msleep(delay_ms);
+
+	v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0);
+
+	return v == -ETIMEDOUT ? phy_modtype_none : get_module_type(phy, v);
+}
+
 static int ael1002_reset(struct cphy *phy, int wait)
 {
 	int err;
@@ -123,6 +203,11 @@ static int ael1002_reset(struct cphy *ph
 	    (err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, AEL1002_LB_EN,
 				       0, 1 << 5)))
 		return err;
+
+	err = ael1002_get_module_type(phy, 300);
+	if (err >= 0)
+		phy->modtype = err;
+
 	return 0;
 }
 
@@ -186,10 +271,17 @@ static struct cphy_ops ael1002_ops = {
 int t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
 			const struct mdio_ops *mdio_ops)
 {
+	int err;
+
 	cphy_init(phy, adapter, phy_addr, &ael1002_ops, mdio_ops,
 		  SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE,
 		  "10GBASE-R");
 	ael100x_txon(phy);
+
+	err = ael1002_get_module_type(phy, 0);
+	if (err >= 0)
+		phy->modtype = err;
+
 	return 0;
 }
 
@@ -987,7 +1079,7 @@ static int ael2005_i2c_rd(struct cphy *p
 	return -ETIMEDOUT;
 }
 
-static int get_module_type(struct cphy *phy, int delay_ms)
+static int ael2005_get_module_type(struct cphy *phy, int delay_ms)
 {
 	int v;
 	unsigned int stat;
@@ -1002,36 +1094,8 @@ static int get_module_type(struct cphy *
 	if (delay_ms)
 		msleep(delay_ms);
 
-	/* see SFF-8472 for below */
-	v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3);
-	if (v < 0)
-		return v;
-
-	if (v == 0x10)
-		return phy_modtype_sr;
-	if (v == 0x20)
-		return phy_modtype_lr;
-	if (v == 0x40)
-		return phy_modtype_lrm;
-
-	v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 6);
-	if (v < 0)
-		return v;
-	if (v != 4)
-		goto unknown;
-
-	v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 10);
-	if (v < 0)
-		return v;
+	return get_module_type(phy, 0);
 
-	if (v & 0x80) {
-		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0x12);
-		if (v < 0)
-			return v;
-		return v > 10 ? phy_modtype_twinax_long : phy_modtype_twinax;
-	}
-unknown:
-	return phy_modtype_unknown;
 }
 
 static int ael2005_intr_enable(struct cphy *phy)
@@ -1088,7 +1152,7 @@ static int ael2005_reset(struct cphy *ph
 
 	msleep(50);
 
-	err = get_module_type(phy, 0);
+	err = ael2005_get_module_type(phy, 0);
 	if (err < 0)
 		return err;
 	phy->modtype = (u8)err;
@@ -1126,7 +1190,7 @@ static int ael2005_intr_handler(struct c
 			return ret;
 
 		/* modules have max 300 ms init time after hot plug */
-		ret = get_module_type(phy, 300);
+		ret = ael2005_get_module_type(phy, 300);
 		if (ret < 0)
 			return ret;
 
@@ -1180,10 +1244,16 @@ static struct cphy_ops ael2005_ops = {
 int t3_ael2005_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
 			const struct mdio_ops *mdio_ops)
 {
+	int err;
 	cphy_init(phy, adapter, phy_addr, &ael2005_ops, mdio_ops,
 		  SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE |
 		  SUPPORTED_IRQ, "10GBASE-R");
 	msleep(125);
+
+	err = ael2005_get_module_type(phy, 0);
+	if (err >= 0)
+		phy->modtype = err;
+
 	return t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, AEL_OPT_SETTINGS, 0,
 				   1 << 5);
 }

Modified: stable/7/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_main.c	Wed Jun  3 22:54:27 2009	(r193409)
+++ stable/7/sys/dev/cxgb/cxgb_main.c	Wed Jun  3 23:01:13 2009	(r193410)
@@ -98,6 +98,7 @@ static void cxgb_stop_locked(struct port
 static void cxgb_set_rxmode(struct port_info *);
 static int cxgb_ioctl(struct ifnet *, unsigned long, caddr_t);
 static int cxgb_media_change(struct ifnet *);
+static int cxgb_ifm_type(int);
 static void cxgb_media_status(struct ifnet *, struct ifmediareq *);
 static int setup_sge_qsets(adapter_t *);
 static void cxgb_async_intr(void *);
@@ -1011,7 +1012,7 @@ cxgb_port_attach(device_t dev)
 	} else if (!strcmp(p->phy.desc, "10GBASE-SR")) {
 		media_flags = IFM_ETHER | IFM_10G_SR | IFM_FDX;
 	} else if (!strcmp(p->phy.desc, "10GBASE-R")) {
-		media_flags = IFM_ETHER | IFM_10G_LR | IFM_FDX;
+		media_flags = cxgb_ifm_type(p->phy.modtype);
 	} else if (!strcmp(p->phy.desc, "10/100/1000BASE-T")) {
 		ifmedia_add(&p->media, IFM_ETHER | IFM_10_T, 0, NULL);
 		ifmedia_add(&p->media, IFM_ETHER | IFM_10_T | IFM_FDX,
@@ -1027,6 +1028,9 @@ cxgb_port_attach(device_t dev)
 		/*
 		 * XXX: This is not very accurate.  Fix when common code
 		 * returns more specific value - eg 1000BASE-SX, LX, etc.
+		 *
+		 * XXX: In the meantime, don't lie. Consider setting IFM_AUTO
+		 * instead of SX.
 		 */
 		media_flags = IFM_ETHER | IFM_1000_SX | IFM_FDX;
 	} else {
@@ -1034,7 +1038,13 @@ cxgb_port_attach(device_t dev)
 		return (ENXIO);
 	}
 	if (media_flags) {
-		ifmedia_add(&p->media, media_flags, 0, NULL);
+		/*
+		 * Note the modtype on which we based our flags.  If modtype
+		 * changes, we'll redo the ifmedia for this ifp.  modtype may
+		 * change when transceivers are plugged in/out, and in other
+		 * situations.
+		 */
+		ifmedia_add(&p->media, media_flags, p->phy.modtype, NULL);
 		ifmedia_set(&p->media, media_flags);
 	} else {
 		ifmedia_add(&p->media, IFM_ETHER | IFM_AUTO, 0, NULL);
@@ -1875,7 +1885,7 @@ cxgb_init_locked(struct port_info *p)
 	cxgb_link_start(p);
 	t3_link_changed(sc, p->port_id);
 #endif
-	ifp->if_baudrate = p->link_config.speed * 1000000;
+	ifp->if_baudrate = IF_Mbps(p->link_config.speed);
 
 	device_printf(sc->dev, "enabling interrupts on port=%d\n", p->port_id);
 	t3_port_intr_enable(sc, p->port_id);
@@ -2033,7 +2043,9 @@ cxgb_ioctl(struct ifnet *ifp, unsigned l
 		break;
 	case SIOCSIFMEDIA:
 	case SIOCGIFMEDIA:
+		PORT_LOCK(p);
 		error = ifmedia_ioctl(ifp, ifr, &p->media, command);
+		PORT_UNLOCK(p);
 		break;
 	case SIOCSIFCAP:
 		PORT_LOCK(p);
@@ -2107,10 +2119,64 @@ cxgb_media_change(struct ifnet *ifp)
 	return (ENXIO);
 }
 
+/*
+ * Translates from phy->modtype to IFM_TYPE.
+ */
+static int
+cxgb_ifm_type(int phymod)
+{
+	int rc = IFM_ETHER | IFM_FDX;
+
+	switch (phymod) {
+	case phy_modtype_sr:
+		rc |= IFM_10G_SR;
+		break;
+	case phy_modtype_lr:
+		rc |= IFM_10G_LR;
+		break;
+	case phy_modtype_lrm:
+#ifdef IFM_10G_LRM
+		rc |= IFM_10G_LRM;
+#endif
+		break;
+	case phy_modtype_twinax:
+#ifdef IFM_10G_TWINAX
+		rc |= IFM_10G_TWINAX;
+#endif
+		break;
+	case phy_modtype_twinax_long:
+#ifdef IFM_10G_TWINAX_LONG
+		rc |= IFM_10G_TWINAX_LONG;
+#endif
+		break;
+	case phy_modtype_none:
+		rc = IFM_ETHER | IFM_NONE;
+		break;
+	case phy_modtype_unknown:
+		break;
+	}
+
+	return (rc);
+}
+
 static void
 cxgb_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
 {
 	struct port_info *p = ifp->if_softc;
+	struct ifmedia_entry *cur = p->media.ifm_cur;
+	int m;
+
+	if (cur->ifm_data != p->phy.modtype) { 
+		/* p->media about to be rebuilt, must hold lock */
+		PORT_LOCK_ASSERT_OWNED(p);
+
+		m = cxgb_ifm_type(p->phy.modtype);
+		ifmedia_removeall(&p->media);
+		ifmedia_add(&p->media, m, p->phy.modtype, NULL); 
+		ifmedia_set(&p->media, m);
+		cur = p->media.ifm_cur; /* ifmedia_set modified ifm_cur */
+		ifmr->ifm_current = m;
+	}
 
 	ifmr->ifm_status = IFM_AVALID;
 	ifmr->ifm_active = IFM_ETHER;
@@ -2130,6 +2196,9 @@ cxgb_media_status(struct ifnet *ifp, str
 	case 1000:
 		ifmr->ifm_active |= IFM_1000_T;
 		break;
+	case 10000:
+		ifmr->ifm_active |= IFM_SUBTYPE(cur->ifm_media);
+		break;
 	}
 	
 	if (p->link_config.duplex)
@@ -2181,7 +2250,7 @@ check_link_status(adapter_t *sc)
 
 		if (!(p->phy.caps & SUPPORTED_IRQ)) 
 			t3_link_changed(sc, i);
-		p->ifp->if_baudrate = p->link_config.speed * 1000000;
+		p->ifp->if_baudrate = IF_Mbps(p->link_config.speed);
 	}
 }
 
From kib at FreeBSD.org  Thu Jun  4 15:10:30 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Thu Jun  4 15:10:37 2009
Subject: svn commit: r193438 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
Message-ID: <200906041510.n54FAT8i095611@svn.freebsd.org>

Author: kib
Date: Thu Jun  4 15:10:29 2009
New Revision: 193438
URL: http://svn.freebsd.org/changeset/base/193438

Log:
  MFC r192094:
  Do not advance req->oldidx when sysctl_old_user returning an
  error due to copyout failure or short buffer.
  
  MFC r192144:
  Revert r192094. The revision caused problems for sysctl(3) consumers
  that expect that oldlen is filled with required buffer length even when
  supplied buffer is too short and returned error is ENOMEM.
  
  Redo the fix for kern.proc.filedesc, by reverting the req->oldidx when
  remaining buffer space is too short for the current kinfo_file structure.
  Also, only ignore ENOMEM. We have to convert ENOMEM to no error condition
  to keep existing interface for the sysctl, though.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/kern_descrip.c

Modified: stable/7/sys/kern/kern_descrip.c
==============================================================================
--- stable/7/sys/kern/kern_descrip.c	Thu Jun  4 14:49:27 2009	(r193437)
+++ stable/7/sys/kern/kern_descrip.c	Thu Jun  4 15:10:29 2009	(r193438)
@@ -2866,6 +2866,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER
 	struct file *fp;
 	struct proc *p;
 	int vfslocked;
+	size_t oldidx;
 
 	name = (int *)arg1;
 	if ((p = pfind((pid_t)name[0])) == NULL)
@@ -3032,14 +3033,26 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER
 		    strlen(kif->kf_path) + 1;
 		kif->kf_structsize = roundup(kif->kf_structsize,
 		    sizeof(uint64_t));
+		oldidx = req->oldidx;
 		error = SYSCTL_OUT(req, kif, kif->kf_structsize);
-		if (error)
+		if (error) {
+			if (error == ENOMEM) {
+				/*
+				 * The hack to keep the ABI of sysctl
+				 * kern.proc.filedesc intact, but not
+				 * to account a partially copied
+				 * kinfo_file into the oldidx.
+				 */
+				req->oldidx = oldidx;
+				error = 0;
+			}
 			break;
+		}
 	}
 	FILEDESC_SUNLOCK(fdp);
 	fddrop(fdp);
 	free(kif, M_TEMP);
-	return (0);
+	return (error);
 }
 
 static SYSCTL_NODE(_kern_proc, KERN_PROC_FILEDESC, filedesc, CTLFLAG_RD,
From brueffer at FreeBSD.org  Thu Jun  4 17:55:43 2009
From: brueffer at FreeBSD.org (Christian Brueffer)
Date: Thu Jun  4 17:55:55 2009
Subject: svn commit: r193444 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/iir
Message-ID: <200906041755.n54HthMl099252@svn.freebsd.org>

Author: brueffer
Date: Thu Jun  4 17:55:42 2009
New Revision: 193444
URL: http://svn.freebsd.org/changeset/base/193444

Log:
  MFC: r192097
  
  Compare the correct variable against NULL.
  
  Reviewed by:	scottl
  Found with:	Coverity Prevent(tm)
  CID:		821

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/iir/iir_pci.c

Modified: stable/7/sys/dev/iir/iir_pci.c
==============================================================================
--- stable/7/sys/dev/iir/iir_pci.c	Thu Jun  4 17:12:50 2009	(r193443)
+++ stable/7/sys/dev/iir/iir_pci.c	Thu Jun  4 17:55:42 2009	(r193444)
@@ -202,7 +202,7 @@ iir_pci_attach(device_t dev)
     rid = 0;
     irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
                                  RF_ACTIVE | RF_SHAREABLE);
-    if (io == NULL) {
+    if (irq == NULL) {
         device_printf(dev, "can't find IRQ value\n");
         error = ENOMEM;
         goto err;
From edwin at FreeBSD.org  Fri Jun  5 11:55:35 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Fri Jun  5 11:55:52 2009
Subject: svn commit: r193493 - stable/7/games/fortune/datfiles
Message-ID: <200906051155.n55BtWqS024658@svn.freebsd.org>

Author: edwin
Date: Fri Jun  5 11:55:32 2009
New Revision: 193493
URL: http://svn.freebsd.org/changeset/base/193493

Log:
  MFC of r179459 and r187110:
  
  Remove a quote about the instant-workstation, this port
  has been removed ages ago.
  
  netcat is "now" in base, so point people at nc(1) instead of the port.
  
  PR:		docs/124166

Modified:
  stable/7/games/fortune/datfiles/freebsd-tips   (contents, props changed)

Modified: stable/7/games/fortune/datfiles/freebsd-tips
==============================================================================
--- stable/7/games/fortune/datfiles/freebsd-tips	Fri Jun  5 09:46:00 2009	(r193492)
+++ stable/7/games/fortune/datfiles/freebsd-tips	Fri Jun  5 11:55:32 2009	(r193493)
@@ -215,8 +215,8 @@ Over quota?  "du -s * | sort -n " will g
 directory sizes.
 		-- David Scheidt 
 %
-ports/net/netcat port is useful not only for redirecting input/output
-to TCP or UDP connections, but also for proxying them with inetd(8).
+nc(1) (or netcat) is useful not only for redirecting input/output to
+TCP or UDP connections, but also for proxying them with inetd(8).
 %
 sh (the default Bourne shell in FreeBSD) supports command-line editing.  Just
 ``set -o emacs'' or ``set -o vi'' to enable it.
@@ -402,16 +402,6 @@ install it by doing
 as root.  This will install a collection of packages that is appropriate for
 running a "generic" server.
 %
-You can get a good standard workstation install by using the
-instant-workstation port/package.  If you have ports installed, you can
-install it by doing
-
-	# cd /usr/ports/misc/instant-workstation
-	# make install && make clean
-
-as root.  This will install a collection of packages that is convenient to
-have on a workstation.
-%
 You can install extra packages for FreeBSD by using the ports system.
 If you have installed it, you can download, compile, and install software by
 just typing
From kmacy at FreeBSD.org  Fri Jun  5 12:00:59 2009
From: kmacy at FreeBSD.org (Kip Macy)
Date: Fri Jun  5 12:01:16 2009
Subject: svn commit: r193494 - in stable/7/sys/boot: . i386 i386/loader
Message-ID: <200906051200.n55C0tRj024830@svn.freebsd.org>

Author: kmacy
Date: Fri Jun  5 12:00:55 2009
New Revision: 193494
URL: http://svn.freebsd.org/changeset/base/193494

Log:
  roll zfs loader support under MK_ZFS to enable / disable consistently

Modified:
  stable/7/sys/boot/Makefile
  stable/7/sys/boot/i386/Makefile
  stable/7/sys/boot/i386/loader/Makefile

Modified: stable/7/sys/boot/Makefile
==============================================================================
--- stable/7/sys/boot/Makefile	Fri Jun  5 11:55:32 2009	(r193493)
+++ stable/7/sys/boot/Makefile	Fri Jun  5 12:00:55 2009	(r193494)
@@ -17,7 +17,7 @@ SUBDIR+=		efi
 SUBDIR+=		ofw
 .endif
 
-.if defined(LOADER_ZFS_SUPPORT)
+.if ${MK_ZFS} != "no"
 SUBDIR+=		zfs
 .endif
 

Modified: stable/7/sys/boot/i386/Makefile
==============================================================================
--- stable/7/sys/boot/i386/Makefile	Fri Jun  5 11:55:32 2009	(r193493)
+++ stable/7/sys/boot/i386/Makefile	Fri Jun  5 12:00:55 2009	(r193494)
@@ -3,7 +3,7 @@
 SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \
 		kgzldr libi386 libfirewire loader
 
-.if defined(LOADER_ZFS_SUPPORT)
+.if ${MK_ZFS} != "no"
 SUBDIR+=		zfsboot gptzfsboot
 .endif
 

Modified: stable/7/sys/boot/i386/loader/Makefile
==============================================================================
--- stable/7/sys/boot/i386/loader/Makefile	Fri Jun  5 11:55:32 2009	(r193493)
+++ stable/7/sys/boot/i386/loader/Makefile	Fri Jun  5 12:00:55 2009	(r193494)
@@ -15,8 +15,7 @@ CFLAGS+=	-DLOADER_FIREWIRE_SUPPORT
 LIBFIREWIRE=	${.OBJDIR}/../libfirewire/libfirewire.a
 .endif
 
-# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support
-.if defined(LOADER_ZFS_SUPPORT)
+.if ${MK_ZFS} != "no"
 CFLAGS+=	-DLOADER_ZFS_SUPPORT
 LIBZFS=		${.OBJDIR}/../../zfs/libzfsboot.a
 .endif
From kmacy at FreeBSD.org  Fri Jun  5 12:14:44 2009
From: kmacy at FreeBSD.org (Kip Macy)
Date: Fri Jun  5 12:15:01 2009
Subject: svn commit: r193495 - in stable/7/sys/boot: . i386 i386/loader
Message-ID: <200906051214.n55CEhgJ025118@svn.freebsd.org>

Author: kmacy
Date: Fri Jun  5 12:14:43 2009
New Revision: 193495
URL: http://svn.freebsd.org/changeset/base/193495

Log:
  reverse previous commit ...

Modified:
  stable/7/sys/boot/Makefile
  stable/7/sys/boot/i386/Makefile
  stable/7/sys/boot/i386/loader/Makefile

Modified: stable/7/sys/boot/Makefile
==============================================================================
--- stable/7/sys/boot/Makefile	Fri Jun  5 12:00:55 2009	(r193494)
+++ stable/7/sys/boot/Makefile	Fri Jun  5 12:14:43 2009	(r193495)
@@ -17,7 +17,7 @@ SUBDIR+=		efi
 SUBDIR+=		ofw
 .endif
 
-.if ${MK_ZFS} != "no"
+.if defined(LOADER_ZFS_SUPPORT)
 SUBDIR+=		zfs
 .endif
 

Modified: stable/7/sys/boot/i386/Makefile
==============================================================================
--- stable/7/sys/boot/i386/Makefile	Fri Jun  5 12:00:55 2009	(r193494)
+++ stable/7/sys/boot/i386/Makefile	Fri Jun  5 12:14:43 2009	(r193495)
@@ -3,7 +3,7 @@
 SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \
 		kgzldr libi386 libfirewire loader
 
-.if ${MK_ZFS} != "no"
+.if defined(LOADER_ZFS_SUPPORT)
 SUBDIR+=		zfsboot gptzfsboot
 .endif
 

Modified: stable/7/sys/boot/i386/loader/Makefile
==============================================================================
--- stable/7/sys/boot/i386/loader/Makefile	Fri Jun  5 12:00:55 2009	(r193494)
+++ stable/7/sys/boot/i386/loader/Makefile	Fri Jun  5 12:14:43 2009	(r193495)
@@ -15,7 +15,8 @@ CFLAGS+=	-DLOADER_FIREWIRE_SUPPORT
 LIBFIREWIRE=	${.OBJDIR}/../libfirewire/libfirewire.a
 .endif
 
-.if ${MK_ZFS} != "no"
+# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support
+.if defined(LOADER_ZFS_SUPPORT)
 CFLAGS+=	-DLOADER_ZFS_SUPPORT
 LIBZFS=		${.OBJDIR}/../../zfs/libzfsboot.a
 .endif
From gnn at FreeBSD.org  Fri Jun  5 15:57:08 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Fri Jun  5 15:57:14 2009
Subject: svn commit: r193515 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb
Message-ID: <200906051557.n55Fv7ct030518@svn.freebsd.org>

Author: gnn
Date: Fri Jun  5 15:57:07 2009
New Revision: 193515
URL: http://svn.freebsd.org/changeset/base/193515

Log:
  MFC of 185506 and 185508
  
  Proper fix for tracking ifnet statistics
  
  Update internal mac stats every time the tick task is called
  if we don't do this "netstat -w 1" will frequently see negative
  differences in packets sent

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/cxgb/cxgb_main.c

Modified: stable/7/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_main.c	Fri Jun  5 15:32:41 2009	(r193514)
+++ stable/7/sys/dev/cxgb/cxgb_main.c	Fri Jun  5 15:57:07 2009	(r193515)
@@ -2305,7 +2305,7 @@ cxgb_tick(void *arg)
 	if(sc->flags & CXGB_SHUTDOWN)
 		return;
 
-	taskqueue_enqueue(sc->tq, &sc->tick_task);
+	taskqueue_enqueue(sc->tq, &sc->tick_task);	
 	callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
 }
 
@@ -2323,6 +2323,7 @@ cxgb_tick_handler(void *arg, int count)
 	if (p->linkpoll_period)
 		check_link_status(sc);
 
+	
 	sc->check_task_cnt++;
 
 	/*
@@ -2334,17 +2335,59 @@ cxgb_tick_handler(void *arg, int count)
 	if (p->rev == T3_REV_B2 && p->nports < 4 && sc->open_device_map) 
 		check_t3b2_mac(sc);
 
-	/* Update MAC stats if it's time to do so */
-	if (!p->linkpoll_period ||
-	    (sc->check_task_cnt * p->linkpoll_period) / 10 >=
-	    p->stats_update_period) {
-		for_each_port(sc, i) {
-			struct port_info *port = &sc->port[i];
-			PORT_LOCK(port);
-			t3_mac_update_stats(&port->mac);
-			PORT_UNLOCK(port);
-		}
-		sc->check_task_cnt = 0;
+	for (i = 0; i < sc->params.nports; i++) {
+		struct port_info *pi = &sc->port[i];
+		struct ifnet *ifp = pi->ifp;
+		struct mac_stats *mstats = &pi->mac.stats;
+		PORT_LOCK(pi);
+		t3_mac_update_stats(&pi->mac);
+		PORT_UNLOCK(pi);
+
+		
+		ifp->if_opackets =
+		    mstats->tx_frames_64 +
+		    mstats->tx_frames_65_127 +
+		    mstats->tx_frames_128_255 +
+		    mstats->tx_frames_256_511 +
+		    mstats->tx_frames_512_1023 +
+		    mstats->tx_frames_1024_1518 +
+		    mstats->tx_frames_1519_max;
+		
+		ifp->if_ipackets =
+		    mstats->rx_frames_64 +
+		    mstats->rx_frames_65_127 +
+		    mstats->rx_frames_128_255 +
+		    mstats->rx_frames_256_511 +
+		    mstats->rx_frames_512_1023 +
+		    mstats->rx_frames_1024_1518 +
+		    mstats->rx_frames_1519_max;
+
+		ifp->if_obytes = mstats->tx_octets;
+		ifp->if_ibytes = mstats->rx_octets;
+		ifp->if_omcasts = mstats->tx_mcast_frames;
+		ifp->if_imcasts = mstats->rx_mcast_frames;
+		
+		ifp->if_collisions =
+		    mstats->tx_total_collisions;
+
+		ifp->if_iqdrops = mstats->rx_cong_drops;
+		
+		ifp->if_oerrors =
+		    mstats->tx_excess_collisions +
+		    mstats->tx_underrun +
+		    mstats->tx_len_errs +
+		    mstats->tx_mac_internal_errs +
+		    mstats->tx_excess_deferral +
+		    mstats->tx_fcs_errs;
+		ifp->if_ierrors =
+		    mstats->rx_jabber +
+		    mstats->rx_data_errs +
+		    mstats->rx_sequence_errs +
+		    mstats->rx_runt + 
+		    mstats->rx_too_long +
+		    mstats->rx_mac_internal_errs +
+		    mstats->rx_short +
+		    mstats->rx_fcs_errs;
 	}
 }
 
From gnn at FreeBSD.org  Fri Jun  5 17:06:30 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Fri Jun  5 17:06:54 2009
Subject: svn commit: r193523 - in stable/7/sys: . contrib/pf dev/cxgb
Message-ID: <200906051706.n55H6Rvb032201@svn.freebsd.org>

Author: gnn
Date: Fri Jun  5 17:06:27 2009
New Revision: 193523
URL: http://svn.freebsd.org/changeset/base/193523

Log:
  MFC 185655
  
  Re submit code to print the part and serial number for Chelsio cards.
  The original code was accidentally removed in another commit.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
From gnn at FreeBSD.org  Fri Jun  5 22:23:34 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Fri Jun  5 22:23:42 2009
Subject: svn commit: r193539 - in stable/7/sys: . conf contrib/pf
	dev/ath/ath_hal dev/cxgb dev/cxgb/common modules/cxgb/cxgb_t3fw
Message-ID: <200906052223.n55MNYUu039895@svn.freebsd.org>

Author: gnn
Date: Fri Jun  5 22:23:33 2009
New Revision: 193539
URL: http://svn.freebsd.org/changeset/base/193539

Log:
  MFC of 189643
  
  Update the Chelsio driver to the latest bits from Chelsio
  
  Firmware upgraded to 7.1.0 (from 5.0.0).
  T3C EEPROM and SRAM added; Code to update eeprom/sram fixed.
  fl_empty and rx_fifo_ovfl counters can be observed via sysctl.
  Two new cxgbtool commands to get uP logic analyzer info and uP IOQs
  Synced up with Chelsio's "common code" (as of 03/03/09)

Added:
  stable/7/sys/dev/cxgb/t3c_protocol_sram.h
     - copied unchanged from r189643, head/sys/dev/cxgb/t3c_protocol_sram.h
  stable/7/sys/dev/cxgb/t3c_tp_eeprom.h
     - copied unchanged from r189643, head/sys/dev/cxgb/t3c_tp_eeprom.h
Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/conf/kern.pre.mk
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/cxgb/common/cxgb_ael1002.c
  stable/7/sys/dev/cxgb/common/cxgb_common.h
  stable/7/sys/dev/cxgb/common/cxgb_t3_cpl.h
  stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c
  stable/7/sys/dev/cxgb/common/cxgb_xgmac.c
  stable/7/sys/dev/cxgb/cxgb_adapter.h
  stable/7/sys/dev/cxgb/cxgb_ioctl.h
  stable/7/sys/dev/cxgb/cxgb_main.c
  stable/7/sys/dev/cxgb/cxgb_sge.c
  stable/7/sys/dev/cxgb/cxgb_t3fw.c
  stable/7/sys/dev/cxgb/cxgb_t3fw.h
  stable/7/sys/modules/cxgb/cxgb_t3fw/Makefile

Modified: stable/7/sys/conf/kern.pre.mk
==============================================================================
--- stable/7/sys/conf/kern.pre.mk	Fri Jun  5 22:21:10 2009	(r193538)
+++ stable/7/sys/conf/kern.pre.mk	Fri Jun  5 22:23:33 2009	(r193539)
@@ -80,6 +80,9 @@ INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/
 # ...  and OpenSolaris
 INCLUDES+= -I$S/contrib/opensolaris/compat
 
+# ... and the same for cxgb
+INCLUDES+= -I$S/dev/cxgb
+
 .endif
 
 CFLAGS=	${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS}

Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_ael1002.c	Fri Jun  5 22:21:10 2009	(r193538)
+++ stable/7/sys/dev/cxgb/common/cxgb_ael1002.c	Fri Jun  5 22:23:33 2009	(r193539)
@@ -1,6 +1,6 @@
 /**************************************************************************
 
-Copyright (c) 2007-2008, Chelsio Inc.
+Copyright (c) 2007-2009, Chelsio Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,17 @@ enum {
 enum { edc_none, edc_sr, edc_twinax };
 
 /* PHY module I2C device address */
-#define MODULE_DEV_ADDR 0xa0
+enum {
+	MODULE_DEV_ADDR	= 0xa0,
+	SFF_DEV_ADDR	= 0xa2,
+};
+
+/* PHY transceiver type */
+enum {
+	phy_transtype_unknown = 0,
+	phy_transtype_sfp     = 3,
+	phy_transtype_xfp     = 6,
+};		
 
 #define AEL2005_MODDET_IRQ 4
 
@@ -75,73 +85,7 @@ struct reg_val {
 	unsigned short set_bits;
 };
 
-static int ael2005_i2c_rd(struct cphy *phy, int dev_addr, int word_addr);
-
-static int get_module_type (struct cphy *phy, int hint)
-{
-	int v;
-
-	v = hint ? hint : ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0);
-	if (v < 0)
-		return v;
-
-	if (v == 0x3) {
-		/* SFP: see SFF-8472 for below */
-		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 3);
-		if (v < 0)
-			return v;
-
-		if (v == 0x1)
-			return phy_modtype_twinax;
-		if (v == 0x10)
-			return phy_modtype_sr;
-		if (v == 0x20)
-			return phy_modtype_lr;
-		if (v == 0x40)
-			return phy_modtype_lrm;
-
-		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 6);
-		if (v < 0)
-			return v;
-		if (v != 4)
-			return phy_modtype_unknown;
-
-		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 10);
-		if (v < 0)
-			return v;
-
-		if (v & 0x80) {
-			v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0x12);
-			if (v < 0)
-				return v;
-			return v > 10 ? phy_modtype_twinax_long :
-			    phy_modtype_twinax;
-		}
-	} else if (v == 0x6) {
-		/* XFP: See INF-8077i for details. */
-
-		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 127);
-		if (v < 0)
-			return v;
-
-		if (v != 1) {
-			/* XXX: set page select to table 1 yourself */
-			return phy_modtype_unknown;
-		}
-
-		v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 131);
-		if (v < 0)
-			return v;
-		if (v == 0x10)
-			return phy_modtype_lrm;
-		if (v == 0x40)
-			return phy_modtype_lr;
-		if (v == 0x80)
-			return phy_modtype_sr;
-	}
-
-	return phy_modtype_unknown;
-}
+static int get_module_type(struct cphy *phy);
 
 static int set_phy_regs(struct cphy *phy, const struct reg_val *rv)
 {
@@ -168,6 +112,110 @@ static void ael100x_txon(struct cphy *ph
 	msleep(30);
 }
 
+static int ael_i2c_rd(struct cphy *phy, int dev_addr, int word_addr)
+{
+	int i, err;
+	unsigned int stat, data;
+
+	err = mdio_write(phy, MDIO_DEV_PMA_PMD, AEL_I2C_CTRL,
+			 (dev_addr << 8) | (1 << 8) | word_addr);
+	if (err)
+		return err;
+
+	for (i = 0; i < 200; i++) {
+		msleep(1);
+		err = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL_I2C_STAT, &stat);
+		if (err)
+			return err;
+		if ((stat & 3) == 1) {
+			err = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL_I2C_DATA,
+					&data);
+			if (err)
+				return err;
+			return data >> 8;
+		}
+	}
+	CH_WARN(phy->adapter, "PHY %u I2C read of addr %u timed out\n",
+		phy->addr, word_addr);
+	return -ETIMEDOUT;
+}
+
+static int ael_i2c_wr(struct cphy *phy, int dev_addr, int word_addr, int data)
+{
+	int i, err;
+	unsigned int stat;
+
+	err = mdio_write(phy, MDIO_DEV_PMA_PMD, AEL_I2C_DATA, data);
+	if (err)
+		return err;
+
+	err = mdio_write(phy, MDIO_DEV_PMA_PMD, AEL_I2C_CTRL,
+			 (dev_addr << 8) | word_addr);
+	if (err)
+		return err;
+
+	for (i = 0; i < 200; i++) {
+		msleep(1);
+		err = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL_I2C_STAT, &stat);
+		if (err)
+			return err;
+		if ((stat & 3) == 1)
+			return 0;
+	}
+	CH_WARN(phy->adapter, "PHY %u I2C Write of addr %u timed out\n",
+		phy->addr, word_addr);
+	return -ETIMEDOUT;
+}
+
+static int get_phytrans_type(struct cphy *phy)
+{
+	int v;
+
+	v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0);
+	if (v < 0)
+		return phy_transtype_unknown;
+
+	return v;
+}
+
+static int ael_laser_down(struct cphy *phy, int enable)
+{
+	int v, dev_addr;
+
+	v = get_phytrans_type(phy);
+	if (v < 0)
+		return v;
+
+	if (v == phy_transtype_sfp) {
+		/* Check SFF Soft TX disable is supported */
+		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 93);
+		if (v < 0)
+			return v;
+
+		v &= 0x40;
+		if (!v)
+			return v;
+
+		dev_addr = SFF_DEV_ADDR;	
+	} else if (v == phy_transtype_xfp)
+		dev_addr = MODULE_DEV_ADDR;
+	else
+		return v;
+
+	v = ael_i2c_rd(phy, dev_addr, 110);
+	if (v < 0)
+		return v;
+
+	if (enable)
+		v |= 0x40;
+	else
+		v &= ~0x40;
+
+	v = ael_i2c_wr(phy, dev_addr, 110, v);
+
+	return v;
+}
+
 static int ael1002_power_down(struct cphy *phy, int enable)
 {
 	int err;
@@ -186,9 +234,9 @@ static int ael1002_get_module_type(struc
 	if (delay_ms)
 		msleep(delay_ms);
 
-	v = ael2005_i2c_rd(phy, MODULE_DEV_ADDR, 0);
+	v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0);
 
-	return v == -ETIMEDOUT ? phy_modtype_none : get_module_type(phy, v);
+	return v == -ETIMEDOUT ? phy_modtype_none : get_module_type(phy);
 }
 
 static int ael1002_reset(struct cphy *phy, int wait)
@@ -277,6 +325,7 @@ int t3_ael1002_phy_prep(struct cphy *phy
 		  SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE,
 		  "10GBASE-R");
 	ael100x_txon(phy);
+	ael_laser_down(phy, 0);
 
 	err = ael1002_get_module_type(phy, 0);
 	if (err >= 0)
@@ -287,31 +336,38 @@ int t3_ael1002_phy_prep(struct cphy *phy
 
 static int ael1006_reset(struct cphy *phy, int wait)
 {
-	u32 gpio_out;
-	t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
-	/* Hack to reset the phy correctly */
-	/* Read out the current value */
-	gpio_out = t3_read_reg(phy->adapter, A_T3DBG_GPIO_EN);
-	/* Reset the phy */
-	gpio_out &= ~F_GPIO6_OUT_VAL;
-	t3_write_reg(phy->adapter, A_T3DBG_GPIO_EN, gpio_out); 
+	int err;
+
+	err = t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
+	if (err)
+		return err;
+
+	t3_set_reg_field(phy->adapter, A_T3DBG_GPIO_EN, 
+			 F_GPIO6_OUT_VAL, 0);
+
+	msleep(125);
+
+	t3_set_reg_field(phy->adapter, A_T3DBG_GPIO_EN, 
+			 F_GPIO6_OUT_VAL, F_GPIO6_OUT_VAL);
+
+	msleep(125);
+
+	err = t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
+	if (err)
+		return err;
+
 	msleep(125);
-	/* Take the phy out of reset */
-	gpio_out |= F_GPIO6_OUT_VAL;
-	t3_write_reg(phy->adapter, A_T3DBG_GPIO_EN, gpio_out);
+
+	err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 1, 1);
+	if (err)
+		return err;
+	
 	msleep(125);
-	t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
 
-       /* Phy loopback work around for ael1006 */
-       /* Soft reset phy by toggling loopback  */
-       msleep(125);
-       /* Put phy into local loopback */
-       t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 0, 1);
-       msleep(125);
-       /* Take phy out of local loopback */
-       t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 1, 0);
+	err = t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, 1, 0);
 
-	return 0;
+	return err;
+	   
 }
 
 static int ael1006_power_down(struct cphy *phy, int enable)
@@ -1051,53 +1107,71 @@ static int ael2005_setup_twinax_edc(stru
 	return err;
 }
 
-static int ael2005_i2c_rd(struct cphy *phy, int dev_addr, int word_addr)
+static int get_module_type(struct cphy *phy)
 {
-	int i, err;
-	unsigned int stat, data;
+	int v;
 
-	err = mdio_write(phy, MDIO_DEV_PMA_PMD, AEL_I2C_CTRL,
-			 (dev_addr << 8) | (1 << 8) | word_addr);
-	if (err)
-		return err;
+	v = get_phytrans_type(phy);
+	if (v == phy_transtype_sfp) {
+		/* SFP: see SFF-8472 for below */
 
-	for (i = 0; i < 5; i++) {
-		msleep(1);
-		err = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL_I2C_STAT, &stat);
-		if (err)
-			return err;
-		if ((stat & 3) == 1) {
-			err = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL_I2C_DATA,
-					&data);
-			if (err)
-				return err;
-			return data >> 8;
-		}
-	}
-	CH_WARN(phy->adapter, "PHY %u I2C read of addr %u timed out\n",
-		phy->addr, word_addr);
-	return -ETIMEDOUT;
-}
+		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 3);
+		if (v < 0)
+			return v;
 
-static int ael2005_get_module_type(struct cphy *phy, int delay_ms)
-{
-	int v;
-	unsigned int stat;
+		if (v == 0x1)
+			return phy_modtype_twinax;
+		if (v == 0x10)
+			return phy_modtype_sr;
+		if (v == 0x20)
+			return phy_modtype_lr;
+		if (v == 0x40)
+			return phy_modtype_lrm;
 
-	v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, &stat);
-	if (v)
-		return v;
+		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 6);
+		if (v < 0)
+			return v;
+		if (v != 4)
+			return phy_modtype_unknown;
 
-	if (stat & (1 << 8))			/* module absent */
-		return phy_modtype_none;
+		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 10);
+		if (v < 0)
+			return v;
 
-	if (delay_ms)
-		msleep(delay_ms);
+		if (v & 0x80) {
+			v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12);
+			if (v < 0)
+				return v;
+			return v > 10 ? phy_modtype_twinax_long :
+			    phy_modtype_twinax;
+		}
+	} else if (v == phy_transtype_xfp) {
+		/* XFP: See INF-8077i for details. */
+
+		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 127);
+		if (v < 0)
+			return v;
+
+		if (v != 1) {
+			/* XXX: set page select to table 1 yourself */
+			return phy_modtype_unknown;
+		}
 
-	return get_module_type(phy, 0);
+		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 131);
+		if (v < 0)
+			return v;
+		if (v == 0x10)
+			return phy_modtype_lrm;
+		if (v == 0x40)
+			return phy_modtype_lr;
+		if (v == 0x80)
+			return phy_modtype_sr;
+	}
 
+	return phy_modtype_unknown;
 }
 
+
 static int ael2005_intr_enable(struct cphy *phy)
 {
 	int err = mdio_write(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, 0x200);
@@ -1116,6 +1190,24 @@ static int ael2005_intr_clear(struct cph
 	return err ? err : t3_phy_lasi_intr_clear(phy);
 }
 
+static int ael2005_get_module_type(struct cphy *phy, int delay_ms)
+{
+	int v;
+	unsigned int stat;
+
+	v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, &stat);
+	if (v)
+		return v;
+
+	if (stat & (1 << 8))			/* module absent */
+		return phy_modtype_none;
+
+	if (delay_ms)
+		msleep(delay_ms);
+
+	return get_module_type(phy);
+}
+
 static int ael2005_reset(struct cphy *phy, int wait)
 {
 	static struct reg_val regs0[] = {
@@ -1211,7 +1303,13 @@ static int ael2005_intr_handler(struct c
 	}
 
 	ret = t3_phy_lasi_intr_handler(phy);
-	return ret < 0 ? ret : ret + cause;
+	if (ret < 0)
+		return ret;
+
+	ret |= cause;
+	if (!ret)
+		ret |= cphy_cause_link_change;
+	return ret;
 }
 
 #ifdef C99_NOT_SUPPORTED
@@ -1249,6 +1347,7 @@ int t3_ael2005_phy_prep(struct cphy *phy
 		  SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE |
 		  SUPPORTED_IRQ, "10GBASE-R");
 	msleep(125);
+	ael_laser_down(phy, 0);
 
 	err = ael2005_get_module_type(phy, 0);
 	if (err >= 0)
@@ -1339,7 +1438,7 @@ static int xaui_direct_get_link_status(s
 {
 	if (link_ok) {
 		unsigned int status;
-		
+
 		status = t3_read_reg(phy->adapter,
 				     XGM_REG(A_XGM_SERDES_STAT0, phy->addr)) |
 			 t3_read_reg(phy->adapter,

Modified: stable/7/sys/dev/cxgb/common/cxgb_common.h
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_common.h	Fri Jun  5 22:21:10 2009	(r193538)
+++ stable/7/sys/dev/cxgb/common/cxgb_common.h	Fri Jun  5 22:23:33 2009	(r193539)
@@ -1,6 +1,6 @@
 /**************************************************************************
 
-Copyright (c) 2007-2008, Chelsio Inc.
+Copyright (c) 2007-2009, Chelsio Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -96,12 +96,22 @@ enum {
 	    (((x) >> S_TP_VERSION_MICRO) & M_TP_VERSION_MICRO)
 
 enum {
-	FW_VERSION_MAJOR = 5,
-	FW_VERSION_MINOR = 0,
+	FW_VERSION_MAJOR = 7,
+	FW_VERSION_MINOR = 1,
 	FW_VERSION_MICRO = 0
 };
 
 enum {
+	LA_CTRL = 0x80,
+	LA_DATA = 0x84,
+	LA_ENTRIES = 512
+};
+
+enum {
+	IOQ_ENTRIES = 7
+};
+
+enum {
 	SGE_QSETS = 8,            /* # of SGE Tx/Rx/RspQ sets */
 	SGE_RXQ_PER_SET = 2,      /* # of Rx queues per set */
 	SGE_TXQ_PER_SET = 3       /* # of Tx queues per set */
@@ -147,8 +157,6 @@ struct adapter_info {
 	unsigned char          nports0;        /* # of ports on channel 0 */
 	unsigned char          nports1;        /* # of ports on channel 1 */
 	unsigned char          phy_base_addr;  /* MDIO PHY base address */
-	unsigned char          mdien:1;
-	unsigned char          mdiinv:1;
 	unsigned int           gpio_out;       /* GPIO output settings */
 	unsigned char gpio_intr[MAX_PHYINTRS]; /* GPIO PHY IRQ pins */
 	unsigned long          caps;           /* adapter capabilities */
@@ -235,6 +243,8 @@ struct mac_stats {
 
 	unsigned long num_toggled; /* # times toggled TxEn due to stuck TX */
 	unsigned long num_resets;  /* # times reset due to stuck TX */
+
+	unsigned long link_faults;  /* # detected link faults */
 };
 
 struct tp_mib_stats {
@@ -349,6 +359,14 @@ struct vpd_params {
 	unsigned short xauicfg[2];
 };
 
+struct generic_vpd {
+	u32 offset;
+	u32 len;
+	u8 *data;
+};
+
+enum { MAX_VPD_BYTES = 32000 };
+
 struct pci_params {
 	unsigned int   vpd_cap_addr;
 	unsigned int   pcie_cap_addr;
@@ -682,6 +700,8 @@ int t3_phy_lasi_intr_handler(struct cphy
 void t3_intr_enable(adapter_t *adapter);
 void t3_intr_disable(adapter_t *adapter);
 void t3_intr_clear(adapter_t *adapter);
+void t3_xgm_intr_enable(adapter_t *adapter, int idx);
+void t3_xgm_intr_disable(adapter_t *adapter, int idx);
 void t3_port_intr_enable(adapter_t *adapter, int idx);
 void t3_port_intr_disable(adapter_t *adapter, int idx);
 void t3_port_intr_clear(adapter_t *adapter, int idx);
@@ -689,29 +709,34 @@ int t3_slow_intr_handler(adapter_t *adap
 int t3_phy_intr_handler(adapter_t *adapter);
 
 void t3_link_changed(adapter_t *adapter, int port_id);
+void t3_link_fault(adapter_t *adapter, int port_id);
 int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
 const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
 int t3_seeprom_read(adapter_t *adapter, u32 addr, u32 *data);
 int t3_seeprom_write(adapter_t *adapter, u32 addr, u32 data);
 int t3_seeprom_wp(adapter_t *adapter, int enable);
+int t3_get_vpd_len(adapter_t *adapter, struct generic_vpd *vpd);
+int t3_read_vpd(adapter_t *adapter, struct generic_vpd *vpd);
 int t3_read_flash(adapter_t *adapter, unsigned int addr, unsigned int nwords,
 		  u32 *data, int byte_oriented);
 int t3_get_tp_version(adapter_t *adapter, u32 *vers);
-int t3_check_tpsram_version(adapter_t *adapter, int *must_load);
+int t3_check_tpsram_version(adapter_t *adapter);
 int t3_check_tpsram(adapter_t *adapter, const u8 *tp_ram, unsigned int size);
 int t3_load_fw(adapter_t *adapter, const u8 *fw_data, unsigned int size);
 int t3_get_fw_version(adapter_t *adapter, u32 *vers);
-int t3_check_fw_version(adapter_t *adapter, int *must_load);
+int t3_check_fw_version(adapter_t *adapter);
 int t3_load_boot(adapter_t *adapter, u8 *fw_data, unsigned int size);
 int t3_init_hw(adapter_t *adapter, u32 fw_params);
 void mac_prep(struct cmac *mac, adapter_t *adapter, int index);
 void early_hw_init(adapter_t *adapter, const struct adapter_info *ai);
+int t3_reset_adapter(adapter_t *adapter);
 int t3_prep_adapter(adapter_t *adapter, const struct adapter_info *ai, int reset);
 int t3_reinit_adapter(adapter_t *adap);
 void t3_led_ready(adapter_t *adapter);
 void t3_fatal_err(adapter_t *adapter);
 void t3_set_vlan_accel(adapter_t *adapter, unsigned int ports, int on);
 void t3_enable_filters(adapter_t *adap);
+void t3_disable_filters(adapter_t *adap);
 void t3_tp_set_offload_mode(adapter_t *adap, int enable);
 void t3_config_rss(adapter_t *adapter, unsigned int rss_config, const u8 *cpus,
 		   const u16 *rspq);
@@ -728,6 +753,8 @@ int t3_mc7_bd_read(struct mc7 *mc7, unsi
 
 int t3_mac_reset(struct cmac *mac);
 void t3b_pcs_reset(struct cmac *mac);
+void t3_mac_disable_exact_filters(struct cmac *mac);
+void t3_mac_enable_exact_filters(struct cmac *mac);
 int t3_mac_enable(struct cmac *mac, int which);
 int t3_mac_disable(struct cmac *mac, int which);
 int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu);
@@ -758,6 +785,8 @@ void t3_get_cong_cntl_tab(adapter_t *ada
 			  unsigned short incr[NMTUS][NCCTRL_WIN]);
 void t3_config_trace_filter(adapter_t *adapter, const struct trace_params *tp,
 			    int filter_index, int invert, int enable);
+void t3_query_trace_filter(adapter_t *adapter, struct trace_params *tp,
+			   int filter_index, int *inverted, int *enabled);
 int t3_config_sched(adapter_t *adap, unsigned int kbps, int sched);
 int t3_set_sched_ipg(adapter_t *adap, int sched, unsigned int ipg);
 void t3_get_tx_sched(adapter_t *adap, unsigned int sched, unsigned int *kbps,
@@ -767,6 +796,10 @@ void t3_set_pace_tbl(adapter_t *adap, un
 		     unsigned int start, unsigned int n);
 #endif
 
+int t3_get_up_la(adapter_t *adapter, u32 *stopped, u32 *index,
+		 u32 *size, void *data);
+int t3_get_up_ioqs(adapter_t *adapter, u32 *size, void *data);
+
 void t3_sge_prep(adapter_t *adap, struct sge_params *p);
 void t3_sge_init(adapter_t *adap, struct sge_params *p);
 int t3_sge_init_ecntxt(adapter_t *adapter, unsigned int id, int gts_enable,
@@ -803,6 +836,11 @@ int t3_vsc7323_enable(adapter_t *adap, i
 int t3_vsc7323_disable(adapter_t *adap, int port, int which);
 const struct mac_stats *t3_vsc7323_update_stats(struct cmac *mac);
 
+int t3_mi1_read(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr,
+		unsigned int *valp);
+int t3_mi1_write(adapter_t *adapter, int phy_addr, int mmd_addr, int reg_addr,
+		 unsigned int val);
+
 int t3_mv88e1xxx_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
 			  const struct mdio_ops *mdio_ops);
 int t3_vsc8211_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,

Modified: stable/7/sys/dev/cxgb/common/cxgb_t3_cpl.h
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_t3_cpl.h	Fri Jun  5 22:21:10 2009	(r193538)
+++ stable/7/sys/dev/cxgb/common/cxgb_t3_cpl.h	Fri Jun  5 22:23:33 2009	(r193539)
@@ -1,6 +1,6 @@
 /**************************************************************************
 
-Copyright (c) 2007, Chelsio Inc.
+Copyright (c) 2007-2009 Chelsio Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -273,6 +273,14 @@ struct work_request_hdr {
 #define V_WR_FLUSH(x)	((x) << S_WR_FLUSH)
 #define F_WR_FLUSH	V_WR_FLUSH(1U)
 
+#define S_WR_CHN	18
+#define V_WR_CHN(x)	((x) << S_WR_CHN)
+#define F_WR_CHN	V_WR_CHN(1U)
+
+#define S_WR_CHN_VLD	19
+#define V_WR_CHN_VLD(x)	((x) << S_WR_CHN_VLD)
+#define F_WR_CHN_VLD	V_WR_CHN_VLD(1U)
+
 #define S_WR_DATATYPE    20
 #define V_WR_DATATYPE(x) ((x) << S_WR_DATATYPE)
 #define F_WR_DATATYPE    V_WR_DATATYPE(1U)

Modified: stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c	Fri Jun  5 22:21:10 2009	(r193538)
+++ stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c	Fri Jun  5 22:23:33 2009	(r193539)
@@ -1,6 +1,6 @@
 /**************************************************************************
 
-Copyright (c) 2007, Chelsio Inc.
+Copyright (c) 2007-2009, Chelsio Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -197,21 +197,18 @@ int t3_mc7_bd_read(struct mc7 *mc7, unsi
 static void mi1_init(adapter_t *adap, const struct adapter_info *ai)
 {
         u32 clkdiv = adap->params.vpd.cclk / (2 * adap->params.vpd.mdc) - 1;
-        u32 val = F_PREEN | V_MDIINV(ai->mdiinv) | V_MDIEN(ai->mdien) |
-		  V_CLKDIV(clkdiv);
+        u32 val = F_PREEN | V_CLKDIV(clkdiv);
 
-	if (!(ai->caps & SUPPORTED_10000baseT_Full))
-		val |= V_ST(1);
         t3_write_reg(adap, A_MI1_CFG, val);
 }
 
 #define MDIO_ATTEMPTS 20
 
 /*
- * MI1 read/write operations for direct-addressed PHYs.
+ * MI1 read/write operations for clause 22 PHYs.
  */
-static int mi1_read(adapter_t *adapter, int phy_addr, int mmd_addr,
-		    int reg_addr, unsigned int *valp)
+int t3_mi1_read(adapter_t *adapter, int phy_addr, int mmd_addr,
+		int reg_addr, unsigned int *valp)
 {
 	int ret;
 	u32 addr = V_REGADDR(reg_addr) | V_PHYADDR(phy_addr);
@@ -220,6 +217,7 @@ static int mi1_read(adapter_t *adapter, 
 		return -EINVAL;
 
 	MDIO_LOCK(adapter);
+	t3_set_reg_field(adapter, A_MI1_CFG, V_ST(M_ST), V_ST(1));
 	t3_write_reg(adapter, A_MI1_ADDR, addr);
 	t3_write_reg(adapter, A_MI1_OP, V_MDI_OP(2));
 	ret = t3_wait_op_done(adapter, A_MI1_OP, F_BUSY, 0, MDIO_ATTEMPTS, 10);
@@ -229,8 +227,8 @@ static int mi1_read(adapter_t *adapter, 
 	return ret;
 }
 
-static int mi1_write(adapter_t *adapter, int phy_addr, int mmd_addr,
-		     int reg_addr, unsigned int val)
+int t3_mi1_write(adapter_t *adapter, int phy_addr, int mmd_addr,
+		 int reg_addr, unsigned int val)
 {
 	int ret;
 	u32 addr = V_REGADDR(reg_addr) | V_PHYADDR(phy_addr);
@@ -239,6 +237,7 @@ static int mi1_write(adapter_t *adapter,
 		return -EINVAL;
 
 	MDIO_LOCK(adapter);
+	t3_set_reg_field(adapter, A_MI1_CFG, V_ST(M_ST), V_ST(1));
 	t3_write_reg(adapter, A_MI1_ADDR, addr);
 	t3_write_reg(adapter, A_MI1_DATA, val);
 	t3_write_reg(adapter, A_MI1_OP, V_MDI_OP(1));
@@ -248,12 +247,12 @@ static int mi1_write(adapter_t *adapter,
 }
 
 static struct mdio_ops mi1_mdio_ops = {
-	mi1_read,
-	mi1_write
+	t3_mi1_read,
+	t3_mi1_write
 };
 
 /*
- * MI1 read/write operations for indirect-addressed PHYs.
+ * MI1 read/write operations for clause 45 PHYs.
  */
 static int mi1_ext_read(adapter_t *adapter, int phy_addr, int mmd_addr,
 			int reg_addr, unsigned int *valp)
@@ -262,6 +261,7 @@ static int mi1_ext_read(adapter_t *adapt
 	u32 addr = V_REGADDR(mmd_addr) | V_PHYADDR(phy_addr);
 
 	MDIO_LOCK(adapter);
+	t3_set_reg_field(adapter, A_MI1_CFG, V_ST(M_ST), 0);
 	t3_write_reg(adapter, A_MI1_ADDR, addr);
 	t3_write_reg(adapter, A_MI1_DATA, reg_addr);
 	t3_write_reg(adapter, A_MI1_OP, V_MDI_OP(0));
@@ -284,6 +284,7 @@ static int mi1_ext_write(adapter_t *adap
 	u32 addr = V_REGADDR(mmd_addr) | V_PHYADDR(phy_addr);
 
 	MDIO_LOCK(adapter);
+	t3_set_reg_field(adapter, A_MI1_CFG, V_ST(M_ST), 0);
 	t3_write_reg(adapter, A_MI1_ADDR, addr);
 	t3_write_reg(adapter, A_MI1_DATA, reg_addr);
 	t3_write_reg(adapter, A_MI1_OP, V_MDI_OP(0));
@@ -488,32 +489,32 @@ int t3_phy_lasi_intr_handler(struct cphy
 }
 
 static struct adapter_info t3_adap_info[] = {
-	{ 1, 1, 0, 0, 0,
+	{ 1, 1, 0,
 	  F_GPIO2_OEN | F_GPIO4_OEN |
 	  F_GPIO2_OUT_VAL | F_GPIO4_OUT_VAL, { S_GPIO3, S_GPIO5 }, 0,
 	  &mi1_mdio_ops, "Chelsio PE9000" },
-	{ 1, 1, 0, 0, 0,
+	{ 1, 1, 0,
 	  F_GPIO2_OEN | F_GPIO4_OEN |
 	  F_GPIO2_OUT_VAL | F_GPIO4_OUT_VAL, { S_GPIO3, S_GPIO5 }, 0,
 	  &mi1_mdio_ops, "Chelsio T302" },
-	{ 1, 0, 0, 0, 0,
+	{ 1, 0, 0,
 	  F_GPIO1_OEN | F_GPIO6_OEN | F_GPIO7_OEN | F_GPIO10_OEN |
 	  F_GPIO11_OEN | F_GPIO1_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL,
 	  { 0 }, SUPPORTED_10000baseT_Full | SUPPORTED_AUI,
 	  &mi1_mdio_ext_ops, "Chelsio T310" },
-	{ 1, 1, 0, 0, 0,
+	{ 1, 1, 0,
 	  F_GPIO1_OEN | F_GPIO2_OEN | F_GPIO4_OEN | F_GPIO5_OEN | F_GPIO6_OEN |
 	  F_GPIO7_OEN | F_GPIO10_OEN | F_GPIO11_OEN | F_GPIO1_OUT_VAL |
 	  F_GPIO5_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL,
 	  { S_GPIO9, S_GPIO3 }, SUPPORTED_10000baseT_Full | SUPPORTED_AUI,
 	  &mi1_mdio_ext_ops, "Chelsio T320" },
-	{ 4, 0, 0, 0, 0,
+	{ 4, 0, 0,
 	  F_GPIO5_OEN | F_GPIO6_OEN | F_GPIO7_OEN | F_GPIO5_OUT_VAL |
 	  F_GPIO6_OUT_VAL | F_GPIO7_OUT_VAL,
 	  { S_GPIO1, S_GPIO2, S_GPIO3, S_GPIO4 }, SUPPORTED_AUI,
 	  &mi1_mdio_ops, "Chelsio T304" },
 	{ 0 },
-	{ 1, 0, 0, 0, 0,
+	{ 1, 0, 0,
 	  F_GPIO1_OEN | F_GPIO2_OEN | F_GPIO4_OEN | F_GPIO6_OEN | F_GPIO7_OEN |
 	  F_GPIO10_OEN | F_GPIO1_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL,
 	  { S_GPIO9 }, SUPPORTED_10000baseT_Full | SUPPORTED_AUI,
@@ -750,16 +751,17 @@ enum {
 	SF_ERASE_SECTOR = 0xd8,    /* erase sector */
 
 	FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */
-	OLD_FW_VERS_ADDR = 0x77ffc,   /* flash address holding FW version */
 	FW_VERS_ADDR = 0x7fffc,    /* flash address holding FW version */
+	FW_VERS_ADDR_PRE8 = 0x77ffc,/* flash address holding FW version pre8 */
 	FW_MIN_SIZE = 8,           /* at least version and csum */
 	FW_MAX_SIZE = FW_VERS_ADDR - FW_FLASH_BOOT_ADDR,
+	FW_MAX_SIZE_PRE8 = FW_VERS_ADDR_PRE8 - FW_FLASH_BOOT_ADDR,
 
 	BOOT_FLASH_BOOT_ADDR = 0x0,/* start address of boot image in flash */
 	BOOT_SIGNATURE = 0xaa55,   /* signature of BIOS boot ROM */
 	BOOT_SIZE_INC = 512,       /* image size measured in 512B chunks */
 	BOOT_MIN_SIZE = sizeof(boot_header_t), /* at least basic header */
-	BOOT_MAX_SIZE = 0xff*BOOT_SIZE_INC /* 1 byte * length increment  */
+	BOOT_MAX_SIZE = 1024*BOOT_SIZE_INC /* 1 byte * length increment  */
 };
 
 /**
@@ -888,7 +890,7 @@ int t3_read_flash(adapter_t *adapter, un
  *	at the given address.
  *	If @byte_oriented is set the write data is stored as a 32-bit
  *	big-endian array, otherwise in the processor's native endianess.
- *	
+ *
  */
 static int t3_write_flash(adapter_t *adapter, unsigned int addr,
 			  unsigned int n, const u8 *data,
@@ -949,7 +951,7 @@ int t3_get_tp_version(adapter_t *adapter
 			      1, 1, 5, 1);
 	if (ret)
 		return ret;
-	
+
 	*vers = t3_read_reg(adapter, A_TP_EMBED_OP_FIELD1);
 
 	return 0;
@@ -960,7 +962,7 @@ int t3_get_tp_version(adapter_t *adapter
  *	@adapter: the adapter
  *
  */
-int t3_check_tpsram_version(adapter_t *adapter, int *must_load)
+int t3_check_tpsram_version(adapter_t *adapter)
 {
 	int ret;
 	u32 vers;
@@ -969,26 +971,19 @@ int t3_check_tpsram_version(adapter_t *a
 	if (adapter->params.rev == T3_REV_A)
 		return 0;
 
-	*must_load = 1;
 
 	ret = t3_get_tp_version(adapter, &vers);
 	if (ret)
 		return ret;
-	
+
 	vers = t3_read_reg(adapter, A_TP_EMBED_OP_FIELD1);
 
 	major = G_TP_VERSION_MAJOR(vers);
 	minor = G_TP_VERSION_MINOR(vers);
 
-	if (major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR) 
+	if (major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR)
 		return 0;
-
-	if (major != TP_VERSION_MAJOR)
-		CH_ERR(adapter, "found wrong TP version (%u.%u), "
-		       "driver needs version %d.%d\n", major, minor,
-		       TP_VERSION_MAJOR, TP_VERSION_MINOR);
 	else {
-		*must_load = 0;
 		CH_ERR(adapter, "found wrong TP version (%u.%u), "
 		       "driver compiled for version %d.%d\n", major, minor,
 		       TP_VERSION_MAJOR, TP_VERSION_MINOR);
@@ -997,7 +992,7 @@ int t3_check_tpsram_version(adapter_t *a
 }
 
 /**
- *	t3_check_tpsram - check if provided protocol SRAM 
+ *	t3_check_tpsram - check if provided protocol SRAM
  *			  is compatible with this driver
  *	@adapter: the adapter
  *	@tp_sram: the firmware image to write
@@ -1034,16 +1029,17 @@ enum fw_version_type {
  *	@adapter: the adapter
  *	@vers: where to place the version
  *
- *	Reads the FW version from flash.
+ *	Reads the FW version from flash. Note that we had to move the version
+ *	due to FW size. If we don't find a valid FW version in the new location
+ *	we fall back and read the old location.
  */
 int t3_get_fw_version(adapter_t *adapter, u32 *vers)
 {
 	int ret = t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0);
-
 	if (!ret && *vers != 0xffffffff)
 		return 0;
 	else
-		return t3_read_flash(adapter, OLD_FW_VERS_ADDR, 1, vers, 0);
+		return t3_read_flash(adapter, FW_VERS_ADDR_PRE8, 1, vers, 0);
 }
 
 /**
@@ -1053,13 +1049,12 @@ int t3_get_fw_version(adapter_t *adapter
  *	Checks if an adapter's FW is compatible with the driver.  Returns 0
  *	if the versions are compatible, a negative error otherwise.
  */
-int t3_check_fw_version(adapter_t *adapter, int *must_load)
+int t3_check_fw_version(adapter_t *adapter)
 {
 	int ret;
 	u32 vers;
 	unsigned int type, major, minor;
 
-	*must_load = 1;
 	ret = t3_get_fw_version(adapter, &vers);
 	if (ret)
 		return ret;
@@ -1072,16 +1067,11 @@ int t3_check_fw_version(adapter_t *adapt
 	    minor == FW_VERSION_MINOR)
 		return 0;
 
-	if (major != FW_VERSION_MAJOR)
-		CH_ERR(adapter, "found wrong FW version(%u.%u), "
-		       "driver needs version %u.%u\n", major, minor,
-		       FW_VERSION_MAJOR, FW_VERSION_MINOR);
-	else if ((int)minor < FW_VERSION_MINOR) {
-		*must_load = 0;
+	else if (major != FW_VERSION_MAJOR || minor < FW_VERSION_MINOR)
 		CH_WARN(adapter, "found old FW minor version(%u.%u), "
 		        "driver compiled for version %u.%u\n", major, minor,
 			FW_VERSION_MAJOR, FW_VERSION_MINOR);
-	} else {
+	else {
 		CH_WARN(adapter, "found newer FW version(%u.%u), "
 		        "driver compiled for version %u.%u\n", major, minor,
 			FW_VERSION_MAJOR, FW_VERSION_MINOR);
@@ -1126,7 +1116,7 @@ static int t3_flash_erase_sectors(adapte
  */
 int t3_load_fw(adapter_t *adapter, const u8 *fw_data, unsigned int size)
 {
-	u32 csum;
+	u32 version, csum, fw_version_addr;
 	unsigned int i;
 	const u32 *p = (const u32 *)fw_data;
 	int ret, addr, fw_sector = FW_FLASH_BOOT_ADDR >> 16;
@@ -1136,6 +1126,16 @@ int t3_load_fw(adapter_t *adapter, const
 	if (size - 8 > FW_MAX_SIZE)
 		return -EFBIG;
 
+	version = ntohl(*(const u32 *)(fw_data + size - 8));
+	if (G_FW_VERSION_MAJOR(version) < 8) {
+
+		fw_version_addr = FW_VERS_ADDR_PRE8;
+
+		if (size - 8 > FW_MAX_SIZE_PRE8)
+			return -EFBIG;
+	} else
+		fw_version_addr = FW_VERS_ADDR;
+
 	for (csum = 0, i = 0; i < size / sizeof(csum); i++)
 		csum += ntohl(p[i]);
 	if (csum != 0xffffffff) {
@@ -1161,7 +1161,7 @@ int t3_load_fw(adapter_t *adapter, const
 		size -= chunk_size;
 	}
 
-	ret = t3_write_flash(adapter, FW_VERS_ADDR, 4, fw_data, 1);
+	ret = t3_write_flash(adapter, fw_version_addr, 4, fw_data, 1);
 out:
 	if (ret)
 		CH_ERR(adapter, "firmware download failed, error %d\n", ret);
@@ -1255,6 +1255,39 @@ int t3_cim_ctl_blk_read(adapter_t *adap,
 	return ret;
 }
 
+static void t3_gate_rx_traffic(struct cmac *mac, u32 *rx_cfg,
+			       u32 *rx_hash_high, u32 *rx_hash_low)
+{
+	/* stop Rx unicast traffic */
+	t3_mac_disable_exact_filters(mac);
+
+	/* stop broadcast, multicast, promiscuous mode traffic */
+	*rx_cfg = t3_read_reg(mac->adapter, A_XGM_RX_CFG);
+	t3_set_reg_field(mac->adapter, A_XGM_RX_CFG, 
+			 F_ENHASHMCAST | F_DISBCAST | F_COPYALLFRAMES,
+			 F_DISBCAST);
+
+	*rx_hash_high = t3_read_reg(mac->adapter, A_XGM_RX_HASH_HIGH);
+	t3_write_reg(mac->adapter, A_XGM_RX_HASH_HIGH, 0);
+
+	*rx_hash_low = t3_read_reg(mac->adapter, A_XGM_RX_HASH_LOW);
+	t3_write_reg(mac->adapter, A_XGM_RX_HASH_LOW, 0);
+
+	/* Leave time to drain max RX fifo */
+	msleep(1);
+}
+
+static void t3_open_rx_traffic(struct cmac *mac, u32 rx_cfg,
+			       u32 rx_hash_high, u32 rx_hash_low)
+{
+	t3_mac_enable_exact_filters(mac);
+	t3_set_reg_field(mac->adapter, A_XGM_RX_CFG, 
+			 F_ENHASHMCAST | F_DISBCAST | F_COPYALLFRAMES,
+			 rx_cfg);
+	t3_write_reg(mac->adapter, A_XGM_RX_HASH_HIGH, rx_hash_high);
+	t3_write_reg(mac->adapter, A_XGM_RX_HASH_LOW, rx_hash_low);
+}
+
 /**
  *	t3_link_changed - handle interface link changes

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From edwin at FreeBSD.org  Sat Jun  6 02:17:34 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sat Jun  6 02:17:39 2009
Subject: svn commit: r193561 - stable/7/usr.bin/calendar/calendars
Message-ID: <200906060217.n562HXWt045262@svn.freebsd.org>

Author: edwin
Date: Sat Jun  6 02:17:33 2009
New Revision: 193561
URL: http://svn.freebsd.org/changeset/base/193561

Log:
  MFC of r193462:
  
  [patch] calendar.music: Chuck Berry was born in St. Louis, Missouri, not Califor
  nia
  
      The /usr/bin/calendar program reports that Chuck Berry was born
      in San Jose California but he was not born in California.
  
      Chuck Berry was born in St. Louis, Missouri in 1926 on October 18.
  
      http://www.chuckberry.com/about/bio.htm
      http://www.khaldea.com/charts/chuckberry.shtml
      http://en.wikipedia.org/wiki/Chuck_Berry
  
  PR:             conf/128215
  Submitted by:   comet--berkeley (aka Pablo Picasso) 

Modified:
  stable/7/usr.bin/calendar/calendars/   (props changed)
  stable/7/usr.bin/calendar/calendars/calendar.music

Modified: stable/7/usr.bin/calendar/calendars/calendar.music
==============================================================================
--- stable/7/usr.bin/calendar/calendars/calendar.music	Sat Jun  6 02:17:11 2009	(r193560)
+++ stable/7/usr.bin/calendar/calendars/calendar.music	Sat Jun  6 02:17:33 2009	(r193561)
@@ -182,7 +182,7 @@
 10/16	Bob Weir (Grateful Dead) is born in San Francisco, 1947
 10/17	"Hair" opens at New York's Public Theater, 1967
 10/17	Frederic Chopin dies in Paris, France, 1849
-10/18	Chuck Berry is born in San Jose, California, 1926
+10/18	Chuck Berry is born in St. Louis, Missouri, 1926
 10/20	Three members of Lynyrd Skynyrd die in a plane crash, 1977
 10/21	Jesus Christ Super Star debuted on Broadway, 1971
 10/22	Franz Liszt born, 1811
From edwin at FreeBSD.org  Sat Jun  6 02:26:26 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sat Jun  6 02:26:32 2009
Subject: svn commit: r193562 - stable/7/games/fortune/datfiles
Message-ID: <200906060226.n562QNbV045511@svn.freebsd.org>

Author: edwin
Date: Sat Jun  6 02:26:23 2009
New Revision: 193562
URL: http://svn.freebsd.org/changeset/base/193562

Log:
  MFC of r193464, r193467
  
  [patch] fortune(6): George Bernard Shaw quote fix
  [patch] fortune(6): file not Y2.01K compliant
  
  PR:		conf/129860, conf/131469
  Submitted by:	Alan Amesbury , John Hein 

Modified:
  stable/7/games/fortune/datfiles/   (props changed)
  stable/7/games/fortune/datfiles/fortunes
  stable/7/games/fortune/datfiles/fortunes-o.real
  stable/7/games/fortune/datfiles/freebsd-tips   (props changed)

Modified: stable/7/games/fortune/datfiles/fortunes
==============================================================================
--- stable/7/games/fortune/datfiles/fortunes	Sat Jun  6 02:17:33 2009	(r193561)
+++ stable/7/games/fortune/datfiles/fortunes	Sat Jun  6 02:26:23 2009	(r193562)
@@ -48239,9 +48239,9 @@ beat their head on the keyboard.  After 
 		-- Harry Skelton
 %
 The seven deadly sins ... Food, clothing, firing, rent, taxes,
-respectability and children.  Nothing can lift those seven milestones
-from man's neck but money; and the spirit cannot soar until the
-milestones are lifted.
+respectability and children.  Nothing can lift those seven millstones
+from Man's neck but money; and the spirit cannot soar until the
+millstones are lifted.
 		-- George Bernard Shaw
 %
 The seven eyes of Ningauble the Wizard floated back to his hood as he

Modified: stable/7/games/fortune/datfiles/fortunes-o.real
==============================================================================
--- stable/7/games/fortune/datfiles/fortunes-o.real	Sat Jun  6 02:17:33 2009	(r193561)
+++ stable/7/games/fortune/datfiles/fortunes-o.real	Sat Jun  6 02:26:23 2009	(r193562)
@@ -4242,7 +4242,7 @@ Apple owners do it with mice!
 APPOINTMENT BOOK:
 	The reference of last resort when trying to duck undesired
 	invitations ("Gee, the soonest I can pencil you in is
-	December, 2009"), or when trying to figure out what the hell
+	December, 2039"), or when trying to figure out what the hell
 	it was you did during the past year.
 %
 Approximately 80% of our air pollution stems from hydrocarbons
From dchagin at FreeBSD.org  Sat Jun  6 10:55:12 2009
From: dchagin at FreeBSD.org (Dmitry Chagin)
Date: Sat Jun  6 10:55:29 2009
Subject: svn commit: r193580 - in stable/7/sys: . amd64/linux32 compat/linux
	contrib/pf dev/ath/ath_hal dev/cxgb i386/linux
Message-ID: <200906061055.n56AtBIJ059395@svn.freebsd.org>

Author: dchagin
Date: Sat Jun  6 10:55:11 2009
New Revision: 193580
URL: http://svn.freebsd.org/changeset/base/193580

Log:
  MFC r191876:
  To avoid excessive code duplication move MI definitions to the MI
  header file. As it is defined in Linux.
  
  Approved by:	kib (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/linux32/linux.h
  stable/7/sys/compat/linux/linux_ioctl.c
  stable/7/sys/compat/linux/linux_socket.h
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/i386/linux/linux.h

Modified: stable/7/sys/amd64/linux32/linux.h
==============================================================================
--- stable/7/sys/amd64/linux32/linux.h	Sat Jun  6 09:37:55 2009	(r193579)
+++ stable/7/sys/amd64/linux32/linux.h	Sat Jun  6 10:55:11 2009	(r193580)
@@ -663,14 +663,6 @@ union l_semun {
 #define	LINUX_SENDMSG		16
 #define	LINUX_RECVMSG		17
 
-#define	LINUX_AF_UNSPEC		0
-#define	LINUX_AF_UNIX		1
-#define	LINUX_AF_INET		2
-#define	LINUX_AF_AX25		3
-#define	LINUX_AF_IPX		4
-#define	LINUX_AF_APPLETALK	5
-#define	LINUX_AF_INET6		10
-
 #define	LINUX_SOL_SOCKET	1
 #define	LINUX_SOL_IP		0
 #define	LINUX_SOL_IPX		256

Modified: stable/7/sys/compat/linux/linux_ioctl.c
==============================================================================
--- stable/7/sys/compat/linux/linux_ioctl.c	Sat Jun  6 09:37:55 2009	(r193579)
+++ stable/7/sys/compat/linux/linux_ioctl.c	Sat Jun  6 10:55:11 2009	(r193580)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 
 CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ);

Modified: stable/7/sys/compat/linux/linux_socket.h
==============================================================================
--- stable/7/sys/compat/linux/linux_socket.h	Sat Jun  6 09:37:55 2009	(r193579)
+++ stable/7/sys/compat/linux/linux_socket.h	Sat Jun  6 10:55:11 2009	(r193580)
@@ -49,4 +49,14 @@
 #define LINUX_MSG_ERRQUEUE	0x2000
 #define LINUX_MSG_NOSIGNAL	0x4000
 
+/* Supported address families */
+
+#define	LINUX_AF_UNSPEC		0
+#define	LINUX_AF_UNIX		1
+#define	LINUX_AF_INET		2
+#define	LINUX_AF_AX25		3
+#define	LINUX_AF_IPX		4
+#define	LINUX_AF_APPLETALK	5
+#define	LINUX_AF_INET6		10
+
 #endif /* _LINUX_SOCKET_H_ */

Modified: stable/7/sys/i386/linux/linux.h
==============================================================================
--- stable/7/sys/i386/linux/linux.h	Sat Jun  6 09:37:55 2009	(r193579)
+++ stable/7/sys/i386/linux/linux.h	Sat Jun  6 10:55:11 2009	(r193580)
@@ -634,14 +634,6 @@ union l_semun {
 #define	LINUX_SENDMSG		16
 #define	LINUX_RECVMSG		17
 
-#define	LINUX_AF_UNSPEC		0
-#define	LINUX_AF_UNIX		1
-#define	LINUX_AF_INET		2
-#define	LINUX_AF_AX25		3
-#define	LINUX_AF_IPX		4
-#define	LINUX_AF_APPLETALK	5
-#define	LINUX_AF_INET6		10
-
 #define	LINUX_SOL_SOCKET	1
 #define	LINUX_SOL_IP		0
 #define	LINUX_SOL_IPX		256
From dchagin at FreeBSD.org  Sat Jun  6 10:59:37 2009
From: dchagin at FreeBSD.org (Dmitry Chagin)
Date: Sat Jun  6 10:59:44 2009
Subject: svn commit: r193581 - in stable/7/sys: . compat/linux contrib/pf
	dev/ath/ath_hal dev/cxgb
Message-ID: <200906061059.n56AxalK059531@svn.freebsd.org>

Author: dchagin
Date: Sat Jun  6 10:59:36 2009
New Revision: 193581
URL: http://svn.freebsd.org/changeset/base/193581

Log:
  MFC r191887:
  Add KTR(9) tracing for futex emulation.
  
  Approved by:	kib (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/compat/linux/linux_futex.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/7/sys/compat/linux/linux_futex.c	Sat Jun  6 10:55:11 2009	(r193580)
+++ stable/7/sys/compat/linux/linux_futex.c	Sat Jun  6 10:59:36 2009	(r193581)
@@ -43,6 +43,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex.
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -61,6 +62,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex.
 #endif
 #include 
 #include 
+#include 
 
 MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes");
 MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp");
@@ -131,11 +133,15 @@ futex_put(struct futex *f, struct waitin
 		FUTEXES_UNLOCK;
 		FUTEX_UNLOCK(f);
 
+		LINUX_CTR2(sys_futex, "futex_put destroy uaddr %p ref %d",
+		    f->f_uaddr, f->f_refcount);
 		FUTEX_DESTROY(f);
 		free(f, M_FUTEX);
 		return;
 	}
 
+	LINUX_CTR2(sys_futex, "futex_put uaddr %p ref %d",
+	    f->f_uaddr, f->f_refcount);
 	FUTEXES_UNLOCK;
 	FUTEX_UNLOCK(f);
 }
@@ -170,12 +176,15 @@ retry:
 
 			FUTEX_LOCK(f);
 			*newf = f;
+			LINUX_CTR2(sys_futex, "futex_get uaddr %p ref %d",
+			    uaddr, f->f_refcount);
 			return (0);
 		}
 	}
 
 	if (flags & FUTEX_DONTCREATE) {
 		FUTEXES_UNLOCK;
+		LINUX_CTR1(sys_futex, "futex_get uaddr %p null", uaddr);
 		return (0);
 	}
 
@@ -198,6 +207,8 @@ retry:
 	LIST_INSERT_HEAD(&futex_list, tmpf, f_list);
 	FUTEXES_UNLOCK;
 
+	LINUX_CTR2(sys_futex, "futex_get uaddr %p ref %d new",
+	    uaddr, tmpf->f_refcount);
 	*newf = tmpf;
 	return (0);
 }
@@ -232,13 +243,21 @@ futex_sleep(struct futex *f, struct wait
 	int error;
 
 	FUTEX_ASSERT_LOCKED(f);
+	LINUX_CTR4(sys_futex, "futex_sleep enter uaddr %p wp %p timo %ld ref %d",
+	    f->f_uaddr, wp, timeout, f->f_refcount);
 	error = sx_sleep(wp, &f->f_lck, PCATCH, "futex", timeout);
 	if (wp->wp_flags & FUTEX_WP_REQUEUED) {
 		KASSERT(f != wp->wp_futex, ("futex != wp_futex"));
+		LINUX_CTR5(sys_futex, "futex_sleep out error %d uaddr %p w"
+		    " %p requeued uaddr %p ref %d",
+		    error, f->f_uaddr, wp, wp->wp_futex->f_uaddr,
+		    wp->wp_futex->f_refcount);
 		futex_put(f, NULL);
 		f = wp->wp_futex;
 		FUTEX_LOCK(f);
-	}
+	} else
+		LINUX_CTR3(sys_futex, "futex_sleep out error %d uaddr %p wp %p",
+		    error, f->f_uaddr, wp);
 
 	futex_put(f, wp);
 	return (error);
@@ -252,6 +271,8 @@ futex_wake(struct futex *f, int n)
 
 	FUTEX_ASSERT_LOCKED(f);
 	TAILQ_FOREACH_SAFE(wp, &f->f_waiting_proc, wp_list, wpt) {
+		LINUX_CTR3(sys_futex, "futex_wake uaddr %p wp %p ref %d",
+		    f->f_uaddr, wp, f->f_refcount);
 		wp->wp_flags |= FUTEX_WP_REMOVED;
 		TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list);
 		wakeup_one(wp);
@@ -273,10 +294,14 @@ futex_requeue(struct futex *f, int n, st
 
 	TAILQ_FOREACH_SAFE(wp, &f->f_waiting_proc, wp_list, wpt) {
 		if (++count <= n) {
+			LINUX_CTR2(sys_futex, "futex_req_wake uaddr %p wp %p",
+			    f->f_uaddr, wp);
 			wp->wp_flags |= FUTEX_WP_REMOVED;
 			TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list);
 			wakeup_one(wp);
 		} else {
+			LINUX_CTR3(sys_futex, "futex_requeue uaddr %p wp %p to %p",
+			    f->f_uaddr, wp, f2->f_uaddr);
 			wp->wp_flags |= FUTEX_WP_REQUEUED;
 			/* Move wp to wp_list of f2 futex */
 			TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list);
@@ -421,6 +446,8 @@ linux_sys_futex(struct thread *td, struc
 	switch (args->op) {
 	case LINUX_FUTEX_WAIT:
 
+		LINUX_CTR2(sys_futex, "WAIT val %d uaddr %p",
+		    args->val, args->uaddr);
 #ifdef DEBUG
 		if (ldebug(sys_futex))
 			printf(ARGS(sys_futex, "futex_wait val %d uaddr %p"),
@@ -431,15 +458,14 @@ linux_sys_futex(struct thread *td, struc
 			return (error);
 		error = copyin(args->uaddr, &val, sizeof(val));
 		if (error) {
+			LINUX_CTR1(sys_futex, "WAIT copyin failed %d",
+			    error);
 			futex_put(f, wp);
 			return (error);
 		}
 		if (val != args->val) {
-#ifdef DEBUG
-			if (ldebug(sys_futex))
-				printf(ARGS(sys_futex, "futex_wait uaddr %p WHOOPS %d != %d"),
-				    args->uaddr, args->val, val);
-#endif
+			LINUX_CTR3(sys_futex, "WAIT uaddr %p val %d != uval %d",
+			    args->uaddr, args->val, val);
 			futex_put(f, wp);
 			return (EWOULDBLOCK);
 		}
@@ -449,6 +475,9 @@ linux_sys_futex(struct thread *td, struc
 
 	case LINUX_FUTEX_WAKE:
 
+		LINUX_CTR2(sys_futex, "WAKE val %d uaddr %p",
+		    args->val, args->uaddr);
+
 		/*
 		 * XXX: Linux is able to cope with different addresses
 		 * corresponding to the same mapped memory in the sleeping
@@ -472,6 +501,11 @@ linux_sys_futex(struct thread *td, struc
 
 	case LINUX_FUTEX_CMP_REQUEUE:
 
+		LINUX_CTR5(sys_futex, "CMP_REQUEUE uaddr %p "
+		    "val %d val3 %d uaddr2 %p val2 %d",
+		    args->uaddr, args->val, args->val3, args->uaddr2,
+		    (int)(unsigned long)args->timeout);
+
 #ifdef DEBUG
 		if (ldebug(sys_futex))
 			printf(ARGS(sys_futex, "futex_cmp_requeue uaddr %p "
@@ -505,16 +539,15 @@ linux_sys_futex(struct thread *td, struc
 		}
 		error = copyin(args->uaddr, &val, sizeof(val));
 		if (error) {
+			LINUX_CTR1(sys_futex, "CMP_REQUEUE copyin failed %d",
+			    error);
 			futex_put(f2, NULL);
 			futex_put(f, NULL);
 			return (error);
 		}
 		if (val != args->val3) {
-#ifdef DEBUG
-			if (ldebug(sys_futex))
-				printf(ARGS(sys_futex, "futex_cmp_requeue WHOOPS"
-				    " VAL %d != UVAL %d"), args->val, val);
-#endif
+			LINUX_CTR2(sys_futex, "CMP_REQUEUE val %d != uval %d",
+			    args->val, val);
 			futex_put(f2, NULL);
 			futex_put(f, NULL);
 			return (EAGAIN);
@@ -528,6 +561,11 @@ linux_sys_futex(struct thread *td, struc
 
 	case LINUX_FUTEX_WAKE_OP:
 
+		LINUX_CTR5(sys_futex, "WAKE_OP "
+		    "uaddr %p op %d val %x uaddr2 %p val3 %x",
+		    args->uaddr, args->op, args->val,
+		    args->uaddr2, args->val3);
+
 #ifdef DEBUG
 		if (ldebug(sys_futex))
 			printf(ARGS(sys_futex, "futex_wake_op "
From edwin at FreeBSD.org  Sun Jun  7 04:49:26 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sun Jun  7 04:49:33 2009
Subject: svn commit: r193610 - in stable/7/games/fortune: . datfiles fortune
Message-ID: <200906070449.n574nNgV081882@svn.freebsd.org>

Author: edwin
Date: Sun Jun  7 04:49:23 2009
New Revision: 193610
URL: http://svn.freebsd.org/changeset/base/193610

Log:
  MFC of r193486
  
  Misc fixed to fortunes
  
  PR:		conf/112024
  Submitted by:	Niclas Zeising 

Modified:
  stable/7/games/fortune/   (props changed)
  stable/7/games/fortune/datfiles/   (props changed)
  stable/7/games/fortune/datfiles/fortunes
  stable/7/games/fortune/datfiles/fortunes-o.real
  stable/7/games/fortune/datfiles/freebsd-tips   (props changed)
  stable/7/games/fortune/fortune/   (props changed)

Modified: stable/7/games/fortune/datfiles/fortunes
==============================================================================
--- stable/7/games/fortune/datfiles/fortunes	Sun Jun  7 04:45:50 2009	(r193609)
+++ stable/7/games/fortune/datfiles/fortunes	Sun Jun  7 04:49:23 2009	(r193610)
@@ -674,8 +674,9 @@ Liza Minnelli.
 %
 	... with liberty and justice for all who can afford it.
 %
-	12 + 144 + 20 + 3(4)                  2
-	----------------------  +  5(11)  =  9  +  0
+			   1/2
+	12 + 144 + 20 + 3*4                    2
+	----------------------  +  5 * 11  =  9  +  0
 		  7
 
 A dozen, a gross and a score,
@@ -758,7 +759,7 @@ his honeymoon a chastened man.  He'd bec
 	A farm in the country side had several turkeys, it was known as the
 house of seven gobbles.
 %
-	A father gave his teen-age daughter an untrained pedigreed pup for
+	A father gave his teenage daughter an untrained pedigreed pup for
 her birthday.  An hour later, when wandered through the house, he found her
 looking at a puddle in the center of the kitchen.  "My pup," she murmured
 sadly, "runneth over."
@@ -2541,7 +2542,7 @@ library and I'm half way through the sec
 should find what I'm looking for by mid May.  I hope I can remember what it
 was by the time I find it.
 	I had this idea for a new horror film, "VMS Manuals from Hell" or maybe
-"The Paper Chase : IBM vs. DEC".  It's based on Hitchcock's "The Birds", except
+"The Paper Chase: IBM vs. DEC".  It's based on Hitchcock's "The Birds", except
 that it's centered around a programmer who is attacked by a swarm of binder
 pages with an index number and the single line "This page intentionally left
 blank."
@@ -2935,7 +2936,7 @@ Esther and hustle them off to prison.
 	They can't prove who they are because they've left their
 passports in their hotel room.  For three weeks they're tortured day
 and night to get them to name their contacts in the liberation
-movement..  Finally they're hauled in front of a military court,
+movement.  Finally they're hauled in front of a military court,
 charged with espionage, and sentenced to death.
 	The next morning they're lined up in front of the wall where
 they'll be shot.  The sergeant in charge of the firing squad asks them
@@ -2992,7 +2993,7 @@ a girl should not do before twenty."
 	"Your mother is right," said the executive, "I don't like a large
 audience, either."
 %
-	NEW YORK-- Kraft Foods, Inc. announced today that its board of
+	NEW YORK -- Kraft Foods, Inc. announced today that its board of
 directors unanimously rejected the $11 billion takeover bid by Philip
 Morris and Co. A Kraft spokesman stated in a press conference that the
 offer was rejected because the $90-per-share bid did not reflect the
@@ -4077,7 +4078,7 @@ right!  Can I have a dollar?"
 %
 	The master programmer moves from program to program without fear.  No
 change in management can harm him.  He will not be fired, even if the project
-is canceled. Why is this?  He is filled with the Tao.
+is canceled.  Why is this?  He is filled with the Tao.
 		-- Geoffrey James, "The Tao of Programming"
 %
 	The Minnesota Board of Education voted to consider requiring all
@@ -4242,7 +4243,7 @@ With a lot of these folks you'd have to 
 make sure that they are Earthlings.  Then there's the police.  In Portland,
 when some guy goes bananas, the cops rope off a sixteen block area around
 him and call a shrink from the medical school who stands atop a patrol car
-with a megaphone and shouts, "OK! THIS!  ALL!  STARTED!  WHEN!  YOU!  WERE!
+with a megaphone and shouts, "OK!  THIS!  ALL!  STARTED!  WHEN!  YOU!  WERE!
 THREE! YEARS!  OLD!  ON!  ACCOUNT! OF!  YOUR MOTHER!  RIGHT?  SO!  LET'S!
 TALK! ABOUT!  IT!"  Down here they don't waste that kind of time.  The LAPD
 has SWAT teams composed of guys who make Darth Vader look like Mr. Peepers.
@@ -4377,7 +4378,7 @@ against a wall, and this was inscribed o
 warlord Wu.  The warlord asked the programmer: "Which is easier to design:
 an accounting package or an operating system?"
 	"An operating system," replied the programmer.
-	The warlord uttered an exclamation of disbelief. "Surely an
+	The warlord uttered an exclamation of disbelief.  "Surely an
 accounting package is trivial next to the complexity of an operating
 system," he said.
 	"Not so," said the programmer, "when designing an accounting package,
@@ -4387,7 +4388,7 @@ tax laws.  By contrast, an operating sys
 appearances.  When designing an operating system, the programmer seeks the
 simplest harmony between machine and ideas.  This is why an operating system
 is easier to design."
-	The warlord of Wu nodded and smiled. "That is all good and well,"
+	The warlord of Wu nodded and smiled.  "That is all good and well,"
 he said, "but which is easier to debug?"
 	The programmer made no reply.
 		-- Geoffrey James, "The Tao of Programming"
@@ -4828,7 +4829,7 @@ invariably he can't speak English, and i
 sure, little lady, it's eleven-thirty.  Wanna get high?
 	Don't bother thinking that instant lust will turn into the real thing.
 It may, but then you may also wake up one morning to find you're the Queen of
-Rumania.
+Romania.
 		-- Cynthia Hemiel, "Sex Tips for Girls"
 %
 	"When you wake up in the morning, Pooh," said Piglet at last,
@@ -5270,9 +5271,9 @@ marked "450 volts", react as you would n
 For those who have had too much of Esalen, Topanga, and Kairos.
 Tired of being genuine all the time?  Would you like to learn how
 to be a little phony again?  Have you disclosed so much that you're
-beginning to avoid people? Have you touched so many people that
-they're all beginning to feel the same? Like to be a little dependent?
-Are perfect orgasms beginning to bore you? Would you like, for once,
+beginning to avoid people?  Have you touched so many people that
+they're all beginning to feel the same?  Like to be a little dependent?
+Are perfect orgasms beginning to bore you?  Would you like, for once,
 not to express a feeling?  Or better yet, not be in touch with it at
 all?  Come to us.  We promise to relieve you of the burden of your
 great potential.
@@ -6572,7 +6573,7 @@ A critic is a bundle of biases held loos
 		-- Whitney Balliett
 %
 A "critic" is a man who creates nothing and thereby feels
-qualified to judge the work of creative men. There is logic
+qualified to judge the work of creative men.  There is logic
 in this; he is unbiased -- he hates all creative people equally.
 %
 A cynic is a person searching for an honest man, with a stolen lantern.
@@ -7264,7 +7265,7 @@ A little inaccuracy sometimes saves tons
 %
 A little kid went up to Santa and asked him, "Santa, you know when I'm bad
 right?"  And Santa says, "Yes, I do."  The little kid then asks, "And you
-know when I'm sleeping?" To which Santa replies, "Every minute." So the
+know when I'm sleeping?"  To which Santa replies, "Every minute."  So the
 little kid then says, "Well, if you know when I'm bad and when I'm good,
 then how come you don't know what I want for Christmas?"
 %

Modified: stable/7/games/fortune/datfiles/fortunes-o.real
==============================================================================
--- stable/7/games/fortune/datfiles/fortunes-o.real	Sun Jun  7 04:45:50 2009	(r193609)
+++ stable/7/games/fortune/datfiles/fortunes-o.real	Sun Jun  7 04:49:23 2009	(r193610)
@@ -1636,7 +1636,7 @@ Jerry Falwell, would get upset about see
 claim," he jeered, "that my client came at you with a broken bottle in
 his hand.  But is it not true, that you had something in YOUR hand?"
 
-	"Yes," he admitted, "his wife. Very charming, of course, but
+	"Yes," he admitted, "his wife.  Very charming, of course, but
 not much good in a fight."
 %
 	The devout Jew was beside himself because his son had been dating
From yongari at FreeBSD.org  Sun Jun  7 05:08:22 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 05:08:34 2009
Subject: svn commit: r193612 - in stable/7/sys: . contrib/pf dev/age
	dev/ath/ath_hal dev/cxgb
Message-ID: <200906070508.n5758L1Z082335@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 05:08:20 2009
New Revision: 193612
URL: http://svn.freebsd.org/changeset/base/193612

Log:
  MFC r192418:
    pci(4) handles PCIM_CMD_INTxDIS so there is no need to poke this
    bit in driver.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/age/if_age.c
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/age/if_age.c
==============================================================================
--- stable/7/sys/dev/age/if_age.c	Sun Jun  7 04:58:34 2009	(r193611)
+++ stable/7/sys/dev/age/if_age.c	Sun Jun  7 05:08:20 2009	(r193612)
@@ -1477,23 +1477,11 @@ age_resume(device_t dev)
 {
 	struct age_softc *sc;
 	struct ifnet *ifp;
-	uint16_t cmd;
 
 	sc = device_get_softc(dev);
 
 	AGE_LOCK(sc);
-	/*
-	 * Clear INTx emulation disable for hardwares that
-	 * is set in resume event. From Linux.
-	 */
-	cmd = pci_read_config(sc->age_dev, PCIR_COMMAND, 2);
-	if ((cmd & 0x0400) != 0) {
-		cmd &= ~0x0400;
-		pci_write_config(sc->age_dev, PCIR_COMMAND, cmd, 2);
-	}
-	AGE_UNLOCK(sc);
 	age_phy_reset(sc);
-	AGE_LOCK(sc);
 	ifp = sc->age_ifp;
 	if ((ifp->if_flags & IFF_UP) != 0)
 		age_init_locked(sc);
From yongari at FreeBSD.org  Sun Jun  7 05:12:52 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 05:13:09 2009
Subject: svn commit: r193613 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/nfe
Message-ID: <200906070512.n575CoBr082476@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 05:12:50 2009
New Revision: 193613
URL: http://svn.freebsd.org/changeset/base/193613

Log:
  MFC r192706:
    NVIDIA MCP controllers have no Rx buffer alignment restrictions.
    Remove PAGE_SIZE alignment used in Rx buffer DMA tag creation. The
    alignment restriction was used in old local jumbo allocator and
    nfe(4) switched to UMA backed page allocator for jumbo frame.
  
    This change should fix jumbo buffer allocation failure.
  
    Reported by:	Pascal Braun ( pascal.braun <> continum dot net )

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/nfe/if_nfe.c

Modified: stable/7/sys/dev/nfe/if_nfe.c
==============================================================================
--- stable/7/sys/dev/nfe/if_nfe.c	Sun Jun  7 05:08:20 2009	(r193612)
+++ stable/7/sys/dev/nfe/if_nfe.c	Sun Jun  7 05:12:50 2009	(r193613)
@@ -1153,7 +1153,7 @@ nfe_alloc_jrx_ring(struct nfe_softc *sc,
 
 	/* Create DMA tag for jumbo Rx buffers. */
 	error = bus_dma_tag_create(sc->nfe_parent_tag,
-	    PAGE_SIZE, 0,			/* alignment, boundary */
+	    1, 0,				/* alignment, boundary */
 	    BUS_SPACE_MAXADDR,			/* lowaddr */
 	    BUS_SPACE_MAXADDR,			/* highaddr */
 	    NULL, NULL,				/* filter, filterarg */
From yongari at FreeBSD.org  Sun Jun  7 05:22:24 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 05:22:41 2009
Subject: svn commit: r193614 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/msk
Message-ID: <200906070522.n575MMWB082703@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 05:22:22 2009
New Revision: 193614
URL: http://svn.freebsd.org/changeset/base/193614

Log:
  MFC r190314:
    Togging ALLMULTI does not require controller reset so have Rx
    filtering handle this. Introduce a new function msk_rxfilter that
    handles Rx filter configuration and multicast setup as well as
    promiscuous mode. This simplifies code a lot.
    Promiscuous mode always have preference to any other Rx
    filtering so don't disable the mode when ALLMULTI is set.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/msk/if_msk.c

Modified: stable/7/sys/dev/msk/if_msk.c
==============================================================================
--- stable/7/sys/dev/msk/if_msk.c	Sun Jun  7 05:12:50 2009	(r193613)
+++ stable/7/sys/dev/msk/if_msk.c	Sun Jun  7 05:22:22 2009	(r193614)
@@ -287,9 +287,8 @@ static int msk_miibus_writereg(device_t,
 static void msk_miibus_statchg(device_t);
 static void msk_link_task(void *, int);
 
-static void msk_setmulti(struct msk_if_softc *);
+static void msk_rxfilter(struct msk_if_softc *);
 static void msk_setvlan(struct msk_if_softc *, struct ifnet *);
-static void msk_setpromisc(struct msk_if_softc *);
 
 static void msk_stats_clear(struct msk_if_softc *);
 static void msk_stats_update(struct msk_if_softc *);
@@ -560,7 +559,7 @@ msk_link_task(void *arg, int pending)
 }
 
 static void
-msk_setmulti(struct msk_if_softc *sc_if)
+msk_rxfilter(struct msk_if_softc *sc_if)
 {
 	struct msk_softc *sc;
 	struct ifnet *ifp;
@@ -577,15 +576,14 @@ msk_setmulti(struct msk_if_softc *sc_if)
 
 	bzero(mchash, sizeof(mchash));
 	mode = GMAC_READ_2(sc, sc_if->msk_port, GM_RX_CTRL);
-	mode |= GM_RXCR_UCF_ENA;
-	if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
-		if ((ifp->if_flags & IFF_PROMISC) != 0)
-			mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
-		else if ((ifp->if_flags & IFF_ALLMULTI) != 0) {
-			mchash[0] = 0xffff;
-			mchash[1] = 0xffff;
-		}
+	if ((ifp->if_flags & IFF_PROMISC) != 0)
+		mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
+	else if ((ifp->if_flags & IFF_ALLMULTI) != 0) {
+		mode |= GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA;
+		mchash[0] = 0xffff;
+		mchash[1] = 0xffff;
 	} else {
+		mode |= GM_RXCR_UCF_ENA;
 		IF_ADDR_LOCK(ifp);
 		TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 			if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -598,7 +596,8 @@ msk_setmulti(struct msk_if_softc *sc_if)
 			mchash[crc >> 5] |= 1 << (crc & 0x1f);
 		}
 		IF_ADDR_UNLOCK(ifp);
-		mode |= GM_RXCR_MCF_ENA;
+		if (mchash[0] != 0 || mchash[1] != 0)
+			mode |= GM_RXCR_MCF_ENA;
 	}
 
 	GMAC_WRITE_2(sc, sc_if->msk_port, GM_MC_ADDR_H1,
@@ -631,26 +630,6 @@ msk_setvlan(struct msk_if_softc *sc_if, 
 	}
 }
 
-static void
-msk_setpromisc(struct msk_if_softc *sc_if)
-{
-	struct msk_softc *sc;
-	struct ifnet *ifp;
-	uint16_t mode;
-
-	MSK_IF_LOCK_ASSERT(sc_if);
-
-	sc = sc_if->msk_softc;
-	ifp = sc_if->msk_ifp;
-
-	mode = GMAC_READ_2(sc, sc_if->msk_port, GM_RX_CTRL);
-	if (ifp->if_flags & IFF_PROMISC)
-		mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
-	else
-		mode |= (GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
-	GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_CTRL, mode);
-}
-
 static int
 msk_init_rx_ring(struct msk_if_softc *sc_if)
 {
@@ -954,10 +933,8 @@ msk_ioctl(struct ifnet *ifp, u_long comm
 		if ((ifp->if_flags & IFF_UP) != 0) {
 			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 				if (((ifp->if_flags ^ sc_if->msk_if_flags)
-				    & IFF_PROMISC) != 0) {
-					msk_setpromisc(sc_if);
-					msk_setmulti(sc_if);
-				}
+				    & (IFF_PROMISC | IFF_ALLMULTI)) != 0)
+					msk_rxfilter(sc_if);
 			} else {
 				if (sc_if->msk_detach == 0)
 					msk_init_locked(sc_if);
@@ -973,7 +950,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm
 	case SIOCDELMULTI:
 		MSK_IF_LOCK(sc_if);
 		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
-			msk_setmulti(sc_if);
+			msk_rxfilter(sc_if);
 		MSK_IF_UNLOCK(sc_if);
 		break;
 	case SIOCGIFMEDIA:
@@ -3594,11 +3571,8 @@ msk_init_locked(struct msk_if_softc *sc_
 	CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T),
 	    GMF_OPER_ON | GMF_RX_F_FL_ON);
 
-	/* Set promiscuous mode. */
-	msk_setpromisc(sc_if);
-
-	/* Set multicast filter. */
-	msk_setmulti(sc_if);
+	/* Set receive filter. */
+	msk_rxfilter(sc_if);
 
 	/* Flush Rx MAC FIFO on any flow control or error. */
 	CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK),
From yongari at FreeBSD.org  Sun Jun  7 05:41:15 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 05:41:34 2009
Subject: svn commit: r193615 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/nge
Message-ID: <200906070541.n575fDBq083180@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 05:41:13 2009
New Revision: 193615
URL: http://svn.freebsd.org/changeset/base/193615

Log:
  MFC r192288-192292,192294,192297-192299:
  
  r192288:
    Use ANSI C declarations for all functions.
  
  r192289:
    Remove register keyword.
  
  r192290:
    Remove trailling whitespaces.
  
  r192291:
    Remove return statement at the end of functions that return void.
  
  r192292:
    style(9) - space after keyword.
  
  r192294:
    s/u_int8_t/uint8_t/g
    s/u_int16_t/uint16_t/g
    s/u_int32_t/uint32_t/g
  
  r192297:
    style(9)
  
  r192298:
    Consistently use tab characters instead of spaces.
  
  r192299:
    Remove extra parenthesis used in macros. These macros are not used
    in driver, though.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/nge/if_nge.c
  stable/7/sys/dev/nge/if_ngereg.h

Modified: stable/7/sys/dev/nge/if_nge.c
==============================================================================
--- stable/7/sys/dev/nge/if_nge.c	Sun Jun  7 05:22:22 2009	(r193614)
+++ stable/7/sys/dev/nge/if_nge.c	Sun Jun  7 05:41:13 2009	(r193615)
@@ -151,7 +151,7 @@ static int nge_attach(device_t);
 static int nge_detach(device_t);
 
 static int nge_newbuf(struct nge_softc *, struct nge_desc *, struct mbuf *);
-static int nge_encap(struct nge_softc *, struct mbuf *, u_int32_t *);
+static int nge_encap(struct nge_softc *, struct mbuf *, uint32_t *);
 #ifdef NGE_FIXUP_RX
 static __inline void nge_fixup_rx (struct mbuf *);
 #endif
@@ -174,11 +174,11 @@ static void nge_ifmedia_sts(struct ifnet
 static void nge_delay(struct nge_softc *);
 static void nge_eeprom_idle(struct nge_softc *);
 static void nge_eeprom_putbyte(struct nge_softc *, int);
-static void nge_eeprom_getword(struct nge_softc *, int, u_int16_t *);
+static void nge_eeprom_getword(struct nge_softc *, int, uint16_t *);
 static void nge_read_eeprom(struct nge_softc *, caddr_t, int, int, int);
 
 static void nge_mii_sync(struct nge_softc *);
-static void nge_mii_send(struct nge_softc *, u_int32_t, int);
+static void nge_mii_send(struct nge_softc *, uint32_t, int);
 static int nge_mii_readreg(struct nge_softc *, struct nge_mii_frame *);
 static int nge_mii_writereg(struct nge_softc *, struct nge_mii_frame *);
 
@@ -244,22 +244,18 @@ DRIVER_MODULE(miibus, nge, miibus_driver
 	CSR_WRITE_4(sc, NGE_MEAR, CSR_READ_4(sc, NGE_MEAR) & ~(x))
 
 static void
-nge_delay(sc)
-	struct nge_softc	*sc;
+nge_delay(struct nge_softc *sc)
 {
-	int			idx;
+	int idx;
 
 	for (idx = (300 / 33) + 1; idx > 0; idx--)
 		CSR_READ_4(sc, NGE_CSR);
-
-	return;
 }
 
 static void
-nge_eeprom_idle(sc)
-	struct nge_softc	*sc;
+nge_eeprom_idle(struct nge_softc *sc)
 {
-	register int		i;
+	int i;
 
 	SIO_SET(NGE_MEAR_EE_CSEL);
 	nge_delay(sc);
@@ -278,19 +274,15 @@ nge_eeprom_idle(sc)
 	SIO_CLR(NGE_MEAR_EE_CSEL);
 	nge_delay(sc);
 	CSR_WRITE_4(sc, NGE_MEAR, 0x00000000);
-
-	return;
 }
 
 /*
  * Send a read command and address to the EEPROM, check for ACK.
  */
 static void
-nge_eeprom_putbyte(sc, addr)
-	struct nge_softc	*sc;
-	int			addr;
+nge_eeprom_putbyte(struct nge_softc *sc, int addr)
 {
-	register int		d, i;
+	int d, i;
 
 	d = addr | NGE_EECMD_READ;
 
@@ -309,21 +301,16 @@ nge_eeprom_putbyte(sc, addr)
 		SIO_CLR(NGE_MEAR_EE_CLK);
 		nge_delay(sc);
 	}
-
-	return;
 }
 
 /*
  * Read a word of data stored in the EEPROM at address 'addr.'
  */
 static void
-nge_eeprom_getword(sc, addr, dest)
-	struct nge_softc	*sc;
-	int			addr;
-	u_int16_t		*dest;
+nge_eeprom_getword(struct nge_softc *sc, int addr, uint16_t *dest)
 {
-	register int		i;
-	u_int16_t		word = 0;
+	int i;
+	uint16_t word = 0;
 
 	/* Force EEPROM to idle state. */
 	nge_eeprom_idle(sc);
@@ -357,44 +344,34 @@ nge_eeprom_getword(sc, addr, dest)
 	nge_eeprom_idle(sc);
 
 	*dest = word;
-
-	return;
 }
 
 /*
  * Read a sequence of words from the EEPROM.
  */
 static void
-nge_read_eeprom(sc, dest, off, cnt, swap)
-	struct nge_softc	*sc;
-	caddr_t			dest;
-	int			off;
-	int			cnt;
-	int			swap;
+nge_read_eeprom(struct nge_softc *sc, caddr_t dest, int off, int cnt, int swap)
 {
-	int			i;
-	u_int16_t		word = 0, *ptr;
+	int i;
+	uint16_t word = 0, *ptr;
 
 	for (i = 0; i < cnt; i++) {
 		nge_eeprom_getword(sc, off + i, &word);
-		ptr = (u_int16_t *)(dest + (i * 2));
+		ptr = (uint16_t *)(dest + (i * 2));
 		if (swap)
 			*ptr = ntohs(word);
 		else
 			*ptr = word;
 	}
-
-	return;
 }
 
 /*
  * Sync the PHYs by setting data bit and strobing the clock 32 times.
  */
 static void
-nge_mii_sync(sc)
-	struct nge_softc		*sc;
+nge_mii_sync(struct nge_softc *sc)
 {
-	register int		i;
+	int i;
 
 	SIO_SET(NGE_MEAR_MII_DIR|NGE_MEAR_MII_DATA);
 
@@ -404,29 +381,24 @@ nge_mii_sync(sc)
 		SIO_CLR(NGE_MEAR_MII_CLK);
 		DELAY(1);
 	}
-
-	return;
 }
 
 /*
  * Clock a series of bits through the MII.
  */
 static void
-nge_mii_send(sc, bits, cnt)
-	struct nge_softc		*sc;
-	u_int32_t		bits;
-	int			cnt;
+nge_mii_send(struct nge_softc *sc, uint32_t bits, int cnt)
 {
-	int			i;
+	int i;
 
 	SIO_CLR(NGE_MEAR_MII_CLK);
 
 	for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
-                if (bits & i) {
+		if (bits & i) {
 			SIO_SET(NGE_MEAR_MII_DATA);
-                } else {
+		} else {
 			SIO_CLR(NGE_MEAR_MII_DATA);
-                }
+		}
 		DELAY(1);
 		SIO_CLR(NGE_MEAR_MII_CLK);
 		DELAY(1);
@@ -438,12 +410,9 @@ nge_mii_send(sc, bits, cnt)
  * Read an PHY register through the MII.
  */
 static int
-nge_mii_readreg(sc, frame)
-	struct nge_softc		*sc;
-	struct nge_mii_frame	*frame;
-	
+nge_mii_readreg(struct nge_softc *sc, struct nge_mii_frame *frame)
 {
-	int			i, ack;
+	int i, ack;
 
 	/*
 	 * Set up frame for RX.
@@ -452,7 +421,7 @@ nge_mii_readreg(sc, frame)
 	frame->mii_opcode = NGE_MII_READOP;
 	frame->mii_turnaround = 0;
 	frame->mii_data = 0;
-	
+
 	CSR_WRITE_4(sc, NGE_MEAR, 0);
 
 	/*
@@ -490,7 +459,7 @@ nge_mii_readreg(sc, frame)
 	 * need to clock through 16 cycles to keep the PHY(s) in sync.
 	 */
 	if (ack) {
-		for(i = 0; i < 16; i++) {
+		for (i = 0; i < 16; i++) {
 			SIO_CLR(NGE_MEAR_MII_CLK);
 			DELAY(1);
 			SIO_SET(NGE_MEAR_MII_CLK);
@@ -519,18 +488,15 @@ fail:
 	DELAY(1);
 
 	if (ack)
-		return(1);
-	return(0);
+		return (1);
+	return (0);
 }
 
 /*
  * Write to a PHY register through the MII.
  */
 static int
-nge_mii_writereg(sc, frame)
-	struct nge_softc		*sc;
-	struct nge_mii_frame	*frame;
-	
+nge_mii_writereg(struct nge_softc *sc, struct nge_mii_frame *frame)
 {
 
 	/*
@@ -540,7 +506,7 @@ nge_mii_writereg(sc, frame)
 	frame->mii_stdelim = NGE_MII_STARTDELIM;
 	frame->mii_opcode = NGE_MII_WRITEOP;
 	frame->mii_turnaround = NGE_MII_TURNAROUND;
-	
+
 	/*
  	 * Turn on data output.
 	 */
@@ -566,16 +532,14 @@ nge_mii_writereg(sc, frame)
 	 */
 	SIO_CLR(NGE_MEAR_MII_DIR);
 
-	return(0);
+	return (0);
 }
 
 static int
-nge_miibus_readreg(dev, phy, reg)
-	device_t		dev;
-	int			phy, reg;
+nge_miibus_readreg(device_t dev, int phy, int reg)
 {
-	struct nge_softc	*sc;
-	struct nge_mii_frame	frame;
+	struct nge_softc *sc;
+	struct nge_mii_frame frame;
 
 	sc = device_get_softc(dev);
 
@@ -585,16 +549,14 @@ nge_miibus_readreg(dev, phy, reg)
 	frame.mii_regaddr = reg;
 	nge_mii_readreg(sc, &frame);
 
-	return(frame.mii_data);
+	return (frame.mii_data);
 }
 
 static int
-nge_miibus_writereg(dev, phy, reg, data)
-	device_t		dev;
-	int			phy, reg, data;
+nge_miibus_writereg(device_t dev, int phy, int reg, int data)
 {
-	struct nge_softc	*sc;
-	struct nge_mii_frame	frame;
+	struct nge_softc *sc;
+	struct nge_mii_frame frame;
 
 	sc = device_get_softc(dev);
 
@@ -605,16 +567,15 @@ nge_miibus_writereg(dev, phy, reg, data)
 	frame.mii_data = data;
 	nge_mii_writereg(sc, &frame);
 
-	return(0);
+	return (0);
 }
 
 static void
-nge_miibus_statchg(dev)
-	device_t		dev;
+nge_miibus_statchg(device_t dev)
 {
-	int			status;	
-	struct nge_softc	*sc;
-	struct mii_data		*mii;
+	int status;
+	struct nge_softc *sc;
+	struct mii_data *mii;
 
 	sc = device_get_softc(dev);
 	if (sc->nge_tbi) {
@@ -631,7 +592,7 @@ nge_miibus_statchg(dev)
 				NGE_CLRBIT(sc, NGE_RX_CFG, NGE_RXCFG_RX_FDX);
 			}
 
-		} else if ((sc->nge_ifmedia.ifm_cur->ifm_media & IFM_GMASK) 
+		} else if ((sc->nge_ifmedia.ifm_cur->ifm_media & IFM_GMASK)
 			!= IFM_FDX) {
 			NGE_CLRBIT(sc, NGE_TX_CFG,
 			    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
@@ -662,17 +623,15 @@ nge_miibus_statchg(dev)
 			NGE_CLRBIT(sc, NGE_CFG, NGE_CFG_MODE_1000);
 		}
 	}
-	return;
 }
 
 static void
-nge_setmulti(sc)
-	struct nge_softc	*sc;
+nge_setmulti(struct nge_softc *sc)
 {
-	struct ifnet		*ifp;
-	struct ifmultiaddr	*ifma;
-	u_int32_t		h = 0, i, filtsave;
-	int			bit, index;
+	struct ifnet *ifp;
+	struct ifmultiaddr *ifma;
+	uint32_t h = 0, i, filtsave;
+	int bit, index;
 
 	NGE_LOCK_ASSERT(sc);
 	ifp = sc->nge_ifp;
@@ -723,15 +682,12 @@ nge_setmulti(sc)
 	IF_ADDR_UNLOCK(ifp);
 
 	CSR_WRITE_4(sc, NGE_RXFILT_CTL, filtsave);
-
-	return;
 }
 
 static void
-nge_reset(sc)
-	struct nge_softc	*sc;
+nge_reset(struct nge_softc *sc)
 {
-	register int		i;
+	int i;
 
 	NGE_SETBIT(sc, NGE_CSR, NGE_CSR_RESET);
 
@@ -752,8 +708,6 @@ nge_reset(sc)
 	 */
 	CSR_WRITE_4(sc, NGE_CLKRUN, NGE_CLKRUN_PMESTS);
 	CSR_WRITE_4(sc, NGE_CLKRUN, 0);
-
-        return;
 }
 
 /*
@@ -761,23 +715,22 @@ nge_reset(sc)
  * IDs against our list and return a device name if we find a match.
  */
 static int
-nge_probe(dev)
-	device_t		dev;
+nge_probe(device_t dev)
 {
-	struct nge_type		*t;
+	struct nge_type *t;
 
 	t = nge_devs;
 
-	while(t->nge_name != NULL) {
+	while (t->nge_name != NULL) {
 		if ((pci_get_vendor(dev) == t->nge_vid) &&
 		    (pci_get_device(dev) == t->nge_did)) {
 			device_set_desc(dev, t->nge_name);
-			return(BUS_PROBE_DEFAULT);
+			return (BUS_PROBE_DEFAULT);
 		}
 		t++;
 	}
 
-	return(ENXIO);
+	return (ENXIO);
 }
 
 /*
@@ -785,13 +738,12 @@ nge_probe(dev)
  * setup and ethernet/BPF attach.
  */
 static int
-nge_attach(dev)
-	device_t		dev;
+nge_attach(device_t dev)
 {
-	u_char			eaddr[ETHER_ADDR_LEN];
-	struct nge_softc	*sc;
-	struct ifnet		*ifp = NULL;
-	int			error = 0, rid;
+	u_char eaddr[ETHER_ADDR_LEN];
+	struct nge_softc *sc;
+	struct ifnet *ifp = NULL;
+	int error = 0, rid;
 
 	sc = device_get_softc(dev);
 	sc->nge_dev = dev;
@@ -877,10 +829,10 @@ nge_attach(dev)
 		if (CSR_READ_4(sc, NGE_CFG) & NGE_CFG_TBI_EN) {
 			sc->nge_tbi = 1;
 			device_printf(dev, "Using TBI\n");
-			
+
 			sc->nge_miibus = dev;
 
-			ifmedia_init(&sc->nge_ifmedia, 0, nge_ifmedia_upd, 
+			ifmedia_init(&sc->nge_ifmedia, 0, nge_ifmedia_upd,
 				nge_ifmedia_sts);
 #define	ADD(m, c)	ifmedia_add(&sc->nge_ifmedia, (m), (c), NULL)
 			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, 0), 0);
@@ -889,16 +841,16 @@ nge_attach(dev)
 			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, 0), 0);
 #undef ADD
 			device_printf(dev, " 1000baseSX, 1000baseSX-FDX, auto\n");
-			
-			ifmedia_set(&sc->nge_ifmedia, 
+
+			ifmedia_set(&sc->nge_ifmedia,
 				IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, 0));
-	    
+
 			CSR_WRITE_4(sc, NGE_GPIO, CSR_READ_4(sc, NGE_GPIO)
-				| NGE_GPIO_GP4_OUT 
-				| NGE_GPIO_GP1_OUTENB | NGE_GPIO_GP2_OUTENB 
+				| NGE_GPIO_GP4_OUT
+				| NGE_GPIO_GP1_OUTENB | NGE_GPIO_GP2_OUTENB
 				| NGE_GPIO_GP3_OUTENB
 				| NGE_GPIO_GP3_IN | NGE_GPIO_GP4_IN);
-	    
+
 		} else {
 			device_printf(dev, "MII without any PHY!\n");
 			error = ENXIO;
@@ -934,15 +886,14 @@ fail:
 	if (sc->nge_res)
 		bus_release_resource(dev, NGE_RES, NGE_RID, sc->nge_res);
 	NGE_LOCK_DESTROY(sc);
-	return(error);
+	return (error);
 }
 
 static int
-nge_detach(dev)
-	device_t		dev;
+nge_detach(device_t dev)
 {
-	struct nge_softc	*sc;
-	struct ifnet		*ifp;
+	struct nge_softc *sc;
+	struct ifnet *ifp;
 
 	sc = device_get_softc(dev);
 	ifp = sc->nge_ifp;
@@ -971,19 +922,18 @@ nge_detach(dev)
 
 	NGE_LOCK_DESTROY(sc);
 
-	return(0);
+	return (0);
 }
 
 /*
  * Initialize the transmit descriptors.
  */
 static int
-nge_list_tx_init(sc)
-	struct nge_softc	*sc;
+nge_list_tx_init(struct nge_softc *sc)
 {
-	struct nge_list_data	*ld;
-	struct nge_ring_data	*cd;
-	int			i;
+	struct nge_list_data *ld;
+	struct nge_ring_data *cd;
+	int i;
 
 	cd = &sc->nge_cdata;
 	ld = sc->nge_ldata;
@@ -1007,7 +957,7 @@ nge_list_tx_init(sc)
 
 	cd->nge_tx_prod = cd->nge_tx_cons = cd->nge_tx_cnt = 0;
 
-	return(0);
+	return (0);
 }
 
 
@@ -1017,19 +967,18 @@ nge_list_tx_init(sc)
  * points back to the first.
  */
 static int
-nge_list_rx_init(sc)
-	struct nge_softc	*sc;
+nge_list_rx_init(struct nge_softc *sc)
 {
-	struct nge_list_data	*ld;
-	struct nge_ring_data	*cd;
-	int			i;
+	struct nge_list_data *ld;
+	struct nge_ring_data *cd;
+	int i;
 
 	ld = sc->nge_ldata;
 	cd = &sc->nge_cdata;
 
 	for (i = 0; i < NGE_RX_LIST_CNT; i++) {
 		if (nge_newbuf(sc, &ld->nge_rx_list[i], NULL) == ENOBUFS)
-			return(ENOBUFS);
+			return (ENOBUFS);
 		if (i == (NGE_RX_LIST_CNT - 1)) {
 			ld->nge_rx_list[i].nge_nextdesc =
 			    &ld->nge_rx_list[0];
@@ -1046,17 +995,14 @@ nge_list_rx_init(sc)
 	cd->nge_rx_prod = 0;
 	sc->nge_head = sc->nge_tail = NULL;
 
-	return(0);
+	return (0);
 }
 
 /*
  * Initialize an RX descriptor and attach an MBUF cluster.
  */
 static int
-nge_newbuf(sc, c, m)
-	struct nge_softc	*sc;
-	struct nge_desc		*c;
-	struct mbuf		*m;
+nge_newbuf(struct nge_softc *sc, struct nge_desc *c, struct mbuf *m)
 {
 
 	if (m == NULL) {
@@ -1068,34 +1014,33 @@ nge_newbuf(sc, c, m)
 
 	m->m_len = m->m_pkthdr.len = MCLBYTES;
 
-	m_adj(m, sizeof(u_int64_t));
+	m_adj(m, sizeof(uint64_t));
 
 	c->nge_mbuf = m;
 	c->nge_ptr = vtophys(mtod(m, caddr_t));
 	c->nge_ctl = m->m_len;
 	c->nge_extsts = 0;
 
-	return(0);
+	return (0);
 }
 
 #ifdef NGE_FIXUP_RX
 static __inline void
-nge_fixup_rx(m)
-	struct mbuf		*m;
-{  
-        int			i;
-        uint16_t		*src, *dst;
-   
+nge_fixup_rx(struct mbuf *m)
+{
+	int i;
+	uint16_t *src, *dst;
+
 	src = mtod(m, uint16_t *);
 	dst = src - 1;
-   
+
 	for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++)
 		*dst++ = *src++;
-   
+
 	m->m_data -= ETHER_ALIGN;
-   
+
 	return;
-}  
+}
 #endif
 
 /*
@@ -1103,21 +1048,20 @@ nge_fixup_rx(m)
  * the higher level protocols.
  */
 static void
-nge_rxeof(sc)
-	struct nge_softc	*sc;
+nge_rxeof(struct nge_softc *sc)
 {
-        struct mbuf		*m;
-        struct ifnet		*ifp;
-	struct nge_desc		*cur_rx;
-	int			i, total_len = 0;
-	u_int32_t		rxstat;
+	struct mbuf *m;
+	struct ifnet *ifp;
+	struct nge_desc *cur_rx;
+	int i, total_len = 0;
+	uint32_t rxstat;
 
 	NGE_LOCK_ASSERT(sc);
 	ifp = sc->nge_ifp;
 	i = sc->nge_cdata.nge_rx_prod;
 
-	while(NGE_OWNDESC(&sc->nge_ldata->nge_rx_list[i])) {
-		u_int32_t		extsts;
+	while (NGE_OWNDESC(&sc->nge_ldata->nge_rx_list[i])) {
+		uint32_t		extsts;
 
 #ifdef DEVICE_POLLING
 		if (ifp->if_capenable & IFCAP_POLLING) {
@@ -1237,8 +1181,6 @@ nge_rxeof(sc)
 	}
 
 	sc->nge_cdata.nge_rx_prod = i;
-
-	return;
 }
 
 /*
@@ -1247,12 +1189,11 @@ nge_rxeof(sc)
  */
 
 static void
-nge_txeof(sc)
-	struct nge_softc	*sc;
+nge_txeof(struct nge_softc *sc)
 {
-	struct nge_desc		*cur_tx;
-	struct ifnet		*ifp;
-	u_int32_t		idx;
+	struct nge_desc *cur_tx;
+	struct ifnet *ifp;
+	uint32_t idx;
 
 	NGE_LOCK_ASSERT(sc);
 	ifp = sc->nge_ifp;
@@ -1300,17 +1241,14 @@ nge_txeof(sc)
 
 	if (idx == sc->nge_cdata.nge_tx_prod)
 		ifp->if_timer = 0;
-
-	return;
 }
 
 static void
-nge_tick(xsc)
-	void			*xsc;
+nge_tick(void *xsc)
 {
-	struct nge_softc	*sc;
-	struct mii_data		*mii;
-	struct ifnet		*ifp;
+	struct nge_softc *sc;
+	struct mii_data *mii;
+	struct ifnet *ifp;
 
 	sc = xsc;
 	NGE_LOCK_ASSERT(sc);
@@ -1318,10 +1256,10 @@ nge_tick(xsc)
 
 	if (sc->nge_tbi) {
 		if (!sc->nge_link) {
-			if (CSR_READ_4(sc, NGE_TBI_BMSR) 
+			if (CSR_READ_4(sc, NGE_TBI_BMSR)
 			    & NGE_TBIBMSR_ANEG_DONE) {
 				if (bootverbose)
-					device_printf(sc->nge_dev, 
+					device_printf(sc->nge_dev,
 					    "gigabit link up\n");
 				nge_miibus_statchg(sc->nge_miibus);
 				sc->nge_link++;
@@ -1337,9 +1275,9 @@ nge_tick(xsc)
 			if (mii->mii_media_status & IFM_ACTIVE &&
 			    IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
 				sc->nge_link++;
-				if (IFM_SUBTYPE(mii->mii_media_active) 
+				if (IFM_SUBTYPE(mii->mii_media_active)
 				    == IFM_1000_T && bootverbose)
-					device_printf(sc->nge_dev, 
+					device_printf(sc->nge_dev,
 					    "gigabit link up\n");
 				if (ifp->if_snd.ifq_head != NULL)
 					nge_start_locked(ifp);
@@ -1347,8 +1285,6 @@ nge_tick(xsc)
 		}
 	}
 	callout_reset(&sc->nge_stat_ch, hz, nge_tick, sc);
-
-	return;
 }
 
 #ifdef DEVICE_POLLING
@@ -1357,7 +1293,7 @@ static poll_handler_t nge_poll;
 static void
 nge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
 {
-	struct  nge_softc *sc = ifp->if_softc;
+	struct nge_softc *sc = ifp->if_softc;
 
 	NGE_LOCK(sc);
 	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
@@ -1379,7 +1315,7 @@ nge_poll(struct ifnet *ifp, enum poll_cm
 		nge_start_locked(ifp);
 
 	if (sc->rxcycles > 0 || cmd == POLL_AND_CHECK_STATUS) {
-		u_int32_t	status;
+		uint32_t	status;
 
 		/* Reading the ISR register clears all interrupts. */
 		status = CSR_READ_4(sc, NGE_ISR);
@@ -1400,12 +1336,11 @@ nge_poll(struct ifnet *ifp, enum poll_cm
 #endif /* DEVICE_POLLING */
 
 static void
-nge_intr(arg)
-	void			*arg;
+nge_intr(void *arg)
 {
-	struct nge_softc	*sc;
-	struct ifnet		*ifp;
-	u_int32_t		status;
+	struct nge_softc *sc;
+	struct ifnet *ifp;
+	uint32_t status;
 
 	sc = arg;
 	ifp = sc->nge_ifp;
@@ -1429,7 +1364,7 @@ nge_intr(arg)
 	CSR_WRITE_4(sc, NGE_IER, 0);
 
 	/* Data LED on for TBI mode */
-	if(sc->nge_tbi)
+	if (sc->nge_tbi)
 		 CSR_WRITE_4(sc, NGE_GPIO, CSR_READ_4(sc, NGE_GPIO)
 			     | NGE_GPIO_GP3_OUT);
 
@@ -1464,7 +1399,7 @@ nge_intr(arg)
 		}
 
 #if 0
-		/* 
+		/*
 		 * XXX: nge_tick() is not ready to be called this way
 		 * it screws up the aneg timeout because mii_tick() is
 		 * only to be called once per second.
@@ -1484,13 +1419,11 @@ nge_intr(arg)
 
 	/* Data LED off for TBI mode */
 
-	if(sc->nge_tbi)
+	if (sc->nge_tbi)
 		CSR_WRITE_4(sc, NGE_GPIO, CSR_READ_4(sc, NGE_GPIO)
 			    & ~NGE_GPIO_GP3_OUT);
 
 	NGE_UNLOCK(sc);
-
-	return;
 }
 
 /*
@@ -1498,14 +1431,11 @@ nge_intr(arg)
  * pointers to the fragment pointers.
  */
 static int
-nge_encap(sc, m_head, txidx)
-	struct nge_softc	*sc;
-	struct mbuf		*m_head;
-	u_int32_t		*txidx;
-{
-	struct nge_desc		*f = NULL;
-	struct mbuf		*m;
-	int			frag, cur, cnt = 0;
+nge_encap(struct nge_softc *sc, struct mbuf *m_head, uint32_t *txidx)
+{
+	struct nge_desc *f = NULL;
+	struct mbuf *m;
+	int frag, cur, cnt = 0;
 
 	/*
  	 * Start packing the mbufs in this chain into
@@ -1519,7 +1449,7 @@ nge_encap(sc, m_head, txidx)
 		if (m->m_len != 0) {
 			if ((NGE_TX_LIST_CNT -
 			    (sc->nge_cdata.nge_tx_cnt + cnt)) < 2)
-				return(ENOBUFS);
+				return (ENOBUFS);
 			f = &sc->nge_ldata->nge_tx_list[frag];
 			f->nge_ctl = NGE_CMDSTS_MORE | m->m_len;
 			f->nge_ptr = vtophys(mtod(m, vm_offset_t));
@@ -1532,7 +1462,7 @@ nge_encap(sc, m_head, txidx)
 	}
 
 	if (m != NULL)
-		return(ENOBUFS);
+		return (ENOBUFS);
 
 	sc->nge_ldata->nge_tx_list[*txidx].nge_extsts = 0;
 	if (m_head->m_pkthdr.csum_flags) {
@@ -1558,7 +1488,7 @@ nge_encap(sc, m_head, txidx)
 	sc->nge_cdata.nge_tx_cnt += cnt;
 	*txidx = frag;
 
-	return(0);
+	return (0);
 }
 
 /*
@@ -1569,10 +1499,9 @@ nge_encap(sc, m_head, txidx)
  */
 
 static void
-nge_start(ifp)
-	struct ifnet		*ifp;
+nge_start(struct ifnet *ifp)
 {
-	struct nge_softc	*sc;
+	struct nge_softc *sc;
 
 	sc = ifp->if_softc;
 	NGE_LOCK(sc);
@@ -1581,12 +1510,11 @@ nge_start(ifp)
 }
 
 static void
-nge_start_locked(ifp)
-	struct ifnet		*ifp;
+nge_start_locked(struct ifnet *ifp)
 {
-	struct nge_softc	*sc;
-	struct mbuf		*m_head = NULL;
-	u_int32_t		idx;
+	struct nge_softc *sc;
+	struct mbuf *m_head = NULL;
+	uint32_t idx;
 
 	sc = ifp->if_softc;
 
@@ -1598,7 +1526,7 @@ nge_start_locked(ifp)
 	if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
 		return;
 
-	while(sc->nge_ldata->nge_tx_list[idx].nge_mbuf == NULL) {
+	while (sc->nge_ldata->nge_tx_list[idx].nge_mbuf == NULL) {
 		IF_DEQUEUE(&ifp->if_snd, m_head);
 		if (m_head == NULL)
 			break;
@@ -1625,15 +1553,12 @@ nge_start_locked(ifp)
 	 * Set a timeout in case the chip goes out to lunch.
 	 */
 	ifp->if_timer = 5;
-
-	return;
 }
 
 static void
-nge_init(xsc)
-	void			*xsc;
+nge_init(void *xsc)
 {
-	struct nge_softc	*sc = xsc;
+	struct nge_softc *sc = xsc;
 
 	NGE_LOCK(sc);
 	nge_init_locked(sc);
@@ -1641,11 +1566,10 @@ nge_init(xsc)
 }
 
 static void
-nge_init_locked(sc)
-	struct nge_softc	*sc;
+nge_init_locked(struct nge_softc *sc)
 {
-	struct ifnet		*ifp = sc->nge_ifp;
-	struct mii_data		*mii;
+	struct ifnet *ifp = sc->nge_ifp;
+	struct mii_data *mii;
 
 	NGE_LOCK_ASSERT(sc);
 
@@ -1666,13 +1590,13 @@ nge_init_locked(sc)
 	/* Set MAC address */
 	CSR_WRITE_4(sc, NGE_RXFILT_CTL, NGE_FILTADDR_PAR0);
 	CSR_WRITE_4(sc, NGE_RXFILT_DATA,
-	    ((u_int16_t *)IF_LLADDR(sc->nge_ifp))[0]);
+	    ((uint16_t *)IF_LLADDR(sc->nge_ifp))[0]);
 	CSR_WRITE_4(sc, NGE_RXFILT_CTL, NGE_FILTADDR_PAR1);
 	CSR_WRITE_4(sc, NGE_RXFILT_DATA,
-	    ((u_int16_t *)IF_LLADDR(sc->nge_ifp))[1]);
+	    ((uint16_t *)IF_LLADDR(sc->nge_ifp))[1]);
 	CSR_WRITE_4(sc, NGE_RXFILT_CTL, NGE_FILTADDR_PAR2);
 	CSR_WRITE_4(sc, NGE_RXFILT_DATA,
-	    ((u_int16_t *)IF_LLADDR(sc->nge_ifp))[2]);
+	    ((uint16_t *)IF_LLADDR(sc->nge_ifp))[2]);
 
 	/* Init circular RX list. */
 	if (nge_list_rx_init(sc) == ENOBUFS) {
@@ -1760,7 +1684,7 @@ nge_init_locked(sc)
 
 	/* Set full/half duplex mode. */
 	if (sc->nge_tbi) {
-		if ((sc->nge_ifmedia.ifm_cur->ifm_media & IFM_GMASK) 
+		if ((sc->nge_ifmedia.ifm_cur->ifm_media & IFM_GMASK)
 		    == IFM_FDX) {
 			NGE_SETBIT(sc, NGE_TX_CFG,
 			    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
@@ -1824,18 +1748,15 @@ nge_init_locked(sc)
 
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-
-	return;
 }
 
 /*
  * Set media options.
  */
 static int
-nge_ifmedia_upd(ifp)
-	struct ifnet		*ifp;
+nge_ifmedia_upd(struct ifnet *ifp)
 {
-	struct nge_softc	*sc;
+	struct nge_softc *sc;
 
 	sc = ifp->if_softc;
 	NGE_LOCK(sc);
@@ -1845,26 +1766,25 @@ nge_ifmedia_upd(ifp)
 }
 
 static void
-nge_ifmedia_upd_locked(ifp)
-	struct ifnet		*ifp;
+nge_ifmedia_upd_locked(struct ifnet *ifp)
 {
-	struct nge_softc	*sc;
-	struct mii_data		*mii;
+	struct nge_softc *sc;
+	struct mii_data *mii;
 
 	sc = ifp->if_softc;
 	NGE_LOCK_ASSERT(sc);
 
 	if (sc->nge_tbi) {
-		if (IFM_SUBTYPE(sc->nge_ifmedia.ifm_cur->ifm_media) 
+		if (IFM_SUBTYPE(sc->nge_ifmedia.ifm_cur->ifm_media)
 		     == IFM_AUTO) {
-			CSR_WRITE_4(sc, NGE_TBI_ANAR, 
+			CSR_WRITE_4(sc, NGE_TBI_ANAR,
 				CSR_READ_4(sc, NGE_TBI_ANAR)
 					| NGE_TBIANAR_HDX | NGE_TBIANAR_FDX
 					| NGE_TBIANAR_PS1 | NGE_TBIANAR_PS2);
 			CSR_WRITE_4(sc, NGE_TBI_BMCR, NGE_TBIBMCR_ENABLE_ANEG
 				| NGE_TBIBMCR_RESTART_ANEG);
 			CSR_WRITE_4(sc, NGE_TBI_BMCR, NGE_TBIBMCR_ENABLE_ANEG);
-		} else if ((sc->nge_ifmedia.ifm_cur->ifm_media 
+		} else if ((sc->nge_ifmedia.ifm_cur->ifm_media
 			    & IFM_GMASK) == IFM_FDX) {
 			NGE_SETBIT(sc, NGE_TX_CFG,
 			    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
@@ -1880,7 +1800,7 @@ nge_ifmedia_upd_locked(ifp)
 			CSR_WRITE_4(sc, NGE_TBI_ANAR, 0);
 			CSR_WRITE_4(sc, NGE_TBI_BMCR, 0);
 		}
-			
+
 		CSR_WRITE_4(sc, NGE_GPIO, CSR_READ_4(sc, NGE_GPIO)
 			    & ~NGE_GPIO_GP3_OUT);
 	} else {
@@ -1900,12 +1820,10 @@ nge_ifmedia_upd_locked(ifp)
  * Report current media status.
  */
 static void
-nge_ifmedia_sts(ifp, ifmr)
-	struct ifnet		*ifp;
-	struct ifmediareq	*ifmr;
+nge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
 {
-	struct nge_softc	*sc;
-	struct mii_data		*mii;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From yongari at FreeBSD.org  Sun Jun  7 05:46:13 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 05:46:32 2009
Subject: svn commit: r193616 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/nge
Message-ID: <200906070546.n575kCDE083329@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 05:46:12 2009
New Revision: 193616
URL: http://svn.freebsd.org/changeset/base/193616

Log:
  MFC r192506:
    bus_dma(9) conversion and make nge(4) work on all architectures.
    o Header file cleanup.
    o bus_dma(9) conversion.
      - Removed all consumers of vtophys(9) and converted to use
        bus_dma(9).
      - 64bit DMA support was disabled because DP83821 is not capable
        of handling the DMA request. 64bit DMA request on DP83820
        requires different descriptor structures and it's hard to
        dynamically change descriptor format at run time so I disabled
        it. Note, this is the same behavior as previous one but
        previously nge(4) didn't explicitly disable 64bit mode on
        DP83820.
      - Added Tx/Rx descriptor ring alignment requirements(8 bytes
        alignment).
      - Limit maximum number of Tx DMA segments to 16. In fact,
        controller does not seem to have limitations on number of Tx
        DMA segments but 16 should be enough for most cases and
        m_collapse(9) will handle highly fragmented frames without
        consuming a lot of CPU cycles.
      - Added Rx buffer alignment requirements(8 bytes alignment). This
        means driver should fixup received frames to align on 16bits
        boundary on strict-alignment architectures.
      - Nuked driver private data structure in descriptor ring.
      - Added endianness support code in Tx/Rx descriptor access.
    o Prefer faster memory mapped register access to I/O mapped access.
       Added fall-back mechanism to use alternative register access.
       The hardware supports both memory and I/O mapped access.
    o Added suspend/resume methods but it wasn't tested as controller I
      have does not support PCI PME.
    o Removed swap argument in nge_read_eeprom() since endianness
      should be handled after reading EEPROM.
    o Implemented experimental 802.3x full-duplex flow-control. ATM
      it was commented out but will be activated after we have generic
      flow-control framework in mii(4) layer.
    o Rearranged promiscuous mode settings and simplified logic.
    o Always disable Rx filter prior to changing Rx filter functions as
      indicated in DP83820/DP83821 datasheet.
    o Added an explicit DELAY in timeout loop of nge_reset().
    o Added a sysctl variable dev.nge.%d.int_holdoff to control
      interrupt moderation. Valid ranges are 1 to 255(default 1) in
      units of 100us. The actual delivery of interrupt would be delayed
      based on the sysctl value. The interface has to be brought down
      and up again before a change takes effect. With proper tuning
      value, users do not need to resort to polling(4) anymore.
    o Added ALTQ(4) support.
    o Added missing IFCAP_VLAN_HWCSUM as nge(4) can offload Tx/Rx
      checksum calculation on VLAN tagged frames as well as VLAN tag
      insertion/stripping. Also add IFCAP_VLAN_MTU capability as nge(4)
      can handle VLAN tagged oversized frames.
    o Fixed media header length for VLAN.
    o Rearranged nge_detach routine such that it's now used for general
      clean-up routine.
    o Enabled MWI.
    o Accessing EEPROM takes very long time so read 6 bytes ethernet
      address with one call instead of 3 separate accesses.
    o Don't set if_mtu in device attach, it's already set in
      ether_ifattach().
    o Don't do any special things for TBI interface. Remove TBI
      specific media handling in the driver and have gentbi(4) handle
      it. Add glue code to read/write TBI PHY registers in miibus
      method. This change removes a lot of PHY handling code in driver
      and now its functionality is handled by mii(4).
    o Alignment fixup code is now applied only for strict-alignment
      architectures. Previously the code was applied for all
      architectures except i386. With this change amd64 will get
      instant Rx performance boost.
    o When driver fails to allocate a new mbuf, update if_qdrops so
      users can see what was wrong in Rx path.
    o Added a workaround for a hardware bug which resulted in short
      VLAN tagged frames(e.g. ARP) was rejected as if runt frame was
      received. With this workaround nge(4) now accepts the short VLAN
      tagged frame and nge(4) can take full advantage of hardware VLAN
      tag stripping. I have no idea how this bug wasn't known so far,
      without the workaround nge(4) may never work on VLAN
      environments.
    o Fixed Rx checksum offload logic such that it now honors active
      interface capability configured with ifconfig(8).
    o In nge_start()/nge_txencap(), always leave at least one free
      descriptor as indicated in datasheet. Without this the hardware
      would be confused with ring descriptor structure(e.g. no clue
      for the end of descriptor ring).
    o Removed dead-code that checks interrupts on PHY hardware. The
      code was designed to detect link state changes but it was
      disabled as driving nge_tick clock would break auto-negotiation
      timer. This code is no longer needed as nge(4) now uses mii(4)
      and link state change handling is done with mii callback.
    o Rearranged ethernet address programming logic such that it works
       on strict-alignment architectures.
    o Added IFCAP_VLAN_HWTAGGING/IFCAP_VLAN_HWCSUM handler in
       nge_ioctl() such that the functionality is configurable with
       ifconfig(8). DP83820/DP83821 can do checksum offload for VLAN
       tagged frames so enable Tx/Rx checksum offload for VLAN
       interfaces.
    o Simplified IFCAP_POLLING selection logic in nge_ioctl().
    o Fixed module unload panic when bpf listeners are active.
    o Tx/Rx descriptor ring address uses 64bit DMA address for
       readability. High address part of DMA would be 0 as nge(4)
       disabled 64bit DMA transfers so it's ok for DP83821.
    o Removed volatile keyword in softc as bus_dmamap_sync(9) should
       take care of this.
    o Removed extra driver private structures in descriptor ring. These
       extra elements are not part of descriptor structure. Embedding
       private driver structure into descriptor ring is not good idea
       as its size may be different on 32bit/64bit architectures.
    o Added miibus_linkchg method handler to catch link state changes.
    o Removed unneeded nge_ifmedia in softc. All TBI access is handled
      in gentbi(4). There is no difference between TBI and non-TBI case
      now.
    o Removed "gigabit link up" message handling in nge_tick. Link
      state change notification is already performed by mii(4) and
      checking link state by accessing PHY registers in periodic timer
      handler of driver is wrong. All link state and speed/duplex
      monitoring should be handled in PHY driver.
    o Use our own timer for watchdog instead of if_watchdog/if_timer
      interface.
    o Added hardware MAC statistics counter, users canget current MAC
      statistics from dev.nge.%d.stats sysctl node(%d is unit number of
      a device).
    o Removed unused macros, NGE_LASTDESC, NGE_MODE, NGE_OWNDESC,
      NGE_RXBYTES.
    o Increased number of Tx/Rx descriptors from 128 to 256. From my
      experience on gigabit ethernet controllers, number of descriptors
      should be 256 or higher to get an optimal performance on gigabit
      link.
    o Increased jumbo frame length to 9022 bytes to cope with other
      gigabit ethernet drivers. Experimentation shows no problems with
      9022 bytes.
    o Removed unused member variables in softc.
    o Switched from bus_space_{read|write}_4 to bus_{read|write}_4.
    o Added support for WOL.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/nge/if_nge.c
  stable/7/sys/dev/nge/if_ngereg.h

Modified: stable/7/sys/dev/nge/if_nge.c
==============================================================================
--- stable/7/sys/dev/nge/if_nge.c	Sun Jun  7 05:41:13 2009	(r193615)
+++ stable/7/sys/dev/nge/if_nge.c	Sun Jun  7 05:46:12 2009	(r193616)
@@ -94,13 +94,20 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
 #include 
+#include 
 #include 
-#include 
+#include 
+#include 
 #include 
+#include 
+#include 
 
+#include 
 #include 
 #include 
 #include 
@@ -109,32 +116,23 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
-#include               /* for vtophys */
-#include             /* for vtophys */
-#include 
-#include 
-#include 
-#include 
-
 #include 
 #include 
 
 #include 
 #include 
 
-#define NGE_USEIOSPACE
+#include 
 
 #include 
 
+/* "device miibus" required.  See GENERIC if you get errors here. */
+#include "miibus_if.h"
+
 MODULE_DEPEND(nge, pci, 1, 1, 1);
 MODULE_DEPEND(nge, ether, 1, 1, 1);
 MODULE_DEPEND(nge, miibus, 1, 1, 1);
 
-/* "device miibus" required.  See GENERIC if you get errors here. */
-#include "miibus_if.h"
-
 #define NGE_CSUM_FEATURES	(CSUM_IP | CSUM_TCP | CSUM_UDP)
 
 /*
@@ -149,33 +147,38 @@ static struct nge_type nge_devs[] = {
 static int nge_probe(device_t);
 static int nge_attach(device_t);
 static int nge_detach(device_t);
+static int nge_shutdown(device_t);
+static int nge_suspend(device_t);
+static int nge_resume(device_t);
 
-static int nge_newbuf(struct nge_softc *, struct nge_desc *, struct mbuf *);
-static int nge_encap(struct nge_softc *, struct mbuf *, uint32_t *);
-#ifdef NGE_FIXUP_RX
-static __inline void nge_fixup_rx (struct mbuf *);
+static __inline void nge_discard_rxbuf(struct nge_softc *, int);
+static int nge_newbuf(struct nge_softc *, int);
+static int nge_encap(struct nge_softc *, struct mbuf **);
+#ifndef __NO_STRICT_ALIGNMENT
+static __inline void nge_fixup_rx(struct mbuf *);
 #endif
 static void nge_rxeof(struct nge_softc *);
 static void nge_txeof(struct nge_softc *);
 static void nge_intr(void *);
 static void nge_tick(void *);
+static void nge_stats_update(struct nge_softc *);
 static void nge_start(struct ifnet *);
 static void nge_start_locked(struct ifnet *);
 static int nge_ioctl(struct ifnet *, u_long, caddr_t);
 static void nge_init(void *);
 static void nge_init_locked(struct nge_softc *);
+static int nge_stop_mac(struct nge_softc *);
 static void nge_stop(struct nge_softc *);
-static void nge_watchdog(struct ifnet *);
-static int nge_shutdown(device_t);
-static int nge_ifmedia_upd(struct ifnet *);
-static void nge_ifmedia_upd_locked(struct ifnet *);
-static void nge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static void nge_wol(struct nge_softc *);
+static void nge_watchdog(struct nge_softc *);
+static int nge_mediachange(struct ifnet *);
+static void nge_mediastatus(struct ifnet *, struct ifmediareq *);
 
 static void nge_delay(struct nge_softc *);
 static void nge_eeprom_idle(struct nge_softc *);
 static void nge_eeprom_putbyte(struct nge_softc *, int);
 static void nge_eeprom_getword(struct nge_softc *, int, uint16_t *);
-static void nge_read_eeprom(struct nge_softc *, caddr_t, int, int, int);
+static void nge_read_eeprom(struct nge_softc *, caddr_t, int, int);
 
 static void nge_mii_sync(struct nge_softc *);
 static void nge_mii_send(struct nge_softc *, uint32_t, int);
@@ -186,18 +189,16 @@ static int nge_miibus_readreg(device_t, 
 static int nge_miibus_writereg(device_t, int, int, int);
 static void nge_miibus_statchg(device_t);
 
-static void nge_setmulti(struct nge_softc *);
+static void nge_rxfilter(struct nge_softc *);
 static void nge_reset(struct nge_softc *);
+static void nge_dmamap_cb(void *, bus_dma_segment_t *, int, int);
+static int nge_dma_alloc(struct nge_softc *);
+static void nge_dma_free(struct nge_softc *);
 static int nge_list_rx_init(struct nge_softc *);
 static int nge_list_tx_init(struct nge_softc *);
-
-#ifdef NGE_USEIOSPACE
-#define NGE_RES			SYS_RES_IOPORT
-#define NGE_RID			NGE_PCI_LOIO
-#else
-#define NGE_RES			SYS_RES_MEMORY
-#define NGE_RID			NGE_PCI_LOMEM
-#endif
+static void nge_sysctl_node(struct nge_softc *);
+static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int);
+static int sysctl_hw_nge_int_holdoff(SYSCTL_HANDLER_ARGS);
 
 static device_method_t nge_methods[] = {
 	/* Device interface */
@@ -205,6 +206,8 @@ static device_method_t nge_methods[] = {
 	DEVMETHOD(device_attach,	nge_attach),
 	DEVMETHOD(device_detach,	nge_detach),
 	DEVMETHOD(device_shutdown,	nge_shutdown),
+	DEVMETHOD(device_suspend,	nge_suspend),
+	DEVMETHOD(device_resume,	nge_resume),
 
 	/* bus interface */
 	DEVMETHOD(bus_print_child,	bus_generic_print_child),
@@ -215,7 +218,7 @@ static device_method_t nge_methods[] = {
 	DEVMETHOD(miibus_writereg,	nge_miibus_writereg),
 	DEVMETHOD(miibus_statchg,	nge_miibus_statchg),
 
-	{ 0, 0 }
+	{ NULL, NULL }
 };
 
 static driver_t nge_driver = {
@@ -350,7 +353,7 @@ nge_eeprom_getword(struct nge_softc *sc,
  * Read a sequence of words from the EEPROM.
  */
 static void
-nge_read_eeprom(struct nge_softc *sc, caddr_t dest, int off, int cnt, int swap)
+nge_read_eeprom(struct nge_softc *sc, caddr_t dest, int off, int cnt)
 {
 	int i;
 	uint16_t word = 0, *ptr;
@@ -358,10 +361,7 @@ nge_read_eeprom(struct nge_softc *sc, ca
 	for (i = 0; i < cnt; i++) {
 		nge_eeprom_getword(sc, off + i, &word);
 		ptr = (uint16_t *)(dest + (i * 2));
-		if (swap)
-			*ptr = ntohs(word);
-		else
-			*ptr = word;
+		*ptr = word;
 	}
 }
 
@@ -540,8 +540,48 @@ nge_miibus_readreg(device_t dev, int phy
 {
 	struct nge_softc *sc;
 	struct nge_mii_frame frame;
+	int rv;
 
 	sc = device_get_softc(dev);
+	if ((sc->nge_flags & NGE_FLAG_TBI) != 0) {
+		/* Pretend PHY is at address 0. */
+		if (phy != 0)
+			return (0);
+		switch (reg) {
+		case MII_BMCR:
+			reg = NGE_TBI_BMCR;
+			break;
+		case MII_BMSR:
+			/* 83820/83821 has different bit layout for BMSR. */
+			rv = BMSR_ANEG | BMSR_EXTCAP | BMSR_EXTSTAT;
+			reg = CSR_READ_4(sc, NGE_TBI_BMSR);
+			if ((reg & NGE_TBIBMSR_ANEG_DONE) != 0)
+				rv |= BMSR_ACOMP;
+			if ((reg & NGE_TBIBMSR_LINKSTAT) != 0)
+				rv |= BMSR_LINK;
+			return (rv);
+		case MII_ANAR:
+			reg = NGE_TBI_ANAR;
+			break;
+		case MII_ANLPAR:
+			reg = NGE_TBI_ANLPAR;
+			break;
+		case MII_ANER:
+			reg = NGE_TBI_ANER;
+			break;
+		case MII_EXTSR:
+			reg = NGE_TBI_ESR;
+			break;
+		case MII_PHYIDR1:
+		case MII_PHYIDR2:
+			return (0);
+		default:
+			device_printf(sc->nge_dev,
+			    "bad phy register read : %d\n", reg);
+			return (0);
+		}
+		return (CSR_READ_4(sc, reg));
+	}
 
 	bzero((char *)&frame, sizeof(frame));
 
@@ -559,6 +599,39 @@ nge_miibus_writereg(device_t dev, int ph
 	struct nge_mii_frame frame;
 
 	sc = device_get_softc(dev);
+	if ((sc->nge_flags & NGE_FLAG_TBI) != 0) {
+		/* Pretend PHY is at address 0. */
+		if (phy != 0)
+			return (0);
+		switch (reg) {
+		case MII_BMCR:
+			reg = NGE_TBI_BMCR;
+			break;
+		case MII_BMSR:
+			return (0);
+		case MII_ANAR:
+			reg = NGE_TBI_ANAR;
+			break;
+		case MII_ANLPAR:
+			reg = NGE_TBI_ANLPAR;
+			break;
+		case MII_ANER:
+			reg = NGE_TBI_ANER;
+			break;
+		case MII_EXTSR:
+			reg = NGE_TBI_ESR;
+			break;
+		case MII_PHYIDR1:
+		case MII_PHYIDR2:
+			return (0);
+		default:
+			device_printf(sc->nge_dev,
+			    "bad phy register write : %d\n", reg);
+			return (0);
+		}
+		CSR_WRITE_4(sc, reg, data);
+		return (0);
+	}
 
 	bzero((char *)&frame, sizeof(frame));
 
@@ -570,90 +643,213 @@ nge_miibus_writereg(device_t dev, int ph
 	return (0);
 }
 
+/*
+ * media status/link state change handler.
+ */
 static void
 nge_miibus_statchg(device_t dev)
 {
-	int status;
 	struct nge_softc *sc;
 	struct mii_data *mii;
+	struct ifnet *ifp;
+	struct nge_txdesc *txd;
+	uint32_t done, reg, status;
+	int i;
 
 	sc = device_get_softc(dev);
-	if (sc->nge_tbi) {
-		if (IFM_SUBTYPE(sc->nge_ifmedia.ifm_cur->ifm_media)
-		    == IFM_AUTO) {
-			status = CSR_READ_4(sc, NGE_TBI_ANLPAR);
-			if (status == 0 || status & NGE_TBIANAR_FDX) {
-				NGE_SETBIT(sc, NGE_TX_CFG,
-				    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
-				NGE_SETBIT(sc, NGE_RX_CFG, NGE_RXCFG_RX_FDX);
-			} else {
-				NGE_CLRBIT(sc, NGE_TX_CFG,
-				    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
-				NGE_CLRBIT(sc, NGE_RX_CFG, NGE_RXCFG_RX_FDX);
-			}
+	NGE_LOCK_ASSERT(sc);
 
-		} else if ((sc->nge_ifmedia.ifm_cur->ifm_media & IFM_GMASK)
-			!= IFM_FDX) {
-			NGE_CLRBIT(sc, NGE_TX_CFG,
-			    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
-			NGE_CLRBIT(sc, NGE_RX_CFG, NGE_RXCFG_RX_FDX);
-		} else {
-			NGE_SETBIT(sc, NGE_TX_CFG,
-			    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
-			NGE_SETBIT(sc, NGE_RX_CFG, NGE_RXCFG_RX_FDX);
+	mii = device_get_softc(sc->nge_miibus);
+	ifp = sc->nge_ifp;
+	if (mii == NULL || ifp == NULL ||
+	    (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+		return;
+
+	sc->nge_flags &= ~NGE_FLAG_LINK;
+	if ((mii->mii_media_status & (IFM_AVALID | IFM_ACTIVE)) ==
+	    (IFM_AVALID | IFM_ACTIVE)) {
+		switch (IFM_SUBTYPE(mii->mii_media_active)) {
+		case IFM_10_T:
+		case IFM_100_TX:
+		case IFM_1000_T:
+		case IFM_1000_SX:
+		case IFM_1000_LX:
+		case IFM_1000_CX:
+			sc->nge_flags |= NGE_FLAG_LINK;
+			break;
+		default:
+			break;
 		}
-	} else {
-		mii = device_get_softc(sc->nge_miibus);
+	}
+
+	/* Stop Tx/Rx MACs. */
+	if (nge_stop_mac(sc) == ETIMEDOUT)
+		device_printf(sc->nge_dev,
+		    "%s: unable to stop Tx/Rx MAC\n", __func__);
+	nge_txeof(sc);
+	nge_rxeof(sc);
+	if (sc->nge_head != NULL) {
+		m_freem(sc->nge_head);
+		sc->nge_head = sc->nge_tail = NULL;
+	}
+
+	/* Release queued frames. */
+	for (i = 0; i < NGE_TX_RING_CNT; i++) {
+		txd = &sc->nge_cdata.nge_txdesc[i];
+		if (txd->tx_m != NULL) {
+			bus_dmamap_sync(sc->nge_cdata.nge_tx_tag,
+			    txd->tx_dmamap, BUS_DMASYNC_POSTWRITE);
+			bus_dmamap_unload(sc->nge_cdata.nge_tx_tag,
+			    txd->tx_dmamap);
+			m_freem(txd->tx_m);
+			txd->tx_m = NULL;
+		}
+	}
 
-		if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) {
-		        NGE_SETBIT(sc, NGE_TX_CFG,
-			    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
+	/* Program MAC with resolved speed/duplex. */
+	if ((sc->nge_flags & NGE_FLAG_LINK) != 0) {
+		if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) {
+			NGE_SETBIT(sc, NGE_TX_CFG,
+			    (NGE_TXCFG_IGN_HBEAT | NGE_TXCFG_IGN_CARR));
 			NGE_SETBIT(sc, NGE_RX_CFG, NGE_RXCFG_RX_FDX);
+#ifdef notyet
+			/* Enable flow-control. */
+			if ((IFM_OPTIONS(mii->mii_media_active) &
+			    (IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE)) != 0)
+				NGE_SETBIT(sc, NGE_PAUSECSR,
+				    NGE_PAUSECSR_PAUSE_ENB);
+#endif
 		} else {
 			NGE_CLRBIT(sc, NGE_TX_CFG,
-			    (NGE_TXCFG_IGN_HBEAT|NGE_TXCFG_IGN_CARR));
+			    (NGE_TXCFG_IGN_HBEAT | NGE_TXCFG_IGN_CARR));
 			NGE_CLRBIT(sc, NGE_RX_CFG, NGE_RXCFG_RX_FDX);
+			NGE_CLRBIT(sc, NGE_PAUSECSR, NGE_PAUSECSR_PAUSE_ENB);
 		}
-
 		/* If we have a 1000Mbps link, set the mode_1000 bit. */
-		if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T ||
-		    IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) {
-			NGE_SETBIT(sc, NGE_CFG, NGE_CFG_MODE_1000);
-		} else {
-			NGE_CLRBIT(sc, NGE_CFG, NGE_CFG_MODE_1000);
+		reg = CSR_READ_4(sc, NGE_CFG);
+		switch (IFM_SUBTYPE(mii->mii_media_active)) {
+		case IFM_1000_SX:
+		case IFM_1000_LX:
+		case IFM_1000_CX:
+		case IFM_1000_T:
+			reg |= NGE_CFG_MODE_1000;
+			break;
+		default:
+			reg &= ~NGE_CFG_MODE_1000;
+			break;
+		}
+		CSR_WRITE_4(sc, NGE_CFG, reg);
+
+		/* Reset Tx/Rx MAC. */
+		reg = CSR_READ_4(sc, NGE_CSR);
+		reg |= NGE_CSR_TX_RESET | NGE_CSR_RX_RESET;
+		CSR_WRITE_4(sc, NGE_CSR, reg);
+		/* Check the completion of reset. */
+		done = 0;
+		for (i = 0; i < NGE_TIMEOUT; i++) {
+			DELAY(1);
+			status = CSR_READ_4(sc, NGE_ISR);
+			if ((status & NGE_ISR_RX_RESET_DONE) != 0)
+				done |= NGE_ISR_RX_RESET_DONE;
+			if ((status & NGE_ISR_TX_RESET_DONE) != 0)
+				done |= NGE_ISR_TX_RESET_DONE;
+			if (done ==
+			    (NGE_ISR_TX_RESET_DONE | NGE_ISR_RX_RESET_DONE))
+				break;
+		}
+		if (i == NGE_TIMEOUT)
+			device_printf(sc->nge_dev,
+			    "%s: unable to reset Tx/Rx MAC\n", __func__);
+		/* Reuse Rx buffer and reset consumer pointer. */
+		sc->nge_cdata.nge_rx_cons = 0;
+		/*
+		 * It seems that resetting Rx/Tx MAC results in
+		 * resetting Tx/Rx descriptor pointer registers such
+		 * that reloading Tx/Rx lists address are needed.
+		 */
+		CSR_WRITE_4(sc, NGE_RX_LISTPTR_HI,
+		    NGE_ADDR_HI(sc->nge_rdata.nge_rx_ring_paddr));
+		CSR_WRITE_4(sc, NGE_RX_LISTPTR_LO,
+		    NGE_ADDR_LO(sc->nge_rdata.nge_rx_ring_paddr));
+		CSR_WRITE_4(sc, NGE_TX_LISTPTR_HI,
+		    NGE_ADDR_HI(sc->nge_rdata.nge_tx_ring_paddr));
+		CSR_WRITE_4(sc, NGE_TX_LISTPTR_LO,
+		    NGE_ADDR_LO(sc->nge_rdata.nge_tx_ring_paddr));
+		/* Reinitialize Tx buffers. */
+		nge_list_tx_init(sc);
+
+		/* Restart Rx MAC. */
+		reg = CSR_READ_4(sc, NGE_CSR);
+		reg |= NGE_CSR_RX_ENABLE;
+		CSR_WRITE_4(sc, NGE_CSR, reg);
+		for (i = 0; i < NGE_TIMEOUT; i++) {
+			if ((CSR_READ_4(sc, NGE_CSR) & NGE_CSR_RX_ENABLE) != 0)
+				break;
+			DELAY(1);
 		}
+		if (i == NGE_TIMEOUT)
+			device_printf(sc->nge_dev,
+			    "%s: unable to restart Rx MAC\n", __func__);
 	}
+
+	/* Data LED off for TBI mode */
+	if ((sc->nge_flags & NGE_FLAG_TBI) != 0)
+		CSR_WRITE_4(sc, NGE_GPIO,
+		    CSR_READ_4(sc, NGE_GPIO) & ~NGE_GPIO_GP3_OUT);
 }
 
 static void
-nge_setmulti(struct nge_softc *sc)
+nge_rxfilter(struct nge_softc *sc)
 {
 	struct ifnet *ifp;
 	struct ifmultiaddr *ifma;
-	uint32_t h = 0, i, filtsave;
+	uint32_t h, i, rxfilt;
 	int bit, index;
 
 	NGE_LOCK_ASSERT(sc);
 	ifp = sc->nge_ifp;
 
-	if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
-		NGE_CLRBIT(sc, NGE_RXFILT_CTL,
-		    NGE_RXFILTCTL_MCHASH|NGE_RXFILTCTL_UCHASH);
-		NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_ALLMULTI);
-		return;
+	/* Make sure to stop Rx filtering. */
+	rxfilt = CSR_READ_4(sc, NGE_RXFILT_CTL);
+	rxfilt &= ~NGE_RXFILTCTL_ENABLE;
+	CSR_WRITE_4(sc, NGE_RXFILT_CTL, rxfilt);
+	CSR_BARRIER_WRITE_4(sc, NGE_RXFILT_CTL);
+
+	rxfilt &= ~(NGE_RXFILTCTL_ALLMULTI | NGE_RXFILTCTL_ALLPHYS);
+	rxfilt &= ~NGE_RXFILTCTL_BROAD;
+	/*
+	 * We don't want to use the hash table for matching unicast
+	 * addresses.
+	 */
+	rxfilt &= ~(NGE_RXFILTCTL_MCHASH | NGE_RXFILTCTL_UCHASH);
+
+	/*
+	 * For the NatSemi chip, we have to explicitly enable the
+	 * reception of ARP frames, as well as turn on the 'perfect
+	 * match' filter where we store the station address, otherwise
+	 * we won't receive unicasts meant for this host.
+	 */
+	rxfilt |= NGE_RXFILTCTL_ARP | NGE_RXFILTCTL_PERFECT;
+
+	/*
+	 * Set the capture broadcast bit to capture broadcast frames.
+	 */
+	if ((ifp->if_flags & IFF_BROADCAST) != 0)
+		rxfilt |= NGE_RXFILTCTL_BROAD;
+
+	if ((ifp->if_flags & IFF_PROMISC) != 0 ||
+	    (ifp->if_flags & IFF_ALLMULTI) != 0) {
+		rxfilt |= NGE_RXFILTCTL_ALLMULTI;
+		if ((ifp->if_flags & IFF_PROMISC) != 0)
+			rxfilt |= NGE_RXFILTCTL_ALLPHYS;
+		goto done;
 	}
 
 	/*
 	 * We have to explicitly enable the multicast hash table
 	 * on the NatSemi chip if we want to use it, which we do.
-	 * We also have to tell it that we don't want to use the
-	 * hash table for matching unicast addresses.
 	 */
-	NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_MCHASH);
-	NGE_CLRBIT(sc, NGE_RXFILT_CTL,
-	    NGE_RXFILTCTL_ALLMULTI|NGE_RXFILTCTL_UCHASH);
-
-	filtsave = CSR_READ_4(sc, NGE_RXFILT_CTL);
+	rxfilt |= NGE_RXFILTCTL_MCHASH;
 
 	/* first, zot all the existing hash bits */
 	for (i = 0; i < NGE_MCAST_FILTER_LEN; i += 2) {
@@ -681,12 +877,18 @@ nge_setmulti(struct nge_softc *sc)
 	}
 	IF_ADDR_UNLOCK(ifp);
 
-	CSR_WRITE_4(sc, NGE_RXFILT_CTL, filtsave);
+done:
+	CSR_WRITE_4(sc, NGE_RXFILT_CTL, rxfilt);
+	/* Turn the receive filter on. */
+	rxfilt |= NGE_RXFILTCTL_ENABLE;
+	CSR_WRITE_4(sc, NGE_RXFILT_CTL, rxfilt);
+	CSR_BARRIER_WRITE_4(sc, NGE_RXFILT_CTL);
 }
 
 static void
 nge_reset(struct nge_softc *sc)
 {
+	uint32_t v;
 	int i;
 
 	NGE_SETBIT(sc, NGE_CSR, NGE_CSR_RESET);
@@ -694,6 +896,7 @@ nge_reset(struct nge_softc *sc)
 	for (i = 0; i < NGE_TIMEOUT; i++) {
 		if (!(CSR_READ_4(sc, NGE_CSR) & NGE_CSR_RESET))
 			break;
+		DELAY(1);
 	}
 
 	if (i == NGE_TIMEOUT)
@@ -708,6 +911,18 @@ nge_reset(struct nge_softc *sc)
 	 */
 	CSR_WRITE_4(sc, NGE_CLKRUN, NGE_CLKRUN_PMESTS);
 	CSR_WRITE_4(sc, NGE_CLKRUN, 0);
+
+	/* Clear WOL events which may interfere normal Rx filter opertaion. */
+	CSR_WRITE_4(sc, NGE_WOLCSR, 0);
+
+	/*
+	 * Only DP83820 supports 64bits addressing/data transfers and
+	 * 64bit addressing requires different descriptor structures.
+	 * To make it simple, disable 64bit addressing/data transfers.
+	 */
+	v = CSR_READ_4(sc, NGE_CFG);
+	v &= ~(NGE_CFG_64BIT_ADDR_ENB | NGE_CFG_64BIT_DATA_ENB);
+	CSR_WRITE_4(sc, NGE_CFG, v);
 }
 
 /*
@@ -740,11 +955,13 @@ nge_probe(device_t dev)
 static int
 nge_attach(device_t dev)
 {
-	u_char eaddr[ETHER_ADDR_LEN];
+	uint8_t eaddr[ETHER_ADDR_LEN];
+	uint16_t ea[ETHER_ADDR_LEN/2], ea_temp, reg;
 	struct nge_softc *sc;
-	struct ifnet *ifp = NULL;
-	int error = 0, rid;
+	struct ifnet *ifp;
+	int error, i, rid;
 
+	error = 0;
 	sc = device_get_softc(dev);
 	sc->nge_dev = dev;
 
@@ -756,18 +973,35 @@ nge_attach(device_t dev)
 	 */
 	pci_enable_busmaster(dev);
 
-	rid = NGE_RID;
-	sc->nge_res = bus_alloc_resource_any(dev, NGE_RES, &rid, RF_ACTIVE);
+#ifdef NGE_USEIOSPACE
+	sc->nge_res_type = SYS_RES_IOPORT;
+	sc->nge_res_id = PCIR_BAR(0);
+#else
+	sc->nge_res_type = SYS_RES_MEMORY;
+	sc->nge_res_id = PCIR_BAR(1);
+#endif
+	sc->nge_res = bus_alloc_resource_any(dev, sc->nge_res_type,
+	    &sc->nge_res_id, RF_ACTIVE);
 
 	if (sc->nge_res == NULL) {
-		device_printf(dev, "couldn't map ports/memory\n");
-		error = ENXIO;
-		goto fail;
+		if (sc->nge_res_type == SYS_RES_MEMORY) {
+			sc->nge_res_type = SYS_RES_IOPORT;
+			sc->nge_res_id = PCIR_BAR(0);
+		} else {
+			sc->nge_res_type = SYS_RES_MEMORY;
+			sc->nge_res_id = PCIR_BAR(1);
+		}
+		sc->nge_res = bus_alloc_resource_any(dev, sc->nge_res_type,
+		    &sc->nge_res_id, RF_ACTIVE);
+		if (sc->nge_res == NULL) {
+			device_printf(dev, "couldn't allocate %s resources\n",
+			    sc->nge_res_type == SYS_RES_MEMORY ? "memory" :
+			    "I/O");
+			NGE_LOCK_DESTROY(sc);
+			return (ENXIO);
+		}
 	}
 
-	sc->nge_btag = rman_get_bustag(sc->nge_res);
-	sc->nge_bhandle = rman_get_bushandle(sc->nge_res);
-
 	/* Allocate interrupt */
 	rid = 0;
 	sc->nge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
@@ -779,83 +1013,77 @@ nge_attach(device_t dev)
 		goto fail;
 	}
 
+	/* Enable MWI. */
+	reg = pci_read_config(dev, PCIR_COMMAND, 2);
+	reg |= PCIM_CMD_MWRICEN;
+	pci_write_config(dev, PCIR_COMMAND, reg, 2);
+
 	/* Reset the adapter. */
 	nge_reset(sc);
 
 	/*
 	 * Get station address from the EEPROM.
 	 */
-	nge_read_eeprom(sc, (caddr_t)&eaddr[4], NGE_EE_NODEADDR, 1, 0);
-	nge_read_eeprom(sc, (caddr_t)&eaddr[2], NGE_EE_NODEADDR + 1, 1, 0);
-	nge_read_eeprom(sc, (caddr_t)&eaddr[0], NGE_EE_NODEADDR + 2, 1, 0);
+	nge_read_eeprom(sc, (caddr_t)ea, NGE_EE_NODEADDR, 3);
+	for (i = 0; i < ETHER_ADDR_LEN / 2; i++)
+		ea[i] = le16toh(ea[i]);
+	ea_temp = ea[0];
+	ea[0] = ea[2];
+	ea[2] = ea_temp;
+	bcopy(ea, eaddr, sizeof(eaddr));
 
-	sc->nge_ldata = contigmalloc(sizeof(struct nge_list_data), M_DEVBUF,
-	    M_NOWAIT|M_ZERO, 0, 0xffffffff, PAGE_SIZE, 0);
-
-	if (sc->nge_ldata == NULL) {
-		device_printf(dev, "no memory for list buffers!\n");
+	if (nge_dma_alloc(sc) != 0) {
 		error = ENXIO;
 		goto fail;
 	}
 
+	nge_sysctl_node(sc);
+
 	ifp = sc->nge_ifp = if_alloc(IFT_ETHER);
 	if (ifp == NULL) {
-		device_printf(dev, "can not if_alloc()\n");
+		device_printf(dev, "can not allocate ifnet structure\n");
 		error = ENOSPC;
 		goto fail;
 	}
 	ifp->if_softc = sc;
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	ifp->if_mtu = ETHERMTU;
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = nge_ioctl;
 	ifp->if_start = nge_start;
-	ifp->if_watchdog = nge_watchdog;
 	ifp->if_init = nge_init;
-	ifp->if_snd.ifq_maxlen = NGE_TX_LIST_CNT - 1;
+	ifp->if_snd.ifq_drv_maxlen = NGE_TX_RING_CNT - 1;
+	IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
+	IFQ_SET_READY(&ifp->if_snd);
 	ifp->if_hwassist = NGE_CSUM_FEATURES;
-	ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING;
+	ifp->if_capabilities = IFCAP_HWCSUM;
+	/*
+	 * It seems that some hardwares doesn't provide 3.3V auxiliary
+	 * supply(3VAUX) to drive PME such that checking PCI power
+	 * management capability is necessary.
+	 */
+	if (pci_find_extcap(sc->nge_dev, PCIY_PMG, &i) == 0)
+		ifp->if_capabilities |= IFCAP_WOL;
 	ifp->if_capenable = ifp->if_capabilities;
-#ifdef DEVICE_POLLING
-	ifp->if_capabilities |= IFCAP_POLLING;
-#endif
+
+	if ((CSR_READ_4(sc, NGE_CFG) & NGE_CFG_TBI_EN) != 0) {
+		sc->nge_flags |= NGE_FLAG_TBI;
+		device_printf(dev, "Using TBI\n");
+		/* Configure GPIO. */
+		CSR_WRITE_4(sc, NGE_GPIO, CSR_READ_4(sc, NGE_GPIO)
+		    | NGE_GPIO_GP4_OUT
+		    | NGE_GPIO_GP1_OUTENB | NGE_GPIO_GP2_OUTENB
+		    | NGE_GPIO_GP3_OUTENB
+		    | NGE_GPIO_GP3_IN | NGE_GPIO_GP4_IN);
+	}
 
 	/*
 	 * Do MII setup.
 	 */
-	/* XXX: leaked on error */
-	if (mii_phy_probe(dev, &sc->nge_miibus,
-			  nge_ifmedia_upd, nge_ifmedia_sts)) {
-		if (CSR_READ_4(sc, NGE_CFG) & NGE_CFG_TBI_EN) {
-			sc->nge_tbi = 1;
-			device_printf(dev, "Using TBI\n");
-
-			sc->nge_miibus = dev;
-
-			ifmedia_init(&sc->nge_ifmedia, 0, nge_ifmedia_upd,
-				nge_ifmedia_sts);
-#define	ADD(m, c)	ifmedia_add(&sc->nge_ifmedia, (m), (c), NULL)
-			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, 0), 0);
-			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, 0, 0), 0);
-			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, 0),0);
-			ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, 0), 0);
-#undef ADD
-			device_printf(dev, " 1000baseSX, 1000baseSX-FDX, auto\n");
-
-			ifmedia_set(&sc->nge_ifmedia,
-				IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, 0));
-
-			CSR_WRITE_4(sc, NGE_GPIO, CSR_READ_4(sc, NGE_GPIO)
-				| NGE_GPIO_GP4_OUT
-				| NGE_GPIO_GP1_OUTENB | NGE_GPIO_GP2_OUTENB
-				| NGE_GPIO_GP3_OUTENB
-				| NGE_GPIO_GP3_IN | NGE_GPIO_GP4_IN);
-
-		} else {
-			device_printf(dev, "MII without any PHY!\n");
-			error = ENXIO;
-			goto fail;
-		}
+	error = mii_phy_probe(dev, &sc->nge_miibus, nge_mediachange,
+	    nge_mediastatus);
+	if (error != 0) {
+		device_printf(dev, "no PHY found!\n");
+		goto fail;
 	}
 
 	/*
@@ -863,6 +1091,20 @@ nge_attach(device_t dev)
 	 */
 	ether_ifattach(ifp, eaddr);
 
+	/* VLAN capability setup. */
+	ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
+	ifp->if_capabilities |= IFCAP_VLAN_HWCSUM;
+	ifp->if_capenable = ifp->if_capabilities;
+#ifdef DEVICE_POLLING
+	ifp->if_capabilities |= IFCAP_POLLING;
+#endif
+	/*
+	 * Tell the upper layer(s) we support long frames.
+	 * Must appear after the call to ether_ifattach() because
+	 * ether_ifattach() sets ifi_hdrlen to the default value.
+	 */
+	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
+
 	/*
 	 * Hookup IRQ last.
 	 */
@@ -873,19 +1115,9 @@ nge_attach(device_t dev)
 		goto fail;
 	}
 
-	return (0);
-
 fail:
-	if (sc->nge_ldata)
-		contigfree(sc->nge_ldata,
-		  sizeof(struct nge_list_data), M_DEVBUF);
-	if (ifp)
-		if_free(ifp);
-	if (sc->nge_irq)
-		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->nge_irq);
-	if (sc->nge_res)
-		bus_release_resource(dev, NGE_RES, NGE_RID, sc->nge_res);
-	NGE_LOCK_DESTROY(sc);
+	if (error != 0)
+		nge_detach(dev);
 	return (error);
 }
 
@@ -899,68 +1131,339 @@ nge_detach(device_t dev)
 	ifp = sc->nge_ifp;
 
 #ifdef DEVICE_POLLING
-	if (ifp->if_capenable & IFCAP_POLLING)
+	if (ifp != NULL && ifp->if_capenable & IFCAP_POLLING)
 		ether_poll_deregister(ifp);
 #endif
-	NGE_LOCK(sc);
-	nge_reset(sc);
-	nge_stop(sc);
-	NGE_UNLOCK(sc);
-	callout_drain(&sc->nge_stat_ch);
-	ether_ifdetach(ifp);
 
-	bus_generic_detach(dev);
-	if (!sc->nge_tbi) {
+	if (device_is_attached(dev)) {
+		NGE_LOCK(sc);
+		sc->nge_flags |= NGE_FLAG_DETACH;
+		nge_stop(sc);
+		NGE_UNLOCK(sc);
+		callout_drain(&sc->nge_stat_ch);
+		if (ifp != NULL)
+			ether_ifdetach(ifp);
+	}
+
+	if (sc->nge_miibus != NULL) {
 		device_delete_child(dev, sc->nge_miibus);
+		sc->nge_miibus = NULL;
 	}
-	bus_teardown_intr(dev, sc->nge_irq, sc->nge_intrhand);
-	bus_release_resource(dev, SYS_RES_IRQ, 0, sc->nge_irq);
-	bus_release_resource(dev, NGE_RES, NGE_RID, sc->nge_res);
+	bus_generic_detach(dev);
+	if (sc->nge_intrhand != NULL)
+		bus_teardown_intr(dev, sc->nge_irq, sc->nge_intrhand);
+	if (sc->nge_irq != NULL)
+		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->nge_irq);
+	if (sc->nge_res != NULL)
+		bus_release_resource(dev, sc->nge_res_type, sc->nge_res_id,
+		    sc->nge_res);
 
-	contigfree(sc->nge_ldata, sizeof(struct nge_list_data), M_DEVBUF);
-	if_free(ifp);
+	nge_dma_free(sc);
+	if (ifp != NULL)
+		if_free(ifp);
 
 	NGE_LOCK_DESTROY(sc);
 
 	return (0);
 }
 
+struct nge_dmamap_arg {
+	bus_addr_t	nge_busaddr;
+};
+
+static void
+nge_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error)
+{
+	struct nge_dmamap_arg *ctx;
+
+	if (error != 0)
+		return;
+	ctx = arg;
+	ctx->nge_busaddr = segs[0].ds_addr;
+}
+
+static int
+nge_dma_alloc(struct nge_softc *sc)
+{
+	struct nge_dmamap_arg ctx;
+	struct nge_txdesc *txd;
+	struct nge_rxdesc *rxd;
+	int error, i;
+
+	/* Create parent DMA tag. */
+	error = bus_dma_tag_create(
+	    bus_get_dma_tag(sc->nge_dev),	/* parent */
+	    1, 0,			/* alignment, boundary */
+	    BUS_SPACE_MAXADDR_32BIT,	/* lowaddr */
+	    BUS_SPACE_MAXADDR,		/* highaddr */
+	    NULL, NULL,			/* filter, filterarg */
+	    BUS_SPACE_MAXSIZE_32BIT,	/* maxsize */
+	    0,				/* nsegments */
+	    BUS_SPACE_MAXSIZE_32BIT,	/* maxsegsize */
+	    0,				/* flags */
+	    NULL, NULL,			/* lockfunc, lockarg */
+	    &sc->nge_cdata.nge_parent_tag);
+	if (error != 0) {
+		device_printf(sc->nge_dev, "failed to create parent DMA tag\n");
+		goto fail;
+	}
+	/* Create tag for Tx ring. */
+	error = bus_dma_tag_create(sc->nge_cdata.nge_parent_tag,/* parent */
+	    NGE_RING_ALIGN, 0,		/* alignment, boundary */
+	    BUS_SPACE_MAXADDR,		/* lowaddr */
+	    BUS_SPACE_MAXADDR,		/* highaddr */
+	    NULL, NULL,			/* filter, filterarg */
+	    NGE_TX_RING_SIZE,		/* maxsize */
+	    1,				/* nsegments */
+	    NGE_TX_RING_SIZE,		/* maxsegsize */
+	    0,				/* flags */
+	    NULL, NULL,			/* lockfunc, lockarg */
+	    &sc->nge_cdata.nge_tx_ring_tag);
+	if (error != 0) {
+		device_printf(sc->nge_dev, "failed to create Tx ring DMA tag\n");
+		goto fail;
+	}
+
+	/* Create tag for Rx ring. */
+	error = bus_dma_tag_create(sc->nge_cdata.nge_parent_tag,/* parent */
+	    NGE_RING_ALIGN, 0,		/* alignment, boundary */
+	    BUS_SPACE_MAXADDR,		/* lowaddr */
+	    BUS_SPACE_MAXADDR,		/* highaddr */
+	    NULL, NULL,			/* filter, filterarg */
+	    NGE_RX_RING_SIZE,		/* maxsize */
+	    1,				/* nsegments */
+	    NGE_RX_RING_SIZE,		/* maxsegsize */
+	    0,				/* flags */
+	    NULL, NULL,			/* lockfunc, lockarg */
+	    &sc->nge_cdata.nge_rx_ring_tag);
+	if (error != 0) {
+		device_printf(sc->nge_dev,
+		    "failed to create Rx ring DMA tag\n");
+		goto fail;
+	}
+
+	/* Create tag for Tx buffers. */
+	error = bus_dma_tag_create(sc->nge_cdata.nge_parent_tag,/* parent */
+	    1, 0,			/* alignment, boundary */
+	    BUS_SPACE_MAXADDR,		/* lowaddr */
+	    BUS_SPACE_MAXADDR,		/* highaddr */
+	    NULL, NULL,			/* filter, filterarg */
+	    MCLBYTES * NGE_MAXTXSEGS,	/* maxsize */
+	    NGE_MAXTXSEGS,		/* nsegments */
+	    MCLBYTES,			/* maxsegsize */
+	    0,				/* flags */
+	    NULL, NULL,			/* lockfunc, lockarg */
+	    &sc->nge_cdata.nge_tx_tag);
+	if (error != 0) {
+		device_printf(sc->nge_dev, "failed to create Tx DMA tag\n");
+		goto fail;
+	}
+
+	/* Create tag for Rx buffers. */
+	error = bus_dma_tag_create(sc->nge_cdata.nge_parent_tag,/* parent */
+	    NGE_RX_ALIGN, 0,		/* alignment, boundary */
+	    BUS_SPACE_MAXADDR,		/* lowaddr */
+	    BUS_SPACE_MAXADDR,		/* highaddr */
+	    NULL, NULL,			/* filter, filterarg */
+	    MCLBYTES,			/* maxsize */
+	    1,				/* nsegments */
+	    MCLBYTES,			/* maxsegsize */
+	    0,				/* flags */
+	    NULL, NULL,			/* lockfunc, lockarg */
+	    &sc->nge_cdata.nge_rx_tag);
+	if (error != 0) {
+		device_printf(sc->nge_dev, "failed to create Rx DMA tag\n");
+		goto fail;
+	}
+
+	/* Allocate DMA'able memory and load the DMA map for Tx ring. */
+	error = bus_dmamem_alloc(sc->nge_cdata.nge_tx_ring_tag,
+	    (void **)&sc->nge_rdata.nge_tx_ring, BUS_DMA_WAITOK |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->nge_cdata.nge_tx_ring_map);
+	if (error != 0) {
+		device_printf(sc->nge_dev,
+		    "failed to allocate DMA'able memory for Tx ring\n");
+		goto fail;
+	}
+
+	ctx.nge_busaddr = 0;
+	error = bus_dmamap_load(sc->nge_cdata.nge_tx_ring_tag,
+	    sc->nge_cdata.nge_tx_ring_map, sc->nge_rdata.nge_tx_ring,
+	    NGE_TX_RING_SIZE, nge_dmamap_cb, &ctx, 0);
+	if (error != 0 || ctx.nge_busaddr == 0) {
+		device_printf(sc->nge_dev,
+		    "failed to load DMA'able memory for Tx ring\n");
+		goto fail;
+	}
+	sc->nge_rdata.nge_tx_ring_paddr = ctx.nge_busaddr;
+
+	/* Allocate DMA'able memory and load the DMA map for Rx ring. */
+	error = bus_dmamem_alloc(sc->nge_cdata.nge_rx_ring_tag,
+	    (void **)&sc->nge_rdata.nge_rx_ring, BUS_DMA_WAITOK |
+	    BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->nge_cdata.nge_rx_ring_map);
+	if (error != 0) {
+		device_printf(sc->nge_dev,
+		    "failed to allocate DMA'able memory for Rx ring\n");
+		goto fail;
+	}

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From yongari at FreeBSD.org  Sun Jun  7 05:49:38 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 05:49:43 2009
Subject: svn commit: r193617 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb sparc64/conf
Message-ID: <200906070549.n575nbYZ083439@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 05:49:37 2009
New Revision: 193617
URL: http://svn.freebsd.org/changeset/base/193617

Log:
  MFC r192508:
    Add nge(4), nge(4) should work on all architectures.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/sparc64/conf/GENERIC

Modified: stable/7/sys/sparc64/conf/GENERIC
==============================================================================
--- stable/7/sys/sparc64/conf/GENERIC	Sun Jun  7 05:46:12 2009	(r193616)
+++ stable/7/sys/sparc64/conf/GENERIC	Sun Jun  7 05:49:37 2009	(r193617)
@@ -167,6 +167,7 @@ device		dc		# DEC/Intel 21143 and variou
 device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)
 device		gem		# Sun GEM/Sun ERI/Apple GMAC
 device		hme		# Sun HME (Happy Meal Ethernet)
+device		nge		# NatSemi DP83820 gigabit Ethernet
 #device		pcn		# AMD Am79C97x PCI 10/100 (precedence over 'le')
 device		re		# RealTek 8139C+/8169/8169S/8110S
 device		rl		# RealTek 8129/8139
From yongari at FreeBSD.org  Sun Jun  7 06:22:00 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 06:22:07 2009
Subject: svn commit: r193619 - stable/7/share/man/man4
Message-ID: <200906070621.n576LxPS084229@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 06:21:59 2009
New Revision: 193619
URL: http://svn.freebsd.org/changeset/base/193619

Log:
  MFC r176267:
    Document the hw.skc.jumbo_disable tunable.  While here, correct some things
    in the SYSCTLS section.
  
    Submitted by:	yongari

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/igb.4   (props changed)
  stable/7/share/man/man4/sk.4

Modified: stable/7/share/man/man4/sk.4
==============================================================================
--- stable/7/share/man/man4/sk.4	Sun Jun  7 05:52:22 2009	(r193618)
+++ stable/7/share/man/man4/sk.4	Sun Jun  7 06:21:59 2009	(r193619)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 16, 2005
+.Dd February 14, 2008
 .Dt SK 4
 .Os
 .Sh NAME
@@ -191,17 +191,28 @@ SK-9844 SK-NET GE-SX dual port, multimod
 .It
 SMC 9452TX single port, 1000baseT adapter
 .El
+.Sh LOADER TUNABLES
+Tunables can be set at the
+.Xr loader 8
+prompt before booting the kernel or stored in
+.Xr loader.conf 5 .
+.Bl -tag -width xxxxxx
+.It Va hw.skc.jumbo_disable
+Disable jumbo frame support.
+Systems with less memory can set it to a non-zero value to save memory.
+The default value is 0.
+.El
 .Sh SYSCTL VARIABLES
 The following variable is available as both
 .Xr sysctl 8
 variable and
 .Xr loader 8
 tunable:
-.Bl -tag -width indent
+.Bl -tag -width xxxxxx
 .It Va dev.skc.%d.int_mod
-.Pp
 This variable controls interrupt moderation.
-The accepted range is 10 to 10000, default value is 100 microseconds.
+The accepted range is 10 to 10000.
+The default value is 100 microseconds.
 The interface has to be brought down and up again before a change takes effect.
 .El
 .Sh DIAGNOSTICS
From yongari at FreeBSD.org  Sun Jun  7 06:23:25 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 06:23:32 2009
Subject: svn commit: r193620 - stable/7/share/man/man4
Message-ID: <200906070623.n576NOj2084314@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 06:23:24 2009
New Revision: 193620
URL: http://svn.freebsd.org/changeset/base/193620

Log:
  MFC r187662:
    Update the supported device list a little bit.
  
    PR:		84538
    Submitted by:	asmodai

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/igb.4   (props changed)
  stable/7/share/man/man4/nge.4
  stable/7/share/man/man4/sk.4

Modified: stable/7/share/man/man4/nge.4
==============================================================================
--- stable/7/share/man/man4/nge.4	Sun Jun  7 06:21:59 2009	(r193619)
+++ stable/7/share/man/man4/nge.4	Sun Jun  7 06:23:24 2009	(r193620)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 14, 2006
+.Dd January 23, 2009
 .Dt NGE 4
 .Os
 .Sh NAME
@@ -170,6 +170,8 @@ Asante FriendlyNet GigaNIX 1000TA and 10
 .It
 D-Link DGE-500T
 .It
+Linksys EG1032, revision 1
+.It
 Netgear GA621
 .It
 Netgear GA622T

Modified: stable/7/share/man/man4/sk.4
==============================================================================
--- stable/7/share/man/man4/sk.4	Sun Jun  7 06:21:59 2009	(r193619)
+++ stable/7/share/man/man4/sk.4	Sun Jun  7 06:23:24 2009	(r193620)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 14, 2008
+.Dd January 23, 2009
 .Dt SK 4
 .Os
 .Sh NAME
@@ -82,7 +82,7 @@ second port on dual port adapters for fa
 on the primary port fails, the SysKonnect driver will automatically
 switch traffic onto the second port.
 .Pp
-Also supported is the Marvell Semiconductor 88E1000* gigabit PHY.
+Also supported is the Marvell Semiconductor 88E100* gigabit PHY.
 .Pp
 The XaQti XMAC II supports full and half duplex operation with
 autonegotiation.
@@ -173,7 +173,7 @@ Belkin F5D5005 single port, 1000baseT ad
 .It
 D-Link DGE-530T single port, 1000baseT adapter
 .It
-Linksys EG1032 single port, 1000baseT adapter
+Linksys (revision 2) single port, 1000baseT adapter
 .It
 SK-9521 SK-NET GE-T single port, 1000baseT adapter
 .It
From yongari at FreeBSD.org  Sun Jun  7 06:27:34 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 06:27:46 2009
Subject: svn commit: r193621 - stable/7/share/man/man4
Message-ID: <200906070627.n576RXbH084459@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 06:27:33 2009
New Revision: 193621
URL: http://svn.freebsd.org/changeset/base/193621

Log:
  MFC r192512-192514:
  r192512:
    Document sysctl variable dev.nge.%d.int_holdoff.
  
  r192513:
    DP83821 also supports jumbo frames.
  
  r192514:
    nge(4) supports altq(4). Xr altq

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/igb.4   (props changed)
  stable/7/share/man/man4/nge.4

Modified: stable/7/share/man/man4/nge.4
==============================================================================
--- stable/7/share/man/man4/nge.4	Sun Jun  7 06:23:24 2009	(r193620)
+++ stable/7/share/man/man4/nge.4	Sun Jun  7 06:27:33 2009	(r193621)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 23, 2009
+.Dd May 21, 2009
 .Dt NGE 4
 .Os
 .Sh NAME
@@ -69,8 +69,8 @@ Most cards also use the DP83861 10/100/1
 chip, which supports autonegotiation of 10, 100 and 1000Mbps modes in
 full or half duplex.
 .Pp
-The DP83820 also supports jumbo frames, which can be configured
-via the interface MTU setting.
+The DP83820 and DP83821 also support jumbo frames, which can be
+configured via the interface MTU setting.
 Selecting an MTU larger than 1500 bytes with the
 .Xr ifconfig 8
 utility configures the adapter to receive and transmit jumbo frames.
@@ -182,6 +182,21 @@ Surecom Technology EP-320G-TX
 .It
 Trendware TEG-PCITX (32-bit PCI) and TEG-PCITX2 (64-bit PCI)
 .El
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width "xxxxxx"
+.It Va dev.nge.%d.int_holdoff
+Maximum amount of time to delay interrupt processing in units of
+100us.
+The accepted range is 0 to 255, the default is 1(100us).
+Value 0 completely disables the interrupt moderation.
+The interface has to be brought down and up again before a change
+takes effect.
+.El
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "nge%d: couldn't map memory"
@@ -205,6 +220,7 @@ The device has stopped responding to the
 the network connection (cable).
 .El
 .Sh SEE ALSO
+.Xr altq 4 ,
 .Xr arp 4 ,
 .Xr miibus 4 ,
 .Xr netintro 4 ,
From yongari at FreeBSD.org  Sun Jun  7 06:28:57 2009
From: yongari at FreeBSD.org (Pyun YongHyeon)
Date: Sun Jun  7 06:29:03 2009
Subject: svn commit: r193622 - stable/7/share/man/man4
Message-ID: <200906070628.n576St4I084530@svn.freebsd.org>

Author: yongari
Date: Sun Jun  7 06:28:55 2009
New Revision: 193622
URL: http://svn.freebsd.org/changeset/base/193622

Log:
  MFC r192515:
    Add nge(4) to the list of drivers supporting ALTQ.

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/altq.4
  stable/7/share/man/man4/igb.4   (props changed)

Modified: stable/7/share/man/man4/altq.4
==============================================================================
--- stable/7/share/man/man4/altq.4	Sun Jun  7 06:27:33 2009	(r193621)
+++ stable/7/share/man/man4/altq.4	Sun Jun  7 06:28:55 2009	(r193622)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 12, 2009
+.Dd May 21, 2009
 .Dt ALTQ 4
 .Os
 .Sh NAME
@@ -141,6 +141,7 @@ They have been applied to the following 
 .Xr mxge 4 ,
 .Xr my 4 ,
 .Xr nfe 4 ,
+.Xr nge 4 ,
 .Xr npe 4 ,
 .Xr nve 4 ,
 .Xr ral 4 ,
From brian at FreeBSD.org  Sun Jun  7 08:11:26 2009
From: brian at FreeBSD.org (Brian Somers)
Date: Sun Jun  7 08:11:43 2009
Subject: svn commit: r193626 - stable/7/bin/ps
Message-ID: <200906070811.n578BP0Z086661@svn.freebsd.org>

Author: brian
Date: Sun Jun  7 08:11:25 2009
New Revision: 193626
URL: http://svn.freebsd.org/changeset/base/193626

Log:
  MFC: r192239: Add a -d switch.

Modified:
  stable/7/bin/ps/   (props changed)
  stable/7/bin/ps/print.c
  stable/7/bin/ps/ps.1
  stable/7/bin/ps/ps.c
  stable/7/bin/ps/ps.h

Modified: stable/7/bin/ps/print.c
==============================================================================
--- stable/7/bin/ps/print.c	Sun Jun  7 07:45:25 2009	(r193625)
+++ stable/7/bin/ps/print.c	Sun Jun  7 08:11:25 2009	(r193626)
@@ -129,25 +129,33 @@ command(KINFO *k, VARENT *ve)
 	v = ve->var;
 	if (cflag) {
 		/* If it is the last field, then don't pad */
-		if (STAILQ_NEXT(ve, next_ve) == NULL)
+		if (STAILQ_NEXT(ve, next_ve) == NULL) {
+			if (k->ki_d.prefix)
+				(void)printf("%s", k->ki_d.prefix);
 			(void)printf("%s", k->ki_p->ki_comm);
-		else
+		} else
 			(void)printf("%-*s", v->width, k->ki_p->ki_comm);
 		return;
 	}
 	if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL)
 		errx(1, "malloc failed");
 	strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH);
-	if (k->ki_env) {
-		if ((vis_env = malloc(strlen(k->ki_env) * 4 + 1)) == NULL)
-			errx(1, "malloc failed");
-		strvis(vis_env, k->ki_env, VIS_TAB | VIS_NL | VIS_NOSLASH);
-	} else
-		vis_env = NULL;
 
 	if (STAILQ_NEXT(ve, next_ve) == NULL) {
 		/* last field */
+
+		if (k->ki_env) {
+			if ((vis_env = malloc(strlen(k->ki_env) * 4 + 1))
+			    == NULL)
+				errx(1, "malloc failed");
+			strvis(vis_env, k->ki_env,
+			    VIS_TAB | VIS_NL | VIS_NOSLASH);
+		} else
+			vis_env = NULL;
+
 		if (termwidth == UNLIMITED) {
+			if (k->ki_d.prefix)
+				(void)printf("%s", k->ki_d.prefix);
 			if (vis_env)
 				(void)printf("%s ", vis_env);
 			(void)printf("%s", vis_args);
@@ -155,6 +163,9 @@ command(KINFO *k, VARENT *ve)
 			left = termwidth - (totwidth - v->width);
 			if (left < 1) /* already wrapped, just use std width */
 				left = v->width;
+			if ((cp = k->ki_d.prefix) != NULL)
+				while (--left >= 0 && *cp)
+					(void)putchar(*cp++);
 			if ((cp = vis_env) != NULL) {
 				while (--left >= 0 && *cp)
 					(void)putchar(*cp++);
@@ -164,12 +175,12 @@ command(KINFO *k, VARENT *ve)
 			for (cp = vis_args; --left >= 0 && *cp != '\0';)
 				(void)putchar(*cp++);
 		}
+		if (vis_env != NULL)
+			free(vis_env);
 	} else
-		/* XXX env? */
+		/* ki_d.prefix & ki_env aren't shown for interim fields */
 		(void)printf("%-*.*s", v->width, v->width, vis_args);
 	free(vis_args);
-	if (vis_env != NULL)
-		free(vis_env);
 }
 
 void
@@ -178,9 +189,11 @@ ucomm(KINFO *k, VARENT *ve)
 	VAR *v;
 
 	v = ve->var;
-	if (STAILQ_NEXT(ve, next_ve) == NULL)	/* last field, don't pad */
+	if (STAILQ_NEXT(ve, next_ve) == NULL) {	/* last field, don't pad */
+		if (k->ki_d.prefix)
+			(void)printf("%s", k->ki_d.prefix);
 		(void)printf("%s", k->ki_p->ki_comm);
-	else
+	} else
 		(void)printf("%-*s", v->width, k->ki_p->ki_comm);
 }
 

Modified: stable/7/bin/ps/ps.1
==============================================================================
--- stable/7/bin/ps/ps.1	Sun Jun  7 07:45:25 2009	(r193625)
+++ stable/7/bin/ps/ps.1	Sun Jun  7 08:11:25 2009	(r193626)
@@ -29,7 +29,7 @@
 .\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd August 21, 2006
+.Dd May 16, 2009
 .Dt PS 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd process status
 .Sh SYNOPSIS
 .Nm
-.Op Fl aCcefHhjlmrSTuvwXxZ
+.Op Fl aCcdefHhjlmrSTuvwXxZ
 .Op Fl O Ar fmt | Fl o Ar fmt
 .Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ...
 .Op Fl M Ar core
@@ -122,6 +122,15 @@ CPU calculation that ignores
 .Dq resident
 time (this normally has
 no effect).
+.It Fl d
+Arrange processes into descendancy order and prefix each command with
+indentation text showing sibling and parent/child relationships.
+If either of the
+.Fl m
+and
+.Fl r
+options are also used, they control how sibling processes are sorted
+relative to eachother.
 .It Fl e
 Display the environment as well.
 .It Fl f

Modified: stable/7/bin/ps/ps.c
==============================================================================
--- stable/7/bin/ps/ps.c	Sun Jun  7 07:45:25 2009	(r193625)
+++ stable/7/bin/ps/ps.c	Sun Jun  7 08:11:25 2009	(r193626)
@@ -137,6 +137,7 @@ static int	 addelem_pid(struct listinfo 
 static int	 addelem_tty(struct listinfo *, const char *);
 static int	 addelem_uid(struct listinfo *, const char *);
 static void	 add_list(struct listinfo *, const char *);
+static void	 descendant_sort(KINFO *, int);
 static void	 dynsizevars(KINFO *);
 static void	*expand_list(struct listinfo *);
 static const char *
@@ -162,7 +163,7 @@ static char vfmt[] = "pid,state,time,sl,
 			"%cpu,%mem,command";
 static char Zfmt[] = "label";
 
-#define	PS_ARGS	"AaCce" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ"
+#define	PS_ARGS	"AaCcde" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ"
 
 int
 main(int argc, char *argv[])
@@ -176,7 +177,7 @@ main(int argc, char *argv[])
 	const char *nlistf, *memf;
 	char *cols;
 	int all, ch, elem, flag, _fmt, i, lineno;
-	int nentries, nkept, nselectors;
+	int descendancy, nentries, nkept, nselectors;
 	int prtheader, showthreads, wflag, what, xkeep, xkeep_implied;
 	char errbuf[_POSIX2_LINE_MAX];
 
@@ -200,7 +201,7 @@ main(int argc, char *argv[])
 	if (argc > 1)
 		argv[1] = kludge_oldps_options(PS_ARGS, argv[1], argv[2]);
 
-	all = _fmt = nselectors = optfatal = 0;
+	all = descendancy = _fmt = nselectors = optfatal = 0;
 	prtheader = showthreads = wflag = xkeep_implied = 0;
 	xkeep = -1;			/* Neither -x nor -X. */
 	init_list(&gidlist, addelem_gid, sizeof(gid_t), "group");
@@ -232,6 +233,9 @@ main(int argc, char *argv[])
 		case 'c':
 			cflag = 1;
 			break;
+		case 'd':
+			descendancy = 1;
+			break;
 		case 'e':			/* XXX set ufmt */
 			needenv = 1;
 			break;
@@ -574,6 +578,8 @@ main(int argc, char *argv[])
 		keepit:
 			next_KINFO = &kinfo[nkept];
 			next_KINFO->ki_p = kp;
+			next_KINFO->ki_d.level = 0;
+			next_KINFO->ki_d.prefix = NULL;
 			next_KINFO->ki_pcpu = getpcpu(next_KINFO);
 			if (sortby == SORTMEM)
 				next_KINFO->ki_memsize = kp->ki_tsize +
@@ -598,6 +604,13 @@ main(int argc, char *argv[])
 	 * sort proc list
 	 */
 	qsort(kinfo, nkept, sizeof(KINFO), pscomp);
+
+	/*
+	 * We want things in descendant order
+	 */
+	if (descendancy)
+		descendant_sort(kinfo, nkept);
+
 	/*
 	 * For each process, call each variable output function.
 	 */
@@ -621,6 +634,9 @@ main(int argc, char *argv[])
 	free_list(&sesslist);
 	free_list(&ttylist);
 	free_list(&uidlist);
+	for (i = 0; i < nkept; i++)
+		free(kinfo[i].ki_d.prefix);
+	free(kinfo);
 
 	exit(eval);
 }
@@ -889,6 +905,116 @@ add_list(struct listinfo *inf, const cha
 	}
 }
 
+static void
+descendant_sort(KINFO *ki, int items)
+{
+	int dst, lvl, maxlvl, n, ndst, nsrc, siblings, src;
+	unsigned char *path;
+	KINFO kn;
+
+	/*
+	 * First, sort the entries by descendancy, tracking the descendancy
+	 * depth in the ki_d.level field.
+	 */
+	src = 0;
+	maxlvl = 0;
+	while (src < items) {
+		if (ki[src].ki_d.level) {
+			src++;
+			continue;
+		}
+		for (nsrc = 1; src + nsrc < items; nsrc++)
+			if (!ki[src + nsrc].ki_d.level)
+				break;
+
+		for (dst = 0; dst < items; dst++) {
+			if (ki[dst].ki_p->ki_pid == ki[src].ki_p->ki_pid)
+				continue;
+			if (ki[dst].ki_p->ki_pid == ki[src].ki_p->ki_ppid)
+				break;
+		}
+
+		if (dst == items) {
+			src += nsrc;
+			continue;
+		}
+
+		for (ndst = 1; dst + ndst < items; ndst++)
+			if (ki[dst + ndst].ki_d.level <= ki[dst].ki_d.level)
+				break;
+
+		for (n = src; n < src + nsrc; n++) {
+			ki[n].ki_d.level += ki[dst].ki_d.level + 1;
+			if (maxlvl < ki[n].ki_d.level)
+				maxlvl = ki[n].ki_d.level;
+		}
+
+		while (nsrc) {
+			if (src < dst) {
+				kn = ki[src];
+				memmove(ki + src, ki + src + 1,
+				    (dst - src + ndst - 1) * sizeof *ki);
+				ki[dst + ndst - 1] = kn;
+				nsrc--;
+				dst--;
+				ndst++;
+			} else if (src != dst + ndst) {
+				kn = ki[src];
+				memmove(ki + dst + ndst + 1, ki + dst + ndst,
+				    (src - dst - ndst) * sizeof *ki);
+				ki[dst + ndst] = kn;
+				ndst++;
+				nsrc--;
+				src++;
+			} else {
+				ndst += nsrc;
+				src += nsrc;
+				nsrc = 0;
+			}
+		}
+	}
+
+	/*
+	 * Now populate ki_d.prefix (instead of ki_d.level) with the command
+	 * prefix used to show descendancies.
+	 */
+	path = malloc((maxlvl + 7) / 8);
+	memset(path, '\0', (maxlvl + 7) / 8);
+	for (src = 0; src < items; src++) {
+		if ((lvl = ki[src].ki_d.level) == 0) {
+			ki[src].ki_d.prefix = NULL;
+			continue;
+		}
+		if ((ki[src].ki_d.prefix = malloc(lvl * 2 + 1)) == NULL)
+			errx(1, "malloc failed");
+		for (n = 0; n < lvl - 2; n++) {
+			ki[src].ki_d.prefix[n * 2] =
+			    path[n / 8] & 1 << (n % 8) ? '|' : ' ';
+			ki[src].ki_d.prefix[n * 2 + 1] = ' ';
+				
+		}
+		if (n == lvl - 2) {
+			/* Have I any more siblings? */
+			for (siblings = 0, dst = src + 1; dst < items; dst++) {
+				if (ki[dst].ki_d.level > lvl)
+					continue;
+				if (ki[dst].ki_d.level == lvl)
+					siblings = 1;
+				break;
+			}
+			if (siblings)
+				path[n / 8] |= 1 << (n % 8);
+			else
+				path[n / 8] &= ~(1 << (n % 8));
+			ki[src].ki_d.prefix[n * 2] = siblings ? '|' : '`';
+			ki[src].ki_d.prefix[n * 2 + 1] = '-';
+			n++;
+		}
+		strcpy(ki[src].ki_d.prefix + n * 2, "- ");
+	}
+	free(path);
+}
+
 static void *
 expand_list(struct listinfo *inf)
 {

Modified: stable/7/bin/ps/ps.h
==============================================================================
--- stable/7/bin/ps/ps.h	Sun Jun  7 07:45:25 2009	(r193625)
+++ stable/7/bin/ps/ps.h	Sun Jun  7 08:11:25 2009	(r193626)
@@ -42,6 +42,10 @@ typedef struct kinfo {
 	int ki_valid;		/* 1 => uarea stuff valid */
 	double	 ki_pcpu;	/* calculated in main() */
 	segsz_t	 ki_memsize;	/* calculated in main() */
+	union {
+		int level;	/* used in decendant_sort() */
+		char *prefix;	/* calculated in decendant_sort() */
+	} ki_d;
 } KINFO;
 
 /* Variables. */
From brian at FreeBSD.org  Sun Jun  7 08:21:07 2009
From: brian at FreeBSD.org (Brian Somers)
Date: Sun Jun  7 08:21:24 2009
Subject: svn commit: r193627 - stable/7/usr.bin/pkill
Message-ID: <200906070821.n578L66a086938@svn.freebsd.org>

Author: brian
Date: Sun Jun  7 08:21:06 2009
New Revision: 193627
URL: http://svn.freebsd.org/changeset/base/193627

Log:
  MFC: r192242: Don't kill ancestors unless -a is given.

Modified:
  stable/7/usr.bin/pkill/   (props changed)
  stable/7/usr.bin/pkill/pkill.1
  stable/7/usr.bin/pkill/pkill.c

Modified: stable/7/usr.bin/pkill/pkill.1
==============================================================================
--- stable/7/usr.bin/pkill/pkill.1	Sun Jun  7 08:11:25 2009	(r193626)
+++ stable/7/usr.bin/pkill/pkill.1	Sun Jun  7 08:21:06 2009	(r193627)
@@ -36,7 +36,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 23, 2006
+.Dd May 16, 2009
 .Dt PKILL 1
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@
 .Nd find or signal processes by name
 .Sh SYNOPSIS
 .Nm pgrep
-.Op Fl LSfilnovx
+.Op Fl LSafilnovx
 .Op Fl F Ar pidfile
 .Op Fl G Ar gid
 .Op Fl M Ar core
@@ -60,7 +60,7 @@
 .Ar pattern ...
 .Nm pkill
 .Op Fl Ar signal
-.Op Fl ILfinovx
+.Op Fl ILafinovx
 .Op Fl F Ar pidfile
 .Op Fl G Ar gid
 .Op Fl M Ar core
@@ -128,6 +128,15 @@ The default is a newline.
 This option can only be used with the
 .Nm pgrep
 command.
+.It Fl a
+Include process ancestors in the match list.
+By default, the current
+.Nm pgrep
+or
+.Nm pkill
+process and all of its ancestors are excluded (unless
+.Fl v
+is used).
 .It Fl f
 Match against full argument lists.
 The default is to match against process names.

Modified: stable/7/usr.bin/pkill/pkill.c
==============================================================================
--- stable/7/usr.bin/pkill/pkill.c	Sun Jun  7 08:11:25 2009	(r193626)
+++ stable/7/usr.bin/pkill/pkill.c	Sun Jun  7 08:21:06 2009	(r193627)
@@ -133,7 +133,7 @@ main(int argc, char **argv)
 {
 	char buf[_POSIX2_LINE_MAX], *mstr, **pargv, *p, *q, *pidfile;
 	const char *execf, *coref;
-	int debug_opt;
+	int ancestors, debug_opt;
 	int i, ch, bestidx, rv, criteria, pidfromfile, pidfilelock;
 	size_t jsz;
 	int (*action)(const struct kinfo_proc *);
@@ -142,6 +142,7 @@ main(int argc, char **argv)
 	struct timeval best_tval;
 	regex_t reg;
 	regmatch_t regmatch;
+	pid_t pid;
 
 	setlocale(LC_ALL, "");
 
@@ -174,13 +175,14 @@ main(int argc, char **argv)
 		}
 	}
 
+	ancestors = 0;
 	criteria = 0;
 	debug_opt = 0;
 	pidfile = NULL;
 	pidfilelock = 0;
 	execf = coref = _PATH_DEVNULL;
 
-	while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:d:fg:ij:lnos:t:u:vx")) != -1)
+	while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1)
 		switch (ch) {
 		case 'D':
 			debug_opt++;
@@ -220,6 +222,9 @@ main(int argc, char **argv)
 			makelist(&ruidlist, LT_USER, optarg);
 			criteria = 1;
 			break;
+		case 'a':
+			ancestors++;
+			break;
 		case 'd':
 			if (!pgrep)
 				usage();
@@ -468,6 +473,27 @@ main(int argc, char **argv)
 			selected[i] = 1;
 	}
 
+	if (!ancestors) {
+		pid = mypid;
+		while (pid) {
+			for (i = 0, kp = plist; i < nproc; i++, kp++) {
+				if (PSKIP(kp))
+					continue;
+				if (kp->ki_pid == pid) {
+					selected[i] = 0;
+					pid = kp->ki_ppid;
+					break;
+				}
+			}
+			if (i == nproc) {
+				if (pid == mypid)
+					pid = getppid();
+				else
+					break;	/* Maybe we're in a jail ? */
+			}
+		}
+	}
+
 	if (newest || oldest) {
 		best_tval.tv_sec = 0;
 		best_tval.tv_usec = 0;
From fabient at FreeBSD.org  Sun Jun  7 10:00:36 2009
From: fabient at FreeBSD.org (Fabien Thomas)
Date: Sun Jun  7 10:00:44 2009
Subject: svn commit: r193634 - in stable/7: lib/libpmc share/man/man4
	sys/amd64/amd64 sys/amd64/include sys/conf sys/dev/hwpmc
	sys/i386/i386 sys/i386/include sys/kern sys/modules/hwpmc
	sys/sys usr.sbin usr....
Message-ID: <200906071000.n57A0Zem089380@svn.freebsd.org>

Author: fabient
Date: Sun Jun  7 10:00:35 2009
New Revision: 193634
URL: http://svn.freebsd.org/changeset/base/193634

Log:
  MFC hwpmc framework:
  
  - capture with callchain
  - Intel Core 2 support
  - Intel Core i7 support
  - source code annotate (pmcannotate)
  - bug fixes
  
  Reviewed by: jkoshy (mentor)
  Approved by: re (gnn)

Added:
  stable/7/lib/libpmc/libpmcinternal.h   (contents, props changed)
  stable/7/lib/libpmc/pmc.atom.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.core.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.core2.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.iaf.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.k7.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.k8.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.p4.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.p5.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.p6.3   (contents, props changed)
  stable/7/lib/libpmc/pmc.tsc.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_allocate.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_attach.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_capabilities.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_configure_logfile.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_disable.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_event_names_of_class.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_get_driver_stats.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_get_msr.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_init.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_name_of_capability.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_read.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_set.3   (contents, props changed)
  stable/7/lib/libpmc/pmc_start.3   (contents, props changed)
  stable/7/sys/dev/hwpmc/hwpmc_core.c   (contents, props changed)
  stable/7/sys/dev/hwpmc/hwpmc_core.h   (contents, props changed)
  stable/7/sys/dev/hwpmc/hwpmc_intel.c   (contents, props changed)
  stable/7/sys/dev/hwpmc/hwpmc_tsc.c   (contents, props changed)
  stable/7/sys/dev/hwpmc/hwpmc_tsc.h   (contents, props changed)
  stable/7/usr.sbin/pmcannotate/
  stable/7/usr.sbin/pmcannotate/Makefile   (contents, props changed)
  stable/7/usr.sbin/pmcannotate/pmcannotate.8   (contents, props changed)
  stable/7/usr.sbin/pmcannotate/pmcannotate.c   (contents, props changed)
Modified:
  stable/7/lib/libpmc/Makefile
  stable/7/lib/libpmc/libpmc.c
  stable/7/lib/libpmc/pmc.3
  stable/7/lib/libpmc/pmclog.c
  stable/7/lib/libpmc/pmclog.h
  stable/7/share/man/man4/hwpmc.4
  stable/7/sys/amd64/amd64/exception.S
  stable/7/sys/amd64/amd64/genassym.c
  stable/7/sys/amd64/amd64/machdep.c
  stable/7/sys/amd64/amd64/mp_machdep.c
  stable/7/sys/amd64/amd64/trap.c
  stable/7/sys/amd64/include/intr_machdep.h
  stable/7/sys/amd64/include/pmc_mdep.h
  stable/7/sys/conf/Makefile.amd64
  stable/7/sys/conf/Makefile.i386
  stable/7/sys/conf/files.amd64
  stable/7/sys/conf/files.i386
  stable/7/sys/conf/files.pc98
  stable/7/sys/dev/hwpmc/hwpmc_amd.c
  stable/7/sys/dev/hwpmc/hwpmc_amd.h
  stable/7/sys/dev/hwpmc/hwpmc_arm.c
  stable/7/sys/dev/hwpmc/hwpmc_ia64.c
  stable/7/sys/dev/hwpmc/hwpmc_logging.c
  stable/7/sys/dev/hwpmc/hwpmc_mod.c
  stable/7/sys/dev/hwpmc/hwpmc_pentium.c
  stable/7/sys/dev/hwpmc/hwpmc_pentium.h
  stable/7/sys/dev/hwpmc/hwpmc_piv.c
  stable/7/sys/dev/hwpmc/hwpmc_piv.h
  stable/7/sys/dev/hwpmc/hwpmc_powerpc.c
  stable/7/sys/dev/hwpmc/hwpmc_ppro.c
  stable/7/sys/dev/hwpmc/hwpmc_ppro.h
  stable/7/sys/dev/hwpmc/hwpmc_sparc64.c
  stable/7/sys/dev/hwpmc/hwpmc_x86.c
  stable/7/sys/dev/hwpmc/pmc_events.h
  stable/7/sys/i386/i386/exception.s
  stable/7/sys/i386/i386/genassym.c
  stable/7/sys/i386/i386/trap.c
  stable/7/sys/i386/include/pmc_mdep.h
  stable/7/sys/kern/kern_pmc.c
  stable/7/sys/modules/hwpmc/Makefile
  stable/7/sys/sys/pmc.h
  stable/7/sys/sys/pmckern.h
  stable/7/sys/sys/pmclog.h
  stable/7/sys/sys/proc.h
  stable/7/usr.sbin/Makefile
  stable/7/usr.sbin/pmccontrol/pmccontrol.8
  stable/7/usr.sbin/pmccontrol/pmccontrol.c
  stable/7/usr.sbin/pmcstat/Makefile
  stable/7/usr.sbin/pmcstat/pmcstat.8
  stable/7/usr.sbin/pmcstat/pmcstat.c
  stable/7/usr.sbin/pmcstat/pmcstat.h
  stable/7/usr.sbin/pmcstat/pmcstat_log.c

Modified: stable/7/lib/libpmc/Makefile
==============================================================================
--- stable/7/lib/libpmc/Makefile	Sun Jun  7 09:23:50 2009	(r193633)
+++ stable/7/lib/libpmc/Makefile	Sun Jun  7 10:00:35 2009	(r193634)
@@ -7,40 +7,54 @@ INCS=	pmc.h pmclog.h
 
 WARNS?=	6
 
-MAN=	pmc.3 pmclog.3
+MAN=	pmc.3
+MAN+=	pmc_allocate.3
+MAN+=	pmc_attach.3
+MAN+=	pmc_capabilities.3
+MAN+=	pmc_configure_logfile.3
+MAN+=	pmc_disable.3
+MAN+=	pmc_event_names_of_class.3
+MAN+=	pmc_get_driver_stats.3
+MAN+=	pmc_get_msr.3
+MAN+=	pmc_init.3
+MAN+=	pmc_name_of_capability.3
+MAN+=	pmc_read.3
+MAN+=	pmc_set.3
+MAN+=	pmc_start.3
+MAN+=	pmclog.3
+
+# PMC-dependent manual pages
+MAN+=	pmc.atom.3
+MAN+=	pmc.core.3
+MAN+=	pmc.core2.3
+MAN+=	pmc.iaf.3
+MAN+=	pmc.k7.3
+MAN+=	pmc.k8.3
+MAN+=	pmc.p4.3
+MAN+=	pmc.p5.3
+MAN+=	pmc.p6.3
+MAN+=	pmc.tsc.3
 
 MLINKS+= \
-	pmc.3 pmc_allocate.3 \
-	pmc.3 pmc_attach.3 \
-	pmc.3 pmc_capabilities.3 \
-	pmc.3 pmc_configure_logfile.3 \
-	pmc.3 pmc_cpuinfo.3 \
-	pmc.3 pmc_detach.3 \
-	pmc.3 pmc_disable.3 \
-	pmc.3 pmc_enable.3 \
-	pmc.3 pmc_event_names_of_class.3 \
-	pmc.3 pmc_flush_logfile.3 \
-	pmc.3 pmc_get_driver_stats.3 \
-	pmc.3 pmc_init.3 \
-	pmc.3 pmc_name_of_capability.3 \
-	pmc.3 pmc_name_of_class.3 \
-	pmc.3 pmc_name_of_cputype.3 \
-	pmc.3 pmc_name_of_event.3 \
-	pmc.3 pmc_name_of_mode.3 \
-	pmc.3 pmc_name_of_state.3 \
-	pmc.3 pmc_ncpu.3 \
-	pmc.3 pmc_npmc.3 \
-	pmc.3 pmc_pmcinfo.3 \
-	pmc.3 pmc_read.3 \
-	pmc.3 pmc_release.3 \
-	pmc.3 pmc_rw.3 \
-	pmc.3 pmc_set.3 \
-	pmc.3 pmc_start.3 \
-	pmc.3 pmc_stop.3 \
-	pmc.3 pmc_width.3 \
-	pmc.3 pmc_write.3 \
-	pmc.3 pmc_writelog.3 \
-	pmc.3 pmc_x86_get_msr.3
+	pmc_allocate.3 pmc_release.3 \
+	pmc_attach.3 pmc_detach.3 \
+	pmc_capabilities.3 pmc_ncpu.3 \
+	pmc_capabilities.3 pmc_npmc.3 \
+	pmc_capabilities.3 pmc_pmcinfo.3 \
+	pmc_capabilities.3 pmc_cpuinfo.3 \
+	pmc_capabilities.3 pmc_width.3 \
+	pmc_configure_logfile.3 pmc_flush_logfile.3 \
+	pmc_configure_logfile.3 pmc_writelog.3 \
+	pmc_disable.3 pmc_enable.3 \
+	pmc_name_of_capability.3 pmc_name_of_class.3 \
+	pmc_name_of_capability.3 pmc_name_of_cputype.3 \
+	pmc_name_of_capability.3 pmc_name_of_disposition.3 \
+	pmc_name_of_capability.3 pmc_name_of_event.3 \
+	pmc_name_of_capability.3 pmc_name_of_mode.3 \
+	pmc_name_of_capability.3 pmc_name_of_state.3 \
+	pmc_read.3 pmc_rw.3 \
+	pmc_read.3 pmc_write.3 \
+	pmc_start.3 pmc_stop.3
 
 MLINKS+= \
 	pmclog.3 pmclog_open.3 \

Modified: stable/7/lib/libpmc/libpmc.c
==============================================================================
--- stable/7/lib/libpmc/libpmc.c	Sun Jun  7 09:23:50 2009	(r193633)
+++ stable/7/lib/libpmc/libpmc.c	Sun Jun  7 10:00:35 2009	(r193634)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003-2006 Joseph Koshy
+ * Copyright (c) 2003-2008 Joseph Koshy
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,12 +42,18 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "libpmcinternal.h"
+
 /* Function prototypes */
 #if defined(__i386__)
 static int k7_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
     struct pmc_op_pmcallocate *_pmc_config);
 #endif
 #if defined(__amd64__) || defined(__i386__)
+static int iaf_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
+    struct pmc_op_pmcallocate *_pmc_config);
+static int iap_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
+    struct pmc_op_pmcallocate *_pmc_config);
 static int k8_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
     struct pmc_op_pmcallocate *_pmc_config);
 static int p4_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
@@ -59,6 +65,10 @@ static int p5_allocate_pmc(enum pmc_even
 static int p6_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
     struct pmc_op_pmcallocate *_pmc_config);
 #endif
+#if defined(__amd64__) || defined(__i386__)
+static int tsc_allocate_pmc(enum pmc_event _pe, char *_ctrspec,
+    struct pmc_op_pmcallocate *_pmc_config);
+#endif
 
 #define PMC_CALL(cmd, params)				\
 	syscall(pmc_syscall, PMC_OP_##cmd, (params))
@@ -69,7 +79,6 @@ static int p6_allocate_pmc(enum pmc_even
  * mapped to the appropriate canonical event descriptions using a
  * lookup table.
  */
-
 struct pmc_event_alias {
 	const char	*pm_alias;
 	const char	*pm_spec;
@@ -78,25 +87,145 @@ struct pmc_event_alias {
 static const struct pmc_event_alias *pmc_mdep_event_aliases;
 
 /*
- * The pmc_event_descr table maps symbolic names known to the user
+ * The pmc_event_descr structure maps symbolic names known to the user
  * to integer codes used by the PMC KLD.
  */
-
 struct pmc_event_descr {
 	const char	*pm_ev_name;
 	enum pmc_event	pm_ev_code;
-	enum pmc_class	pm_ev_class;
 };
 
-static const struct pmc_event_descr
-pmc_event_table[] =
+/*
+ * The pmc_class_descr structure maps class name prefixes for
+ * event names to event tables and other PMC class data.
+ */
+struct pmc_class_descr {
+	const char	*pm_evc_name;
+	size_t		pm_evc_name_size;
+	enum pmc_class	pm_evc_class;
+	const struct pmc_event_descr *pm_evc_event_table;
+	size_t		pm_evc_event_table_size;
+	int		(*pm_evc_allocate_pmc)(enum pmc_event _pe,
+			    char *_ctrspec, struct pmc_op_pmcallocate *_pa);
+};
+
+#define	PMC_TABLE_SIZE(N)	(sizeof(N)/sizeof(N[0]))
+#define	PMC_EVENT_TABLE_SIZE(N)	PMC_TABLE_SIZE(N##_event_table)
+
+#undef	__PMC_EV
+#define	__PMC_EV(C,N) { #N, PMC_EV_ ## C ## _ ## N },
+
+/*
+ * PMC_CLASSDEP_TABLE(NAME, CLASS)
+ *
+ * Define a table mapping event names and aliases to HWPMC event IDs.
+ */
+#define	PMC_CLASSDEP_TABLE(N, C)				\
+	static const struct pmc_event_descr N##_event_table[] =	\
+	{							\
+		__PMC_EV_##C()					\
+	}
+
+PMC_CLASSDEP_TABLE(iaf, IAF);
+PMC_CLASSDEP_TABLE(k7, K7);
+PMC_CLASSDEP_TABLE(k8, K8);
+PMC_CLASSDEP_TABLE(p4, P4);
+PMC_CLASSDEP_TABLE(p5, P5);
+PMC_CLASSDEP_TABLE(p6, P6);
+
+#undef	__PMC_EV_ALIAS
+#define	__PMC_EV_ALIAS(N,CODE) 	{ N, PMC_EV_##CODE },
+
+static const struct pmc_event_descr atom_event_table[] =
+{
+	__PMC_EV_ALIAS_ATOM()
+};
+
+static const struct pmc_event_descr core_event_table[] =
 {
-#undef  __PMC_EV
-#define	__PMC_EV(C,N,EV) { #EV, PMC_EV_ ## C ## _ ## N, PMC_CLASS_ ## C },
-	__PMC_EVENTS()
+	__PMC_EV_ALIAS_CORE()
+};
+
+
+static const struct pmc_event_descr core2_event_table[] =
+{
+	__PMC_EV_ALIAS_CORE2()
+};
+
+static const struct pmc_event_descr corei7_event_table[] =
+{
+	__PMC_EV_ALIAS_COREI7()
 };
 
 /*
+ * PMC_MDEP_TABLE(NAME, PRIMARYCLASS, ADDITIONAL_CLASSES...)
+ *
+ * Map a CPU to the PMC classes it supports.
+ */
+#define	PMC_MDEP_TABLE(N,C,...)				\
+	static const enum pmc_class N##_pmc_classes[] = {	\
+		PMC_CLASS_##C, __VA_ARGS__			\
+	}
+
+PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(core, IAP, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_IAF, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(k7, K7, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(k8, K8, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(p4, P4, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(p5, P5, PMC_CLASS_TSC);
+PMC_MDEP_TABLE(p6, P6, PMC_CLASS_TSC);
+
+static const struct pmc_event_descr tsc_event_table[] =
+{
+	__PMC_EV_TSC()
+};
+
+#undef	PMC_CLASS_TABLE_DESC
+#define	PMC_CLASS_TABLE_DESC(NAME, CLASS, EVENTS, ALLOCATOR)	\
+static const struct pmc_class_descr NAME##_class_table_descr =	\
+	{							\
+		.pm_evc_name  = #CLASS "-",			\
+		.pm_evc_name_size = sizeof(#CLASS "-") - 1,	\
+		.pm_evc_class = PMC_CLASS_##CLASS ,		\
+		.pm_evc_event_table = EVENTS##_event_table ,	\
+		.pm_evc_event_table_size = 			\
+			PMC_EVENT_TABLE_SIZE(EVENTS),		\
+		.pm_evc_allocate_pmc = ALLOCATOR##_allocate_pmc	\
+	}
+
+#if	defined(__i386__) || defined(__amd64__)
+PMC_CLASS_TABLE_DESC(iaf, IAF, iaf, iaf);
+PMC_CLASS_TABLE_DESC(atom, IAP, atom, iap);
+PMC_CLASS_TABLE_DESC(core, IAP, core, iap);
+PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap);
+PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap);
+#endif
+#if	defined(__i386__)
+PMC_CLASS_TABLE_DESC(k7, K7, k7, k7);
+#endif
+#if	defined(__i386__) || defined(__amd64__)
+PMC_CLASS_TABLE_DESC(k8, K8, k8, k8);
+PMC_CLASS_TABLE_DESC(p4, P4, p4, p4);
+#endif
+#if	defined(__i386__)
+PMC_CLASS_TABLE_DESC(p5, P5, p5, p5);
+PMC_CLASS_TABLE_DESC(p6, P6, p6, p6);
+#endif
+#if	defined(__i386__) || defined(__amd64__)
+PMC_CLASS_TABLE_DESC(tsc, TSC, tsc, tsc);
+#endif
+
+#undef	PMC_CLASS_TABLE_DESC
+
+static const struct pmc_class_descr **pmc_class_table;
+#define	PMC_CLASS_TABLE_SIZE	cpu_info.pm_nclass
+
+static const enum pmc_class *pmc_mdep_class_list;
+static size_t pmc_mdep_class_list_size;
+
+/*
  * Mapping tables, mapping enumeration values to human readable
  * strings.
  */
@@ -113,9 +242,14 @@ static const char * pmc_class_names[] = 
 	__PMC_CLASSES()
 };
 
-static const char * pmc_cputype_names[] = {
+struct pmc_cputype_map {
+	enum pmc_class	pm_cputype;
+	const char	*pm_name;
+};
+
+static const struct pmc_cputype_map pmc_cputype_names[] = {
 #undef	__PMC_CPU
-#define	__PMC_CPU(S, D) #S ,
+#define	__PMC_CPU(S, V, D) { .pm_cputype = PMC_CPU_##S, .pm_name = #S } ,
 	__PMC_CPUS()
 };
 
@@ -141,11 +275,6 @@ static int pmc_syscall = -1;		/* filled 
 
 static struct pmc_cpuinfo cpu_info;	/* filled in by pmc_init() */
 
-
-/* Architecture dependent event parsing */
-static int (*pmc_mdep_allocate_pmc)(enum pmc_event _pe, char *_ctrspec,
-    struct pmc_op_pmcallocate *_pmc_config);
-
 /* Event masks for events */
 struct pmc_masks {
 	const char	*pm_name;
@@ -163,20 +292,21 @@ pmc_parse_mask(const struct pmc_masks *p
 	int c;
 
 	if (pmask == NULL)	/* no mask keywords */
-		return -1;
-	q = strchr(p, '='); 	/* skip '=' */
+		return (-1);
+	q = strchr(p, '=');	/* skip '=' */
 	if (*++q == '\0')	/* no more data */
-		return -1;
+		return (-1);
 	c = 0;			/* count of mask keywords seen */
 	while ((r = strsep(&q, "+")) != NULL) {
-		for (pm = pmask; pm->pm_name && strcmp(r, pm->pm_name); pm++)
+		for (pm = pmask; pm->pm_name && strcasecmp(r, pm->pm_name);
+		    pm++)
 			;
 		if (pm->pm_name == NULL) /* not found */
-			return -1;
+			return (-1);
 		*evmask |= pm->pm_value;
 		c++;
 	}
-	return c;
+	return (c);
 }
 #endif
 
@@ -194,7 +324,7 @@ static struct pmc_event_alias k7_aliases
 	EV_ALIAS("branches",		"k7-retired-branches"),
 	EV_ALIAS("branch-mispredicts",	"k7-retired-branches-mispredicted"),
 	EV_ALIAS("cycles",		"tsc"),
-	EV_ALIAS("dc-misses",		"k7-dc-misses,mask=moesi"),
+	EV_ALIAS("dc-misses",		"k7-dc-misses"),
 	EV_ALIAS("ic-misses",		"k7-ic-misses"),
 	EV_ALIAS("instructions",	"k7-retired-instructions"),
 	EV_ALIAS("interrupts",		"k7-hardware-interrupts"),
@@ -212,19 +342,12 @@ static int
 k7_allocate_pmc(enum pmc_event pe, char *ctrspec,
     struct pmc_op_pmcallocate *pmc_config)
 {
-	char 		*e, *p, *q;
-	int 		c, has_unitmask;
+	char		*e, *p, *q;
+	int		c, has_unitmask;
 	uint32_t	count, unitmask;
 
 	pmc_config->pm_md.pm_amd.pm_amd_config = 0;
-	pmc_config->pm_caps |= PMC_CAP_READ;
-
-	if (pe == PMC_EV_TSC_TSC) {
-		/* TSC events must be unqualified. */
-		if (ctrspec && *ctrspec != '\0')
-			return -1;
-		return 0;
-	}
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 
 	if (pe == PMC_EV_K7_DC_REFILLS_FROM_L2 ||
 	    pe == PMC_EV_K7_DC_REFILLS_FROM_SYSTEM ||
@@ -234,17 +357,15 @@ k7_allocate_pmc(enum pmc_event pe, char 
 	} else
 		unitmask = has_unitmask = 0;
 
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
-
 	while ((p = strsep(&ctrspec, ",")) != NULL) {
 		if (KWPREFIXMATCH(p, K7_KW_COUNT "=")) {
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 
 			count = strtol(q, &e, 0);
 			if (e == q || *e != '\0')
-				return -1;
+				return (-1);
 
 			pmc_config->pm_caps |= PMC_CAP_THRESHOLD;
 			pmc_config->pm_md.pm_amd.pm_amd_config |=
@@ -258,11 +379,11 @@ k7_allocate_pmc(enum pmc_event pe, char 
 			pmc_config->pm_caps |= PMC_CAP_SYSTEM;
 		} else if (KWPREFIXMATCH(p, K7_KW_UNITMASK "=")) {
 			if (has_unitmask == 0)
-				return -1;
+				return (-1);
 			unitmask = 0;
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 
 			while ((c = tolower(*q++)) != 0)
 				if (c == 'm')
@@ -278,15 +399,15 @@ k7_allocate_pmc(enum pmc_event pe, char 
 				else if (c == '+')
 					continue;
 				else
-					return -1;
+					return (-1);
 
 			if (unitmask == 0)
-				return -1;
+				return (-1);
 
 		} else if (KWMATCH(p, K7_KW_USR)) {
 			pmc_config->pm_caps |= PMC_CAP_USER;
 		} else
-			return -1;
+			return (-1);
 	}
 
 	if (has_unitmask) {
@@ -295,7 +416,7 @@ k7_allocate_pmc(enum pmc_event pe, char 
 		    AMD_PMC_TO_UNITMASK(unitmask);
 	}
 
-	return 0;
+	return (0);
 
 }
 
@@ -304,6 +425,240 @@ k7_allocate_pmc(enum pmc_event pe, char 
 #if defined(__amd64__) || defined(__i386__)
 
 /*
+ * Intel Core (Family 6, Model E) PMCs.
+ */
+
+static struct pmc_event_alias core_aliases[] = {
+	EV_ALIAS("branches",		"iap-br-instr-ret"),
+	EV_ALIAS("branch-mispredicts",	"iap-br-mispred-ret"),
+	EV_ALIAS("cycles",		"tsc-tsc"),
+	EV_ALIAS("ic-misses",		"iap-icache-misses"),
+	EV_ALIAS("instructions",	"iap-instr-ret"),
+	EV_ALIAS("interrupts",		"iap-core-hw-int-rx"),
+	EV_ALIAS("unhalted-cycles",	"iap-unhalted-core-cycles"),
+	EV_ALIAS(NULL, NULL)
+};
+
+/*
+ * Intel Core2 (Family 6, Model F), Core2Extreme (Family 6, Model 17H)
+ * and Atom (Family 6, model 1CH) PMCs.
+ */
+
+static struct pmc_event_alias core2_aliases[] = {
+	EV_ALIAS("branches",		"iap-br-inst-retired.any"),
+	EV_ALIAS("branch-mispredicts",	"iap-br-inst-retired.mispred"),
+	EV_ALIAS("cycles",		"tsc-tsc"),
+	EV_ALIAS("ic-misses",		"iap-l1i-misses"),
+	EV_ALIAS("instructions",	"iaf-instr-retired.any"),
+	EV_ALIAS("interrupts",		"iap-hw-int-rcv"),
+	EV_ALIAS("unhalted-cycles",	"iaf-cpu-clk-unhalted.core"),
+	EV_ALIAS(NULL, NULL)
+};
+#define	atom_aliases	core2_aliases
+#define corei7_aliases	core2_aliases
+
+#define	IAF_KW_OS		"os"
+#define	IAF_KW_USR		"usr"
+#define	IAF_KW_ANYTHREAD	"anythread"
+
+/*
+ * Parse an event specifier for Intel fixed function counters.
+ */
+static int
+iaf_allocate_pmc(enum pmc_event pe, char *ctrspec,
+    struct pmc_op_pmcallocate *pmc_config)
+{
+	char *p;
+
+	(void) pe;
+
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
+	pmc_config->pm_md.pm_iaf.pm_iaf_flags = 0;
+
+	while ((p = strsep(&ctrspec, ",")) != NULL) {
+		if (KWMATCH(p, IAF_KW_OS))
+			pmc_config->pm_caps |= PMC_CAP_SYSTEM;
+		else if (KWMATCH(p, IAF_KW_USR))
+			pmc_config->pm_caps |= PMC_CAP_USER;
+		else if (KWMATCH(p, IAF_KW_ANYTHREAD))
+			pmc_config->pm_md.pm_iaf.pm_iaf_flags |= IAF_ANY;
+		else
+			return (-1);
+	}
+
+	return (0);
+}
+
+/*
+ * Core/Core2 support.
+ */
+
+#define	IAP_KW_AGENT		"agent"
+#define	IAP_KW_ANYTHREAD	"anythread"
+#define	IAP_KW_CACHESTATE	"cachestate"
+#define	IAP_KW_CMASK		"cmask"
+#define	IAP_KW_CORE		"core"
+#define	IAP_KW_EDGE		"edge"
+#define	IAP_KW_INV		"inv"
+#define	IAP_KW_OS		"os"
+#define	IAP_KW_PREFETCH		"prefetch"
+#define	IAP_KW_SNOOPRESPONSE	"snoopresponse"
+#define	IAP_KW_SNOOPTYPE	"snooptype"
+#define	IAP_KW_TRANSITION	"trans"
+#define	IAP_KW_USR		"usr"
+
+static struct pmc_masks iap_core_mask[] = {
+	PMCMASK(all,	(0x3 << 14)),
+	PMCMASK(this,	(0x1 << 14)),
+	NULLMASK
+};
+
+static struct pmc_masks iap_agent_mask[] = {
+	PMCMASK(this,	0),
+	PMCMASK(any,	(0x1 << 13)),
+	NULLMASK
+};
+
+static struct pmc_masks iap_prefetch_mask[] = {
+	PMCMASK(both,		(0x3 << 12)),
+	PMCMASK(only,		(0x1 << 12)),
+	PMCMASK(exclude,	0),
+	NULLMASK
+};
+
+static struct pmc_masks iap_cachestate_mask[] = {
+	PMCMASK(i,		(1 <<  8)),
+	PMCMASK(s,		(1 <<  9)),
+	PMCMASK(e,		(1 << 10)),
+	PMCMASK(m,		(1 << 11)),
+	NULLMASK
+};
+
+static struct pmc_masks iap_snoopresponse_mask[] = {
+	PMCMASK(clean,		(1 << 8)),
+	PMCMASK(hit,		(1 << 9)),
+	PMCMASK(hitm,		(1 << 11)),
+	NULLMASK
+};
+
+static struct pmc_masks iap_snooptype_mask[] = {
+	PMCMASK(cmp2s,		(1 << 8)),
+	PMCMASK(cmp2i,		(1 << 9)),
+	NULLMASK
+};
+
+static struct pmc_masks iap_transition_mask[] = {
+	PMCMASK(any,		0x00),
+	PMCMASK(frequency,	0x10),
+	NULLMASK
+};
+
+static int
+iap_allocate_pmc(enum pmc_event pe, char *ctrspec,
+    struct pmc_op_pmcallocate *pmc_config)
+{
+	char *e, *p, *q;
+	uint32_t cachestate, evmask;
+	int count, n;
+
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE |
+	    PMC_CAP_QUALIFIER);
+	pmc_config->pm_md.pm_iap.pm_iap_config = 0;
+
+	cachestate = evmask = 0;
+
+	/* Parse additional modifiers if present */
+	while ((p = strsep(&ctrspec, ",")) != NULL) {
+
+		n = 0;
+		if (KWPREFIXMATCH(p, IAP_KW_CMASK "=")) {
+			q = strchr(p, '=');
+			if (*++q == '\0') /* skip '=' */
+				return (-1);
+			count = strtol(q, &e, 0);
+			if (e == q || *e != '\0')
+				return (-1);
+			pmc_config->pm_caps |= PMC_CAP_THRESHOLD;
+			pmc_config->pm_md.pm_iap.pm_iap_config |=
+			    IAP_CMASK(count);
+		} else if (KWMATCH(p, IAP_KW_EDGE)) {
+			pmc_config->pm_caps |= PMC_CAP_EDGE;
+		} else if (KWMATCH(p, IAP_KW_INV)) {
+			pmc_config->pm_caps |= PMC_CAP_INVERT;
+		} else if (KWMATCH(p, IAP_KW_OS)) {
+			pmc_config->pm_caps |= PMC_CAP_SYSTEM;
+		} else if (KWMATCH(p, IAP_KW_USR)) {
+			pmc_config->pm_caps |= PMC_CAP_USER;
+		} else if (KWMATCH(p, IAP_KW_ANYTHREAD)) {
+			pmc_config->pm_md.pm_iap.pm_iap_config |= IAP_ANY;
+		} else if (KWMATCH(p, IAP_KW_CORE)) {
+			n = pmc_parse_mask(iap_core_mask, p, &evmask);
+			if (n != 1)
+				return (-1);
+		} else if (KWMATCH(p, IAP_KW_AGENT)) {
+			n = pmc_parse_mask(iap_agent_mask, p, &evmask);
+			if (n != 1)
+				return (-1);
+		} else if (KWMATCH(p, IAP_KW_PREFETCH)) {
+			n = pmc_parse_mask(iap_prefetch_mask, p, &evmask);
+			if (n != 1)
+				return (-1);
+		} else if (KWMATCH(p, IAP_KW_CACHESTATE)) {
+			n = pmc_parse_mask(iap_cachestate_mask, p, &cachestate);
+		} else if (cpu_info.pm_cputype == PMC_CPU_INTEL_CORE &&
+		    KWMATCH(p, IAP_KW_TRANSITION)) {
+			n = pmc_parse_mask(iap_transition_mask, p, &evmask);
+			if (n != 1)
+				return (-1);
+		} else if (cpu_info.pm_cputype == PMC_CPU_INTEL_ATOM ||
+		    cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2 ||
+		    cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME ||
+		    cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7) {
+			if (KWMATCH(p, IAP_KW_SNOOPRESPONSE)) {
+				n = pmc_parse_mask(iap_snoopresponse_mask, p,
+				    &evmask);
+			} else if (KWMATCH(p, IAP_KW_SNOOPTYPE)) {
+				n = pmc_parse_mask(iap_snooptype_mask, p,
+				    &evmask);
+			} else
+				return (-1);
+		} else
+			return (-1);
+
+		if (n < 0)	/* Parsing failed. */
+			return (-1);
+	}
+
+	pmc_config->pm_md.pm_iap.pm_iap_config |= evmask;
+
+	/*
+	 * If the event requires a 'cachestate' qualifier but was not
+	 * specified by the user, use a sensible default.
+	 */
+	switch (pe) {
+	case PMC_EV_IAP_EVENT_28H: /* Core, Core2, Atom */
+	case PMC_EV_IAP_EVENT_29H: /* Core, Core2, Atom */
+	case PMC_EV_IAP_EVENT_2AH: /* Core, Core2, Atom */
+	case PMC_EV_IAP_EVENT_2BH: /* Atom, Core2 */
+	case PMC_EV_IAP_EVENT_2EH: /* Core, Core2, Atom */
+	case PMC_EV_IAP_EVENT_30H: /* Core, Core2, Atom */
+	case PMC_EV_IAP_EVENT_32H: /* Core */
+	case PMC_EV_IAP_EVENT_40H: /* Core */
+	case PMC_EV_IAP_EVENT_41H: /* Core */
+	case PMC_EV_IAP_EVENT_42H: /* Core, Core2, Atom */
+	case PMC_EV_IAP_EVENT_77H: /* Core */
+		if (cachestate == 0)
+			cachestate = (0xF << 8);
+	default:
+		break;
+	}
+
+	pmc_config->pm_md.pm_iap.pm_iap_config |= cachestate;
+
+	return (0);
+}
+
+/*
  * AMD K8 PMCs.
  *
  * These are very similar to AMD K7 PMCs, but support more kinds of
@@ -317,7 +672,7 @@ static struct pmc_event_alias k8_aliases
 	EV_ALIAS("cycles",		"tsc"),
 	EV_ALIAS("dc-misses",		"k8-dc-miss"),
 	EV_ALIAS("ic-misses",		"k8-ic-miss"),
-	EV_ALIAS("instructions", 	"k8-fr-retired-x86-instructions"),
+	EV_ALIAS("instructions",	"k8-fr-retired-x86-instructions"),
 	EV_ALIAS("interrupts",		"k8-fr-taken-hardware-interrupts"),
 	EV_ALIAS("unhalted-cycles",	"k8-bu-cpu-clk-unhalted"),
 	EV_ALIAS(NULL, NULL)
@@ -492,7 +847,7 @@ static const struct pmc_masks k8_mask_np
 /* nb hypertransport bus bandwidth */
 static const struct pmc_masks k8_mask_nhbb[] = { /* HT bus bandwidth */
 	__K8MASK(command,	0),
-	__K8MASK(data, 	1),
+	__K8MASK(data,	1),
 	__K8MASK(buffer-release, 2),
 	__K8MASK(nop,	3),
 	NULLMASK
@@ -511,21 +866,14 @@ static int
 k8_allocate_pmc(enum pmc_event pe, char *ctrspec,
     struct pmc_op_pmcallocate *pmc_config)
 {
-	char 		*e, *p, *q;
-	int 		n;
+	char		*e, *p, *q;
+	int		n;
 	uint32_t	count, evmask;
 	const struct pmc_masks	*pm, *pmask;
 
-	pmc_config->pm_caps |= PMC_CAP_READ;
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 	pmc_config->pm_md.pm_amd.pm_amd_config = 0;
 
-	if (pe == PMC_EV_TSC_TSC) {
-		/* TSC events must be unqualified. */
-		if (ctrspec && *ctrspec != '\0')
-			return -1;
-		return 0;
-	}
-
 	pmask = NULL;
 	evmask = 0;
 
@@ -599,17 +947,15 @@ k8_allocate_pmc(enum pmc_event pe, char 
 		break;		/* no options defined */
 	}
 
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
-
 	while ((p = strsep(&ctrspec, ",")) != NULL) {
 		if (KWPREFIXMATCH(p, K8_KW_COUNT "=")) {
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 
 			count = strtol(q, &e, 0);
 			if (e == q || *e != '\0')
-				return -1;
+				return (-1);
 
 			pmc_config->pm_caps |= PMC_CAP_THRESHOLD;
 			pmc_config->pm_md.pm_amd.pm_amd_config |=
@@ -621,18 +967,17 @@ k8_allocate_pmc(enum pmc_event pe, char 
 			pmc_config->pm_caps |= PMC_CAP_INVERT;
 		} else if (KWPREFIXMATCH(p, K8_KW_MASK "=")) {
 			if ((n = pmc_parse_mask(pmask, p, &evmask)) < 0)
-				return -1;
+				return (-1);
 			pmc_config->pm_caps |= PMC_CAP_QUALIFIER;
 		} else if (KWMATCH(p, K8_KW_OS)) {
 			pmc_config->pm_caps |= PMC_CAP_SYSTEM;
 		} else if (KWMATCH(p, K8_KW_USR)) {
 			pmc_config->pm_caps |= PMC_CAP_USER;
 		} else
-			return -1;
+			return (-1);
 	}
 
 	/* other post processing */
-
 	switch (pe) {
 	case PMC_EV_K8_FP_DISPATCHED_FPU_OPS:
 	case PMC_EV_K8_FP_CYCLES_WITH_NO_FPU_OPS_RETIRED:
@@ -648,7 +993,7 @@ k8_allocate_pmc(enum pmc_event pe, char 
 	case PMC_EV_K8_LS_LOCKED_OPERATION:
 		/* XXX CPU Rev A,B evmask is to be zero */
 		if (evmask & (evmask - 1)) /* > 1 bit set */
-			return -1;
+			return (-1);
 		if (evmask == 0) {
 			evmask = 0x01; /* Rev C and later: #instrs */
 			pmc_config->pm_caps |= PMC_CAP_QUALIFIER;
@@ -666,7 +1011,7 @@ k8_allocate_pmc(enum pmc_event pe, char 
 		pmc_config->pm_md.pm_amd.pm_amd_config =
 		    AMD_PMC_TO_UNITMASK(evmask);
 
-	return 0;
+	return (0);
 }
 
 #endif
@@ -1008,25 +1353,17 @@ p4_allocate_pmc(enum pmc_event pe, char 
 	uint32_t evmask, cccractivemask;
 	const struct pmc_masks *pm, *pmask;
 
-	pmc_config->pm_caps |= PMC_CAP_READ;
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 	pmc_config->pm_md.pm_p4.pm_p4_cccrconfig =
 	    pmc_config->pm_md.pm_p4.pm_p4_escrconfig = 0;
 
-	if (pe == PMC_EV_TSC_TSC) {
-		/* TSC must not be further qualified */
-		if (ctrspec && *ctrspec != '\0')
-			return -1;
-		return 0;
-	}
-
 	pmask   = NULL;
 	evmask  = 0;
 	cccractivemask = 0x3;
 	has_tag = has_busreqtype = 0;
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
 
 #define	__P4SETMASK(M) do {				\
-	pmask = p4_mask_##M; 				\
+	pmask = p4_mask_##M;				\
 } while (0)
 
 	switch (pe) {
@@ -1159,7 +1496,7 @@ p4_allocate_pmc(enum pmc_event pe, char 
 		__P4SETMASK(machclr);
 		break;
 	default:
-		return -1;
+		return (-1);
 	}
 
 	/* process additional flags */
@@ -1167,30 +1504,30 @@ p4_allocate_pmc(enum pmc_event pe, char 
 		if (KWPREFIXMATCH(p, P4_KW_ACTIVE)) {
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 
-			if (strcmp(q, P4_KW_ACTIVE_NONE) == 0)
+			if (strcasecmp(q, P4_KW_ACTIVE_NONE) == 0)
 				cccractivemask = 0x0;
-			else if (strcmp(q, P4_KW_ACTIVE_SINGLE) == 0)
+			else if (strcasecmp(q, P4_KW_ACTIVE_SINGLE) == 0)
 				cccractivemask = 0x1;
-			else if (strcmp(q, P4_KW_ACTIVE_BOTH) == 0)
+			else if (strcasecmp(q, P4_KW_ACTIVE_BOTH) == 0)
 				cccractivemask = 0x2;
-			else if (strcmp(q, P4_KW_ACTIVE_ANY) == 0)
+			else if (strcasecmp(q, P4_KW_ACTIVE_ANY) == 0)
 				cccractivemask = 0x3;
 			else
-				return -1;
+				return (-1);
 
 		} else if (KWPREFIXMATCH(p, P4_KW_BUSREQTYPE)) {
 			if (has_busreqtype == 0)
-				return -1;
+				return (-1);
 
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 
 			count = strtol(q, &e, 0);
 			if (e == q || *e != '\0')
-				return -1;
+				return (-1);
 			evmask = (evmask & ~0x1F) | (count & 0x1F);
 		} else if (KWMATCH(p, P4_KW_CASCADE))
 			pmc_config->pm_caps |= PMC_CAP_CASCADE;
@@ -1200,7 +1537,7 @@ p4_allocate_pmc(enum pmc_event pe, char 
 			pmc_config->pm_caps |= PMC_CAP_INVERT;
 		else if (KWPREFIXMATCH(p, P4_KW_MASK "=")) {
 			if ((n = pmc_parse_mask(pmask, p, &evmask)) < 0)
-				return -1;
+				return (-1);
 			pmc_config->pm_caps |= PMC_CAP_QUALIFIER;
 		} else if (KWMATCH(p, P4_KW_OS))
 			pmc_config->pm_caps |= PMC_CAP_SYSTEM;
@@ -1208,15 +1545,15 @@ p4_allocate_pmc(enum pmc_event pe, char 
 			pmc_config->pm_caps |= PMC_CAP_PRECISE;
 		else if (KWPREFIXMATCH(p, P4_KW_TAG "=")) {
 			if (has_tag == 0)
-				return -1;
+				return (-1);
 
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 
 			count = strtol(q, &e, 0);
 			if (e == q || *e != '\0')
-				return -1;
+				return (-1);
 
 			pmc_config->pm_caps |= PMC_CAP_TAGGING;
 			pmc_config->pm_md.pm_p4.pm_p4_escrconfig |=
@@ -1224,11 +1561,11 @@ p4_allocate_pmc(enum pmc_event pe, char 
 		} else if (KWPREFIXMATCH(p, P4_KW_THRESHOLD "=")) {
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 
 			count = strtol(q, &e, 0);
 			if (e == q || *e != '\0')
-				return -1;
+				return (-1);
 
 			pmc_config->pm_caps |= PMC_CAP_THRESHOLD;
 			pmc_config->pm_md.pm_p4.pm_p4_cccrconfig &=
@@ -1238,7 +1575,7 @@ p4_allocate_pmc(enum pmc_event pe, char 
 		} else if (KWMATCH(p, P4_KW_USR))
 			pmc_config->pm_caps |= PMC_CAP_USER;
 		else
-			return -1;
+			return (-1);
 	}
 
 	/* other post processing */
@@ -1258,16 +1595,16 @@ p4_allocate_pmc(enum pmc_event pe, char 
 	case PMC_EV_P4_FSB_DATA_ACTIVITY:
 		if ((evmask & 0x06) == 0x06 ||
 		    (evmask & 0x18) == 0x18)
-			return -1; /* can't have own+other bits together */
+			return (-1); /* can't have own+other bits together */
 		if (evmask == 0) /* default:drdy-{drv,own}+dbsy{drv,own} */
 			evmask = 0x1D;
 		break;
 	case PMC_EV_P4_MACHINE_CLEAR:
 		/* only one bit is allowed to be set */
 		if ((evmask & (evmask - 1)) != 0)
-			return -1;
+			return (-1);
 		if (evmask == 0) {
-			evmask = 0x1; 	/* 'CLEAR' */
+			evmask = 0x1;	/* 'CLEAR' */
 			pmc_config->pm_caps |= PMC_CAP_QUALIFIER;
 		}
 		break;
@@ -1282,7 +1619,7 @@ p4_allocate_pmc(enum pmc_event pe, char 
 	pmc_config->pm_md.pm_p4.pm_p4_escrconfig =
 	    P4_ESCR_TO_EVENT_MASK(evmask);
 
-	return 0;
+	return (0);
 }
 
 #endif
@@ -1294,7 +1631,14 @@ p4_allocate_pmc(enum pmc_event pe, char 
  */
 
 static struct pmc_event_alias p5_aliases[] = {
-	EV_ALIAS("cycles", "tsc"),
+	EV_ALIAS("branches",		"p5-taken-branches"),
+	EV_ALIAS("cycles",		"tsc"),
+	EV_ALIAS("dc-misses",		"p5-data-read-miss-or-write-miss"),
+	EV_ALIAS("ic-misses",		"p5-code-cache-miss"),
+	EV_ALIAS("instructions",	"p5-instructions-executed"),
+	EV_ALIAS("interrupts",		"p5-hardware-interrupts"),
+	EV_ALIAS("unhalted-cycles",
+	    "p5-number-of-cycles-not-in-halt-state"),
 	EV_ALIAS(NULL, NULL)
 };
 
@@ -1302,7 +1646,7 @@ static int
 p5_allocate_pmc(enum pmc_event pe, char *ctrspec,
     struct pmc_op_pmcallocate *pmc_config)
 {
-	return -1 || pe || ctrspec || pmc_config; /* shut up gcc */
+	return (-1 || pe || ctrspec || pmc_config); /* shut up gcc */
 }
 
 /*
@@ -1438,22 +1782,15 @@ p6_allocate_pmc(enum pmc_event pe, char 
 	int count, n;
 	const struct pmc_masks *pm, *pmask;
 
-	pmc_config->pm_caps |= PMC_CAP_READ;
+	pmc_config->pm_caps |= (PMC_CAP_READ | PMC_CAP_WRITE);
 	pmc_config->pm_md.pm_ppro.pm_ppro_config = 0;
 
-	if (pe == PMC_EV_TSC_TSC) {
-		if (ctrspec && *ctrspec != '\0')
-			return -1;
-		return 0;
-	}
-
-	pmc_config->pm_caps |= PMC_CAP_WRITE;
 	evmask = 0;
 
 #define	P6MASKSET(M)	pmask = p6_mask_ ## M
 
 	switch(pe) {
-	case PMC_EV_P6_L2_IFETCH: 	P6MASKSET(mesi); break;
+	case PMC_EV_P6_L2_IFETCH:	P6MASKSET(mesi); break;
 	case PMC_EV_P6_L2_LD:		P6MASKSET(mesi); break;
 	case PMC_EV_P6_L2_ST:		P6MASKSET(mesi); break;
 	case PMC_EV_P6_L2_RQSTS:	P6MASKSET(mesi); break;
@@ -1513,10 +1850,10 @@ p6_allocate_pmc(enum pmc_event pe, char 
 		if (KWPREFIXMATCH(p, P6_KW_CMASK "=")) {
 			q = strchr(p, '=');
 			if (*++q == '\0') /* skip '=' */
-				return -1;
+				return (-1);
 			count = strtol(q, &e, 0);
 			if (e == q || *e != '\0')
-				return -1;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From fabient at FreeBSD.org  Sun Jun  7 18:45:05 2009
From: fabient at FreeBSD.org (Fabien Thomas)
Date: Sun Jun  7 18:45:16 2009
Subject: svn commit: r193638 - in stable/7: . sys/sys
Message-ID: <200906071845.n57Ij4Rb001597@svn.freebsd.org>

Author: fabient
Date: Sun Jun  7 18:45:04 2009
New Revision: 193638
URL: http://svn.freebsd.org/changeset/base/193638

Log:
  Bump sys/param.h for the merge of PmcTools.
  Add a note to rebuild world in UPDATING.
  
  Reviewed by: jkoshy (mentor)

Modified:
  stable/7/UPDATING
  stable/7/sys/sys/param.h

Modified: stable/7/UPDATING
==============================================================================
--- stable/7/UPDATING	Sun Jun  7 18:19:04 2009	(r193637)
+++ stable/7/UPDATING	Sun Jun  7 18:45:04 2009	(r193638)
@@ -8,6 +8,10 @@ Items affecting the ports and packages s
 /usr/ports/UPDATING.  Please read that file before running
 portupgrade.
 
+20090606:
+	The components of PmcTools have been upgraded. Please
+	update world and the kernel.
+
 20090521:
 	The k8temp(4) driver has been renamed to amdtemp(4) since               
 	support for K10 and K11 CPU families was added.

Modified: stable/7/sys/sys/param.h
==============================================================================
--- stable/7/sys/sys/param.h	Sun Jun  7 18:19:04 2009	(r193637)
+++ stable/7/sys/sys/param.h	Sun Jun  7 18:45:04 2009	(r193638)
@@ -57,7 +57,7 @@
  *		is created, otherwise 1.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 702102	/* Master, propagated to newvers */
+#define __FreeBSD_version 702103	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 
From fabient at FreeBSD.org  Sun Jun  7 18:53:26 2009
From: fabient at FreeBSD.org (Fabien Thomas)
Date: Sun Jun  7 18:53:42 2009
Subject: svn commit: r193639 - stable/7/sys/conf
Message-ID: <200906071853.n57IrPLG001921@svn.freebsd.org>

Author: fabient
Date: Sun Jun  7 18:53:25 2009
New Revision: 193639
URL: http://svn.freebsd.org/changeset/base/193639

Log:
  Repair pc98 LINT build broken by PmcTools merge.
  
  Reviewed by: jkoshy (mentor)

Modified:
  stable/7/sys/conf/files.pc98

Modified: stable/7/sys/conf/files.pc98
==============================================================================
--- stable/7/sys/conf/files.pc98	Sun Jun  7 18:45:04 2009	(r193638)
+++ stable/7/sys/conf/files.pc98	Sun Jun  7 18:53:25 2009	(r193639)
@@ -105,6 +105,7 @@ dev/fb/fb.c			optional fb | gdc
 dev/fe/if_fe_cbus.c		optional fe isa
 dev/hwpmc/hwpmc_amd.c		optional hwpmc
 dev/hwpmc/hwpmc_intel.c		optional hwpmc
+dev/hwpmc/hwpmc_core.c		optional hwpmc
 dev/hwpmc/hwpmc_pentium.c	optional hwpmc
 dev/hwpmc/hwpmc_piv.c		optional hwpmc
 dev/hwpmc/hwpmc_ppro.c		optional hwpmc
From fabient at FreeBSD.org  Sun Jun  7 19:12:42 2009
From: fabient at FreeBSD.org (Fabien Thomas)
Date: Sun Jun  7 19:12:52 2009
Subject: svn commit: r193641 - in stable/7/sys: arm/include ia64/include
	powerpc/include sparc64/include sun4v/include
Message-ID: <200906071912.n57JCewB002479@svn.freebsd.org>

Author: fabient
Date: Sun Jun  7 19:12:40 2009
New Revision: 193641
URL: http://svn.freebsd.org/changeset/base/193641

Log:
  Unbreak LINT.

Modified:
  stable/7/sys/arm/include/pmc_mdep.h
  stable/7/sys/ia64/include/pmc_mdep.h
  stable/7/sys/powerpc/include/pmc_mdep.h
  stable/7/sys/sparc64/include/pmc_mdep.h
  stable/7/sys/sun4v/include/pmc_mdep.h

Modified: stable/7/sys/arm/include/pmc_mdep.h
==============================================================================
--- stable/7/sys/arm/include/pmc_mdep.h	Sun Jun  7 19:12:08 2009	(r193640)
+++ stable/7/sys/arm/include/pmc_mdep.h	Sun Jun  7 19:12:40 2009	(r193641)
@@ -19,6 +19,10 @@ union pmc_md_op_pmcallocate {
 union pmc_md_pmc {
 };
 
+#define	PMC_TRAPFRAME_TO_PC(TF)	(0)	/* Stubs */
+#define	PMC_TRAPFRAME_TO_FP(TF)	(0)
+#define	PMC_TRAPFRAME_TO_SP(TF)	(0)
+
 #endif
 
 #endif /* !_MACHINE_PMC_MDEP_H_ */

Modified: stable/7/sys/ia64/include/pmc_mdep.h
==============================================================================
--- stable/7/sys/ia64/include/pmc_mdep.h	Sun Jun  7 19:12:08 2009	(r193640)
+++ stable/7/sys/ia64/include/pmc_mdep.h	Sun Jun  7 19:12:40 2009	(r193641)
@@ -19,6 +19,10 @@ union pmc_md_op_pmcallocate {
 union pmc_md_pmc {
 };
 
+#define	PMC_TRAPFRAME_TO_PC(TF)	(0)	/* Stubs */
+#define	PMC_TRAPFRAME_TO_FP(TF)	(0)
+#define	PMC_TRAPFRAME_TO_SP(TF)	(0)
+
 #endif
 
 #endif /* !_MACHINE_PMC_MDEP_H_ */

Modified: stable/7/sys/powerpc/include/pmc_mdep.h
==============================================================================
--- stable/7/sys/powerpc/include/pmc_mdep.h	Sun Jun  7 19:12:08 2009	(r193640)
+++ stable/7/sys/powerpc/include/pmc_mdep.h	Sun Jun  7 19:12:40 2009	(r193641)
@@ -20,6 +20,10 @@ union pmc_md_op_pmcallocate {
 union pmc_md_pmc {
 };
 
+#define	PMC_TRAPFRAME_TO_PC(TF)	(0)	/* Stubs */
+#define	PMC_TRAPFRAME_TO_FP(TF)	(0)
+#define	PMC_TRAPFRAME_TO_SP(TF)	(0)
+
 #endif
 
 #endif /* !_MACHINE_PMC_MDEP_H_ */

Modified: stable/7/sys/sparc64/include/pmc_mdep.h
==============================================================================
--- stable/7/sys/sparc64/include/pmc_mdep.h	Sun Jun  7 19:12:08 2009	(r193640)
+++ stable/7/sys/sparc64/include/pmc_mdep.h	Sun Jun  7 19:12:40 2009	(r193641)
@@ -19,6 +19,10 @@ union pmc_md_op_pmcallocate {
 union pmc_md_pmc {
 };
 
+#define	PMC_TRAPFRAME_TO_PC(TF)	(0)	/* Stubs */
+#define	PMC_TRAPFRAME_TO_FP(TF)	(0)
+#define	PMC_TRAPFRAME_TO_SP(TF)	(0)
+
 #endif
 
 #endif /* !_MACHINE_PMC_MDEP_H_ */

Modified: stable/7/sys/sun4v/include/pmc_mdep.h
==============================================================================
--- stable/7/sys/sun4v/include/pmc_mdep.h	Sun Jun  7 19:12:08 2009	(r193640)
+++ stable/7/sys/sun4v/include/pmc_mdep.h	Sun Jun  7 19:12:40 2009	(r193641)
@@ -19,6 +19,10 @@ union pmc_md_op_pmcallocate {
 union pmc_md_pmc {
 };
 
+#define	PMC_TRAPFRAME_TO_PC(TF)	(0)	/* Stubs */
+#define	PMC_TRAPFRAME_TO_FP(TF)	(0)
+#define	PMC_TRAPFRAME_TO_SP(TF)	(0)
+
 #endif
 
 #endif /* !_MACHINE_PMC_MDEP_H_ */
From hrs at FreeBSD.org  Mon Jun  8 05:11:37 2009
From: hrs at FreeBSD.org (Hiroki Sato)
Date: Mon Jun  8 05:11:42 2009
Subject: svn commit: r193687 - stable/7/release/doc/en_US.ISO8859-1/errata
Message-ID: <200906080511.n585BZP5016771@svn.freebsd.org>

Author: hrs
Date: Mon Jun  8 05:11:35 2009
New Revision: 193687
URL: http://svn.freebsd.org/changeset/base/193687

Log:
  Document possible bge(4) panic on shutdown time.

Modified:
  stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml

Modified: stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml
==============================================================================
--- stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml	Mon Jun  8 05:00:32 2009	(r193686)
+++ stable/7/release/doc/en_US.ISO8859-1/errata/article.sgml	Mon Jun  8 05:11:35 2009	(r193687)
@@ -192,6 +192,10 @@
       0 (globally on the system).  An Errata Notice
       to fix this problem is planned after the release.
 
+    [20090608] An issue was found in the &man.bge.4; driver that
+      it can cause a system panic upon reboot with heavy network
+      traffic.  A fix has been committed to RELENG_7 (r192127).
+
   
     Late-Breaking News and Corrections
 
From kib at FreeBSD.org  Mon Jun  8 13:31:29 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Mon Jun  8 13:31:51 2009
Subject: svn commit: r193713 - in stable/7/sys: . amd64/amd64 contrib/pf
	dev/ath/ath_hal dev/cxgb
Message-ID: <200906081331.n58DVRDO030605@svn.freebsd.org>

Author: kib
Date: Mon Jun  8 13:31:27 2009
New Revision: 193713
URL: http://svn.freebsd.org/changeset/base/193713

Log:
  MFC r193535:
  Put intrcnt, eintrcnt, intrnames and eintrnames into the .data section.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/amd64/support.S
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/amd64/amd64/support.S
==============================================================================
--- stable/7/sys/amd64/amd64/support.S	Mon Jun  8 12:15:39 2009	(r193712)
+++ stable/7/sys/amd64/amd64/support.S	Mon Jun  8 13:31:27 2009	(r193713)
@@ -38,6 +38,7 @@
 
 #include "assym.s"
 
+	.data
 	ALIGN_DATA
 	.globl	intrcnt, eintrcnt
 intrcnt:
From jhb at FreeBSD.org  Mon Jun  8 14:52:18 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Mon Jun  8 14:52:24 2009
Subject: svn commit: r193717 - in stable/7/sys: . boot/i386/libi386
	contrib/pf dev/ath/ath_hal dev/cxgb
Message-ID: <200906081452.n58EqHrH032482@svn.freebsd.org>

Author: jhb
Date: Mon Jun  8 14:52:17 2009
New Revision: 193717
URL: http://svn.freebsd.org/changeset/base/193717

Log:
  MFC: Add a missing parameter when displaying GPT partitions with an unknown
  UUID.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/boot/i386/libi386/biosdisk.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/boot/i386/libi386/biosdisk.c
==============================================================================
--- stable/7/sys/boot/i386/libi386/biosdisk.c	Mon Jun  8 14:37:47 2009	(r193716)
+++ stable/7/sys/boot/i386/libi386/biosdisk.c	Mon Jun  8 14:52:17 2009	(r193717)
@@ -375,6 +375,7 @@ bd_printgptpart(struct open_disk *od, st
 	sprintf(line, "%s: FreeBSD swap%s\n", prefix, stats);
     else
 	sprintf(line, "%s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x%s\n",
+	    prefix,
 	    gp->gp_type.time_low, gp->gp_type.time_mid,
 	    gp->gp_type.time_hi_and_version,
 	    gp->gp_type.clock_seq_hi_and_reserved, gp->gp_type.clock_seq_low,
From jhb at freebsd.org  Mon Jun  8 15:33:58 2009
From: jhb at freebsd.org (John Baldwin)
Date: Mon Jun  8 15:34:37 2009
Subject: svn commit: r192033 - stable/7/sys/dev/ata
In-Reply-To: <4A10A324.5040501@incunabulum.net>
References: <200905130255.n4D2tMQZ040010@svn.freebsd.org>
	<4A109662.9060909@FreeBSD.org> <4A10A324.5040501@incunabulum.net>
Message-ID: <200906081050.41020.jhb@freebsd.org>

On Sunday 17 May 2009 7:52:04 pm Bruce Simpson wrote:
> Alexander Motin wrote:
> > ...
> > This change is not anyhow related to your system. Looks like the real 
> > reason found by jhb@ on stable@. Probably something become more strict 
> > in system resource management last time and this driver violates now.
> >
> 
> Thanks... I reckon John is probably on the money with this but have not 
> looked closely. Hopefully the fix is backportable... I will try to find 
> time to test HEAD, I need to do some HEAD testing on this box anyway, 
> using a USB key is possible for this with NanoBSD now :-)

Were you ever able to test http://www.FreeBSD.org/~jhb/patches/ata_ali.patch?

-- 
John Baldwin
From des at FreeBSD.org  Mon Jun  8 19:22:13 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 19:22:19 2009
Subject: svn commit: r193738 - stable/7/usr.bin/rpcgen
Message-ID: <200906081922.n58JMCSB039638@svn.freebsd.org>

Author: des
Date: Mon Jun  8 19:22:12 2009
New Revision: 193738
URL: http://svn.freebsd.org/changeset/base/193738

Log:
  merge r173761: generate code that respects C99's strict aliasing rules.

Modified:
  stable/7/usr.bin/rpcgen/   (props changed)
  stable/7/usr.bin/rpcgen/rpc_cout.c

Modified: stable/7/usr.bin/rpcgen/rpc_cout.c
==============================================================================
--- stable/7/usr.bin/rpcgen/rpc_cout.c	Mon Jun  8 18:58:54 2009	(r193737)
+++ stable/7/usr.bin/rpcgen/rpc_cout.c	Mon Jun  8 19:22:12 2009	(r193738)
@@ -200,11 +200,13 @@ print_ifsizeof(int indent, const char *p
 }
 
 static void
-print_ifclose(int indent)
+print_ifclose(int indent, int brace)
 {
 	f_print(fout, "))\n");
 	tabify(fout, indent);
 	f_print(fout, "\treturn (FALSE);\n");
+	if (brace)
+		f_print(fout, "\t}\n");
 }
 
 static void
@@ -212,12 +214,16 @@ print_ifstat(int indent, const char *pre
     const char *amax, const char *objname, const char *name)
 {
 	const char *alt = NULL;
+	int brace = 0;
 
 	switch (rel) {
 	case REL_POINTER:
+		brace = 1;
+		f_print(fout, "\t{\n");
+		f_print(fout, "\t%s **pp = %s;\n", type, objname);
 		print_ifopen(indent, "pointer");
 		print_ifarg("(char **)");
-		f_print(fout, "%s", objname);
+		f_print(fout, "pp");
 		print_ifsizeof(0, prefix, type);
 		break;
 	case REL_VECTOR:
@@ -274,7 +280,7 @@ print_ifstat(int indent, const char *pre
 		print_ifarg(objname);
 		break;
 	}
-	print_ifclose(indent);
+	print_ifclose(indent, brace);
 }
 
 /* ARGSUSED */
@@ -283,7 +289,7 @@ emit_enum(definition *def __unused)
 {
 	print_ifopen(1, "enum");
 	print_ifarg("(enum_t *)objp");
-	print_ifclose(1);
+	print_ifclose(1, 0);
 }
 
 static void
From des at FreeBSD.org  Mon Jun  8 19:24:39 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 19:24:50 2009
Subject: svn commit: r193739 - stable/7/include
Message-ID: <200906081924.n58JObsf039759@svn.freebsd.org>

Author: des
Date: Mon Jun  8 19:24:37 2009
New Revision: 193739
URL: http://svn.freebsd.org/changeset/base/193739

Log:
  merge r173762: use a forward declaration to avoid an aliasing warning

Modified:
  stable/7/include/   (props changed)
  stable/7/include/dirent.h

Modified: stable/7/include/dirent.h
==============================================================================
--- stable/7/include/dirent.h	Mon Jun  8 19:22:12 2009	(r193738)
+++ stable/7/include/dirent.h	Mon Jun  8 19:24:37 2009	(r193739)
@@ -60,6 +60,7 @@
 #define	DIRBLKSIZ	1024
 
 struct _telldir;		/* see telldir.h */
+struct pthread_mutex;
 
 /* structure describing an open directory. */
 typedef struct _dirdesc {
@@ -71,7 +72,7 @@ typedef struct _dirdesc {
 	long	dd_seek;	/* magic cookie returned by getdirentries */
 	long	dd_rewind;	/* magic cookie for rewinding */
 	int	dd_flags;	/* flags for readdir */
-	void	*dd_lock;	/* hack to avoid including  */
+	struct pthread_mutex	*dd_lock;	/* lock */
 	struct _telldir *dd_td;	/* telldir position recording */
 } DIR;
 
From des at FreeBSD.org  Mon Jun  8 19:40:49 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 19:40:56 2009
Subject: svn commit: r193740 - stable/7/lib/libc/string
Message-ID: <200906081940.n58JemMt040560@svn.freebsd.org>

Author: des
Date: Mon Jun  8 19:40:48 2009
New Revision: 193740
URL: http://svn.freebsd.org/changeset/base/193740

Log:
  Remove bogus mergeinfo

Modified:
  stable/7/lib/libc/string/ffsll.c   (props changed)
  stable/7/lib/libc/string/flsll.c   (props changed)
From des at FreeBSD.org  Mon Jun  8 19:52:13 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 19:52:31 2009
Subject: svn commit: r193741 - in stable/7/lib/libc: . gen
Message-ID: <200906081952.n58JqCLi040920@svn.freebsd.org>

Author: des
Date: Mon Jun  8 19:52:12 2009
New Revision: 193741
URL: http://svn.freebsd.org/changeset/base/193741

Log:
  merge r174221: remove unnecessary casts

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/gen/closedir.c
  stable/7/lib/libc/gen/readdir.c
  stable/7/lib/libc/gen/seekdir.c
  stable/7/lib/libc/gen/telldir.c

Modified: stable/7/lib/libc/gen/closedir.c
==============================================================================
--- stable/7/lib/libc/gen/closedir.c	Mon Jun  8 19:40:48 2009	(r193740)
+++ stable/7/lib/libc/gen/closedir.c	Mon Jun  8 19:52:12 2009	(r193741)
@@ -54,7 +54,7 @@ closedir(dirp)
 	int fd;
 
 	if (__isthreaded)
-		_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_lock(&dirp->dd_lock);
 	_seekdir(dirp, dirp->dd_rewind);	/* free seekdir storage */
 	fd = dirp->dd_fd;
 	dirp->dd_fd = -1;
@@ -62,8 +62,8 @@ closedir(dirp)
 	free((void *)dirp->dd_buf);
 	_reclaim_telldir(dirp);
 	if (__isthreaded) {
-		_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
-		_pthread_mutex_destroy((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_unlock(&dirp->dd_lock);
+		_pthread_mutex_destroy(&dirp->dd_lock);
 	}
 	free((void *)dirp);
 	return(_close(fd));

Modified: stable/7/lib/libc/gen/readdir.c
==============================================================================
--- stable/7/lib/libc/gen/readdir.c	Mon Jun  8 19:40:48 2009	(r193740)
+++ stable/7/lib/libc/gen/readdir.c	Mon Jun  8 19:52:12 2009	(r193741)
@@ -88,9 +88,9 @@ readdir(dirp)
 	struct dirent	*dp;
 
 	if (__isthreaded) {
-		_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_lock(&dirp->dd_lock);
 		dp = _readdir_unlocked(dirp, 1);
-		_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_unlock(&dirp->dd_lock);
 	}
 	else
 		dp = _readdir_unlocked(dirp, 1);
@@ -109,10 +109,10 @@ readdir_r(dirp, entry, result)
 	saved_errno = errno;
 	errno = 0;
 	if (__isthreaded) {
-		_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_lock(&dirp->dd_lock);
 		if ((dp = _readdir_unlocked(dirp, 1)) != NULL)
 			memcpy(entry, dp, _GENERIC_DIRSIZ(dp));
-		_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_unlock(&dirp->dd_lock);
 	}
 	else if ((dp = _readdir_unlocked(dirp, 1)) != NULL)
 		memcpy(entry, dp, _GENERIC_DIRSIZ(dp));

Modified: stable/7/lib/libc/gen/seekdir.c
==============================================================================
--- stable/7/lib/libc/gen/seekdir.c	Mon Jun  8 19:40:48 2009	(r193740)
+++ stable/7/lib/libc/gen/seekdir.c	Mon Jun  8 19:52:12 2009	(r193741)
@@ -52,8 +52,8 @@ seekdir(dirp, loc)
 	long loc;
 {
 	if (__isthreaded)
-		_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_lock(&dirp->dd_lock);
 	_seekdir(dirp, loc);
 	if (__isthreaded)
-		_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_unlock(&dirp->dd_lock);
 }

Modified: stable/7/lib/libc/gen/telldir.c
==============================================================================
--- stable/7/lib/libc/gen/telldir.c	Mon Jun  8 19:40:48 2009	(r193740)
+++ stable/7/lib/libc/gen/telldir.c	Mon Jun  8 19:52:12 2009	(r193741)
@@ -64,13 +64,13 @@ telldir(dirp)
 	if ((lp = (struct ddloc *)malloc(sizeof(struct ddloc))) == NULL)
 		return (-1);
 	if (__isthreaded)
-		_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_lock(&dirp->dd_lock);
 	lp->loc_index = dirp->dd_td->td_loccnt++;
 	lp->loc_seek = dirp->dd_seek;
 	lp->loc_loc = dirp->dd_loc;
 	LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe);
 	if (__isthreaded)
-		_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
+		_pthread_mutex_unlock(&dirp->dd_lock);
 	return (lp->loc_index);
 }
 
From des at FreeBSD.org  Mon Jun  8 19:56:52 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 19:56:57 2009
Subject: svn commit: r193743 - stable/7/lib/libc
Message-ID: <200906081956.n58Juo4O041155@svn.freebsd.org>

Author: des
Date: Mon Jun  8 19:56:50 2009
New Revision: 193743
URL: http://svn.freebsd.org/changeset/base/193743

Log:
  Record a rev that was merged in the previous commit.

Modified:
  stable/7/lib/libc/   (props changed)
From des at FreeBSD.org  Mon Jun  8 19:59:28 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 19:59:34 2009
Subject: svn commit: r193745 - in stable/7/lib/libc: . rpc
Message-ID: <200906081959.n58JxRaF041391@svn.freebsd.org>

Author: des
Date: Mon Jun  8 19:59:26 2009
New Revision: 193745
URL: http://svn.freebsd.org/changeset/base/193745

Log:
  merge r173763: fix aliasing bug

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/rpc/authdes_prot.c
  stable/7/lib/libc/rpc/authunix_prot.c
  stable/7/lib/libc/rpc/key_prot_xdr.c
  stable/7/lib/libc/rpc/rpc_callmsg.c
  stable/7/lib/libc/rpc/rpc_prot.c
  stable/7/lib/libc/rpc/rpcb_prot.c
  stable/7/lib/libc/rpc/rpcb_st_xdr.c

Modified: stable/7/lib/libc/rpc/authdes_prot.c
==============================================================================
--- stable/7/lib/libc/rpc/authdes_prot.c	Mon Jun  8 19:57:35 2009	(r193744)
+++ stable/7/lib/libc/rpc/authdes_prot.c	Mon Jun  8 19:59:26 2009	(r193745)
@@ -54,10 +54,11 @@ xdr_authdes_cred(xdrs, cred)
 	XDR *xdrs;
 	struct authdes_cred *cred;
 {
+	enum authdes_namekind *padc_namekind = &cred->adc_namekind;
 	/*
 	 * Unrolled xdr
 	 */
-	ATTEMPT(xdr_enum(xdrs, (enum_t *)&cred->adc_namekind));
+	ATTEMPT(xdr_enum(xdrs, (enum_t *) padc_namekind));
 	switch (cred->adc_namekind) {
 	case ADN_FULLNAME:
 		ATTEMPT(xdr_string(xdrs, &cred->adc_fullname.name,

Modified: stable/7/lib/libc/rpc/authunix_prot.c
==============================================================================
--- stable/7/lib/libc/rpc/authunix_prot.c	Mon Jun  8 19:57:35 2009	(r193744)
+++ stable/7/lib/libc/rpc/authunix_prot.c	Mon Jun  8 19:59:26 2009	(r193745)
@@ -60,15 +60,18 @@ xdr_authunix_parms(xdrs, p)
 	XDR *xdrs;
 	struct authunix_parms *p;
 {
+	int **paup_gids;
 
 	assert(xdrs != NULL);
 	assert(p != NULL);
 
+	paup_gids = &p->aup_gids;
+
 	if (xdr_u_long(xdrs, &(p->aup_time))
 	    && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
 	    && xdr_int(xdrs, &(p->aup_uid))
 	    && xdr_int(xdrs, &(p->aup_gid))
-	    && xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
+	    && xdr_array(xdrs, (char **) paup_gids,
 		    &(p->aup_len), NGRPS, sizeof(int), (xdrproc_t)xdr_int) ) {
 		return (TRUE);
 	}

Modified: stable/7/lib/libc/rpc/key_prot_xdr.c
==============================================================================
--- stable/7/lib/libc/rpc/key_prot_xdr.c	Mon Jun  8 19:57:35 2009	(r193744)
+++ stable/7/lib/libc/rpc/key_prot_xdr.c	Mon Jun  8 19:59:26 2009	(r193745)
@@ -117,12 +117,14 @@ xdr_cryptkeyres(register XDR *xdrs, cryp
 bool_t
 xdr_unixcred(register XDR *xdrs, unixcred *objp)
 {
+	u_int **pgids_val;
 
 	if (!xdr_u_int(xdrs, &objp->uid))
 		return (FALSE);
 	if (!xdr_u_int(xdrs, &objp->gid))
 		return (FALSE);
-	if (!xdr_array(xdrs, (char **)&objp->gids.gids_val, (u_int *) &objp->gids.gids_len, MAXGIDS,
+	pgids_val = &objp->gids.gids_val;
+	if (!xdr_array(xdrs, (char **) pgids_val, (u_int *) &objp->gids.gids_len, MAXGIDS,
 		sizeof (u_int), (xdrproc_t) xdr_u_int))
 		return (FALSE);
 	return (TRUE);

Modified: stable/7/lib/libc/rpc/rpc_callmsg.c
==============================================================================
--- stable/7/lib/libc/rpc/rpc_callmsg.c	Mon Jun  8 19:57:35 2009	(r193744)
+++ stable/7/lib/libc/rpc/rpc_callmsg.c	Mon Jun  8 19:59:26 2009	(r193745)
@@ -59,6 +59,7 @@ xdr_callmsg(xdrs, cmsg)
 	XDR *xdrs;
 	struct rpc_msg *cmsg;
 {
+	enum msg_type *prm_direction;
 	int32_t *buf;
 	struct opaque_auth *oa;
 
@@ -190,9 +191,10 @@ xdr_callmsg(xdrs, cmsg)
 			return (TRUE);
 		}
 	}
+	prm_direction = &cmsg->rm_direction;
 	if (
 	    xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) &&
-	    xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) &&
+	    xdr_enum(xdrs, (enum_t *) prm_direction) &&
 	    (cmsg->rm_direction == CALL) &&
 	    xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
 	    (cmsg->rm_call.cb_rpcvers == RPC_MSG_VERSION) &&

Modified: stable/7/lib/libc/rpc/rpc_prot.c
==============================================================================
--- stable/7/lib/libc/rpc/rpc_prot.c	Mon Jun  8 19:57:35 2009	(r193744)
+++ stable/7/lib/libc/rpc/rpc_prot.c	Mon Jun  8 19:59:26 2009	(r193745)
@@ -108,14 +108,17 @@ xdr_accepted_reply(xdrs, ar)
 	XDR *xdrs;   
 	struct accepted_reply *ar;
 {
+	enum accept_stat *par_stat;
 
 	assert(xdrs != NULL);
 	assert(ar != NULL);
 
+	par_stat = &ar->ar_stat;
+
 	/* personalized union, rather than calling xdr_union */
 	if (! xdr_opaque_auth(xdrs, &(ar->ar_verf)))
 		return (FALSE);
-	if (! xdr_enum(xdrs, (enum_t *)&(ar->ar_stat)))
+	if (! xdr_enum(xdrs, (enum_t *) par_stat))
 		return (FALSE);
 	switch (ar->ar_stat) {
 
@@ -144,12 +147,16 @@ xdr_rejected_reply(xdrs, rr)
 	XDR *xdrs;
 	struct rejected_reply *rr;
 {
+	enum reject_stat *prj_stat;
+	enum auth_stat *prj_why;
 
 	assert(xdrs != NULL);
 	assert(rr != NULL);
 
+	prj_stat = &rr->rj_stat;
+
 	/* personalized union, rather than calling xdr_union */
-	if (! xdr_enum(xdrs, (enum_t *)&(rr->rj_stat)))
+	if (! xdr_enum(xdrs, (enum_t *) prj_stat))
 		return (FALSE);
 	switch (rr->rj_stat) {
 
@@ -159,7 +166,8 @@ xdr_rejected_reply(xdrs, rr)
 		return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high)));
 
 	case AUTH_ERROR:
-		return (xdr_enum(xdrs, (enum_t *)&(rr->rj_why)));
+		prj_why = &rr->rj_why;
+		return (xdr_enum(xdrs, (enum_t *) prj_why));
 	}
 	/* NOTREACHED */
 	assert(0);
@@ -179,14 +187,20 @@ xdr_replymsg(xdrs, rmsg)
 	XDR *xdrs;
 	struct rpc_msg *rmsg;
 {
+	enum msg_type *prm_direction;
+	enum reply_stat *prp_stat;
+
 	assert(xdrs != NULL);
 	assert(rmsg != NULL);
 
+	prm_direction = &rmsg->rm_direction;
+	prp_stat = &rmsg->rm_reply.rp_stat;
+
 	if (
 	    xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) && 
-	    xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) &&
+	    xdr_enum(xdrs, (enum_t *) prm_direction) &&
 	    (rmsg->rm_direction == REPLY) )
-		return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat),
+		return (xdr_union(xdrs, (enum_t *) prp_stat,
 		   (caddr_t)(void *)&(rmsg->rm_reply.ru), reply_dscrm,
 		   NULL_xdrproc_t));
 	return (FALSE);
@@ -203,16 +217,19 @@ xdr_callhdr(xdrs, cmsg)
 	XDR *xdrs;
 	struct rpc_msg *cmsg;
 {
+	enum msg_type *prm_direction;
 
 	assert(xdrs != NULL);
 	assert(cmsg != NULL);
 
+	prm_direction = &cmsg->rm_direction;
+
 	cmsg->rm_direction = CALL;
 	cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION;
 	if (
 	    (xdrs->x_op == XDR_ENCODE) &&
 	    xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) &&
-	    xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) &&
+	    xdr_enum(xdrs, (enum_t *) prm_direction) &&
 	    xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
 	    xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) )
 		return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers)));

Modified: stable/7/lib/libc/rpc/rpcb_prot.c
==============================================================================
--- stable/7/lib/libc/rpc/rpcb_prot.c	Mon Jun  8 19:57:35 2009	(r193744)
+++ stable/7/lib/libc/rpc/rpcb_prot.c	Mon Jun  8 19:59:26 2009	(r193745)
@@ -320,11 +320,13 @@ xdr_netbuf(xdrs, objp)
 	struct netbuf *objp;
 {
 	bool_t dummy;
+	void **pp;
 
 	if (!xdr_u_int32_t(xdrs, (u_int32_t *) &objp->maxlen)) {
 		return (FALSE);
 	}
-	dummy = xdr_bytes(xdrs, (char **)&(objp->buf),
+	pp = &objp->buf;
+	dummy = xdr_bytes(xdrs, (char **) pp,
 			(u_int *)&(objp->len), objp->maxlen);
 	return (dummy);
 }

Modified: stable/7/lib/libc/rpc/rpcb_st_xdr.c
==============================================================================
--- stable/7/lib/libc/rpc/rpcb_st_xdr.c	Mon Jun  8 19:57:35 2009	(r193744)
+++ stable/7/lib/libc/rpc/rpcb_st_xdr.c	Mon Jun  8 19:59:26 2009	(r193745)
@@ -52,6 +52,7 @@ xdr_rpcbs_addrlist(xdrs, objp)
 	XDR *xdrs;
 	rpcbs_addrlist *objp;
 {
+	struct rpcbs_addrlist **pnext;
 
 	    if (!xdr_u_int32_t(xdrs, &objp->prog)) {
 		return (FALSE);
@@ -69,7 +70,9 @@ xdr_rpcbs_addrlist(xdrs, objp)
 		return (FALSE);
 	    }
 
-	    if (!xdr_pointer(xdrs, (char **)&objp->next,
+	    pnext = &objp->next;
+
+	    if (!xdr_pointer(xdrs, (char **) pnext,
 			sizeof (rpcbs_addrlist),
 			(xdrproc_t)xdr_rpcbs_addrlist)) {
 		return (FALSE);
@@ -86,6 +89,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
 	rpcbs_rmtcalllist *objp;
 {
 	int32_t *buf;
+	struct rpcbs_rmtcalllist **pnext;
 
 	if (xdrs->x_op == XDR_ENCODE) {
 	buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
@@ -119,7 +123,8 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
 	if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
 		return (FALSE);
 	}
-	if (!xdr_pointer(xdrs, (char **)&objp->next,
+	pnext = &objp->next;
+	if (!xdr_pointer(xdrs, (char **) pnext,
 			sizeof (rpcbs_rmtcalllist),
 			(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
 		return (FALSE);
@@ -157,7 +162,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
 	if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
 		return (FALSE);
 	}
-	if (!xdr_pointer(xdrs, (char **)&objp->next,
+	if (!xdr_pointer(xdrs, (char **) pnext,
 			sizeof (rpcbs_rmtcalllist),
 			(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
 		return (FALSE);
@@ -185,7 +190,7 @@ xdr_rpcbs_rmtcalllist(xdrs, objp)
 	if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
 		return (FALSE);
 	}
-	if (!xdr_pointer(xdrs, (char **)&objp->next,
+	if (!xdr_pointer(xdrs, (char **) pnext,
 			sizeof (rpcbs_rmtcalllist),
 			(xdrproc_t)xdr_rpcbs_rmtcalllist)) {
 		return (FALSE);
From des at FreeBSD.org  Mon Jun  8 20:04:37 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 20:04:43 2009
Subject: svn commit: r193747 - in stable/7/lib/libc: . include
Message-ID: <200906082004.n58K4avY041738@svn.freebsd.org>

Author: des
Date: Mon Jun  8 20:04:36 2009
New Revision: 193747
URL: http://svn.freebsd.org/changeset/base/193747

Log:
  merge r177605,177607,177855: add missing namespace wrappers for libthr

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/include/namespace.h
  stable/7/lib/libc/include/un-namespace.h

Modified: stable/7/lib/libc/include/namespace.h
==============================================================================
--- stable/7/lib/libc/include/namespace.h	Mon Jun  8 20:02:15 2009	(r193746)
+++ stable/7/lib/libc/include/namespace.h	Mon Jun  8 20:04:36 2009	(r193747)
@@ -84,6 +84,7 @@
 #define		pthread_atfork			_pthread_atfork
 #define		pthread_attr_destroy		_pthread_attr_destroy
 #define		pthread_attr_get_np		_pthread_attr_get_np
+#define		pthread_attr_getaffinity_np	_pthread_attr_getaffinity_np
 #define		pthread_attr_getdetachstate	_pthread_attr_getdetachstate
 #define		pthread_attr_getguardsize	_pthread_attr_getguardsize
 #define		pthread_attr_getinheritsched	_pthread_attr_getinheritsched
@@ -94,6 +95,7 @@
 #define		pthread_attr_getstackaddr	_pthread_attr_getstackaddr
 #define		pthread_attr_getstacksize	_pthread_attr_getstacksize
 #define		pthread_attr_init		_pthread_attr_init
+#define		pthread_attr_setaffinity_np	_pthread_attr_setaffinity_np
 #define		pthread_attr_setcreatesuspend_np _pthread_attr_setcreatesuspend_np
 #define		pthread_attr_setdetachstate	_pthread_attr_setdetachstate
 #define		pthread_attr_setguardsize	_pthread_attr_setguardsize
@@ -130,7 +132,9 @@
 #define		pthread_detach			_pthread_detach
 #define		pthread_equal			_pthread_equal
 #define		pthread_exit			_pthread_exit
+#define		pthread_getaffinity_np		_pthread_getaffinity_np
 #define		pthread_getconcurrency		_pthread_getconcurrency
+#define		pthread_getcpuclockid		_pthread_getcpuclockid
 #define		pthread_getprio			_pthread_getprio
 #define		pthread_getschedparam		_pthread_getschedparam
 #define		pthread_getspecific		_pthread_getspecific
@@ -178,6 +182,7 @@
 #define		pthread_rwlockattr_setpshared	_pthread_rwlockattr_setpshared
 #define		pthread_self			_pthread_self
 #define		pthread_set_name_np		_pthread_set_name_np
+#define		pthread_setaffinity_np		_pthread_setaffinity_np
 #define		pthread_setcancelstate		_pthread_setcancelstate
 #define		pthread_setcanceltype		_pthread_setcanceltype
 #define		pthread_setconcurrency		_pthread_setconcurrency

Modified: stable/7/lib/libc/include/un-namespace.h
==============================================================================
--- stable/7/lib/libc/include/un-namespace.h	Mon Jun  8 20:02:15 2009	(r193746)
+++ stable/7/lib/libc/include/un-namespace.h	Mon Jun  8 20:04:36 2009	(r193747)
@@ -65,6 +65,7 @@
 #undef		pthread_atfork
 #undef		pthread_attr_destroy
 #undef		pthread_attr_get_np
+#undef		pthread_attr_getaffinity_np
 #undef		pthread_attr_getdetachstate
 #undef		pthread_attr_getguardsize
 #undef		pthread_attr_getinheritsched
@@ -75,6 +76,7 @@
 #undef		pthread_attr_getstackaddr
 #undef		pthread_attr_getstacksize
 #undef		pthread_attr_init
+#undef		pthread_attr_setaffinity_np
 #undef		pthread_attr_setcreatesuspend_np
 #undef		pthread_attr_setdetachstate
 #undef		pthread_attr_setguardsize
@@ -111,7 +113,9 @@
 #undef		pthread_detach
 #undef		pthread_equal
 #undef		pthread_exit
+#undef		pthread_getaffinity_np
 #undef		pthread_getconcurrency
+#undef		pthread_getcpuclockid
 #undef		pthread_getprio
 #undef		pthread_getschedparam
 #undef		pthread_getspecific
@@ -159,6 +163,7 @@
 #undef		pthread_rwlockattr_setpshared
 #undef		pthread_self
 #undef		pthread_set_name_np
+#undef		pthread_setaffinity_np
 #undef		pthread_setcancelstate
 #undef		pthread_setcanceltype
 #undef		pthread_setconcurrency
From des at FreeBSD.org  Mon Jun  8 20:07:14 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 20:07:30 2009
Subject: svn commit: r193749 - stable/7/lib/libthr
Message-ID: <200906082007.n58K7D3S041905@svn.freebsd.org>

Author: des
Date: Mon Jun  8 20:07:12 2009
New Revision: 193749
URL: http://svn.freebsd.org/changeset/base/193749

Log:
  record already-merged r177605

Modified:
  stable/7/lib/libthr/   (props changed)
From des at FreeBSD.org  Mon Jun  8 20:08:21 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Mon Jun  8 20:08:38 2009
Subject: svn commit: r193751 - in stable/7/lib/libc: . gdtoa
Message-ID: <200906082008.n58K8KhD042012@svn.freebsd.org>

Author: des
Date: Mon Jun  8 20:08:20 2009
New Revision: 193751
URL: http://svn.freebsd.org/changeset/base/193751

Log:
  merge r173793: silence aliasing warning.

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/gdtoa/_ldtoa.c

Modified: stable/7/lib/libc/gdtoa/_ldtoa.c
==============================================================================
--- stable/7/lib/libc/gdtoa/_ldtoa.c	Mon Jun  8 20:07:16 2009	(r193750)
+++ stable/7/lib/libc/gdtoa/_ldtoa.c	Mon Jun  8 20:08:20 2009	(r193751)
@@ -61,6 +61,7 @@ __ldtoa(long double *ld, int mode, int n
 	char *ret;
 	union IEEEl2bits u;
 	uint32_t bits[(LDBL_MANT_DIG + 31) / 32];
+	void *vbits = bits;
 
 	u.e = *ld;
 	*sign = u.bits.sign;
@@ -91,7 +92,7 @@ __ldtoa(long double *ld, int mode, int n
 		abort();
 	}
 
-	ret = gdtoa(&fpi, be, (ULong *)bits, &kind, mode, ndigits, decpt, rve);
+	ret = gdtoa(&fpi, be, vbits, &kind, mode, ndigits, decpt, rve);
 	if (*decpt == -32768)
 		*decpt = INT_MAX;
 	return ret;
From gnn at FreeBSD.org  Mon Jun  8 21:01:16 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Mon Jun  8 21:01:36 2009
Subject: svn commit: r193754 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/cxgb/common
Message-ID: <200906082101.n58L1EHi043331@svn.freebsd.org>

Author: gnn
Date: Mon Jun  8 21:01:14 2009
New Revision: 193754
URL: http://svn.freebsd.org/changeset/base/193754

Log:
  MFC of 190206 190330 192537 192 540 192584 192593 192933
  
  Bring the 7.x version of the cxgb driver up to date with respect to
  HEAD as of 8 June 2009
  
  192933
  
  Rework interrupt bringup and teardown.
  
  Calculate the exact number of vectors we'll use before calling
  pci_alloc_msix.  Don't grab nine all the time.
  
  Call cxgb_setup_interrupts once per T3, not once per port.  Ditto
  for cxgb_teardown_interrupts.
  
  Don't leak resources when interrupt setup fails in the middle.
  
  192593
  
  Partial reversion of previous commit.  The CXGB_SHUTDOWN flag does NOT
  need to be inverted when doing an ifconfig down of an interface.
  
  192584
  
  Fix a possible panic cxgb_controller_attach() routine that would occur
  only if prepping the adapter failed.
  
  Slight adjustment to comments.
  
  Fix a bug whereby downing the interface didn't preven it from
  processing packets.
  
  192540
  
  Integrate three changes from Chelsio.
  
  1) Add a sysctl that will say what type of PHYs exist on the card.
  2) Fix a bug that occurs when an AEL 2005 PHY resets without a transciever
  in the card.
  3) Unify the PHY link detection code.
  
  192537
  
  Modified the attach and detach routines to handle bringing ports up
  and down more cleanly.  This addresses a problem where if we have the
  link flap during boot the driver would lock up the system.
  
  190330
  
  Minor updates to the Chelsio driver, including removing an LOR.
  
  190206
  
  Fix a bug in the recent update to the Chelsio driver.
  The tick routine was not being restarted in the init_locked routine
  which could resulted in loss of carrier when updating the MTU.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/cxgb/common/cxgb_ael1002.c
  stable/7/sys/dev/cxgb/common/cxgb_common.h
  stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c
  stable/7/sys/dev/cxgb/cxgb_adapter.h
  stable/7/sys/dev/cxgb/cxgb_main.c
  stable/7/sys/dev/cxgb/cxgb_sge.c

Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_ael1002.c	Mon Jun  8 20:50:38 2009	(r193753)
+++ stable/7/sys/dev/cxgb/common/cxgb_ael1002.c	Mon Jun  8 21:01:14 2009	(r193754)
@@ -1160,6 +1160,7 @@ static int get_module_type(struct cphy *
 		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 131);
 		if (v < 0)
 			return v;
+		v &= 0xf0;
 		if (v == 0x10)
 			return phy_modtype_lrm;
 		if (v == 0x40)
@@ -1249,7 +1250,9 @@ static int ael2005_reset(struct cphy *ph
 		return err;
 	phy->modtype = (u8)err;
 
-	if (err == phy_modtype_twinax || err == phy_modtype_twinax_long)
+	if (err == phy_modtype_none || err == phy_modtype_unknown)
+		err = 0;
+	else if (err == phy_modtype_twinax || err == phy_modtype_twinax_long)
 		err = ael2005_setup_twinax_edc(phy, err);
 	else
 		err = ael2005_setup_sr_edc(phy);

Modified: stable/7/sys/dev/cxgb/common/cxgb_common.h
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_common.h	Mon Jun  8 20:50:38 2009	(r193753)
+++ stable/7/sys/dev/cxgb/common/cxgb_common.h	Mon Jun  8 21:01:14 2009	(r193754)
@@ -709,7 +709,6 @@ int t3_slow_intr_handler(adapter_t *adap
 int t3_phy_intr_handler(adapter_t *adapter);
 
 void t3_link_changed(adapter_t *adapter, int port_id);
-void t3_link_fault(adapter_t *adapter, int port_id);
 int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc);
 const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
 int t3_seeprom_read(adapter_t *adapter, u32 addr, u32 *data);

Modified: stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c
==============================================================================
--- stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c	Mon Jun  8 20:50:38 2009	(r193753)
+++ stable/7/sys/dev/cxgb/common/cxgb_t3_hw.c	Mon Jun  8 21:01:14 2009	(r193754)
@@ -1288,6 +1288,49 @@ static void t3_open_rx_traffic(struct cm
 	t3_write_reg(mac->adapter, A_XGM_RX_HASH_LOW, rx_hash_low);
 }
 
+static int t3_detect_link_fault(adapter_t *adapter, int port_id)
+{
+	struct port_info *pi = adap2pinfo(adapter, port_id);
+	struct cmac *mac = &pi->mac;
+	uint32_t rx_cfg, rx_hash_high, rx_hash_low;
+	int link_fault;
+
+	/* stop rx */
+	t3_gate_rx_traffic(mac, &rx_cfg, &rx_hash_high, &rx_hash_low);
+	t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0);
+
+	/* clear status and make sure intr is enabled */
+	(void) t3_read_reg(adapter, A_XGM_INT_STATUS + mac->offset);
+	t3_xgm_intr_enable(adapter, port_id);
+
+	/* restart rx */
+	t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, F_RXEN);
+	t3_open_rx_traffic(mac, rx_cfg, rx_hash_high, rx_hash_low);
+
+	link_fault = t3_read_reg(adapter, A_XGM_INT_STATUS + mac->offset);
+	return (link_fault & F_LINKFAULTCHANGE ? 1 : 0);
+}
+
+static void t3_clear_faults(adapter_t *adapter, int port_id)
+{
+	struct port_info *pi = adap2pinfo(adapter, port_id);
+	struct cmac *mac = &pi->mac;
+
+	t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset,
+			 F_ENDROPPKT, 0);
+	t3_mac_enable(mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX);
+	t3_set_reg_field(adapter, A_XGM_STAT_CTRL + mac->offset, F_CLRSTATS, 1);
+
+	if (adapter->params.nports <= 2) {
+		t3_xgm_intr_disable(adapter, pi->port_id);
+		t3_read_reg(adapter, A_XGM_INT_STATUS + mac->offset);
+		t3_write_reg(adapter, A_XGM_INT_CAUSE + mac->offset, F_XGM_INT);
+		t3_set_reg_field(adapter, A_XGM_INT_ENABLE + mac->offset,
+				 F_XGM_INT, F_XGM_INT);
+		t3_xgm_intr_enable(adapter, pi->port_id);
+	}
+}
+
 /**
  *	t3_link_changed - handle interface link changes
  *	@adapter: the adapter
@@ -1299,34 +1342,47 @@ static void t3_open_rx_traffic(struct cm
  */
 void t3_link_changed(adapter_t *adapter, int port_id)
 {
-	int link_ok, speed, duplex, fc;
+	int link_ok, speed, duplex, fc, link_fault, link_change;
 	struct port_info *pi = adap2pinfo(adapter, port_id);
 	struct cphy *phy = &pi->phy;
 	struct cmac *mac = &pi->mac;
 	struct link_config *lc = &pi->link_config;
-	int force_link_down = 0;
+
+	link_ok = lc->link_ok;
+	speed = lc->speed;
+	duplex = lc->duplex;
+	fc = lc->fc;
+	link_fault = 0;
 
 	phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc);
 
-	if (!lc->link_ok && link_ok && adapter->params.nports <= 2) {
-		u32 rx_cfg, rx_hash_high, rx_hash_low;
-		u32 status;
+	/*
+	 * Check for link faults if any of these is true:
+	 * a) A link fault is suspected, and PHY says link ok
+	 * b) PHY link transitioned from down -> up
+	 */
+	if (adapter->params.nports <= 2 &&
+	    ((pi->link_fault && link_ok) || (!lc->link_ok && link_ok))) {
+
+		link_fault = t3_detect_link_fault(adapter, port_id);
+		if (link_fault) {
+			if (pi->link_fault != LF_YES) {
+				mac->stats.link_faults++;
+				pi->link_fault = LF_YES;
+			}
 
-		t3_xgm_intr_enable(adapter, port_id);
-		t3_gate_rx_traffic(mac, &rx_cfg, &rx_hash_high, &rx_hash_low);
-		t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0);
-		t3_mac_enable(mac, MAC_DIRECTION_RX);
+			/* Don't report link up or any other change */
+			link_ok = 0;
+			speed = lc->speed;
+			duplex = lc->duplex;
+			fc = lc->fc;
+		} else {
+			/* clear faults here if this was a false alarm. */
+			if (pi->link_fault == LF_MAYBE &&
+			    link_ok && lc->link_ok)
+				t3_clear_faults(adapter, port_id);
 
-		status = t3_read_reg(adapter, A_XGM_INT_STATUS + mac->offset);
-		if (status & F_LINKFAULTCHANGE) {
-			mac->stats.link_faults++;
-			force_link_down = 1;
-		}
-		t3_open_rx_traffic(mac, rx_cfg, rx_hash_high, rx_hash_low);
-
-		if (force_link_down) {
-			t3_os_link_fault_handler(adapter, port_id);
-			return;
+			pi->link_fault = LF_NO;
 		}
 	}
 
@@ -1339,75 +1395,65 @@ void t3_link_changed(adapter_t *adapter,
 	    duplex == lc->duplex && fc == lc->fc)
 		return;                            /* nothing changed */
 
-	if (link_ok != lc->link_ok && adapter->params.rev > 0 &&
-	    uses_xaui(adapter)) {
-		if (link_ok)
-			t3b_pcs_reset(mac);
-		t3_write_reg(adapter, A_XGM_XAUI_ACT_CTRL + mac->offset,
-			     link_ok ? F_TXACTENABLE | F_RXEN : 0);
-	}
+	link_change = link_ok != lc->link_ok;
 	lc->link_ok = (unsigned char)link_ok;
 	lc->speed = speed < 0 ? SPEED_INVALID : speed;
 	lc->duplex = duplex < 0 ? DUPLEX_INVALID : duplex;
 
-	if (link_ok && speed >= 0 && lc->autoneg == AUTONEG_ENABLE) {
-		/* Set MAC speed, duplex, and flow control to match PHY. */
-		t3_mac_set_speed_duplex_fc(mac, speed, duplex, fc);
-		lc->fc = (unsigned char)fc;
-	}
+	if (link_ok) {
 
-	t3_os_link_changed(adapter, port_id, link_ok, speed, duplex, fc);
-}
-
-void t3_link_fault(adapter_t *adapter, int port_id)
-{
-	struct port_info *pi = adap2pinfo(adapter, port_id);
-	struct cmac *mac = &pi->mac;
-	struct cphy *phy = &pi->phy;
-	struct link_config *lc = &pi->link_config;
-	int link_ok, speed, duplex, fc, link_fault;
-	u32 rx_cfg, rx_hash_high, rx_hash_low;
+		/* down -> up, or up -> up with changed settings */
 
-	if (!pi->link_fault)
-		return; /* nothing to do */
+		if (link_change && adapter->params.rev > 0 &&
+		    uses_xaui(adapter)) {
+			t3b_pcs_reset(mac);
+			t3_write_reg(adapter, A_XGM_XAUI_ACT_CTRL + mac->offset,
+				     F_TXACTENABLE | F_RXEN);
+		}
 
-	t3_gate_rx_traffic(mac, &rx_cfg, &rx_hash_high, &rx_hash_low);
+		if (speed >= 0 && lc->autoneg == AUTONEG_ENABLE) {
+			/* Set MAC settings to match PHY. */
+			t3_mac_set_speed_duplex_fc(mac, speed, duplex, fc);
+			lc->fc = (unsigned char)fc;
+		}
 
-	if (adapter->params.rev > 0 && uses_xaui(adapter))
-		t3_write_reg(adapter, A_XGM_XAUI_ACT_CTRL + mac->offset, 0);
+		t3_clear_faults(adapter, port_id);
 
-	t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0);
-	t3_mac_enable(mac, MAC_DIRECTION_RX);
+	} else {
 
-	t3_open_rx_traffic(mac, rx_cfg, rx_hash_high, rx_hash_low);
+		/* up -> down */
 
-	link_fault = t3_read_reg(adapter,
-				 A_XGM_INT_STATUS + mac->offset);
-	link_fault &= F_LINKFAULTCHANGE;
+		if (adapter->params.rev > 0 && uses_xaui(adapter)) {
+			t3_write_reg(adapter,
+				     A_XGM_XAUI_ACT_CTRL + mac->offset, 0);
+		}
 
-	phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc);
+		t3_xgm_intr_disable(adapter, pi->port_id);
+		if (adapter->params.nports <= 2) {
+			t3_set_reg_field(adapter,
+					 A_XGM_INT_ENABLE + mac->offset,
+					 F_XGM_INT, 0);
+		}
 
-	if (link_fault) {
-		lc->link_ok = 0;
-		lc->speed = SPEED_INVALID;
-		lc->duplex = DUPLEX_INVALID;
-
-		t3_os_link_fault(adapter, port_id, 0);
-
-		/* Account link faults only when the phy reports a link up */
-		if (link_ok)
-			mac->stats.link_faults++;
-	} else {
-		if (link_ok)
-			t3_write_reg(adapter, A_XGM_XAUI_ACT_CTRL + mac->offset,
-			     	     F_TXACTENABLE | F_RXEN);
+		if (!link_fault) {
+			if (is_10G(adapter))
+				pi->phy.ops->power_down(&pi->phy, 1);
+			t3_mac_disable(mac, MAC_DIRECTION_RX);
+			t3_link_start(phy, mac, lc);
+		}
 
-		pi->link_fault = 0;
-		lc->link_ok = (unsigned char)link_ok;
-		lc->speed = speed < 0 ? SPEED_INVALID : speed;
-		lc->duplex = duplex < 0 ? DUPLEX_INVALID : duplex;
-		t3_os_link_fault(adapter, port_id, link_ok);
+		/*
+		 * Make sure Tx FIFO continues to drain, even as rxen is left
+		 * high to help detect and indicate remote faults.
+		 */
+		t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset, 0,
+				 F_ENDROPPKT);
+		t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0);
+		t3_write_reg(adapter, A_XGM_TX_CTRL + mac->offset, F_TXEN);
+		t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, F_RXEN);
 	}
+
+	t3_os_link_changed(adapter, port_id, link_ok, speed, duplex, fc);
 }
 
 /**
@@ -1906,10 +1952,12 @@ static void mc7_intr_handler(struct mc7 
 static int mac_intr_handler(adapter_t *adap, unsigned int idx)
 {
 	u32 cause;
+	struct port_info *pi;
 	struct cmac *mac;
 
 	idx = idx == 0 ? 0 : adapter_info(adap)->nports0; /* MAC idx -> port */
-	mac = &adap2pinfo(adap, idx)->mac;
+	pi = adap2pinfo(adap, idx);
+	mac = &pi->mac;
 
 	/*
 	 * We mask out interrupt causes for which we're not taking interrupts.
@@ -1942,9 +1990,9 @@ static int mac_intr_handler(adapter_t *a
 		t3_set_reg_field(adap,
 				 A_XGM_INT_ENABLE + mac->offset,
 				 F_XGM_INT, 0);
-		mac->stats.link_faults++;
 
-		t3_os_link_fault_handler(adap, idx);
+		/* link fault suspected */
+		pi->link_fault = LF_MAYBE;
 	}
 
 	t3_write_reg(adap, A_XGM_INT_CAUSE + mac->offset, cause);

Modified: stable/7/sys/dev/cxgb/cxgb_adapter.h
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_adapter.h	Mon Jun  8 20:50:38 2009	(r193753)
+++ stable/7/sys/dev/cxgb/cxgb_adapter.h	Mon Jun  8 21:01:14 2009	(r193754)
@@ -107,6 +107,12 @@ extern int cxgb_debug;
 #define SX_DESTROY sx_destroy
 #endif
 
+enum {
+	LF_NO = 0,
+	LF_MAYBE,
+	LF_YES
+};
+
 struct port_info {
 	struct adapter	*adapter;
 	struct ifnet	*ifp;
@@ -130,7 +136,6 @@ struct port_info {
 
 	uint8_t		hw_addr[ETHER_ADDR_LEN];
 	struct task	timer_reclaim_task;
-	struct task	link_fault_task;
 	struct cdev     *port_cdev;
 
 #define PORT_LOCK_NAME_LEN 32
@@ -394,6 +399,7 @@ struct adapter {
 	device_t		portdev[MAX_NPORTS];
 	struct t3cdev           tdev;
 	char                    fw_version[64];
+	char                    port_types[MAX_NPORTS + 1];
 	uint32_t                open_device_map;
 	uint32_t                registered_device_map;
 #ifdef USE_SX
@@ -436,6 +442,7 @@ struct t3_rx_mode {
 #define ADAPTER_LOCK_INIT(adap, name)      SX_INIT(&(adap)->lock, name)
 #define ADAPTER_LOCK_DEINIT(adap)          SX_DESTROY(&(adap)->lock)
 #define ADAPTER_LOCK_ASSERT_NOTOWNED(adap) sx_assert(&(adap)->lock, SA_UNLOCKED)
+#define ADAPTER_LOCK_ASSERT_OWNED(adap) sx_assert(&(adap)->lock, SA_LOCKED)
 #else
 #define PORT_LOCK(port)		     mtx_lock(&(port)->lock);
 #define PORT_UNLOCK(port)	     mtx_unlock(&(port)->lock);
@@ -447,7 +454,8 @@ struct t3_rx_mode {
 #define ADAPTER_UNLOCK(adap)	mtx_unlock(&(adap)->lock);
 #define ADAPTER_LOCK_INIT(adap, name) mtx_init(&(adap)->lock, name, 0, MTX_DEF)
 #define ADAPTER_LOCK_DEINIT(adap) mtx_destroy(&(adap)->lock)
-#define ADAPTER_LOCK_ASSERT_NOTOWNED(adap) mtx_assert(&(adap)->lock, MO_NOTOWNED)
+#define ADAPTER_LOCK_ASSERT_NOTOWNED(adap) mtx_assert(&(adap)->lock, MA_NOTOWNED)
+#define ADAPTER_LOCK_ASSERT_OWNED(adap) mtx_assert(&(adap)->lock, MA_OWNED)
 #endif
 
 
@@ -531,8 +539,6 @@ int t3_os_pci_restore_state(struct adapt
 void t3_os_link_changed(adapter_t *adapter, int port_id, int link_status,
 			int speed, int duplex, int fc);
 void t3_os_phymod_changed(struct adapter *adap, int port_id);
-void t3_os_link_fault(adapter_t *adapter, int port_id, int state);
-void t3_os_link_fault_handler(adapter_t *adapter, int port_id);
 void t3_sge_err_intr_handler(adapter_t *adapter);
 int t3_offload_tx(struct t3cdev *, struct mbuf *);
 void t3_os_ext_intr_handler(adapter_t *adapter);

Modified: stable/7/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_main.c	Mon Jun  8 20:50:38 2009	(r193753)
+++ stable/7/sys/dev/cxgb/cxgb_main.c	Mon Jun  8 21:01:14 2009	(r193754)
@@ -76,22 +76,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef CONFIG_DEFINED
 #include 
-#else
-#include 
-#endif
 
 #ifdef PRIV_SUPPORTED
 #include 
 #endif
 
-#ifdef IFNET_MULTIQUEUE
-#include 
-#endif
-
-static int cxgb_setup_msix(adapter_t *, int);
-static void cxgb_teardown_msix(adapter_t *);
+static int cxgb_setup_interrupts(adapter_t *);
+static void cxgb_teardown_interrupts(adapter_t *);
 static void cxgb_init(void *);
 static void cxgb_init_locked(struct port_info *);
 static void cxgb_stop_locked(struct port_info *);
@@ -123,7 +115,7 @@ static int offload_open(struct port_info
 static void touch_bars(device_t dev);
 static int offload_close(struct t3cdev *tdev);
 static void cxgb_link_start(struct port_info *p);
-static void cxgb_link_fault(void *arg, int ncount);
+int t3_detect_link_fault(adapter_t *adapter, int port_id);
 
 static device_method_t cxgb_controller_methods[] = {
 	DEVMETHOD(device_probe,		cxgb_controller_probe),
@@ -183,8 +175,6 @@ static struct cdevsw cxgb_cdevsw = {
 static devclass_t	cxgb_port_devclass;
 DRIVER_MODULE(cxgb, cxgbc, cxgb_port_driver, cxgb_port_devclass, 0, 0);
 
-#define SGE_MSIX_COUNT (SGE_QSETS + 1)
-
 /*
  * The driver uses the best interrupt scheme available on a platform in the
  * order MSI-X, MSI, legacy pin interrupts.  This parameter determines which
@@ -212,17 +202,17 @@ SYSCTL_UINT(_hw_cxgb, OID_AUTO, ofld_dis
 
 /*
  * The driver uses an auto-queue algorithm by default.
- * To disable it and force a single queue-set per port, use singleq = 1.
+ * To disable it and force a single queue-set per port, use multiq = 0
  */
-static int singleq = 0;
-TUNABLE_INT("hw.cxgb.singleq", &singleq);
-SYSCTL_UINT(_hw_cxgb, OID_AUTO, singleq, CTLFLAG_RDTUN, &singleq, 0,
-    "use a single queue-set per port");
-
+static int multiq = 1;
+TUNABLE_INT("hw.cxgb.multiq", &multiq);
+SYSCTL_UINT(_hw_cxgb, OID_AUTO, multiq, CTLFLAG_RDTUN, &multiq, 0,
+    "use min(ncpus/ports, 8) queue-sets per port");
 
 /*
- * The driver uses an auto-queue algorithm by default.
- * To disable it and force a single queue-set per port, use singleq = 1.
+ * By default the driver will not update the firmware unless
+ * it was compiled against a newer version
+ * 
  */
 static int force_fw_update = 0;
 TUNABLE_INT("hw.cxgb.force_fw_update", &force_fw_update);
@@ -234,15 +224,6 @@ TUNABLE_INT("hw.cxgb.use_16k_clusters", 
 SYSCTL_UINT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN,
     &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue ");
 
-/*
- * Tune the size of the output queue.
- */
-int cxgb_snd_queue_len = IFQ_MAXLEN;
-TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len);
-SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN,
-    &cxgb_snd_queue_len, 0, "send queue size ");
-
-
 enum {
 	MAX_TXQ_ENTRIES      = 16384,
 	MAX_CTRL_TXQ_ENTRIES = 1024,
@@ -307,31 +288,6 @@ struct cxgb_ident {
 static int set_eeprom(struct port_info *pi, const uint8_t *data, int len, int offset);
 
 
-void
-cxgb_log_tcb(struct adapter *sc, unsigned int tid)
-{
-	char buf[TCB_SIZE];
-	uint64_t *tcb = (uint64_t *)buf;
-	int i, error;
-	struct mc7 *mem = &sc->cm;
-	
-	error = t3_mc7_bd_read(mem, tid*TCB_SIZE/8, TCB_SIZE/8, tcb);
-	if (error)
-		printf("cxgb_tcb_log failed\n");
-	
-	CTR1(KTR_CXGB, "TCB tid=%u", tid);
-	for (i = 0; i < TCB_SIZE / 32; i++) {
-		CTR5(KTR_CXGB, "%1d: %08x %08x %08x %08x",
-		    i, (uint32_t)tcb[1], (uint32_t)(tcb[1] >> 32),
-		    (uint32_t)tcb[0], (uint32_t)(tcb[0] >> 32));
-		tcb += 2;
-		CTR4(KTR_CXGB, "   %08x %08x %08x %08x",
-		    (uint32_t)tcb[1], (uint32_t)(tcb[1] >> 32),
-		    (uint32_t)tcb[0], (uint32_t)(tcb[0] >> 32));
-		tcb += 2;
-	}
-}
-
 static __inline char
 t3rev2char(struct adapter *adapter)
 {
@@ -371,7 +327,7 @@ cxgb_get_adapter_info(device_t dev)
 {
 	struct cxgb_ident *id;
 	const struct adapter_info *ai;
-      
+
 	id = cxgb_get_ident(dev);
 	if (id == NULL)
 		return (NULL);
@@ -400,15 +356,15 @@ cxgb_controller_probe(device_t dev)
 		ports = "ports";
 
 	snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s",
-		 ai->desc, is_offload(sc) ? "R" : "",
-		 sc->params.rev, nports, ports);
+	    ai->desc, is_offload(sc) ? "R" : "",
+	    sc->params.rev, nports, ports);
 	device_set_desc_copy(dev, buf);
 	return (BUS_PROBE_DEFAULT);
 }
 
 #define FW_FNAME "cxgb_t3fw"
-#define TPEEPROM_NAME "t3%c_tp_eeprom"
-#define TPSRAM_NAME "t3%c_protocol_sram"
+#define TPEEPROM_NAME "cxgb_t3%c_tp_eeprom"
+#define TPSRAM_NAME "cxgb_t3%c_protocol_sram"
 
 static int
 upgrade_fw(adapter_t *sc)
@@ -434,6 +390,32 @@ upgrade_fw(adapter_t *sc)
 	return (status);	
 }
 
+/*
+ * The cxgb_controller_attach function is responsible for the initial
+ * bringup of the device.  Its responsibilities include:
+ *
+ *  1. Determine if the device supports MSI or MSI-X.
+ *  2. Allocate bus resources so that we can access the Base Address Register
+ *  3. Create and initialize mutexes for the controller and its control
+ *     logic such as SGE and MDIO.
+ *  4. Call hardware specific setup routine for the adapter as a whole.
+ *  5. Allocate the BAR for doing MSI-X.
+ *  6. Setup the line interrupt iff MSI-X is not supported.
+ *  7. Create the driver's taskq.
+ *  8. Start one task queue service thread.
+ *  9. Check if the firmware and SRAM are up-to-date.  They will be
+ *     auto-updated later (before FULL_INIT_DONE), if required.
+ * 10. Create a child device for each MAC (port)
+ * 11. Initialize T3 private state.
+ * 12. Trigger the LED
+ * 13. Setup offload iff supported.
+ * 14. Reset/restart the tick callout.
+ * 15. Attach sysctls
+ *
+ * NOTE: Any modification or deviation from this list MUST be reflected in
+ * the above comment.  Failure to do so will result in problems on various
+ * error conditions including link flapping.
+ */
 static int
 cxgb_controller_attach(device_t dev)
 {
@@ -533,46 +515,52 @@ cxgb_controller_attach(device_t dev)
 	    (sc->msix_regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
 	    &sc->msix_regs_rid, RF_ACTIVE)) != NULL) {
 
-		msi_needed = sc->msi_count = SGE_MSIX_COUNT;
-
-		if (((error = pci_alloc_msix(dev, &sc->msi_count)) != 0) ||
-		    (sc->msi_count != msi_needed)) {
-			device_printf(dev, "msix allocation failed - msi_count = %d"
-			    " msi_needed=%d will try msi err=%d\n", sc->msi_count,
-			    msi_needed, error);
+		if (multiq)
+			port_qsets = min(SGE_QSETS/sc->params.nports, mp_ncpus);
+		msi_needed = sc->msi_count = sc->params.nports * port_qsets + 1;
+
+		if (pci_msix_count(dev) == 0 ||
+		    (error = pci_alloc_msix(dev, &sc->msi_count)) != 0 ||
+		    sc->msi_count != msi_needed) {
+			device_printf(dev, "alloc msix failed - "
+				      "msi_count=%d, msi_needed=%d, err=%d; "
+				      "will try MSI\n", sc->msi_count,
+				      msi_needed, error);
 			sc->msi_count = 0;
+			port_qsets = 1;
 			pci_release_msi(dev);
 			bus_release_resource(dev, SYS_RES_MEMORY,
 			    sc->msix_regs_rid, sc->msix_regs_res);
 			sc->msix_regs_res = NULL;
 		} else {
 			sc->flags |= USING_MSIX;
-			sc->cxgb_intr = t3_intr_msix;
+			sc->cxgb_intr = cxgb_async_intr;
+			device_printf(dev,
+				      "using MSI-X interrupts (%u vectors)\n",
+				      sc->msi_count);
 		}
 	}
 
 	if ((msi_allowed >= 1) && (sc->msi_count == 0)) {
 		sc->msi_count = 1;
-		if (pci_alloc_msi(dev, &sc->msi_count)) {
-			device_printf(dev, "alloc msi failed - will try INTx\n");
+		if ((error = pci_alloc_msi(dev, &sc->msi_count)) != 0) {
+			device_printf(dev, "alloc msi failed - "
+				      "err=%d; will try INTx\n", error);
 			sc->msi_count = 0;
+			port_qsets = 1;
 			pci_release_msi(dev);
 		} else {
 			sc->flags |= USING_MSI;
-			sc->irq_rid = 1;
 			sc->cxgb_intr = t3_intr_msi;
+			device_printf(dev, "using MSI interrupts\n");
 		}
 	}
 #endif
 	if (sc->msi_count == 0) {
 		device_printf(dev, "using line interrupts\n");
-		sc->irq_rid = 0;
 		sc->cxgb_intr = t3b_intr;
 	}
 
-	if ((sc->flags & USING_MSIX) && !singleq)
-		port_qsets = min((SGE_QSETS/(sc)->params.nports), mp_ncpus);
-	
 	/* Create a private taskqueue thread for handling driver events */
 #ifdef TASKQUEUE_CURRENT	
 	sc->tq = taskqueue_create("cxgb_taskq", M_NOWAIT,
@@ -667,6 +655,10 @@ cxgb_controller_attach(device_t dev)
 		 sc->params.vpd.ec, sc->params.vpd.sn);
 	device_set_desc_copy(dev, buf);
 
+	snprintf(&sc->port_types[0], sizeof(sc->port_types), "%x%x%x%x",
+		 sc->params.vpd.port_type[0], sc->params.vpd.port_type[1],
+		 sc->params.vpd.port_type[2], sc->params.vpd.port_type[3]);
+
 	device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]);
 	callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
 	t3_add_attach_sysctls(sc);
@@ -677,6 +669,11 @@ out:
 	return (error);
 }
 
+/*
+ * The cxgb_controller_detach routine is called with the device is
+ * unloaded from the system.
+ */
+
 static int
 cxgb_controller_detach(device_t dev)
 {
@@ -689,6 +686,24 @@ cxgb_controller_detach(device_t dev)
 	return (0);
 }
 
+/*
+ * The cxgb_free() is called by the cxgb_controller_detach() routine
+ * to tear down the structures that were built up in
+ * cxgb_controller_attach(), and should be the final piece of work
+ * done when fully unloading the driver.
+ * 
+ *
+ *  1. Shutting down the threads started by the cxgb_controller_attach()
+ *     routine.
+ *  2. Stopping the lower level device and all callouts (cxgb_down_locked()).
+ *  3. Detaching all of the port devices created during the
+ *     cxgb_controller_attach() routine.
+ *  4. Removing the device children created via cxgb_controller_attach().
+ *  5. Releasing PCI resources associated with the device.
+ *  6. Turning off the offload support, iff it was turned on.
+ *  7. Destroying the mutexes created in cxgb_controller_attach().
+ *
+ */
 static void
 cxgb_free(struct adapter *sc)
 {
@@ -697,14 +712,30 @@ cxgb_free(struct adapter *sc)
 	ADAPTER_LOCK(sc);
 	sc->flags |= CXGB_SHUTDOWN;
 	ADAPTER_UNLOCK(sc);
+
 	cxgb_pcpu_shutdown_threads(sc);
-	ADAPTER_LOCK(sc);
 
-/*
- * drops the lock
- */
+	ADAPTER_LOCK(sc);
 	cxgb_down_locked(sc);
+	ADAPTER_UNLOCK(sc);
+	
+	t3_sge_deinit_sw(sc);
+	/*
+	 * Wait for last callout
+	 */
 	
+	DELAY(hz*100);
+
+	bus_generic_detach(sc->dev);
+
+	for (i = 0; i < (sc)->params.nports; i++) {
+		if (sc->portdev[i] &&
+		    device_delete_child(sc->dev, sc->portdev[i]) != 0)
+			device_printf(sc->dev, "failed to delete child port\n");
+	}
+
+	cxgb_teardown_interrupts(sc);
+
 #ifdef MSI_SUPPORTED
 	if (sc->flags & (USING_MSI | USING_MSIX)) {
 		device_printf(sc->dev, "releasing msi message(s)\n");
@@ -712,25 +743,13 @@ cxgb_free(struct adapter *sc)
 	} else {
 		device_printf(sc->dev, "no msi message to release\n");
 	}
-#endif
+
 	if (sc->msix_regs_res != NULL) {
 		bus_release_resource(sc->dev, SYS_RES_MEMORY, sc->msix_regs_rid,
 		    sc->msix_regs_res);
 	}
+#endif
 
-	t3_sge_deinit_sw(sc);
-	/*
-	 * Wait for last callout
-	 */
-	
-	DELAY(hz*100);
-
-	for (i = 0; i < (sc)->params.nports; ++i) {
-		if (sc->portdev[i] != NULL)
-			device_delete_child(sc->dev, sc->portdev[i]);
-	}
-		
-	bus_generic_detach(sc->dev);
 	if (sc->tq != NULL) {
 		taskqueue_free(sc->tq);
 		sc->tq = NULL;
@@ -809,88 +828,116 @@ setup_sge_qsets(adapter_t *sc)
 }
 
 static void
-cxgb_teardown_msix(adapter_t *sc) 
+cxgb_teardown_interrupts(adapter_t *sc)
 {
-	int i, nqsets;
-	
-	for (nqsets = i = 0; i < (sc)->params.nports; i++) 
-		nqsets += sc->port[i].nqsets;
+	int i;
 
-	for (i = 0; i < nqsets; i++) {
-		if (sc->msix_intr_tag[i] != NULL) {
-			bus_teardown_intr(sc->dev, sc->msix_irq_res[i],
-			    sc->msix_intr_tag[i]);
-			sc->msix_intr_tag[i] = NULL;
-		}
-		if (sc->msix_irq_res[i] != NULL) {
-			bus_release_resource(sc->dev, SYS_RES_IRQ,
-			    sc->msix_irq_rid[i], sc->msix_irq_res[i]);
-			sc->msix_irq_res[i] = NULL;
+	for (i = 0; i < SGE_QSETS; i++) {
+		if (sc->msix_intr_tag[i] == NULL) {
+
+			/* Should have been setup fully or not at all */
+			KASSERT(sc->msix_irq_res[i] == NULL &&
+				sc->msix_irq_rid[i] == 0,
+				("%s: half-done interrupt (%d).", __func__, i));
+
+			continue;
 		}
+
+		bus_teardown_intr(sc->dev, sc->msix_irq_res[i],
+				  sc->msix_intr_tag[i]);
+		bus_release_resource(sc->dev, SYS_RES_IRQ, sc->msix_irq_rid[i],
+				     sc->msix_irq_res[i]);
+
+		sc->msix_irq_res[i] = sc->msix_intr_tag[i] = NULL;
+		sc->msix_irq_rid[i] = 0;
 	}
-}
 
-static int
-cxgb_setup_msix(adapter_t *sc, int msix_count)
-{
-	int i, j, k, nqsets, rid;
+	if (sc->intr_tag) {
+		KASSERT(sc->irq_res != NULL,
+			("%s: half-done interrupt.", __func__));
 
-	/* The first message indicates link changes and error conditions */
-	sc->irq_rid = 1;
-	if ((sc->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ,
-	   &sc->irq_rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) {
-		device_printf(sc->dev, "Cannot allocate msix interrupt\n");
-		return (EINVAL);
+		bus_teardown_intr(sc->dev, sc->irq_res, sc->intr_tag);
+		bus_release_resource(sc->dev, SYS_RES_IRQ, sc->irq_rid,
+				     sc->irq_res);
+
+		sc->irq_res = sc->intr_tag = NULL;
+		sc->irq_rid = 0;
 	}
+}
 
-	if (bus_setup_intr(sc->dev, sc->irq_res, INTR_MPSAFE|INTR_TYPE_NET,
+static int
+cxgb_setup_interrupts(adapter_t *sc)
+{
+	struct resource *res;
+	void *tag;
+	int i, rid, err, intr_flag = sc->flags & (USING_MSI | USING_MSIX);
+
+	sc->irq_rid = intr_flag ? 1 : 0;
+	sc->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &sc->irq_rid,
+					     RF_SHAREABLE | RF_ACTIVE);
+	if (sc->irq_res == NULL) {
+		device_printf(sc->dev, "Cannot allocate interrupt (%x, %u)\n",
+			      intr_flag, sc->irq_rid);
+		err = EINVAL;
+		sc->irq_rid = 0;
+	} else {
+		err = bus_setup_intr(sc->dev, sc->irq_res,
+				     INTR_MPSAFE | INTR_TYPE_NET,
 #ifdef INTR_FILTERS
-		NULL,
+				     NULL,
 #endif
-		cxgb_async_intr, sc, &sc->intr_tag)) {
-		device_printf(sc->dev, "Cannot set up interrupt\n");
-		return (EINVAL);
+				     sc->cxgb_intr, sc, &sc->intr_tag);
+
+		if (err) {
+			device_printf(sc->dev,
+				      "Cannot set up interrupt (%x, %u, %d)\n",
+				      intr_flag, sc->irq_rid, err);
+			bus_release_resource(sc->dev, SYS_RES_IRQ, sc->irq_rid,
+					     sc->irq_res);
+			sc->irq_res = sc->intr_tag = NULL;
+			sc->irq_rid = 0;
+		}
 	}
-	for (i = k = 0; i < (sc)->params.nports; i++) {
-		nqsets = sc->port[i].nqsets;
-		for (j = 0; j < nqsets; j++, k++) {
-			struct sge_qset *qs = &sc->sge.qs[k];
-
-			rid = k + 2;
-			if (cxgb_debug)
-				printf("rid=%d ", rid);
-			if ((sc->msix_irq_res[k] = bus_alloc_resource_any(
-			    sc->dev, SYS_RES_IRQ, &rid,
-			    RF_SHAREABLE | RF_ACTIVE)) == NULL) {
-				device_printf(sc->dev, "Cannot allocate "
-				    "interrupt for message %d\n", rid);
-				return (EINVAL);
-			}
-			sc->msix_irq_rid[k] = rid;
-			if (bus_setup_intr(sc->dev, sc->msix_irq_res[k],
-				INTR_MPSAFE|INTR_TYPE_NET,
+
+	/* That's all for INTx or MSI */
+	if (!(intr_flag & USING_MSIX) || err)
+		return (err);
+
+	for (i = 0; i < sc->msi_count - 1; i++) {
+		rid = i + 2;
+		res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, &rid,
+					     RF_SHAREABLE | RF_ACTIVE);
+		if (res == NULL) {
+			device_printf(sc->dev, "Cannot allocate interrupt "
+				      "for message %d\n", rid);
+			err = EINVAL;
+			break;
+		}
+
+		err = bus_setup_intr(sc->dev, res, INTR_MPSAFE | INTR_TYPE_NET,
 #ifdef INTR_FILTERS
-				NULL,
+				     NULL,
 #endif
-				t3_intr_msix, qs, &sc->msix_intr_tag[k])) {
-				device_printf(sc->dev, "Cannot set up "
-				    "interrupt for message %d\n", rid);
-				return (EINVAL);
-			}
-#ifdef IFNET_MULTIQUEUE			
-			if (singleq == 0) {
-				int vector = rman_get_start(sc->msix_irq_res[k]);
-				if (bootverbose)
-					device_printf(sc->dev, "binding vector=%d to cpu=%d\n", vector, k % mp_ncpus);
-				intr_bind(vector, k % mp_ncpus);
-			}
-#endif			
+				     t3_intr_msix, &sc->sge.qs[i], &tag);
+		if (err) {
+			device_printf(sc->dev, "Cannot set up interrupt "
+				      "for message %d (%d)\n", rid, err);
+			bus_release_resource(sc->dev, SYS_RES_IRQ, rid, res);
+			break;
 		}
+
+		sc->msix_irq_rid[i] = rid;
+		sc->msix_irq_res[i] = res;
+		sc->msix_intr_tag[i] = tag;
 	}
 
-	return (0);
+	if (err)
+		cxgb_teardown_interrupts(sc);
+
+	return (err);
 }
 
+
 static int
 cxgb_port_probe(device_t dev)
 {
@@ -921,6 +968,12 @@ cxgb_makedev(struct port_info *pi)
 	return (0);
 }
 
+#ifndef LRO_SUPPORTED
+#ifdef IFCAP_LRO
+#undef IFCAP_LRO
+#endif
+#define IFCAP_LRO 0x0
+#endif
 
 #ifdef TSO_SUPPORTED
 #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO)
@@ -968,16 +1021,11 @@ cxgb_port_attach(device_t dev)
 	ifp->if_ioctl = cxgb_ioctl;
 	ifp->if_start = cxgb_start;
 
-#if 0	
-#ifdef IFNET_MULTIQUEUE
-	ifp->if_flags |= IFF_MULTIQ;
-	ifp->if_mq_start = cxgb_pcpu_start;
-#endif
-#endif	
+
 	ifp->if_timer = 0;	/* Disable ifnet watchdog */
 	ifp->if_watchdog = NULL;
 
-	ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len;
+	ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
 	IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
 	IFQ_SET_READY(&ifp->if_snd);
 
@@ -995,6 +1043,10 @@ cxgb_port_attach(device_t dev)
 	}
 
 	ether_ifattach(ifp, p->hw_addr);
+
+#ifdef IFNET_MULTIQUEUE
+	ifp->if_transmit = cxgb_pcpu_transmit;
+#endif
 	/*
 	 * Only default to jumbo frames on 10GigE
 	 */
@@ -1055,40 +1107,60 @@ cxgb_port_attach(device_t dev)
 	bcopy(IF_LLADDR(p->ifp), p->hw_addr, ETHER_ADDR_LEN);
 	t3_sge_init_port(p);
 
-	TASK_INIT(&p->link_fault_task, 0, cxgb_link_fault, p);
-
 #if defined(LINK_ATTACH)	
 	cxgb_link_start(p);
 	t3_link_changed(sc, p->port_id);
 #endif
-	return (0);
+
+	return (err);
 }
 
+/*
+ * cxgb_port_detach() is called via the device_detach methods when
+ * cxgb_free() calls the bus_generic_detach.  It is responsible for 
+ * removing the device from the view of the kernel, i.e. from all 
+ * interfaces lists etc.  This routine is only called when the driver is 
+ * being unloaded, not when the link goes down.
+ * 
+ */
 static int
 cxgb_port_detach(device_t dev)
 {
 	struct port_info *p;
+	struct adapter *sc;
 
 	p = device_get_softc(dev);
+	sc = p->adapter;
+
+	if (p->port_cdev != NULL)
+		destroy_dev(p->port_cdev);
+	
+	ether_ifdetach(p->ifp);
 
 	PORT_LOCK(p);
 	if (p->ifp->if_drv_flags & IFF_DRV_RUNNING) 
 		cxgb_stop_locked(p);
 	PORT_UNLOCK(p);
 	
-	ether_ifdetach(p->ifp);
-	printf("waiting for callout to stop ...");
-	DELAY(1000000);
-	printf("done\n");
+	callout_drain(&sc->cxgb_tick_ch);
+	callout_drain(&sc->sge_timer_ch);
+	
+	if (sc->tq != NULL) {
+		printf("draining slow intr\n");
+		
+		taskqueue_drain(sc->tq, &sc->slow_intr_task);
+			printf("draining ext intr\n");	
+		taskqueue_drain(sc->tq, &sc->ext_intr_task);
+		printf("draining tick task\n");
+		taskqueue_drain(sc->tq, &sc->tick_task);
+	}
+
 	/*
 	 * the lock may be acquired in ifdetach
 	 */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From jilles at FreeBSD.org  Mon Jun  8 22:05:49 2009
From: jilles at FreeBSD.org (Jilles Tjoelker)
Date: Mon Jun  8 22:06:13 2009
Subject: svn commit: r193776 - in stable/7/usr.sbin/pkg_install: . info
Message-ID: <200906082205.n58M5lTc045758@svn.freebsd.org>

Author: jilles
Date: Mon Jun  8 22:05:47 2009
New Revision: 193776
URL: http://svn.freebsd.org/changeset/base/193776

Log:
  MFC r193273: Fix segfault when giving invalid long option to pkg_info.
  
  PR:		bin/133473
  Submitted by:	Rafal Grodzinski
  Approved by:	ed (mentor)

Modified:
  stable/7/usr.sbin/pkg_install/   (props changed)
  stable/7/usr.sbin/pkg_install/info/main.c

Modified: stable/7/usr.sbin/pkg_install/info/main.c
==============================================================================
--- stable/7/usr.sbin/pkg_install/info/main.c	Mon Jun  8 22:03:37 2009	(r193775)
+++ stable/7/usr.sbin/pkg_install/info/main.c	Mon Jun  8 22:05:47 2009	(r193776)
@@ -58,6 +58,7 @@ static struct option longopts[] = {
 	{ "verbose",	no_argument,		NULL,		'v' },
 	{ "version",	no_argument,		NULL,		'P' },
 	{ "which",	required_argument,	NULL,		'W' },
+	{ NULL,		0,			NULL,		0 }
 };
 
 int
From sam at FreeBSD.org  Mon Jun  8 23:47:48 2009
From: sam at FreeBSD.org (Sam Leffler)
Date: Mon Jun  8 23:47:54 2009
Subject: svn commit: r193782 - stable/7/usr.sbin/wpa/hostapd
Message-ID: <200906082347.n58NllZl048176@svn.freebsd.org>

Author: sam
Date: Mon Jun  8 23:47:47 2009
New Revision: 193782
URL: http://svn.freebsd.org/changeset/base/193782

Log:
  MFC r193524: do not force the mtu to 2290

Modified:
  stable/7/usr.sbin/wpa/hostapd/driver_freebsd.c

Modified: stable/7/usr.sbin/wpa/hostapd/driver_freebsd.c
==============================================================================
--- stable/7/usr.sbin/wpa/hostapd/driver_freebsd.c	Mon Jun  8 23:36:52 2009	(r193781)
+++ stable/7/usr.sbin/wpa/hostapd/driver_freebsd.c	Mon Jun  8 23:47:47 2009	(r193782)
@@ -244,18 +244,6 @@ bsd_set_iface_flags(void *priv, int dev_
 		perror("ioctl[SIOCSIFFLAGS]");
 		return -1;
 	}
-
-	if (dev_up) {
-		memset(&ifr, 0, sizeof(ifr));
-		snprintf(ifr.ifr_name, IFNAMSIZ, "%s", drv->iface);
-		ifr.ifr_mtu = HOSTAPD_MTU;
-		if (ioctl(drv->ioctl_sock, SIOCSIFMTU, &ifr) != 0) {
-			perror("ioctl[SIOCSIFMTU]");
-			printf("Setting MTU failed - trying to survive with "
-			       "current value\n");
-		}
-	}
-
 	return 0;
 }
 
From des at FreeBSD.org  Tue Jun  9 00:27:24 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Tue Jun  9 00:27:30 2009
Subject: svn commit: r193788 - in stable/7/lib/libc: . include
Message-ID: <200906090027.n590RNAg049628@svn.freebsd.org>

Author: des
Date: Tue Jun  9 00:27:23 2009
New Revision: 193788
URL: http://svn.freebsd.org/changeset/base/193788

Log:
  merge r176058: more missing namespace wrappers for libthr

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/include/namespace.h
  stable/7/lib/libc/include/un-namespace.h

Modified: stable/7/lib/libc/include/namespace.h
==============================================================================
--- stable/7/lib/libc/include/namespace.h	Tue Jun  9 00:15:46 2009	(r193787)
+++ stable/7/lib/libc/include/namespace.h	Tue Jun  9 00:27:23 2009	(r193788)
@@ -147,6 +147,7 @@
 #define		pthread_mutex_destroy		_pthread_mutex_destroy
 #define		pthread_mutex_getprioceiling	_pthread_mutex_getprioceiling
 #define		pthread_mutex_init		_pthread_mutex_init
+#define		pthread_mutex_isowned_np	_pthread_mutex_isowned_np
 #define		pthread_mutex_lock		_pthread_mutex_lock
 #define		pthread_mutex_setprioceiling	_pthread_mutex_setprioceiling
 #define		pthread_mutex_timedlock		_pthread_mutex_timedlock

Modified: stable/7/lib/libc/include/un-namespace.h
==============================================================================
--- stable/7/lib/libc/include/un-namespace.h	Tue Jun  9 00:15:46 2009	(r193787)
+++ stable/7/lib/libc/include/un-namespace.h	Tue Jun  9 00:27:23 2009	(r193788)
@@ -128,6 +128,7 @@
 #undef		pthread_mutex_destroy
 #undef		pthread_mutex_getprioceiling
 #undef		pthread_mutex_init
+#undef		pthread_mutex_isowned_np
 #undef		pthread_mutex_lock
 #undef		pthread_mutex_setprioceiling
 #undef		pthread_mutex_timedlock
From des at FreeBSD.org  Tue Jun  9 00:47:56 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Tue Jun  9 00:48:04 2009
Subject: svn commit: r193789 - in stable/7: lib/libthr lib/libthread_db
	lib/libthread_db/arch/amd64 lib/libthread_db/arch/arm
	lib/libthread_db/arch/i386 lib/libthread_db/arch/ia64
	lib/libthread_db/arch/powe...
Message-ID: <200906090047.n590lsYY050180@svn.freebsd.org>

Author: des
Date: Tue Jun  9 00:47:54 2009
New Revision: 193789
URL: http://svn.freebsd.org/changeset/base/193789

Log:
  merge r180982,r181044,r181059,r181065,r181341,r183021: WARNS cleanup,
  add thr_pread_{int,long,ptr} and thr_pwrite_{int,long,ptr}, and change
  definition of psaddr_t (no impact on ABI).  Discussed with marcel@, but
  any screwups are my own.

Modified:
  stable/7/lib/libthr/   (props changed)
  stable/7/lib/libthread_db/   (props changed)
  stable/7/lib/libthread_db/Makefile
  stable/7/lib/libthread_db/arch/amd64/libpthread_md.c
  stable/7/lib/libthread_db/arch/arm/libpthread_md.c
  stable/7/lib/libthread_db/arch/i386/libpthread_md.c
  stable/7/lib/libthread_db/arch/ia64/libpthread_md.c
  stable/7/lib/libthread_db/arch/powerpc/libpthread_md.c
  stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c
  stable/7/lib/libthread_db/libpthread_db.c
  stable/7/lib/libthread_db/libpthread_db.h
  stable/7/lib/libthread_db/libthr_db.c
  stable/7/lib/libthread_db/thread_db.c
  stable/7/lib/libthread_db/thread_db.h
  stable/7/lib/libthread_db/thread_db_int.h
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/sys/procfs.h

Modified: stable/7/lib/libthread_db/Makefile
==============================================================================
--- stable/7/lib/libthread_db/Makefile	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/Makefile	Tue Jun  9 00:47:54 2009	(r193789)
@@ -8,7 +8,7 @@ SRCS=	thread_db.c
 SRCS+=	libpthread_db.c libpthread_md.c
 SRCS+=	libthr_db.c
 INCS=	thread_db.h
-WARNS?= 1
+WARNS?= 6
 
 CFLAGS+=-I. -I${.CURDIR}
 SYM_MAPS+=${.CURDIR}/Symbol.map

Modified: stable/7/lib/libthread_db/arch/amd64/libpthread_md.c
==============================================================================
--- stable/7/lib/libthread_db/arch/amd64/libpthread_md.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/arch/amd64/libpthread_md.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -30,8 +30,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 
+#include "libpthread_db.h"
+
 void
 pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc)
 {

Modified: stable/7/lib/libthread_db/arch/arm/libpthread_md.c
==============================================================================
--- stable/7/lib/libthread_db/arch/arm/libpthread_md.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/arch/arm/libpthread_md.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -27,9 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
 #include 
-#include 
+#include 
 #include 
 
 #include "libpthread_db.h"
@@ -86,7 +85,7 @@ pt_ucontext_to_reg(const ucontext_t *uc,
 }
 
 void
-pt_fpreg_to_ucontext(const struct fpreg *r, ucontext_t *uc)
+pt_fpreg_to_ucontext(const struct fpreg *r __unused, ucontext_t *uc)
 {
 	mcontext_t *mc = &uc->uc_mcontext;
 
@@ -95,9 +94,8 @@ pt_fpreg_to_ucontext(const struct fpreg 
 }
 
 void
-pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
+pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r)
 {
-	const mcontext_t *mc = &uc->uc_mcontext;
 
 	/* XXX */
 	memset(r, 0, sizeof(*r));
@@ -109,8 +107,9 @@ pt_md_init(void)
 }
 
 int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
 {
 
 	/* XXX */
+	return (0);
 }

Modified: stable/7/lib/libthread_db/arch/i386/libpthread_md.c
==============================================================================
--- stable/7/lib/libthread_db/arch/i386/libpthread_md.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/arch/i386/libpthread_md.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -27,11 +27,10 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
 #include 
-#include 
-#include 
 #include 
+#include 
+#include 
 
 #include "libpthread_db.h"
 

Modified: stable/7/lib/libthread_db/arch/ia64/libpthread_md.c
==============================================================================
--- stable/7/lib/libthread_db/arch/ia64/libpthread_md.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/arch/ia64/libpthread_md.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -28,25 +28,28 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 
+#include "libpthread_db.h"
+
 void
-pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc)
+pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused)
 {
 }
 
 void
-pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
+pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused)
 {
 }
 
 void
-pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc)
+pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused)
 {
 }
 
 void
-pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
+pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused)
 {
 }
 
@@ -56,7 +59,7 @@ pt_md_init(void)
 }
 
 int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
 {
 	return (0);
 }

Modified: stable/7/lib/libthread_db/arch/powerpc/libpthread_md.c
==============================================================================
--- stable/7/lib/libthread_db/arch/powerpc/libpthread_md.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/arch/powerpc/libpthread_md.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -27,9 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
 #include 
-#include 
+#include 
 #include 
 
 #include "libpthread_db.h"
@@ -76,8 +75,9 @@ pt_md_init(void)
 }
 
 int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
 {
 
 	/* XXX */
+	return (0);
 }

Modified: stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c
==============================================================================
--- stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/arch/sparc64/libpthread_md.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -28,25 +28,28 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 
+#include "libpthread_db.h"
+
 void
-pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc)
+pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused)
 {
 }
 
 void
-pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
+pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused)
 {
 }
 
 void
-pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc)
+pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused)
 {
 }
 
 void
-pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
+pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused)
 {
 }
 
@@ -56,7 +59,7 @@ pt_md_init(void)
 }
 
 int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
 {
 	return (0);
 }

Modified: stable/7/lib/libthread_db/libpthread_db.c
==============================================================================
--- stable/7/lib/libthread_db/libpthread_db.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/libpthread_db.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -70,7 +70,7 @@ ps2td(int c)
 }
 
 static long
-pt_map_thread(const td_thragent_t *const_ta, psaddr_t pt, int type)
+pt_map_thread(const td_thragent_t *const_ta, psaddr_t pt, enum pt_type type)
 {
 	td_thragent_t *ta = __DECONST(td_thragent_t *, const_ta);
 	struct pt_map *new;
@@ -220,7 +220,6 @@ static td_err_e
 pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th)
 {
 	prgregset_t gregs;
-	TAILQ_HEAD(, pthread) thread_list;
 	psaddr_t pt, tcb_addr;
 	lwpid_t lwp;
 	int ret;
@@ -229,28 +228,24 @@ pt_ta_map_id2thr(const td_thragent_t *ta
 
 	if (id < 0 || id >= ta->map_len || ta->map[id].type == PT_NONE)
 		return (TD_NOTHR);
-	ret = ps_pread(ta->ph, ta->thread_list_addr, &thread_list,
-			sizeof(thread_list));
+
+	ret = thr_pread_ptr(ta, ta->thread_list_addr, &pt);
 	if (ret != 0)
-		return (P2T(ret));
-	pt = (psaddr_t)thread_list.tqh_first;
+		return (TD_ERR);
 	if (ta->map[id].type == PT_LWP) {
 		/*
 		 * if we are referencing a lwp, make sure it was not already
 		 * mapped to user thread.
 		 */
 		while (pt != 0) {
-			ret = ps_pread(ta->ph,
-			        pt + ta->thread_off_tcb,
-			        &tcb_addr, sizeof(tcb_addr));
+			ret = thr_pread_ptr(ta, pt + ta->thread_off_tcb,
+			    &tcb_addr);
 			if (ret != 0)
-				return (P2T(ret));
-			ret = ps_pread(ta->ph,
-			        tcb_addr + ta->thread_off_tmbx + 
-				offsetof(struct kse_thr_mailbox, tm_lwp),
-				&lwp, sizeof(lwp));
+				return (TD_ERR);
+			ret = thr_pread_int(ta, tcb_addr + ta->thread_off_tmbx +
+			    offsetof(struct kse_thr_mailbox, tm_lwp), &lwp);
 			if (ret != 0)
-				return (P2T(ret));
+				return (TD_ERR);
 			/*
 			 * If the lwp was already mapped to userland thread,
 			 * we shouldn't reference it directly in future.
@@ -260,11 +255,9 @@ pt_ta_map_id2thr(const td_thragent_t *ta
 				return (TD_NOTHR);
 			}
 			/* get next thread */
-			ret = ps_pread(ta->ph,
-			        pt + ta->thread_off_next,
-			        &pt, sizeof(pt));
+			ret = thr_pread_ptr(ta, pt + ta->thread_off_next, &pt);
 			if (ret != 0)
-				return (P2T(ret));
+				return (TD_ERR);
 		}
 		/* check lwp */
 		ret = ps_lgetregs(ta->ph, ta->map[id].lwp, gregs);
@@ -275,17 +268,14 @@ pt_ta_map_id2thr(const td_thragent_t *ta
 		}
 	} else {
 		while (pt != 0 && ta->map[id].thr != pt) {
-			ret = ps_pread(ta->ph,
-				pt + ta->thread_off_tcb,
-				&tcb_addr, sizeof(tcb_addr));
+			ret = thr_pread_ptr(ta, pt + ta->thread_off_tcb,
+			    &tcb_addr);
 			if (ret != 0)
-				return (P2T(ret));
+				return (TD_ERR);
 			/* get next thread */
-			ret = ps_pread(ta->ph,
-				pt + ta->thread_off_next,
-				&pt, sizeof(pt));
+			ret = thr_pread_ptr(ta, pt + ta->thread_off_next, &pt);
 			if (ret != 0)
-				return (P2T(ret));
+				return (TD_ERR);
 		}
 
 		if (pt == 0) {
@@ -303,29 +293,24 @@ pt_ta_map_id2thr(const td_thragent_t *ta
 static td_err_e
 pt_ta_map_lwp2thr(const td_thragent_t *ta, lwpid_t lwp, td_thrhandle_t *th)
 {
-	TAILQ_HEAD(, pthread) thread_list;
-	psaddr_t pt, ptr;
-	lwpid_t tmp_lwp;
+	psaddr_t pt, tcb_addr;
+	lwpid_t lwp1;
 	int ret;
-	
+
 	TDBG_FUNC();
 
-	ret = ps_pread(ta->ph, ta->thread_list_addr, &thread_list,
-	                sizeof(thread_list));
+	ret = thr_pread_ptr(ta, ta->thread_list_addr, &pt);
 	if (ret != 0)
-		return (P2T(ret));
-	pt = (psaddr_t)thread_list.tqh_first;
+		return (TD_ERR);
 	while (pt != 0) {
-		ret = ps_pread(ta->ph, pt + ta->thread_off_tcb,
-				&ptr, sizeof(ptr));
+		ret = thr_pread_ptr(ta, pt + ta->thread_off_tcb, &tcb_addr);
 		if (ret != 0)
-			return (P2T(ret));
-		ptr += ta->thread_off_tmbx +
-		       offsetof(struct kse_thr_mailbox, tm_lwp);
-		ret = ps_pread(ta->ph, ptr, &tmp_lwp, sizeof(lwpid_t));
+			return (TD_ERR);
+		ret = thr_pread_int(ta, tcb_addr + ta->thread_off_tmbx +
+		    offsetof(struct kse_thr_mailbox, tm_lwp), &lwp1);
 		if (ret != 0)
-			return (P2T(ret));
-		if (tmp_lwp == lwp) {
+			return (TD_ERR);
+		if (lwp1 == lwp) {
 			th->th_ta = ta;
 			th->th_tid = pt_map_thread(ta, pt, PT_USER);
 			if (th->th_tid == -1)
@@ -336,28 +321,23 @@ pt_ta_map_lwp2thr(const td_thragent_t *t
 		}
 
 		/* get next thread */
-		ret = ps_pread(ta->ph,
-		           pt + ta->thread_off_next,
-		           &pt, sizeof(pt));
+		ret = thr_pread_ptr(ta, pt + ta->thread_off_next, &pt);
 		if (ret != 0)
-			return (P2T(ret));
+			return (TD_ERR);
 	}
 
 	return (TD_NOTHR);
 }
 
 static td_err_e
-pt_ta_thr_iter(const td_thragent_t *ta,
-               td_thr_iter_f *callback, void *cbdata_p,
-               td_thr_state_e state, int ti_pri,
-               sigset_t *ti_sigmask_p,
-               unsigned int ti_user_flags)
+pt_ta_thr_iter(const td_thragent_t *ta, td_thr_iter_f *callback,
+    void *cbdata_p, td_thr_state_e state __unused, int ti_pri __unused,
+    sigset_t *ti_sigmask_p __unused, unsigned int ti_user_flags __unused)
 {
-	TAILQ_HEAD(, pthread) thread_list;
 	td_thrhandle_t th;
 	psaddr_t pt;
 	ps_err_e pserr;
-	int activated;
+	int activated, ret;
 
 	TDBG_FUNC();
 
@@ -368,11 +348,9 @@ pt_ta_thr_iter(const td_thragent_t *ta,
 	if (!activated)
 		return (TD_OK);
 
-	pserr = ps_pread(ta->ph, ta->thread_list_addr, &thread_list,
-	    sizeof(thread_list));
-	if (pserr != 0)
-		return (P2T(pserr));
-	pt = (psaddr_t)thread_list.tqh_first;
+	ret = thr_pread_ptr(ta, ta->thread_list_addr, &pt);
+	if (ret != 0)
+		return (TD_ERR);
 	while (pt != 0) {
 		th.th_ta = ta;
 		th.th_tid = pt_map_thread(ta, pt, PT_USER);
@@ -383,11 +361,9 @@ pt_ta_thr_iter(const td_thragent_t *ta,
 		if ((*callback)(&th, cbdata_p))
 			return (TD_DBERR);
 		/* get next thread */
-		pserr = ps_pread(ta->ph,
-		    pt + ta->thread_off_next, &pt,
-		    sizeof(pt));
-		if (pserr != PS_OK)
-			return (P2T(pserr));
+		ret = thr_pread_ptr(ta, pt + ta->thread_off_next, &pt);
+		if (ret != 0)
+			return (TD_ERR);
 	}
 	return (TD_OK);
 }
@@ -395,7 +371,7 @@ pt_ta_thr_iter(const td_thragent_t *ta,
 static td_err_e
 pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg)
 {
-	char *keytable;
+	void *keytable;
 	void *destructor;
 	int i, ret, allocated;
 
@@ -411,10 +387,10 @@ pt_ta_tsd_iter(const td_thragent_t *ta, 
 		return (P2T(ret));
 	}	
 	for (i = 0; i < ta->thread_max_keys; i++) {
-		allocated = *(int *)(keytable + i * ta->thread_size_key +
-			ta->thread_off_key_allocated);
-		destructor = *(void **)(keytable + i * ta->thread_size_key +
-			ta->thread_off_key_destructor);
+		allocated = *(int *)(void *)((uintptr_t)keytable +
+		    i * ta->thread_size_key + ta->thread_off_key_allocated);
+		destructor = *(void **)(void *)((uintptr_t)keytable +
+		    i * ta->thread_size_key + ta->thread_off_key_destructor);
 		if (allocated) {
 			ret = (ki)(i, destructor, arg);
 			if (ret != 0) {
@@ -428,28 +404,32 @@ pt_ta_tsd_iter(const td_thragent_t *ta, 
 }
 
 static td_err_e
-pt_ta_event_addr(const td_thragent_t *ta, td_event_e event, td_notify_t *ptr)
+pt_ta_event_addr(const td_thragent_t *ta __unused, td_event_e event __unused,
+    td_notify_t *ptr __unused)
 {
 	TDBG_FUNC();
 	return (TD_ERR);
 }
 
 static td_err_e
-pt_ta_set_event(const td_thragent_t *ta, td_thr_events_t *events)
+pt_ta_set_event(const td_thragent_t *ta __unused,
+    td_thr_events_t *events __unused)
 {
 	TDBG_FUNC();
 	return (0);
 }
 
 static td_err_e
-pt_ta_clear_event(const td_thragent_t *ta, td_thr_events_t *events)
+pt_ta_clear_event(const td_thragent_t *ta __unused,
+    td_thr_events_t *events __unused)
 {
 	TDBG_FUNC();
 	return (0);
 }
 
 static td_err_e
-pt_ta_event_getmsg(const td_thragent_t *ta, td_event_msg_t *msg)
+pt_ta_event_getmsg(const td_thragent_t *ta __unused,
+    td_event_msg_t *msg __unused)
 {
 	TDBG_FUNC();
 	return (TD_NOMSG);
@@ -458,7 +438,7 @@ pt_ta_event_getmsg(const td_thragent_t *
 static td_err_e
 pt_dbsuspend(const td_thrhandle_t *th, int suspend)
 {
-	td_thragent_t *ta = (td_thragent_t *)th->th_ta;
+	const td_thragent_t *ta = th->th_ta;
 	psaddr_t tcb_addr, tmbx_addr, ptr;
 	lwpid_t lwp;
 	uint32_t dflags;
@@ -952,28 +932,31 @@ pt_thr_setgregs(const td_thrhandle_t *th
 }
 
 static td_err_e
-pt_thr_event_enable(const td_thrhandle_t *th, int en)
+pt_thr_event_enable(const td_thrhandle_t *th __unused, int en __unused)
 {
 	TDBG_FUNC();
 	return (0);
 }
 
 static td_err_e
-pt_thr_set_event(const td_thrhandle_t *th, td_thr_events_t *setp)
+pt_thr_set_event(const td_thrhandle_t *th __unused,
+    td_thr_events_t *setp __unused)
 {
 	TDBG_FUNC();
 	return (0);
 }
 
 static td_err_e
-pt_thr_clear_event(const td_thrhandle_t *th, td_thr_events_t *setp)
+pt_thr_clear_event(const td_thrhandle_t *th __unused,
+    td_thr_events_t *setp __unused)
 {
 	TDBG_FUNC();
 	return (0);
 }
 
 static td_err_e
-pt_thr_event_getmsg(const td_thrhandle_t *th, td_event_msg_t *msg)
+pt_thr_event_getmsg(const td_thrhandle_t *th __unused,
+    td_event_msg_t *msg __unused)
 {
 	TDBG_FUNC();
 	return (TD_NOMSG);
@@ -1074,17 +1057,16 @@ pt_validate(const td_thrhandle_t *th)
 	return (TD_OK);
 }
 
-td_err_e
-pt_thr_tls_get_addr(const td_thrhandle_t *th, void *_linkmap, size_t offset,
-		    void **address)
+static td_err_e
+pt_thr_tls_get_addr(const td_thrhandle_t *th, psaddr_t _linkmap, size_t offset,
+    psaddr_t *address)
 {
-	char *obj_entry;
 	const td_thragent_t *ta = th->th_ta;
-	psaddr_t tcb_addr, *dtv_addr;
+	psaddr_t dtv_addr, obj_entry, tcb_addr;
 	int tls_index, ret;
 
 	/* linkmap is a member of Obj_Entry */
-	obj_entry = (char *)_linkmap - ta->thread_off_linkmap;
+	obj_entry = _linkmap - ta->thread_off_linkmap;
 
 	/* get tlsindex of the object file */
 	ret = ps_pread(ta->ph,
@@ -1106,8 +1088,8 @@ pt_thr_tls_get_addr(const td_thrhandle_t
 	if (ret != 0)
 		return (P2T(ret));
 	/* now get the object's tls block base address */
-	ret = ps_pread(ta->ph, &dtv_addr[tls_index+1], address,
-		sizeof(*address));
+	ret = ps_pread(ta->ph, dtv_addr + sizeof(void *) * (tls_index + 1),
+	    address, sizeof(*address));
 	if (ret != 0)
 		return (P2T(ret));
 

Modified: stable/7/lib/libthread_db/libpthread_db.h
==============================================================================
--- stable/7/lib/libthread_db/libpthread_db.h	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/libpthread_db.h	Tue Jun  9 00:47:54 2009	(r193789)
@@ -34,13 +34,14 @@
 
 #include "thread_db_int.h"
 
-struct pt_map {
-	enum {
-		PT_NONE,
-		PT_USER,
-		PT_LWP
-	} type;
+enum pt_type {
+	PT_NONE,
+	PT_USER,
+	PT_LWP
+};
 
+struct pt_map {
+	enum pt_type	type;
 	union {
 		lwpid_t		lwp;
 		psaddr_t	thr;

Modified: stable/7/lib/libthread_db/libthr_db.c
==============================================================================
--- stable/7/lib/libthread_db/libthr_db.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/libthr_db.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -201,36 +201,30 @@ pt_ta_delete(td_thragent_t *ta)
 static td_err_e
 pt_ta_map_id2thr(const td_thragent_t *ta, thread_t id, td_thrhandle_t *th)
 {
-	TAILQ_HEAD(, pthread) thread_list;
 	psaddr_t pt;
-	long lwp;
+	int32_t lwp;
 	int ret;
 
 	TDBG_FUNC();
 
 	if (id == 0)
 		return (TD_NOTHR);
-	ret = ps_pread(ta->ph, ta->thread_list_addr, &thread_list,
-		sizeof(thread_list));
+	ret = thr_pread_ptr(ta, ta->thread_list_addr, &pt);
 	if (ret != 0)
-		return (P2T(ret));
+		return (TD_ERR);
 	/* Iterate through thread list to find pthread */
-	pt = (psaddr_t)thread_list.tqh_first;
-	while (pt != NULL) {
-		ret = ps_pread(ta->ph, pt + ta->thread_off_tid,
-			       &lwp, sizeof(lwp));
+	while (pt != 0) {
+		ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
 		if (ret != 0)
-			return (P2T(ret));
+			return (TD_ERR);
 		if (lwp == id)
 			break;
 		/* get next thread */
-		ret = ps_pread(ta->ph,
-				pt + ta->thread_off_next,
-				&pt, sizeof(pt));
+		ret = thr_pread_ptr(ta, pt + ta->thread_off_next, &pt);
 		if (ret != 0)
-			return (P2T(ret));
+			return (TD_ERR);
 	}
-	if (pt == NULL)
+	if (pt == 0)
 		return (TD_NOTHR);
 	th->th_ta = ta;
 	th->th_tid = id;
@@ -245,30 +239,24 @@ pt_ta_map_lwp2thr(const td_thragent_t *t
 }
 
 static td_err_e
-pt_ta_thr_iter(const td_thragent_t *ta,
-               td_thr_iter_f *callback, void *cbdata_p,
-               td_thr_state_e state, int ti_pri,
-               sigset_t *ti_sigmask_p,
-               unsigned int ti_user_flags)
+pt_ta_thr_iter(const td_thragent_t *ta, td_thr_iter_f *callback,
+    void *cbdata_p, td_thr_state_e state __unused, int ti_pri __unused,
+    sigset_t *ti_sigmask_p __unused, unsigned int ti_user_flags __unused)
 {
-	TAILQ_HEAD(, pthread) thread_list;
 	td_thrhandle_t th;
 	psaddr_t pt;
-	long lwp;
+	int32_t lwp;
 	int ret;
 
 	TDBG_FUNC();
 
-	ret = ps_pread(ta->ph, ta->thread_list_addr, &thread_list,
-		       sizeof(thread_list));
+	ret = thr_pread_ptr(ta, ta->thread_list_addr, &pt);
 	if (ret != 0)
-		return (P2T(ret));
-	pt = (psaddr_t)thread_list.tqh_first;
+		return (TD_ERR);
 	while (pt != 0) {
-		ret = ps_pread(ta->ph, pt + ta->thread_off_tid, &lwp,
-			      sizeof(lwp));
+		ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
 		if (ret != 0)
-			return (P2T(ret));
+			return (TD_ERR);
 		if (lwp != 0 && lwp != TERMINATED) {
 			th.th_ta = ta;
 			th.th_tid = (thread_t)lwp;
@@ -277,10 +265,9 @@ pt_ta_thr_iter(const td_thragent_t *ta,
 				return (TD_DBERR);
 		}
 		/* get next thread */
-		ret = ps_pread(ta->ph, pt + ta->thread_off_next, &pt,
-			       sizeof(pt));
+		ret = thr_pread_ptr(ta, pt + ta->thread_off_next, &pt);
 		if (ret != 0)
-			return (P2T(ret));
+			return (TD_ERR);
 	}
 	return (TD_OK);
 }
@@ -288,7 +275,7 @@ pt_ta_thr_iter(const td_thragent_t *ta,
 static td_err_e
 pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg)
 {
-	char *keytable;
+	void *keytable;
 	void *destructor;
 	int i, ret, allocated;
 
@@ -304,10 +291,10 @@ pt_ta_tsd_iter(const td_thragent_t *ta, 
 		return (P2T(ret));
 	}
 	for (i = 0; i < ta->thread_max_keys; i++) {
-		allocated = *(int *)(keytable + i * ta->thread_size_key +
-			ta->thread_off_key_allocated);
-		destructor = *(void **)(keytable + i * ta->thread_size_key +
-			ta->thread_off_key_destructor);
+		allocated = *(int *)(void *)((uintptr_t)keytable +
+		    i * ta->thread_size_key + ta->thread_off_key_allocated);
+		destructor = *(void **)(void *)((uintptr_t)keytable +
+		    i * ta->thread_size_key + ta->thread_off_key_destructor);
 		if (allocated) {
 			ret = (ki)(i, destructor, arg);
 			if (ret != 0) {
@@ -379,24 +366,23 @@ pt_ta_event_getmsg(const td_thragent_t *
 {
 	static td_thrhandle_t handle;
 
-	psaddr_t pt, pt_temp;
+	psaddr_t pt;
 	td_thr_events_e	tmp;
-	long lwp;
+	int32_t lwp;
 	int ret;
 
 	TDBG_FUNC();
 
-	ret = ps_pread(ta->ph, ta->thread_last_event_addr, &pt, sizeof(pt));
+	ret = thr_pread_ptr(ta, ta->thread_last_event_addr, &pt);
 	if (ret != 0)
-		return (P2T(ret));
-	if (pt == NULL)
+		return (TD_ERR);
+	if (pt == 0)
 		return (TD_NOMSG);
 	/*
 	 * Take the event pointer, at the time, libthr only reports event
 	 * once a time, so it is not a link list.
 	 */
-	pt_temp = NULL;
-	ps_pwrite(ta->ph, ta->thread_last_event_addr, &pt_temp, sizeof(pt_temp));
+	thr_pwrite_ptr(ta, ta->thread_last_event_addr, 0);
 
 	/* Read event info */
 	ret = ps_pread(ta->ph, pt + ta->thread_off_event_buf, msg, sizeof(*msg));
@@ -408,21 +394,21 @@ pt_ta_event_getmsg(const td_thragent_t *
 	tmp = 0;
 	ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp));
 	/* Convert event */
-	pt = (psaddr_t)msg->th_p;
-	ret = ps_pread(ta->ph, pt + ta->thread_off_tid, &lwp, sizeof(lwp));
+	pt = msg->th_p;
+	ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
 	if (ret != 0)
-		return (P2T(ret));
+		return (TD_ERR);
 	handle.th_ta = ta;
 	handle.th_tid = lwp;
 	handle.th_thread = pt;
-	msg->th_p = &handle;
+	msg->th_p = (uintptr_t)&handle;
 	return (0);
 }
 
 static td_err_e
 pt_dbsuspend(const td_thrhandle_t *th, int suspend)
 {
-	td_thragent_t *ta = (td_thragent_t *)th->th_ta;
+	const td_thragent_t *ta = th->th_ta;
 	int ret;
 
 	TDBG_FUNC();
@@ -480,14 +466,13 @@ pt_thr_get_info(const td_thrhandle_t *th
 	ret = pt_validate(th);
 	if (ret)
 		return (ret);
-	ret = ps_pread(ta->ph, th->th_thread + ta->thread_off_state,
-	               &state, sizeof(state));
+	ret = thr_pread_int(ta, th->th_thread + ta->thread_off_state, &state);
 	if (ret != 0)
-		return (P2T(ret));
-	ret = ps_pread(ta->ph, th->th_thread + ta->thread_off_report_events,
-		&info->ti_traceme, sizeof(int));
+		return (TD_ERR);
+	ret = thr_pread_int(ta, th->th_thread + ta->thread_off_report_events,
+	    &info->ti_traceme);
 	if (ret != 0)
-		return (P2T(ret));
+		return (TD_ERR);
 	ret = ps_pread(ta->ph, th->th_thread + ta->thread_off_event_mask,
 		&info->ti_events, sizeof(td_thr_events_t));
 	if (ret != 0)
@@ -662,17 +647,17 @@ static td_err_e
 pt_thr_event_getmsg(const td_thrhandle_t *th, td_event_msg_t *msg)
 {
 	static td_thrhandle_t handle;
-	td_thragent_t *ta = (td_thragent_t *)th->th_ta;
+	const td_thragent_t *ta = th->th_ta;
 	psaddr_t pt, pt_temp;
-	long lwp;
+	int32_t lwp;
 	int ret;
 	td_thr_events_e	tmp;
 
 	TDBG_FUNC();
 	pt = th->th_thread;
-	ret = ps_pread(ta->ph, ta->thread_last_event_addr, &pt_temp, sizeof(pt_temp));
+	ret = thr_pread_ptr(ta, ta->thread_last_event_addr, &pt_temp);
 	if (ret != 0)
-		return (P2T(ret));
+		return (TD_ERR);
 	/* Get event */
 	ret = ps_pread(ta->ph, pt + ta->thread_off_event_buf, msg, sizeof(*msg));
 	if (ret != 0)
@@ -683,27 +668,26 @@ pt_thr_event_getmsg(const td_thrhandle_t
 	 * Take the event pointer, at the time, libthr only reports event
 	 * once a time, so it is not a link list.
 	 */
-	if (pt == pt_temp) {
-		pt_temp = NULL;
-		ps_pwrite(ta->ph, ta->thread_last_event_addr, &pt_temp, sizeof(pt_temp));
-	}
+	if (pt == pt_temp)
+		thr_pwrite_ptr(ta, ta->thread_last_event_addr, 0);
+
 	/* Clear event */
 	tmp = 0;
 	ps_pwrite(ta->ph, pt + ta->thread_off_event_buf, &tmp, sizeof(tmp));
 	/* Convert event */
-	pt = (psaddr_t)msg->th_p;
-	ret = ps_pread(ta->ph, pt + ta->thread_off_tid, &lwp, sizeof(lwp));
+	pt = msg->th_p;
+	ret = thr_pread_int(ta, pt + ta->thread_off_tid, &lwp);
 	if (ret != 0)
-		return (P2T(ret));
+		return (TD_ERR);
 	handle.th_ta = ta;
 	handle.th_tid = lwp;
 	handle.th_thread = pt;
-	msg->th_p = &handle;
+	msg->th_p = (uintptr_t)&handle;
 	return (0);
 }
 
 static td_err_e
-pt_thr_sstep(const td_thrhandle_t *th, int step)
+pt_thr_sstep(const td_thrhandle_t *th, int step __unused)
 {
 	TDBG_FUNC();
 
@@ -714,22 +698,21 @@ static int
 pt_validate(const td_thrhandle_t *th)
 {
 
-	if (th->th_tid == 0 || th->th_thread == NULL)
+	if (th->th_tid == 0 || th->th_thread == 0)
 		return (TD_ERR);
 	return (TD_OK);
 }
 
 static td_err_e
-pt_thr_tls_get_addr(const td_thrhandle_t *th, void *_linkmap, size_t offset,
-		    void **address)
+pt_thr_tls_get_addr(const td_thrhandle_t *th, psaddr_t _linkmap, size_t offset,
+    psaddr_t *address)
 {
-	char *obj_entry;
 	const td_thragent_t *ta = th->th_ta;
-	psaddr_t tcb_addr, *dtv_addr;
+	psaddr_t dtv_addr, obj_entry, tcb_addr;
 	int tls_index, ret;
 
 	/* linkmap is a member of Obj_Entry */
-	obj_entry = (char *)_linkmap - ta->thread_off_linkmap;
+	obj_entry = _linkmap - ta->thread_off_linkmap;
 
 	/* get tlsindex of the object file */
 	ret = ps_pread(ta->ph,
@@ -750,8 +733,8 @@ pt_thr_tls_get_addr(const td_thrhandle_t
 	if (ret != 0)
 		return (P2T(ret));
 	/* now get the object's tls block base address */
-	ret = ps_pread(ta->ph, &dtv_addr[tls_index+1], address,
-		sizeof(*address));
+	ret = ps_pread(ta->ph, dtv_addr + sizeof(void *) * (tls_index+1),
+	    address, sizeof(*address));
 	if (ret != 0)
 		return (P2T(ret));
 

Modified: stable/7/lib/libthread_db/thread_db.c
==============================================================================
--- stable/7/lib/libthread_db/thread_db.c	Tue Jun  9 00:27:23 2009	(r193788)
+++ stable/7/lib/libthread_db/thread_db.c	Tue Jun  9 00:47:54 2009	(r193789)
@@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include "thread_db_int.h"
@@ -50,7 +52,6 @@ td_init(void)
 {
 	td_err_e ret, tmp;
 	struct ta_ops *ops_p, **ops_pp;
-	size_t i;
 
 	ret = 0;
 	SET_FOREACH(ops_pp, __ta_ops) {
@@ -104,7 +105,6 @@ td_ta_map_lwp2thr(const td_thragent_t *t
 td_err_e
 td_ta_new(struct ps_prochandle *ph, td_thragent_t **pta)
 {
-	size_t i;
 	struct ta_ops *ops_p, **ops_pp;
 
 	SET_FOREACH(ops_pp, __ta_ops) {
@@ -244,8 +244,8 @@ td_thr_validate(const td_thrhandle_t *th
 }
 
 td_err_e
-td_thr_tls_get_addr(const td_thrhandle_t *th, void *linkmap, size_t offset,
-		    void **address)
+td_thr_tls_get_addr(const td_thrhandle_t *th, psaddr_t linkmap, size_t offset,
+    psaddr_t *address)
 {
 	const td_thragent_t *ta = th->th_ta;
 	return (ta->ta_ops->to_thr_tls_get_addr(th, linkmap, offset, address));
@@ -259,3 +259,176 @@ td_thr_sstep(const td_thrhandle_t *th, i
 	const td_thragent_t *ta = th->th_ta;
 	return (ta->ta_ops->to_thr_sstep(th, step));
 }
+
+/*
+ * Support functions for reading from and writing to the target
+ * address space.
+ */
+
+static int
+thr_pread(struct ps_prochandle *ph, psaddr_t addr, uint64_t *val,
+    u_int size, u_int byteorder)
+{
+	uint8_t buf[sizeof(*val)];
+	ps_err_e err;
+
+	if (size > sizeof(buf))
+		return (EOVERFLOW);
+
+	err = ps_pread(ph, addr, buf, size);
+	if (err != PS_OK)
+		return (EFAULT);
+
+	switch (byteorder) {
+	case BIG_ENDIAN:
+		switch (size) {
+		case 1:
+			*val = buf[0];
+			break;
+		case 2:
+			*val = be16dec(buf);
+			break;
+		case 4:
+			*val = be32dec(buf);
+			break;
+		case 8:
+			*val = be64dec(buf);
+			break;
+		default:
+			return (EINVAL);
+		}
+		break;
+	case LITTLE_ENDIAN:
+		switch (size) {
+		case 1:
+			*val = buf[0];
+			break;
+		case 2:
+			*val = le16dec(buf);
+			break;
+		case 4:
+			*val = le32dec(buf);
+			break;
+		case 8:
+			*val = le64dec(buf);
+			break;
+		default:
+			return (EINVAL);
+		}
+		break;
+	default:
+		return (EINVAL);
+	}
+
+	return (0);
+}
+
+int
+thr_pread_int(const struct td_thragent *ta, psaddr_t addr, uint32_t *val)
+{
+	uint64_t tmp;
+	int error;
+
+	error = thr_pread(ta->ph, addr, &tmp, sizeof(int), BYTE_ORDER);
+	if (!error)
+		*val = tmp;
+
+	return (error);
+}
+
+int
+thr_pread_long(const struct td_thragent *ta, psaddr_t addr, uint64_t *val)
+{
+
+	return (thr_pread(ta->ph, addr, val, sizeof(long), BYTE_ORDER));
+}
+
+int
+thr_pread_ptr(const struct td_thragent *ta, psaddr_t addr, psaddr_t *val)
+{
+	uint64_t tmp;
+	int error;
+
+	error = thr_pread(ta->ph, addr, &tmp, sizeof(void *), BYTE_ORDER);
+	if (!error)
+		*val = tmp;
+
+	return (error);
+}
+
+static int
+thr_pwrite(struct ps_prochandle *ph, psaddr_t addr, uint64_t val,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From attilio at freebsd.org  Tue Jun  9 01:12:40 2009
From: attilio at freebsd.org (Attilio Rao)
Date: Tue Jun  9 01:12:47 2009
Subject: svn commit: r193789 - in stable/7: lib/libthr lib/libthread_db 
	lib/libthread_db/arch/amd64 lib/libthread_db/arch/arm
	lib/libthread_db/arch/i386 
	lib/libthread_db/arch/ia64 lib/libthread_db/arch/powe...
In-Reply-To: <200906090047.n590lsYY050180@svn.freebsd.org>
References: <200906090047.n590lsYY050180@svn.freebsd.org>
Message-ID: <3bbf2fe10906081812i4138020bhfd774cef77a01f5f@mail.gmail.com>

2009/6/9 Dag-Erling Smorgrav :
> Author: des
> Date: Tue Jun  9 00:47:54 2009
> New Revision: 193789
> URL: http://svn.freebsd.org/changeset/base/193789
>
> Log:
>  merge r180982,r181044,r181059,r181065,r181341,r183021: WARNS cleanup,
>  add thr_pread_{int,long,ptr} and thr_pwrite_{int,long,ptr}, and change
>  definition of psaddr_t (no impact on ABI).  Discussed with marcel@, but
>  any screwups are my own.

Thanks,
I had this into my pipeline but you saved me some time.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein
From des at FreeBSD.org  Tue Jun  9 01:44:00 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Tue Jun  9 01:44:13 2009
Subject: svn commit: r193795 - stable/7/lib/libutil
Message-ID: <200906090143.n591hw1x051817@svn.freebsd.org>

Author: des
Date: Tue Jun  9 01:43:58 2009
New Revision: 193795
URL: http://svn.freebsd.org/changeset/base/193795

Log:
  merge r180815,184081-184088,184091-184094,184634,184676-184677, 185277,
  93589,193591: style and warning cleanups, libutil is now WARNS=6 clean.
  Also merged setclasscpumask(), which would have been a b***h to isolate
  from the rest of the changes.  AFAICT, nobody uses it anyway.

Modified:
  stable/7/lib/libutil/   (props changed)
  stable/7/lib/libutil/Makefile
  stable/7/lib/libutil/flopen.3
  stable/7/lib/libutil/flopen.c
  stable/7/lib/libutil/login.conf.5
  stable/7/lib/libutil/login_cap.h
  stable/7/lib/libutil/login_class.3
  stable/7/lib/libutil/login_class.c
  stable/7/lib/libutil/login_times.3
  stable/7/lib/libutil/login_times.c
  stable/7/lib/libutil/pidfile.3
  stable/7/lib/libutil/pidfile.c
  stable/7/lib/libutil/realhostname.c

Modified: stable/7/lib/libutil/Makefile
==============================================================================
--- stable/7/lib/libutil/Makefile	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/Makefile	Tue Jun  9 01:43:58 2009	(r193795)
@@ -8,7 +8,7 @@ SHLIBDIR?= /lib
 LIB=	util
 SHLIB_MAJOR= 7
 
-SRCS=	_secure_path.c auth.c gr_util.c expand_number.c flopen.c fparseln.c \
+SRCS=	_secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \
 	humanize_number.c kinfo_getfile.c kinfo_getvmmap.c kld.c \
 	login.c login_auth.c login_cap.c login_class.c \
 	login_crypt.c login_ok.c login_times.c login_tty.c logout.c \

Modified: stable/7/lib/libutil/flopen.3
==============================================================================
--- stable/7/lib/libutil/flopen.3	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/flopen.3	Tue Jun  9 01:43:58 2009	(r193795)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 10, 2007
+.Dd June 6, 2009
 .Dt FLOPEN 3
 .Os
 .Sh NAME
@@ -93,11 +93,6 @@ and
 .Xr errno 2 ,
 .Xr flock 2 ,
 .Xr open 2
-.Sh HISTORY
-The
-.Fn flopen
-function first appeared in
-.Fx 6.3 .
 .Sh AUTHORS
 .An -nosplit
 The

Modified: stable/7/lib/libutil/flopen.c
==============================================================================
--- stable/7/lib/libutil/flopen.c	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/flopen.c	Tue Jun  9 01:43:58 2009	(r193795)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007 Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 2007 Dag-Erling Coïdan Smørgrav
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
 #include 
 #include 
 
@@ -54,13 +53,13 @@ flopen(const char *path, int flags, ...)
 		va_list ap;
 
 		va_start(ap, flags);
-		mode = va_arg(ap, int); /* mode_t promoted to int */
+		mode = (mode_t)va_arg(ap, int); /* mode_t promoted to int */
 		va_end(ap);
 	}
 
-	operation = LOCK_EX;
-	if (flags & O_NONBLOCK)
-		operation |= LOCK_NB;
+        operation = LOCK_EX;
+        if (flags & O_NONBLOCK)
+                operation |= LOCK_NB;
 
 	trunc = (flags & O_TRUNC);
 	flags &= ~O_TRUNC;
@@ -72,32 +71,32 @@ flopen(const char *path, int flags, ...)
 		if (flock(fd, operation) == -1) {
 			/* unsupported or interrupted */
 			serrno = errno;
-			close(fd);
+			(void)close(fd);
 			errno = serrno;
 			return (-1);
 		}
 		if (stat(path, &sb) == -1) {
 			/* disappeared from under our feet */
-			close(fd);
+			(void)close(fd);
 			continue;
 		}
 		if (fstat(fd, &fsb) == -1) {
 			/* can't happen [tm] */
 			serrno = errno;
-			close(fd);
+			(void)close(fd);
 			errno = serrno;
 			return (-1);
 		}
 		if (sb.st_dev != fsb.st_dev ||
 		    sb.st_ino != fsb.st_ino) {
 			/* changed under our feet */
-			close(fd);
+			(void)close(fd);
 			continue;
 		}
 		if (trunc && ftruncate(fd, 0) != 0) {
 			/* can't happen [tm] */
 			serrno = errno;
-			close(fd);
+			(void)close(fd);
 			errno = serrno;
 			return (-1);
 		}

Modified: stable/7/lib/libutil/login.conf.5
==============================================================================
--- stable/7/lib/libutil/login.conf.5	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/login.conf.5	Tue Jun  9 01:43:58 2009	(r193795)
@@ -203,6 +203,15 @@ The maximum and current limits may be sp
 .It Sy "Name	Type	Notes	Description
 .It "charset	string		Set $MM_CHARSET environment variable to the specified
 value.
+.It "cpumask	string		List of cpus to bind the user to.
+The syntax is the same as for the
+.Fl l
+argument of
+.Xr cpuset 1 or the word
+.Ql default .
+If set to
+.Ql default
+no action is taken.
 .It "hushlogin	bool	false	Same as having a ~/.hushlogin file.
 .It "ignorenologin	bool	false	Login not prevented by nologin.
 .It "ftp-chroot	bool	false	Limit FTP access with

Modified: stable/7/lib/libutil/login_cap.h
==============================================================================
--- stable/7/lib/libutil/login_cap.h	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/login_cap.h	Tue Jun  9 01:43:58 2009	(r193795)
@@ -48,7 +48,8 @@
 #define LOGIN_SETUSER		0x0040		/* set user (via setuid) */
 #define LOGIN_SETENV		0x0080		/* set user environment */
 #define LOGIN_SETMAC		0x0100		/* set user default MAC label */
-#define LOGIN_SETALL		0x01ff		/* set everything */
+#define LOGIN_SETCPUMASK	0x0200		/* set user cpumask */
+#define LOGIN_SETALL		0x03ff		/* set everything */
 
 #define BI_AUTH		"authorize"		/* accepted authentication */
 #define BI_REJECT	"reject"		/* rejected authentication */
@@ -80,7 +81,7 @@ typedef struct login_time {
 #define LTM_NONE  0x00
 #define LTM_SUN   0x01
 #define LTM_MON   0x02
-#define LTM_TUE   0x04 
+#define LTM_TUE   0x04
 #define LTM_WED   0x08
 #define LTM_THU   0x10
 #define LTM_FRI   0x20
@@ -103,7 +104,8 @@ login_cap_t *login_getclass(const char *
 login_cap_t *login_getpwclass(const struct passwd *);
 login_cap_t *login_getuserclass(const struct passwd *);
 
-const char *login_getcapstr(login_cap_t*, const char *, const char *, const char *);
+const char *login_getcapstr(login_cap_t *, const char *, const char *,
+    const char *);
 const char **login_getcaplist(login_cap_t *, const char *, const char *);
 const char *login_getstyle(login_cap_t *, const char *, const char *);
 rlim_t login_getcaptime(login_cap_t *, const char *, rlim_t, rlim_t);
@@ -113,45 +115,51 @@ const char *login_getpath(login_cap_t *,
 int login_getcapbool(login_cap_t *, const char *, int);
 const char *login_setcryptfmt(login_cap_t *, const char *, const char *);
 
-int setclasscontext(const char*, unsigned int);
-int setusercontext(login_cap_t*, const struct passwd*, uid_t, unsigned int);
+int setclasscontext(const char *, unsigned int);
+void setclasscpumask(login_cap_t *);
+int setusercontext(login_cap_t *, const struct passwd *, uid_t, unsigned int);
 void setclassresources(login_cap_t *);
 void setclassenvironment(login_cap_t *, const struct passwd *, int);
 
 /* Most of these functions are deprecated */
-int auth_approve(login_cap_t*, const char*, const char*);
+int auth_approve(login_cap_t *, const char *, const char *);
 int auth_check(const char *, const char *, const char *, const char *, int *);
 void auth_env(void);
-char *auth_mkvalue(const char *n);
-int auth_response(const char *, const char *, const char *, const char *, int *, const char *, const char *);
+char *auth_mkvalue(const char *);
+int auth_response(const char *, const char *, const char *, const char *, int *,
+    const char *, const char *);
 void auth_rmfiles(void);
 int auth_scan(int);
-int auth_script(const char*, ...);
+int auth_script(const char *, ...);
 int auth_script_data(const char *, int, const char *, ...);
 char *auth_valud(const char *);
 int auth_setopt(const char *, const char *);
 void auth_clropts(void);
 
-void auth_checknologin(login_cap_t*);
-int auth_cat(const char*);
+void auth_checknologin(login_cap_t *);
+int auth_cat(const char *);
 
-int auth_ttyok(login_cap_t*, const char *);
-int auth_hostok(login_cap_t*, const char *, char const *);
-int auth_timeok(login_cap_t*, time_t);
+int auth_ttyok(login_cap_t *, const char *);
+int auth_hostok(login_cap_t *, const char *, char const *);
+int auth_timeok(login_cap_t *, time_t);
 
 struct tm;
 
 login_time_t parse_lt(const char *);
+int in_lt(const login_time_t *, time_t *);
 int in_ltm(const login_time_t *, struct tm *, time_t *);
 int in_ltms(const login_time_t *, struct tm *, time_t *);
+int in_lts(const login_time_t *, time_t *);
 
 /* helper functions */
 
 int login_strinlist(const char **, char const *, int);
 int login_str2inlist(const char **, const char *, const char *, int);
-login_time_t * login_timelist(login_cap_t *, char const *, int *, login_time_t **);
+login_time_t * login_timelist(login_cap_t *, char const *, int *,
+    login_time_t **);
 int login_ttyok(login_cap_t *, const char *, const char *, const char *);
-int login_hostok(login_cap_t *, const char *, const char *, const char *, const char *);
+int login_hostok(login_cap_t *, const char *, const char *, const char *,
+    const char *);
 
 __END_DECLS
 

Modified: stable/7/lib/libutil/login_class.3
==============================================================================
--- stable/7/lib/libutil/login_class.3	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/login_class.3	Tue Jun  9 01:43:58 2009	(r193795)
@@ -19,11 +19,12 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 28, 1996
+.Dd October 20, 2008
 .Os
 .Dt LOGIN_CLASS 3
 .Sh NAME
 .Nm setclasscontext ,
+.Nm setclasscpumask ,
 .Nm setclassenvironment ,
 .Nm setclassresources ,
 .Nm setusercontext
@@ -35,12 +36,14 @@
 .In login_cap.h
 .Ft int
 .Fn setclasscontext "const char *classname" "unsigned int flags"
-.Ft int
-.Fn setusercontext "login_cap_t *lc" "const struct passwd *pwd" "uid_t uid" "unsigned int flags"
 .Ft void
-.Fn setclassresources "login_cap_t *lc"
+.Fn setclasscpumask "login_cap_t *lc"
 .Ft void
 .Fn setclassenvironment "login_cap_t *lc" "const struct passwd *pwd" "int paths"
+.Ft void
+.Fn setclassresources "login_cap_t *lc"
+.Ft int
+.Fn setusercontext "login_cap_t *lc" "const struct passwd *pwd" "uid_t uid" "unsigned int flags"
 .Sh DESCRIPTION
 These functions provide a higher level interface to the login class
 database than those documented in
@@ -155,6 +158,18 @@ capability "setenv=var1 val1,var2 val2..
 Set the MAC label for the current process to the label specified
 in system login class database.
 .Pp
+.It LOGIN_SETCPUMASK
+Create a new
+.Xr cpuset 2
+and set the cpu affinity to the specified mask.
+The string may contain a comma separated list of numbers and/or number
+ranges as handled by the
+.Xr cpuset 1
+utility or the case-insensitive string
+.Ql default .
+If the string is
+.Ql default
+no action will be taken.
 .It LOGIN_SETALL
 Enables all of the above settings.
 .El
@@ -170,6 +185,7 @@ are substituted for the user's home dire
 respectively.
 .Pp
 The
+.Fn setclasscpumask ,
 .Fn setclassresources
 and
 .Fn setclassenvironment
@@ -186,6 +202,8 @@ or resources, a message is reported to
 .Xr syslog 3 ,
 with LOG_ERR priority and directed to the currently active facility.
 .Sh SEE ALSO
+.Xr cpuset 1 ,
+.Xr cpuset 2 ,
 .Xr setgid 2 ,
 .Xr setlogin 2 ,
 .Xr setuid 2 ,

Modified: stable/7/lib/libutil/login_class.c
==============================================================================
--- stable/7/lib/libutil/login_class.c	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/login_class.c	Tue Jun  9 01:43:58 2009	(r193795)
@@ -25,12 +25,16 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
+#include 
 #include 
+#include 
+#include 
+
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -89,7 +93,7 @@ setclassresources(login_cap_t *lc)
 	if (getrlimit(lr->why, &rlim) != 0)
 	    syslog(LOG_ERR, "getting %s resource limit: %m", lr->what);
 	else {
-	    char  	name_cur[40];
+	    char	name_cur[40];
 	    char	name_max[40];
 	    rlim_t	rcur = rlim.rlim_cur;
 	    rlim_t	rmax = rlim.rlim_max;
@@ -101,7 +105,7 @@ setclassresources(login_cap_t *lc)
 	    rmax = (*lr->who)(lc, lr->what, rmax, rmax);
 	    rlim.rlim_cur = (*lr->who)(lc, name_cur, rcur, rcur);
 	    rlim.rlim_max = (*lr->who)(lc, name_max, rmax, rmax);
-    
+
 	    if (setrlimit(lr->why, &rlim) == -1)
 		syslog(LOG_WARNING, "set class '%s' resource limit %s: %m", lc->lc_class, lr->what);
 	}
@@ -181,7 +185,7 @@ substvar(const char * var, const struct 
 	}
     }
 
-    return np;
+    return (np);
 }
 
 
@@ -238,6 +242,108 @@ setclassenvironment(login_cap_t *lc, con
 }
 
 
+static int
+list2cpuset(const char *list, cpuset_t *mask)
+{
+	enum { NONE, NUM, DASH } state;
+	int lastnum;
+	int curnum;
+	const char *l;
+
+	state = NONE;
+	curnum = lastnum = 0;
+	for (l = list; *l != '\0';) {
+		if (isdigit(*l)) {
+			curnum = atoi(l);
+			if (curnum > CPU_SETSIZE)
+				errx(EXIT_FAILURE,
+				    "Only %d cpus supported", CPU_SETSIZE);
+			while (isdigit(*l))
+				l++;
+			switch (state) {
+			case NONE:
+				lastnum = curnum;
+				state = NUM;
+				break;
+			case DASH:
+				for (; lastnum <= curnum; lastnum++)
+					CPU_SET(lastnum, mask);
+				state = NONE;
+				break;
+			case NUM:
+			default:
+				return (0);
+			}
+			continue;
+		}
+		switch (*l) {
+		case ',':
+			switch (state) {
+			case NONE:
+				break;
+			case NUM:
+				CPU_SET(curnum, mask);
+				state = NONE;
+				break;
+			case DASH:
+				return (0);
+				break;
+			}
+			break;
+		case '-':
+			if (state != NUM)
+				return (0);
+			state = DASH;
+			break;
+		default:
+			return (0);
+		}
+		l++;
+	}
+	switch (state) {
+		case NONE:
+			break;
+		case NUM:
+			CPU_SET(curnum, mask);
+			break;
+		case DASH:
+			return (0);
+	}
+	return (1);
+}
+
+
+void
+setclasscpumask(login_cap_t *lc)
+{
+	const char *maskstr;
+	cpuset_t maskset;
+	cpusetid_t setid;
+
+	maskstr = login_getcapstr(lc, "cpumask", NULL, NULL);
+	CPU_ZERO(&maskset);
+	if (maskstr == NULL)
+		return;
+	if (strcasecmp("default", maskstr) == 0)
+		return;
+	if (!list2cpuset(maskstr, &maskset)) {
+		syslog(LOG_WARNING,
+		    "list2cpuset(%s) invalid mask specification", maskstr);
+		return;
+	}
+
+	if (cpuset(&setid) != 0) {
+		syslog(LOG_ERR, "cpuset(): %s", strerror(errno));
+		return;
+	}
+
+	if (cpuset_setaffinity(CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1,
+	    sizeof(maskset), &maskset) != 0)
+		syslog(LOG_ERR, "cpuset_setaffinity(%s): %s", maskstr,
+		    strerror(errno));
+}
+
+
 /*
  * setclasscontext()
  *
@@ -262,7 +368,7 @@ setclasscontext(const char *classname, u
 
     rc = lc ? setusercontext(lc, NULL, 0, flags) : -1;
     login_close(lc);
-    return rc;
+    return (rc);
 }
 
 
@@ -288,8 +394,11 @@ setlogincontext(login_cap_t *lc, const s
 	/* Set environment */
 	if (flags & LOGIN_SETENV)
 	    setclassenvironment(lc, pwd, 0);
+	/* Set cpu affinity */
+	if (flags & LOGIN_SETCPUMASK)
+	    setclasscpumask(lc);
     }
-    return mymask;
+    return (mymask);
 }
 
 
@@ -359,13 +468,13 @@ setusercontext(login_cap_t *lc, const st
 	if (setgid(pwd->pw_gid) != 0) {
 	    syslog(LOG_ERR, "setgid(%lu): %m", (u_long)pwd->pw_gid);
 	    login_close(llc);
-	    return -1;
+	    return (-1);
 	}
 	if (initgroups(pwd->pw_name, pwd->pw_gid) == -1) {
 	    syslog(LOG_ERR, "initgroups(%s,%lu): %m", pwd->pw_name,
 		   (u_long)pwd->pw_gid);
 	    login_close(llc);
-	    return -1;
+	    return (-1);
 	}
     }
 
@@ -379,7 +488,7 @@ setusercontext(login_cap_t *lc, const st
 	    if (mac_from_text(&label, label_string) == -1) {
 		syslog(LOG_ERR, "mac_from_text('%s') for %s: %m",
 		    pwd->pw_name, label_string);
-		    return -1;
+		return (-1);
 	    }
 	    if (mac_set_proc(label) == -1)
 		error = errno;
@@ -389,7 +498,7 @@ setusercontext(login_cap_t *lc, const st
 	    if (error != 0) {
 		syslog(LOG_ERR, "mac_set_proc('%s') for %s: %s",
 		    label_string, pwd->pw_name, strerror(error));
-		return -1;
+		return (-1);
 	    }
 	}
     }
@@ -398,7 +507,7 @@ setusercontext(login_cap_t *lc, const st
     if ((flags & LOGIN_SETLOGIN) && setlogin(pwd->pw_name) != 0) {
 	syslog(LOG_ERR, "setlogin(%s): %m", pwd->pw_name);
 	login_close(llc);
-	return -1;
+	return (-1);
     }
 
     mymask = (flags & LOGIN_SETUMASK) ? umask(LOGIN_DEFUMASK) : 0;
@@ -408,7 +517,7 @@ setusercontext(login_cap_t *lc, const st
     /* This needs to be done after anything that needs root privs */
     if ((flags & LOGIN_SETUSER) && setuid(uid) != 0) {
 	syslog(LOG_ERR, "setuid(%lu): %m", (u_long)uid);
-	return -1;	/* Paranoia again */
+	return (-1);	/* Paranoia again */
     }
 
     /*
@@ -423,6 +532,5 @@ setusercontext(login_cap_t *lc, const st
     if (flags & LOGIN_SETUMASK)
 	umask(mymask);
 
-    return 0;
+    return (0);
 }
-

Modified: stable/7/lib/libutil/login_times.3
==============================================================================
--- stable/7/lib/libutil/login_times.3	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/login_times.3	Tue Jun  9 01:43:58 2009	(r193795)
@@ -19,13 +19,15 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 2, 1997
+.Dd October 20, 2008
 .Os
 .Dt LOGIN_TIMES 3
 .Sh NAME
 .Nm parse_lt ,
+.Nm in_lt ,
 .Nm in_ltm ,
-.Nm in_ltms
+.Nm in_ltms ,
+.Nm in_lts
 .Nd functions for parsing and checking login time periods
 .Sh LIBRARY
 .Lb libutil
@@ -36,9 +38,13 @@
 .Ft login_time_t
 .Fn parse_lt "const char *str"
 .Ft int
+.Fn in_lt "const login_time_t *lt" "time_t *ends"
+.Ft int
 .Fn in_ltm "const login_time_t *lt" "struct tm *t" "time_t *ends"
 .Ft int
 .Fn in_ltms "const login_time_t *lt" "struct tm *t" "time_t *ends"
+.Ft int
+.Fn in_lts "const login_time_t *lt" "time_t *ends"
 .Sh DESCRIPTION
 This set of functions may be used for parsing and checking login and
 session times against a predefined list of allowed login times as
@@ -135,6 +141,18 @@ elements in length, and terminated by an
 .Ar lt_dow
 field set to
 .Em LTM_NONE .
+.Pp
+The
+.Fn in_lt
+and
+.Fn in_lts
+functions are equivalent to
+.Fn in_ltm
+and
+.Fn in_ltms ,
+respectively, with the second argument set to the current time as
+returned by
+.Xr localtime 3 .
 .Sh RETURN VALUES
 The
 .Fn parse_lt

Modified: stable/7/lib/libutil/login_times.c
==============================================================================
--- stable/7/lib/libutil/login_times.c	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/login_times.c	Tue Jun  9 01:43:58 2009	(r193795)
@@ -34,13 +34,13 @@ __FBSDID("$FreeBSD$");
 static struct
 {
     const char	*dw;
-    u_char      cn;
-    u_char      fl;
+    u_char       cn;
+    u_char       fl;
 } dws[] =
 {
     { "su", 2, LTM_SUN }, { "mo", 2, LTM_MON }, { "tu", 2, LTM_TUE },
     { "we", 2, LTM_WED }, { "th", 2, LTM_THU }, { "fr", 2, LTM_FRI },
-    { "sa", 2, LTM_SAT }, { "any",3, LTM_ANY }, { "all",3, LTM_ANY }, 
+    { "sa", 2, LTM_SAT }, { "any",3, LTM_ANY }, { "all",3, LTM_ANY },
     { "wk", 2, LTM_WK  }, { "wd", 2, LTM_WD  }, { NULL, 0, 0       }
 };
 
@@ -54,28 +54,28 @@ parse_time(char * ptr, u_short * t)
 
     *t = (u_short)((val / 100) * 60 + (val % 100));
 
-    return ptr;
+    return (ptr);
 }
 
 
 login_time_t
-parse_lt(const char * str)
+parse_lt(const char *str)
 {
     login_time_t    t;
 
     memset(&t, 0, sizeof t);
     t.lt_dow = LTM_NONE;
     if (str && *str && strcmp(str, "Never") != 0 && strcmp(str, "None") != 0) {
-	int		i;
-	login_time_t	m = t;
+	int		 i;
+	login_time_t	 m = t;
 	char		*p;
-	char		buf[64];
+	char		 buf[64];
 
 	/* Make local copy and force lowercase to simplify parsing */
-	p = strncpy(buf, str, sizeof buf);
-	buf[sizeof buf - 1] = '\0';
+	strlcpy(buf, str, sizeof buf);
 	for (i = 0; buf[i]; i++)
 	    buf[i] = (char)tolower(buf[i]);
+	p = buf;
 
 	while (isalpha(*p)) {
 
@@ -102,12 +102,12 @@ parse_lt(const char * str)
 
 	t = m;
     }
-    return t;
+    return (t);
 }
 
 
 int
-in_ltm(const login_time_t * ltm, struct tm * tt, time_t * ends)
+in_ltm(const login_time_t *ltm, struct tm *tt, time_t *ends)
 {
     int	    rc = 0;
 
@@ -130,32 +130,33 @@ in_ltm(const login_time_t * ltm, struct 
 	    }
 	}
     }
-    return rc;
+    return (rc);
 }
 
 
 int
-in_lt(const login_time_t * ltm, time_t * t)
+in_lt(const login_time_t *ltm, time_t *t)
 {
-    return in_ltm(ltm, localtime(t), t);
+
+    return (in_ltm(ltm, localtime(t), t));
 }
 
 int
-in_ltms(const login_time_t * ltm, struct tm * tm, time_t * t)
+in_ltms(const login_time_t *ltm, struct tm *tm, time_t *t)
 {
     int	    i = 0;
 
     while (i < LC_MAXTIMES && ltm[i].lt_dow != LTM_NONE) {
 	if (in_ltm(ltm + i, tm, t))
-	    return i;
+	    return (i);
 	i++;
     }
-    return -1;
+    return (-1);
 }
 
 int
-in_lts(const login_time_t * ltm, time_t * t)
+in_lts(const login_time_t *ltm, time_t *t)
 {
-    return in_ltms(ltm, localtime(t), t);
-}
 
+    return (in_ltms(ltm, localtime(t), t));
+}

Modified: stable/7/lib/libutil/pidfile.3
==============================================================================
--- stable/7/lib/libutil/pidfile.3	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/pidfile.3	Tue Jun  9 01:43:58 2009	(r193795)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 22, 2005
+.Dd October 20, 2008
 .Dt PIDFILE 3
 .Os
 .Sh NAME
@@ -51,16 +51,14 @@ The
 .Nm pidfile
 family of functions allows daemons to handle PID files.
 It uses
-.Xr flock 2
+.Xr flopen 3
 to lock a pidfile and detect already running daemons.
 .Pp
 The
 .Fn pidfile_open
 function opens (or creates) a file specified by the
 .Fa path
-argument and locks it with the
-.Xr flock 2
-system call.
+argument and locks it.
 If a file can not be locked, a PID of an already running daemon is returned in
 the
 .Fa pidptr
@@ -102,6 +100,7 @@ if an error occurs.
 If an error occurs,
 .Va errno
 will be set.
+.Pp
 .Rv -std pidfile_write pidfile_close pidfile_remove
 .Sh EXAMPLES
 The following example shows in which order these functions should be used.
@@ -233,16 +232,17 @@ function may also fail and set
 .Va errno
 for any errors specified for the
 .Xr close 2 ,
-.Xr flock 2 ,
 .Xr fstat 2 ,
 .Xr write 2 ,
 and
 .Xr unlink 2
-calls.
+system calls and the
+.Xr flopen 3
+library function.
 .Sh SEE ALSO
-.Xr flock 2 ,
 .Xr open 2 ,
-.Xr daemon 3
+.Xr daemon 3 ,
+.Xr flopen 3
 .Sh AUTHORS
 .An -nosplit
 The

Modified: stable/7/lib/libutil/pidfile.c
==============================================================================
--- stable/7/lib/libutil/pidfile.c	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/pidfile.c	Tue Jun  9 01:43:58 2009	(r193795)
@@ -231,10 +231,6 @@ _pidfile_remove(struct pidfh *pfh, int f
 
 	if (unlink(pfh->pf_path) == -1)
 		error = errno;
-	if (flock(pfh->pf_fd, LOCK_UN) == -1) {
-		if (error == 0)
-			error = errno;
-	}
 	if (close(pfh->pf_fd) == -1) {
 		if (error == 0)
 			error = errno;

Modified: stable/7/lib/libutil/realhostname.c
==============================================================================
--- stable/7/lib/libutil/realhostname.c	Tue Jun  9 01:41:45 2009	(r193794)
+++ stable/7/lib/libutil/realhostname.c	Tue Jun  9 01:43:58 2009	(r193795)
@@ -101,7 +101,9 @@ realhostname_sa(char *host, size_t hsize
 {
 	int result, error;
 	char buf[NI_MAXHOST];
+#ifdef INET6
 	struct sockaddr_in lsin;
+#endif
 
 	result = HOSTNAME_INVALIDADDR;
 
From des at des.no  Tue Jun  9 01:46:00 2009
From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=)
Date: Tue Jun  9 01:46:12 2009
Subject: svn commit: r193789 - in stable/7: lib/libthr lib/libthread_db
	lib/libthread_db/arch/amd64 lib/libthread_db/arch/arm
	lib/libthread_db/arch/i386 lib/libthread_db/arch/ia64
	lib/libthread_db/arch/powe...
In-Reply-To: <3bbf2fe10906081812i4138020bhfd774cef77a01f5f@mail.gmail.com>
	(Attilio Rao's message of "Tue, 9 Jun 2009 03:12:37 +0200")
References: <200906090047.n590lsYY050180@svn.freebsd.org>
	<3bbf2fe10906081812i4138020bhfd774cef77a01f5f@mail.gmail.com>
Message-ID: <86vdn66uy1.fsf@ds4.des.no>

Attilio Rao  writes:
> Thanks,
> I had this into my pipeline but you saved me some time.

You're welcome.  I'm trying to get 7 to build with -Werror again :)

DES
-- 
Dag-Erling Sm?rgrav - des@des.no
From bms at incunabulum.net  Tue Jun  9 10:40:43 2009
From: bms at incunabulum.net (Bruce Simpson)
Date: Tue Jun  9 10:40:54 2009
Subject: svn commit: r192033 - stable/7/sys/dev/ata
In-Reply-To: <200906081050.41020.jhb@freebsd.org>
References: <200905130255.n4D2tMQZ040010@svn.freebsd.org>
	<4A109662.9060909@FreeBSD.org> <4A10A324.5040501@incunabulum.net>
	<200906081050.41020.jhb@freebsd.org>
Message-ID: <4A2E3C26.9040903@incunabulum.net>

John,

John Baldwin wrote:
> Were you ever able to test http://www.FreeBSD.org/~jhb/patches/ata_ali.patch?
>
>   

Fraid not, thanks for the reminder... I have been sidetracked...

Unfortunately that patch doesn't seem to be there now, and I didn't have 
a copy downloaded.
I can try to make time now that MLDv2 is checked in it will be easier, 
although I would have to test HEAD from a USB key.

As far as I know the regression / panic still happens in 7.2 -- I nearly 
did an 'installkernel' on that box w/o thinking...

thanks,
BMS

From des at FreeBSD.org  Tue Jun  9 12:39:18 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Tue Jun  9 12:39:35 2009
Subject: svn commit: r193827 - stable/7/lib/libthread_db
Message-ID: <200906091239.n59CdHwj071383@svn.freebsd.org>

Author: des
Date: Tue Jun  9 12:39:17 2009
New Revision: 193827
URL: http://svn.freebsd.org/changeset/base/193827

Log:
  merge r181651, r193826: avoid writing an int to a char *.

Modified:
  stable/7/lib/libthread_db/   (props changed)
  stable/7/lib/libthread_db/libthr_db.c

Modified: stable/7/lib/libthread_db/libthr_db.c
==============================================================================
--- stable/7/lib/libthread_db/libthr_db.c	Tue Jun  9 12:32:10 2009	(r193826)
+++ stable/7/lib/libthread_db/libthr_db.c	Tue Jun  9 12:39:17 2009	(r193827)
@@ -457,6 +457,7 @@ pt_thr_get_info(const td_thrhandle_t *th
 {
 	const td_thragent_t *ta = th->th_ta;
 	struct ptrace_lwpinfo linfo;
+	int traceme;
 	int state;
 	int ret;
 
@@ -470,7 +471,8 @@ pt_thr_get_info(const td_thrhandle_t *th
 	if (ret != 0)
 		return (TD_ERR);
 	ret = thr_pread_int(ta, th->th_thread + ta->thread_off_report_events,
-	    &info->ti_traceme);
+	    &traceme);
+	info->ti_traceme = traceme;
 	if (ret != 0)
 		return (TD_ERR);
 	ret = ps_pread(ta->ph, th->th_thread + ta->thread_off_event_mask,
From jhb at freebsd.org  Tue Jun  9 13:49:43 2009
From: jhb at freebsd.org (John Baldwin)
Date: Tue Jun  9 13:50:07 2009
Subject: svn commit: r192033 - stable/7/sys/dev/ata
In-Reply-To: <4A2E3C26.9040903@incunabulum.net>
References: <200905130255.n4D2tMQZ040010@svn.freebsd.org>
	<200906081050.41020.jhb@freebsd.org>
	<4A2E3C26.9040903@incunabulum.net>
Message-ID: <200906090946.46103.jhb@freebsd.org>

On Tuesday 09 June 2009 6:40:38 am Bruce Simpson wrote:
> John,
> 
> John Baldwin wrote:
> > Were you ever able to test 
http://www.FreeBSD.org/~jhb/patches/ata_ali.patch?
> >
> >   
> 
> Fraid not, thanks for the reminder... I have been sidetracked...
> 
> Unfortunately that patch doesn't seem to be there now, and I didn't have 
> a copy downloaded.
> I can try to make time now that MLDv2 is checked in it will be easier, 
> although I would have to test HEAD from a USB key.

Ok, I've uploaded the patch, I must have just sent it inline before.

> As far as I know the regression / panic still happens in 7.2 -- I nearly 
> did an 'installkernel' on that box w/o thinking...

Yes.  The same patch will apply to 7-stable though it will have to be applied 
to ata-chipset.c instead.

-- 
John Baldwin
From des at FreeBSD.org  Tue Jun  9 14:07:31 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Tue Jun  9 14:09:14 2009
Subject: svn commit: r193831 - stable/7/bin/sh
Message-ID: <200906091407.n59E7UHT073381@svn.freebsd.org>

Author: des
Date: Tue Jun  9 14:07:29 2009
New Revision: 193831
URL: http://svn.freebsd.org/changeset/base/193831

Log:
  merge r173718: reduce WARNS due to too many "variable might be clobbered
  by longjmp" false positives.

Modified:
  stable/7/bin/sh/   (props changed)
  stable/7/bin/sh/Makefile

Modified: stable/7/bin/sh/Makefile
==============================================================================
--- stable/7/bin/sh/Makefile	Tue Jun  9 13:50:16 2009	(r193830)
+++ stable/7/bin/sh/Makefile	Tue Jun  9 14:07:29 2009	(r193831)
@@ -22,7 +22,7 @@ LFLAGS= -8	# 8-bit lex scanner for arith
 CFLAGS+=-DSHELL -I. -I${.CURDIR}
 # for debug:
 # CFLAGS+= -g -DDEBUG=2
-WARNS?=	3
+WARNS?=	2
 WFORMAT=0
 
 .PATH:	${.CURDIR}/bltin \
From des at FreeBSD.org  Tue Jun  9 15:09:15 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Tue Jun  9 15:09:23 2009
Subject: svn commit: r193835 - in stable/7/lib/libkse: . arch/amd64/include
	arch/arm/include arch/i386/include arch/ia64/include
	arch/powerpc/include arch/sparc64/include sys thread
Message-ID: <200906091509.n59F9ASo075357@svn.freebsd.org>

Author: des
Date: Tue Jun  9 15:09:10 2009
New Revision: 193835
URL: http://svn.freebsd.org/changeset/base/193835

Log:
  merge r174111, r174112, r174335: style and warning fixes.  The functional
  parts of these commits have already been merged.

Modified:
  stable/7/lib/libkse/   (props changed)
  stable/7/lib/libkse/Makefile
  stable/7/lib/libkse/arch/amd64/include/atomic_ops.h
  stable/7/lib/libkse/arch/amd64/include/pthread_md.h
  stable/7/lib/libkse/arch/arm/include/atomic_ops.h
  stable/7/lib/libkse/arch/i386/include/atomic_ops.h
  stable/7/lib/libkse/arch/i386/include/pthread_md.h
  stable/7/lib/libkse/arch/ia64/include/atomic_ops.h
  stable/7/lib/libkse/arch/powerpc/include/atomic_ops.h
  stable/7/lib/libkse/arch/powerpc/include/pthread_md.h
  stable/7/lib/libkse/arch/sparc64/include/atomic_ops.h
  stable/7/lib/libkse/arch/sparc64/include/pthread_md.h
  stable/7/lib/libkse/sys/lock.c
  stable/7/lib/libkse/sys/thr_error.c
  stable/7/lib/libkse/thread/thr_accept.c
  stable/7/lib/libkse/thread/thr_aio_suspend.c
  stable/7/lib/libkse/thread/thr_atfork.c
  stable/7/lib/libkse/thread/thr_attr_destroy.c
  stable/7/lib/libkse/thread/thr_attr_get_np.c
  stable/7/lib/libkse/thread/thr_attr_getdetachstate.c
  stable/7/lib/libkse/thread/thr_attr_getguardsize.c
  stable/7/lib/libkse/thread/thr_attr_getinheritsched.c
  stable/7/lib/libkse/thread/thr_attr_getschedparam.c
  stable/7/lib/libkse/thread/thr_attr_getschedpolicy.c
  stable/7/lib/libkse/thread/thr_attr_getscope.c
  stable/7/lib/libkse/thread/thr_attr_getstack.c
  stable/7/lib/libkse/thread/thr_attr_getstackaddr.c
  stable/7/lib/libkse/thread/thr_attr_getstacksize.c
  stable/7/lib/libkse/thread/thr_attr_init.c
  stable/7/lib/libkse/thread/thr_attr_setcreatesuspend_np.c
  stable/7/lib/libkse/thread/thr_attr_setdetachstate.c
  stable/7/lib/libkse/thread/thr_attr_setguardsize.c
  stable/7/lib/libkse/thread/thr_attr_setinheritsched.c
  stable/7/lib/libkse/thread/thr_attr_setschedparam.c
  stable/7/lib/libkse/thread/thr_attr_setschedpolicy.c
  stable/7/lib/libkse/thread/thr_attr_setscope.c
  stable/7/lib/libkse/thread/thr_attr_setstack.c
  stable/7/lib/libkse/thread/thr_attr_setstackaddr.c
  stable/7/lib/libkse/thread/thr_attr_setstacksize.c
  stable/7/lib/libkse/thread/thr_barrier.c
  stable/7/lib/libkse/thread/thr_barrierattr.c
  stable/7/lib/libkse/thread/thr_cancel.c
  stable/7/lib/libkse/thread/thr_clean.c
  stable/7/lib/libkse/thread/thr_close.c
  stable/7/lib/libkse/thread/thr_concurrency.c
  stable/7/lib/libkse/thread/thr_cond.c
  stable/7/lib/libkse/thread/thr_condattr_destroy.c
  stable/7/lib/libkse/thread/thr_condattr_init.c
  stable/7/lib/libkse/thread/thr_condattr_pshared.c
  stable/7/lib/libkse/thread/thr_connect.c
  stable/7/lib/libkse/thread/thr_creat.c
  stable/7/lib/libkse/thread/thr_create.c
  stable/7/lib/libkse/thread/thr_detach.c
  stable/7/lib/libkse/thread/thr_equal.c
  stable/7/lib/libkse/thread/thr_execve.c
  stable/7/lib/libkse/thread/thr_exit.c
  stable/7/lib/libkse/thread/thr_fcntl.c
  stable/7/lib/libkse/thread/thr_find_thread.c
  stable/7/lib/libkse/thread/thr_fork.c
  stable/7/lib/libkse/thread/thr_fsync.c
  stable/7/lib/libkse/thread/thr_getschedparam.c
  stable/7/lib/libkse/thread/thr_info.c
  stable/7/lib/libkse/thread/thr_init.c
  stable/7/lib/libkse/thread/thr_join.c
  stable/7/lib/libkse/thread/thr_kern.c
  stable/7/lib/libkse/thread/thr_kill.c
  stable/7/lib/libkse/thread/thr_main_np.c
  stable/7/lib/libkse/thread/thr_mattr_init.c
  stable/7/lib/libkse/thread/thr_mattr_kind_np.c
  stable/7/lib/libkse/thread/thr_mattr_pshared.c
  stable/7/lib/libkse/thread/thr_msync.c
  stable/7/lib/libkse/thread/thr_multi_np.c
  stable/7/lib/libkse/thread/thr_mutex.c
  stable/7/lib/libkse/thread/thr_mutex_prioceiling.c
  stable/7/lib/libkse/thread/thr_mutex_protocol.c
  stable/7/lib/libkse/thread/thr_mutexattr_destroy.c
  stable/7/lib/libkse/thread/thr_nanosleep.c
  stable/7/lib/libkse/thread/thr_once.c
  stable/7/lib/libkse/thread/thr_open.c
  stable/7/lib/libkse/thread/thr_pause.c
  stable/7/lib/libkse/thread/thr_poll.c
  stable/7/lib/libkse/thread/thr_priority_queue.c
  stable/7/lib/libkse/thread/thr_private.h
  stable/7/lib/libkse/thread/thr_pselect.c
  stable/7/lib/libkse/thread/thr_pspinlock.c
  stable/7/lib/libkse/thread/thr_raise.c
  stable/7/lib/libkse/thread/thr_read.c
  stable/7/lib/libkse/thread/thr_readv.c
  stable/7/lib/libkse/thread/thr_resume_np.c
  stable/7/lib/libkse/thread/thr_rtld.c
  stable/7/lib/libkse/thread/thr_rwlock.c
  stable/7/lib/libkse/thread/thr_rwlockattr.c
  stable/7/lib/libkse/thread/thr_select.c
  stable/7/lib/libkse/thread/thr_self.c
  stable/7/lib/libkse/thread/thr_seterrno.c
  stable/7/lib/libkse/thread/thr_setprio.c
  stable/7/lib/libkse/thread/thr_setschedparam.c
  stable/7/lib/libkse/thread/thr_sig.c
  stable/7/lib/libkse/thread/thr_sigaction.c
  stable/7/lib/libkse/thread/thr_sigaltstack.c
  stable/7/lib/libkse/thread/thr_sigmask.c
  stable/7/lib/libkse/thread/thr_sigpending.c
  stable/7/lib/libkse/thread/thr_sigprocmask.c
  stable/7/lib/libkse/thread/thr_sigsuspend.c
  stable/7/lib/libkse/thread/thr_sigwait.c
  stable/7/lib/libkse/thread/thr_single_np.c
  stable/7/lib/libkse/thread/thr_sleep.c
  stable/7/lib/libkse/thread/thr_spec.c
  stable/7/lib/libkse/thread/thr_spinlock.c
  stable/7/lib/libkse/thread/thr_stack.c
  stable/7/lib/libkse/thread/thr_suspend_np.c
  stable/7/lib/libkse/thread/thr_switch_np.c
  stable/7/lib/libkse/thread/thr_symbols.c
  stable/7/lib/libkse/thread/thr_system.c
  stable/7/lib/libkse/thread/thr_tcdrain.c
  stable/7/lib/libkse/thread/thr_vfork.c
  stable/7/lib/libkse/thread/thr_wait.c
  stable/7/lib/libkse/thread/thr_wait4.c
  stable/7/lib/libkse/thread/thr_waitpid.c
  stable/7/lib/libkse/thread/thr_write.c
  stable/7/lib/libkse/thread/thr_writev.c
  stable/7/lib/libkse/thread/thr_yield.c

Modified: stable/7/lib/libkse/Makefile
==============================================================================
--- stable/7/lib/libkse/Makefile	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/Makefile	Tue Jun  9 15:09:10 2009	(r193835)
@@ -32,7 +32,7 @@ CFLAGS+=-fno-builtin
 # Uncomment this if you want libkse to contain debug information for
 # thread locking.
 CFLAGS+=-D_LOCK_DEBUG
-WARNS?=2
+WARNS?=3
 
 # Uncomment this if you want to build a 1:1 threading mode library
 # however it is no longer strictly conformed to POSIX

Modified: stable/7/lib/libkse/arch/amd64/include/atomic_ops.h
==============================================================================
--- stable/7/lib/libkse/arch/amd64/include/atomic_ops.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/amd64/include/atomic_ops.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -36,7 +36,7 @@
  * void atomic_swap64(intptr_t *dst, intptr_t val, intptr_t *res);
  */
 static inline void
-atomic_swap64(intptr_t *dst, intptr_t val, intptr_t *res)
+atomic_swap64(volatile intptr_t *dst, intptr_t val, intptr_t *res)
 {
 	__asm __volatile(
 	"xchgq %2, %1; movq %2, %0"
@@ -44,7 +44,7 @@ atomic_swap64(intptr_t *dst, intptr_t va
 }
 
 static inline void
-atomic_swap_int(int *dst, int val, int *res)
+atomic_swap_int(volatile int *dst, int val, int *res)
 {
 	__asm __volatile(
 	"xchgl %2, %1; movl %2, %0"
@@ -52,6 +52,6 @@ atomic_swap_int(int *dst, int val, int *
 }
 
 #define	atomic_swap_ptr(d, v, r) \
-	atomic_swap64((intptr_t *)(d), (intptr_t)(v), (intptr_t *)(r))
+	atomic_swap64((volatile intptr_t *)(d), (intptr_t)(v), (intptr_t *)(r))
 
 #endif

Modified: stable/7/lib/libkse/arch/amd64/include/pthread_md.h
==============================================================================
--- stable/7/lib/libkse/arch/amd64/include/pthread_md.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/amd64/include/pthread_md.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -250,7 +250,7 @@ _thread_switch(struct kcb *kcb, struct t
 			_amd64_restore_context(
 				&tcb->tcb_tmbx.tm_context.uc_mcontext,
 				(intptr_t)&tcb->tcb_tmbx,
-				(intptr_t *)&kcb->kcb_kmbx.km_curthread);
+				(intptr_t *)(void *)&kcb->kcb_kmbx.km_curthread);
 		else
 			_amd64_restore_context(
 				&tcb->tcb_tmbx.tm_context.uc_mcontext,

Modified: stable/7/lib/libkse/arch/arm/include/atomic_ops.h
==============================================================================
--- stable/7/lib/libkse/arch/arm/include/atomic_ops.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/arm/include/atomic_ops.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -39,15 +39,15 @@
  * void atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res);
  */
 static inline void
-atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res)
+atomic_swap32(volatile intptr_t *dst, intptr_t val, intptr_t *res)
 {
 	*res = __swp(val, dst);
 }
 
 #define	atomic_swap_ptr(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
+	atomic_swap32((volatile intptr_t *)d, (intptr_t)v, (intptr_t *)r)
 
 #define	atomic_swap_int(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
+	atomic_swap32((volatile intptr_t *)d, (intptr_t)v, (intptr_t *)r)
 #endif
 

Modified: stable/7/lib/libkse/arch/i386/include/atomic_ops.h
==============================================================================
--- stable/7/lib/libkse/arch/i386/include/atomic_ops.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/i386/include/atomic_ops.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -36,7 +36,7 @@
  * void atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res);
  */
 static inline void
-atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res)
+atomic_swap32(volatile intptr_t *dst, intptr_t val, intptr_t *res)
 {
 	__asm __volatile(
 	"xchgl %2, %1; movl %2, %0"
@@ -44,8 +44,8 @@ atomic_swap32(intptr_t *dst, intptr_t va
 }
 
 #define	atomic_swap_ptr(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
+	atomic_swap32((volatile intptr_t *)d, (intptr_t)v, (intptr_t *)r)
 
 #define	atomic_swap_int(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
+	atomic_swap32((volatile intptr_t *)d, (intptr_t)v, (intptr_t *)r)
 #endif

Modified: stable/7/lib/libkse/arch/i386/include/pthread_md.h
==============================================================================
--- stable/7/lib/libkse/arch/i386/include/pthread_md.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/i386/include/pthread_md.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -246,7 +246,7 @@ _thread_switch(struct kcb *kcb, struct t
 		if (setmbox != 0)
 			_thr_setcontext(&tcb->tcb_tmbx.tm_context.uc_mcontext,
 			    (intptr_t)&tcb->tcb_tmbx,
-			    (intptr_t *)&kcb->kcb_kmbx.km_curthread);
+			    (intptr_t *)(void *)&kcb->kcb_kmbx.km_curthread);
 		else
 			_thr_setcontext(&tcb->tcb_tmbx.tm_context.uc_mcontext,
 				0, NULL);

Modified: stable/7/lib/libkse/arch/ia64/include/atomic_ops.h
==============================================================================
--- stable/7/lib/libkse/arch/ia64/include/atomic_ops.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/ia64/include/atomic_ops.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -30,18 +30,18 @@
 #define	_ATOMIC_OPS_H_
 
 static inline void
-atomic_swap_int(int *dst, int val, int *res)
+atomic_swap_int(volatile int *dst, int val, int *res)
 {
 	__asm("xchg4	%0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst));
 }
 
 static inline void
-atomic_swap_long(long *dst, long val, long *res)
+atomic_swap_long(volatile long *dst, long val, long *res)
 {
 	__asm("xchg8	%0=[%2],%1" : "=r"(*res) : "r"(val), "r"(dst));
 }
 
 #define	atomic_swap_ptr(d,v,r)		\
-	atomic_swap_long((long*)d, (long)v, (long*)r)
+	atomic_swap_long((volatile long *)d, (long)v, (long *)r)
 
 #endif /* _ATOMIC_OPS_H_ */

Modified: stable/7/lib/libkse/arch/powerpc/include/atomic_ops.h
==============================================================================
--- stable/7/lib/libkse/arch/powerpc/include/atomic_ops.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/powerpc/include/atomic_ops.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -37,7 +37,7 @@
  * void atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res);
  */
 static inline void
-atomic_swap32(intptr_t *dst, intptr_t val, intptr_t *res)
+atomic_swap32(volatile intptr_t *dst, intptr_t val, intptr_t *res)
 {
 	int tmp;
 
@@ -55,8 +55,8 @@ atomic_swap32(intptr_t *dst, intptr_t va
 }
 
 #define	atomic_swap_ptr(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
+	atomic_swap32((volatile intptr_t *)d, (intptr_t)v, (intptr_t *)r)
 
 #define	atomic_swap_int(d, v, r) \
-	atomic_swap32((intptr_t *)d, (intptr_t)v, (intptr_t *)r)
+	atomic_swap32((volatile intptr_t *)d, (intptr_t)v, (intptr_t *)r)
 #endif

Modified: stable/7/lib/libkse/arch/powerpc/include/pthread_md.h
==============================================================================
--- stable/7/lib/libkse/arch/powerpc/include/pthread_md.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/powerpc/include/pthread_md.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -280,7 +280,7 @@ _thread_switch(struct kcb *kcb, struct t
 		tcb->tcb_tmbx.tm_lwp = kcb->kcb_kmbx.km_lwp;
 		if (setmbox)
 			_ppc32_setcontext(mc, (intptr_t)&tcb->tcb_tmbx,
-			    (intptr_t *)&kcb->kcb_kmbx.km_curthread);
+			    (intptr_t *)(void *)&kcb->kcb_kmbx.km_curthread);
 		else
 			_ppc32_setcontext(mc, 0, NULL);
 	}

Modified: stable/7/lib/libkse/arch/sparc64/include/atomic_ops.h
==============================================================================
--- stable/7/lib/libkse/arch/sparc64/include/atomic_ops.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/sparc64/include/atomic_ops.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -38,7 +38,7 @@
  * void atomic_swap_long(long *dst, long val, long *res);
  */
 static __inline void
-atomic_swap_long(long *dst, long val, long *res)
+atomic_swap_long(volatile long *dst, long val, long *res)
 {
 	long tmp;
 	long r;
@@ -54,7 +54,7 @@ atomic_swap_long(long *dst, long val, lo
 }
 
 static __inline void
-atomic_swap_int(int *dst, int val, int *res)
+atomic_swap_int(volatile int *dst, int val, int *res)
 {
 	int tmp;
 	int r;
@@ -70,6 +70,6 @@ atomic_swap_int(int *dst, int val, int *
 }
 
 #define	atomic_swap_ptr(dst, val, res) \
-	atomic_swap_long((long *)dst, (long)val, (long *)res)
+	atomic_swap_long((volatile long *)dst, (long)val, (long *)res)
 
 #endif

Modified: stable/7/lib/libkse/arch/sparc64/include/pthread_md.h
==============================================================================
--- stable/7/lib/libkse/arch/sparc64/include/pthread_md.h	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/arch/sparc64/include/pthread_md.h	Tue Jun  9 15:09:10 2009	(r193835)
@@ -237,7 +237,7 @@ _thread_switch(struct kcb *kcb, struct t
 		tcb->tcb_tmbx.tm_lwp = kcb->kcb_kmbx.km_lwp;
 		if (setmbox)
 			_thr_setcontext(mc, (intptr_t)&tcb->tcb_tmbx,
-			    (intptr_t *)&kcb->kcb_kmbx.km_curthread);
+			    (intptr_t *)(void *)&kcb->kcb_kmbx.km_curthread);
 		else
 			_thr_setcontext(mc, 0, NULL);
 	} else {

Modified: stable/7/lib/libkse/sys/lock.c
==============================================================================
--- stable/7/lib/libkse/sys/lock.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/sys/lock.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -187,11 +187,12 @@ _lock_acquire(struct lock *lck, struct l
 	 * Atomically swap the head of the lock request with
 	 * this request.
 	 */
-	atomic_swap_ptr(&lck->l_head, lu->lu_myreq, &lu->lu_watchreq);
+	atomic_swap_ptr((void *)&lck->l_head, lu->lu_myreq,
+	    (void *)&lu->lu_watchreq);
 
 	if (lu->lu_watchreq->lr_locked != 0) {
 		atomic_store_rel_ptr
-		    ((volatile uintptr_t *)&lu->lu_watchreq->lr_watcher,
+		    ((volatile uintptr_t *)(void *)&lu->lu_watchreq->lr_watcher,
 		    (uintptr_t)lu);
 		if ((lck->l_wait == NULL) ||
 		    ((lck->l_type & LCK_ADAPTIVE) == 0)) {
@@ -223,7 +224,7 @@ _lock_acquire(struct lock *lck, struct l
 				if (lu->lu_watchreq->lr_active == 0)
 					break;
 			}
-			atomic_swap_int((int *)&lu->lu_watchreq->lr_locked,
+			atomic_swap_int(&lu->lu_watchreq->lr_locked,
 			    2, &lval);
 			if (lval == 0)
 				lu->lu_watchreq->lr_locked = 0;
@@ -262,18 +263,19 @@ _lock_release(struct lock *lck, struct l
 
 		/* Update tail if our request is last. */
 		if (lu->lu_watchreq->lr_owner == NULL) {
-			atomic_store_rel_ptr((volatile uintptr_t *)&lck->l_tail,
+			atomic_store_rel_ptr((volatile uintptr_t *)
+			    (void *)&lck->l_tail,
 			    (uintptr_t)lu->lu_myreq);
-			atomic_store_rel_ptr
-			    ((volatile uintptr_t *)&lu->lu_myreq->lr_owner,
+			atomic_store_rel_ptr((volatile uintptr_t *)
+			    (void *)&lu->lu_myreq->lr_owner,
 			    (uintptr_t)NULL);
 		} else {
 			/* Remove ourselves from the list. */
 			atomic_store_rel_ptr((volatile uintptr_t *)
-			    &lu->lu_myreq->lr_owner,
+			    (void *)&lu->lu_myreq->lr_owner,
 			    (uintptr_t)lu->lu_watchreq->lr_owner);
 			atomic_store_rel_ptr((volatile uintptr_t *)
-			    &lu->lu_watchreq->lr_owner->lu_myreq,
+			    (void *)&lu->lu_watchreq->lr_owner->lu_myreq,
 			    (uintptr_t)lu->lu_myreq);
 		}
 		/*
@@ -302,7 +304,7 @@ _lock_release(struct lock *lck, struct l
 			/* Give the lock to the highest priority user. */
 			if (lck->l_wakeup != NULL) {
 				atomic_swap_int(
-				    (int *)&lu_h->lu_watchreq->lr_locked,
+				    &lu_h->lu_watchreq->lr_locked,
 				    0, &lval);
 				if (lval == 2)
 					/* Notify the sleeper */
@@ -314,7 +316,7 @@ _lock_release(struct lock *lck, struct l
 				    &lu_h->lu_watchreq->lr_locked, 0);
 		} else {
 			if (lck->l_wakeup != NULL) {
-				atomic_swap_int((int *)&myreq->lr_locked,
+				atomic_swap_int(&myreq->lr_locked,
 				    0, &lval);
 				if (lval == 2)
 					/* Notify the sleeper */
@@ -335,7 +337,7 @@ _lock_release(struct lock *lck, struct l
 		lu->lu_watchreq = NULL;
 		lu->lu_myreq->lr_locked = 1;
 		if (lck->l_wakeup) {
-			atomic_swap_int((int *)&myreq->lr_locked, 0, &lval);
+			atomic_swap_int(&myreq->lr_locked, 0, &lval);
 			if (lval == 2)
 				/* Notify the sleeper */
 				lck->l_wakeup(lck, myreq->lr_watcher);
@@ -348,7 +350,7 @@ _lock_release(struct lock *lck, struct l
 }
 
 void
-_lock_grant(struct lock *lck /* unused */, struct lockuser *lu)
+_lock_grant(struct lock *lck __unused /* unused */, struct lockuser *lu)
 {
 	atomic_store_rel_int(&lu->lu_watchreq->lr_locked, 3);
 }

Modified: stable/7/lib/libkse/sys/thr_error.c
==============================================================================
--- stable/7/lib/libkse/sys/thr_error.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/sys/thr_error.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -33,6 +33,7 @@
  *
  * $FreeBSD$
  */
+#include 
 #include 
 #include "libc_private.h"
 #include "thr_private.h"

Modified: stable/7/lib/libkse/thread/thr_accept.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_accept.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_accept.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$");
 LT10_COMPAT_PRIVATE(__accept);
 LT10_COMPAT_DEFAULT(accept);
 
+int __accept(int s, struct sockaddr *addr, socklen_t *addrlen);
+
+
 __weak_reference(__accept, accept);
 
 int

Modified: stable/7/lib/libkse/thread/thr_aio_suspend.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_aio_suspend.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_aio_suspend.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -36,6 +36,11 @@
 LT10_COMPAT_PRIVATE(_aio_suspend);
 LT10_COMPAT_DEFAULT(aio_suspend);
 
+
+int
+_aio_suspend(const struct aiocb * const iocbs[], int niocb, const struct
+    timespec *timeout);
+
 __weak_reference(_aio_suspend, aio_suspend);
 
 int

Modified: stable/7/lib/libkse/thread/thr_atfork.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_atfork.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_atfork.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -25,10 +25,12 @@
  *
  * $FreeBSD$
  */
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_atfork);

Modified: stable/7/lib/libkse/thread/thr_attr_destroy.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_destroy.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_destroy.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,9 +28,11 @@
  *
  * $FreeBSD$
  */
+#include "namespace.h"
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_destroy);

Modified: stable/7/lib/libkse/thread/thr_attr_get_np.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_get_np.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_get_np.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -25,10 +25,13 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_get_np);

Modified: stable/7/lib/libkse/thread/thr_attr_getdetachstate.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getdetachstate.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getdetachstate.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,8 +28,10 @@
  *
  * $FreeBSD$
  */
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getdetachstate);

Modified: stable/7/lib/libkse/thread/thr_attr_getguardsize.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getguardsize.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getguardsize.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -29,8 +29,10 @@
  * $FreeBSD$
  */
 
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getguardsize);

Modified: stable/7/lib/libkse/thread/thr_attr_getinheritsched.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getinheritsched.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getinheritsched.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getinheritsched);

Modified: stable/7/lib/libkse/thread/thr_attr_getschedparam.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getschedparam.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getschedparam.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getschedparam);

Modified: stable/7/lib/libkse/thread/thr_attr_getschedpolicy.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getschedpolicy.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getschedpolicy.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getschedpolicy);

Modified: stable/7/lib/libkse/thread/thr_attr_getscope.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getscope.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getscope.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getscope);

Modified: stable/7/lib/libkse/thread/thr_attr_getstack.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getstack.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getstack.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getstack);

Modified: stable/7/lib/libkse/thread/thr_attr_getstackaddr.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getstackaddr.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getstackaddr.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,8 +28,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getstackaddr);

Modified: stable/7/lib/libkse/thread/thr_attr_getstacksize.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_getstacksize.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_getstacksize.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,8 +28,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_getstacksize);

Modified: stable/7/lib/libkse/thread/thr_attr_init.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_init.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_init.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,10 +28,13 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_init);

Modified: stable/7/lib/libkse/thread/thr_attr_setcreatesuspend_np.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setcreatesuspend_np.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setcreatesuspend_np.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,13 +28,18 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setcreatesuspend_np);
 LT10_COMPAT_DEFAULT(pthread_attr_setcreatesuspend_np);
 
+int _pthread_attr_setcreatesuspend_np(pthread_attr_t *attr);
+
 __weak_reference(_pthread_attr_setcreatesuspend_np, pthread_attr_setcreatesuspend_np);
 
 int

Modified: stable/7/lib/libkse/thread/thr_attr_setdetachstate.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setdetachstate.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setdetachstate.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,8 +28,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setdetachstate);

Modified: stable/7/lib/libkse/thread/thr_attr_setguardsize.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setguardsize.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setguardsize.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -29,9 +29,11 @@
  * $FreeBSD$
  */
 
+#include "namespace.h"
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setguardsize);

Modified: stable/7/lib/libkse/thread/thr_attr_setinheritsched.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setinheritsched.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setinheritsched.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setinheritsched);

Modified: stable/7/lib/libkse/thread/thr_attr_setschedparam.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setschedparam.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setschedparam.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setschedparam);

Modified: stable/7/lib/libkse/thread/thr_attr_setschedpolicy.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setschedpolicy.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setschedpolicy.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setschedpolicy);

Modified: stable/7/lib/libkse/thread/thr_attr_setscope.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setscope.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setscope.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setscope);

Modified: stable/7/lib/libkse/thread/thr_attr_setstack.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setstack.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setstack.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -31,8 +31,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setstack);

Modified: stable/7/lib/libkse/thread/thr_attr_setstackaddr.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setstackaddr.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setstackaddr.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,8 +28,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setstackaddr);

Modified: stable/7/lib/libkse/thread/thr_attr_setstacksize.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_attr_setstacksize.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_attr_setstacksize.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,8 +28,11 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_attr_setstacksize);

Modified: stable/7/lib/libkse/thread/thr_barrier.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_barrier.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_barrier.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -26,9 +26,9 @@
  * $FreeBSD$
  */
 
+#include "namespace.h"
 #include 
 #include 
-#include "namespace.h"
 #include 
 #include "un-namespace.h"
 #include "thr_private.h"
@@ -65,7 +65,7 @@ _pthread_barrier_destroy(pthread_barrier
 
 int
 _pthread_barrier_init(pthread_barrier_t *barrier,
-		      const pthread_barrierattr_t *attr, unsigned count)
+    const pthread_barrierattr_t *attr __unused, unsigned count)
 {
 	pthread_barrier_t	bar;
 	int			ret;

Modified: stable/7/lib/libkse/thread/thr_barrierattr.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_barrierattr.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_barrierattr.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,9 +28,11 @@
  * $FreeBSD$
  */
 
+#include "namespace.h"
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_barrierattr_destroy);

Modified: stable/7/lib/libkse/thread/thr_cancel.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_cancel.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_cancel.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -2,8 +2,10 @@
  * David Leonard , 1999. Public domain.
  * $FreeBSD$
  */
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_cancel);
@@ -53,7 +55,7 @@ testcancel(struct pthread *curthread)
 		THR_THREAD_UNLOCK(curthread, curthread);
 
 		_thr_exit_cleanup();
-		pthread_exit(PTHREAD_CANCELED);
+		_pthread_exit(PTHREAD_CANCELED);
 		PANIC("cancel");
 	}
 }
@@ -214,7 +216,7 @@ _pthread_setcancelstate(int state, int *
 	THR_THREAD_UNLOCK(curthread, curthread);
 	if (need_exit != 0) {
 		_thr_exit_cleanup();
-		pthread_exit(PTHREAD_CANCELED);
+		_pthread_exit(PTHREAD_CANCELED);
 		PANIC("cancel");
 	}
 	if (ret == 0 && oldstate != NULL)
@@ -252,7 +254,7 @@ _pthread_setcanceltype(int type, int *ol
 	THR_THREAD_UNLOCK(curthread, curthread);
 	if (need_exit != 0) {
 		_thr_exit_cleanup();
-		pthread_exit(PTHREAD_CANCELED);
+		_pthread_exit(PTHREAD_CANCELED);
 		PANIC("cancel");
 	}
 	if (ret == 0 && oldtype != NULL)
@@ -293,7 +295,7 @@ _thr_cancel_leave(struct pthread *thread
 }
 
 void
-_thr_finish_cancellation(void *arg)
+_thr_finish_cancellation(void *arg __unused)
 {
 	struct pthread	*curthread = _get_curthread();
 
@@ -305,7 +307,7 @@ _thr_finish_cancellation(void *arg)
 		curthread->cancelflags &= ~THR_CANCEL_NEEDED;
 		THR_THREAD_UNLOCK(curthread, curthread);
 		_thr_exit_cleanup();
-		pthread_exit(PTHREAD_CANCELED);
+		_pthread_exit(PTHREAD_CANCELED);
 	}
 	THR_THREAD_UNLOCK(curthread, curthread);
 }

Modified: stable/7/lib/libkse/thread/thr_clean.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_clean.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_clean.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,10 +28,13 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_cleanup_push);

Modified: stable/7/lib/libkse/thread/thr_close.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_close.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_close.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,17 +28,22 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(__close);
 LT10_COMPAT_DEFAULT(close);
 
+int __close(int fd);
+
 __weak_reference(__close, close);
 
 int

Modified: stable/7/lib/libkse/thread/thr_concurrency.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_concurrency.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_concurrency.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -26,10 +26,13 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 
 #include "thr_private.h"
 

Modified: stable/7/lib/libkse/thread/thr_cond.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_cond.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_cond.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,10 +28,13 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(__pthread_cond_wait);
@@ -63,6 +66,10 @@ static void			cond_wait_backout(void *);
 static inline void		check_continuation(struct pthread *,
 				    struct pthread_cond *, pthread_mutex_t *);
 
+int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
+int __pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+		       const struct timespec *abstime);
+
 /*
  * Double underscore versions are cancellation points.  Single underscore
  * versions are not and are provided for libc internal usage (which
@@ -197,7 +204,7 @@ _pthread_cond_wait(pthread_cond_t *cond,
 	 * perform the dynamic initialization:
 	 */
 	if (*cond == NULL &&
-	    (rval = pthread_cond_init(cond, NULL)) != 0)
+	    (rval = _pthread_cond_init(cond, NULL)) != 0)
 		return (rval);
 
 	if (!_kse_isthreaded())
@@ -395,7 +402,7 @@ _pthread_cond_timedwait(pthread_cond_t *
 	 * If the condition variable is statically initialized, perform dynamic
 	 * initialization.
 	 */
-	if (*cond == NULL && (rval = pthread_cond_init(cond, NULL)) != 0)
+	if (*cond == NULL && (rval = _pthread_cond_init(cond, NULL)) != 0)
 		return (rval);
 
 	if (!_kse_isthreaded())
@@ -596,7 +603,7 @@ _pthread_cond_signal(pthread_cond_t * co
         * If the condition variable is statically initialized, perform dynamic
         * initialization.
         */
-	else if (*cond != NULL || (rval = pthread_cond_init(cond, NULL)) == 0) {
+	else if (*cond != NULL || (rval = _pthread_cond_init(cond, NULL)) == 0) {
 		/* Lock the condition variable structure: */
 		THR_LOCK_ACQUIRE(curthread, &(*cond)->c_lock);
 
@@ -665,7 +672,7 @@ _pthread_cond_broadcast(pthread_cond_t *
         * If the condition variable is statically initialized, perform dynamic
         * initialization.
         */
-	else if (*cond != NULL || (rval = pthread_cond_init(cond, NULL)) == 0) {
+	else if (*cond != NULL || (rval = _pthread_cond_init(cond, NULL)) == 0) {
 		/* Lock the condition variable structure: */
 		THR_LOCK_ACQUIRE(curthread, &(*cond)->c_lock);
 

Modified: stable/7/lib/libkse/thread/thr_condattr_destroy.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_condattr_destroy.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_condattr_destroy.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,9 +28,12 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_condattr_destroy);

Modified: stable/7/lib/libkse/thread/thr_condattr_init.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_condattr_init.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_condattr_init.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,10 +28,13 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_condattr_init);

Modified: stable/7/lib/libkse/thread/thr_condattr_pshared.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_condattr_pshared.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_condattr_pshared.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -30,6 +30,9 @@
 #include 
 #include "thr_private.h"
 
+int _pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
+int _pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);
+
 __weak_reference(_pthread_condattr_getpshared, pthread_condattr_getpshared);
 __weak_reference(_pthread_condattr_setpshared, pthread_condattr_setpshared);
 

Modified: stable/7/lib/libkse/thread/thr_connect.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_connect.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_connect.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
 LT10_COMPAT_PRIVATE(__connect);
 LT10_COMPAT_DEFAULT(connect);
 
+int __connect(int fd, const struct sockaddr *name, socklen_t namelen);
+
 __weak_reference(__connect, connect);
 
 int

Modified: stable/7/lib/libkse/thread/thr_creat.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_creat.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_creat.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -29,8 +29,10 @@
  * $FreeBSD$
  */
 
+#include "namespace.h"
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(___creat);
@@ -38,6 +40,8 @@ LT10_COMPAT_DEFAULT(creat);
 
 extern int __creat(const char *, mode_t);
 
+int ___creat(const char *path, mode_t mode);
+
 __weak_reference(___creat, creat);
 
 int

Modified: stable/7/lib/libkse/thread/thr_create.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_create.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_create.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -29,6 +29,8 @@
  *
  * $FreeBSD$
  */
+
+#include "namespace.h"
 #include 
 #include 
 #include 
@@ -38,6 +40,7 @@
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 #include "libc_private.h"
 
@@ -334,11 +337,11 @@ free_stack(struct pthread_attr *pattr)
 }
 
 static void
-thread_start(struct pthread *curthread, void *(*start_routine) (void *),
+thread_start(struct pthread *curthread __unused, void *(*start_routine) (void *),
     void *arg)
 {
 	/* Run the current thread's start routine with argument: */
-	pthread_exit(start_routine(arg));
+	_pthread_exit(start_routine(arg));
 
 	/* This point should never be reached. */
 	PANIC("Thread has resumed after exit");

Modified: stable/7/lib/libkse/thread/thr_detach.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_detach.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_detach.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,10 +28,12 @@
  *
  * $FreeBSD$
  */
+#include "namespace.h"
 #include 
 #include 
 #include 
 #include 
+#include "un-namespace.h"
 #include "thr_private.h"
 
 LT10_COMPAT_PRIVATE(_pthread_detach);

Modified: stable/7/lib/libkse/thread/thr_equal.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_equal.c	Tue Jun  9 15:03:22 2009	(r193834)
+++ stable/7/lib/libkse/thread/thr_equal.c	Tue Jun  9 15:09:10 2009	(r193835)
@@ -28,7 +28,10 @@
  *
  * $FreeBSD$
  */
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From gnn at FreeBSD.org  Tue Jun  9 15:10:02 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Tue Jun  9 15:10:20 2009
Subject: svn commit: r193836 - stable/7/sys/dev/cxgb
Message-ID: <200906091510.n59FA0Ei075460@svn.freebsd.org>

Author: gnn
Date: Tue Jun  9 15:10:00 2009
New Revision: 193836
URL: http://svn.freebsd.org/changeset/base/193836

Log:
  Re-add accidentally removed code from the previous MFCs.

Modified:
  stable/7/sys/dev/cxgb/cxgb_main.c

Modified: stable/7/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_main.c	Tue Jun  9 15:09:10 2009	(r193835)
+++ stable/7/sys/dev/cxgb/cxgb_main.c	Tue Jun  9 15:10:00 2009	(r193836)
@@ -76,7 +76,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef CONFIG_DEFINED
 #include 
+#else
+#include 
+#endif
 
 #ifdef PRIV_SUPPORTED
 #include 
From kmacy at FreeBSD.org  Tue Jun  9 21:17:59 2009
From: kmacy at FreeBSD.org (Kip Macy)
Date: Tue Jun  9 21:18:12 2009
Subject: svn commit: r193858 - in stable/7/usr.bin/fstat: . zfs
Message-ID: <200906092117.n59LHvPm084057@svn.freebsd.org>

Author: kmacy
Date: Tue Jun  9 21:17:57 2009
New Revision: 193858
URL: http://svn.freebsd.org/changeset/base/193858

Log:
  MFC fstat support bits for ZFS
  
  Submitted by:	Alexander Nedotsukov

Added:
  stable/7/usr.bin/fstat/zfs/
  stable/7/usr.bin/fstat/zfs.c   (contents, props changed)
  stable/7/usr.bin/fstat/zfs/Makefile   (contents, props changed)
Modified:
  stable/7/usr.bin/fstat/Makefile
  stable/7/usr.bin/fstat/fstat.c
  stable/7/usr.bin/fstat/fstat.h

Modified: stable/7/usr.bin/fstat/Makefile
==============================================================================
--- stable/7/usr.bin/fstat/Makefile	Tue Jun  9 20:29:47 2009	(r193857)
+++ stable/7/usr.bin/fstat/Makefile	Tue Jun  9 21:17:57 2009	(r193858)
@@ -1,6 +1,8 @@
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 # $FreeBSD$
 
+.include 
+
 PROG=	fstat
 SRCS=	cd9660.c fstat.c msdosfs.c
 DPADD=	${LIBKVM}
@@ -11,4 +13,13 @@ WARNS?=	6
 
 CFLAGS+=-D_KVM_VNODE
 
+# XXX This is a hack.
+.if ${MK_CDDL} != "no"
+CFLAGS+= -DZFS
+OBJS+=	zfs/zfs.o
+SUBDIR=	zfs
+zfs/zfs.o: .PHONY
+	@cd ${.CURDIR}/zfs && ${MAKE} zfs.o
+.endif
+
 .include 

Modified: stable/7/usr.bin/fstat/fstat.c
==============================================================================
--- stable/7/usr.bin/fstat/fstat.c	Tue Jun  9 20:29:47 2009	(r193857)
+++ stable/7/usr.bin/fstat/fstat.c	Tue Jun  9 21:17:57 2009	(r193858)
@@ -525,6 +525,11 @@ vtrans(struct vnode *vp, int i, int flag
 		} else if (!strcmp("isofs", tagstr)) {
 			if (!isofs_filestat(&vn, &fst))
 				badtype = "error";
+#ifdef ZFS
+		} else if (!strcmp("zfs", tagstr)) {
+			if (!zfs_filestat(&vn, &fst))
+				badtype = "error";
+#endif
 		} else {
 			static char unknown[32];
 			snprintf(unknown, sizeof unknown, "?(%s)", tagstr);
@@ -939,6 +944,20 @@ getfname(const char *filename)
 	return(1);
 }
 
+#ifdef ZFS
+void *
+getvnodedata(struct vnode *vp)
+{
+	return (vp->v_data);
+}
+
+struct mount *
+getvnodemount(struct vnode *vp)
+{
+	return (vp->v_mount);
+}
+#endif
+
 void
 usage(void)
 {

Modified: stable/7/usr.bin/fstat/fstat.h
==============================================================================
--- stable/7/usr.bin/fstat/fstat.h	Tue Jun  9 20:29:47 2009	(r193857)
+++ stable/7/usr.bin/fstat/fstat.h	Tue Jun  9 21:17:57 2009	(r193858)
@@ -71,4 +71,10 @@ dev_t dev2udev(struct cdev *dev);
 int isofs_filestat(struct vnode *vp, struct filestat *fsp);
 int msdosfs_filestat(struct vnode *vp, struct filestat *fsp);
 
+#ifdef ZFS
+int zfs_filestat(struct vnode *vp, struct filestat *fsp);
+void *getvnodedata(struct vnode *vp);
+struct mount *getvnodemount(struct vnode *vp);
+#endif
+
 #endif /* __FSTAT_H__ */

Added: stable/7/usr.bin/fstat/zfs.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/usr.bin/fstat/zfs.c	Tue Jun  9 21:17:57 2009	(r193858)
@@ -0,0 +1,135 @@
+/*-
+ * Copyright (c) 2007 Ulf Lilleengen
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#define _KERNEL
+#include 
+#include 
+#undef _KERNEL
+#include 
+
+#undef lbolt
+#undef lbolt64
+#undef gethrestime_sec
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define ZFS
+#undef dprintf
+#include 
+
+/* 
+ * Offset calculations that are used to get data from znode without having the
+ * definition.
+ */
+#define LOCATION_ZID (2 * sizeof(void *))
+#define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *)) - sizeof(struct task))
+
+int
+zfs_filestat(struct vnode *vp, struct filestat *fsp)
+{
+
+	znode_phys_t zphys;
+	struct mount mount, *mountptr;
+	uint64_t *zid;
+	void *znodeptr, *vnodeptr;
+	char *dataptr;
+	void *zphys_addr;
+	size_t len;
+	int size;
+
+	len = sizeof(size);
+	if (sysctlbyname("debug.sizeof.znode", &size, &len, NULL, 0) == -1) {
+		dprintf(stderr, "error getting sysctl\n");
+		return (0);
+	}
+	znodeptr = malloc(size);
+	if (znodeptr == NULL) {
+		dprintf(stderr, "error allocating memory for znode storage\n");
+		return (0);
+	}
+
+	/* Since we have problems including vnode.h, we'll use the wrappers. */
+	vnodeptr = getvnodedata(vp);
+	if (!KVM_READ(vnodeptr, znodeptr, (size_t)size)) {
+		dprintf(stderr, "can't read znode at %p for pid %d\n",
+		    (void *)vnodeptr, Pid);
+		goto bad;
+	}
+
+	/* 
+	 * z_id field is stored in the third pointer. We therefore skip the two
+	 * first bytes. 
+	 *
+	 * Pointer to the z_phys structure is the next last pointer. Therefore
+	 * go back two bytes from the end.
+	 */
+	dataptr = znodeptr;
+	zid = (uint64_t *)(dataptr + LOCATION_ZID);
+	zphys_addr = *(void **)(dataptr + LOCATION_ZPHYS(size));
+
+	if (!KVM_READ(zphys_addr, &zphys, sizeof(zphys))) {
+		dprintf(stderr, "can't read znode_phys at %p for pid %d\n",
+		    zphys_addr, Pid);
+		goto bad;
+	}
+
+	/* Get the mount pointer, and read from the address. */
+	mountptr = getvnodemount(vp);
+	if (!KVM_READ(mountptr, &mount, sizeof(mount))) {
+		dprintf(stderr, "can't read mount at %p for pid %d\n",
+		    (void *)mountptr, Pid);
+		goto bad;
+	}
+
+	fsp->fsid = (long)mount.mnt_stat.f_fsid.val[0];
+	fsp->fileid = *zid;
+	/*
+	 * XXX: Shows up wrong in output, but UFS has this error too. Could
+	 * be that we're casting mode-variables from 64-bit to 8-bit or simply
+	 * error in the mode-to-string function.
+	 */
+	fsp->mode = (mode_t)zphys.zp_mode;
+	fsp->size = (u_long)zphys.zp_size;
+	fsp->rdev = (dev_t)zphys.zp_rdev;
+	free(znodeptr);
+	return (1);
+bad:
+	free(znodeptr);
+	return (0);
+}

Added: stable/7/usr.bin/fstat/zfs/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/usr.bin/fstat/zfs/Makefile	Tue Jun  9 21:17:57 2009	(r193858)
@@ -0,0 +1,23 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/..
+
+SRCS=	zfs.c
+OBJS=	zfs.o
+WARNS?=	1
+
+CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
+CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
+CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
+CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
+CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
+CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
+CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
+CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
+CFLAGS+= -I${.CURDIR}/..
+CFLAGS+= -DNEED_SOLARIS_BOOLEAN
+
+all: ${OBJS}
+CLEANFILES= ${OBJS}
+
+.include 
From kmacy at FreeBSD.org  Wed Jun 10 01:18:09 2009
From: kmacy at FreeBSD.org (Kip Macy)
Date: Wed Jun 10 01:18:16 2009
Subject: svn commit: r193876 - in stable/7/sys/boot/i386: . loader
Message-ID: <200906100118.n5A1I8A5089581@svn.freebsd.org>

Author: kmacy
Date: Wed Jun 10 01:18:07 2009
New Revision: 193876
URL: http://svn.freebsd.org/changeset/base/193876

Log:
  - enable building of loader by default
  - fix MK_ZFS == "no" and MK_CDDL == "no" handling

Modified:
  stable/7/sys/boot/i386/Makefile
  stable/7/sys/boot/i386/loader/Makefile

Modified: stable/7/sys/boot/i386/Makefile
==============================================================================
--- stable/7/sys/boot/i386/Makefile	Wed Jun 10 01:15:30 2009	(r193875)
+++ stable/7/sys/boot/i386/Makefile	Wed Jun 10 01:18:07 2009	(r193876)
@@ -1,9 +1,10 @@
 # $FreeBSD$
+.include 
 
 SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \
 		kgzldr libi386 libfirewire loader
 
-.if defined(LOADER_ZFS_SUPPORT)
+.if ${MK_ZFS}
 SUBDIR+=		zfsboot gptzfsboot
 .endif
 

Modified: stable/7/sys/boot/i386/loader/Makefile
==============================================================================
--- stable/7/sys/boot/i386/loader/Makefile	Wed Jun 10 01:15:30 2009	(r193875)
+++ stable/7/sys/boot/i386/loader/Makefile	Wed Jun 10 01:18:07 2009	(r193876)
@@ -16,9 +16,11 @@ LIBFIREWIRE=	${.OBJDIR}/../libfirewire/l
 .endif
 
 # Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support
-.if defined(LOADER_ZFS_SUPPORT)
+.if ${MK_ZFS} != "no"
 CFLAGS+=	-DLOADER_ZFS_SUPPORT
 LIBZFS=		${.OBJDIR}/../../zfs/libzfsboot.a
+.else
+LIBZFS=
 .endif
 
 # Enable PXE TFTP or NFS support, not both.
From kmacy at FreeBSD.org  Wed Jun 10 01:20:47 2009
From: kmacy at FreeBSD.org (Kip Macy)
Date: Wed Jun 10 01:21:04 2009
Subject: svn commit: r193877 - stable/7/sys/boot/i386
Message-ID: <200906100120.n5A1KkES089668@svn.freebsd.org>

Author: kmacy
Date: Wed Jun 10 01:20:46 2009
New Revision: 193877
URL: http://svn.freebsd.org/changeset/base/193877

Log:
  Should be ${MK_ZFS} != "no"

Modified:
  stable/7/sys/boot/i386/Makefile

Modified: stable/7/sys/boot/i386/Makefile
==============================================================================
--- stable/7/sys/boot/i386/Makefile	Wed Jun 10 01:18:07 2009	(r193876)
+++ stable/7/sys/boot/i386/Makefile	Wed Jun 10 01:20:46 2009	(r193877)
@@ -4,7 +4,7 @@
 SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \
 		kgzldr libi386 libfirewire loader
 
-.if ${MK_ZFS}
+.if ${MK_ZFS} != "no"
 SUBDIR+=		zfsboot gptzfsboot
 .endif
 
From brian at FreeBSD.org  Wed Jun 10 05:26:22 2009
From: brian at FreeBSD.org (Brian Somers)
Date: Wed Jun 10 05:26:38 2009
Subject: svn commit: r193888 - stable/7/usr.sbin/pwd_mkdb
Message-ID: <200906100526.n5A5QLsC095035@svn.freebsd.org>

Author: brian
Date: Wed Jun 10 05:26:21 2009
New Revision: 193888
URL: http://svn.freebsd.org/changeset/base/193888

Log:
  MFC: r192432: Fail pwd_mkdb -C if the user name is MAXLOGNAME or longer.

Modified:
  stable/7/usr.sbin/pwd_mkdb/   (props changed)
  stable/7/usr.sbin/pwd_mkdb/pwd_mkdb.c

Modified: stable/7/usr.sbin/pwd_mkdb/pwd_mkdb.c
==============================================================================
--- stable/7/usr.sbin/pwd_mkdb/pwd_mkdb.c	Wed Jun 10 04:18:11 2009	(r193887)
+++ stable/7/usr.sbin/pwd_mkdb/pwd_mkdb.c	Wed Jun 10 05:26:21 2009	(r193888)
@@ -204,7 +204,11 @@ main(int argc, char *argv[])
 
 	/* check only if password database is valid */
 	if (Cflag) {
-		for (cnt = 1; scan(fp, &pwd); ++cnt);
+		while (scan(fp, &pwd))
+			if (!is_comment && strlen(pwd.pw_name) >= MAXLOGNAME) {
+				warnx("%s: username too long", pwd.pw_name);
+				exit(1);
+			}
 		exit(0);
 	}
 
From bms at incunabulum.net  Wed Jun 10 08:39:58 2009
From: bms at incunabulum.net (Bruce Simpson)
Date: Wed Jun 10 08:40:15 2009
Subject: svn commit: r192033 - stable/7/sys/dev/ata
In-Reply-To: <200906090946.46103.jhb@freebsd.org>
References: <200905130255.n4D2tMQZ040010@svn.freebsd.org>
	<200906081050.41020.jhb@freebsd.org>
	<4A2E3C26.9040903@incunabulum.net>
	<200906090946.46103.jhb@freebsd.org>
Message-ID: <4A2F7159.3090800@incunabulum.net>

John Baldwin wrote:
> http://www.FreeBSD.org/~jhb/patches/ata_ali.patch
> Ok, I've uploaded the patch, I must have just sent it inline before.
>   

Thanks!

I did a p4 integ on my p4 work branch, built a NanoBSD USB stick image 
with this patch incorporated into the kernel, booted from it 
successfully on the affected machine, and got this panic just after the 
WITNESS warning.

Had to transcribe by hand, no debugging symbols at the moment.

Fatal trap 12: page fault while in kernel mode
cpuid = 0 apic id = 00
fault virtual address = 0x0
fault code = supervisor read, page not present
instruction pointer = 0x20:0x0
stack pointer = 0x28:0xc4adbb68
frame pointer = 0x28:0xc4adbb9c
code segment = base 0x0, limit 0xfffff, type 0x1b
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 4 (g_down)
[thread pid 4 tid 100008]
Stopped at 0: error reading from address 0

ata_begin_transaction+0x18a
ata_start+0x1db
ata_queue_request+0x4a0
ad_strategy+0x28f
g_disk_start+0x16a
g_io_schedule_down+0x281
g_down_procbody+0x8d
fork_exit+0xb8
fork_trampoline+0x8

Looks like some sort of switch table, call %*edx, just after 
ata_pio_write() in that function. I'll try to grab line number info on 
next boot from NanoBSD build tree.

Don't have any other HEAD stuff compiled but that does sound fairly far 
down in the body of ata_begin_transaction() and it looks like it's 
inside one of the switch cases.


>
> The same patch will apply to 7-stable though it will have to be applied 
> to ata-chipset.c instead.
>   

I'll try applying this there next, just in case this is an 8.x specific 
problem.

thanks!
BMS

From kmacy at FreeBSD.org  Wed Jun 10 09:06:43 2009
From: kmacy at FreeBSD.org (Kip Macy)
Date: Wed Jun 10 09:06:54 2009
Subject: svn commit: r193890 - in stable/7/sys/boot: . i386
Message-ID: <200906100906.n5A96grD099416@svn.freebsd.org>

Author: kmacy
Date: Wed Jun 10 09:06:42 2009
New Revision: 193890
URL: http://svn.freebsd.org/changeset/base/193890

Log:
  fix loader for default settings case

Modified:
  stable/7/sys/boot/Makefile
  stable/7/sys/boot/i386/Makefile

Modified: stable/7/sys/boot/Makefile
==============================================================================
--- stable/7/sys/boot/Makefile	Wed Jun 10 06:49:45 2009	(r193889)
+++ stable/7/sys/boot/Makefile	Wed Jun 10 09:06:42 2009	(r193890)
@@ -17,7 +17,7 @@ SUBDIR+=		efi
 SUBDIR+=		ofw
 .endif
 
-.if defined(LOADER_ZFS_SUPPORT)
+.if ${MK_ZFS} != "no"
 SUBDIR+=		zfs
 .endif
 

Modified: stable/7/sys/boot/i386/Makefile
==============================================================================
--- stable/7/sys/boot/i386/Makefile	Wed Jun 10 06:49:45 2009	(r193889)
+++ stable/7/sys/boot/i386/Makefile	Wed Jun 10 09:06:42 2009	(r193890)
@@ -2,11 +2,7 @@
 .include 
 
 SUBDIR=		mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \
-		kgzldr libi386 libfirewire loader
-
-.if ${MK_ZFS} != "no"
-SUBDIR+=		zfsboot gptzfsboot
-.endif
+		zfsboot gptzfsboot kgzldr libi386 libfirewire loader
 
 # special boot programs, 'self-extracting boot2+loader'
 SUBDIR+=	pxeldr
From bms at incunabulum.net  Wed Jun 10 09:08:50 2009
From: bms at incunabulum.net (Bruce Simpson)
Date: Wed Jun 10 09:09:02 2009
Subject: svn commit: r192033 - stable/7/sys/dev/ata
In-Reply-To: <200906090946.46103.jhb@freebsd.org>
References: <200905130255.n4D2tMQZ040010@svn.freebsd.org>
	<200906081050.41020.jhb@freebsd.org>
	<4A2E3C26.9040903@incunabulum.net>
	<200906090946.46103.jhb@freebsd.org>
Message-ID: <4A2F781E.8010803@incunabulum.net>

John Baldwin wrote:
>> As far as I know the regression / panic still happens in 7.2 -- I nearly 
>> did an 'installkernel' on that box w/o thinking...
>>     
> Yes.  The same patch will apply to 7-stable though it will have to be applied 
> to ata-chipset.c instead.
>   

Here is that patch reworked, which I'm about to test shortly. I see the 
fuzz confused patch(1).

... After manual fixup, I am now up and running with this modified 
patch. Thanks John!

Not sure why it didn't work in 8.x, though.

cheers
BMS
-------------- next part --------------
--- ata-chipset.c.orig	2009-06-01 23:05:07.000000000 +0100
+++ ata-chipset.c	2009-06-10 09:54:02.000000000 +0100
@@ -198,6 +198,9 @@
 static int ata_check_80pin(device_t dev, int mode);
 static int ata_mode2idx(int mode);
 
+struct ali_sata_resources {
+	struct resource *bars[4];
+};
 
 /*
  * generic ATA support functions
@@ -1094,6 +1097,8 @@
 ata_ali_chipinit(device_t dev)
 {
     struct ata_pci_controller *ctlr = device_get_softc(dev);
+    struct ali_sata_resources *res;
+    int i, rid;
 
     if (ata_setup_interrupt(dev))
 	return ENXIO;
@@ -1108,6 +1113,22 @@
 	if ((ctlr->chip->chipid == ATA_ALI_5288) &&
 	    (ata_ahci_chipinit(dev) != ENXIO))
             return 0;
+
+	/* Allocate resources for later use by channel attach routines. */
+	res = malloc(sizeof(struct ali_sata_resources), M_TEMP, M_WAITOK);
+	for (i = 0; i < 4; i++) {
+		rid = PCIR_BAR(i);
+		res->bars[i] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+		    RF_ACTIVE);
+		if (res->bars[i] == NULL) {
+			device_printf(dev, "Failed to allocate BAR %d\n", i);
+			for (i--; i >=0; i--)
+				bus_release_resource(dev, SYS_RES_IOPORT,
+				    PCIR_BAR(i), res->bars[i]);
+			free(res, M_TEMP);
+		}
+	}
+	ctlr->chipset_data = res;
 	break;
 
     case ALINEW:
@@ -1162,20 +1183,18 @@
     device_t parent = device_get_parent(dev);
     struct ata_pci_controller *ctlr = device_get_softc(parent);
     struct ata_channel *ch = device_get_softc(dev);
+    struct ali_sata_resources *res;
     struct resource *io = NULL, *ctlio = NULL;
     int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2);
-    int i, rid;
-		
-    rid = PCIR_BAR(0) + (unit01 ? 8 : 0);
-    io = bus_alloc_resource_any(parent, SYS_RES_IOPORT, &rid, RF_ACTIVE);
-    if (!io)
-	return ENXIO;
+    int i;
 
-    rid = PCIR_BAR(1) + (unit01 ? 8 : 0);
-    ctlio = bus_alloc_resource_any(parent, SYS_RES_IOPORT, &rid, RF_ACTIVE);
-    if (!ctlio) {
-	bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
-	return ENXIO;
+    res = ctlr->chipset_data;
+    if (unit01) {
+	    io = res->bars[2];
+	    ctlio = res->bars[3];
+    } else {
+	    io = res->bars[0];
+	    ctlio = res->bars[1];
     }
 		
     for (i = ATA_DATA; i <= ATA_COMMAND; i ++) {

From cperciva at FreeBSD.org  Wed Jun 10 10:31:13 2009
From: cperciva at FreeBSD.org (Colin Percival)
Date: Wed Jun 10 10:31:31 2009
Subject: svn commit: r193893 - head/contrib/ntp/ntpd head/sys/kern
	head/sys/netinet6 releng/6.3 releng/6.3/contrib/ntp/ntpd
	releng/6.3/sys/conf releng/6.3/sys/kern
	releng/6.3/sys/netinet6 releng/6.4 releng/...
Message-ID: <200906101031.n5AAVBWv010114@svn.freebsd.org>

Author: cperciva
Date: Wed Jun 10 10:31:11 2009
New Revision: 193893
URL: http://svn.freebsd.org/changeset/base/193893

Log:
  Prevent integer overflow in direct pipe write code from circumventing
  virtual-to-physical page lookups. [09:09]
  
  Add missing permissions check for SIOCSIFINFO_IN6 ioctl. [09:10]
  
  Fix buffer overflow in "autokey" negotiation in ntpd(8). [09:11]
  
  Approved by:	so (cperciva)
  Approved by:	re (not really, but SVN wants this...)
  Security:	FreeBSD-SA-09:09.pipe
  Security:	FreeBSD-SA-09:10.ipv6
  Security:	FreeBSD-SA-09:11.ntpd

Modified:
  stable/7/contrib/ntp/ntpd/ntp_crypto.c
  stable/7/sys/kern/sys_pipe.c
  stable/7/sys/netinet6/in6.c

Changes in other areas also in this revision:
Modified:
  head/contrib/ntp/ntpd/ntp_crypto.c
  head/sys/kern/sys_pipe.c
  head/sys/netinet6/in6.c
  releng/6.3/UPDATING
  releng/6.3/contrib/ntp/ntpd/ntp_crypto.c
  releng/6.3/sys/conf/newvers.sh
  releng/6.3/sys/kern/sys_pipe.c
  releng/6.3/sys/netinet6/in6.c
  releng/6.4/UPDATING
  releng/6.4/contrib/ntp/ntpd/ntp_crypto.c
  releng/6.4/sys/conf/newvers.sh
  releng/6.4/sys/kern/sys_pipe.c
  releng/6.4/sys/netinet6/in6.c
  releng/7.1/UPDATING
  releng/7.1/contrib/ntp/ntpd/ntp_crypto.c
  releng/7.1/sys/conf/newvers.sh
  releng/7.1/sys/kern/sys_pipe.c
  releng/7.1/sys/netinet6/in6.c
  releng/7.2/UPDATING
  releng/7.2/contrib/ntp/ntpd/ntp_crypto.c
  releng/7.2/sys/conf/newvers.sh
  releng/7.2/sys/kern/sys_pipe.c
  releng/7.2/sys/netinet6/in6.c
  stable/6/contrib/ntp/ntpd/ntp_crypto.c
  stable/6/sys/kern/sys_pipe.c
  stable/6/sys/netinet6/in6.c

Modified: stable/7/contrib/ntp/ntpd/ntp_crypto.c
==============================================================================
--- stable/7/contrib/ntp/ntpd/ntp_crypto.c	Wed Jun 10 09:28:50 2009	(r193892)
+++ stable/7/contrib/ntp/ntpd/ntp_crypto.c	Wed Jun 10 10:31:11 2009	(r193893)
@@ -570,7 +570,7 @@ crypto_recv(
 			peer->issuer = emalloc(vallen + 1);
 			strcpy(peer->issuer, peer->subject);
 			temp32 = (fstamp >> 16) & 0xffff;
-			sprintf(statstr,
+			snprintf(statstr, NTP_MAXSTRLEN,
 			    "flags 0x%x host %s signature %s", fstamp,
 			    peer->subject, OBJ_nid2ln(temp32));
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -636,7 +636,8 @@ crypto_recv(
 			}
 			peer->flash &= ~TEST8;
 			temp32 = cinfo->nid;
-			sprintf(statstr, "cert %s 0x%x %s (%u) fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN,
+			    "cert %s 0x%x %s (%u) fs %u",
 			    cinfo->subject, cinfo->flags,
 			    OBJ_nid2ln(temp32), temp32,
 			    ntohl(ep->fstamp));
@@ -685,7 +686,7 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_VRFY |
 			    CRYPTO_FLAG_PROV;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "iff fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "iff fs %u",
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -733,7 +734,7 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_VRFY |
 			    CRYPTO_FLAG_PROV;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "gq fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "gq fs %u",
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -774,7 +775,7 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_VRFY |
 			    CRYPTO_FLAG_PROV;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "mv fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "mv fs %u",
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -828,7 +829,7 @@ crypto_recv(
 			peer->crypto &= ~CRYPTO_FLAG_AUTO;
 			peer->crypto |= CRYPTO_FLAG_AGREE;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "cook %x ts %u fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "cook %x ts %u fs %u",
 			    peer->pcookie, ntohl(ep->tstamp),
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -893,7 +894,7 @@ crypto_recv(
 				peer->crypto &= ~CRYPTO_FLAG_AUTO;
 			peer->crypto |= CRYPTO_FLAG_AGREE;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "cook %x ts %u fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN, "cook %x ts %u fs %u",
 			    peer->pcookie, ntohl(ep->tstamp),
 			    ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -944,7 +945,7 @@ crypto_recv(
 			peer->pkeyid = bp->key;
 			peer->crypto |= CRYPTO_FLAG_AUTO;
 			peer->flash &= ~TEST8;
-			sprintf(statstr,
+			snprintf(statstr, NTP_MAXSTRLEN,
 			    "auto seq %d key %x ts %u fs %u", bp->seq,
 			    bp->key, ntohl(ep->tstamp),
 			    ntohl(ep->fstamp));
@@ -987,7 +988,8 @@ crypto_recv(
 			peer->crypto |= CRYPTO_FLAG_SIGN;
 			peer->flash &= ~TEST8;
 			temp32 = cinfo->nid;
-			sprintf(statstr, "sign %s 0x%x %s (%u) fs %u",
+			snprintf(statstr, NTP_MAXSTRLEN,
+			    "sign %s 0x%x %s (%u) fs %u",
 			    cinfo->issuer, cinfo->flags,
 			    OBJ_nid2ln(temp32), temp32,
 			    ntohl(ep->fstamp));
@@ -1071,7 +1073,8 @@ crypto_recv(
 			crypto_flags |= CRYPTO_FLAG_TAI;
 			peer->crypto |= CRYPTO_FLAG_LEAP;
 			peer->flash &= ~TEST8;
-			sprintf(statstr, "leap %u ts %u fs %u", vallen,
+			snprintf(statstr, NTP_MAXSTRLEN,
+			    "leap %u ts %u fs %u", vallen,
 			    ntohl(ep->tstamp), ntohl(ep->fstamp));
 			record_crypto_stats(&peer->srcadr, statstr);
 #ifdef DEBUG
@@ -1127,7 +1130,7 @@ crypto_recv(
 		 * cheerfully ignored, as the message is not sent.
 		 */
 		if (rval > XEVNT_TSP) {
-			sprintf(statstr,
+			snprintf(statstr, NTP_MAXSTRLEN,
 			    "error %x opcode %x ts %u fs %u", rval,
 			    code, tstamp, fstamp);
 			record_crypto_stats(&peer->srcadr, statstr);
@@ -1453,7 +1456,8 @@ crypto_xmit(
 	 */
 	if (rval != XEVNT_OK) {
 		opcode |= CRYPTO_ERROR;
-		sprintf(statstr, "error %x opcode %x", rval, opcode);
+		snprintf(statstr, NTP_MAXSTRLEN,
+		    "error %x opcode %x", rval, opcode);
 		record_crypto_stats(srcadr_sin, statstr);
 		report_event(rval, NULL);
 #ifdef DEBUG
@@ -1952,7 +1956,8 @@ crypto_update(void)
 		if (EVP_SignFinal(&ctx, tai_leap.sig, &len, sign_pkey))
 			tai_leap.siglen = htonl(len);
 	}
-	sprintf(statstr, "update ts %u", ntohl(hostval.tstamp)); 
+	snprintf(statstr, NTP_MAXSTRLEN,
+	    "update ts %u", ntohl(hostval.tstamp)); 
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG
 	if (debug)
@@ -3606,7 +3611,7 @@ crypto_key(
 	 */
 	if ((ptr = strrchr(linkname, '\n')) != NULL)
 		*ptr = '\0'; 
-	sprintf(statstr, "%s mod %d", &linkname[2],
+	snprintf(statstr, NTP_MAXSTRLEN, "%s mod %d", &linkname[2],
 	    EVP_PKEY_size(pkey) * 8);
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG
@@ -3715,8 +3720,8 @@ crypto_cert(
 
 	if ((ptr = strrchr(linkname, '\n')) != NULL)
 		*ptr = '\0'; 
-	sprintf(statstr, "%s 0x%x len %lu", &linkname[2], ret->flags,
-	    len);
+	snprintf(statstr, NTP_MAXSTRLEN,
+	    "%s 0x%x len %lu", &linkname[2], ret->flags, len);
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG
 	if (debug)
@@ -3832,7 +3837,7 @@ crypto_tai(
 	for (j = 0; j < i; j++)
 		*ptr++ = htonl(leapsec[j]);
 	crypto_flags |= CRYPTO_FLAG_TAI;
-	sprintf(statstr, "%s fs %u leap %u len %u", cp, fstamp,
+	snprintf(statstr, NTP_MAXSTRLEN, "%s fs %u leap %u len %u", cp, fstamp,
 	   leapsec[--j], len);
 	record_crypto_stats(NULL, statstr);
 #ifdef DEBUG

Modified: stable/7/sys/kern/sys_pipe.c
==============================================================================
--- stable/7/sys/kern/sys_pipe.c	Wed Jun 10 09:28:50 2009	(r193892)
+++ stable/7/sys/kern/sys_pipe.c	Wed Jun 10 10:31:11 2009	(r193893)
@@ -755,6 +755,8 @@ pipe_build_write_buffer(wpipe, uio)
 	pmap = vmspace_pmap(curproc->p_vmspace);
 	endaddr = round_page((vm_offset_t)uio->uio_iov->iov_base + size);
 	addr = trunc_page((vm_offset_t)uio->uio_iov->iov_base);
+	if (endaddr < addr)
+		return (EFAULT);
 	for (i = 0; addr < endaddr; addr += PAGE_SIZE, i++) {
 		/*
 		 * vm_fault_quick() can sleep.  Consequently,

Modified: stable/7/sys/netinet6/in6.c
==============================================================================
--- stable/7/sys/netinet6/in6.c	Wed Jun 10 09:28:50 2009	(r193892)
+++ stable/7/sys/netinet6/in6.c	Wed Jun 10 10:31:11 2009	(r193893)
@@ -354,6 +354,7 @@ in6_control(struct socket *so, u_long cm
 	case SIOCSRTRFLUSH_IN6:
 	case SIOCSDEFIFACE_IN6:
 	case SIOCSIFINFO_FLAGS:
+	case SIOCSIFINFO_IN6:
 		if (td != NULL) {
 			error = priv_check(td, PRIV_NETINET_ND6);
 			if (error)
@@ -362,7 +363,6 @@ in6_control(struct socket *so, u_long cm
 		/* FALLTHROUGH */
 	case OSIOCGIFINFO_IN6:
 	case SIOCGIFINFO_IN6:
-	case SIOCSIFINFO_IN6:
 	case SIOCGDRLST_IN6:
 	case SIOCGPRLST_IN6:
 	case SIOCGNBRINFO_IN6:
From kib at FreeBSD.org  Wed Jun 10 12:07:56 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Wed Jun 10 12:08:15 2009
Subject: svn commit: r193906 - in stable/7/sys: . amd64/linux32 contrib/pf
	dev/ath/ath_hal dev/cxgb i386/linux kern sys
Message-ID: <200906101207.n5AC7q9M012551@svn.freebsd.org>

Author: kib
Date: Wed Jun 10 12:07:52 2009
New Revision: 193906
URL: http://svn.freebsd.org/changeset/base/193906

Log:
  MFC r185647;
  Several threads in a process may do vfork() simultaneously. Then, all
  parent threads sleep on the parent' struct proc until corresponding
  child releases the vmspace. Each sleep is interlocked with proc mutex of
  the child, that triggers assertion in the sleepq_add(). The assertion
  requires that at any time, all simultaneous sleepers for the channel use
  the same interlock.
  
  Silent the assertion by using conditional variable allocated in the
  child. Broadcast the variable event on exec() and exit().
  
  MFC r188750:
  Adapt linux emulation to use cv for vfork wait.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/linux32/linux32_machdep.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/i386/linux/linux_machdep.c
  stable/7/sys/kern/kern_exec.c
  stable/7/sys/kern/kern_exit.c
  stable/7/sys/kern/kern_fork.c
  stable/7/sys/kern/kern_proc.c
  stable/7/sys/sys/proc.h

Modified: stable/7/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/7/sys/amd64/linux32/linux32_machdep.c	Wed Jun 10 12:03:55 2009	(r193905)
+++ stable/7/sys/amd64/linux32/linux32_machdep.c	Wed Jun 10 12:07:52 2009	(r193906)
@@ -537,7 +537,7 @@ linux_vfork(struct thread *td, struct li
 	/* wait for the children to exit, ie. emulate vfork */
 	PROC_LOCK(p2);
 	while (p2->p_flag & P_PPWAIT)
-	   	msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+		cv_wait(&p2->p_pwait, &p2->p_mtx);
 	PROC_UNLOCK(p2);
 
 	return (0);
@@ -726,7 +726,7 @@ linux_clone(struct thread *td, struct li
 		/* wait for the children to exit, ie. emulate vfork */
 		PROC_LOCK(p2);
 		while (p2->p_flag & P_PPWAIT)
-			msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+			cv_wait(&p2->p_pwait, &p2->p_mtx);
 		PROC_UNLOCK(p2);
 	}
 

Modified: stable/7/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/7/sys/i386/linux/linux_machdep.c	Wed Jun 10 12:03:55 2009	(r193905)
+++ stable/7/sys/i386/linux/linux_machdep.c	Wed Jun 10 12:07:52 2009	(r193906)
@@ -376,7 +376,7 @@ linux_vfork(struct thread *td, struct li
 	/* wait for the children to exit, ie. emulate vfork */
 	PROC_LOCK(p2);
 	while (p2->p_flag & P_PPWAIT)
-	   	msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+		cv_wait(&p2->p_pwait, &p2->p_mtx);
 	PROC_UNLOCK(p2);
 
 	return (0);
@@ -581,7 +581,7 @@ linux_clone(struct thread *td, struct li
    	   	/* wait for the children to exit, ie. emulate vfork */
    	   	PROC_LOCK(p2);
 		while (p2->p_flag & P_PPWAIT)
-   		   	msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+			cv_wait(&p2->p_pwait, &p2->p_mtx);
 		PROC_UNLOCK(p2);
 	}
 

Modified: stable/7/sys/kern/kern_exec.c
==============================================================================
--- stable/7/sys/kern/kern_exec.c	Wed Jun 10 12:03:55 2009	(r193905)
+++ stable/7/sys/kern/kern_exec.c	Wed Jun 10 12:07:52 2009	(r193906)
@@ -559,7 +559,7 @@ interpret:
 	p->p_flag |= P_EXEC;
 	if (p->p_pptr && (p->p_flag & P_PPWAIT)) {
 		p->p_flag &= ~P_PPWAIT;
-		wakeup(p->p_pptr);
+		cv_broadcast(&p->p_pwait);
 	}
 
 	/*

Modified: stable/7/sys/kern/kern_exit.c
==============================================================================
--- stable/7/sys/kern/kern_exit.c	Wed Jun 10 12:03:55 2009	(r193905)
+++ stable/7/sys/kern/kern_exit.c	Wed Jun 10 12:07:52 2009	(r193906)
@@ -550,6 +550,7 @@ retry:
 	 * proc lock.
 	 */
 	wakeup(p->p_pptr);
+	cv_broadcast(&p->p_pwait);
 	PROC_SLOCK(p->p_pptr);
 	sched_exit(p->p_pptr, td);
 	PROC_SUNLOCK(p->p_pptr);
@@ -783,6 +784,7 @@ loop:
 				PROC_UNLOCK(p);
 				tdsignal(t, NULL, SIGCHLD, p->p_ksi);
 				wakeup(t);
+				cv_broadcast(&p->p_pwait);
 				PROC_UNLOCK(t);
 				sx_xunlock(&proctree_lock);
 				return (0);

Modified: stable/7/sys/kern/kern_fork.c
==============================================================================
--- stable/7/sys/kern/kern_fork.c	Wed Jun 10 12:03:55 2009	(r193905)
+++ stable/7/sys/kern/kern_fork.c	Wed Jun 10 12:07:52 2009	(r193906)
@@ -744,7 +744,7 @@ again:
 	 */
 	PROC_LOCK(p2);
 	while (p2->p_flag & P_PPWAIT)
-		msleep(p1, &p2->p_mtx, PWAIT, "ppwait", 0);
+		cv_wait(&p2->p_pwait, &p2->p_mtx);
 	PROC_UNLOCK(p2);
 
 	/*

Modified: stable/7/sys/kern/kern_proc.c
==============================================================================
--- stable/7/sys/kern/kern_proc.c	Wed Jun 10 12:03:55 2009	(r193905)
+++ stable/7/sys/kern/kern_proc.c	Wed Jun 10 12:07:52 2009	(r193906)
@@ -231,6 +231,7 @@ proc_init(void *mem, int size, int flags
 	bzero(&p->p_mtx, sizeof(struct mtx));
 	mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
 	mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_RECURSE);
+	cv_init(&p->p_pwait, "ppwait");
 	TAILQ_INIT(&p->p_threads);	     /* all threads in proc */
 	EVENTHANDLER_INVOKE(process_init, p);
 	p->p_stats = pstats_alloc();

Modified: stable/7/sys/sys/proc.h
==============================================================================
--- stable/7/sys/sys/proc.h	Wed Jun 10 12:03:55 2009	(r193905)
+++ stable/7/sys/sys/proc.h	Wed Jun 10 12:07:52 2009	(r193906)
@@ -40,6 +40,7 @@
 
 #include 		/* For struct callout. */
 #include 			/* For struct klist. */
+#include 
 #ifndef _KERNEL
 #include 
 #endif
@@ -598,6 +599,7 @@ struct proc {
 	STAILQ_HEAD(, ktr_request)	p_ktr;	/* (o) KTR event queue. */
 	LIST_HEAD(, mqueue_notifier)	p_mqnotifier; /* (c) mqueue notifiers.*/
 	struct kdtrace_proc	*p_dtrace; /* (*) DTrace-specific data. */
+	struct cv	p_pwait;	/* (*) wait cv for exit/exec */
 };
 
 #define	p_session	p_pgrp->pg_session
From des at FreeBSD.org  Wed Jun 10 12:51:59 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 12:52:20 2009
Subject: svn commit: r193910 - stable/7/lib/libkse
Message-ID: <200906101251.n5ACpw9d013611@svn.freebsd.org>

Author: des
Date: Wed Jun 10 12:51:58 2009
New Revision: 193910
URL: http://svn.freebsd.org/changeset/base/193910

Log:
  merge r176055, r176056: use libc's version definition file.

Modified:
  stable/7/lib/libkse/   (props changed)
  stable/7/lib/libkse/Makefile
  stable/7/lib/libkse/kse.map

Modified: stable/7/lib/libkse/Makefile
==============================================================================
--- stable/7/lib/libkse/Makefile	Wed Jun 10 12:47:54 2009	(r193909)
+++ stable/7/lib/libkse/Makefile	Wed Jun 10 12:51:58 2009	(r193910)
@@ -41,7 +41,8 @@ WARNS?=3
 # Enable extra internal consistancy checks.
 CFLAGS+=-D_PTHREADS_INVARIANTS -Wall
 
-VERSION_MAP=${.CURDIR}/kse.map
+VERSION_DEF=${.CURDIR}/../libc/Versions.def
+SYMBOL_MAPS=${.CURDIR}/kse.map
 
 PRECIOUSLIB=
 

Modified: stable/7/lib/libkse/kse.map
==============================================================================
--- stable/7/lib/libkse/kse.map	Wed Jun 10 12:47:54 2009	(r193909)
+++ stable/7/lib/libkse/kse.map	Wed Jun 10 12:51:58 2009	(r193910)
@@ -4,7 +4,6 @@
  * Use the same naming scheme as libc.
  */
 FBSD_1.0 {
-global:
 	__error;
 	accept;
 	aio_suspend;
@@ -158,8 +157,6 @@ global:
 	waitpid;
 	write;
 	writev;
-local:
-	*;
 };
 
 /*
@@ -167,7 +164,6 @@ local:
  * These are not part of our application ABI.
  */
 FBSDprivate_1.0 {
-global:
 	___creat;
 	__accept;
 	__close;
@@ -363,7 +359,4 @@ global:
 	_thread_size_key;
 	_thread_state_running;
 	_thread_state_zoombie;
-
-local:
-	*;
 };
From des at FreeBSD.org  Wed Jun 10 12:54:37 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 12:54:44 2009
Subject: svn commit: r193911 - in stable/7/lib/libkse: . thread
Message-ID: <200906101254.n5ACsaZT013728@svn.freebsd.org>

Author: des
Date: Wed Jun 10 12:54:36 2009
New Revision: 193911
URL: http://svn.freebsd.org/changeset/base/193911

Log:
  merge r176060, r176071: add pthread_mutex_isowned_np() (already in libthr)

Modified:
  stable/7/lib/libkse/   (props changed)
  stable/7/lib/libkse/kse.map
  stable/7/lib/libkse/thread/thr_mutex.c

Modified: stable/7/lib/libkse/kse.map
==============================================================================
--- stable/7/lib/libkse/kse.map	Wed Jun 10 12:51:58 2009	(r193910)
+++ stable/7/lib/libkse/kse.map	Wed Jun 10 12:54:36 2009	(r193911)
@@ -256,6 +256,7 @@ FBSDprivate_1.0 {
 	_pthread_mutex_getprioceiling;
 	_pthread_mutex_init;
 	_pthread_mutex_init_calloc_cb;
+	_pthread_mutex_isowned_np;
 	_pthread_mutex_lock;
 	_pthread_mutex_setprioceiling;
 	_pthread_mutex_timedlock;
@@ -360,3 +361,7 @@ FBSDprivate_1.0 {
 	_thread_state_running;
 	_thread_state_zoombie;
 };
+
+FBSD_1.1 {
+	pthread_mutex_isowned_np;
+};

Modified: stable/7/lib/libkse/thread/thr_mutex.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_mutex.c	Wed Jun 10 12:51:58 2009	(r193910)
+++ stable/7/lib/libkse/thread/thr_mutex.c	Wed Jun 10 12:54:36 2009	(r193911)
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "un-namespace.h"
 #include "thr_private.h"
 
@@ -127,6 +128,7 @@ __weak_reference(__pthread_mutex_trylock
 /* No difference between libc and application usage of these: */
 __weak_reference(_pthread_mutex_destroy, pthread_mutex_destroy);
 __weak_reference(_pthread_mutex_unlock, pthread_mutex_unlock);
+__weak_reference(_pthread_mutex_isowned_np, pthread_mutex_isowned_np);
 
 static int
 thr_mutex_init(pthread_mutex_t *mutex,
@@ -1866,3 +1868,12 @@ mutex_queue_enq(pthread_mutex_t mutex, p
 	}
 	pthread->sflags |= THR_FLAGS_IN_SYNCQ;
 }
+
+int
+_pthread_mutex_isowned_np(pthread_mutex_t *mutex)
+{
+	struct pthread	*curthread = _get_curthread();
+
+	return ((*mutex)->m_owner == curthread);
+}
+
From des at FreeBSD.org  Wed Jun 10 13:04:08 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 13:05:19 2009
Subject: svn commit: r193912 - stable/7/sbin/clri
Message-ID: <200906101304.n5AD47T1013987@svn.freebsd.org>

Author: des
Date: Wed Jun 10 13:04:07 2009
New Revision: 193912
URL: http://svn.freebsd.org/changeset/base/193912

Log:
  merge r173764: fix aliasing violations.

Modified:
  stable/7/sbin/clri/   (props changed)
  stable/7/sbin/clri/clri.c

Modified: stable/7/sbin/clri/clri.c
==============================================================================
--- stable/7/sbin/clri/clri.c	Wed Jun 10 12:54:36 2009	(r193911)
+++ stable/7/sbin/clri/clri.c	Wed Jun 10 13:04:07 2009	(r193912)
@@ -81,6 +81,7 @@ main(int argc, char *argv[])
 	off_t offset;
 	int i, fd, inonum;
 	char *fs, sblock[SBLOCKSIZE];
+	void *v = ibuf;
 
 	if (argc < 3)
 		usage();
@@ -128,7 +129,7 @@ main(int argc, char *argv[])
 
 		if (sbp->fs_magic == FS_UFS2_MAGIC) {
 			/* get the inode within the block. */
-			dp2 = &(((struct ufs2_dinode *)ibuf)
+			dp2 = &(((struct ufs2_dinode *)v)
 			    [ino_to_fsbo(sbp, inonum)]);
 
 			/* clear the inode, and bump the generation count. */
@@ -137,7 +138,7 @@ main(int argc, char *argv[])
 			dp2->di_gen = generation;
 		} else {
 			/* get the inode within the block. */
-			dp1 = &(((struct ufs1_dinode *)ibuf)
+			dp1 = &(((struct ufs1_dinode *)v)
 			    [ino_to_fsbo(sbp, inonum)]);
 
 			/* clear the inode, and bump the generation count. */
From des at FreeBSD.org  Wed Jun 10 13:41:41 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 13:41:54 2009
Subject: svn commit: r193914 - in stable/7/sbin/ipf: . ipftest
Message-ID: <200906101341.n5ADfeFG014888@svn.freebsd.org>

Author: des
Date: Wed Jun 10 13:41:40 2009
New Revision: 193914
URL: http://svn.freebsd.org/changeset/base/193914

Log:
  merge r173722: lower WARNS; we can't easily fix the (contrib) code.

Modified:
  stable/7/sbin/ipf/   (props changed)
  stable/7/sbin/ipf/ipftest/Makefile

Modified: stable/7/sbin/ipf/ipftest/Makefile
==============================================================================
--- stable/7/sbin/ipf/ipftest/Makefile	Wed Jun 10 13:39:51 2009	(r193913)
+++ stable/7/sbin/ipf/ipftest/Makefile	Wed Jun 10 13:41:40 2009	(r193914)
@@ -1,5 +1,7 @@
 #	$FreeBSD$
 
+WARNS=0
+
 PROG=		ipftest
 SRCS=		${GENHDRS} ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \
 		ip_proxy.c ip_auth.c ip_htable.c ip_lookup.c \
From jhb at FreeBSD.org  Wed Jun 10 13:44:51 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Wed Jun 10 13:45:08 2009
Subject: svn commit: r193915 - stable/7/sys/dev/cxgb
Message-ID: <200906101344.n5ADinwf014996@svn.freebsd.org>

Author: jhb
Date: Wed Jun 10 13:44:49 2009
New Revision: 193915
URL: http://svn.freebsd.org/changeset/base/193915

Log:
  Remove the mergeinfo from sys/dev/cxgb.  The relevant merge history should
  be adequately reflected in the mergeinfo in sys/ at this point.

Modified:
  stable/7/sys/dev/cxgb/   (props changed)
From jhb at freebsd.org  Wed Jun 10 13:57:04 2009
From: jhb at freebsd.org (John Baldwin)
Date: Wed Jun 10 13:57:26 2009
Subject: svn commit: r192033 - stable/7/sys/dev/ata
In-Reply-To: <4A2F7159.3090800@incunabulum.net>
References: <200905130255.n4D2tMQZ040010@svn.freebsd.org>
	<200906090946.46103.jhb@freebsd.org>
	<4A2F7159.3090800@incunabulum.net>
Message-ID: <200906100954.20026.jhb@freebsd.org>

On Wednesday 10 June 2009 4:39:53 am Bruce Simpson wrote:
> John Baldwin wrote:
> > http://www.FreeBSD.org/~jhb/patches/ata_ali.patch
> > Ok, I've uploaded the patch, I must have just sent it inline before.
> >   
> 
> Thanks!
> 
> I did a p4 integ on my p4 work branch, built a NanoBSD USB stick image 
> with this patch incorporated into the kernel, booted from it 
> successfully on the affected machine, and got this panic just after the 
> WITNESS warning.
> 
> Had to transcribe by hand, no debugging symbols at the moment.
> 
> Fatal trap 12: page fault while in kernel mode
> cpuid = 0 apic id = 00
> fault virtual address = 0x0
> fault code = supervisor read, page not present
> instruction pointer = 0x20:0x0
> stack pointer = 0x28:0xc4adbb68
> frame pointer = 0x28:0xc4adbb9c
> code segment = base 0x0, limit 0xfffff, type 0x1b
> processor eflags = interrupt enabled, resume, IOPL = 0
> current process = 4 (g_down)
> [thread pid 4 tid 100008]
> Stopped at 0: error reading from address 0
> 
> ata_begin_transaction+0x18a
> ata_start+0x1db
> ata_queue_request+0x4a0
> ad_strategy+0x28f
> g_disk_start+0x16a
> g_io_schedule_down+0x281
> g_down_procbody+0x8d
> fork_exit+0xb8
> fork_trampoline+0x8
> 
> Looks like some sort of switch table, call %*edx, just after 
> ata_pio_write() in that function. I'll try to grab line number info on 
> next boot from NanoBSD build tree.

On an i386 8.0 kernel built here it is this line:

139		if ((error = ch->dma.load(request, NULL, &dummy))) {

which would seem to indicate dma.load is NULL somehow.  My patch doesn't 
affect that part of the code at all.  Are you using any modules or is ata 
compiled into your kernel?  Given that the resource stuff worked and that it 
worked on 7, I think I will commit it for now (and start the MFC timer) and 
assume this is a separate bug.

-- 
John Baldwin
From lulf at FreeBSD.org  Wed Jun 10 13:59:07 2009
From: lulf at FreeBSD.org (Ulf Lilleengen)
Date: Wed Jun 10 13:59:13 2009
Subject: svn commit: r193920 - stable/7/sbin/fsck_ffs
Message-ID: <200906101359.n5ADx6vp015531@svn.freebsd.org>

Author: lulf
Date: Wed Jun 10 13:59:05 2009
New Revision: 193920
URL: http://svn.freebsd.org/changeset/base/193920

Log:
  MFC r193059:
  - Use sig_atomic_t for signal handler variables.
  
  MFC r193325:
  - Use volatile for signal variables.
  
  MFC r193372:
  Correct comment.

Modified:
  stable/7/sbin/fsck_ffs/   (props changed)
  stable/7/sbin/fsck_ffs/fsck.h
  stable/7/sbin/fsck_ffs/gjournal.c

Modified: stable/7/sbin/fsck_ffs/fsck.h
==============================================================================
--- stable/7/sbin/fsck_ffs/fsck.h	Wed Jun 10 13:57:36 2009	(r193919)
+++ stable/7/sbin/fsck_ffs/fsck.h	Wed Jun 10 13:59:05 2009	(r193920)
@@ -297,8 +297,8 @@ int	lfmode;			/* lost & found directory 
 ufs2_daddr_t n_blks;		/* number of blocks in use */
 ino_t n_files;			/* number of files in use */
 
-int	got_siginfo;		/* received a SIGINFO */
-int	got_sigalarm;		/* received a SIGALRM */
+volatile sig_atomic_t	got_siginfo;	/* received a SIGINFO */
+volatile sig_atomic_t	got_sigalarm;	/* received a SIGALRM */
 
 #define	clearinode(dp) \
 	if (sblock.fs_magic == FS_UFS1_MAGIC) { \

Modified: stable/7/sbin/fsck_ffs/gjournal.c
==============================================================================
--- stable/7/sbin/fsck_ffs/gjournal.c	Wed Jun 10 13:57:36 2009	(r193919)
+++ stable/7/sbin/fsck_ffs/gjournal.c	Wed Jun 10 13:59:05 2009	(r193920)
@@ -672,7 +672,7 @@ gjournal_check(const char *filesys)
 
 	devnam = filesys;
 	getdisk();
-	/* Are there any unreferenced inodes in this cylinder group? */
+	/* Are there any unreferenced inodes in this file system? */
 	if (fs->fs_unrefs == 0) {
 		//printf("No unreferenced inodes.\n");
 		closedisk();
From lulf at FreeBSD.org  Wed Jun 10 14:01:24 2009
From: lulf at FreeBSD.org (Ulf Lilleengen)
Date: Wed Jun 10 14:01:41 2009
Subject: svn commit: r193921 - stable/7/contrib/csup
Message-ID: <200906101401.n5AE1N6v015684@svn.freebsd.org>

Author: lulf
Date: Wed Jun 10 14:01:23 2009
New Revision: 193921
URL: http://svn.freebsd.org/changeset/base/193921

Log:
  MFC r193213:
  - Add missing data argument to printf.

Modified:
  stable/7/contrib/csup/   (props changed)
  stable/7/contrib/csup/updater.c

Modified: stable/7/contrib/csup/updater.c
==============================================================================
--- stable/7/contrib/csup/updater.c	Wed Jun 10 13:59:05 2009	(r193920)
+++ stable/7/contrib/csup/updater.c	Wed Jun 10 14:01:23 2009	(r193921)
@@ -1858,7 +1858,7 @@ updater_append_file(struct updater *up, 
 			goto bad;
 	}
 	if (nread == -1) {
-		xasprintf(&up->errmsg, "%s: Error reading: %s",
+		xasprintf(&up->errmsg, "%s: Error reading: %s", fup->destpath,
 		    strerror(errno));
 		return (UPDATER_ERR_MSG);
 	}
From des at FreeBSD.org  Wed Jun 10 14:38:41 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 14:38:47 2009
Subject: svn commit: r193927 - in stable/7/usr.bin/tip: . tip
Message-ID: <200906101438.n5AEcdK8016686@svn.freebsd.org>

Author: des
Date: Wed Jun 10 14:38:39 2009
New Revision: 193927
URL: http://svn.freebsd.org/changeset/base/193927

Log:
  merge r173716: lower WARNS to avoid spurious "variable might be clobbered
  by longjmp" warnings.

Modified:
  stable/7/usr.bin/tip/   (props changed)
  stable/7/usr.bin/tip/tip/Makefile

Modified: stable/7/usr.bin/tip/tip/Makefile
==============================================================================
--- stable/7/usr.bin/tip/tip/Makefile	Wed Jun 10 14:36:59 2009	(r193926)
+++ stable/7/usr.bin/tip/tip/Makefile	Wed Jun 10 14:38:39 2009	(r193927)
@@ -36,7 +36,7 @@ LINKS=	${BINDIR}/tip ${BINDIR}/cu
 MAN=	tip.1 cu.1
 CFLAGS+=-I${.CURDIR} -DDEFBR=9600 -DDEFFS=BUFSIZ -DACULOG -DPRISTINE \
 	-DCONNECT -DV831 -DVENTEL -DHAYES -DCOURIER -DT3000
-WARNS?=	3
+WARNS?=	2
 .PATH:	${.CURDIR}/../libacu
 SRCS=	acu.c acutab.c cmds.c cmdtab.c cu.c hunt.c log.c partab.c \
 	remote.c tip.c tipout.c uucplock.c value.c vars.c \
From des at FreeBSD.org  Wed Jun 10 14:52:36 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 14:52:52 2009
Subject: svn commit: r193928 - stable/7/lib/libutil
Message-ID: <200906101452.n5AEqZwV017005@svn.freebsd.org>

Author: des
Date: Wed Jun 10 14:52:34 2009
New Revision: 193928
URL: http://svn.freebsd.org/changeset/base/193928

Log:
  merge r173719: constify expand_number(3).

Modified:
  stable/7/lib/libutil/   (props changed)
  stable/7/lib/libutil/expand_number.3
  stable/7/lib/libutil/expand_number.c
  stable/7/lib/libutil/libutil.h

Modified: stable/7/lib/libutil/expand_number.3
==============================================================================
--- stable/7/lib/libutil/expand_number.3	Wed Jun 10 14:38:39 2009	(r193927)
+++ stable/7/lib/libutil/expand_number.3	Wed Jun 10 14:52:34 2009	(r193928)
@@ -37,7 +37,7 @@
 .In libutil.h
 .Ft int
 .Fo expand_number
-.Fa "char *buf" "int64_t *num"
+.Fa "const char *buf" "int64_t *num"
 .Fc
 .Sh DESCRIPTION
 The

Modified: stable/7/lib/libutil/expand_number.c
==============================================================================
--- stable/7/lib/libutil/expand_number.c	Wed Jun 10 14:38:39 2009	(r193927)
+++ stable/7/lib/libutil/expand_number.c	Wed Jun 10 14:52:34 2009	(r193928)
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
  *	8) A positive decimal number followed by a 'e' or 'E' (mult by 1 << 60).
  */
 int
-expand_number(char *buf, int64_t *num)
+expand_number(const char *buf, int64_t *num)
 {
 	static const char unit[] = "bkmgtpe";
 	char *endptr, s;

Modified: stable/7/lib/libutil/libutil.h
==============================================================================
--- stable/7/lib/libutil/libutil.h	Wed Jun 10 14:38:39 2009	(r193927)
+++ stable/7/lib/libutil/libutil.h	Wed Jun 10 14:52:34 2009	(r193928)
@@ -84,7 +84,7 @@ int	forkpty(int *_amaster, char *_name,
 		     struct termios *_termp, struct winsize *_winp);
 int	humanize_number(char *_buf, size_t _len, int64_t _number,
 	    const char *_suffix, int _scale, int _flags);
-int	expand_number(char *_buf, int64_t *_num);
+int	expand_number(const char *_buf, int64_t *_num);
 const char *uu_lockerr(int _uu_lockresult);
 int	uu_lock(const char *_ttyname);
 int	uu_unlock(const char *_ttyname);
From des at FreeBSD.org  Wed Jun 10 17:29:14 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 17:29:20 2009
Subject: svn commit: r193932 - stable/7/usr.sbin/acpi/acpidb
Message-ID: <200906101729.n5AHTDx8020530@svn.freebsd.org>

Author: des
Date: Wed Jun 10 17:29:13 2009
New Revision: 193932
URL: http://svn.freebsd.org/changeset/base/193932

Log:
  Lower WARNS due to aliasing violations in contrib code.

Modified:
  stable/7/usr.sbin/acpi/acpidb/Makefile

Modified: stable/7/usr.sbin/acpi/acpidb/Makefile
==============================================================================
--- stable/7/usr.sbin/acpi/acpidb/Makefile	Wed Jun 10 16:17:38 2009	(r193931)
+++ stable/7/usr.sbin/acpi/acpidb/Makefile	Wed Jun 10 17:29:13 2009	(r193932)
@@ -56,7 +56,7 @@ SRCS+=	utalloc.c utcache.c utcopy.c utde
 	utxface.c
 
 MAN=	acpidb.8
-WARNS?=	2
+WARNS?=	1
 
 CFLAGS+= -DACPI_EXEC_APP
 
From des at FreeBSD.org  Wed Jun 10 17:30:14 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Wed Jun 10 17:30:26 2009
Subject: svn commit: r193933 - in stable/7/usr.sbin/acpi: . acpidump
Message-ID: <200906101730.n5AHUDhO020609@svn.freebsd.org>

Author: des
Date: Wed Jun 10 17:30:12 2009
New Revision: 193933
URL: http://svn.freebsd.org/changeset/base/193933

Log:
  merge r173723, r173726: fix an execl() call.

Modified:
  stable/7/usr.sbin/acpi/   (props changed)
  stable/7/usr.sbin/acpi/acpidump/acpi.c

Modified: stable/7/usr.sbin/acpi/acpidump/acpi.c
==============================================================================
--- stable/7/usr.sbin/acpi/acpidump/acpi.c	Wed Jun 10 17:29:13 2009	(r193932)
+++ stable/7/usr.sbin/acpi/acpidump/acpi.c	Wed Jun 10 17:30:12 2009	(r193933)
@@ -821,7 +821,7 @@ aml_disassemble(struct ACPIsdt *rsdt, st
 		close(STDOUT_FILENO);
 		if (vflag == 0)
 			close(STDERR_FILENO);
-		execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, 0);
+		execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, (char *) 0);
 		err(1, "exec");
 	}
 
From imp at FreeBSD.org  Wed Jun 10 19:21:24 2009
From: imp at FreeBSD.org (Warner Losh)
Date: Wed Jun 10 19:21:30 2009
Subject: svn commit: r193945 - stable/7/sys/dev/cardbus
Message-ID: <200906101921.n5AJLNDe023477@svn.freebsd.org>

Author: imp
Date: Wed Jun 10 19:21:23 2009
New Revision: 193945
URL: http://svn.freebsd.org/changeset/base/193945

Log:
  MFC:
  
  r188216 | wkoszek | 2009-02-05 17:55:19 -0700 (Thu, 05 Feb 2009) | 5 lines
  r185545 | imp | 2008-12-01 21:54:31 -0700 (Mon, 01 Dec 2008) | 2 lines
  r185140 | imp | 2008-11-20 20:03:57 -0700 (Thu, 20 Nov 2008) | 4 lines
  r185015 | imp | 2008-11-16 18:32:29 -0700 (Sun, 16 Nov 2008) | 8 lines
  r184981 | imp | 2008-11-14 22:22:06 -0700 (Fri, 14 Nov 2008) | 5 lines
  
  These commits move all the parsing of the CIS to where the card is
  detected, rather than when the open call for the device happens.  This
  means that we can now reliably get this info from cards.  Atheros
  network cards in conjunction with the HAL were a primary motivator for
  this fix, although other applications benefit.

Modified:
  stable/7/sys/dev/cardbus/cardbus.c
  stable/7/sys/dev/cardbus/cardbus_cis.c
  stable/7/sys/dev/cardbus/cardbus_device.c
  stable/7/sys/dev/cardbus/cardbusvar.h

Modified: stable/7/sys/dev/cardbus/cardbus.c
==============================================================================
--- stable/7/sys/dev/cardbus/cardbus.c	Wed Jun 10 19:03:23 2009	(r193944)
+++ stable/7/sys/dev/cardbus/cardbus.c	Wed Jun 10 19:21:23 2009	(r193945)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003 M. Warner Losh.  All Rights Reserved.
+ * Copyright (c) 2003-2008 M. Warner Losh.  All Rights Reserved.
  * Copyright (c) 2000,2001 Jonathan Chen.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -99,20 +99,18 @@ cardbus_probe(device_t cbdev)
 static int
 cardbus_attach(device_t cbdev)
 {
-	struct cardbus_softc *sc = device_get_softc(cbdev);
+	struct cardbus_softc *sc;
 
+	sc = device_get_softc(cbdev);
 	sc->sc_dev = cbdev;
-	cardbus_device_create(sc);
 	return (0);
 }
 
 static int
 cardbus_detach(device_t cbdev)
 {
-	struct cardbus_softc *sc = device_get_softc(cbdev);
 
 	cardbus_detach_card(cbdev);
-	cardbus_device_destroy(sc);
 	return (0);
 }
 
@@ -165,7 +163,9 @@ cardbus_attach_card(device_t cbdev)
 	int bus, domain, slot, func;
 	int cardattached = 0;
 	int cardbusfunchigh = 0;
+	struct cardbus_softc *sc;
 
+	sc = device_get_softc(cbdev);
 	cardbus_detach_card(cbdev); /* detach existing cards */
 	POWER_ENABLE_SOCKET(brdev, cbdev);
 	domain = pcib_get_domain(cbdev);
@@ -192,6 +192,7 @@ cardbus_attach_card(device_t cbdev)
 		dinfo->pci.cfg.dev = child;
 		resource_list_init(&dinfo->pci.resources);
 		device_set_ivars(child, dinfo);
+		cardbus_device_create(sc, dinfo, cbdev, child);
 		if (cardbus_do_cis(cbdev, child) != 0)
 			DEVPRINTF((cbdev, "Warning: Bogus CIS ignored\n"));
 		pci_cfg_save(dinfo->pci.cfg.dev, &dinfo->pci, 0);
@@ -235,6 +236,7 @@ cardbus_detach_card(device_t cbdev)
 		if (status == DS_ATTACHED || status == DS_BUSY)
 			device_detach(devlist[tmp]);
 		cardbus_release_all_resources(cbdev, dinfo);
+		cardbus_device_destroy(dinfo);
 		device_delete_child(cbdev, devlist[tmp]);
 		pci_freecfg((struct pci_devinfo *)dinfo);
 	}

Modified: stable/7/sys/dev/cardbus/cardbus_cis.c
==============================================================================
--- stable/7/sys/dev/cardbus/cardbus_cis.c	Wed Jun 10 19:03:23 2009	(r193944)
+++ stable/7/sys/dev/cardbus/cardbus_cis.c	Wed Jun 10 19:21:23 2009	(r193945)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2005-2008, M. Warner Losh
  * Copyright (c) 2000,2001 Jonathan Chen.
  * All rights reserved.
  *
@@ -318,29 +319,27 @@ decode_tuple_bar(device_t cbdev, device_
 	if (type == SYS_RES_MEMORY) {
 		if (reg & TPL_BAR_REG_PREFETCHABLE)
 			dinfo->mprefetchable |= (1 << PCI_RID2BAR(bar));
-#if 0
 		/*
-		 * XXX: It appears from a careful reading of the spec
-		 * that we're not supposed to honor this when the bridge
-		 * is not on the main system bus.  PCI spec doesn't appear
-		 * to allow for memory ranges not listed in the bridge's
-		 * decode range to be decoded.  The PC Card spec seems to
-		 * indicate that this should only be done on x86 based
-		 * machines, which seems to imply that on non-x86 machines
-		 * the adddresses can be anywhere.  This further implies that
-		 * since the hardware can do it on non-x86 machines, it should
-		 * be able to do it on x86 machines.  Therefore, we can and
-		 * should ignore this hint.  Furthermore, the PC Card spec
-		 * recommends always allocating memory above 1MB, contradicting
-		 * the other part of the PC Card spec.
+		 * The PC Card spec says we're only supposed to honor this
+		 * hint when the cardbus bridge is a child of pci0 (the main
+		 * bus).  The PC Card spec seems to indicate that this should
+		 * only be done on x86 based machines, which suggests that on
+		 * non-x86 machines the adddresses can be anywhere.  Since the
+		 * hardware can do it on non-x86 machines, it should be able
+		 * to do it on x86 machines too.  Therefore, we can and should
+		 * ignore this hint.  Furthermore, the PC Card spec recommends
+		 * always allocating memory above 1MB, contradicting the other
+		 * part of the PC Card spec, it seems.  We make note of it,
+		 * but otherwise don't use this information.
 		 *
-		 * NetBSD ignores this bit, but it also ignores the
-		 * prefetchable bit too, so that's not an indication of
-		 * correctness.
+		 * Some Realtek cards have this set in their CIS, but fail
+		 * to actually work when mapped this way, and experience
+		 * has shown ignoring this big to be a wise choice.
+		 *
+		 * XXX We should cite chapter and verse for standard refs.
 		 */
 		if (reg & TPL_BAR_REG_BELOW1MB)
 			dinfo->mbelow1mb |= (1 << PCI_RID2BAR(bar));
-#endif
 	}
 
 	return (0);

Modified: stable/7/sys/dev/cardbus/cardbus_device.c
==============================================================================
--- stable/7/sys/dev/cardbus/cardbus_device.c	Wed Jun 10 19:03:23 2009	(r193944)
+++ stable/7/sys/dev/cardbus/cardbus_device.c	Wed Jun 10 19:21:23 2009	(r193945)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2005, M. Warner Losh
+ * Copyright (c) 2005-2008, M. Warner Losh
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -63,26 +63,6 @@ static struct cdevsw cardbus_cdevsw = {
 	.d_name =	"cardbus"
 };
 
-int
-cardbus_device_create(struct cardbus_softc *sc)
-{
-	uint32_t minor;
-
-	minor = device_get_unit(sc->sc_dev) << 16;
-	sc->sc_cisdev = make_dev(&cardbus_cdevsw, minor, 0, 0, 0666,
-	    "cardbus%u.cis", device_get_unit(sc->sc_dev));
-	sc->sc_cisdev->si_drv1 = sc;
-	return (0);
-}
-
-int
-cardbus_device_destroy(struct cardbus_softc *sc)
-{
-	if (sc->sc_cisdev)
-		destroy_dev(sc->sc_cisdev);
-	return (0);
-}
-
 static int
 cardbus_build_cis(device_t cbdev, device_t child, int id,
     int len, uint8_t *tupledata, uint32_t start, uint32_t *off,
@@ -96,13 +76,17 @@ cardbus_build_cis(device_t cbdev, device
 	 * CISTPL_END is a special case, it has no length field.
 	 */
 	if (id == CISTPL_END) {
-		if (cis->len + 1 > sizeof(cis->buffer))
+		if (cis->len + 1 > sizeof(cis->buffer)) {
+			cis->len = 0;
 			return (ENOSPC);
+		}
 		cis->buffer[cis->len++] = id;
 		return (0);
 	}
-	if (cis->len + 2 + len > sizeof(cis->buffer))
+	if (cis->len + 2 + len > sizeof(cis->buffer)) {
+		cis->len = 0;
 		return (ENOSPC);
+	}
 	cis->buffer[cis->len++] = id;
 	cis->buffer[cis->len++] = len;
 	for (i = 0; i < len; i++)
@@ -110,52 +94,54 @@ cardbus_build_cis(device_t cbdev, device
 	return (0);
 }
 
-static	int
-cardbus_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
+static int
+cardbus_device_buffer_cis(device_t parent, device_t child,
+    struct cis_buffer *cbp)
 {
-	device_t parent, child;
-	device_t *kids;
-	int cnt, err;
-	struct cardbus_softc *sc;
 	struct tuple_callbacks cb[] = {
 		{CISTPL_GENERIC, "GENERIC", cardbus_build_cis}
 	};
 
-	sc = dev->si_drv1;
-	if (sc->sc_cis_open)
-		return (EBUSY);
-	parent = sc->sc_dev;
-	err = device_get_children(parent, &kids, &cnt);
-	if (err)
-		return err;
-	if (cnt == 0) {
-		free(kids, M_TEMP);
-		sc->sc_cis_open++;
-		sc->sc_cis = NULL;
-		return (0);
-	}
-	child = kids[0];
-	free(kids, M_TEMP);
-	sc->sc_cis = malloc(sizeof(*sc->sc_cis), M_TEMP, M_ZERO | M_WAITOK);
-	err = cardbus_parse_cis(parent, child, cb, sc->sc_cis);
-	if (err) {
-		free(sc->sc_cis, M_TEMP);
-		sc->sc_cis = NULL;
-		return (err);
-	}
-	sc->sc_cis_open++;
+	return (cardbus_parse_cis(parent, child, cb, cbp));
+}
+
+int
+cardbus_device_create(struct cardbus_softc *sc, struct cardbus_devinfo *devi,
+    device_t parent, device_t child)
+{
+	uint32_t minor;
+	int unit;
+
+	cardbus_device_buffer_cis(parent, child, &devi->sc_cis);
+	minor = (device_get_unit(sc->sc_dev) << 8) + devi->pci.cfg.func;
+	unit = device_get_unit(sc->sc_dev);
+	devi->sc_cisdev = make_dev(&cardbus_cdevsw, minor, 0, 0, 0666,
+	    "cardbus%d.%d.cis", unit, devi->pci.cfg.func);
+	if (devi->pci.cfg.func == 0)
+		make_dev_alias(devi->sc_cisdev, "cardbus%d.cis", unit);
+	devi->sc_cisdev->si_drv1 = devi;
+	return (0);
+}
+
+int
+cardbus_device_destroy(struct cardbus_devinfo *devi)
+{
+	if (devi->sc_cisdev)
+		destroy_dev(devi->sc_cisdev);
+	return (0);
+}
+
+static	int
+cardbus_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
+{
+
 	return (0);
 }
 
 static	int
 cardbus_close(struct cdev *dev, int fflags, int devtype, struct thread *td)
 {
-	struct cardbus_softc *sc;
 
-	sc = dev->si_drv1;
-	free(sc->sc_cis, M_TEMP);
-	sc->sc_cis = NULL;
-	sc->sc_cis_open = 0;
 	return (0);
 }
 
@@ -169,12 +155,12 @@ cardbus_ioctl(struct cdev *dev, u_long c
 static	int
 cardbus_read(struct cdev *dev, struct uio *uio, int ioflag)
 {
-	struct cardbus_softc *sc;
+	struct cardbus_devinfo *devi;
 
-	sc = dev->si_drv1;
+	devi = dev->si_drv1;
 	/* EOF */
-	if (sc->sc_cis == NULL || uio->uio_offset > sc->sc_cis->len)
+	if (uio->uio_offset >= devi->sc_cis.len)
 		return (0);
-	return (uiomove(sc->sc_cis->buffer + uio->uio_offset,
-	  MIN(uio->uio_resid, sc->sc_cis->len - uio->uio_offset), uio));
+	return (uiomove(devi->sc_cis.buffer + uio->uio_offset,
+	  MIN(uio->uio_resid, devi->sc_cis.len - uio->uio_offset), uio));
 }

Modified: stable/7/sys/dev/cardbus/cardbusvar.h
==============================================================================
--- stable/7/sys/dev/cardbus/cardbusvar.h	Wed Jun 10 19:03:23 2009	(r193944)
+++ stable/7/sys/dev/cardbus/cardbusvar.h	Wed Jun 10 19:21:23 2009	(r193945)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2008, M. Warner Losh
  * Copyright (c) 2000,2001 Jonathan Chen.
  * All rights reserved.
  *
@@ -29,12 +30,26 @@
 /*
  * Structure definitions for the Cardbus Bus driver
  */
+
+/*
+ * Static copy of the CIS buffer.  Technically, you aren't supposed
+ * to do this.  In practice, however, it works well.
+ */
+struct cis_buffer
+{
+	size_t	len;			/* Actual length of the CIS */
+	uint8_t buffer[2040];		/* small enough to be 2k */
+};
+
+/*
+ * Per child information for the PCI device.  Cardbus layers on some
+ * additional data.
+ */
 struct cardbus_devinfo
 {
 	struct pci_devinfo pci;
 	uint8_t        mprefetchable; /* bit mask of prefetchable BARs */
 	uint8_t        mbelow1mb; /* bit mask of BARs which require below 1Mb */
-	uint8_t        ibelow1mb; /* bit mask of BARs which require below 1Mb */
 	uint16_t	mfrid;		/* manufacturer id */
 	uint16_t	prodid;		/* product id */
 	u_int		funcid;		/* function id */
@@ -44,36 +59,33 @@ struct cardbus_devinfo
 		} lan;
 	} funce;
 	uint32_t	fepresent;	/* bit mask of funce values present */
+	struct cdev 	*sc_cisdev;
+	struct cis_buffer sc_cis;
 };
 
-struct cis_buffer
-{
-	size_t	len;			/* Actual length of the CIS */
-	uint8_t buffer[2040];		/* small enough to be 2k */
-};
-
+/*
+ * Per cardbus soft info.  Not sure why we even keep this around...
+ */
 struct cardbus_softc 
 {
-	/* XXX need mutex XXX */
 	device_t	sc_dev;
-	struct cdev 	*sc_cisdev;
-	struct cis_buffer *sc_cis;
-	int		sc_cis_open;
 };
 
+/*
+ * Per node callback structures.
+ */
 struct tuple_callbacks;
-
 typedef int (tuple_cb) (device_t cbdev, device_t child, int id, int len,
 		 uint8_t *tupledata, uint32_t start, uint32_t *off,
 		 struct tuple_callbacks *info, void *);
-
 struct tuple_callbacks {
 	int	id;
 	char	*name;
 	tuple_cb *func;
 };
 
-int	cardbus_device_create(struct cardbus_softc *);
-int	cardbus_device_destroy(struct cardbus_softc *);
+int	cardbus_device_create(struct cardbus_softc *sc,
+	    struct cardbus_devinfo *devi, device_t parent, device_t child);
+int	cardbus_device_destroy(struct cardbus_devinfo *devi);
 int	cardbus_parse_cis(device_t cbdev, device_t child,
 	    struct tuple_callbacks *callbacks, void *);
From imp at FreeBSD.org  Wed Jun 10 19:25:22 2009
From: imp at FreeBSD.org (Warner Losh)
Date: Wed Jun 10 19:25:34 2009
Subject: svn commit: r193946 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
Message-ID: <200906101925.n5AJPLSV023612@svn.freebsd.org>

Author: imp
Date: Wed Jun 10 19:25:21 2009
New Revision: 193946
URL: http://svn.freebsd.org/changeset/base/193946

Log:
  Commit merge info from my last commit.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
From jhb at FreeBSD.org  Wed Jun 10 19:57:55 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Wed Jun 10 19:58:06 2009
Subject: svn commit: r193948 - in stable/7: include lib/libc lib/libc/gen
Message-ID: <200906101957.n5AJvsGk024285@svn.freebsd.org>

Author: jhb
Date: Wed Jun 10 19:57:54 2009
New Revision: 193948
URL: http://svn.freebsd.org/changeset/base/193948

Log:
  MFC: Add a feature_present(3) function which checks to see if a named kernel
  feature is present by checking the kern.features sysctl MIB.

Added:
  stable/7/lib/libc/gen/feature_present.3
     - copied unchanged from r175220, head/lib/libc/gen/feature_present.3
  stable/7/lib/libc/gen/feature_present.c
     - copied unchanged from r175220, head/lib/libc/gen/feature_present.c
Modified:
  stable/7/include/   (props changed)
  stable/7/include/unistd.h
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/gen/Makefile.inc
  stable/7/lib/libc/gen/Symbol.map

Modified: stable/7/include/unistd.h
==============================================================================
--- stable/7/include/unistd.h	Wed Jun 10 19:25:46 2009	(r193947)
+++ stable/7/include/unistd.h	Wed Jun 10 19:57:54 2009	(r193948)
@@ -480,6 +480,7 @@ int	 des_setkey(const char *key);
 void	 endusershell(void);
 int	 exect(const char *, char * const *, char * const *);
 int	 execvP(const char *, const char *, char * const *);
+int	 feature_present(const char *);
 char	*fflagstostr(u_long);
 int	 getdomainname(char *, int);
 int	 getgrouplist(const char *, gid_t, gid_t *, int *);

Modified: stable/7/lib/libc/gen/Makefile.inc
==============================================================================
--- stable/7/lib/libc/gen/Makefile.inc	Wed Jun 10 19:25:46 2009	(r193947)
+++ stable/7/lib/libc/gen/Makefile.inc	Wed Jun 10 19:57:54 2009	(r193948)
@@ -10,7 +10,7 @@ SRCS+=  __getosreldate.c __xuname.c \
 	clock.c closedir.c confstr.c \
 	crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \
 	dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c errno.c \
-	exec.c fmtcheck.c fmtmsg.c fnmatch.c \
+	exec.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \
 	fpclassify.c frexp.c fstab.c ftok.c fts.c ftw.c \
 	getbootfile.c getbsize.c \
 	getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \
@@ -45,7 +45,8 @@ MAN+=	alarm.3 arc4random.3 \
 	basename.3 check_utility_compat.3 clock.3 \
 	confstr.3 ctermid.3 daemon.3 devname.3 directory.3 dirname.3 \
 	dladdr.3 dlinfo.3 dllockinit.3 dlopen.3 \
-	err.3 exec.3 fmtcheck.3 fmtmsg.3 fnmatch.3 fpclassify.3 frexp.3 \
+	err.3 exec.3 \
+	feature_present.3 fmtcheck.3 fmtmsg.3 fnmatch.3 fpclassify.3 frexp.3 \
 	ftok.3 fts.3 ftw.3 \
 	getbootfile.3 getbsize.3 getcap.3 getcontext.3 getcwd.3 \
 	getdiskbyname.3 getdomainname.3 getfsent.3 \

Modified: stable/7/lib/libc/gen/Symbol.map
==============================================================================
--- stable/7/lib/libc/gen/Symbol.map	Wed Jun 10 19:25:46 2009	(r193947)
+++ stable/7/lib/libc/gen/Symbol.map	Wed Jun 10 19:57:54 2009	(r193948)
@@ -338,6 +338,7 @@ FBSD_1.0 {
 
 FBSD_1.1 {
 	fdopendir;
+	feature_present;
 };
 
 FBSDprivate_1.0 {

Copied: stable/7/lib/libc/gen/feature_present.3 (from r175220, head/lib/libc/gen/feature_present.3)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/lib/libc/gen/feature_present.3	Wed Jun 10 19:57:54 2009	(r193948, copy of r175220, head/lib/libc/gen/feature_present.3)
@@ -0,0 +1,72 @@
+.\" Copyright (c) 2008 Yahoo!, Inc.
+.\" All rights reserved.
+.\" Written by: John Baldwin 
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 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. Neither the name of the author nor the names of any co-contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd January 8, 2008
+.Dt feature_present 3
+.Os
+.Sh NAME
+.Nm feature_present
+.Nd query presence of a kernel feature
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In unistd.h
+.Ft int
+.Fn feature_present "const char *feature"
+.Sh DESCRIPTION
+The
+.Fn feature_present
+function provides a method for an application to determine if a specific
+kernel feature is present in the currently running kernel.
+The
+.Fa feature
+argument specifies the name of the feature to check.
+The
+.Fn feature_present
+function will return 1 if the specified feature is present,
+otherwise it will return 0.
+If the
+.Fn feature_present
+function is not able to determine the presence of
+.Fa feature
+due to an internal error it will return 0.
+.Sh RETURN VALUES
+If
+.Fa feature
+is present then 1 is returned;
+otherwise 0 is returned.
+.Sh SEE ALSO
+.Xr sysconf 3 ,
+.Xr sysctl 3
+.Sh HISTORY
+The
+.Fn feature_present
+function first appeared in
+.Fx 8.0 .

Copied: stable/7/lib/libc/gen/feature_present.c (from r175220, head/lib/libc/gen/feature_present.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/lib/libc/gen/feature_present.c	Wed Jun 10 19:57:54 2009	(r193948, copy of r175220, head/lib/libc/gen/feature_present.c)
@@ -0,0 +1,62 @@
+/*-
+ * Copyright (c) 2008 Yahoo!, Inc.
+ * All rights reserved.
+ * Written by: John Baldwin 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 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. Neither the name of the author nor the names of any co-contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * Returns true if the named feature is present in the currently
+ * running kernel.  A feature's presence is indicated by an integer
+ * sysctl node called kern.feature. that is non-zero.
+ */
+int
+feature_present(const char *feature)
+{
+	char *mib;
+	size_t len;
+	int i;
+
+	if (asprintf(&mib, "kern.features.%s", feature) < 0)
+		return (0);
+	len = sizeof(i);
+	if (sysctlbyname(mib, &i, &len, NULL, 0) < 0) {
+		free(mib);
+		return (0);
+	}
+	free(mib);
+	if (len != sizeof(i))
+		return (0);
+	return (i != 0);
+}
From bms at incunabulum.net  Wed Jun 10 20:09:14 2009
From: bms at incunabulum.net (Bruce Simpson)
Date: Wed Jun 10 20:09:40 2009
Subject: svn commit: r192033 - stable/7/sys/dev/ata
In-Reply-To: <200906100954.20026.jhb@freebsd.org>
References: <200905130255.n4D2tMQZ040010@svn.freebsd.org>
	<200906090946.46103.jhb@freebsd.org>
	<4A2F7159.3090800@incunabulum.net>
	<200906100954.20026.jhb@freebsd.org>
Message-ID: <4A3012E3.7020305@incunabulum.net>

John Baldwin wrote:
> On an i386 8.0 kernel built here it is this line:
>
> 139		if ((error = ch->dma.load(request, NULL, &dummy))) {
>
> which would seem to indicate dma.load is NULL somehow.  My patch doesn't 
> affect that part of the code at all.  Are you using any modules or is ata 
> compiled into your kernel?  Given that the resource stuff worked and that it 
> worked on 7, I think I will commit it for now (and start the MFC timer) and 
> assume this is a separate bug.
>   

ATA was in kernel, no modules apart from acpi.ko were loaded.

thanks,
BMS


From delphij at FreeBSD.org  Thu Jun 11 00:42:55 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Thu Jun 11 00:43:11 2009
Subject: svn commit: r193965 - stable/7/usr.bin/truss
Message-ID: <200906110042.n5B0grQb030623@svn.freebsd.org>

Author: delphij
Date: Thu Jun 11 00:42:53 2009
New Revision: 193965
URL: http://svn.freebsd.org/changeset/base/193965

Log:
  MFC r192943: Correct off-by-one issue in truss(1) which happens when system
  call number is nsyscalls.  (mips bits intentionally left off since it's not
  in 7-stable yet)

Modified:
  stable/7/usr.bin/truss/   (props changed)
  stable/7/usr.bin/truss/amd64-fbsd.c
  stable/7/usr.bin/truss/amd64-fbsd32.c
  stable/7/usr.bin/truss/amd64-linux32.c
  stable/7/usr.bin/truss/i386-fbsd.c
  stable/7/usr.bin/truss/i386-linux.c
  stable/7/usr.bin/truss/ia64-fbsd.c
  stable/7/usr.bin/truss/powerpc-fbsd.c
  stable/7/usr.bin/truss/sparc64-fbsd.c

Modified: stable/7/usr.bin/truss/amd64-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/amd64-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/amd64-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -142,7 +142,7 @@ amd64_syscall_entry(struct trussinfo *tr
 
   fsc.number = syscall_num;
   fsc.name =
-    (syscall_num < 0 || syscall_num > nsyscalls) ?  NULL : syscallnames[syscall_num];
+    (syscall_num < 0 || syscall_num >= nsyscalls) ?  NULL : syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);
   }

Modified: stable/7/usr.bin/truss/amd64-fbsd32.c
==============================================================================
--- stable/7/usr.bin/truss/amd64-fbsd32.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/amd64-fbsd32.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -152,7 +152,7 @@ amd64_fbsd32_syscall_entry(struct trussi
 
   fsc.number = syscall_num;
   fsc.name =
-    (syscall_num < 0 || syscall_num > nsyscalls) ? NULL :
+    (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL :
       freebsd32_syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);

Modified: stable/7/usr.bin/truss/amd64-linux32.c
==============================================================================
--- stable/7/usr.bin/truss/amd64-linux32.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/amd64-linux32.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -124,7 +124,7 @@ amd64_linux32_syscall_entry(struct truss
 
   fsc.number = syscall_num;
   fsc.name =
-    (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux32_syscallnames[syscall_num];
+    (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux32_syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);
   }

Modified: stable/7/usr.bin/truss/i386-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/i386-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/i386-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -147,7 +147,7 @@ i386_syscall_entry(struct trussinfo *tru
 
   fsc.number = syscall_num;
   fsc.name =
-    (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num];
+    (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);
   }

Modified: stable/7/usr.bin/truss/i386-linux.c
==============================================================================
--- stable/7/usr.bin/truss/i386-linux.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/i386-linux.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -124,7 +124,7 @@ i386_linux_syscall_entry(struct trussinf
 
   fsc.number = syscall_num;
   fsc.name =
-    (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : linux_syscallnames[syscall_num];
+    (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux_syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);
   }

Modified: stable/7/usr.bin/truss/ia64-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/ia64-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/ia64-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -135,7 +135,7 @@ ia64_syscall_entry(struct trussinfo *tru
     syscall_num = (int)*parm_offset++;
 
   fsc.number = syscall_num;
-  fsc.name = (syscall_num < 0 || syscall_num > nsyscalls)
+  fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls)
       ? NULL : syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);

Modified: stable/7/usr.bin/truss/powerpc-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/powerpc-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/powerpc-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -149,7 +149,7 @@ powerpc_syscall_entry(struct trussinfo *
 
   fsc.number = syscall_num;
   fsc.name =
-    (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num];
+    (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);
   }

Modified: stable/7/usr.bin/truss/sparc64-fbsd.c
==============================================================================
--- stable/7/usr.bin/truss/sparc64-fbsd.c	Wed Jun 10 22:58:27 2009	(r193964)
+++ stable/7/usr.bin/truss/sparc64-fbsd.c	Thu Jun 11 00:42:53 2009	(r193965)
@@ -145,7 +145,7 @@ sparc64_syscall_entry(struct trussinfo *
 
   fsc.number = syscall_num;
   fsc.name =
-    (syscall_num < 0 || syscall_num > nsyscalls) ? NULL : syscallnames[syscall_num];
+    (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num];
   if (!fsc.name) {
     fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num);
   }
From edwin at FreeBSD.org  Thu Jun 11 07:40:22 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Thu Jun 11 07:40:31 2009
Subject: svn commit: r193974 - stable/7/share/zoneinfo
Message-ID: <200906110740.n5B7eLj5039289@svn.freebsd.org>

Author: edwin
Date: Thu Jun 11 07:40:21 2009
New Revision: 193974
URL: http://svn.freebsd.org/changeset/base/193974

Log:
  MFC of tzdata2009i:
  
  Bangladesh will go into DST on 20 June.

Modified:
  stable/7/share/zoneinfo/   (props changed)
  stable/7/share/zoneinfo/asia

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Thu Jun 11 05:48:49 2009	(r193973)
+++ stable/7/share/zoneinfo/asia	Thu Jun 11 07:40:21 2009	(r193974)
@@ -1,5 +1,5 @@
 # 
-# @(#)asia	8.32
+# @(#)asia	8.34
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -127,6 +127,48 @@ Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# 
 			3:00	-	AST
 
 # Bangladesh
+# From Alexander Krivenyshev (2009-05-13):
+# According to newspaper Asian Tribune (May 6, 2009) Bangladesh may introduce
+# Daylight Saving Time from June 16 to Sept 30
+#
+# Bangladesh to introduce daylight saving time likely from June 16
+# 
+# http://www.asiantribune.com/?q=node/17288
+# 
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh02.html
+# 
+#
+# "... Bangladesh government has decided to switch daylight saving time from
+# June
+# 16 till September 30 in a bid to ensure maximum use of daylight to cope with
+# crippling power crisis. "
+#
+# The switch will remain in effect from June 16 to Sept 30 (2009) but if
+# implemented the next year, it will come in force from April 1, 2010
+
+# From Steffen Thorsen (2009-06-02):
+# They have finally decided now, but changed the start date to midnight between
+# the 19th and 20th, and they have not set the end date yet.
+#
+# Some sources:
+# 
+# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
+# 
+# 
+# http://bdnews24.com/details.php?id=85889&cid=2
+# 
+#
+# Our wrap-up:
+# 
+# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
+# 
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Bang	2009	only	-	Jan	1	0:00	0	-
+Rule	Bang	2009	only	-	Jun	20	0:00	1:00	S
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
@@ -134,7 +176,8 @@ Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:30	-	IST	1942 Sep
 			6:30	-	BURT	1951 Sep 30
 			6:00	-	DACT	1971 Mar 26 # Dacca Time
-			6:00	-	BDT	# Bangladesh Time
+			6:00	-	BDT	2009 # Bangladesh Time
+			6:00	Bang	BD%sT
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
From des at FreeBSD.org  Thu Jun 11 07:52:36 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Thu Jun 11 07:52:54 2009
Subject: svn commit: r193977 - stable/7/usr.sbin/arp
Message-ID: <200906110752.n5B7qZdH039679@svn.freebsd.org>

Author: des
Date: Thu Jun 11 07:52:35 2009
New Revision: 193977
URL: http://svn.freebsd.org/changeset/base/193977

Log:
  merge r173716, r175206, r193976: silence warning, WARNS=6, prettify macro.

Modified:
  stable/7/usr.sbin/arp/   (props changed)
  stable/7/usr.sbin/arp/Makefile
  stable/7/usr.sbin/arp/arp.c

Modified: stable/7/usr.sbin/arp/Makefile
==============================================================================
--- stable/7/usr.sbin/arp/Makefile	Thu Jun 11 07:50:36 2009	(r193976)
+++ stable/7/usr.sbin/arp/Makefile	Thu Jun 11 07:52:35 2009	(r193977)
@@ -4,6 +4,6 @@
 PROG=	arp
 MAN=	arp.4 arp.8
 
-WARNS?=	3
+WARNS?=	6
 
 .include 

Modified: stable/7/usr.sbin/arp/arp.c
==============================================================================
--- stable/7/usr.sbin/arp/arp.c	Thu Jun 11 07:50:36 2009	(r193976)
+++ stable/7/usr.sbin/arp/arp.c	Thu Jun 11 07:52:35 2009	(r193977)
@@ -648,7 +648,7 @@ rtmsg(int cmd, struct sockaddr_inarp *ds
 	static int seq;
 	int rlen;
 	int l;
-	struct sockaddr_in so_mask;
+	struct sockaddr_in so_mask, *som = &so_mask;
 	static int s = -1;
 	static pid_t pid;
 
@@ -702,13 +702,17 @@ rtmsg(int cmd, struct sockaddr_inarp *ds
 	case RTM_GET:
 		rtm->rtm_addrs |= RTA_DST;
 	}
-#define NEXTADDR(w, s) \
-	if ((s) != NULL && rtm->rtm_addrs & (w)) { \
-		bcopy((s), cp, sizeof(*(s))); cp += SA_SIZE(s);}
+#define NEXTADDR(w, s)					   \
+	do {						   \
+		if ((s) != NULL && rtm->rtm_addrs & (w)) { \
+			bcopy((s), cp, sizeof(*(s)));	   \
+			cp += SA_SIZE(s);		   \
+		}					   \
+	} while (0)
 
 	NEXTADDR(RTA_DST, dst);
 	NEXTADDR(RTA_GATEWAY, sdl);
-	NEXTADDR(RTA_NETMASK, &so_mask);
+	NEXTADDR(RTA_NETMASK, som);
 
 	rtm->rtm_msglen = cp - (char *)&m_rtmsg;
 doit:
From des at FreeBSD.org  Thu Jun 11 10:32:14 2009
From: des at FreeBSD.org (Dag-Erling Smorgrav)
Date: Thu Jun 11 10:32:23 2009
Subject: svn commit: r193985 - stable/7/usr.sbin/arp
Message-ID: <200906111032.n5BAWDQ2044517@svn.freebsd.org>

Author: des
Date: Thu Jun 11 10:32:13 2009
New Revision: 193985
URL: http://svn.freebsd.org/changeset/base/193985

Log:
  merge r193984: lower WARNS due to alignment issues on sparc64.

Modified:
  stable/7/usr.sbin/arp/   (props changed)
  stable/7/usr.sbin/arp/Makefile

Modified: stable/7/usr.sbin/arp/Makefile
==============================================================================
--- stable/7/usr.sbin/arp/Makefile	Thu Jun 11 10:30:30 2009	(r193984)
+++ stable/7/usr.sbin/arp/Makefile	Thu Jun 11 10:32:13 2009	(r193985)
@@ -4,6 +4,6 @@
 PROG=	arp
 MAN=	arp.4 arp.8
 
-WARNS?=	6
+WARNS?=	3
 
 .include 
From gnn at FreeBSD.org  Thu Jun 11 14:18:34 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Thu Jun 11 14:18:46 2009
Subject: svn commit: r194001 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb
Message-ID: <200906111418.n5BEIXf6049843@svn.freebsd.org>

Author: gnn
Date: Thu Jun 11 14:18:33 2009
New Revision: 194001
URL: http://svn.freebsd.org/changeset/base/194001

Log:
  MFC of 193925
  
  Add a missing error statistic, the number of FCS errors on receive.
  
  Reviewed by:	jhb

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/cxgb_sge.c

Modified: stable/7/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_sge.c	Thu Jun 11 13:59:51 2009	(r194000)
+++ stable/7/sys/dev/cxgb/cxgb_sge.c	Thu Jun 11 14:18:33 2009	(r194001)
@@ -3636,6 +3636,7 @@ t3_add_configured_sysctls(adapter_t *sc)
 		CXGB_SYSCTL_ADD_QUAD(rx_mcast_frames);
 		CXGB_SYSCTL_ADD_QUAD(rx_bcast_frames);
 		CXGB_SYSCTL_ADD_QUAD(rx_pause);
+		CXGB_SYSCTL_ADD_QUAD(rx_fcs_errs);
 		CXGB_SYSCTL_ADD_QUAD(rx_align_errs);
 		CXGB_SYSCTL_ADD_QUAD(rx_symbol_errs);
 		CXGB_SYSCTL_ADD_QUAD(rx_data_errs);
From jhb at FreeBSD.org  Thu Jun 11 15:15:44 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Thu Jun 11 15:15:56 2009
Subject: svn commit: r194006 - in stable/7/sys: . boot/i386/libi386
	contrib/pf dev/ath/ath_hal
Message-ID: <200906111515.n5BFFeEB051178@svn.freebsd.org>

Author: jhb
Date: Thu Jun 11 15:15:40 2009
New Revision: 194006
URL: http://svn.freebsd.org/changeset/base/194006

Log:
  MFC: Don't attempt to free the GPT partition list for a disk with an empty
  GPT.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/boot/i386/libi386/biosdisk.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)

Modified: stable/7/sys/boot/i386/libi386/biosdisk.c
==============================================================================
--- stable/7/sys/boot/i386/libi386/biosdisk.c	Thu Jun 11 15:07:02 2009	(r194005)
+++ stable/7/sys/boot/i386/libi386/biosdisk.c	Thu Jun 11 15:15:40 2009	(r194006)
@@ -998,7 +998,8 @@ bd_open_gpt(struct open_disk *od, struct
 
 out:
     if (error) {
-	free(od->od_partitions);
+	if (od->od_nparts > 0)
+	    free(od->od_partitions);
 	od->od_flags &= ~BD_GPTOK;
     }
     return (error);
@@ -1052,7 +1053,7 @@ bd_closedisk(struct open_disk *od)
 	delay(3000000);
 #endif
 #ifdef LOADER_GPT_SUPPORT
-    if (od->od_flags & BD_GPTOK)
+    if (od->od_flags & BD_GPTOK && od->od_nparts > 0)
 	free(od->od_partitions);
 #endif
     free(od);
From marius at FreeBSD.org  Thu Jun 11 15:49:47 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Thu Jun 11 15:49:53 2009
Subject: svn commit: r194008 - stable/7/share/man/man9
Message-ID: <200906111549.n5BFnjbM052016@svn.freebsd.org>

Author: marius
Date: Thu Jun 11 15:49:45 2009
New Revision: 194008
URL: http://svn.freebsd.org/changeset/base/194008

Log:
  MFC: r190283, r192026
  
  Correct the documentation of BUS_DMA_NOCACHE for amd64 and i386,
  it's a flag to bus_dmamem_alloc(9) rather than bus_dmamap_load(9)
  there.

Modified:
  stable/7/share/man/man9/bus_dma.9

Modified: stable/7/share/man/man9/bus_dma.9
==============================================================================
--- stable/7/share/man/man9/bus_dma.9	Thu Jun 11 15:16:07 2009	(r194007)
+++ stable/7/share/man/man9/bus_dma.9	Thu Jun 11 15:49:45 2009	(r194008)
@@ -60,7 +60,7 @@
 .\" $FreeBSD$
 .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $
 .\"
-.Dd November 16, 2008
+.Dd May 12, 2009
 .Dt BUS_DMA 9
 .Os
 .Sh NAME
@@ -562,14 +562,12 @@ Are as follows:
 The load should not be deferred in case of insufficient mapping resources,
 and instead should return immediately with an appropriate error.
 .It Dv BUS_DMA_NOCACHE
-The allocated memory will not be cached in the processor caches.
-All memory accesses appear on the bus and are executed
-without reordering.
-On the amd64 and i386 architectures this flag results in the
-Strong Uncacheable PAT to be set for the allocated virtual address range.
-The
+The generated transactions to and from the virtual page are non-cacheable.
+For
+.Fn bus_dmamap_load ,
+the
 .Dv BUS_DMA_NOCACHE
-flag is currently implemented on amd64, i386 and sparc64.
+flag is currently implemented on sparc64.
 .El
 .El
 .Pp
@@ -785,6 +783,16 @@ the
 flag is currently implemented on arm and sparc64.
 .It Dv BUS_DMA_ZERO
 Causes the allocated memory to be set to all zeros.
+.It Dv BUS_DMA_NOCACHE
+The allocated memory will not be cached in the processor caches.
+All memory accesses appear on the bus and are executed
+without reordering.
+For
+.Fn bus_dmamem_alloc ,
+the
+.Dv BUS_DMA_NOCACHE
+flag is currently implemented on amd64 and i386 where it results in the
+Strong Uncacheable PAT to be set for the allocated virtual address range.
 .El
 .It Fa mapp
 Pointer to a
From marius at FreeBSD.org  Thu Jun 11 15:51:15 2009
From: marius at FreeBSD.org (Marius Strobl)
Date: Thu Jun 11 15:51:32 2009
Subject: svn commit: r194010 - stable/7/share/man/man9
Message-ID: <200906111551.n5BFpEnd052138@svn.freebsd.org>

Author: marius
Date: Thu Jun 11 15:51:14 2009
New Revision: 194010
URL: http://svn.freebsd.org/changeset/base/194010

Log:
  MFC: r190283, r192026
  
  Correct the documentation of BUS_DMA_NOCACHE for amd64 and i386,
  it's a flag to bus_dmamem_alloc(9) rather than bus_dmamap_load(9)
  there.

Modified:
  stable/7/share/man/man9/   (props changed)
From avg at FreeBSD.org  Thu Jun 11 18:10:18 2009
From: avg at FreeBSD.org (Andriy Gapon)
Date: Thu Jun 11 18:10:35 2009
Subject: svn commit: r194031 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/ichwd
Message-ID: <200906111810.n5BIAHhZ056173@svn.freebsd.org>

Author: avg
Date: Thu Jun 11 18:10:17 2009
New Revision: 194031
URL: http://svn.freebsd.org/changeset/base/194031

Log:
  MFC r189305: ichwd: correct range check for timeout value
  
  Approved by:	jhb (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/ichwd/ichwd.c

Modified: stable/7/sys/dev/ichwd/ichwd.c
==============================================================================
--- stable/7/sys/dev/ichwd/ichwd.c	Thu Jun 11 18:04:57 2009	(r194030)
+++ stable/7/sys/dev/ichwd/ichwd.c	Thu Jun 11 18:10:17 2009	(r194031)
@@ -261,8 +261,8 @@ ichwd_tmr_set(struct ichwd_softc *sc, un
 		uint16_t tmr_val16 = ichwd_read_tco_2(sc, TCO_TMR2);
 
 		tmr_val16 &= 0xfc00;
-		if (timeout > 0x0bff)
-			timeout = 0x0bff;
+		if (timeout > 0x03ff)
+			timeout = 0x03ff;
 		tmr_val16 |= timeout;
 		ichwd_write_tco_2(sc, TCO_TMR2, tmr_val16);
 	}
From avg at FreeBSD.org  Thu Jun 11 18:15:05 2009
From: avg at FreeBSD.org (Andriy Gapon)
Date: Thu Jun 11 18:15:10 2009
Subject: svn commit: r194032 - stable/7/sbin/newfs_msdos
Message-ID: <200906111815.n5BIF4Ti056347@svn.freebsd.org>

Author: avg
Date: Thu Jun 11 18:15:03 2009
New Revision: 194032
URL: http://svn.freebsd.org/changeset/base/194032

Log:
  MFC r189112: newfs_msdos: work with media that doesn't have any CHS params
  
  Approved by:	jhb (mentor)

Modified:
  stable/7/sbin/newfs_msdos/   (props changed)
  stable/7/sbin/newfs_msdos/newfs_msdos.c

Modified: stable/7/sbin/newfs_msdos/newfs_msdos.c
==============================================================================
--- stable/7/sbin/newfs_msdos/newfs_msdos.c	Thu Jun 11 18:10:17 2009	(r194031)
+++ stable/7/sbin/newfs_msdos/newfs_msdos.c	Thu Jun 11 18:15:03 2009	(r194032)
@@ -739,13 +739,25 @@ getdiskinfo(int fd, const char *fname, c
     /* Maybe it's a fixed drive */
     if (lp == NULL) {
 	if (ioctl(fd, DIOCGDINFO, &dlp) == -1) {
-	    if (ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1)
+	    if (bpb->bps == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1)
 		errx(1, "Cannot get sector size, %s", strerror(errno));
-	    if (ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1)
-		errx(1, "Cannot get number of sectors, %s", strerror(errno));
-	    if (ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks)== -1)
-		errx(1, "Cannot get number of heads, %s", strerror(errno));
+
+	    /* XXX Should we use bpb->bps if it's set? */
 	    dlp.d_secperunit = ms / dlp.d_secsize;
+
+	    if (bpb->spt == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) {
+		warnx("Cannot get number of sectors per track, %s", strerror(errno));
+		dlp.d_nsectors = 63;
+	    }
+	    if (bpb->hds == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) {
+		warnx("Cannot get number of heads, %s", strerror(errno));
+		if (dlp.d_secperunit <= 63*1*1024)
+		    dlp.d_ntracks = 1;
+		else if (dlp.d_secperunit <= 63*16*1024)
+		    dlp.d_ntracks = 16;
+		else
+		    dlp.d_ntracks = 255;
+	    }
 	}
 
 	hs = (ms / dlp.d_secsize) - dlp.d_secperunit;
From avg at FreeBSD.org  Thu Jun 11 18:19:49 2009
From: avg at FreeBSD.org (Andriy Gapon)
Date: Thu Jun 11 18:20:01 2009
Subject: svn commit: r194033 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	pci
Message-ID: <200906111819.n5BIJmfT056487@svn.freebsd.org>

Author: avg
Date: Thu Jun 11 18:19:48 2009
New Revision: 194033
URL: http://svn.freebsd.org/changeset/base/194033

Log:
  MFC r189882: intpm: minor enhancements
  
  Approved by:	jhb (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/pci/intpm.c

Modified: stable/7/sys/pci/intpm.c
==============================================================================
--- stable/7/sys/pci/intpm.c	Thu Jun 11 18:15:03 2009	(r194032)
+++ stable/7/sys/pci/intpm.c	Thu Jun 11 18:19:48 2009	(r194033)
@@ -167,10 +167,6 @@ intsmb_attach(device_t dev)
 		goto fail;
 	}
 
-	value = pci_read_config(dev, PCI_BASE_ADDR_PM, 4);
-	device_printf(dev, "PM %s %x\n", (value & 1) ? "I/O mapped" : "Memory",
-	    value & 0xfffe);
-
 	sc->isbusy = 0;
 	sc->smbus = device_add_child(dev, "smbus", -1);
 	if (sc->smbus == NULL) {
@@ -365,13 +361,13 @@ intsmb_start(struct intsmb_softc *sc, un
 	tmp |= PIIX4_SMBHSTCNT_START;
 
 	/* While not in autoconfiguration enable interrupts. */
-	if (!cold || !nointr)
+	if (!cold && !nointr)
 		tmp |= PIIX4_SMBHSTCNT_INTREN;
 	bus_write_1(sc->io_res, PIIX4_SMBHSTCNT, tmp);
 }
 
 static int
-intsmb_error(int status)
+intsmb_error(device_t dev, int status)
 {
 	int error = 0;
 
@@ -381,6 +377,10 @@ intsmb_error(int status)
 		error |= SMB_ECOLLI;
 	if (status & PIIX4_SMBHSTSTAT_FAIL)
 		error |= SMB_ENOACK;
+
+	if (error != 0 && bootverbose)
+		device_printf(dev, "error = %d, status = %#x\n", error, status);
+
 	return (error);
 }
 
@@ -410,7 +410,7 @@ intsmb_stop_poll(struct intsmb_softc *sc
 		status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS);
 		if (!(status & PIIX4_SMBHSTSTAT_BUSY)) {
 			sc->isbusy = 0;
-			error = intsmb_error(status);
+			error = intsmb_error(sc->dev, status);
 			if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR))
 				device_printf(sc->dev, "unknown cause why?\n");
 			return (error);
@@ -442,7 +442,7 @@ intsmb_stop(struct intsmb_softc *sc)
 	if (error == 0) {
 		status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS);
 		if (!(status & PIIX4_SMBHSTSTAT_BUSY)) {
-			error = intsmb_error(status);
+			error = intsmb_error(sc->dev, status);
 			if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR))
 				device_printf(sc->dev, "unknown cause why?\n");
 #ifdef ENABLE_ALART
From avg at FreeBSD.org  Thu Jun 11 18:29:12 2009
From: avg at FreeBSD.org (Andriy Gapon)
Date: Thu Jun 11 18:29:30 2009
Subject: svn commit: r194034 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	kern
Message-ID: <200906111829.n5BITBfd056767@svn.freebsd.org>

Author: avg
Date: Thu Jun 11 18:29:11 2009
New Revision: 194034
URL: http://svn.freebsd.org/changeset/base/194034

Log:
  MFC r192379: sysctl_rman: report shared resources to devinfo
  
  Approved by:	jhb (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/kern/subr_rman.c

Modified: stable/7/sys/kern/subr_rman.c
==============================================================================
--- stable/7/sys/kern/subr_rman.c	Thu Jun 11 18:19:48 2009	(r194033)
+++ stable/7/sys/kern/subr_rman.c	Thu Jun 11 18:29:11 2009	(r194034)
@@ -835,6 +835,7 @@ sysctl_rman(SYSCTL_HANDLER_ARGS)
 	int			rman_idx, res_idx;
 	struct rman		*rm;
 	struct resource_i	*res;
+	struct resource_i	*sres;
 	struct u_rman		urm;
 	struct u_resource	ures;
 	int			error;
@@ -880,35 +881,44 @@ sysctl_rman(SYSCTL_HANDLER_ARGS)
 	 */
 	mtx_lock(rm->rm_mtx);
 	TAILQ_FOREACH(res, &rm->rm_list, r_link) {
-		if (res_idx-- == 0) {
-			bzero(&ures, sizeof(ures));
-			ures.r_handle = (uintptr_t)res;
-			ures.r_parent = (uintptr_t)res->r_rm;
-			ures.r_device = (uintptr_t)res->r_dev;
-			if (res->r_dev != NULL) {
-				if (device_get_name(res->r_dev) != NULL) {
-					snprintf(ures.r_devname, RM_TEXTLEN,
-					    "%s%d",
-					    device_get_name(res->r_dev),
-					    device_get_unit(res->r_dev));
-				} else {
-					strlcpy(ures.r_devname, "nomatch",
-					    RM_TEXTLEN);
+		if (res->r_sharehead != NULL) {
+			LIST_FOREACH(sres, res->r_sharehead, r_sharelink)
+				if (res_idx-- == 0) {
+					res = sres;
+					goto found;
 				}
-			} else {
-				ures.r_devname[0] = '\0';
-			}
-			ures.r_start = res->r_start;
-			ures.r_size = res->r_end - res->r_start + 1;
-			ures.r_flags = res->r_flags;
-
-			mtx_unlock(rm->rm_mtx);
-			error = SYSCTL_OUT(req, &ures, sizeof(ures));
-			return (error);
 		}
+		else if (res_idx-- == 0)
+				goto found;
 	}
 	mtx_unlock(rm->rm_mtx);
 	return (ENOENT);
+
+found:
+	bzero(&ures, sizeof(ures));
+	ures.r_handle = (uintptr_t)res;
+	ures.r_parent = (uintptr_t)res->r_rm;
+	ures.r_device = (uintptr_t)res->r_dev;
+	if (res->r_dev != NULL) {
+		if (device_get_name(res->r_dev) != NULL) {
+			snprintf(ures.r_devname, RM_TEXTLEN,
+			    "%s%d",
+			    device_get_name(res->r_dev),
+			    device_get_unit(res->r_dev));
+		} else {
+			strlcpy(ures.r_devname, "nomatch",
+			    RM_TEXTLEN);
+		}
+	} else {
+		ures.r_devname[0] = '\0';
+	}
+	ures.r_start = res->r_start;
+	ures.r_size = res->r_end - res->r_start + 1;
+	ures.r_flags = res->r_flags;
+
+	mtx_unlock(rm->rm_mtx);
+	error = SYSCTL_OUT(req, &ures, sizeof(ures));
+	return (error);
 }
 
 SYSCTL_NODE(_hw_bus, OID_AUTO, rman, CTLFLAG_RD, sysctl_rman,
From avg at FreeBSD.org  Thu Jun 11 18:32:54 2009
From: avg at FreeBSD.org (Andriy Gapon)
Date: Thu Jun 11 18:33:15 2009
Subject: svn commit: r194035 - stable/7/usr.bin/find
Message-ID: <200906111832.n5BIWr5N056897@svn.freebsd.org>

Author: avg
Date: Thu Jun 11 18:32:53 2009
New Revision: 194035
URL: http://svn.freebsd.org/changeset/base/194035

Log:
  MFC r192381: find: do not silently disable -L when -delete is used
  
  Approved by:	jhb (mentor)

Modified:
  stable/7/usr.bin/find/   (props changed)
  stable/7/usr.bin/find/function.c

Modified: stable/7/usr.bin/find/function.c
==============================================================================
--- stable/7/usr.bin/find/function.c	Thu Jun 11 18:29:11 2009	(r194034)
+++ stable/7/usr.bin/find/function.c	Thu Jun 11 18:32:53 2009	(r194035)
@@ -427,11 +427,13 @@ f_delete(PLAN *plan __unused, FTSENT *en
 
 	/* sanity check */
 	if (isdepth == 0 ||			/* depth off */
-	    (ftsoptions & FTS_NOSTAT) ||	/* not stat()ing */
-	    !(ftsoptions & FTS_PHYSICAL) ||	/* physical off */
-	    (ftsoptions & FTS_LOGICAL))		/* or finally, logical on */
+	    (ftsoptions & FTS_NOSTAT))		/* not stat()ing */
 		errx(1, "-delete: insecure options got turned on");
 
+	if (!(ftsoptions & FTS_PHYSICAL) ||	/* physical off */
+	    (ftsoptions & FTS_LOGICAL))		/* or finally, logical on */
+		errx(1, "-delete: forbidden when symlinks are followed");
+
 	/* Potentially unsafe - do not accept relative paths whatsoever */
 	if (strchr(entry->fts_accpath, '/') != NULL)
 		errx(1, "-delete: %s: relative path potentially not safe",
@@ -462,8 +464,6 @@ c_delete(OPTION *option, char ***argvp _
 {
 
 	ftsoptions &= ~FTS_NOSTAT;	/* no optimise */
-	ftsoptions |= FTS_PHYSICAL;	/* disable -follow */
-	ftsoptions &= ~FTS_LOGICAL;	/* disable -follow */
 	isoutput = 1;			/* possible output */
 	isdepth = 1;			/* -depth implied */
 
From avg at FreeBSD.org  Thu Jun 11 18:39:33 2009
From: avg at FreeBSD.org (Andriy Gapon)
Date: Thu Jun 11 18:39:49 2009
Subject: svn commit: r194036 - in stable/7/sys: . compat/linux contrib/pf
	dev/ath/ath_hal
Message-ID: <200906111839.n5BIdWat057078@svn.freebsd.org>

Author: avg
Date: Thu Jun 11 18:39:31 2009
New Revision: 194036
URL: http://svn.freebsd.org/changeset/base/194036

Log:
  MFC r192899: linux_ioctl_cdrom: reduce stack usage
  
  Approved by:	jhb (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/compat/linux/linux_ioctl.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)

Modified: stable/7/sys/compat/linux/linux_ioctl.c
==============================================================================
--- stable/7/sys/compat/linux/linux_ioctl.c	Thu Jun 11 18:32:53 2009	(r194035)
+++ stable/7/sys/compat/linux/linux_ioctl.c	Thu Jun 11 18:39:31 2009	(r194036)
@@ -1539,23 +1539,28 @@ linux_ioctl_cdrom(struct thread *td, str
 	/* LINUX_CDROMAUDIOBUFSIZ */
 
 	case LINUX_DVD_READ_STRUCT: {
-		l_dvd_struct lds;
-		struct dvd_struct bds;
+		l_dvd_struct *lds;
+		struct dvd_struct *bds;
 
-		error = copyin((void *)args->arg, &lds, sizeof(lds));
+		lds = malloc(sizeof(*lds), M_LINUX, M_WAITOK);
+		bds = malloc(sizeof(*bds), M_LINUX, M_WAITOK);
+		error = copyin((void *)args->arg, lds, sizeof(*lds));
 		if (error)
-			break;
-		error = linux_to_bsd_dvd_struct(&lds, &bds);
+			goto out;
+		error = linux_to_bsd_dvd_struct(lds, bds);
 		if (error)
-			break;
-		error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)&bds,
+			goto out;
+		error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)bds,
 		    td->td_ucred, td);
 		if (error)
-			break;
-		error = bsd_to_linux_dvd_struct(&bds, &lds);
+			goto out;
+		error = bsd_to_linux_dvd_struct(bds, lds);
 		if (error)
-			break;
-		error = copyout(&lds, (void *)args->arg, sizeof(lds));
+			goto out;
+		error = copyout(lds, (void *)args->arg, sizeof(*lds));
+	out:
+		free(bds, M_LINUX);
+		free(lds, M_LINUX);
 		break;
 	}
 
From jhb at FreeBSD.org  Thu Jun 11 19:07:16 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Thu Jun 11 19:07:23 2009
Subject: svn commit: r194038 - in stable/7/sys/cddl: compat/opensolaris/sys
	contrib/opensolaris/common/zfs
	contrib/opensolaris/uts/common/fs/zfs/sys
	contrib/opensolaris/uts/common/sys contrib/opensolaris/ut...
Message-ID: <200906111907.n5BJ7FOd057716@svn.freebsd.org>

Author: jhb
Date: Thu Jun 11 19:07:15 2009
New Revision: 194038
URL: http://svn.freebsd.org/changeset/base/194038

Log:
  Trim duplicate copies of headers.

Modified:
  stable/7/sys/cddl/compat/opensolaris/sys/refstr.h
  stable/7/sys/cddl/compat/opensolaris/sys/sid.h
  stable/7/sys/cddl/compat/opensolaris/sys/sig.h
  stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h
  stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_fuid.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/acl_impl.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/extdirent.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/idmap.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep_data.h
  stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h

Modified: stable/7/sys/cddl/compat/opensolaris/sys/refstr.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/refstr.h	Thu Jun 11 18:42:31 2009	(r194037)
+++ stable/7/sys/cddl/compat/opensolaris/sys/refstr.h	Thu Jun 11 19:07:15 2009	(r194038)
@@ -32,105 +32,3 @@
 #define	refstr_value(str)	(str)
 
 #endif	/* _OPENSOLARIS_SYS_REFSTR_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- $ $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_REFSTR_H_
-#define	_OPENSOLARIS_SYS_REFSTR_H_
-
-#define	refstr_value(str)	(str)
-
-#endif	/* _OPENSOLARIS_SYS_REFSTR_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- $ $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_REFSTR_H_
-#define	_OPENSOLARIS_SYS_REFSTR_H_
-
-#define	refstr_value(str)	(str)
-
-#endif	/* _OPENSOLARIS_SYS_REFSTR_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- $ $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_REFSTR_H_
-#define	_OPENSOLARIS_SYS_REFSTR_H_
-
-#define	refstr_value(str)	(str)
-
-#endif	/* _OPENSOLARIS_SYS_REFSTR_H_ */

Modified: stable/7/sys/cddl/compat/opensolaris/sys/sid.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/sid.h	Thu Jun 11 18:42:31 2009	(r194037)
+++ stable/7/sys/cddl/compat/opensolaris/sys/sid.h	Thu Jun 11 19:07:15 2009	(r194038)
@@ -52,165 +52,3 @@ ksiddomain_rele(ksiddomain_t *kd)
 }
 
 #endif	/* _OPENSOLARIS_SYS_SID_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_SID_H_
-#define	_OPENSOLARIS_SYS_SID_H_
-
-typedef struct ksiddomain {
-	char	kd_name[16];	/* Domain part of SID */
-} ksiddomain_t;
-typedef void	ksid_t;
-
-static __inline ksiddomain_t *
-ksid_lookupdomain(const char *domain)
-{
-	ksiddomain_t *kd;
-
-	kd = kmem_alloc(sizeof(*kd), KM_SLEEP);
-	strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name));
-	return (kd);
-}
-
-static __inline void
-ksiddomain_rele(ksiddomain_t *kd)
-{
-
-	kmem_free(kd, sizeof(*kd));
-}
-
-#endif	/* _OPENSOLARIS_SYS_SID_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_SID_H_
-#define	_OPENSOLARIS_SYS_SID_H_
-
-typedef struct ksiddomain {
-	char	kd_name[16];	/* Domain part of SID */
-} ksiddomain_t;
-typedef void	ksid_t;
-
-static __inline ksiddomain_t *
-ksid_lookupdomain(const char *domain)
-{
-	ksiddomain_t *kd;
-
-	kd = kmem_alloc(sizeof(*kd), KM_SLEEP);
-	strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name));
-	return (kd);
-}
-
-static __inline void
-ksiddomain_rele(ksiddomain_t *kd)
-{
-
-	kmem_free(kd, sizeof(*kd));
-}
-
-#endif	/* _OPENSOLARIS_SYS_SID_H_ */
-/*-
- * Copyright (c) 2007 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_SID_H_
-#define	_OPENSOLARIS_SYS_SID_H_
-
-typedef struct ksiddomain {
-	char	kd_name[16];	/* Domain part of SID */
-} ksiddomain_t;
-typedef void	ksid_t;
-
-static __inline ksiddomain_t *
-ksid_lookupdomain(const char *domain)
-{
-	ksiddomain_t *kd;
-
-	kd = kmem_alloc(sizeof(*kd), KM_SLEEP);
-	strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name));
-	return (kd);
-}
-
-static __inline void
-ksiddomain_rele(ksiddomain_t *kd)
-{
-
-	kmem_free(kd, sizeof(*kd));
-}
-
-#endif	/* _OPENSOLARIS_SYS_SID_H_ */

Modified: stable/7/sys/cddl/compat/opensolaris/sys/sig.h
==============================================================================
--- stable/7/sys/cddl/compat/opensolaris/sys/sig.h	Thu Jun 11 18:42:31 2009	(r194037)
+++ stable/7/sys/cddl/compat/opensolaris/sys/sig.h	Thu Jun 11 19:07:15 2009	(r194038)
@@ -67,210 +67,3 @@ issig(int why)
 #endif	/* _KERNEL */
 
 #endif	/* _OPENSOLARIS_SYS_SIG_H_ */
-/*-
- * Copyright (c) 2008 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_SIG_H_
-#define	_OPENSOLARIS_SYS_SIG_H_
-
-#ifdef _KERNEL
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define	FORREAL		0
-#define	JUSTLOOKING	1
-
-static __inline int
-issig(int why)
-{
-	struct thread *td = curthread;
-	struct proc *p;
-	int sig;
-
-	ASSERT(why == FORREAL || why == JUSTLOOKING);
-	if (SIGPENDING(td)) {
-		if (why == JUSTLOOKING)
-			return (1);
-		p = td->td_proc;
-		PROC_LOCK(p);
-		mtx_lock(&p->p_sigacts->ps_mtx);
-		sig = cursig(td);
-		mtx_unlock(&p->p_sigacts->ps_mtx);
-		PROC_UNLOCK(p);
-		if (sig != 0)
-			return (1);
-	}
-	return (0);
-}
-
-#endif	/* _KERNEL */
-
-#endif	/* _OPENSOLARIS_SYS_SIG_H_ */
-/*-
- * Copyright (c) 2008 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_SIG_H_
-#define	_OPENSOLARIS_SYS_SIG_H_
-
-#ifdef _KERNEL
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define	FORREAL		0
-#define	JUSTLOOKING	1
-
-static __inline int
-issig(int why)
-{
-	struct thread *td = curthread;
-	struct proc *p;
-	int sig;
-
-	ASSERT(why == FORREAL || why == JUSTLOOKING);
-	if (SIGPENDING(td)) {
-		if (why == JUSTLOOKING)
-			return (1);
-		p = td->td_proc;
-		PROC_LOCK(p);
-		mtx_lock(&p->p_sigacts->ps_mtx);
-		sig = cursig(td);
-		mtx_unlock(&p->p_sigacts->ps_mtx);
-		PROC_UNLOCK(p);
-		if (sig != 0)
-			return (1);
-	}
-	return (0);
-}
-
-#endif	/* _KERNEL */
-
-#endif	/* _OPENSOLARIS_SYS_SIG_H_ */
-/*-
- * Copyright (c) 2008 Pawel Jakub Dawidek 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _OPENSOLARIS_SYS_SIG_H_
-#define	_OPENSOLARIS_SYS_SIG_H_
-
-#ifdef _KERNEL
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define	FORREAL		0
-#define	JUSTLOOKING	1
-
-static __inline int
-issig(int why)
-{
-	struct thread *td = curthread;
-	struct proc *p;
-	int sig;
-
-	ASSERT(why == FORREAL || why == JUSTLOOKING);
-	if (SIGPENDING(td)) {
-		if (why == JUSTLOOKING)
-			return (1);
-		p = td->td_proc;
-		PROC_LOCK(p);
-		mtx_lock(&p->p_sigacts->ps_mtx);
-		sig = cursig(td);
-		mtx_unlock(&p->p_sigacts->ps_mtx);
-		PROC_UNLOCK(p);
-		if (sig != 0)
-			return (1);
-	}
-	return (0);
-}
-
-#endif	/* _KERNEL */
-
-#endif	/* _OPENSOLARIS_SYS_SIG_H_ */

Modified: stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h	Thu Jun 11 18:42:31 2009	(r194037)
+++ stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h	Thu Jun 11 19:07:15 2009	(r194038)
@@ -42,135 +42,3 @@ extern boolean_t zfs_allocatable_devs(nv
 #endif
 
 #endif	/* _ZFS_COMUTIL_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ZFS_COMUTIL_H
-#define	_ZFS_COMUTIL_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-extern boolean_t zfs_allocatable_devs(nvlist_t *nv);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ZFS_COMUTIL_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ZFS_COMUTIL_H
-#define	_ZFS_COMUTIL_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-extern boolean_t zfs_allocatable_devs(nvlist_t *nv);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ZFS_COMUTIL_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ZFS_COMUTIL_H
-#define	_ZFS_COMUTIL_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-extern boolean_t zfs_allocatable_devs(nvlist_t *nv);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ZFS_COMUTIL_H */

Modified: stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h	Thu Jun 11 18:42:31 2009	(r194037)
+++ stable/7/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h	Thu Jun 11 19:07:15 2009	(r194038)
@@ -79,246 +79,3 @@ const char *zfs_deleg_canonicalize_perm(
 #endif
 
 #endif	/* _ZFS_DELEG_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ZFS_DELEG_H
-#define	_ZFS_DELEG_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#define	ZFS_DELEG_SET_NAME_CHR		'@'		/* set name lead char */
-#define	ZFS_DELEG_FIELD_SEP_CHR		'$'		/* field separator */
-
-/*
- * Max name length for a delegation attribute
- */
-#define	ZFS_MAX_DELEG_NAME	128
-
-#define	ZFS_DELEG_LOCAL		'l'
-#define	ZFS_DELEG_DESCENDENT	'd'
-#define	ZFS_DELEG_NA		'-'
-
-typedef enum {
-	ZFS_DELEG_NOTE_CREATE,
-	ZFS_DELEG_NOTE_DESTROY,
-	ZFS_DELEG_NOTE_SNAPSHOT,
-	ZFS_DELEG_NOTE_ROLLBACK,
-	ZFS_DELEG_NOTE_CLONE,
-	ZFS_DELEG_NOTE_PROMOTE,
-	ZFS_DELEG_NOTE_RENAME,
-	ZFS_DELEG_NOTE_RECEIVE,
-	ZFS_DELEG_NOTE_ALLOW,
-	ZFS_DELEG_NOTE_USERPROP,
-	ZFS_DELEG_NOTE_MOUNT,
-	ZFS_DELEG_NOTE_SHARE,
-	ZFS_DELEG_NOTE_NONE
-} zfs_deleg_note_t;
-
-typedef struct zfs_deleg_perm_tab {
-	char *z_perm;
-	zfs_deleg_note_t z_note;
-} zfs_deleg_perm_tab_t;
-
-extern zfs_deleg_perm_tab_t zfs_deleg_perm_tab[];
-
-int zfs_deleg_verify_nvlist(nvlist_t *nvlist);
-void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
-    char checkflag, void *data);
-const char *zfs_deleg_canonicalize_perm(const char *perm);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ZFS_DELEG_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ZFS_DELEG_H
-#define	_ZFS_DELEG_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#define	ZFS_DELEG_SET_NAME_CHR		'@'		/* set name lead char */
-#define	ZFS_DELEG_FIELD_SEP_CHR		'$'		/* field separator */
-
-/*
- * Max name length for a delegation attribute
- */
-#define	ZFS_MAX_DELEG_NAME	128
-
-#define	ZFS_DELEG_LOCAL		'l'
-#define	ZFS_DELEG_DESCENDENT	'd'
-#define	ZFS_DELEG_NA		'-'
-
-typedef enum {
-	ZFS_DELEG_NOTE_CREATE,
-	ZFS_DELEG_NOTE_DESTROY,
-	ZFS_DELEG_NOTE_SNAPSHOT,
-	ZFS_DELEG_NOTE_ROLLBACK,
-	ZFS_DELEG_NOTE_CLONE,
-	ZFS_DELEG_NOTE_PROMOTE,
-	ZFS_DELEG_NOTE_RENAME,
-	ZFS_DELEG_NOTE_RECEIVE,
-	ZFS_DELEG_NOTE_ALLOW,
-	ZFS_DELEG_NOTE_USERPROP,
-	ZFS_DELEG_NOTE_MOUNT,
-	ZFS_DELEG_NOTE_SHARE,
-	ZFS_DELEG_NOTE_NONE
-} zfs_deleg_note_t;
-
-typedef struct zfs_deleg_perm_tab {
-	char *z_perm;
-	zfs_deleg_note_t z_note;
-} zfs_deleg_perm_tab_t;
-
-extern zfs_deleg_perm_tab_t zfs_deleg_perm_tab[];
-
-int zfs_deleg_verify_nvlist(nvlist_t *nvlist);
-void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
-    char checkflag, void *data);
-const char *zfs_deleg_canonicalize_perm(const char *perm);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ZFS_DELEG_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ZFS_DELEG_H
-#define	_ZFS_DELEG_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#define	ZFS_DELEG_SET_NAME_CHR		'@'		/* set name lead char */
-#define	ZFS_DELEG_FIELD_SEP_CHR		'$'		/* field separator */
-
-/*
- * Max name length for a delegation attribute
- */
-#define	ZFS_MAX_DELEG_NAME	128
-
-#define	ZFS_DELEG_LOCAL		'l'
-#define	ZFS_DELEG_DESCENDENT	'd'
-#define	ZFS_DELEG_NA		'-'
-
-typedef enum {
-	ZFS_DELEG_NOTE_CREATE,
-	ZFS_DELEG_NOTE_DESTROY,
-	ZFS_DELEG_NOTE_SNAPSHOT,
-	ZFS_DELEG_NOTE_ROLLBACK,
-	ZFS_DELEG_NOTE_CLONE,
-	ZFS_DELEG_NOTE_PROMOTE,
-	ZFS_DELEG_NOTE_RENAME,
-	ZFS_DELEG_NOTE_RECEIVE,
-	ZFS_DELEG_NOTE_ALLOW,
-	ZFS_DELEG_NOTE_USERPROP,
-	ZFS_DELEG_NOTE_MOUNT,
-	ZFS_DELEG_NOTE_SHARE,
-	ZFS_DELEG_NOTE_NONE
-} zfs_deleg_note_t;
-
-typedef struct zfs_deleg_perm_tab {
-	char *z_perm;
-	zfs_deleg_note_t z_note;
-} zfs_deleg_perm_tab_t;
-
-extern zfs_deleg_perm_tab_t zfs_deleg_perm_tab[];
-
-int zfs_deleg_verify_nvlist(nvlist_t *nvlist);
-void zfs_deleg_whokey(char *attr, zfs_deleg_who_type_t type,
-    char checkflag, void *data);
-const char *zfs_deleg_canonicalize_perm(const char *perm);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ZFS_DELEG_H */

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h	Thu Jun 11 18:42:31 2009	(r194037)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h	Thu Jun 11 19:07:15 2009	(r194038)
@@ -71,222 +71,3 @@ boolean_t dsl_delegation_on(objset_t *os
 #endif
 
 #endif	/* _SYS_DSL_DELEG_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_SYS_DSL_DELEG_H
-#define	_SYS_DSL_DELEG_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-#include 
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#define	ZFS_DELEG_PERM_NONE		""
-#define	ZFS_DELEG_PERM_CREATE		"create"
-#define	ZFS_DELEG_PERM_DESTROY		"destroy"
-#define	ZFS_DELEG_PERM_SNAPSHOT		"snapshot"
-#define	ZFS_DELEG_PERM_ROLLBACK		"rollback"
-#define	ZFS_DELEG_PERM_CLONE		"clone"
-#define	ZFS_DELEG_PERM_PROMOTE		"promote"
-#define	ZFS_DELEG_PERM_RENAME		"rename"
-#define	ZFS_DELEG_PERM_MOUNT		"mount"
-#define	ZFS_DELEG_PERM_SHARE		"share"
-#define	ZFS_DELEG_PERM_SEND		"send"
-#define	ZFS_DELEG_PERM_RECEIVE		"receive"
-#define	ZFS_DELEG_PERM_ALLOW		"allow"
-#define	ZFS_DELEG_PERM_USERPROP		"userprop"
-#define	ZFS_DELEG_PERM_VSCAN		"vscan"
-
-/*
- * Note: the names of properties that are marked delegatable are also
- * valid delegated permissions
- */
-
-int dsl_deleg_get(const char *ddname, nvlist_t **nvp);
-int dsl_deleg_set(const char *ddname, nvlist_t *nvp, boolean_t unset);
-int dsl_deleg_access(const char *ddname, const char *perm, cred_t *cr);
-void dsl_deleg_set_create_perms(dsl_dir_t *dd, dmu_tx_t *tx, cred_t *cr);
-int dsl_deleg_can_allow(char *ddname, nvlist_t *nvp, cred_t *cr);
-int dsl_deleg_can_unallow(char *ddname, nvlist_t *nvp, cred_t *cr);
-int dsl_deleg_destroy(objset_t *os, uint64_t zapobj, dmu_tx_t *tx);
-boolean_t dsl_delegation_on(objset_t *os);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_DSL_DELEG_H */
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_SYS_DSL_DELEG_H
-#define	_SYS_DSL_DELEG_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include 
-#include 
-#include 
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#define	ZFS_DELEG_PERM_NONE		""
-#define	ZFS_DELEG_PERM_CREATE		"create"
-#define	ZFS_DELEG_PERM_DESTROY		"destroy"
-#define	ZFS_DELEG_PERM_SNAPSHOT		"snapshot"
-#define	ZFS_DELEG_PERM_ROLLBACK		"rollback"
-#define	ZFS_DELEG_PERM_CLONE		"clone"
-#define	ZFS_DELEG_PERM_PROMOTE		"promote"

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From jhb at FreeBSD.org  Thu Jun 11 21:37:25 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Thu Jun 11 21:37:40 2009
Subject: svn commit: r194040 - stable/7/lib/libc/gen
Message-ID: <200906112137.n5BLbO2S060767@svn.freebsd.org>

Author: jhb
Date: Thu Jun 11 21:37:23 2009
New Revision: 194040
URL: http://svn.freebsd.org/changeset/base/194040

Log:
  If the running kernel has support for shm_open() and shm_unlink() as
  system calls (i.e. 8.0+), then invoke the system calls instead of using
  open/fcntl/unlink.  This is a direct commit instead of an MFC since libc
  in 8.0 always uses the system calls directly.
  
  MFC after:	1 week

Modified:
  stable/7/lib/libc/gen/posixshm.c

Modified: stable/7/lib/libc/gen/posixshm.c
==============================================================================
--- stable/7/lib/libc/gen/posixshm.c	Thu Jun 11 21:32:26 2009	(r194039)
+++ stable/7/lib/libc/gen/posixshm.c	Thu Jun 11 21:37:23 2009	(r194040)
@@ -40,12 +40,34 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "un-namespace.h"
 
+static int _shm_in_kernel = -1;
+
+/* Wrappers for POSIX SHM system calls in newer kernels. */
+static __inline int
+_shm_open(const char *path, int flags, mode_t mode)
+{
+
+    return (syscall(482, path, flags, mode));
+}
+
+static __inline int
+_shm_unlink(const char *path)
+{
+
+    return (syscall(483, path));
+}
+
 int
 shm_open(const char *path, int flags, mode_t mode)
 {
 	int fd;
 	struct stat stab;
 
+	if (_shm_in_kernel == -1)
+		_shm_in_kernel = feature_present("posix_shm");
+	if (_shm_in_kernel == 1)
+		return (_shm_open(path, flags, mode));
+
 	if ((flags & O_ACCMODE) == O_WRONLY)
 		return (EINVAL);
 
@@ -68,5 +90,11 @@ shm_open(const char *path, int flags, mo
 int
 shm_unlink(const char *path)
 {
+
+	if (_shm_in_kernel == -1)
+		_shm_in_kernel = feature_present("posix_shm");
+	if (_shm_in_kernel == 1)
+		return (_shm_unlink(path));
+
 	return (unlink(path));
 }
From gnn at FreeBSD.org  Thu Jun 11 22:00:55 2009
From: gnn at FreeBSD.org (George V. Neville-Neil)
Date: Thu Jun 11 22:01:02 2009
Subject: svn commit: r194042 - stable/7/sys/dev/cxgb
Message-ID: <200906112200.n5BM0seQ061353@svn.freebsd.org>

Author: gnn
Date: Thu Jun 11 22:00:54 2009
New Revision: 194042
URL: http://svn.freebsd.org/changeset/base/194042

Log:
  MFC of 194039 and part of 190330
  
  Re-add the send queue tunable for people who do not use buffering.

Modified:
  stable/7/sys/dev/cxgb/cxgb_main.c
  stable/7/sys/dev/cxgb/cxgb_offload.c

Modified: stable/7/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_main.c	Thu Jun 11 21:41:51 2009	(r194041)
+++ stable/7/sys/dev/cxgb/cxgb_main.c	Thu Jun 11 22:00:54 2009	(r194042)
@@ -228,6 +228,15 @@ TUNABLE_INT("hw.cxgb.use_16k_clusters", 
 SYSCTL_UINT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN,
     &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue ");
 
+/*
+ * Tune the size of the output queue.
+ */
+int cxgb_snd_queue_len = IFQ_MAXLEN;
+TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len);
+SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN,
+    &cxgb_snd_queue_len, 0, "send queue size ");
+
+
 enum {
 	MAX_TXQ_ENTRIES      = 16384,
 	MAX_CTRL_TXQ_ENTRIES = 1024,
@@ -1029,7 +1038,7 @@ cxgb_port_attach(device_t dev)
 	ifp->if_timer = 0;	/* Disable ifnet watchdog */
 	ifp->if_watchdog = NULL;
 
-	ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+	ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len;
 	IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
 	IFQ_SET_READY(&ifp->if_snd);
 

Modified: stable/7/sys/dev/cxgb/cxgb_offload.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_offload.c	Thu Jun 11 21:41:51 2009	(r194041)
+++ stable/7/sys/dev/cxgb/cxgb_offload.c	Thu Jun 11 22:00:54 2009	(r194042)
@@ -98,6 +98,9 @@ register_tdev(struct t3cdev *tdev)
 static inline void
 unregister_tdev(struct t3cdev *tdev)
 {
+	if (!inited)
+		return;
+
 	mtx_lock(&cxgb_db_lock);
 	TAILQ_REMOVE(&ofld_dev_list, tdev, entry);
 	mtx_unlock(&cxgb_db_lock);	
From edwin at FreeBSD.org  Fri Jun 12 07:34:35 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Fri Jun 12 07:34:52 2009
Subject: svn commit: r194046 - stable/7/share/timedef
Message-ID: <200906120734.n5C7YY3t073895@svn.freebsd.org>

Author: edwin
Date: Fri Jun 12 07:34:34 2009
New Revision: 194046
URL: http://svn.freebsd.org/changeset/base/194046

Log:
  MFC of r193498
  
  [patch] Portuguese timedef
  
  In Portuguese, the names of the days of the week are not capitalized.
  Also there is always a dash before "feira" in the names of the days.
  For example: "segunda-feira" and not "segunda feira" (which has a
  completely different meaning).
  
  x_fmt is not correct either. The date separator should not be a dot
  but a slash. Example: 31/12/2005 if far more used in Portugal than
  31.12.2005.
  
  References:
  - a Portuguese online dictionary http://priberam.pt/dlpo/dlpo.aspx
  - http://answers.com/days_of_the_week (there are translations to
  	various languages, including Portuguese, at the bottom of the
  	page)
  - http://en.wikipedia.org/wiki/Week-day_names (there are translations
  	to various languages, including Portuguese, at the bottom of the
  	page)
  - a Portuguese style guide
  	http://www.publico.clix.pt/nos/livro_estilo/16d-palavras.html
  	("datas" section)
  
  PR:           conf/58595
  Submitted by: Chris Stenton 

Modified:
  stable/7/share/timedef/   (props changed)
  stable/7/share/timedef/pt_PT.ISO8859-1.src
  stable/7/share/timedef/pt_PT.UTF-8.src

Modified: stable/7/share/timedef/pt_PT.ISO8859-1.src
==============================================================================
--- stable/7/share/timedef/pt_PT.ISO8859-1.src	Fri Jun 12 06:13:53 2009	(r194045)
+++ stable/7/share/timedef/pt_PT.ISO8859-1.src	Fri Jun 12 07:34:34 2009	(r194046)
@@ -36,23 +36,23 @@ Dezembro
 #
 # Short weekdays names
 #
-Dom
-Seg
-Ter
-Qua
-Qui
-Sex
-Sáb
+dom
+seg
+ter
+qua
+qui
+sex
+sáb
 #
 # Long weekdays names
 #
-Domingo
-Segunda Feira
-Terça Feira
-Quarta Feira
-Quinta Feira
-Sexta Feira
-Sábado
+domingo
+segunda-feira
+terça-feira
+quarta-feira
+quinta-feira
+sexta-feira
+sábado
 #
 # X_fmt
 #
@@ -60,7 +60,7 @@ Sábado
 #
 # x_fmt
 #
-%d.%m.%Y
+%d/%m/%Y
 #
 # c_fmt
 #

Modified: stable/7/share/timedef/pt_PT.UTF-8.src
==============================================================================
--- stable/7/share/timedef/pt_PT.UTF-8.src	Fri Jun 12 06:13:53 2009	(r194045)
+++ stable/7/share/timedef/pt_PT.UTF-8.src	Fri Jun 12 07:34:34 2009	(r194046)
@@ -36,23 +36,23 @@ Dezembro
 #
 # Short weekdays names
 #
-Dom
-Seg
-Ter
-Qua
-Qui
-Sex
-Sáb
+dom
+seg
+ter
+qua
+qui
+sex
+sáb
 #
 # Long weekdays names
 #
-Domingo
-Segunda Feira
-Terça Feira
-Quarta Feira
-Quinta Feira
-Sexta Feira
-Sábado
+domingo
+segunda-feira
+terça-feira
+quarta-feira
+quinta-feira
+sexta-feira
+sábado
 #
 # X_fmt
 #
@@ -60,7 +60,7 @@ Sábado
 #
 # x_fmt
 #
-%d.%m.%Y
+%d/%m/%Y
 #
 # c_fmt
 #
From edwin at FreeBSD.org  Fri Jun 12 07:48:36 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Fri Jun 12 07:48:48 2009
Subject: svn commit: r194048 - stable/7/share/colldef
Message-ID: <200906120748.n5C7mZ6L074250@svn.freebsd.org>

Author: edwin
Date: Fri Jun 12 07:48:35 2009
New Revision: 194048
URL: http://svn.freebsd.org/changeset/base/194048

Log:
  MFC of r174887
  
  Add Turkish collate
  
  PR:		conf/118976
  Submitted by:	Ismail YENIGUL 

Added:
  stable/7/share/colldef/map.ISO8859-9
     - copied unchanged from r174887, head/share/colldef/map.ISO8859-9
  stable/7/share/colldef/tr_TR.ISO8859-9.src
     - copied unchanged from r174887, head/share/colldef/tr_TR.ISO8859-9.src
Modified:
  stable/7/share/colldef/   (props changed)
  stable/7/share/colldef/Makefile

Modified: stable/7/share/colldef/Makefile
==============================================================================
--- stable/7/share/colldef/Makefile	Fri Jun 12 07:39:10 2009	(r194047)
+++ stable/7/share/colldef/Makefile	Fri Jun 12 07:48:35 2009	(r194048)
@@ -36,6 +36,7 @@ LOCALES=	bg_BG.CP1251 \
 		sr_YU.ISO8859-5 \
 		sv_SE.ISO8859-1 \
 		sv_SE.ISO8859-15 \
+		tr_TR.ISO8859-9 \
 		uk_UA.CP1251 \
 		uk_UA.ISO8859-5 \
 		uk_UA.KOI8-U
@@ -60,7 +61,7 @@ ${locale}.out: map.${locale:E}
 CLEANFILES=	${FILES}
 
 ENCODINGS=	Big5 Big5HKSCS CP949 eucCN eucJP eucKR GB18030 GB2312 GBK \
-		ISO8859-1 ISO8859-2 ISO8859-9 ISO8859-15 SJIS US-ASCII UTF-8
+		ISO8859-1 ISO8859-2 ISO8859-15 SJIS US-ASCII UTF-8
 
 ISO8859-1_Big5=	is_IS:zh_TW
 ISO8859-1_ISO8859-1= ${ISO8859-15_ISO8859-15} pt_PT:pt_BR
@@ -83,7 +84,6 @@ US-ASCII_eucKR=	la_LN:ko_KR
 US-ASCII_GB18030= la_LN:zh_CN
 US-ASCII_GB2312= la_LN:zh_CN
 US-ASCII_GBK=	la_LN:zh_CN
-US-ASCII_ISO8859-9= la_LN:tr_TR
 US-ASCII_SJIS=	la_LN:ja_JP
 
 ASCIILINKS=	en_AU en_CA en_GB en_NZ en_US

Copied: stable/7/share/colldef/map.ISO8859-9 (from r174887, head/share/colldef/map.ISO8859-9)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/share/colldef/map.ISO8859-9	Fri Jun 12 07:48:35 2009	(r194048, copy of r174887, head/share/colldef/map.ISO8859-9)
@@ -0,0 +1,175 @@
+# $FreeBSD$
+NU \x00
+SH \x01
+SX \x02
+EX \x03
+ET \x04
+EQ \x05
+AK \x06
+BL \x07
+BS \x08
+HT \x09
+LF \x0a
+VT \x0b
+FF \x0c
+CR \x0d
+SO \x0e
+SI \x0f
+DL \x10
+D1 \x11
+D2 \x12
+D3 \x13
+D4 \x14
+NK \x15
+SY \x16
+EB \x17
+CN \x18
+EM \x19
+SB \x1a
+EC \x1b
+FS \x1c
+GS \x1d
+RS \x1e
+US \x1f
+SP \x20
+Nb \x23
+DO \x24
+At \x40
+<( \x5b
+// \x5c
+)> \x5d
+'> \x5e
+'! \x60
+(! \x7b
+!! \x7c
+!) \x7d
+'? \x7e
+DT \x7f
+PA \x80
+HO \x81
+BH \x82
+NH \x83
+IN \x84
+NL \x85
+SA \x86
+ES \x87
+HS \x88
+HJ \x89
+VS \x8a
+PD \x8b
+PU \x8c
+RI \x8d
+S2 \x8e
+S3 \x8f
+DC \x90
+P1 \x91
+P2 \x92
+TS \x93
+CC \x94
+MW \x95
+SG \x96
+EG \x97
+SS \x98
+GC \x99
+SC \x9a
+CI \x9b
+ST \x9c
+OC \x9d
+PM \x9e
+AC \x9f
+NS \xa0
+!I \xa1
+Ct \xa2
+Pd \xa3
+Cu \xa4
+Ye \xa5
+BB \xa6
+SE \xa7
+': \xa8
+Co \xa9
+-a \xaa
+<< \xab
+NO \xac
+-- \xad
+Rg \xae
+'m \xaf
+DG \xb0
++- \xb1
+2S \xb2
+3S \xb3
+'' \xb4
+My \xb5
+PI \xb6
+.M \xb7
+', \xb8
+1S \xb9
+-o \xba
+>> \xbb
+14 \xbc
+12 \xbd
+34 \xbe
+?I \xbf
+A! \xc0
+A' \xc1
+A> \xc2
+A? \xc3
+A: \xc4
+AA \xc5
+AE \xc6
+C, \xc7
+E! \xc8
+E' \xc9
+E> \xca
+E: \xcb
+I! \xcc
+I' \xcd
+I> \xce
+I: \xcf
+G( \xd0
+N? \xd1
+O! \xd2
+O' \xd3
+O> \xd4
+O? \xd5
+O: \xd6
+*X \xd7
+O/ \xd8
+U! \xd9
+U' \xda
+U> \xdb
+U: \xdc
+I. \xdd
+S, \xde
+ss \xdf
+a! \xe0
+a' \xe1
+a> \xe2
+a? \xe3
+a: \xe4
+aa \xe5
+ae \xe6
+c, \xe7
+e! \xe8
+e' \xe9
+e; \xea
+e: \xeb
+e. \xec
+i' \xed
+i> \xee
+i- \xef
+g( \xf0
+n? \xf1
+o! \xf2
+o' \xf3
+o> \xf4
+o? \xf5
+o: \xf6
+-: \xf7
+o/ \xf8
+u! \xf9
+u' \xfa
+u> \xfb
+u: \xfc
+i. \xfd
+s, \xfe
+y: \xff

Copied: stable/7/share/colldef/tr_TR.ISO8859-9.src (from r174887, head/share/colldef/tr_TR.ISO8859-9.src)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/7/share/colldef/tr_TR.ISO8859-9.src	Fri Jun 12 07:48:35 2009	(r194048, copy of r174887, head/share/colldef/tr_TR.ISO8859-9.src)
@@ -0,0 +1,36 @@
+# latin5 (backward compatible with ASCII)
+#
+# $FreeBSD$
+#
+charmap map.ISO8859-9
+order \
+# controls
+	;...;;;...;;\
+#
+	;;!;;\";<<<>;/>>;;\
+	;;;;;\
+	%;&;<',>;';\(;\);*;+;<+->;<-:>;<*X>;\,;<-->;-;.;/;\
+# digits
+	(0,<14>,<12>,<34>);(1,<1S>);(2,<2S>);(3,<3S>);4;...;9;\
+#
+	:;\;;\<;=;>;?;;;;;;;\
+# capital
+	(A,,,>,,,,);\
+	B;(C,);D;(E,,,>,);\
+	F;G;;H;(I,,,>,);;\
+	J;...;M;(N,);(O,,,>,,,);\
+	P;...;S;;T;(U,,,>,);\
+	V;W;X;Y;Z;\
+#
+	[;\\;];^;<':>;_;<'m>;<''>;`;\
+# small
+	(a,,,>,,,,);\
+	b;(c,);d;(e,,,,);\
+	f;g;;h;;(i,,,>,);\
+	j;...;m;(n,);(o,,,>,,,);\
+	p;...;s;;;t;(u,,,>,);\
+	v;w;x;(y,);z;\
+#
+	\{;;|;;\};~;<.M>;;;
From edwin at FreeBSD.org Wed Jun 17 03:15:24 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Wed Jun 17 03:15:41 2009 Subject: svn commit: r194327 - stable/7/share/monetdef Message-ID: <200906170315.n5H3FNBX061065@svn.freebsd.org> Author: edwin Date: Wed Jun 17 03:15:23 2009 New Revision: 194327 URL: http://svn.freebsd.org/changeset/base/194327 Log: MFC of 193962 Add euro symbol to pt_PT locale using other encodings PR: conf/98815 Submitted by: Rui Lopes Added: stable/7/share/monetdef/pt_PT.ISO8859-15.src - copied unchanged from r193962, head/share/monetdef/pt_PT.ISO8859-15.src stable/7/share/monetdef/pt_PT.UTF-8.src - copied unchanged from r193962, head/share/monetdef/pt_PT.UTF-8.src Modified: stable/7/share/monetdef/ (props changed) stable/7/share/monetdef/Makefile Modified: stable/7/share/monetdef/Makefile ============================================================================== --- stable/7/share/monetdef/Makefile Wed Jun 17 03:14:18 2009 (r194326) +++ stable/7/share/monetdef/Makefile Wed Jun 17 03:15:23 2009 (r194327) @@ -52,6 +52,8 @@ LOCALES= af_ZA.ISO8859-1 \ pl_PL.UTF-8 \ pt_BR.ISO8859-1 \ pt_PT.ISO8859-1 \ + pt_PT.ISO8859-15 \ + pt_PT.UTF-8 \ ro_RO.ISO8859-2 \ ru_RU.CP1251 \ ru_RU.CP866 \ @@ -105,12 +107,12 @@ ISO8859-1_ISO8859-1= ca_ES:ca_AD ca_ES:c ISO8859-1_ISO8859-15= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \ en_AU en_CA en_GB en_NZ en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR \ - is_IS it_IT it_CH nl_BE nl_NL nb_NO nn_NO no_NO pt_PT sv_SE + is_IS it_IT it_CH nl_BE nl_NL nb_NO nn_NO no_NO sv_SE ISO8859-1_US-ASCII= en_AU en_CA en_GB en_NZ en_US ISO8859-1_UTF-8= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \ en_AU en_CA en_NZ en_US es_ES \ fi_FI fr_BE fr_CA fr_FR is_IS it_IT nl_BE \ - nl_NL nb_NO nn_NO no_NO pt_BR pt_PT sv_SE + nl_NL nb_NO nn_NO no_NO pt_BR sv_SE ISO8859-2_UTF-8= hr_HR hu_HU ro_RO sk_SK sl_SI sr_YU ISO8859-7_UTF-8= el_GR ISO8859-9_UTF-8= tr_TR Copied: stable/7/share/monetdef/pt_PT.ISO8859-15.src (from r193962, head/share/monetdef/pt_PT.ISO8859-15.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/monetdef/pt_PT.ISO8859-15.src Wed Jun 17 03:15:23 2009 (r194327, copy of r193962, head/share/monetdef/pt_PT.ISO8859-15.src) @@ -0,0 +1,36 @@ +# $FreeBSD$ +# +# WARNING: spaces may be essential at the end of lines +# WARNING: empty lines are essential too +# +# int_curr_symbol (last character always SPACE) +EUR +# currency_symbol +¤ +# mon_decimal_point +, +# mon_thousands_sep +. +# mon_grouping, separated by ; +3;3 +# positive_sign + +# negative_sign +- +# int_frac_digits +2 +# frac_digits +2 +# p_cs_precedes +0 +# p_sep_by_space +1 +# n_cs_precedes +0 +# n_sep_by_space +1 +# p_sign_posn +1 +# n_sign_posn +1 +# EOF Copied: stable/7/share/monetdef/pt_PT.UTF-8.src (from r193962, head/share/monetdef/pt_PT.UTF-8.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/monetdef/pt_PT.UTF-8.src Wed Jun 17 03:15:23 2009 (r194327, copy of r193962, head/share/monetdef/pt_PT.UTF-8.src) @@ -0,0 +1,36 @@ +# $FreeBSD$ +# +# WARNING: spaces may be essential at the end of lines +# WARNING: empty lines are essential too +# +# int_curr_symbol (last character always SPACE) +EUR +# currency_symbol +€ +# mon_decimal_point +, +# mon_thousands_sep +. +# mon_grouping, separated by ; +3;3 +# positive_sign + +# negative_sign +- +# int_frac_digits +2 +# frac_digits +2 +# p_cs_precedes +0 +# p_sep_by_space +1 +# n_cs_precedes +0 +# n_sep_by_space +1 +# p_sign_posn +1 +# n_sign_posn +1 +# EOF From des at FreeBSD.org Wed Jun 17 07:05:38 2009 From: des at FreeBSD.org (Dag-Erling Smorgrav) Date: Wed Jun 17 07:05:44 2009 Subject: svn commit: r194336 - stable/7/usr.sbin/rpc.yppasswdd Message-ID: <200906170705.n5H75bKn065636@svn.freebsd.org> Author: des Date: Wed Jun 17 07:05:36 2009 New Revision: 194336 URL: http://svn.freebsd.org/changeset/base/194336 Log: merge r188766: fix a type-punning bug. Modified: stable/7/usr.sbin/rpc.yppasswdd/ (props changed) stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Modified: stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_server.c ============================================================================== --- stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 17 07:03:03 2009 (r194335) +++ stable/7/usr.sbin/rpc.yppasswdd/yppasswdd_server.c Wed Jun 17 07:05:36 2009 (r194336) @@ -70,6 +70,22 @@ struct dom_binding; static struct passwd yp_password; static void +xlate_passwd(struct x_master_passwd *xpwd, struct passwd *pwd) +{ + pwd->pw_name = xpwd->pw_name; + pwd->pw_passwd = xpwd->pw_passwd; + pwd->pw_uid = xpwd->pw_uid; + pwd->pw_gid = xpwd->pw_gid; + pwd->pw_change = xpwd->pw_change; + pwd->pw_class = xpwd->pw_class; + pwd->pw_gecos = xpwd->pw_gecos; + pwd->pw_dir = xpwd->pw_dir; + pwd->pw_shell = xpwd->pw_shell; + pwd->pw_expire = xpwd->pw_expire; + pwd->pw_fields = xpwd->pw_fields; +} + +static void copy_yp_pass(char *p, int x, int m) { char *t, *s = p; @@ -709,6 +725,7 @@ yppasswdproc_update_master_1_svc(master_ char passfile_hold_buf[MAXPATHLEN + 2]; struct sockaddr_in *rqhost; SVCXPRT *transp; + struct passwd newpasswd; result = 1; transp = rqstp->rq_xprt; @@ -820,7 +837,8 @@ allow additions to be made to the passwo yp_error("pw_tmp() failed"); return &result; } - if (pw_copy(pfd, tfd, (struct passwd *)&argp->newpw, NULL) == -1) { + xlate_passwd(&argp->newpw, &newpasswd); + if (pw_copy(pfd, tfd, &newpasswd, NULL) == -1) { pw_fini(); yp_error("pw_copy() failed"); return &result; @@ -858,8 +876,8 @@ allow additions to be made to the passwo pw_fini(); if (inplace) { - if ((rval = update_inplace((struct passwd *)&argp->newpw, - argp->domain))) { + xlate_passwd(&argp->newpw, &newpasswd); + if ((rval = update_inplace(&newpasswd, argp->domain))) { yp_error("inplace update failed -- rebuilding maps"); } } From avg at FreeBSD.org Wed Jun 17 09:29:20 2009 From: avg at FreeBSD.org (Andriy Gapon) Date: Wed Jun 17 09:29:31 2009 Subject: svn commit: r194338 - stable/7/sbin/fsck_msdosfs Message-ID: <200906170929.n5H9TJQ0068728@svn.freebsd.org> Author: avg Date: Wed Jun 17 09:29:18 2009 New Revision: 194338 URL: http://svn.freebsd.org/changeset/base/194338 Log: MFC r193943: fsck_msdosfs: accept no-op -C option Modified: stable/7/sbin/fsck_msdosfs/ (props changed) stable/7/sbin/fsck_msdosfs/fsck_msdosfs.8 stable/7/sbin/fsck_msdosfs/main.c Modified: stable/7/sbin/fsck_msdosfs/fsck_msdosfs.8 ============================================================================== --- stable/7/sbin/fsck_msdosfs/fsck_msdosfs.8 Wed Jun 17 07:11:38 2009 (r194337) +++ stable/7/sbin/fsck_msdosfs/fsck_msdosfs.8 Wed Jun 17 09:29:18 2009 (r194338) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 1995 +.Dd June 4, 2009 .Dt FSCK_MSDOSFS 8 .Os .Sh NAME @@ -41,10 +41,10 @@ .Sh SYNOPSIS .Nm .Fl p -.Op Fl f +.Op Fl Cf .Ar filesystem ... .Nm -.Op Fl ny +.Op Fl Cny .Ar filesystem ... .Sh DESCRIPTION The @@ -80,6 +80,10 @@ making any changes. .Pp The options are as follows: .Bl -tag -width indent +.It Fl C +Compatibility with the corresponding +.Xr fsck 8 +option (skip check if clean), defined to no-op. .It Fl F Compatibility with the wrapper .Xr fsck 8 Modified: stable/7/sbin/fsck_msdosfs/main.c ============================================================================== --- stable/7/sbin/fsck_msdosfs/main.c Wed Jun 17 07:11:38 2009 (r194337) +++ stable/7/sbin/fsck_msdosfs/main.c Wed Jun 17 09:29:18 2009 (r194338) @@ -74,8 +74,10 @@ main(int argc, char **argv) int ch; skipclean = 1; - while ((ch = getopt(argc, argv, "fFnpy")) != -1) { + while ((ch = getopt(argc, argv, "CfFnpy")) != -1) { switch (ch) { + case 'C': /* for fsck_ffs compatibility */ + break; case 'f': skipclean = 0; break; From avg at FreeBSD.org Wed Jun 17 09:42:31 2009 From: avg at FreeBSD.org (Andriy Gapon) Date: Wed Jun 17 09:42:49 2009 Subject: svn commit: r194339 - in stable/7/etc: . defaults mtree rc.d Message-ID: <200906170942.n5H9gUi7069088@svn.freebsd.org> Author: avg Date: Wed Jun 17 09:42:30 2009 New Revision: 194339 URL: http://svn.freebsd.org/changeset/base/194339 Log: MFC r193944: rc.d/fsck: allow additional options via fsck_y_flags Modified: stable/7/etc/ (props changed) stable/7/etc/defaults/rc.conf stable/7/etc/mtree/ (props changed) stable/7/etc/rc.d/ (props changed) stable/7/etc/rc.d/fsck Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Wed Jun 17 09:29:18 2009 (r194338) +++ stable/7/etc/defaults/rc.conf Wed Jun 17 09:42:30 2009 (r194339) @@ -83,6 +83,7 @@ geli_swap_flags="-e aes -l 256 -s 4096 - root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. +fsck_y_flags="" # Additional flags for fsck -y background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. netfs_types="nfs:NFS nfs4:NFS4 smbfs:SMB portalfs:PORTAL nwfs:NWFS" # Net filesystems. Modified: stable/7/etc/rc.d/fsck ============================================================================== --- stable/7/etc/rc.d/fsck Wed Jun 17 09:29:18 2009 (r194338) +++ stable/7/etc/rc.d/fsck Wed Jun 17 09:42:30 2009 (r194339) @@ -44,8 +44,8 @@ fsck_start() ;; 8) if checkyesno fsck_y_enable; then - echo "File system preen failed, trying fsck -y." - fsck -y + echo "File system preen failed, trying fsck -y ${fsck_y_flags}" + fsck -y ${fsck_y_flags} case $? in 0) ;; From avg at FreeBSD.org Wed Jun 17 10:15:08 2009 From: avg at FreeBSD.org (Andriy Gapon) Date: Wed Jun 17 10:15:15 2009 Subject: svn commit: r194341 - in stable/7/etc: . mtree rc.d Message-ID: <200906171015.n5HAF6Vq070070@svn.freebsd.org> Author: avg Date: Wed Jun 17 10:15:06 2009 New Revision: 194341 URL: http://svn.freebsd.org/changeset/base/194341 Log: svn management: move mergeinfo from subdirectories to parent in etc No contents changed, only svn:mergeinfo property affected. Record mergeinfo for r190575 and r193908 in etc. This is, obviously, a direct commit to stable/7. Reviewed by: des Modified: stable/7/etc/ (props changed) stable/7/etc/mtree/ (props changed) stable/7/etc/rc.d/ (props changed) From des at FreeBSD.org Wed Jun 17 11:21:27 2009 From: des at FreeBSD.org (Dag-Erling Smorgrav) Date: Wed Jun 17 11:21:44 2009 Subject: svn commit: r194347 - in stable/7/sys: . contrib/pf Message-ID: <200906171121.n5HBLPwR073541@svn.freebsd.org> Author: des Date: Wed Jun 17 11:21:25 2009 New Revision: 194347 URL: http://svn.freebsd.org/changeset/base/194347 Log: Nuke incorrect mergeinfo: /head:r189748 /head/sys/net:r182880 The correct mergeinfo for these revisions was already present. Pointy hat to: emax, rpaulo Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) From des at FreeBSD.org Wed Jun 17 11:40:46 2009 From: des at FreeBSD.org (Dag-Erling Smorgrav) Date: Wed Jun 17 11:40:57 2009 Subject: svn commit: r194350 - in stable/7/sys: . contrib/pf dev/aic dev/ath/ath_hal Message-ID: <200906171140.n5HBejnY074260@svn.freebsd.org> Author: des Date: Wed Jun 17 11:40:45 2009 New Revision: 194350 URL: http://svn.freebsd.org/changeset/base/194350 Log: merge r192066: redundant assignment. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/aic/aic.c stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/dev/aic/aic.c ============================================================================== --- stable/7/sys/dev/aic/aic.c Wed Jun 17 11:38:16 2009 (r194349) +++ stable/7/sys/dev/aic/aic.c Wed Jun 17 11:40:45 2009 (r194350) @@ -168,7 +168,7 @@ aic_action(struct cam_sim *sim, union cc } case XPT_SET_TRAN_SETTINGS: { - struct ccb_trans_settings *cts = cts = &ccb->cts; + struct ccb_trans_settings *cts = &ccb->cts; struct aic_tinfo *ti = &aic->tinfo[ccb->ccb_h.target_id]; struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; From kib at FreeBSD.org Wed Jun 17 13:12:45 2009 From: kib at FreeBSD.org (Konstantin Belousov) Date: Wed Jun 17 13:12:56 2009 Subject: svn commit: r194359 - in stable/7/sys: . compat/freebsd32 contrib/pf dev/ath/ath_hal Message-ID: <200906171312.n5HDCh0m076528@svn.freebsd.org> Author: kib Date: Wed Jun 17 13:12:43 2009 New Revision: 194359 URL: http://svn.freebsd.org/changeset/base/194359 Log: MFC r193916: Add several syscall compat32 entries for extattr manipulation syscalls. Modified: stable/7/sys/ (props changed) stable/7/sys/compat/freebsd32/syscalls.master stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/7/sys/compat/freebsd32/syscalls.master Wed Jun 17 12:47:27 2009 (r194358) +++ stable/7/sys/compat/freebsd32/syscalls.master Wed Jun 17 13:12:43 2009 (r194359) @@ -712,9 +712,17 @@ 409 AUE_NULL UNIMPL __mac_get_pid 410 AUE_NULL UNIMPL __mac_get_link 411 AUE_NULL UNIMPL __mac_set_link -412 AUE_EXTATTR_SET_LINK UNIMPL extattr_set_link -413 AUE_EXTATTR_GET_LINK UNIMPL extattr_get_link -414 AUE_EXTATTR_DELETE_LINK UNIMPL extattr_delete_link +412 AUE_EXTATTR_SET_LINK NOPROTO { int extattr_set_link( \ + const char *path, int attrnamespace, \ + const char *attrname, void *data, \ + size_t nbytes); } +413 AUE_EXTATTR_GET_LINK NOPROTO { ssize_t extattr_get_link( \ + const char *path, int attrnamespace, \ + const char *attrname, void *data, \ + size_t nbytes); } +414 AUE_EXTATTR_DELETE_LINK NOPROTO { int extattr_delete_link( \ + const char *path, int attrnamespace, \ + const char *attrname); } 415 AUE_NULL UNIMPL __mac_execve 416 AUE_SIGACTION STD { int freebsd32_sigaction(int sig, \ struct sigaction32 *act, \ @@ -745,9 +753,15 @@ 434 AUE_NULL STD { int freebsd32_umtx_lock(struct umtx *umtx); } 435 AUE_NULL STD { int freebsd32_umtx_unlock(struct umtx *umtx); } 436 AUE_NULL NOPROTO { int jail_attach(int jid); } -437 AUE_EXTATTR_LIST_FD UNIMPL extattr_list_fd -438 AUE_EXTATTR_LIST_FILE UNIMPL extattr_list_file -439 AUE_EXTATTR_LIST_LINK UNIMPL extattr_list_link +437 AUE_EXTATTR_LIST_FD NOPROTO { ssize_t extattr_list_fd(int fd, \ + int attrnamespace, void *data, \ + size_t nbytes); } +438 AUE_EXTATTR_LIST_FILE NOPROTO { ssize_t extattr_list_file( \ + const char *path, int attrnamespace, \ + void *data, size_t nbytes); } +439 AUE_EXTATTR_LIST_LINK NOPROTO { ssize_t extattr_list_link( \ + const char *path, int attrnamespace, \ + void *data, size_t nbytes); } 440 AUE_NULL UNIMPL kse_switchin 441 AUE_NULL UNIMPL ksem_timedwait 442 AUE_NULL STD { int freebsd32_thr_suspend( \ From kib at FreeBSD.org Wed Jun 17 13:13:25 2009 From: kib at FreeBSD.org (Konstantin Belousov) Date: Wed Jun 17 13:13:38 2009 Subject: svn commit: r194360 - stable/7/sys/compat/freebsd32 Message-ID: <200906171313.n5HDDOHe076579@svn.freebsd.org> Author: kib Date: Wed Jun 17 13:13:23 2009 New Revision: 194360 URL: http://svn.freebsd.org/changeset/base/194360 Log: Regenerate Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h stable/7/sys/compat/freebsd32/freebsd32_syscall.h stable/7/sys/compat/freebsd32/freebsd32_syscalls.c stable/7/sys/compat/freebsd32/freebsd32_sysent.c Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_proto.h Wed Jun 17 13:12:43 2009 (r194359) +++ stable/7/sys/compat/freebsd32/freebsd32_proto.h Wed Jun 17 13:13:23 2009 (r194360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 188281 2009-02-07 13:19:08Z bz + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/7/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscall.h Wed Jun 17 13:12:43 2009 (r194359) +++ stable/7/sys/compat/freebsd32/freebsd32_syscall.h Wed Jun 17 13:13:23 2009 (r194360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 188281 2009-02-07 13:19:08Z bz + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -308,6 +308,9 @@ #define FREEBSD32_SYS_statfs 396 #define FREEBSD32_SYS_fstatfs 397 #define FREEBSD32_SYS_fhstatfs 398 +#define FREEBSD32_SYS_extattr_set_link 412 +#define FREEBSD32_SYS_extattr_get_link 413 +#define FREEBSD32_SYS_extattr_delete_link 414 #define FREEBSD32_SYS_freebsd32_sigaction 416 #define FREEBSD32_SYS_freebsd32_sigreturn 417 #define FREEBSD32_SYS_freebsd32_getcontext 421 @@ -320,6 +323,9 @@ #define FREEBSD32_SYS_freebsd32_umtx_lock 434 #define FREEBSD32_SYS_freebsd32_umtx_unlock 435 #define FREEBSD32_SYS_jail_attach 436 +#define FREEBSD32_SYS_extattr_list_fd 437 +#define FREEBSD32_SYS_extattr_list_file 438 +#define FREEBSD32_SYS_extattr_list_link 439 #define FREEBSD32_SYS_freebsd32_thr_suspend 442 #define FREEBSD32_SYS_thr_wake 443 #define FREEBSD32_SYS_kldunloadf 444 Modified: stable/7/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jun 17 13:12:43 2009 (r194359) +++ stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jun 17 13:13:23 2009 (r194360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 188281 2009-02-07 13:19:08Z bz + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib */ const char *freebsd32_syscallnames[] = { @@ -419,9 +419,9 @@ const char *freebsd32_syscallnames[] = { "#409", /* 409 = __mac_get_pid */ "#410", /* 410 = __mac_get_link */ "#411", /* 411 = __mac_set_link */ - "#412", /* 412 = extattr_set_link */ - "#413", /* 413 = extattr_get_link */ - "#414", /* 414 = extattr_delete_link */ + "extattr_set_link", /* 412 = extattr_set_link */ + "extattr_get_link", /* 413 = extattr_get_link */ + "extattr_delete_link", /* 414 = extattr_delete_link */ "#415", /* 415 = __mac_execve */ "freebsd32_sigaction", /* 416 = freebsd32_sigaction */ "freebsd32_sigreturn", /* 417 = freebsd32_sigreturn */ @@ -444,9 +444,9 @@ const char *freebsd32_syscallnames[] = { "freebsd32_umtx_lock", /* 434 = freebsd32_umtx_lock */ "freebsd32_umtx_unlock", /* 435 = freebsd32_umtx_unlock */ "jail_attach", /* 436 = jail_attach */ - "#437", /* 437 = extattr_list_fd */ - "#438", /* 438 = extattr_list_file */ - "#439", /* 439 = extattr_list_link */ + "extattr_list_fd", /* 437 = extattr_list_fd */ + "extattr_list_file", /* 438 = extattr_list_file */ + "extattr_list_link", /* 439 = extattr_list_link */ "#440", /* 440 = kse_switchin */ "#441", /* 441 = ksem_timedwait */ "freebsd32_thr_suspend", /* 442 = freebsd32_thr_suspend */ Modified: stable/7/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_sysent.c Wed Jun 17 13:12:43 2009 (r194359) +++ stable/7/sys/compat/freebsd32/freebsd32_sysent.c Wed Jun 17 13:13:23 2009 (r194360) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 188281 2009-02-07 13:19:08Z bz + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib */ #include "opt_compat.h" @@ -450,9 +450,9 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 409 = __mac_get_pid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 410 = __mac_get_link */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 411 = __mac_set_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 412 = extattr_set_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 413 = extattr_get_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 414 = extattr_delete_link */ + { AS(extattr_set_link_args), (sy_call_t *)extattr_set_link, AUE_EXTATTR_SET_LINK, NULL, 0, 0 }, /* 412 = extattr_set_link */ + { AS(extattr_get_link_args), (sy_call_t *)extattr_get_link, AUE_EXTATTR_GET_LINK, NULL, 0, 0 }, /* 413 = extattr_get_link */ + { AS(extattr_delete_link_args), (sy_call_t *)extattr_delete_link, AUE_EXTATTR_DELETE_LINK, NULL, 0, 0 }, /* 414 = extattr_delete_link */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 415 = __mac_execve */ { AS(freebsd32_sigaction_args), (sy_call_t *)freebsd32_sigaction, AUE_SIGACTION, NULL, 0, 0 }, /* 416 = freebsd32_sigaction */ { AS(freebsd32_sigreturn_args), (sy_call_t *)freebsd32_sigreturn, AUE_SIGRETURN, NULL, 0, 0 }, /* 417 = freebsd32_sigreturn */ @@ -475,9 +475,9 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_umtx_lock_args), (sy_call_t *)freebsd32_umtx_lock, AUE_NULL, NULL, 0, 0 }, /* 434 = freebsd32_umtx_lock */ { AS(freebsd32_umtx_unlock_args), (sy_call_t *)freebsd32_umtx_unlock, AUE_NULL, NULL, 0, 0 }, /* 435 = freebsd32_umtx_unlock */ { AS(jail_attach_args), (sy_call_t *)jail_attach, AUE_NULL, NULL, 0, 0 }, /* 436 = jail_attach */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 437 = extattr_list_fd */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 438 = extattr_list_file */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 439 = extattr_list_link */ + { AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0 }, /* 437 = extattr_list_fd */ + { AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0 }, /* 438 = extattr_list_file */ + { AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0 }, /* 439 = extattr_list_link */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 440 = kse_switchin */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 441 = ksem_timedwait */ { AS(freebsd32_thr_suspend_args), (sy_call_t *)freebsd32_thr_suspend, AUE_NULL, NULL, 0, 0 }, /* 442 = freebsd32_thr_suspend */ From jhb at FreeBSD.org Wed Jun 17 14:00:58 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Wed Jun 17 14:01:04 2009 Subject: svn commit: r194362 - in stable/7/sys: . contrib/pf dev/ata dev/ath/ath_hal Message-ID: <200906171400.n5HE0vDC077694@svn.freebsd.org> Author: jhb Date: Wed Jun 17 14:00:56 2009 New Revision: 194362 URL: http://svn.freebsd.org/changeset/base/194362 Log: MFC: Preallocate the four BARs in ALI SATA controllers during the chipinit routine. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ata/ata-chipset.c stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Wed Jun 17 13:36:08 2009 (r194361) +++ stable/7/sys/dev/ata/ata-chipset.c Wed Jun 17 14:00:56 2009 (r194362) @@ -198,6 +198,9 @@ static int ata_atapi(device_t dev); static int ata_check_80pin(device_t dev, int mode); static int ata_mode2idx(int mode); +struct ali_sata_resources { + struct resource *bars[4]; +}; /* * generic ATA support functions @@ -1094,6 +1097,8 @@ static int ata_ali_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ali_sata_resources *res; + int i, rid; if (ata_setup_interrupt(dev)) return ENXIO; @@ -1108,6 +1113,22 @@ ata_ali_chipinit(device_t dev) if ((ctlr->chip->chipid == ATA_ALI_5288) && (ata_ahci_chipinit(dev) != ENXIO)) return 0; + + /* Allocate resources for later use by channel attach routines. */ + res = malloc(sizeof(struct ali_sata_resources), M_TEMP, M_WAITOK); + for (i = 0; i < 4; i++) { + rid = PCIR_BAR(i); + res->bars[i] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); + if (res->bars[i] == NULL) { + device_printf(dev, "Failed to allocate BAR %d\n", i); + for (i--; i >=0; i--) + bus_release_resource(dev, SYS_RES_IOPORT, + PCIR_BAR(i), res->bars[i]); + free(res, M_TEMP); + } + } + ctlr->chipset_data = res; break; case ALINEW: @@ -1162,20 +1183,18 @@ ata_ali_sata_allocate(device_t dev) device_t parent = device_get_parent(dev); struct ata_pci_controller *ctlr = device_get_softc(parent); struct ata_channel *ch = device_get_softc(dev); + struct ali_sata_resources *res; struct resource *io = NULL, *ctlio = NULL; int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2); - int i, rid; - - rid = PCIR_BAR(0) + (unit01 ? 8 : 0); - io = bus_alloc_resource_any(parent, SYS_RES_IOPORT, &rid, RF_ACTIVE); - if (!io) - return ENXIO; + int i; - rid = PCIR_BAR(1) + (unit01 ? 8 : 0); - ctlio = bus_alloc_resource_any(parent, SYS_RES_IOPORT, &rid, RF_ACTIVE); - if (!ctlio) { - bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io); - return ENXIO; + res = ctlr->chipset_data; + if (unit01) { + io = res->bars[2]; + ctlio = res->bars[3]; + } else { + io = res->bars[0]; + ctlio = res->bars[1]; } for (i = ATA_DATA; i <= ATA_COMMAND; i ++) { From des at FreeBSD.org Wed Jun 17 14:45:59 2009 From: des at FreeBSD.org (Dag-Erling Smorgrav) Date: Wed Jun 17 14:46:11 2009 Subject: svn commit: r194365 - in stable/7/sys: . contrib/pf dev/ath/ath_hal modules/linux Message-ID: <200906171445.n5HEjwb9078773@svn.freebsd.org> Author: des Date: Wed Jun 17 14:45:58 2009 New Revision: 194365 URL: http://svn.freebsd.org/changeset/base/194365 Log: merge r192852, r192855: opt_apic.h is only used on i386. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/modules/linux/Makefile Modified: stable/7/sys/modules/linux/Makefile ============================================================================== --- stable/7/sys/modules/linux/Makefile Wed Jun 17 14:32:08 2009 (r194364) +++ stable/7/sys/modules/linux/Makefile Wed Jun 17 14:45:58 2009 (r194365) @@ -17,7 +17,10 @@ SRCS= linux${SFX}_dummy.c linux_emul.c l device_if.h bus_if.h assym.s # XXX: for assym.s -SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h +SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h +.if ${MACHINE_ARCH} == "i386" +SRCS+= opt_apic.h +.endif OBJS= linux${SFX}_locore.o linux${SFX}_support.o From des at FreeBSD.org Wed Jun 17 14:50:42 2009 From: des at FreeBSD.org (Dag-Erling Smorgrav) Date: Wed Jun 17 14:50:59 2009 Subject: svn commit: r194367 - in stable/7/sys: . contrib/pf dev/ath/ath_hal fs/pseudofs Message-ID: <200906171450.n5HEofB5078969@svn.freebsd.org> Author: des Date: Wed Jun 17 14:50:41 2009 New Revision: 194367 URL: http://svn.freebsd.org/changeset/base/194367 Log: merge r193556: drop Giant from pseudofs. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/fs/pseudofs/pseudofs_vncache.c Modified: stable/7/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/7/sys/fs/pseudofs/pseudofs_vncache.c Wed Jun 17 14:47:06 2009 (r194366) +++ stable/7/sys/fs/pseudofs/pseudofs_vncache.c Wed Jun 17 14:50:41 2009 (r194367) @@ -270,13 +270,13 @@ pfs_vncache_free(struct vnode *vp) * The only way to improve this situation is to change the data structure * used to implement the cache. */ -void -pfs_purge(struct pfs_node *pn) +static void +pfs_purge_locked(struct pfs_node *pn) { struct pfs_vdata *pvd; struct vnode *vnp; - mtx_lock(&pfs_vncache_mutex); + mtx_assert(&pfs_vncache_mutex, MA_OWNED); pvd = pfs_vncache; while (pvd != NULL) { if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) { @@ -286,22 +286,26 @@ pfs_purge(struct pfs_node *pn) VOP_LOCK(vnp, LK_EXCLUSIVE, curthread); vgone(vnp); VOP_UNLOCK(vnp, 0, curthread); - vdrop(vnp); mtx_lock(&pfs_vncache_mutex); + vdrop(vnp); pvd = pfs_vncache; } else { pvd = pvd->pvd_next; } } +} + +void +pfs_purge(struct pfs_node *pn) +{ + + mtx_lock(&pfs_vncache_mutex); + pfs_purge_locked(pn); mtx_unlock(&pfs_vncache_mutex); } /* * Free all vnodes associated with a defunct process - * - * XXXRW: It is unfortunate that pfs_exit() always acquires and releases two - * mutexes (one of which is Giant) for every process exit, even if procfs - * isn't mounted. */ static void pfs_exit(void *arg, struct proc *p) @@ -311,13 +315,11 @@ pfs_exit(void *arg, struct proc *p) if (pfs_vncache == NULL) return; - mtx_lock(&Giant); mtx_lock(&pfs_vncache_mutex); for (pvd = pfs_vncache, dead = 0; pvd != NULL; pvd = pvd->pvd_next) if (pvd->pvd_pid == p->p_pid) dead = pvd->pvd_dead = 1; - mtx_unlock(&pfs_vncache_mutex); if (dead) - pfs_purge(NULL); - mtx_unlock(&Giant); + pfs_purge_locked(NULL); + mtx_unlock(&pfs_vncache_mutex); } From dchagin at FreeBSD.org Wed Jun 17 16:56:23 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Wed Jun 17 16:56:33 2009 Subject: svn commit: r194375 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal Message-ID: <200906171656.n5HGuLUO081821@svn.freebsd.org> Author: dchagin Date: Wed Jun 17 16:56:21 2009 New Revision: 194375 URL: http://svn.freebsd.org/changeset/base/194375 Log: MFC r194203: Unlock process lock when return error from getrobustlist call. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_futex.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/compat/linux/linux_futex.c ============================================================================== --- stable/7/sys/compat/linux/linux_futex.c Wed Jun 17 16:34:40 2009 (r194374) +++ stable/7/sys/compat/linux/linux_futex.c Wed Jun 17 16:56:21 2009 (r194375) @@ -707,8 +707,10 @@ linux_get_robust_list(struct thread *td, /* XXX: ptrace? */ if (priv_check(td, PRIV_CRED_SETUID) || priv_check(td, PRIV_CRED_SETEUID) || - p_candebug(td, p)) + p_candebug(td, p)) { + PROC_UNLOCK(p); return (EPERM); + } head = em->robust_futexes; PROC_UNLOCK(p); From jhb at FreeBSD.org Wed Jun 17 17:31:47 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Wed Jun 17 17:31:54 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal Message-ID: <200906171731.n5HHVktG082752@svn.freebsd.org> Author: jhb Date: Wed Jun 17 17:31:45 2009 New Revision: 194377 URL: http://svn.freebsd.org/changeset/base/194377 Log: Remove useless mergeinfo. This was due to copying ath_hal from the projects branch directly into 7 rather than merging from 8 into 7. Modified: stable/7/sys/dev/ath/ath_hal/ (props changed) From marck at rinet.ru Wed Jun 17 20:04:57 2009 From: marck at rinet.ru (Dmitry Morozovsky) Date: Wed Jun 17 20:05:10 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <200906171731.n5HHVktG082752@svn.freebsd.org> References: <200906171731.n5HHVktG082752@svn.freebsd.org> Message-ID: On Wed, 17 Jun 2009, John Baldwin wrote: JB> Author: jhb JB> Date: Wed Jun 17 17:31:45 2009 JB> New Revision: 194377 JB> URL: http://svn.freebsd.org/changeset/base/194377 JB> JB> Log: JB> Remove useless mergeinfo. This was due to copying ath_hal from the JB> projects branch directly into 7 rather than merging from 8 into 7. JB> JB> Modified: JB> stable/7/sys/dev/ath/ath_hal/ (props changed) Great. There's only stable/7/sys/contrib/pf/ (props changed) on every MFC to stable/7 left yet ;-P [no pun intended, thank you very much!] -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From itetcu at FreeBSD.org Wed Jun 17 20:43:08 2009 From: itetcu at FreeBSD.org (Ion-Mihai Tetcu) Date: Wed Jun 17 20:43:20 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <200906171731.n5HHVktG082752@svn.freebsd.org> References: <200906171731.n5HHVktG082752@svn.freebsd.org> Message-ID: <20090617232547.3ab92e5b@it.buh.tecnik93.com> On Wed, 17 Jun 2009 17:31:46 +0000 (UTC) John Baldwin wrote: > Author: jhb > Date: Wed Jun 17 17:31:45 2009 > New Revision: 194377 > URL: http://svn.freebsd.org/changeset/base/194377 > > Log: > Remove useless mergeinfo. This was due to copying ath_hal from the > projects branch directly into 7 rather than merging from 8 into 7. > > Modified: > stable/7/sys/dev/ath/ath_hal/ (props changed) Thank you! -- IOnut - Un^d^dregistered ;) FreeBSD "user" "Intellectual Property" is nowhere near as valuable as "Intellect" FreeBSD committer -> itetcu@FreeBSD.org, PGP Key ID 057E9F8B493A297B -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 196 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/svn-src-stable-7/attachments/20090617/f8e83ad1/signature.pgp From dchagin at FreeBSD.org Wed Jun 17 21:12:33 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Wed Jun 17 21:12:50 2009 Subject: svn commit: r194400 - in stable/7/sys: . amd64/linux32 contrib/pf Message-ID: <200906172112.n5HLCW5f088432@svn.freebsd.org> Author: dchagin Date: Wed Jun 17 21:12:32 2009 New Revision: 194400 URL: http://svn.freebsd.org/changeset/base/194400 Log: MFC r185438: Fix iovec32 for linux32/amd64. Add a custom version of copyiniov() to deal with the 32-bit iovec pointers from userland (to be used later). Adjust prototypes for linux_readv() and linux_writev() to use new l_iovec32 definition and to match actual linux code. In particular, use ulong for fd (why ?). Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/linux32/linux.h stable/7/sys/amd64/linux32/linux32_machdep.c stable/7/sys/amd64/linux32/syscalls.master stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/linux32/linux.h ============================================================================== --- stable/7/sys/amd64/linux32/linux.h Wed Jun 17 21:03:27 2009 (r194399) +++ stable/7/sys/amd64/linux32/linux.h Wed Jun 17 21:12:32 2009 (r194400) @@ -879,6 +879,16 @@ typedef int l_mqd_t; (LINUX_CLONE_VM | LINUX_CLONE_FS | LINUX_CLONE_FILES | \ LINUX_CLONE_SIGHAND | LINUX_CLONE_THREAD) +struct iovec; + +struct l_iovec32 { + uint32_t iov_base; + l_size_t iov_len; +}; + +int linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt, + struct iovec **iovp, int error); + /* robust futexes */ struct linux_robust_list { l_uintptr_t next; Modified: stable/7/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/7/sys/amd64/linux32/linux32_machdep.c Wed Jun 17 21:03:27 2009 (r194399) +++ stable/7/sys/amd64/linux32/linux32_machdep.c Wed Jun 17 21:12:32 2009 (r194400) @@ -232,20 +232,15 @@ linux_execve(struct thread *td, struct l return (error); } -struct iovec32 { - u_int32_t iov_base; - int iov_len; -}; - -CTASSERT(sizeof(struct iovec32) == 8); +CTASSERT(sizeof(struct l_iovec32) == 8); static int -linux32_copyinuio(struct iovec32 *iovp, u_int iovcnt, struct uio **uiop) +linux32_copyinuio(struct l_iovec32 *iovp, l_ulong iovcnt, struct uio **uiop) { - struct iovec32 iov32; + struct l_iovec32 iov32; struct iovec *iov; struct uio *uio; - u_int iovlen; + uint32_t iovlen; int error, i; *uiop = NULL; @@ -255,7 +250,7 @@ linux32_copyinuio(struct iovec32 *iovp, uio = malloc(iovlen + sizeof(*uio), M_IOV, M_WAITOK); iov = (struct iovec *)(uio + 1); for (i = 0; i < iovcnt; i++) { - error = copyin(&iovp[i], &iov32, sizeof(struct iovec32)); + error = copyin(&iovp[i], &iov32, sizeof(struct l_iovec32)); if (error) { free(uio, M_IOV); return (error); @@ -281,6 +276,34 @@ linux32_copyinuio(struct iovec32 *iovp, } int +linux32_copyiniov(struct l_iovec32 *iovp32, l_ulong iovcnt, struct iovec **iovp, + int error) +{ + struct l_iovec32 iov32; + struct iovec *iov; + uint32_t iovlen; + int i; + + *iovp = NULL; + if (iovcnt > UIO_MAXIOV) + return (error); + iovlen = iovcnt * sizeof(struct iovec); + iov = malloc(iovlen, M_IOV, M_WAITOK); + for (i = 0; i < iovcnt; i++) { + error = copyin(&iovp32[i], &iov32, sizeof(struct l_iovec32)); + if (error) { + free(iov, M_IOV); + return (error); + } + iov[i].iov_base = PTRIN(iov32.iov_base); + iov[i].iov_len = iov32.iov_len; + } + *iovp = iov; + return(0); + +} + +int linux_readv(struct thread *td, struct linux_readv_args *uap) { struct uio *auio; Modified: stable/7/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/7/sys/amd64/linux32/syscalls.master Wed Jun 17 21:03:27 2009 (r194399) +++ stable/7/sys/amd64/linux32/syscalls.master Wed Jun 17 21:12:32 2009 (r194400) @@ -252,10 +252,10 @@ 143 AUE_FLOCK NOPROTO { int flock(int fd, int how); } 144 AUE_MSYNC STD { int linux_msync(l_ulong addr, \ l_size_t len, l_int fl); } -145 AUE_READV STD { int linux_readv(int fd, struct iovec32 *iovp, \ - u_int iovcnt); } -146 AUE_WRITEV STD { int linux_writev(int fd, struct iovec32 *iovp, \ - u_int iovcnt); } +145 AUE_READV STD { int linux_readv(l_ulong fd, struct l_iovec32 *iovp, \ + l_ulong iovcnt); } +146 AUE_WRITEV STD { int linux_writev(l_ulong fd, struct l_iovec32 *iovp, \ + l_ulong iovcnt); } 147 AUE_GETSID STD { int linux_getsid(l_pid_t pid); } 148 AUE_NULL STD { int linux_fdatasync(l_uint fd); } 149 AUE_SYSCTL STD { int linux_sysctl( \ From dchagin at FreeBSD.org Wed Jun 17 21:14:08 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Wed Jun 17 21:14:19 2009 Subject: svn commit: r194401 - stable/7/sys/amd64/linux32 Message-ID: <200906172114.n5HLE74w088498@svn.freebsd.org> Author: dchagin Date: Wed Jun 17 21:14:07 2009 New Revision: 194401 URL: http://svn.freebsd.org/changeset/base/194401 Log: Regenerate after r194400. Approved by: kib (mentor) Modified: stable/7/sys/amd64/linux32/linux32_proto.h stable/7/sys/amd64/linux32/linux32_syscall.h stable/7/sys/amd64/linux32/linux32_sysent.c Modified: stable/7/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/7/sys/amd64/linux32/linux32_proto.h Wed Jun 17 21:12:32 2009 (r194400) +++ stable/7/sys/amd64/linux32/linux32_proto.h Wed Jun 17 21:14:07 2009 (r194401) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 191820 2009-05-05 14:53:58Z dchagin + * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 194400 2009-06-17 21:12:32Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -451,14 +451,14 @@ struct linux_msync_args { char fl_l_[PADL_(l_int)]; l_int fl; char fl_r_[PADR_(l_int)]; }; struct linux_readv_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; - char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char iovp_l_[PADL_(struct l_iovec32 *)]; struct l_iovec32 * iovp; char iovp_r_[PADR_(struct l_iovec32 *)]; + char iovcnt_l_[PADL_(l_ulong)]; l_ulong iovcnt; char iovcnt_r_[PADR_(l_ulong)]; }; struct linux_writev_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; - char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char iovp_l_[PADL_(struct l_iovec32 *)]; struct l_iovec32 * iovp; char iovp_r_[PADR_(struct l_iovec32 *)]; + char iovcnt_l_[PADL_(l_ulong)]; l_ulong iovcnt; char iovcnt_r_[PADR_(l_ulong)]; }; struct linux_getsid_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; Modified: stable/7/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/7/sys/amd64/linux32/linux32_syscall.h Wed Jun 17 21:12:32 2009 (r194400) +++ stable/7/sys/amd64/linux32/linux32_syscall.h Wed Jun 17 21:14:07 2009 (r194401) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 191820 2009-05-05 14:53:58Z dchagin + * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 194400 2009-06-17 21:12:32Z dchagin */ #define LINUX_SYS_exit 1 Modified: stable/7/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/7/sys/amd64/linux32/linux32_sysent.c Wed Jun 17 21:12:32 2009 (r194400) +++ stable/7/sys/amd64/linux32/linux32_sysent.c Wed Jun 17 21:14:07 2009 (r194401) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 191820 2009-05-05 14:53:58Z dchagin + * created from FreeBSD: stable/7/sys/amd64/linux32/syscalls.master 194400 2009-06-17 21:12:32Z dchagin */ #include "opt_compat.h" From dchagin at FreeBSD.org Wed Jun 17 21:49:42 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Wed Jun 17 21:49:54 2009 Subject: svn commit: r194404 - in stable/7/sys: . amd64/linux32 compat/linux contrib/pf i386/linux Message-ID: <200906172149.n5HLnfev089359@svn.freebsd.org> Author: dchagin Date: Wed Jun 17 21:49:41 2009 New Revision: 194404 URL: http://svn.freebsd.org/changeset/base/194404 Log: MFC r185442: Make linux_sendmsg() and linux_recvmsg() work on linux32/amd64. Change types used in the linux' struct msghdr and struct cmsghdr definitions to the properly-sized architecture-specific types. Move ancillary data handler from linux_sendit() to linux_sendmsg(). Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/linux32/linux.h stable/7/sys/compat/linux/linux_socket.c stable/7/sys/compat/linux/linux_socket.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/linux/linux.h Modified: stable/7/sys/amd64/linux32/linux.h ============================================================================== --- stable/7/sys/amd64/linux32/linux.h Wed Jun 17 21:48:19 2009 (r194403) +++ stable/7/sys/amd64/linux32/linux.h Wed Jun 17 21:49:41 2009 (r194404) @@ -708,6 +708,22 @@ struct l_sockaddr { char sa_data[14]; } __packed; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +}; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +}; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Wed Jun 17 21:48:19 2009 (r194403) +++ stable/7/sys/compat/linux/linux_socket.c Wed Jun 17 21:49:41 2009 (r194404) @@ -420,10 +420,62 @@ linux_sa_put(struct osockaddr *osa) } static int +linux_to_bsd_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case LINUX_SCM_RIGHTS: + return (SCM_RIGHTS); + } + return (-1); +} + +static int +bsd_to_linux_cmsg_type(int cmsg_type) +{ + + switch (cmsg_type) { + case SCM_RIGHTS: + return (LINUX_SCM_RIGHTS); + } + return (-1); +} + + + +static int +linux_to_bsd_msghdr(struct msghdr *bhdr, const struct l_msghdr *lhdr) +{ + if (lhdr->msg_controllen > INT_MAX) + return (ENOBUFS); + + bhdr->msg_name = PTRIN(lhdr->msg_name); + bhdr->msg_namelen = lhdr->msg_namelen; + bhdr->msg_iov = PTRIN(lhdr->msg_iov); + bhdr->msg_iovlen = lhdr->msg_iovlen; + bhdr->msg_control = PTRIN(lhdr->msg_control); + bhdr->msg_controllen = lhdr->msg_controllen; + bhdr->msg_flags = linux_to_bsd_msg_flags(lhdr->msg_flags); + return (0); +} + +static int +bsd_to_linux_msghdr(const struct msghdr *bhdr, struct l_msghdr *lhdr) +{ + lhdr->msg_name = PTROUT(bhdr->msg_name); + lhdr->msg_namelen = bhdr->msg_namelen; + lhdr->msg_iov = PTROUT(bhdr->msg_iov); + lhdr->msg_iovlen = bhdr->msg_iovlen; + lhdr->msg_control = PTROUT(bhdr->msg_control); + lhdr->msg_controllen = bhdr->msg_controllen; + /* msg_flags skipped */ + return (0); +} + +static int linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, - enum uio_seg segflg) + struct mbuf *control, enum uio_seg segflg) { - struct mbuf *control; struct sockaddr *to; int error; @@ -435,27 +487,9 @@ linux_sendit(struct thread *td, int s, s } else to = NULL; - if (mp->msg_control != NULL) { - struct cmsghdr *cmsg; - - if (mp->msg_controllen < sizeof(struct cmsghdr)) { - error = EINVAL; - goto bad; - } - error = sockargs(&control, mp->msg_control, - mp->msg_controllen, MT_CONTROL); - if (error) - goto bad; - - cmsg = mtod(control, struct cmsghdr *); - cmsg->cmsg_level = linux_to_bsd_sockopt_level(cmsg->cmsg_level); - } else - control = NULL; - error = kern_sendit(td, s, mp, linux_to_bsd_msg_flags(flags), control, segflg); -bad: if (to) FREE(to, M_SONAME); return (error); @@ -530,7 +564,7 @@ linux_sendto_hdrincl(struct thread *td, aiov[0].iov_base = (char *)packet; aiov[0].iov_len = linux_args->len; error = linux_sendit(td, linux_args->s, &msg, linux_args->flags, - UIO_SYSSPACE); + NULL, UIO_SYSSPACE); goout: free(packet, M_TEMP); return (error); @@ -931,7 +965,8 @@ linux_sendto(struct thread *td, struct l msg.msg_flags = 0; aiov.iov_base = PTRIN(args->msg); aiov.iov_len = args->len; - error = linux_sendit(td, args->s, &msg, args->flags, UIO_USERSPACE); + error = linux_sendit(td, args->s, &msg, args->flags, NULL, + UIO_USERSPACE); return (error); } @@ -993,13 +1028,21 @@ struct linux_sendmsg_args { static int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) { + struct cmsghdr *cmsg; + struct mbuf *control; struct msghdr msg; + struct l_cmsghdr linux_cmsg; + struct l_cmsghdr *ptr_cmsg; + struct l_msghdr linux_msg; struct iovec *iov; + socklen_t datalen; + void *data; int error; - /* XXXTJR sendmsg is broken on amd64 */ - - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); + error = linux_to_bsd_msghdr(&msg, &linux_msg); if (error) return (error); @@ -1012,13 +1055,68 @@ linux_sendmsg(struct thread *td, struct */ if (msg.msg_control != NULL && msg.msg_controllen == 0) msg.msg_control = NULL; + +#ifdef COMPAT_LINUX32 + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); +#endif if (error) return (error); + + if (msg.msg_control != NULL) { + error = ENOBUFS; + cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + control = m_get(M_WAIT, MT_CONTROL); + if (control == NULL) + goto bad; + ptr_cmsg = LINUX_CMSG_FIRSTHDR(&msg); + + do { + error = copyin(ptr_cmsg, &linux_cmsg, + sizeof(struct l_cmsghdr)); + if (error) + goto bad; + + error = EINVAL; + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + goto bad; + + /* + * Now we support only SCM_RIGHTS, so return EINVAL + * in any other cmsg_type + */ + if ((cmsg->cmsg_type = + linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type)) == -1) + goto bad; + cmsg->cmsg_level = + linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level); + + datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + cmsg->cmsg_len = CMSG_LEN(datalen); + data = LINUX_CMSG_DATA(ptr_cmsg); + + error = ENOBUFS; + if (!m_append(control, CMSG_HDRSZ, (c_caddr_t) cmsg)) + goto bad; + if (!m_append(control, datalen, (c_caddr_t) data)) + goto bad; + } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&msg, ptr_cmsg))); + } else { + control = NULL; + cmsg = NULL; + } + msg.msg_iov = iov; msg.msg_flags = 0; - error = linux_sendit(td, args->s, &msg, args->flags, UIO_USERSPACE); + error = linux_sendit(td, args->s, &msg, args->flags, control, + UIO_USERSPACE); + +bad: free(iov, M_IOV); + if (cmsg) + free(cmsg, M_TEMP); return (error); } @@ -1031,44 +1129,132 @@ struct linux_recvmsg_args { static int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) { - struct recvmsg_args /* { - int s; - struct msghdr *msg; - int flags; - } */ bsd_args; + struct cmsghdr *cm; struct msghdr msg; - struct cmsghdr *cmsg; + struct l_cmsghdr *linux_cmsg = NULL; + socklen_t datalen, outlen, clen; + struct l_msghdr linux_msg; + struct iovec *iov, *uiov; + struct mbuf *control = NULL; + struct mbuf **controlp; + caddr_t outbuf; + void *data; int error; - /* XXXTJR recvmsg is broken on amd64 */ + error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); + if (error) + return (error); - if ((error = copyin(PTRIN(args->msg), &msg, sizeof (msg)))) + error = linux_to_bsd_msghdr(&msg, &linux_msg); + if (error) return (error); - bsd_args.s = args->s; - bsd_args.msg = PTRIN(args->msg); - bsd_args.flags = linux_to_bsd_msg_flags(args->flags); - if (msg.msg_name) { - linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, - msg.msg_namelen); - error = recvmsg(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)msg.msg_name); - } else - error = recvmsg(td, &bsd_args); +#ifdef COMPAT_LINUX32 + error = linux32_copyiniov(PTRIN(msg.msg_iov), msg.msg_iovlen, + &iov, EMSGSIZE); +#else + error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); +#endif if (error) return (error); - if (bsd_args.msg->msg_control != NULL && - bsd_args.msg->msg_controllen > 0) { - cmsg = (struct cmsghdr*)bsd_args.msg->msg_control; - cmsg->cmsg_level = bsd_to_linux_sockopt_level(cmsg->cmsg_level); + if (msg.msg_name) { + error = linux_to_bsd_sockaddr((struct sockaddr *)msg.msg_name, + msg.msg_namelen); + if (error) + goto bad; } - error = copyin(PTRIN(args->msg), &msg, sizeof(msg)); + uiov = msg.msg_iov; + msg.msg_iov = iov; + controlp = (msg.msg_control != NULL) ? &control : NULL; + error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, controlp); + msg.msg_iov = uiov; + if (error) + goto bad; + + error = bsd_to_linux_msghdr(&msg, &linux_msg); if (error) - return (error); - if (msg.msg_name && msg.msg_namelen > 2) - error = linux_sa_put(msg.msg_name); + goto bad; + + if (linux_msg.msg_name) { + error = bsd_to_linux_sockaddr((struct sockaddr *) + PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + if (linux_msg.msg_name && linux_msg.msg_namelen > 2) { + error = linux_sa_put(PTRIN(linux_msg.msg_name)); + if (error) + goto bad; + } + + if (control) { + + linux_cmsg = malloc(L_CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); + outbuf = PTRIN(linux_msg.msg_control); + cm = mtod(control, struct cmsghdr *); + outlen = 0; + clen = control->m_len; + + while (cm != NULL) { + + if ((linux_cmsg->cmsg_type = + bsd_to_linux_cmsg_type(cm->cmsg_type)) == -1) + { + error = EINVAL; + goto bad; + } + data = CMSG_DATA(cm); + datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; + + if (outlen + LINUX_CMSG_LEN(datalen) > + linux_msg.msg_controllen) { + if (outlen == 0) { + error = EMSGSIZE; + goto bad; + } else { + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + goto out; + } + } + + linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); + linux_cmsg->cmsg_level = + bsd_to_linux_sockopt_level(cm->cmsg_level); + + error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); + if (error) + goto bad; + outbuf += L_CMSG_HDRSZ; + + error = copyout(data, outbuf, datalen); + if (error) + goto bad; + + outbuf += LINUX_CMSG_ALIGN(datalen); + outlen += LINUX_CMSG_LEN(datalen); + linux_msg.msg_controllen = outlen; + + if (CMSG_SPACE(datalen) < clen) { + clen -= CMSG_SPACE(datalen); + cm = (struct cmsghdr *) + ((caddr_t)cm + CMSG_SPACE(datalen)); + } else + cm = NULL; + } + } + +out: + error = copyout(&linux_msg, PTRIN(args->msg), sizeof(linux_msg)); + +bad: + free(iov, M_IOV); + if (control != NULL) + m_freem(control); + if (linux_cmsg != NULL) + free(linux_cmsg, M_TEMP); + return (error); } Modified: stable/7/sys/compat/linux/linux_socket.h ============================================================================== --- stable/7/sys/compat/linux/linux_socket.h Wed Jun 17 21:48:19 2009 (r194403) +++ stable/7/sys/compat/linux/linux_socket.h Wed Jun 17 21:49:41 2009 (r194404) @@ -49,6 +49,37 @@ #define LINUX_MSG_ERRQUEUE 0x2000 #define LINUX_MSG_NOSIGNAL 0x4000 +/* Socket-level control message types */ + +#define LINUX_SCM_RIGHTS 0x01 + +/* Ancilliary data object information macros */ + +#define LINUX_CMSG_ALIGN(len) roundup2(len, sizeof(l_ulong)) +#define LINUX_CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)))) +#define LINUX_CMSG_SPACE(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + LINUX_CMSG_ALIGN(len)) +#define LINUX_CMSG_LEN(len) (LINUX_CMSG_ALIGN(sizeof(struct l_cmsghdr)) + \ + (len)) +#define LINUX_CMSG_FIRSTHDR(msg) \ + ((msg)->msg_controllen >= \ + sizeof(struct l_cmsghdr) ? \ + (struct l_cmsghdr *)((msg)->msg_control) : \ + (struct l_cmsghdr *)(NULL)) +#define LINUX_CMSG_NXTHDR(msg, cmsg) \ + ((((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len) + \ + sizeof(*(cmsg))) > \ + (((char *)(msg)->msg_control) + \ + (msg)->msg_controllen)) ? \ + (struct l_cmsghdr *) NULL : \ + (struct l_cmsghdr *)((char *)(cmsg) + \ + LINUX_CMSG_ALIGN((cmsg)->cmsg_len))) + +#define CMSG_HDRSZ CMSG_LEN(0) +#define L_CMSG_HDRSZ LINUX_CMSG_LEN(0) + /* Supported address families */ #define LINUX_AF_UNSPEC 0 Modified: stable/7/sys/i386/linux/linux.h ============================================================================== --- stable/7/sys/i386/linux/linux.h Wed Jun 17 21:48:19 2009 (r194403) +++ stable/7/sys/i386/linux/linux.h Wed Jun 17 21:49:41 2009 (r194404) @@ -679,6 +679,22 @@ struct l_sockaddr { char sa_data[14]; }; +struct l_msghdr { + l_uintptr_t msg_name; + l_int msg_namelen; + l_uintptr_t msg_iov; + l_size_t msg_iovlen; + l_uintptr_t msg_control; + l_size_t msg_controllen; + l_uint msg_flags; +}; + +struct l_cmsghdr { + l_size_t cmsg_len; + l_int cmsg_level; + l_int cmsg_type; +}; + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; From dchagin at FreeBSD.org Wed Jun 17 21:52:42 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Wed Jun 17 21:52:59 2009 Subject: svn commit: r194405 - in stable/7/sys: . compat/linux contrib/pf Message-ID: <200906172152.n5HLqddj089472@svn.freebsd.org> Author: dchagin Date: Wed Jun 17 21:52:39 2009 New Revision: 194405 URL: http://svn.freebsd.org/changeset/base/194405 Log: MFC r192284: Implement MSG_CMSG_CLOEXEC flag for linux_recvmsg(). Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_socket.c stable/7/sys/compat/linux/linux_socket.h stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Wed Jun 17 21:49:41 2009 (r194404) +++ stable/7/sys/compat/linux/linux_socket.c Wed Jun 17 21:52:39 2009 (r194405) @@ -1139,7 +1139,7 @@ linux_recvmsg(struct thread *td, struct struct mbuf **controlp; caddr_t outbuf; void *data; - int error; + int error, i, fd, fds, *fdp; error = copyin(PTRIN(args->msg), &linux_msg, sizeof(linux_msg)); if (error) @@ -1208,15 +1208,30 @@ linux_recvmsg(struct thread *td, struct data = CMSG_DATA(cm); datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; - if (outlen + LINUX_CMSG_LEN(datalen) > - linux_msg.msg_controllen) { - if (outlen == 0) { - error = EMSGSIZE; - goto bad; - } else { - linux_msg.msg_flags |= LINUX_MSG_CTRUNC; - goto out; + switch (linux_cmsg->cmsg_type) + { + case LINUX_SCM_RIGHTS: + if (outlen + LINUX_CMSG_LEN(datalen) > + linux_msg.msg_controllen) { + if (outlen == 0) { + error = EMSGSIZE; + goto bad; + } else { + linux_msg.msg_flags |= + LINUX_MSG_CTRUNC; + goto out; + } + } + if (args->flags & LINUX_MSG_CMSG_CLOEXEC) { + fds = datalen / sizeof(int); + fdp = data; + for (i = 0; i < fds; i++) { + fd = *fdp++; + (void)kern_fcntl(td, fd, + F_SETFD, FD_CLOEXEC); + } } + break; } linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); Modified: stable/7/sys/compat/linux/linux_socket.h ============================================================================== --- stable/7/sys/compat/linux/linux_socket.h Wed Jun 17 21:49:41 2009 (r194404) +++ stable/7/sys/compat/linux/linux_socket.h Wed Jun 17 21:52:39 2009 (r194405) @@ -48,6 +48,7 @@ #define LINUX_MSG_RST 0x1000 #define LINUX_MSG_ERRQUEUE 0x2000 #define LINUX_MSG_NOSIGNAL 0x4000 +#define LINUX_MSG_CMSG_CLOEXEC 0x40000000 /* Socket-level control message types */ From brian at FreeBSD.org Thu Jun 18 01:11:11 2009 From: brian at FreeBSD.org (Brian Somers) Date: Thu Jun 18 01:11:27 2009 Subject: svn commit: r194411 - in stable/7/etc: . periodic/daily Message-ID: <200906180111.n5I1BA2F093456@svn.freebsd.org> Author: brian Date: Thu Jun 18 01:11:10 2009 New Revision: 194411 URL: http://svn.freebsd.org/changeset/base/194411 Log: MFC: r192970: Handle different rulesets. PR: 35018 Modified: stable/7/etc/ (props changed) stable/7/etc/periodic/daily/460.status-mail-rejects Modified: stable/7/etc/periodic/daily/460.status-mail-rejects ============================================================================== --- stable/7/etc/periodic/daily/460.status-mail-rejects Wed Jun 17 23:34:58 2009 (r194410) +++ stable/7/etc/periodic/daily/460.status-mail-rejects Thu Jun 18 01:11:10 2009 (r194411) @@ -12,10 +12,8 @@ then fi case "$daily_status_mail_rejects_shorten" in -[Yy][Ee][Ss]) - sed_output='\4 \3...';; -*) - sed_output='\2 (\3... \4)';; +[Yy][Ee][Ss]) shorten='cut -d" " -f2,3';; +*) shorten=cat;; esac case "$daily_status_mail_rejects_enable" in @@ -39,7 +37,8 @@ case "$daily_status_mail_rejects_enable" echo echo Checking for rejected mail hosts: - start=`date -v-1d '+%b %e'` + yesterday=$(date -v-1d '+%b %e') + today=$(date '+%b %e') n=$(($daily_status_mail_rejects_logs - 2)) rc=$({ while [ $n -ge 0 ] @@ -57,9 +56,14 @@ case "$daily_status_mail_rejects_enable" n=$(($n - 1)) done cat /var/log/maillog - } | - sed -n -E "s/^$start"'.*ruleset=check_[^ ]+, +arg1=,]+).*reject=([^ ]+) .* ([^ ]+)$/'"$sed_output"'/p' | - sort -f | uniq -ic | sort -fnr | tee /dev/stderr | wc -l) + } | sed -Ene "/^$today/q" -e "/^$yesterday/{"' + s/.*ruleset=check_relay,.* relay=([^,]+), reject=([^ ]*).*/\2 check_relay \1/p + t end + s/.*ruleset=check_rcpt,.* arg1=,]+).* reject=([^ ]+) .* ([^ ]+)/\2 check_rcpt \1 \3/p + t end + s/.*ruleset=check_([^,]+),.* arg1=,]+).* reject=([^ ]+) .* ([^ ]+)/\4 check_\1 \3 \5/p + :end + }' | eval $shorten | sort -f | uniq -ic | sort -fnr | tee /dev/stderr | wc -l) [ $rc -gt 0 ] && rc=1 fi;; From yongari at FreeBSD.org Thu Jun 18 04:47:41 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 04:47:59 2009 Subject: svn commit: r194414 - in stable/7/sys: . contrib/pf dev/mii Message-ID: <200906180447.n5I4le2C097966@svn.freebsd.org> Author: yongari Date: Thu Jun 18 04:47:40 2009 New Revision: 194414 URL: http://svn.freebsd.org/changeset/base/194414 Log: MFC r192708-192711: r192708: Use mii_phy_add_media() and remove usage of local macro ADD. Also checks extended status register to see whether the PHY is fast ethernet or not. This removes a lot of checks for specific PHY models and it makes easy to add more PHYs to e1000phy(4). While I'm here remove setting mii_anegticks as it is set with mii_phy_add_media(). r192709: Report current link state while auto-negotiation is in progress. r192710: Don't read unnecessary PHY registers. Speed/duplex resolution bit is valid only for auto-negotiation case so check the bit if we know auto-negotiation is active. While I'm here explicitly checks current speed with speed mask and set IFM_NONE if resolved speed is unknown. r192711: Do not ignore NEXT Page capability of auto-negotiation advertisement register. Some PHYs such as 88E3016 requires NEXT Page capability to establish valid link. Also set protocol selector field which is read only but it makes the intention clearer. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/mii/e1000phy.c Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:42:47 2009 (r194413) +++ stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:47:40 2009 (r194414) @@ -128,7 +128,6 @@ e1000phy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; - int fast_ether; esc = device_get_softc(dev); sc = &esc->mii_sc; @@ -141,10 +140,8 @@ e1000phy_attach(device_t dev) sc->mii_phy = ma->mii_phyno; sc->mii_service = e1000phy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; mii->mii_instance++; - fast_ether = 0; esc->mii_model = MII_MODEL(ma->mii_id2); switch (esc->mii_model) { case MII_MODEL_MARVELL_E1011: @@ -166,54 +163,16 @@ e1000phy_attach(device_t dev) */ PHY_WRITE(sc, E1000_EADR, 0); break; - case MII_MODEL_MARVELL_E3082: - /* 88E3082 10/100 Fast Ethernet PHY. */ - sc->mii_anegticks = MII_ANEGTICKS; - fast_ether = 1; - break; } e1000phy_reset(sc); + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + if (sc->mii_capabilities & BMSR_EXTSTAT) + sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); device_printf(dev, " "); - -#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), - E1000_CR_ISOLATE); - if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), - E1000_CR_SPEED_10); - printf("10baseT, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), - E1000_CR_SPEED_10 | E1000_CR_FULL_DUPLEX); - printf("10baseT-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), - E1000_CR_SPEED_100); - printf("100baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), - E1000_CR_SPEED_100 | E1000_CR_FULL_DUPLEX); - printf("100baseTX-FDX, "); - if (fast_ether == 0) { - /* - * 1000BT-simplex not supported; driver must ignore - * this entry, but it must be present in order to - * manually set full-duplex. - */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, - sc->mii_inst), E1000_CR_SPEED_1000); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, - sc->mii_inst), - E1000_CR_SPEED_1000 | E1000_CR_FULL_DUPLEX); - printf("1000baseTX-FDX, "); - } - } else { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, sc->mii_inst), - E1000_CR_SPEED_1000 | E1000_CR_FULL_DUPLEX); - printf("1000baseSX-FDX, "); - } - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0); - printf("auto\n"); -#undef ADD + mii_phy_add_media(sc); + printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); return (0); @@ -338,12 +297,14 @@ e1000phy_service(struct mii_softc *sc, s speed = 0; switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_1000_T: - if (esc->mii_model == MII_MODEL_MARVELL_E3082) + if ((sc->mii_extcapabilities & + (EXTSR_1000TFDX | EXTSR_1000THDX)) == 0) return (EINVAL); speed = E1000_CR_SPEED_1000; break; case IFM_1000_SX: - if (esc->mii_model == MII_MODEL_MARVELL_E3082) + if ((sc->mii_extcapabilities & + (EXTSR_1000XFDX | EXTSR_1000XHDX)) == 0) return (EINVAL); speed = E1000_CR_SPEED_1000; break; @@ -389,7 +350,8 @@ e1000phy_service(struct mii_softc *sc, s PHY_WRITE(sc, E1000_1GCR, gig | E1000_1GCR_MS_ENABLE); } else { - if (esc->mii_model != MII_MODEL_MARVELL_E3082) + if ((sc->mii_extcapabilities & + (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, E1000_1GCR, 0); } PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD); @@ -431,7 +393,7 @@ done: if (sc->mii_ticks++ == 0) break; if (sc->mii_ticks <= sc->mii_anegticks) - return (0); + break; sc->mii_ticks = 0; e1000phy_reset(sc); @@ -451,18 +413,14 @@ static void e1000phy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - int bmsr, bmcr, esr, gsr, ssr, isr, ar, lpar; + int bmcr, bmsr, gsr, ssr, ar, lpar; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; bmsr = PHY_READ(sc, E1000_SR) | PHY_READ(sc, E1000_SR); - esr = PHY_READ(sc, E1000_ESR); bmcr = PHY_READ(sc, E1000_CR); ssr = PHY_READ(sc, E1000_SSR); - isr = PHY_READ(sc, E1000_ISR); - ar = PHY_READ(sc, E1000_AR); - lpar = PHY_READ(sc, E1000_LPAR); if (bmsr & E1000_SR_LINK_STATUS) mii->mii_media_status |= IFM_ACTIVE; @@ -470,22 +428,28 @@ e1000phy_status(struct mii_softc *sc) if (bmcr & E1000_CR_LOOPBACK) mii->mii_media_active |= IFM_LOOP; - if ((((bmcr & E1000_CR_AUTO_NEG_ENABLE) != 0) && - ((bmsr & E1000_SR_AUTO_NEG_COMPLETE) == 0)) || - ((ssr & E1000_SSR_LINK) == 0) || - ((ssr & E1000_SSR_SPD_DPLX_RESOLVED) == 0)) { + if ((bmcr & E1000_CR_AUTO_NEG_ENABLE) != 0 && + (ssr & E1000_SSR_SPD_DPLX_RESOLVED) == 0) { /* Erg, still trying, I guess... */ mii->mii_media_active |= IFM_NONE; return; } if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - if (ssr & E1000_SSR_1000MBS) + switch (ssr & E1000_SSR_SPEED) { + case E1000_SSR_1000MBS: mii->mii_media_active |= IFM_1000_T; - else if (ssr & E1000_SSR_100MBS) + break; + case E1000_SSR_100MBS: mii->mii_media_active |= IFM_100_TX; - else + break; + case E1000_SSR_10MBS: mii->mii_media_active |= IFM_10_T; + break; + default: + mii->mii_media_active |= IFM_NONE; + return; + } } else { if (ssr & E1000_SSR_1000MBS) mii->mii_media_active |= IFM_1000_SX; @@ -497,6 +461,8 @@ e1000phy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_HDX; if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { + ar = PHY_READ(sc, E1000_AR); + lpar = PHY_READ(sc, E1000_LPAR); /* FLAG0==rx-flow-control FLAG1==tx-flow-control */ if ((ar & E1000_AR_PAUSE) && (lpar & E1000_LPAR_PAUSE)) { mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1; @@ -523,16 +489,19 @@ static int e1000phy_mii_phy_auto(struct e1000phy_softc *esc) { struct mii_softc *sc; + uint16_t reg; sc = &esc->mii_sc; - if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) - PHY_WRITE(sc, E1000_AR, E1000_AR_10T | E1000_AR_10T_FD | + if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { + reg = PHY_READ(sc, E1000_AR); + reg |= E1000_AR_10T | E1000_AR_10T_FD | E1000_AR_100TX | E1000_AR_100TX_FD | - E1000_AR_PAUSE | E1000_AR_ASM_DIR); - else + E1000_AR_PAUSE | E1000_AR_ASM_DIR; + PHY_WRITE(sc, E1000_AR, reg | E1000_AR_SELECTOR_FIELD); + } else PHY_WRITE(sc, E1000_AR, E1000_FA_1000X_FD | E1000_FA_1000X | E1000_FA_SYM_PAUSE | E1000_FA_ASYM_PAUSE); - if (esc->mii_model != MII_MODEL_MARVELL_E3082) + if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, E1000_1GCR, E1000_1GCR_1000T_FD | E1000_1GCR_1000T); PHY_WRITE(sc, E1000_CR, From yongari at FreeBSD.org Thu Jun 18 04:51:09 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 04:51:15 2009 Subject: svn commit: r194415 - in stable/7/sys: . contrib/pf dev/mii Message-ID: <200906180451.n5I4p8da098075@svn.freebsd.org> Author: yongari Date: Thu Jun 18 04:51:07 2009 New Revision: 194415 URL: http://svn.freebsd.org/changeset/base/194415 Log: MFC r192713: Add driver support for 88E3016 PHY which is found on Marvell Yukon FE+ controller. Due to the severe silicon bugs for Yukon FE+, 88E3016 seems to require more workarounds. However I'm not sure whether the workaround is PHY specific or only applicable to Yukon FE+. The datasheet for the PHY is publicly available but it lacks several details for the workaround used in this change. The workaround information was obtained from Linux. Many thanks to Yukon FE+ users who helped me add 88E3016 support. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu ) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/e1000phyreg.h stable/7/sys/dev/mii/miidevs Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:47:40 2009 (r194414) +++ stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:51:07 2009 (r194415) @@ -106,6 +106,7 @@ static const struct mii_phydesc e1000phy MII_PHY_DESC(MARVELL, E1111), MII_PHY_DESC(MARVELL, E1116), MII_PHY_DESC(MARVELL, E1118), + MII_PHY_DESC(MARVELL, E3016), MII_PHY_DESC(xxMARVELL, E1000), MII_PHY_DESC(xxMARVELL, E1011), MII_PHY_DESC(xxMARVELL, E1000_3), @@ -211,18 +212,29 @@ e1000phy_reset(struct mii_softc *sc) reg |= E1000_SCR_AUTO_X_MODE; if (esc->mii_model == MII_MODEL_MARVELL_E1116) reg &= ~E1000_SCR_POWER_DOWN; + reg |= E1000_SCR_ASSERT_CRS_ON_TX; break; case MII_MODEL_MARVELL_E3082: reg |= (E1000_SCR_AUTO_X_MODE >> 1); + reg |= E1000_SCR_ASSERT_CRS_ON_TX; + break; + case MII_MODEL_MARVELL_E3016: + reg |= E1000_SCR_AUTO_MDIX; + reg &= ~(E1000_SCR_EN_DETECT | + E1000_SCR_SCRAMBLER_DISABLE); + reg |= E1000_SCR_LPNP; + /* XXX Enable class A driver for Yukon FE+ A0. */ + PHY_WRITE(sc, 0x1C, PHY_READ(sc, 0x1C) | 0x0001); break; default: reg &= ~E1000_SCR_AUTO_X_MODE; + reg |= E1000_SCR_ASSERT_CRS_ON_TX; break; } - /* Enable CRS on TX. */ - reg |= E1000_SCR_ASSERT_CRS_ON_TX; - /* Auto correction for reversed cable polarity. */ - reg &= ~E1000_SCR_POLARITY_REVERSAL; + if (esc->mii_model != MII_MODEL_MARVELL_E3016) { + /* Auto correction for reversed cable polarity. */ + reg &= ~E1000_SCR_POLARITY_REVERSAL; + } PHY_WRITE(sc, E1000_SCR, reg); if (esc->mii_model == MII_MODEL_MARVELL_E1116) { @@ -241,6 +253,13 @@ e1000phy_reset(struct mii_softc *sc) case MII_MODEL_MARVELL_E1118: case MII_MODEL_MARVELL_E1149: break; + case MII_MODEL_MARVELL_E3016: + /* LED2 -> ACT, LED1 -> LINK, LED0 -> SPEED. */ + PHY_WRITE(sc, 0x16, 0x0B << 8 | 0x05 << 4 | 0x04); + /* Integrated register calibration workaround. */ + PHY_WRITE(sc, 0x1D, 17); + PHY_WRITE(sc, 0x1E, 0x3F60); + break; default: /* Force TX_CLK to 25MHz clock. */ reg = PHY_READ(sc, E1000_ESCR); Modified: stable/7/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/7/sys/dev/mii/e1000phyreg.h Thu Jun 18 04:47:40 2009 (r194414) +++ stable/7/sys/dev/mii/e1000phyreg.h Thu Jun 18 04:51:07 2009 (r194415) @@ -236,6 +236,16 @@ #define E1000_SCR_TX_FIFO_DEPTH_10 0x8000 #define E1000_SCR_TX_FIFO_DEPTH_12 0xC000 +/* 88E3016 only */ +#define E1000_SCR_AUTO_MDIX 0x0030 +#define E1000_SCR_SIGDET_POLARITY 0x0040 +#define E1000_SCR_EXT_DISTANCE 0x0080 +#define E1000_SCR_FEFI_DISABLE 0x0100 +#define E1000_SCR_NLP_GEN_DISABLE 0x0800 +#define E1000_SCR_LPNP 0x1000 +#define E1000_SCR_NLP_CHK_DISABLE 0x2000 +#define E1000_SCR_EN_DETECT 0x4000 + #define E1000_SCR_EN_DETECT_MASK 0x0300 /* 88E1112 page 2 */ Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Thu Jun 18 04:47:40 2009 (r194414) +++ stable/7/sys/dev/mii/miidevs Thu Jun 18 04:51:07 2009 (r194415) @@ -236,6 +236,7 @@ model MARVELL E1149 0x000b Marvell 88E1 model MARVELL E1111 0x000c Marvell 88E1111 Gigabit PHY model MARVELL E1116 0x0021 Marvell 88E1116 Gigabit PHY model MARVELL E1118 0x0022 Marvell 88E1118 Gigabit PHY +model MARVELL E3016 0x0026 Marvell 88E3016 10/100 Fast Ethernet PHY model xxMARVELL E1000 0x0005 Marvell 88E1000 Gigabit PHY model xxMARVELL E1011 0x0002 Marvell 88E1011 Gigabit PHY model xxMARVELL E1000_3 0x0003 Marvell 88E1000 Gigabit PHY From yongari at FreeBSD.org Thu Jun 18 04:55:06 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 04:55:12 2009 Subject: svn commit: r194416 - in stable/7/sys: . contrib/pf dev/mii Message-ID: <200906180455.n5I4t5Q4098201@svn.freebsd.org> Author: yongari Date: Thu Jun 18 04:55:04 2009 New Revision: 194416 URL: http://svn.freebsd.org/changeset/base/194416 Log: MFC r193289: Don't assume page register value is 0 and restore previous page register after issuing 'powerup'. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/mii/e1000phy.c Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:51:07 2009 (r194415) +++ stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:55:04 2009 (r194416) @@ -238,11 +238,13 @@ e1000phy_reset(struct mii_softc *sc) PHY_WRITE(sc, E1000_SCR, reg); if (esc->mii_model == MII_MODEL_MARVELL_E1116) { + page = PHY_READ(sc, E1000_EADR); + /* Select page 2, MAC specific control register. */ PHY_WRITE(sc, E1000_EADR, 2); reg = PHY_READ(sc, E1000_SCR); reg |= E1000_SCR_RGMII_POWER_UP; PHY_WRITE(sc, E1000_SCR, reg); - PHY_WRITE(sc, E1000_EADR, 0); + PHY_WRITE(sc, E1000_EADR, page); } } From yongari at FreeBSD.org Thu Jun 18 04:58:06 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 04:58:22 2009 Subject: svn commit: r194417 - in stable/7/sys: . contrib/pf dev/mii Message-ID: <200906180458.n5I4w5Lx098306@svn.freebsd.org> Author: yongari Date: Thu Jun 18 04:58:04 2009 New Revision: 194417 URL: http://svn.freebsd.org/changeset/base/194417 Log: MFC r193291: Program LED registers for 88E1116/88E1149 PHYs. These PHYs are found on Marvell Yukon Ultra, Marvell Yukon Extreme controllers. While I'm here explicitly issue 'powerup' command for 88E1149 PHY. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/e1000phyreg.h Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:55:04 2009 (r194416) +++ stable/7/sys/dev/mii/e1000phy.c Thu Jun 18 04:58:04 2009 (r194417) @@ -237,7 +237,8 @@ e1000phy_reset(struct mii_softc *sc) } PHY_WRITE(sc, E1000_SCR, reg); - if (esc->mii_model == MII_MODEL_MARVELL_E1116) { + if (esc->mii_model == MII_MODEL_MARVELL_E1116 || + esc->mii_model == MII_MODEL_MARVELL_E1149) { page = PHY_READ(sc, E1000_EADR); /* Select page 2, MAC specific control register. */ PHY_WRITE(sc, E1000_EADR, 2); @@ -251,9 +252,22 @@ e1000phy_reset(struct mii_softc *sc) switch (MII_MODEL(esc->mii_model)) { case MII_MODEL_MARVELL_E3082: case MII_MODEL_MARVELL_E1112: - case MII_MODEL_MARVELL_E1116: case MII_MODEL_MARVELL_E1118: + break; + case MII_MODEL_MARVELL_E1116: case MII_MODEL_MARVELL_E1149: + page = PHY_READ(sc, E1000_EADR); + /* Select page 3, LED control register. */ + PHY_WRITE(sc, E1000_EADR, 3); + PHY_WRITE(sc, E1000_SCR, + E1000_SCR_LED_LOS(1) | /* Link/Act */ + E1000_SCR_LED_INIT(8) | /* 10Mbps */ + E1000_SCR_LED_STAT1(7) | /* 100Mbps */ + E1000_SCR_LED_STAT0(7)); /* 1000Mbps */ + /* Set blink rate. */ + PHY_WRITE(sc, E1000_IER, E1000_PULSE_DUR(E1000_PULSE_170MS) | + E1000_BLINK_RATE(E1000_BLINK_84MS)); + PHY_WRITE(sc, E1000_EADR, page); break; case MII_MODEL_MARVELL_E3016: /* LED2 -> ACT, LED1 -> LINK, LED0 -> SPEED. */ Modified: stable/7/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/7/sys/dev/mii/e1000phyreg.h Thu Jun 18 04:55:04 2009 (r194416) +++ stable/7/sys/dev/mii/e1000phyreg.h Thu Jun 18 04:58:04 2009 (r194417) @@ -256,9 +256,19 @@ /* 88E1116 page 0 */ #define E1000_SCR_POWER_DOWN 0x0004 -/* 88E1116 page 2 */ +/* 88E1116, 88E1149 page 2 */ #define E1000_SCR_RGMII_POWER_UP 0x0008 +/* 88E1116, 88E1149 page 3 */ +#define E1000_SCR_LED_STAT0_MASK 0x000F +#define E1000_SCR_LED_STAT1_MASK 0x00F0 +#define E1000_SCR_LED_INIT_MASK 0x0F00 +#define E1000_SCR_LED_LOS_MASK 0xF000 +#define E1000_SCR_LED_STAT0(x) ((x) & E1000_SCR_LED_STAT0_MASK) +#define E1000_SCR_LED_STAT1(x) ((x) & E1000_SCR_LED_STAT1_MASK) +#define E1000_SCR_LED_INIT(x) ((x) & E1000_SCR_LED_INIT_MASK) +#define E1000_SCR_LED_LOS(x) ((x) & E1000_SCR_LED_LOS_MASK) + #define E1000_SSR 0x11 /* special status register */ #define E1000_SSR_JABBER 0x0001 #define E1000_SSR_REV_POLARITY 0x0002 @@ -286,6 +296,26 @@ #define E1000_IER_SPEED_CHANGED 0x4000 #define E1000_IER_AUTO_NEG_ERR 0x8000 +/* 88E1116, 88E1149 page 3, LED timer control. */ +#define E1000_PULSE_MASK 0x7000 +#define E1000_PULSE_NO_STR 0 /* no pulse stretching */ +#define E1000_PULSE_21MS 1 /* 21 ms to 42 ms */ +#define E1000_PULSE_42MS 2 /* 42 ms to 84 ms */ +#define E1000_PULSE_84MS 3 /* 84 ms to 170 ms */ +#define E1000_PULSE_170MS 4 /* 170 ms to 340 ms */ +#define E1000_PULSE_340MS 5 /* 340 ms to 670 ms */ +#define E1000_PULSE_670MS 6 /* 670 ms to 1300 ms */ +#define E1000_PULSE_1300MS 7 /* 1300 ms to 2700 ms */ +#define E1000_PULSE_DUR(x) ((x) & E1000_PULSE_MASK) + +#define E1000_BLINK_MASK 0x0700 +#define E1000_BLINK_42MS 0 /* 42 ms */ +#define E1000_BLINK_84MS 1 /* 84 ms */ +#define E1000_BLINK_170MS 2 /* 170 ms */ +#define E1000_BLINK_340MS 3 /* 340 ms */ +#define E1000_BLINK_670MS 4 /* 670 ms */ +#define E1000_BLINK_RATE(x) ((x) & E1000_BLINK_MASK) + #define E1000_ISR 0x13 /* interrupt status reg */ #define E1000_ISR_JABBER 0x0001 #define E1000_ISR_POLARITY_CHANGE 0x0002 From yongari at FreeBSD.org Thu Jun 18 05:06:26 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 05:06:37 2009 Subject: svn commit: r194418 - in stable/7/sys: . contrib/pf dev/msk Message-ID: <200906180506.n5I56Pm4098590@svn.freebsd.org> Author: yongari Date: Thu Jun 18 05:06:25 2009 New Revision: 194418 URL: http://svn.freebsd.org/changeset/base/194418 Log: MFC r192716,192718-192720 r192716: Remove link handling taskqueue and use mii callback directly. While I'm here also checks driver running state. r192718: Use bit definition to represent link state, device suspend instead of using separate variables in softc. r192719: Use bit definition to represent MSI and detach state instead of using separate variables in softc. r192720: Correctly return the result of mii_mediachg(). Previously it always used to return success. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Thu Jun 18 04:58:04 2009 (r194417) +++ stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:06:25 2009 (r194418) @@ -285,7 +285,6 @@ static int msk_phy_writereg(struct msk_i static int msk_miibus_readreg(device_t, int, int); static int msk_miibus_writereg(device_t, int, int, int); static void msk_miibus_statchg(device_t); -static void msk_link_task(void *, int); static void msk_rxfilter(struct msk_if_softc *); static void msk_setvlan(struct msk_if_softc *, struct ifnet *); @@ -459,40 +458,30 @@ msk_phy_writereg(struct msk_if_softc *sc static void msk_miibus_statchg(device_t dev) { - struct msk_if_softc *sc_if; - - sc_if = device_get_softc(dev); - taskqueue_enqueue(taskqueue_swi, &sc_if->msk_link_task); -} - -static void -msk_link_task(void *arg, int pending) -{ struct msk_softc *sc; struct msk_if_softc *sc_if; struct mii_data *mii; struct ifnet *ifp; uint32_t gmac; - sc_if = (struct msk_if_softc *)arg; + sc_if = device_get_softc(dev); sc = sc_if->msk_softc; MSK_IF_LOCK(sc_if); mii = device_get_softc(sc_if->msk_miibus); ifp = sc_if->msk_ifp; - if (mii == NULL || ifp == NULL) { - MSK_IF_UNLOCK(sc_if); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - } if (mii->mii_media_status & IFM_ACTIVE) { if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) - sc_if->msk_link = 1; + sc_if->msk_flags |= MSK_FLAG_LINK; } else - sc_if->msk_link = 0; + sc_if->msk_flags &= ~MSK_FLAG_LINK; - if (sc_if->msk_link != 0) { + if ((sc_if->msk_flags & MSK_FLAG_LINK) != 0) { /* Enable Tx FIFO Underrun. */ CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, GMAC_IRQ_MSK), GM_IS_TX_FF_UR | GM_IS_RX_FF_OR); @@ -554,8 +543,6 @@ msk_link_task(void *arg, int pending) /* Read again to ensure writing. */ GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); } - - MSK_IF_UNLOCK(sc_if); } static void @@ -869,15 +856,16 @@ msk_mediachange(struct ifnet *ifp) { struct msk_if_softc *sc_if; struct mii_data *mii; + int error; sc_if = ifp->if_softc; MSK_IF_LOCK(sc_if); mii = device_get_softc(sc_if->msk_miibus); - mii_mediachg(mii); + error = mii_mediachg(mii); MSK_IF_UNLOCK(sc_if); - return (0); + return (error); } /* @@ -936,7 +924,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm & (IFF_PROMISC | IFF_ALLMULTI)) != 0) msk_rxfilter(sc_if); } else { - if (sc_if->msk_detach == 0) + if ((sc_if->msk_flags & MSK_FLAG_DETACH) == 0) msk_init_locked(sc_if); } } else { @@ -1416,7 +1404,6 @@ msk_attach(device_t dev) } callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); - TASK_INIT(&sc_if->msk_link_task, 0, msk_link_task, sc_if); msk_sysctl_node(sc_if); /* Disable jumbo frame for Yukon FE. */ @@ -1659,7 +1646,7 @@ mskc_attach(device_t dev) if (sc->msk_num_port == 1 && pci_alloc_msi(dev, &msir) == 0) { if (msic == msir) { - sc->msk_msi = 1; + sc->msk_pflags |= MSK_FLAG_MSI; sc->msk_irq_spec = msic == 2 ? msk_irq_spec_msi2 : msk_irq_spec_msi; @@ -1785,13 +1772,12 @@ msk_detach(device_t dev) ifp = sc_if->msk_ifp; if (device_is_attached(dev)) { /* XXX */ - sc_if->msk_detach = 1; + sc_if->msk_flags |= MSK_FLAG_DETACH; msk_stop(sc_if); /* Can't hold locks while calling detach. */ MSK_IF_UNLOCK(sc_if); callout_drain(&sc_if->msk_tick_ch); taskqueue_drain(taskqueue_fast, &sc_if->msk_tx_task); - taskqueue_drain(taskqueue_swi, &sc_if->msk_link_task); ether_ifdetach(ifp); MSK_IF_LOCK(sc_if); } @@ -1870,7 +1856,7 @@ mskc_detach(device_t dev) sc->msk_intrhand[1] = NULL; } bus_release_resources(dev, sc->msk_irq_spec, sc->msk_irq); - if (sc->msk_msi) + if ((sc->msk_pflags & MSK_FLAG_MSI) != 0) pci_release_msi(dev); bus_release_resources(dev, sc->msk_res_spec, sc->msk_res); mtx_destroy(&sc->msk_mtx); @@ -2641,7 +2627,7 @@ msk_start(struct ifnet *ifp) MSK_IF_LOCK(sc_if); if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || sc_if->msk_link == 0) { + IFF_DRV_RUNNING || (sc_if->msk_flags & MSK_FLAG_LINK) == 0) { MSK_IF_UNLOCK(sc_if); return; } @@ -2698,7 +2684,7 @@ msk_watchdog(struct msk_if_softc *sc_if) if (sc_if->msk_watchdog_timer == 0 || --sc_if->msk_watchdog_timer) return; ifp = sc_if->msk_ifp; - if (sc_if->msk_link == 0) { + if ((sc_if->msk_flags & MSK_FLAG_LINK) == 0) { if (bootverbose) if_printf(sc_if->msk_ifp, "watchdog timeout " "(missed link)\n"); @@ -2785,7 +2771,7 @@ mskc_suspend(device_t dev) /* Put hardware reset. */ CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - sc->msk_suspended = 1; + sc->msk_pflags |= MSK_FLAG_SUSPEND; MSK_UNLOCK(sc); @@ -2808,7 +2794,7 @@ mskc_resume(device_t dev) ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0)) msk_init_locked(sc->msk_if[i]); } - sc->msk_suspended = 0; + sc->msk_pflags &= MSK_FLAG_SUSPEND; MSK_UNLOCK(sc); @@ -3321,7 +3307,8 @@ msk_legacy_intr(void *xsc) /* Reading B0_Y2_SP_ISRC2 masks further interrupts. */ status = CSR_READ_4(sc, B0_Y2_SP_ISRC2); - if (status == 0 || status == 0xffffffff || sc->msk_suspended != 0 || + if (status == 0 || status == 0xffffffff || + (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || (status & sc->msk_intrmask) == 0) { CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); return; @@ -3408,7 +3395,8 @@ msk_int_task(void *arg, int pending) /* Get interrupt source. */ status = CSR_READ_4(sc, B0_ISRC); - if (status == 0 || status == 0xffffffff || sc->msk_suspended != 0 || + if (status == 0 || status == 0xffffffff || + (sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 || (status & sc->msk_intrmask) == 0) goto done; @@ -3690,7 +3678,7 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, B0_IMSK, sc->msk_intrmask); CSR_READ_4(sc, B0_IMSK); - sc_if->msk_link = 0; + sc_if->msk_flags &= ~MSK_FLAG_LINK; mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -3925,7 +3913,7 @@ msk_stop(struct msk_if_softc *sc_if) * Mark the interface down. */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - sc_if->msk_link = 0; + sc_if->msk_flags &= ~MSK_FLAG_LINK; } /* Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 04:58:04 2009 (r194417) +++ stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:06:25 2009 (r194418) @@ -2342,9 +2342,7 @@ struct msk_softc { uint32_t msk_intrmask; uint32_t msk_intrhwemask; uint32_t msk_pflags; - int msk_suspended; int msk_clock; - int msk_msi; struct msk_if_softc *msk_if[2]; device_t msk_devs[2]; int msk_txqsize; @@ -2382,10 +2380,13 @@ struct msk_if_softc { int msk_framesize; int msk_phytype; int msk_phyaddr; - int msk_link; uint32_t msk_flags; +#define MSK_FLAG_MSI 0x0001 #define MSK_FLAG_RAMBUF 0x0010 #define MSK_FLAG_NOJUMBO 0x0020 +#define MSK_FLAG_SUSPEND 0x2000 +#define MSK_FLAG_DETACH 0x4000 +#define MSK_FLAG_LINK 0x8000 struct callout msk_tick_ch; int msk_watchdog_timer; uint32_t msk_txq; /* Tx. Async Queue offset */ @@ -2395,10 +2396,8 @@ struct msk_if_softc { struct msk_ring_data msk_rdata; struct msk_softc *msk_softc; /* parent controller */ struct msk_hw_stats msk_stats; - struct task msk_link_task; struct task msk_tx_task; int msk_if_flags; - int msk_detach; uint16_t msk_vtag; /* VLAN tag id. */ }; From yongari at FreeBSD.org Thu Jun 18 05:16:20 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 05:16:38 2009 Subject: svn commit: r194419 - in stable/7/sys: . contrib/pf dev/msk Message-ID: <200906180516.n5I5GJGg098902@svn.freebsd.org> Author: yongari Date: Thu Jun 18 05:16:19 2009 New Revision: 194419 URL: http://svn.freebsd.org/changeset/base/194419 Log: MFC r192723-192728,192731 r192723: Rather than checking every chip revision, introduce more flags to mark controller's capability. Controllers that have jumbo frame support sets MSK_FLAG_JUMBO, and controllers that does not support checksum offloading for jumbo frames will set MSK_FLAG_JUMBO_NOCSUM. For Fast Ethernet controllers it will set MSK_FLAG_FASTETHER and it would be used in link state handling. While here, disable Tx checksum offloading if jumbo frame is used on controllers that does not have Tx checksum offloading capability for jumbo frame(e.g. Yukon EC Ultra). r192724: Caller already hold a driver lock in mii callback, assert it. r192725: Add missing ~ operator. r192726: Add support for newer descriptor format. This format is used on Yukon FE+, Yukon Extreme and Yukon Supreme. r192727: Explicitly check resolved speed/duplex. Just checking IFM_ACTIVE does not guarantee established link. Also 1000baseT link report for fast ethernet controller is not valid one so make sure gigabit link is allowed for this controller. Whenever we lost link, check whether Rx/Tx MACs were enabled. If both MAC are not active, do not try to disable it again. r192728: Disable HW WOL for Yukon EC Ultra. While I'm here use switch statement over if-else statement. This change will make it easy to add newer Yukon controllers. r192731: Explicitly reset GMAC Controls and initialize GM_GP_CTRL register. The GM_GP_CTRL register may have stale content from previous link information so clearing it will make hardware update the register correctly when it established a valid link. While I'm here remove stale comment. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:06:25 2009 (r194418) +++ stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:16:19 2009 (r194419) @@ -467,7 +467,7 @@ msk_miibus_statchg(device_t dev) sc_if = device_get_softc(dev); sc = sc_if->msk_softc; - MSK_IF_LOCK(sc_if); + MSK_IF_LOCK_ASSERT(sc_if); mii = device_get_softc(sc_if->msk_miibus); ifp = sc_if->msk_ifp; @@ -475,11 +475,25 @@ msk_miibus_statchg(device_t dev) (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - if (mii->mii_media_status & IFM_ACTIVE) { - if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) + sc_if->msk_flags &= ~MSK_FLAG_LINK; + if ((mii->mii_media_status & (IFM_AVALID | IFM_ACTIVE)) == + (IFM_AVALID | IFM_ACTIVE)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: sc_if->msk_flags |= MSK_FLAG_LINK; - } else - sc_if->msk_flags &= ~MSK_FLAG_LINK; + break; + case IFM_1000_T: + case IFM_1000_SX: + case IFM_1000_LX: + case IFM_1000_CX: + if ((sc_if->msk_flags & MSK_FLAG_FASTETHER) == 0) + sc_if->msk_flags |= MSK_FLAG_LINK; + break; + default: + break; + } + } if ((sc_if->msk_flags & MSK_FLAG_LINK) != 0) { /* Enable Tx FIFO Underrun. */ @@ -538,10 +552,12 @@ msk_miibus_statchg(device_t dev) msk_phy_writereg(sc_if, PHY_ADDR_MARV, PHY_MARV_INT_MASK, 0); /* Disable Rx/Tx MAC. */ gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); - gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); - GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac); - /* Read again to ensure writing. */ - GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); + if ((GM_GPCR_RX_ENA | GM_GPCR_TX_ENA) != 0) { + gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac); + /* Read again to ensure writing. */ + GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); + } } } @@ -901,20 +917,29 @@ msk_ioctl(struct ifnet *ifp, u_long comm switch(command) { case SIOCSIFMTU: + MSK_IF_LOCK(sc_if); if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN) error = EINVAL; else if (ifp->if_mtu != ifr->ifr_mtu) { - if ((sc_if->msk_flags & MSK_FLAG_NOJUMBO) != 0 && - ifr->ifr_mtu > ETHERMTU) - error = EINVAL; - else { - MSK_IF_LOCK(sc_if); - ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) - msk_init_locked(sc_if); - MSK_IF_UNLOCK(sc_if); + if (ifr->ifr_mtu > ETHERMTU) { + if ((sc_if->msk_flags & MSK_FLAG_JUMBO) == 0) { + error = EINVAL; + MSK_IF_UNLOCK(sc_if); + break; + } + if ((sc_if->msk_flags & + MSK_FLAG_JUMBO_NOCSUM) != 0) { + ifp->if_hwassist &= + ~(MSK_CSUM_FEATURES | CSUM_TSO); + ifp->if_capenable &= + ~(IFCAP_TSO4 | IFCAP_TXCSUM); + VLAN_CAPABILITIES(ifp); + } } + ifp->if_mtu = ifr->ifr_mtu; + msk_init_locked(sc_if); } + MSK_IF_UNLOCK(sc_if); break; case SIOCSIFFLAGS: MSK_IF_LOCK(sc_if); @@ -971,11 +996,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist &= ~CSUM_TSO; } if (ifp->if_mtu > ETHERMTU && - sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_EC_U) { - /* - * In Yukon EC Ultra, TSO & checksum offload is not - * supported for jumbo frame. - */ + (sc_if->msk_flags & MSK_FLAG_JUMBO_NOCSUM) != 0) { ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO); ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM); } @@ -1059,7 +1080,7 @@ mskc_setup_rambuffer(struct msk_softc *s static void msk_phy_power(struct msk_softc *sc, int mode) { - uint32_t val; + uint32_t our, val; int i; switch (mode) { @@ -1085,16 +1106,17 @@ msk_phy_power(struct msk_softc *sc, int val = pci_read_config(sc->msk_dev, PCI_OUR_REG_1, 4); val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); - if (sc->msk_hw_id == CHIP_ID_YUKON_XL && - sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { - /* Deassert Low Power for 1st PHY. */ - val |= PCI_Y2_PHY1_COMA; - if (sc->msk_num_port > 1) - val |= PCI_Y2_PHY2_COMA; - } else if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U) { - uint32_t our; - - CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_ON); + switch (sc->msk_hw_id) { + case CHIP_ID_YUKON_XL: + if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { + /* Deassert Low Power for 1st PHY. */ + val |= PCI_Y2_PHY1_COMA; + if (sc->msk_num_port > 1) + val |= PCI_Y2_PHY2_COMA; + } + break; + case CHIP_ID_YUKON_EC_U: + CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); /* Enable all clocks. */ pci_write_config(sc->msk_dev, PCI_OUR_REG_3, 0, 4); @@ -1105,6 +1127,9 @@ msk_phy_power(struct msk_softc *sc, int pci_write_config(sc->msk_dev, PCI_OUR_REG_4, our, 4); /* Set to default value. */ pci_write_config(sc->msk_dev, PCI_OUR_REG_5, 0, 4); + break; + default: + break; } /* Release PHY from PowerDown/COMA mode. */ pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); @@ -1406,10 +1431,6 @@ msk_attach(device_t dev) callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); msk_sysctl_node(sc_if); - /* Disable jumbo frame for Yukon FE. */ - if (sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_FE) - sc_if->msk_flags |= MSK_FLAG_NOJUMBO; - if ((error = msk_txrx_dma_alloc(sc_if) != 0)) goto fail; msk_rx_dma_jalloc(sc_if); @@ -1609,14 +1630,20 @@ mskc_attach(device_t dev) switch (sc->msk_hw_id) { case CHIP_ID_YUKON_EC: + sc->msk_clock = 125; /* 125 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO; + break; case CHIP_ID_YUKON_EC_U: sc->msk_clock = 125; /* 125 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_JUMBO_NOCSUM; break; case CHIP_ID_YUKON_FE: sc->msk_clock = 100; /* 100 Mhz */ + sc->msk_pflags |= MSK_FLAG_FASTETHER; break; case CHIP_ID_YUKON_XL: sc->msk_clock = 156; /* 156 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO; break; default: sc->msk_clock = 156; /* 156 Mhz */ @@ -2158,11 +2185,10 @@ msk_rx_dma_jalloc(struct msk_if_softc *s bus_size_t rxalign; int error, i; - if (jumbo_disable != 0 || (sc_if->msk_flags & MSK_FLAG_NOJUMBO) != 0) { - sc_if->msk_flags |= MSK_FLAG_NOJUMBO; + if (jumbo_disable != 0 || (sc_if->msk_flags & MSK_FLAG_JUMBO) == 0) { + sc_if->msk_flags &= ~MSK_FLAG_JUMBO; device_printf(sc_if->msk_if_dev, "disabling jumbo frame support\n"); - sc_if->msk_flags |= MSK_FLAG_NOJUMBO; return (0); } /* Create tag for jumbo Rx ring. */ @@ -2257,7 +2283,7 @@ jumbo_fail: msk_rx_dma_jfree(sc_if); device_printf(sc_if->msk_if_dev, "disabling jumbo frame support " "due to resource shortage\n"); - sc_if->msk_flags |= MSK_FLAG_NOJUMBO; + sc_if->msk_flags &= ~MSK_FLAG_JUMBO; return (error); } @@ -2393,7 +2419,8 @@ msk_encap(struct msk_if_softc *sc_if, st tcp_offset = offset = 0; m = *m_head; - if ((m->m_pkthdr.csum_flags & (MSK_CSUM_FEATURES | CSUM_TSO)) != 0) { + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (m->m_pkthdr.csum_flags & (MSK_CSUM_FEATURES | CSUM_TSO)) != 0) { /* * Since mbuf has no protocol specific structure information * in it we have to inspect protocol information here to @@ -2520,11 +2547,18 @@ msk_encap(struct msk_if_softc *sc_if, st /* Check TSO support. */ if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - tso_mtu = offset + m->m_pkthdr.tso_segsz; + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) + tso_mtu = m->m_pkthdr.tso_segsz; + else + tso_mtu = offset + m->m_pkthdr.tso_segsz; if (tso_mtu != sc_if->msk_cdata.msk_tso_mtu) { tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; tx_le->msk_addr = htole32(tso_mtu); - tx_le->msk_control = htole32(OP_LRGLEN | HW_OWNER); + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) + tx_le->msk_control = htole32(OP_MSS | HW_OWNER); + else + tx_le->msk_control = + htole32(OP_LRGLEN | HW_OWNER); sc_if->msk_cdata.msk_tx_cnt++; MSK_INC(prod, MSK_TX_RING_CNT); sc_if->msk_cdata.msk_tso_mtu = tso_mtu; @@ -2548,15 +2582,21 @@ msk_encap(struct msk_if_softc *sc_if, st } /* Check if we have to handle checksum offload. */ if (tso == 0 && (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) { - tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; - tx_le->msk_addr = htole32(((tcp_offset + m->m_pkthdr.csum_data) - & 0xffff) | ((uint32_t)tcp_offset << 16)); - tx_le->msk_control = htole32(1 << 16 | (OP_TCPLISW | HW_OWNER)); - control = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; - if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) - control |= UDPTCP; - sc_if->msk_cdata.msk_tx_cnt++; - MSK_INC(prod, MSK_TX_RING_CNT); + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) + control |= CALSUM; + else { + tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; + tx_le->msk_addr = htole32(((tcp_offset + + m->m_pkthdr.csum_data) & 0xffff) | + ((uint32_t)tcp_offset << 16)); + tx_le->msk_control = htole32(1 << 16 | + (OP_TCPLISW | HW_OWNER)); + control = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; + if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) + control |= UDPTCP; + sc_if->msk_cdata.msk_tx_cnt++; + MSK_INC(prod, MSK_TX_RING_CNT); + } } si = prod; @@ -2794,7 +2834,7 @@ mskc_resume(device_t dev) ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0)) msk_init_locked(sc->msk_if[i]); } - sc->msk_pflags &= MSK_FLAG_SUSPEND; + sc->msk_pflags &= ~MSK_FLAG_SUSPEND; MSK_UNLOCK(sc); @@ -3490,27 +3530,21 @@ msk_init_locked(struct msk_if_softc *sc_ sc_if->msk_framesize = ifp->if_mtu; sc_if->msk_framesize += ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; if (ifp->if_mtu > ETHERMTU && - sc_if->msk_softc->msk_hw_id == CHIP_ID_YUKON_EC_U) { - /* - * In Yukon EC Ultra, TSO & checksum offload is not - * supported for jumbo frame. - */ + (sc_if->msk_flags & MSK_FLAG_JUMBO_NOCSUM) != 0) { ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO); ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM); } + /* GMAC Control reset. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); + /* - * Initialize GMAC first. - * Without this initialization, Rx MAC did not work as expected - * and Rx MAC garbled status LEs and it resulted in out-of-order - * or duplicated frame delivery which in turn showed very poor - * Rx performance.(I had to write a packet analysis code that - * could be embeded in driver to diagnose this issue.) - * I've spent almost 2 months to fix this issue. If I have had - * datasheet for Yukon II I wouldn't have encountered this. :-( + * Initialize GMAC first such that speed/duplex/flow-control + * parameters are renegotiated when interface is brought up. */ - gmac = GM_GPCR_SPEED_100 | GM_GPCR_SPEED_1000 | GM_GPCR_DUP_FULL; - GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, 0); /* Dummy read the Interrupt Source Register. */ CSR_READ_1(sc, MR_ADDR(sc_if->msk_port, GMAC_IRQ_SRC)); Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:06:25 2009 (r194418) +++ stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:16:19 2009 (r194419) @@ -2122,6 +2122,8 @@ struct msk_stat_desc { #define OP_ADDR64VLAN (OP_ADDR64 | OP_VLAN) #define OP_LRGLEN 0x24000000 #define OP_LRGLENVLAN (OP_LRGLEN | OP_VLAN) +#define OP_MSS 0x28000000 +#define OP_MSSVLAN (OP_MSS | OP_VLAN) #define OP_BUFFER 0x40000000 #define OP_PACKET 0x41000000 #define OP_LARGESEND 0x43000000 @@ -2382,8 +2384,11 @@ struct msk_if_softc { int msk_phyaddr; uint32_t msk_flags; #define MSK_FLAG_MSI 0x0001 -#define MSK_FLAG_RAMBUF 0x0010 -#define MSK_FLAG_NOJUMBO 0x0020 +#define MSK_FLAG_FASTETHER 0x0004 +#define MSK_FLAG_JUMBO 0x0008 +#define MSK_FLAG_JUMBO_NOCSUM 0x0010 +#define MSK_FLAG_RAMBUF 0x0020 +#define MSK_FLAG_DESCV2 0x0040 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From yongari at FreeBSD.org Thu Jun 18 05:20:03 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 05:20:09 2009 Subject: svn commit: r194420 - in stable/7/sys: . contrib/pf dev/msk Message-ID: <200906180520.n5I5K2ad099015@svn.freebsd.org> Author: yongari Date: Thu Jun 18 05:20:02 2009 New Revision: 194420 URL: http://svn.freebsd.org/changeset/base/194420 Log: MFC r192734: Add preliminary Yukon FE+ support and register definitions. Yukon FE+ is fast ethernet controller and uses new descriptor format. Since I don't have this controller, the support code was written from guess and various feedback from enthusiastic users. Thanks to all users who patiently tested my initial patches. Special thanks to Tanguy Bouzeloc who fixed critical bug of initial patch. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu ) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:16:19 2009 (r194419) +++ stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:20:02 2009 (r194420) @@ -220,7 +220,8 @@ static const char *model_name[] = { "Yukon EC Ultra", "Yukon Unknown", "Yukon EC", - "Yukon FE" + "Yukon FE", + "Yukon FE+" }; static int mskc_probe(device_t); @@ -1116,6 +1117,7 @@ msk_phy_power(struct msk_softc *sc, int } break; case CHIP_ID_YUKON_EC_U: + case CHIP_ID_YUKON_FE_P: CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); /* Enable all clocks. */ @@ -1579,7 +1581,7 @@ mskc_attach(device_t dev) sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f; /* Bail out if chip is not recognized. */ if (sc->msk_hw_id < CHIP_ID_YUKON_XL || - sc->msk_hw_id > CHIP_ID_YUKON_FE) { + sc->msk_hw_id > CHIP_ID_YUKON_FE_P) { device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n", sc->msk_hw_id, sc->msk_hw_rev); mtx_destroy(&sc->msk_mtx); @@ -1641,6 +1643,10 @@ mskc_attach(device_t dev) sc->msk_clock = 100; /* 100 Mhz */ sc->msk_pflags |= MSK_FLAG_FASTETHER; break; + case CHIP_ID_YUKON_FE_P: + sc->msk_clock = 50; /* 50 Mhz */ + sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2; + break; case CHIP_ID_YUKON_XL: sc->msk_clock = 156; /* 156 Mhz */ sc->msk_pflags |= MSK_FLAG_JUMBO; @@ -3512,6 +3518,7 @@ msk_init_locked(struct msk_if_softc *sc_ struct mii_data *mii; uint16_t eaddr[ETHER_ADDR_LEN / 2]; uint16_t gmac; + uint32_t reg; int error, i; MSK_IF_LOCK_ASSERT(sc_if); @@ -3590,8 +3597,10 @@ msk_init_locked(struct msk_if_softc *sc_ /* Configure Rx MAC FIFO. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_CLR); - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), - GMF_OPER_ON | GMF_RX_F_FL_ON); + reg = GMF_OPER_ON | GMF_RX_F_FL_ON; + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P) + reg |= GMF_RX_OVER_ON; + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), reg); /* Set receive filter. */ msk_rxfilter(sc_if); Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:16:19 2009 (r194419) +++ stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:20:02 2009 (r194420) @@ -828,6 +828,7 @@ #define CHIP_ID_YUKON_EC_U 0xb4 /* Chip ID for YUKON-2 EC Ultra */ #define CHIP_ID_YUKON_EC 0xb6 /* Chip ID for YUKON-2 EC */ #define CHIP_ID_YUKON_FE 0xb7 /* Chip ID for YUKON-2 FE */ +#define CHIP_ID_YUKON_FE_P 0xb8 /* Chip ID for YUKON-2 FE+ */ #define CHIP_REV_YU_XL_A0 0 /* Chip Rev. for Yukon-2 A0 */ #define CHIP_REV_YU_XL_A1 1 /* Chip Rev. for Yukon-2 A1 */ @@ -841,6 +842,8 @@ #define CHIP_REV_YU_EC_U_A0 1 #define CHIP_REV_YU_EC_U_A1 2 +#define CHIP_REV_YU_FE_P_A0 0 /* Chip Rev. for Yukon-2 FE+ A0 */ + /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ #define Y2_STATUS_LNK2_INAC BIT_7 /* Status Link 2 inactiv (0 = activ) */ #define Y2_CLK_GAT_LNK2_DIS BIT_6 /* Disable clock gating Link 2 */ @@ -1855,6 +1858,10 @@ #define RX_TRUNC_OFF BIT_26 /* disable packet truncation */ #define RX_VLAN_STRIP_ON BIT_25 /* enable VLAN stripping */ #define RX_VLAN_STRIP_OFF BIT_24 /* disable VLAN stripping */ +#define GMF_RX_OVER_ON BIT_19 /* enable flushing on receive overrun */ +#define GMF_RX_OVER_OFF BIT_18 /* disable flushing on receive overrun */ +#define GMF_ASF_RX_OVER_ON BIT_17 /* enable flushing of ASF when overrun */ +#define GMF_ASF_RX_OVER_OFF BIT_16 /* disable flushing of ASF when overrun */ #define GMF_WP_TST_ON BIT_14 /* Write Pointer Test On */ #define GMF_WP_TST_OFF BIT_13 /* Write Pointer Test Off */ #define GMF_WP_STEP BIT_12 /* Write Pointer Step/Increment */ From yongari at FreeBSD.org Thu Jun 18 05:29:31 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 05:29:57 2009 Subject: svn commit: r194421 - in stable/7/sys: . contrib/pf dev/msk Message-ID: <200906180529.n5I5TUea099327@svn.freebsd.org> Author: yongari Date: Thu Jun 18 05:29:30 2009 New Revision: 194421 URL: http://svn.freebsd.org/changeset/base/194421 Log: MFC r192735-192740,192742: Add workaround for Yukon FE+ A0. This controller is known to have severe silicon bugs that can't handle VLAN hardware tagging as well as status LE writeback bug. The status LE writeback bug is so critical we can't trust status word of received frame. To accept frames on Yukon FE+ A0 msk(4) just do minimal check for received frames and pass them to upper stack. This means msk(4) can pass corrupted frames to upper layer. You have been warned! Also I supposed RX_GMF_FL_THR to be 32bits register but Linux driver treated it as 16bit register so follow their leads. At least this does not seem to break msk(4) on Yukon FE+. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu ) r192736: Add device ids for Yukon FE+(88E8040, 88E8040T, 88E8048 and 88E8070). r192737: If interface is not UP, don't return media status. r192738: Don't reinitialize controller when interface is already running. r192739: Be consistent with other capability checking. r192740: Simplify SIOCSIFFLAGS handler. r192742: Correct controller description for 88E8035, 88E8036, 88E8038 and 88E8039. These are fast ethernet controllers. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:20:02 2009 (r194420) +++ stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:29:30 2009 (r194421) @@ -190,13 +190,21 @@ static struct msk_product { { VENDORID_MARVELL, DEVICEID_MRVL_8062X, "Marvell Yukon 88E8062 SX/LX Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8035, - "Marvell Yukon 88E8035 Gigabit Ethernet" }, + "Marvell Yukon 88E8035 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8036, - "Marvell Yukon 88E8036 Gigabit Ethernet" }, + "Marvell Yukon 88E8036 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8038, - "Marvell Yukon 88E8038 Gigabit Ethernet" }, + "Marvell Yukon 88E8038 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8039, - "Marvell Yukon 88E8039 Gigabit Ethernet" }, + "Marvell Yukon 88E8039 Fast Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_8040, + "Marvell Yukon 88E8040 Fast Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_8040T, + "Marvell Yukon 88E8040T Fast Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_8048, + "Marvell Yukon 88E8048 Fast Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_8070, + "Marvell Yukon 88E8070 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4361, "Marvell Yukon 88E8050 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4360, @@ -896,6 +904,10 @@ msk_mediastatus(struct ifnet *ifp, struc sc_if = ifp->if_softc; MSK_IF_LOCK(sc_if); + if ((ifp->if_flags & IFF_UP) == 0) { + MSK_IF_UNLOCK(sc_if); + return; + } mii = device_get_softc(sc_if->msk_miibus); mii_pollstat(mii); @@ -945,18 +957,14 @@ msk_ioctl(struct ifnet *ifp, u_long comm case SIOCSIFFLAGS: MSK_IF_LOCK(sc_if); if ((ifp->if_flags & IFF_UP) != 0) { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { - if (((ifp->if_flags ^ sc_if->msk_if_flags) - & (IFF_PROMISC | IFF_ALLMULTI)) != 0) - msk_rxfilter(sc_if); - } else { - if ((sc_if->msk_flags & MSK_FLAG_DETACH) == 0) - msk_init_locked(sc_if); - } - } else { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) - msk_stop(sc_if); - } + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc_if->msk_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + msk_rxfilter(sc_if); + else if ((sc_if->msk_flags & MSK_FLAG_DETACH) == 0) + msk_init_locked(sc_if); + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + msk_stop(sc_if); sc_if->msk_if_flags = ifp->if_flags; MSK_IF_UNLOCK(sc_if); break; @@ -975,23 +983,24 @@ msk_ioctl(struct ifnet *ifp, u_long comm case SIOCSIFCAP: MSK_IF_LOCK(sc_if); mask = ifr->ifr_reqcap ^ ifp->if_capenable; - if ((mask & IFCAP_TXCSUM) != 0) { + if ((mask & IFCAP_TXCSUM) != 0 && + (IFCAP_TXCSUM & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; - if ((IFCAP_TXCSUM & ifp->if_capenable) != 0 && - (IFCAP_TXCSUM & ifp->if_capabilities) != 0) + if ((IFCAP_TXCSUM & ifp->if_capenable) != 0) ifp->if_hwassist |= MSK_CSUM_FEATURES; else ifp->if_hwassist &= ~MSK_CSUM_FEATURES; } - if ((mask & IFCAP_VLAN_HWTAGGING) != 0) { + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; msk_setvlan(sc_if, ifp); } - if ((mask & IFCAP_TSO4) != 0) { + if ((mask & IFCAP_TSO4) != 0 && + (IFCAP_TSO4 & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_TSO4; - if ((IFCAP_TSO4 & ifp->if_capenable) != 0 && - (IFCAP_TSO4 & ifp->if_capabilities) != 0) + if ((IFCAP_TSO4 & ifp->if_capenable) != 0) ifp->if_hwassist |= CSUM_TSO; else ifp->if_hwassist &= ~CSUM_TSO; @@ -1493,14 +1502,17 @@ msk_attach(device_t dev) ether_ifattach(ifp, eaddr); MSK_IF_LOCK(sc_if); - /* - * VLAN capability setup - * Due to Tx checksum offload hardware bugs, msk(4) manually - * computes checksum for short frames. For VLAN tagged frames - * this workaround does not work so disable checksum offload - * for VLAN interface. - */ - ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; + /* VLAN capability setup */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + if ((sc_if->msk_flags & MSK_FLAG_NOHWVLAN) == 0) { + /* + * Due to Tx checksum offload hardware bugs, msk(4) manually + * computes checksum for short frames. For VLAN tagged frames + * this workaround does not work so disable checksum offload + * for VLAN interface. + */ + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; + } ifp->if_capenable = ifp->if_capabilities; /* @@ -1646,6 +1658,19 @@ mskc_attach(device_t dev) case CHIP_ID_YUKON_FE_P: sc->msk_clock = 50; /* 50 Mhz */ sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2; + if (sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { + /* + * XXX + * FE+ A0 has status LE writeback bug so msk(4) + * does not rely on status word of received frame + * in msk_rxeof() which in turn disables all + * hardware assistance bits reported by the status + * word as well as validity of the recevied frame. + * Just pass received frames to upper stack with + * minimal test and let upper stack handle them. + */ + sc->msk_pflags |= MSK_FLAG_NOHWVLAN | MSK_FLAG_NORXCHK; + } break; case CHIP_ID_YUKON_XL: sc->msk_clock = 156; /* 156 Mhz */ @@ -2735,6 +2760,7 @@ msk_watchdog(struct msk_if_softc *sc_if) if_printf(sc_if->msk_ifp, "watchdog timeout " "(missed link)\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; msk_init_locked(sc_if); return; } @@ -2759,6 +2785,7 @@ msk_watchdog(struct msk_if_softc *sc_if) if_printf(ifp, "watchdog timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; msk_init_locked(sc_if); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(taskqueue_fast, &sc_if->msk_tx_task); @@ -2837,8 +2864,11 @@ mskc_resume(device_t dev) mskc_reset(sc); for (i = 0; i < sc->msk_num_port; i++) { if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL && - ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0)) + ((sc->msk_if[i]->msk_ifp->if_flags & IFF_UP) != 0)) { + sc->msk_if[i]->msk_ifp->if_drv_flags &= + ~IFF_DRV_RUNNING; msk_init_locked(sc->msk_if[i]); + } } sc->msk_pflags &= ~MSK_FLAG_SUSPEND; @@ -2882,7 +2912,18 @@ msk_rxeof(struct msk_if_softc *sc_if, ui if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) rxlen -= ETHER_VLAN_ENCAP_LEN; - if (len > sc_if->msk_framesize || + if ((sc_if->msk_flags & MSK_FLAG_NORXCHK) != 0) { + /* + * For controllers that returns bogus status code + * just do minimal check and let upper stack + * handle this frame. + */ + if (len > MSK_MAX_FRAMELEN || len < ETHER_HDR_LEN) { + ifp->if_ierrors++; + msk_discard_rxbuf(sc_if, cons); + break; + } + } else if (len > sc_if->msk_framesize || ((status & GMR_FS_ANY_ERR) != 0) || ((status & GMR_FS_RX_OK) == 0) || (rxlen != len)) { /* Don't count flow-control packet as errors. */ @@ -3527,6 +3568,9 @@ msk_init_locked(struct msk_if_softc *sc_ sc = sc_if->msk_softc; mii = device_get_softc(sc_if->msk_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + error = 0; /* Cancel pending I/O and free all Rx/Tx buffers. */ msk_stop(sc_if); @@ -3613,8 +3657,12 @@ msk_init_locked(struct msk_if_softc *sc_ * Set Rx FIFO flush threshold to 64 bytes + 1 FIFO word * due to hardware hang on receipt of pause frames. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_THR), - RX_GMF_FL_THR_DEF + 1); + reg = RX_GMF_FL_THR_DEF + 1; + /* Another magic for Yukon FE+ - From Linux. */ + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && + sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) + reg = 0x178; + CSR_WRITE_2(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_THR), reg); /* Configure Tx MAC FIFO. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), GMF_RST_SET); @@ -3646,6 +3694,14 @@ msk_init_locked(struct msk_if_softc *sc_ } } + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && + sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { + /* Disable dynamic watermark - from Linux. */ + reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA)); + reg &= ~0x03; + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg); + } + /* * Disable Force Sync bit and Alloc bit in Tx RAM interface * arbiter as we don't use Sync Tx queue. Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:20:02 2009 (r194420) +++ stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:29:30 2009 (r194421) @@ -130,12 +130,16 @@ #define DEVICEID_MRVL_8035 0x4350 #define DEVICEID_MRVL_8036 0x4351 #define DEVICEID_MRVL_8038 0x4352 -#define DEVICEID_MRVL_8039 0X4353 +#define DEVICEID_MRVL_8039 0x4353 +#define DEVICEID_MRVL_8040 0x4354 +#define DEVICEID_MRVL_8040T 0x4355 +#define DEVICEID_MRVL_8048 0x435A #define DEVICEID_MRVL_4360 0x4360 #define DEVICEID_MRVL_4361 0x4361 #define DEVICEID_MRVL_4362 0x4362 #define DEVICEID_MRVL_4363 0x4363 #define DEVICEID_MRVL_4364 0x4364 +#define DEVICEID_MRVL_8070 0x4365 #define DEVICEID_MRVL_436A 0x436A /* @@ -2396,6 +2400,8 @@ struct msk_if_softc { #define MSK_FLAG_JUMBO_NOCSUM 0x0010 #define MSK_FLAG_RAMBUF 0x0020 #define MSK_FLAG_DESCV2 0x0040 +#define MSK_FLAG_NOHWVLAN 0x0080 +#define MSK_FLAG_NORXCHK 0x0100 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From yongari at FreeBSD.org Thu Jun 18 05:46:34 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 05:46:46 2009 Subject: svn commit: r194422 - in stable/7/sys: . contrib/pf dev/msk Message-ID: <200906180546.n5I5kXaS099740@svn.freebsd.org> Author: yongari Date: Thu Jun 18 05:46:33 2009 New Revision: 194422 URL: http://svn.freebsd.org/changeset/base/194422 Log: MFC r193293-193294: r193293: Add preliminary Yukon Extreme support and register definitions. Yukon Extreme uses new descriptor format for TSO and has Tx frame parser which greatly reduces CPU cycles spent in computing TCP/UDP payload offset calculation in Tx checksum offloading path. The new descriptor format also removed TCP/UDP payload computation for TSO which in turn results in better TSO performance. It seems Yukon Extreme has a lot of new (unknown) features but only basic offloading is supported at this time. So far there are two known issues. o Sometimes Rx overrun errors happen when pulling data over gigabit link. Running over 100Mbps seem to ok. o Ethernet hardware address shows all-zeroed value on 88E8070. Assigning ethernet address with ifconfig is necessary to make it work. Support for Yukon Extreme is not perfect but it would be better than having a non-working device. Special thanks to jbh who fixed several bugs of initial patch. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) r193294: Add frame parser capability of Yukon FE+ and Yukon Extreme. With this feature hardware automatically computes TCP/UDP payload offset. Introduce MSK_FLAG_AUTOTX_CSUM to mark the capability. Yukon Extreme B0 revision is known to have a silicon for the feature so disable it. Yukon Extreme B0 still can do Tx checksum offloading but CPU have to compute TCP/UDP payload offset. To enable traditional checksum offloading, disable automatic Tx checksum calculation capability. Yukon Extreme A0 revision could not use store-and-forward mode for jumbo frames(silicon bug) so disable Tx checksum offloading for jumbo frames. I believe controllers that have MSK_FLAG_AUTOTX_CSUM capability or new descriptor format do not have Tx checksum offload bug so disable checksum offloading workaround for for short frames. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:29:30 2009 (r194421) +++ stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:46:33 2009 (r194422) @@ -226,7 +226,7 @@ static struct msk_product { static const char *model_name[] = { "Yukon XL", "Yukon EC Ultra", - "Yukon Unknown", + "Yukon EX", "Yukon EC", "Yukon FE", "Yukon FE+" @@ -1116,16 +1116,19 @@ msk_phy_power(struct msk_softc *sc, int val = pci_read_config(sc->msk_dev, PCI_OUR_REG_1, 4); val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_XL: + if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { /* Deassert Low Power for 1st PHY. */ val |= PCI_Y2_PHY1_COMA; if (sc->msk_num_port > 1) val |= PCI_Y2_PHY2_COMA; } - break; + } + /* Release PHY from PowerDown/COMA mode. */ + pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); + switch (sc->msk_hw_id) { case CHIP_ID_YUKON_EC_U: + case CHIP_ID_YUKON_EX: case CHIP_ID_YUKON_FE_P: CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); @@ -1136,14 +1139,22 @@ msk_phy_power(struct msk_softc *sc, int PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ pci_write_config(sc->msk_dev, PCI_OUR_REG_4, our, 4); - /* Set to default value. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_5, 0, 4); + our = pci_read_config(sc->msk_dev, PCI_OUR_REG_5, 4); + our &= PCI_CTL_TIM_VMAIN_AV_MSK; + pci_write_config(sc->msk_dev, PCI_OUR_REG_5, our, 4); + pci_write_config(sc->msk_dev, PCI_CFG_REG_1, 0, 4); + /* + * Disable status race, workaround for + * Yukon EC Ultra & Yukon EX. + */ + val = CSR_READ_4(sc, B2_GP_IO); + val |= GLB_GPIO_STAT_RACE_DIS; + CSR_WRITE_4(sc, B2_GP_IO, val); + CSR_READ_4(sc, B2_GP_IO); break; default: break; } - /* Release PHY from PowerDown/COMA mode. */ - pci_write_config(sc->msk_dev, PCI_OUR_REG_1, val, 4); for (i = 0; i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, MR_ADDR(i, GMAC_LINK_CTRL), GMLC_RST_SET); @@ -1194,10 +1205,18 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); /* Disable ASF. */ - if (sc->msk_hw_id < CHIP_ID_YUKON_XL) { - CSR_WRITE_4(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); - } + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { + status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); + /* Clear AHB bridge & microcontroller reset. */ + status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | + Y2_ASF_HCU_CCSR_CPU_RST_MODE); + /* Clear ASF microcontroller state. */ + status &= ~ Y2_ASF_HCU_CCSR_UC_STATE_MSK; + CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); + } else + CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); + CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); + /* * Since we disabled ASF, S/W reset is required for Power Management. */ @@ -1249,6 +1268,10 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF); + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), + GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | + GMC_BYP_RETR_ON); } CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); @@ -1651,13 +1674,32 @@ mskc_attach(device_t dev) sc->msk_clock = 125; /* 125 Mhz */ sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_JUMBO_NOCSUM; break; + case CHIP_ID_YUKON_EX: + sc->msk_clock = 125; /* 125 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; + /* + * Yukon Extreme seems to have silicon bug for + * automatic Tx checksum calculation capability. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_B0) + sc->msk_pflags &= ~MSK_FLAG_AUTOTX_CSUM; + /* + * Yukon Extreme A0 could not use store-and-forward + * for jumbo frames, so disable Tx checksum + * offloading for jumbo frames. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) + sc->msk_pflags |= MSK_FLAG_JUMBO_NOCSUM; + break; case CHIP_ID_YUKON_FE: sc->msk_clock = 100; /* 100 Mhz */ sc->msk_pflags |= MSK_FLAG_FASTETHER; break; case CHIP_ID_YUKON_FE_P: sc->msk_clock = 50; /* 50 Mhz */ - sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2; + sc->msk_pflags |= MSK_FLAG_FASTETHER | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; if (sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { /* * XXX @@ -2450,8 +2492,10 @@ msk_encap(struct msk_if_softc *sc_if, st tcp_offset = offset = 0; m = *m_head; - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && - (m->m_pkthdr.csum_flags & (MSK_CSUM_FEATURES | CSUM_TSO)) != 0) { + if (((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) || + ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (m->m_pkthdr.csum_flags & CSUM_TSO) != 0)) { /* * Since mbuf has no protocol specific structure information * in it we have to inspect protocol information here to @@ -2510,9 +2554,12 @@ msk_encap(struct msk_if_softc *sc_if, st * resort to S/W checksum routine when we encounter short * TCP frames. * Short UDP packets appear to be handled correctly by - * Yukon II. + * Yukon II. Also I assume this bug does not happen on + * controllers that use newer descriptor format or + * automatic Tx checksum calaulcation. */ - if (m->m_pkthdr.len < MSK_MIN_FRAMELEN && + if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + (m->m_pkthdr.len < MSK_MIN_FRAMELEN) && (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) { m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { @@ -2613,7 +2660,7 @@ msk_encap(struct msk_if_softc *sc_if, st } /* Check if we have to handle checksum offload. */ if (tso == 0 && (m->m_pkthdr.csum_flags & MSK_CSUM_FEATURES) != 0) { - if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) + if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) != 0) control |= CALSUM; else { tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; @@ -3542,6 +3589,48 @@ done: } static void +msk_set_tx_stfwd(struct msk_if_softc *sc_if) +{ + struct msk_softc *sc; + struct ifnet *ifp; + + ifp = sc_if->msk_ifp; + sc = sc_if->msk_softc; + switch (sc->msk_hw_id) { + case CHIP_ID_YUKON_EX: + if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) + goto yukon_ex_workaround; + if (ifp->if_mtu > ETHERMTU) + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_ENA | TX_STFW_ENA); + else + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_DIS | TX_STFW_ENA); + break; + default: +yukon_ex_workaround: + if (ifp->if_mtu > ETHERMTU) { + /* Set Tx GMAC FIFO Almost Empty Threshold. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), + MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); + /* Disable Store & Forward mode for Tx. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_ENA | TX_STFW_DIS); + } else { + /* Enable Store & Forward mode for Tx. */ + CSR_WRITE_4(sc, + MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_JUMBO_DIS | TX_STFW_ENA); + } + break; + } +} + +static void msk_init(void *xsc) { struct msk_if_softc *sc_if = xsc; @@ -3590,6 +3679,10 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); + if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), + GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | + GMC_BYP_RETR_ON); /* * Initialize GMAC first such that speed/duplex/flow-control @@ -3642,7 +3735,8 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RST_CLR); reg = GMF_OPER_ON | GMF_RX_F_FL_ON; - if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P) + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P || + sc->msk_hw_id == CHIP_ID_YUKON_EX) reg |= GMF_RX_OVER_ON; CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), reg); @@ -3678,20 +3772,8 @@ msk_init_locked(struct msk_if_softc *sc_ MSK_ECU_LLPP); CSR_WRITE_1(sc, MR_ADDR(sc_if->msk_port, RX_GMF_UP_THR), MSK_ECU_ULPP); - if (ifp->if_mtu > ETHERMTU) { - /* - * Set Tx GMAC FIFO Almost Empty Threshold. - */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), - MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); - /* Disable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_DIS); - } else { - /* Enable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); - } + /* Configure store-and-forward for Tx. */ + msk_set_tx_stfwd(sc_if); } if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && @@ -3722,10 +3804,23 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_OPER_INIT); CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_CSR), BMU_FIFO_OP_ON); CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_WM), MSK_BMU_TX_WM); - if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U && - sc->msk_hw_rev == CHIP_REV_YU_EC_U_A0) { - /* Fix for Yukon-EC Ultra: set BMU FIFO level */ - CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_AL), MSK_ECU_TXFF_LEV); + switch (sc->msk_hw_id) { + case CHIP_ID_YUKON_EC_U: + if (sc->msk_hw_rev == CHIP_REV_YU_EC_U_A0) { + /* Fix for Yukon-EC Ultra: set BMU FIFO level */ + CSR_WRITE_2(sc, Q_ADDR(sc_if->msk_txq, Q_AL), + MSK_ECU_TXFF_LEV); + } + break; + case CHIP_ID_YUKON_EX: + /* + * Yukon Extreme seems to have silicon bug for + * automatic Tx checksum calculation capability. + */ + if (sc->msk_hw_rev == CHIP_REV_YU_EX_B0) + CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_txq, Q_F), + F_TX_CHK_AUTO_OFF); + break; } /* Setup Rx Queue Bus Memory Interface. */ Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:29:30 2009 (r194421) +++ stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:46:33 2009 (r194422) @@ -225,6 +225,8 @@ #define PCI_OUR_REG_3 0x80 /* 32 bit Our Register 3 */ #define PCI_OUR_REG_4 0x84 /* 32 bit Our Register 4 */ #define PCI_OUR_REG_5 0x88 /* 32 bit Our Register 5 */ +#define PCI_CFG_REG_0 0x90 /* 32 bit Config Register 0 */ +#define PCI_CFG_REG_1 0x94 /* 32 bit Config Register 1 */ /* PCI Express Capability */ #define PEX_CAP_ID 0xe0 /* 8 bit PEX Capability ID */ @@ -325,6 +327,56 @@ #define PCI_CLK_GATE_PEX_UNIT_ENA BIT_1 /* Enable Gate PEX Unit Clock */ #define PCI_CLK_GATE_ROOT_COR_ENA BIT_0 /* Enable Gate Root Core Clock */ +/* PCI_OUR_REG_5 32 bit Our Register 5 (Yukon-ECU only) */ + /* Bit 31..27: for A3 & later */ +#define PCI_CTL_DIV_CORE_CLK_ENA BIT_31 /* Divide Core Clock Enable */ +#define PCI_CTL_SRESET_VMAIN_AV BIT_30 /* Soft Reset for Vmain_av De-Glitch */ +#define PCI_CTL_BYPASS_VMAIN_AV BIT_29 /* Bypass En. for Vmain_av De-Glitch */ +#define PCI_CTL_TIM_VMAIN_AV1 BIT_28 /* Bit 28..27: Timer Vmain_av Mask */ +#define PCI_CTL_TIM_VMAIN_AV0 BIT_27 /* Bit 28..27: Timer Vmain_av Mask */ +#define PCI_CTL_TIM_VMAIN_AV_MSK (BIT_28 | BIT_27) + /* Bit 26..16: Release Clock on Event */ +#define PCI_REL_PCIE_RST_DE_ASS BIT_26 /* PCIe Reset De-Asserted */ +#define PCI_REL_GPHY_REC_PACKET BIT_25 /* GPHY Received Packet */ +#define PCI_REL_INT_FIFO_N_EMPTY BIT_24 /* Internal FIFO Not Empty */ +#define PCI_REL_MAIN_PWR_AVAIL BIT_23 /* Main Power Available */ +#define PCI_REL_CLKRUN_REQ_REL BIT_22 /* CLKRUN Request Release */ +#define PCI_REL_PCIE_RESET_ASS BIT_21 /* PCIe Reset Asserted */ +#define PCI_REL_PME_ASSERTED BIT_20 /* PME Asserted */ +#define PCI_REL_PCIE_EXIT_L1_ST BIT_19 /* PCIe Exit L1 State */ +#define PCI_REL_LOADER_NOT_FIN BIT_18 /* EPROM Loader Not Finished */ +#define PCI_REL_PCIE_RX_EX_IDLE BIT_17 /* PCIe Rx Exit Electrical Idle State */ +#define PCI_REL_GPHY_LINK_UP BIT_16 /* GPHY Link Up */ + /* Bit 10.. 0: Mask for Gate Clock */ +#define PCI_GAT_PCIE_RST_ASSERTED BIT_10 /* PCIe Reset Asserted */ +#define PCI_GAT_GPHY_N_REC_PACKET BIT_9 /* GPHY Not Received Packet */ +#define PCI_GAT_INT_FIFO_EMPTY BIT_8 /* Internal FIFO Empty */ +#define PCI_GAT_MAIN_PWR_N_AVAIL BIT_7 /* Main Power Not Available */ +#define PCI_GAT_CLKRUN_REQ_REL BIT_6 /* CLKRUN Not Requested */ +#define PCI_GAT_PCIE_RESET_ASS BIT_5 /* PCIe Reset Asserted */ +#define PCI_GAT_PME_DE_ASSERTED BIT_4 /* PME De-Asserted */ +#define PCI_GAT_PCIE_ENTER_L1_ST BIT_3 /* PCIe Enter L1 State */ +#define PCI_GAT_LOADER_FINISHED BIT_2 /* EPROM Loader Finished */ +#define PCI_GAT_PCIE_RX_EL_IDLE BIT_1 /* PCIe Rx Electrical Idle State */ +#define PCI_GAT_GPHY_LINK_DOWN BIT_0 /* GPHY Link Down */ + +/* PCI_CFG_REG_1 32 bit Config Register 1 */ +#define PCI_CF1_DIS_REL_EVT_RST BIT_24 /* Dis. Rel. Event during PCIE reset */ + /* Bit 23..21: Release Clock on Event */ +#define PCI_CF1_REL_LDR_NOT_FIN BIT_23 /* EEPROM Loader Not Finished */ +#define PCI_CF1_REL_VMAIN_AVLBL BIT_22 /* Vmain available */ +#define PCI_CF1_REL_PCIE_RESET BIT_21 /* PCI-E reset */ + /* Bit 20..18: Gate Clock on Event */ +#define PCI_CF1_GAT_LDR_NOT_FIN BIT_20 /* EEPROM Loader Finished */ +#define PCI_CF1_GAT_PCIE_RX_IDLE BIT_19 /* PCI-E Rx Electrical idle */ +#define PCI_CF1_GAT_PCIE_RESET BIT_18 /* PCI-E Reset */ +#define PCI_CF1_PRST_PHY_CLKREQ BIT_17 /* Enable PCI-E rst & PM2PHY gen. CLKREQ */ +#define PCI_CF1_PCIE_RST_CLKREQ BIT_16 /* Enable PCI-E rst generate CLKREQ */ + +#define PCI_CF1_ENA_CFG_LDR_DONE BIT_8 /* Enable core level Config loader done */ +#define PCI_CF1_ENA_TXBMU_RD_IDLE BIT_1 /* Enable TX BMU Read IDLE for ASPM */ +#define PCI_CF1_ENA_TXBMU_WR_IDLE BIT_0 /* Enable TX BMU Write IDLE for ASPM */ + /* PEX_DEV_CTRL 16 bit PEX Device Control (Yukon-2) */ #define PEX_DC_MAX_RRS_MSK (7<<12) /* Bit 14..12: Max. Read Request Size */ #define PEX_DC_EN_NO_SNOOP BIT_11 /* Enable No Snoop */ @@ -621,6 +673,7 @@ #define B28_Y2_SMB_CSD_REG 0x0e44 /* 32 bit ASF SMB Control/Status/Data */ #define B28_Y2_ASF_IRQ_V_BASE 0x0e60 /* 32 bit ASF IRQ Vector Base */ #define B28_Y2_ASF_STAT_CMD 0x0e68 /* 32 bit ASF Status and Command Reg */ +#define B28_Y2_ASF_HCU_CCSR 0x0e68 /* 32 bit ASF HCU CCSR (Yukon EX) */ #define B28_Y2_ASF_HOST_COM 0x0e6c /* 32 bit ASF Host Communication Reg */ #define B28_Y2_DATA_REG_1 0x0e70 /* 32 bit ASF/Host Data Register 1 */ #define B28_Y2_DATA_REG_2 0x0e74 /* 32 bit ASF/Host Data Register 2 */ @@ -830,6 +883,7 @@ #define CHIP_ID_YUKON_LP 0xb2 /* Chip ID for YUKON-LP */ #define CHIP_ID_YUKON_XL 0xb3 /* Chip ID for YUKON-2 XL */ #define CHIP_ID_YUKON_EC_U 0xb4 /* Chip ID for YUKON-2 EC Ultra */ +#define CHIP_ID_YUKON_EX 0xb5 /* Chip ID for YUKON-2 Extreme */ #define CHIP_ID_YUKON_EC 0xb6 /* Chip ID for YUKON-2 EC */ #define CHIP_ID_YUKON_FE 0xb7 /* Chip ID for YUKON-2 FE */ #define CHIP_ID_YUKON_FE_P 0xb8 /* Chip ID for YUKON-2 FE+ */ @@ -848,6 +902,9 @@ #define CHIP_REV_YU_FE_P_A0 0 /* Chip Rev. for Yukon-2 FE+ A0 */ +#define CHIP_REV_YU_EX_A0 1 /* Chip Rev. for Yukon-2 EX A0 */ +#define CHIP_REV_YU_EX_B0 2 /* Chip Rev. for Yukon-2 EX B0 */ + /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ #define Y2_STATUS_LNK2_INAC BIT_7 /* Status Link 2 inactiv (0 = activ) */ #define Y2_CLK_GAT_LNK2_DIS BIT_6 /* Disable clock gating Link 2 */ @@ -912,6 +969,18 @@ #define TST_CFG_WRITE_ON BIT_1 /* Enable Config Reg WR */ #define TST_CFG_WRITE_OFF BIT_0 /* Disable Config Reg WR */ +/* B2_GP_IO */ +#define GLB_GPIO_CLK_DEB_ENA BIT_31 /* Clock Debug Enable */ +#define GLB_GPIO_CLK_DBG_MSK 0x3c000000 /* Clock Debug */ + +#define GLB_GPIO_INT_RST_D3_DIS BIT_15 /* Disable Internal Reset After D3 to D0 */ +#define GLB_GPIO_LED_PAD_SPEED_UP BIT_14 /* LED PAD Speed Up */ +#define GLB_GPIO_STAT_RACE_DIS BIT_13 /* Status Race Disable */ +#define GLB_GPIO_TEST_SEL_MSK 0x00001800 /* Testmode Select */ +#define GLB_GPIO_TEST_SEL_BASE BIT_11 +#define GLB_GPIO_RAND_ENA BIT_10 /* Random Enable */ +#define GLB_GPIO_RAND_BIT_1 BIT_9 /* Random Bit 1 */ + /* B2_I2C_CTRL 32 bit I2C HW Control Register */ #define I2C_FLAG BIT_31 /* Start read/write if WR */ #define I2C_ADDR (0x7fff<<16) /* Bit 30..16: Addr to be RD/WR */ @@ -1033,13 +1102,16 @@ /* Bit 10..0: same as for Rx */ /* Q_F 32 bit Flag Register */ -#define F_ALM_FULL BIT_27 /* Rx FIFO: almost full */ -#define F_EMPTY BIT_27 /* Tx FIFO: empty flag */ -#define F_FIFO_EOF BIT_26 /* Tag (EOF Flag) bit in FIFO */ -#define F_WM_REACHED BIT_25 /* Watermark reached */ -#define F_M_RX_RAM_DIS BIT_24 /* MAC Rx RAM Read Port disable */ -#define F_FIFO_LEVEL (0x1f<<16) /* Bit 23..16: # of Qwords in FIFO */ -#define F_WATER_MARK 0x0007ff /* Bit 10.. 0: Watermark */ +#define F_TX_CHK_AUTO_OFF BIT_31 /* Tx checksum auto-calc Off(Yukon EX)*/ +#define F_TX_CHK_AUTO_ON BIT_30 /* Tx checksum auto-calc On(Yukon EX)*/ +#define F_ALM_FULL BIT_28 /* Rx FIFO: almost full */ +#define F_EMPTY BIT_27 /* Tx FIFO: empty flag */ +#define F_FIFO_EOF BIT_26 /* Tag (EOF Flag) bit in FIFO */ +#define F_WM_REACHED BIT_25 /* Watermark reached */ +#define F_M_RX_RAM_DIS BIT_24 /* MAC Rx RAM Read Port disable */ +#define F_FIFO_LEVEL (0x1f<<16) + /* Bit 23..16: # of Qwords in FIFO */ +#define F_WATER_MARK 0x0007ff/* Bit 10.. 0: Watermark */ /* Queue Prefetch Unit Offsets, use Y2_PREF_Q_ADDR() to address (Yukon-2 only)*/ /* PREF_UNIT_CTRL_REG 32 bit Prefetch Control register */ @@ -1927,6 +1999,28 @@ #define Y2_ASF_UC_STATE (3<<2) /* ASF uC State */ #define Y2_ASF_CLK_HALT 0 /* ASF system clock stopped */ +/* B28_Y2_ASF_HCU_CCSR 32bit CPU Control and Status Register (Yukon EX) */ +#define Y2_ASF_HCU_CCSR_SMBALERT_MONITOR BIT_27 /* SMBALERT pin monitor */ +#define Y2_ASF_HCU_CCSR_CPU_SLEEP BIT_26 /* CPU sleep status */ +#define Y2_ASF_HCU_CCSR_CS_TO BIT_25 /* Clock Stretching Timeout */ +#define Y2_ASF_HCU_CCSR_WDOG BIT_24 /* Watchdog Reset */ +#define Y2_ASF_HCU_CCSR_CLR_IRQ_HOST BIT_17 /* Clear IRQ_HOST */ +#define Y2_ASF_HCU_CCSR_SET_IRQ_HCU BIT_16 /* Set IRQ_HCU */ +#define Y2_ASF_HCU_CCSR_AHB_RST BIT_9 /* Reset AHB bridge */ +#define Y2_ASF_HCU_CCSR_CPU_RST_MODE BIT_8 /* CPU Reset Mode */ +#define Y2_ASF_HCU_CCSR_SET_SYNC_CPU BIT_5 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE1 BIT_4 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE0 BIT_3 +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_MSK (BIT_4 | BIT_3) /* CPU Clock Divide */ +#define Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_BASE BIT_3 +#define Y2_ASF_HCU_CCSR_OS_PRSNT BIT_2 /* ASF OS Present */ + /* Microcontroller State */ +#define Y2_ASF_HCU_CCSR_UC_STATE_MSK 3 +#define Y2_ASF_HCU_CCSR_UC_STATE_BASE BIT_0 +#define Y2_ASF_HCU_CCSR_ASF_RESET 0 +#define Y2_ASF_HCU_CCSR_ASF_HALTED BIT_1 +#define Y2_ASF_HCU_CCSR_ASF_RUNNING BIT_0 + /* B28_Y2_ASF_HOST_COM 32 bit ASF Host Communication Reg */ /* This register is used by the ASF firmware */ #define Y2_ASF_CLR_ASFI BIT_1 /* Clear host IRQ */ @@ -1940,6 +2034,14 @@ #define SC_STAT_RST_SET BIT_0 /* Set Status Unit Reset */ /* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ +#define GMC_SEC_RST BIT_15 /* MAC SEC RST */ +#define GMC_SEC_RST_OFF BIT_14 /* MAC SEC RST Off */ +#define GMC_BYP_MACSECRX_ON BIT_13 /* Bypass MAC SEC RX */ +#define GMC_BYP_MACSECRX_OFF BIT_12 /* Bypass MAC SEC RX Off */ +#define GMC_BYP_MACSECTX_ON BIT_11 /* Bypass MAC SEC TX */ +#define GMC_BYP_MACSECTX_OFF BIT_10 /* Bypass MAC SEC TX Off */ +#define GMC_BYP_RETR_ON BIT_9 /* Bypass MAC retransmit FIFO On */ +#define GMC_BYP_RETR_OFF BIT_8 /* Bypass MAC retransmit FIFO Off */ #define GMC_H_BURST_ON BIT_7 /* Half Duplex Burst Mode On */ #define GMC_H_BURST_OFF BIT_6 /* Half Duplex Burst Mode Off */ #define GMC_F_LOOPB_ON BIT_5 /* FIFO Loopback On */ @@ -2400,8 +2502,9 @@ struct msk_if_softc { #define MSK_FLAG_JUMBO_NOCSUM 0x0010 #define MSK_FLAG_RAMBUF 0x0020 #define MSK_FLAG_DESCV2 0x0040 -#define MSK_FLAG_NOHWVLAN 0x0080 -#define MSK_FLAG_NORXCHK 0x0100 +#define MSK_FLAG_AUTOTX_CSUM 0x0080 +#define MSK_FLAG_NOHWVLAN 0x0100 +#define MSK_FLAG_NORXCHK 0x0200 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From yongari at FreeBSD.org Thu Jun 18 05:50:46 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 05:50:53 2009 Subject: svn commit: r194423 - in stable/7/sys: . contrib/pf dev/msk Message-ID: <200906180550.n5I5okIO099884@svn.freebsd.org> Author: yongari Date: Thu Jun 18 05:50:45 2009 New Revision: 194423 URL: http://svn.freebsd.org/changeset/base/194423 Log: MFC r193298-193299: r193298: Add Rx checksum offloading support for Yukon FE+ and Yukon Extreme. These controllers use newer descriptor format and the new descriptor format uses status LE to indicate the status of checksum. Rx checksummed value used in previous controllers were very cryptic and I failed to understand how to use them. In addition most controllers in previous generations had Rx checksum offloading bug. While I'm here introduce a MSK_FLAG_NORX_CSUM flag to bypass checking Rx checksum offloading as Yukon FE+ A0 has status LE bug. r193299: Add Yukon Extreme device ids, 88E8071 and 88E8072. While I'm here correct description of 88E8070. 88E8070 is Yukon Extreme and have gigabit PHY. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:46:33 2009 (r194422) +++ stable/7/sys/dev/msk/if_msk.c Thu Jun 18 05:50:45 2009 (r194423) @@ -203,8 +203,6 @@ static struct msk_product { "Marvell Yukon 88E8040T Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8048, "Marvell Yukon 88E8048 Fast Ethernet" }, - { VENDORID_MARVELL, DEVICEID_MRVL_8070, - "Marvell Yukon 88E8070 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4361, "Marvell Yukon 88E8050 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4360, @@ -215,8 +213,14 @@ static struct msk_product { "Marvell Yukon 88E8055 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4364, "Marvell Yukon 88E8056 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4365, + "Marvell Yukon 88E8070 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436A, "Marvell Yukon 88E8058 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436B, + "Marvell Yukon 88E8071 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436C, + "Marvell Yukon 88E8072 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560T, @@ -258,8 +262,8 @@ static void msk_intr_hwerr(struct msk_so #ifndef __NO_STRICT_ALIGNMENT static __inline void msk_fixup_rx(struct mbuf *); #endif -static void msk_rxeof(struct msk_if_softc *, uint32_t, int); -static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, int); +static void msk_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); +static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_txeof(struct msk_if_softc *, int); static int msk_encap(struct msk_if_softc *, struct mbuf **); static void msk_tx_task(void *, int); @@ -267,6 +271,7 @@ static void msk_start(struct ifnet *); static int msk_ioctl(struct ifnet *, u_long, caddr_t); static void msk_set_prefetch(struct msk_softc *, int, bus_addr_t, uint32_t); static void msk_set_rambuffer(struct msk_if_softc *); +static void msk_set_tx_stfwd(struct msk_if_softc *); static void msk_init(void *); static void msk_init_locked(struct msk_if_softc *); static void msk_stop(struct msk_if_softc *); @@ -991,12 +996,17 @@ msk_ioctl(struct ifnet *ifp, u_long comm else ifp->if_hwassist &= ~MSK_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; msk_setvlan(sc_if, ifp); } - + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (IFCAP_VLAN_HWCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; if ((mask & IFCAP_TSO4) != 0 && (IFCAP_TSO4 & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_TSO4; @@ -1492,6 +1502,13 @@ msk_attach(device_t dev) * make Rx checksum offload work on Yukon II hardware. */ ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4; + /* + * Enable Rx checksum offloading if controller support new + * descriptor format. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) + ifp->if_capabilities |= IFCAP_RXCSUM; ifp->if_hwassist = MSK_CSUM_FEATURES | CSUM_TSO; ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = msk_ioctl; @@ -1535,6 +1552,13 @@ msk_attach(device_t dev) * for VLAN interface. */ ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; + /* + * Enable Rx checksum offloading for VLAN taggedd frames + * if controller support new descriptor format. + */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && + (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) + ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } ifp->if_capenable = ifp->if_capabilities; @@ -1711,7 +1735,8 @@ mskc_attach(device_t dev) * Just pass received frames to upper stack with * minimal test and let upper stack handle them. */ - sc->msk_pflags |= MSK_FLAG_NOHWVLAN | MSK_FLAG_NORXCHK; + sc->msk_pflags |= MSK_FLAG_NOHWVLAN | + MSK_FLAG_NORXCHK | MSK_FLAG_NORX_CSUM; } break; case CHIP_ID_YUKON_XL: @@ -2942,7 +2967,8 @@ msk_fixup_rx(struct mbuf *m) #endif static void -msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) +msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, + int len) { struct mbuf *m; struct ifnet *ifp; @@ -2994,6 +3020,18 @@ msk_rxeof(struct msk_if_softc *sc_if, ui msk_fixup_rx(m); #endif ifp->if_ipackets++; + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && + (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3010,7 +3048,8 @@ msk_rxeof(struct msk_if_softc *sc_if, ui } static void -msk_jumbo_rxeof(struct msk_if_softc *sc_if, uint32_t status, int len) +msk_jumbo_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, + int len) { struct mbuf *m; struct ifnet *ifp; @@ -3051,6 +3090,18 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ msk_fixup_rx(m); #endif ifp->if_ipackets++; + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && + (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3379,9 +3430,9 @@ msk_handle_events(struct msk_softc *sc) case OP_RXSTAT: if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) - msk_jumbo_rxeof(sc_if, status, len); + msk_jumbo_rxeof(sc_if, status, control, len); else - msk_rxeof(sc_if, status, len); + msk_rxeof(sc_if, status, control, len); rxprog++; /* * Because there is no way to sync single Rx LE Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:46:33 2009 (r194422) +++ stable/7/sys/dev/msk/if_mskreg.h Thu Jun 18 05:50:45 2009 (r194423) @@ -139,8 +139,10 @@ #define DEVICEID_MRVL_4362 0x4362 #define DEVICEID_MRVL_4363 0x4363 #define DEVICEID_MRVL_4364 0x4364 -#define DEVICEID_MRVL_8070 0x4365 +#define DEVICEID_MRVL_4365 0x4365 #define DEVICEID_MRVL_436A 0x436A +#define DEVICEID_MRVL_436B 0x436B +#define DEVICEID_MRVL_436C 0x436C /* * D-Link gigabit ethernet device ID @@ -2255,8 +2257,19 @@ struct msk_stat_desc { #define OP_PUTIDX 0x70000000 #define STLE_OP_MASK 0xff000000 +#define STLE_CSS_MASK 0x00ff0000 #define STLE_LEN_MASK 0x0000ffff +/* CSS defined in status LE(valid for descriptor V2 format). */ +#define CSS_TCPUDP_CSUM_OK 0x00800000 +#define CSS_UDP 0x00400000 +#define CSS_TCP 0x00200000 +#define CSS_IPFRAG 0x00100000 +#define CSS_IPV6 0x00080000 +#define CSS_IPV4_CSUM_OK 0x00040000 +#define CSS_IPV4 0x00020000 +#define CSS_PORT 0x00010000 + /* Descriptor Bit Definition */ /* TxCtrl Transmit Buffer Control Field */ /* RxCtrl Receive Buffer Control Field */ @@ -2505,6 +2518,7 @@ struct msk_if_softc { #define MSK_FLAG_AUTOTX_CSUM 0x0080 #define MSK_FLAG_NOHWVLAN 0x0100 #define MSK_FLAG_NORXCHK 0x0200 +#define MSK_FLAG_NORX_CSUM 0x0400 #define MSK_FLAG_SUSPEND 0x2000 #define MSK_FLAG_DETACH 0x4000 #define MSK_FLAG_LINK 0x8000 From yongari at FreeBSD.org Thu Jun 18 05:56:13 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 05:56:20 2009 Subject: svn commit: r194424 - stable/7/share/man/man4 Message-ID: <200906180556.n5I5uC1b000168@svn.freebsd.org> Author: yongari Date: Thu Jun 18 05:56:12 2009 New Revision: 194424 URL: http://svn.freebsd.org/changeset/base/194424 Log: MFC r192741,192743,193300 r192741: msk(4) now supports Yukon FE+. Specifically 88E8040, 88E8040T, 88E8048 and 88E8070 are supported. r192743: Correct controller description for 88E8035, 88E8036, 88E8038 and 88E8039. These are fast ethernet controllers. r193300: Add 88E8071, 88E8072 to the supported hardware list. While I'm here correct description of 88E8070. It's Yukon Extreme and have gigabit PHY. Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/msk.4 Modified: stable/7/share/man/man4/msk.4 ============================================================================== --- stable/7/share/man/man4/msk.4 Thu Jun 18 05:50:45 2009 (r194423) +++ stable/7/share/man/man4/msk.4 Thu Jun 18 05:56:12 2009 (r194424) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 5, 2007 +.Dd June 2, 2009 .Dt MSK 4 .Os .Sh NAME @@ -176,13 +176,19 @@ Marvell Yukon 88E8062CU Gigabit Ethernet .It Marvell Yukon 88E8062 SX/LX Gigabit Ethernet .It -Marvell Yukon 88E8035 Gigabit Ethernet +Marvell Yukon 88E8035 Fast Ethernet .It -Marvell Yukon 88E8036 Gigabit Ethernet +Marvell Yukon 88E8036 Fast Ethernet .It -Marvell Yukon 88E8038 Gigabit Ethernet +Marvell Yukon 88E8038 Fast Ethernet .It -Marvell Yukon 88E8039 Gigabit Ethernet +Marvell Yukon 88E8039 Fast Ethernet +.It +Marvell Yukon 88E8040 Fast Ethernet +.It +Marvell Yukon 88E8040T Fast Ethernet +.It +Marvell Yukon 88E8048 Fast Ethernet .It Marvell Yukon 88E8050 Gigabit Ethernet .It @@ -196,6 +202,12 @@ Marvell Yukon 88E8056 Gigabit Ethernet .It Marvell Yukon 88E8058 Gigabit Ethernet .It +Marvell Yukon 88E8070 Gigabit Ethernet +.It +Marvell Yukon 88E8071 Gigabit Ethernet +.It +Marvell Yukon 88E8072 Gigabit Ethernet +.It SysKonnect SK-9Sxx Gigabit Ethernet .It SysKonnect SK-9Exx Gigabit Ethernet From yongari at FreeBSD.org Thu Jun 18 06:04:00 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 06:04:12 2009 Subject: svn commit: r194426 - in stable/7/sys: . amd64/conf boot/forth conf contrib/pf dev/alc i386/conf modules modules/alc Message-ID: <200906180603.n5I63wfg000421@svn.freebsd.org> Author: yongari Date: Thu Jun 18 06:03:58 2009 New Revision: 194426 URL: http://svn.freebsd.org/changeset/base/194426 Log: MFC 193880,193887: r193880: Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernet controller. These controllers are also known as L1C(AR8131) and L2C(AR8132) respectively. These controllers resembles the first generation controller L1 but usage of different descriptor format and new register mappings over L1 register space requires a new driver. There are a couple of registers I still don't understand but the driver seems to have no critical issues for performance and stability. Currently alc(4) supports the following hardware features. o MSI o TCP Segmentation offload o Hardware VLAN tag insertion/stripping o Tx/Rx interrupt moderation o Hardware statistics counters(dev.alc.%d.stats) o Jumbo frame o WOL AR8131/AR8132 also supports Tx checksum offloading but I disabled it due to stability issues. I'm not sure this comes from broken sample boards or hardware bugs. If you know your controller works without problems you can still enable it. The controller has a silicon bug for Rx checksum offloading, so the feature was not implemented. I'd like to say big thanks to Atheros. Atheros kindly sent sample boards to me and answered several questions I had. HW donated by: Atheros Communications, Inc. r193887: fix directory name. Added: stable/7/sys/dev/alc/ - copied from r193880, head/sys/dev/alc/ stable/7/sys/modules/alc/ - copied from r193880, head/sys/modules/alc/ Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/conf/GENERIC stable/7/sys/boot/forth/loader.conf stable/7/sys/conf/NOTES stable/7/sys/conf/files stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/conf/GENERIC stable/7/sys/modules/Makefile Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Thu Jun 18 05:56:24 2009 (r194425) +++ stable/7/sys/amd64/conf/GENERIC Thu Jun 18 06:03:58 2009 (r194426) @@ -193,6 +193,7 @@ device vx # 3Com 3c590, 3c595 (``Vorte # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet device ale # Atheros AR8121/AR8113/AR8114 Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet Modified: stable/7/sys/boot/forth/loader.conf ============================================================================== --- stable/7/sys/boot/forth/loader.conf Thu Jun 18 05:56:24 2009 (r194425) +++ stable/7/sys/boot/forth/loader.conf Thu Jun 18 06:03:58 2009 (r194426) @@ -208,6 +208,7 @@ pf_load="NO" # packet filter miibus_load="NO" # miibus support, needed for some drivers if_age_load="NO" # Attansic/Atheros L1 Gigabit Ethernet +if_alc_load="NO" # Atheros AR8131/AR8132 Ethernet if_ale_load="NO" # Atheros AR8121/AR8113/AR8114 Ethernet if_an_load="NO" # Aironet 4500/4800 802.11 wireless NICs if_ar_load="NO" # Digi SYNC/570i Modified: stable/7/sys/conf/NOTES ============================================================================== --- stable/7/sys/conf/NOTES Thu Jun 18 05:56:24 2009 (r194425) +++ stable/7/sys/conf/NOTES Thu Jun 18 06:03:58 2009 (r194426) @@ -1724,6 +1724,7 @@ device miibus # Harris (Intersil) Chipset with PCnetMobile firmware by AMD. # age: Support for gigabit ethernet adapters based on the Attansic/Atheros # L1 PCI express gigabit ethernet controllers. +# alc: Support for Atheros AR8131/AR8132 PCIe ethernet controllers. # ale: Support for Atheros AR8121/AR8113/AR8114 PCIe ethernet controllers. # bce: Broadcom NetXtreme II (BCM5706/BCM5708) PCI/PCIe Gigabit Ethernet # adapters. @@ -1869,6 +1870,7 @@ device xe # PCI Ethernet NICs that use the common MII bus controller code. device ae # Attansic/Atheros L2 FastEthernet device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet device ale # Atheros AR8121/AR8113/AR8114 Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Thu Jun 18 05:56:24 2009 (r194425) +++ stable/7/sys/conf/files Thu Jun 18 06:03:58 2009 (r194426) @@ -446,6 +446,7 @@ dev/aic7xxx/aic7xxx.c optional ahc dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci +dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/amd/amd.c optional amd dev/amr/amr.c optional amr Modified: stable/7/sys/i386/conf/GENERIC ============================================================================== --- stable/7/sys/i386/conf/GENERIC Thu Jun 18 05:56:24 2009 (r194425) +++ stable/7/sys/i386/conf/GENERIC Thu Jun 18 06:03:58 2009 (r194426) @@ -204,6 +204,7 @@ device vx # 3Com 3c590, 3c595 (``Vorte # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support device age # Attansic/Atheros L1 Gigabit Ethernet +device alc # Atheros AR8131/AR8132 Ethernet device ale # Atheros AR8121/AR8113/AR8114 Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Thu Jun 18 05:56:24 2009 (r194425) +++ stable/7/sys/modules/Makefile Thu Jun 18 06:03:58 2009 (r194426) @@ -18,6 +18,7 @@ SUBDIR= ${_3dfx} \ aio \ ${_amd} \ ${_amdtemp} \ + alc \ ale \ amr \ ${_an} \ From yongari at FreeBSD.org Thu Jun 18 06:07:59 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 06:08:06 2009 Subject: svn commit: r194427 - stable/7/usr.sbin/sysinstall Message-ID: <200906180607.n5I67w2Z000552@svn.freebsd.org> Author: yongari Date: Thu Jun 18 06:07:58 2009 New Revision: 194427 URL: http://svn.freebsd.org/changeset/base/194427 Log: MFC 193881,193883: r193881: Add alc(4) to the list of supported network interface. r193883: Fix typo. Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/devices.c Modified: stable/7/usr.sbin/sysinstall/devices.c ============================================================================== --- stable/7/usr.sbin/sysinstall/devices.c Thu Jun 18 06:03:58 2009 (r194426) +++ stable/7/usr.sbin/sysinstall/devices.c Thu Jun 18 06:07:58 2009 (r194427) @@ -95,6 +95,7 @@ static struct _devname { SERIAL("cuad%d", "%s on device %s (COM%d)", 16), NETWORK("ae", "Attansic/Atheros L2 Fast Ethernet"), NETWORK("age", "Attansic/Atheros L1 Gigabit Ethernet"), + NETWORK("alc", "Atheros AR8131/AR8132 PCIe Ethernet"), NETWORK("ale", "Atheros AR8121/AR8113/AR8114 PCIe Ethernet"), NETWORK("an", "Aironet 4500/4800 802.11 wireless adapter"), NETWORK("ath", "Atheros IEEE 802.11 wireless adapter"), From yongari at FreeBSD.org Thu Jun 18 06:09:48 2009 From: yongari at FreeBSD.org (Pyun YongHyeon) Date: Thu Jun 18 06:09:59 2009 Subject: svn commit: r194428 - stable/7/share/man/man4 Message-ID: <200906180609.n5I69lDs000634@svn.freebsd.org> Author: yongari Date: Thu Jun 18 06:09:47 2009 New Revision: 194428 URL: http://svn.freebsd.org/changeset/base/194428 Log: MFC r193882 Add alc(4) man page and hook up alc(4) to the build. Added: stable/7/share/man/man4/alc.4 - copied unchanged from r193882, head/share/man/man4/alc.4 Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/Makefile stable/7/share/man/man4/altq.4 stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/miibus.4 stable/7/share/man/man4/vlan.4 Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Thu Jun 18 06:07:58 2009 (r194427) +++ stable/7/share/man/man4/Makefile Thu Jun 18 06:09:47 2009 (r194428) @@ -16,6 +16,7 @@ MAN= aac.4 \ ahc.4 \ ahd.4 \ aio.4 \ + alc.4 \ ale.4 \ altq.4 \ amd.4 \ Copied: stable/7/share/man/man4/alc.4 (from r193882, head/share/man/man4/alc.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/man/man4/alc.4 Thu Jun 18 06:09:47 2009 (r194428, copy of r193882, head/share/man/man4/alc.4) @@ -0,0 +1,160 @@ +.\" Copyright (c) 2009 Pyun YongHyeon +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 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. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 10, 2009 +.Dt ALC 4 +.Os +.Sh NAME +.Nm alc +.Nd Atheros AR8131/AR8132 Gigabit/Fast Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device alc" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_alc_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for Atheros AR8131 PCI Express +Gigabit Ethernet controllers and Atheros AR8132 PCI Express +Fast Ethernet controllers. +.Pp +All LOMs supported by the +.Nm +driver have TCP/UDP/IP checksum offload for transmit, TCP +segmentation offload (TSO), hardware VLAN tag stripping/insertion +features, Wake On Lan (WOL) and an interrupt moderation mechanism +as well as a 64-bit multicast hash filter. +.Pp +The AR8131/AR8132 supports Jumbo Frames (up to 9216 bytes), which can +be configured via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +.It Cm 1000baseTX +Set 1000baseTX operation over twisted pair. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full duplex operation. +.It Cm half-duplex +Force half duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +Atheros AR8131 PCI Express Gigabit Ethernet controller +.It +Atheros AR8132 PCI Express Fast Ethernet controller +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.alc.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.It Va hw.alc.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.alc.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 130000, the default is 100(100us). +Value 0 completely disables the interrupt moderation. +.It Va dev.alc.%d.int_tx_mod +Maximum amount of time to delay transmit interrupt processing in +units of 1us. +The accepted range is 0 to 130000, the default is 50000(50ms). +Value 0 completely disables the interrupt moderation. +.It Va dev.alc.%d.process_limit +Maximum amount of Rx frames to be processed in the event loop before +rescheduling a taskqueue. +The accepted range is 32 to 255, the default value is 64 events. +The interface does not need to be brought down and up again before +a change takes effect. +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +driver was written by +.An Pyun YongHyeon +.Aq yongari@FreeBSD.org . +It first appeared in +.Fx 8.0 . Modified: stable/7/share/man/man4/altq.4 ============================================================================== --- stable/7/share/man/man4/altq.4 Thu Jun 18 06:07:58 2009 (r194427) +++ stable/7/share/man/man4/altq.4 Thu Jun 18 06:09:47 2009 (r194428) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2009 +.Dd June 10, 2009 .Dt ALTQ 4 .Os .Sh NAME @@ -116,6 +116,7 @@ are required to use a certain network ca .Nm . They have been applied to the following hardware drivers: .Xr age 4 , +.Xr alc 4 , .Xr ale 4 , .Xr an 4 , .Xr ath 4 , Modified: stable/7/share/man/man4/miibus.4 ============================================================================== --- stable/7/share/man/man4/miibus.4 Thu Jun 18 06:07:58 2009 (r194427) +++ stable/7/share/man/man4/miibus.4 Thu Jun 18 06:09:47 2009 (r194428) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2008 +.Dd June 10, 2009 .Dt MIIBUS 4 .Os .Sh NAME @@ -47,6 +47,8 @@ interface: .Bl -tag -compact -width ".Xr fxp 4" .It Xr age 4 Attansic/Atheros L1 Gigabit Ethernet +.It Xr alc 4 +Atheros AR8131/AR8132 PCIe Ethernet .It Xr ale 4 Atheros AR8121/AR8113/AR8114 PCIe Ethernet .It Xr aue 4 @@ -127,6 +129,7 @@ and but as a result are not well behaved newbus device drivers. .Sh SEE ALSO .Xr age 4 , +.Xr alc 4 , .Xr ale 4 , .Xr arp 4 , .Xr aue 4 , Modified: stable/7/share/man/man4/vlan.4 ============================================================================== --- stable/7/share/man/man4/vlan.4 Thu Jun 18 06:07:58 2009 (r194427) +++ stable/7/share/man/man4/vlan.4 Thu Jun 18 06:09:47 2009 (r194428) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2008 +.Dd June 10, 2009 .Dt VLAN 4 .Os .Sh NAME @@ -123,6 +123,7 @@ By now, the list of physical interfaces in the hardware is limited to the following devices: .Xr ae 4 , .Xr age 4 , +.Xr alc 4 , .Xr ale 4 , .Xr bce 4 , .Xr bge 4 , From des at des.no Thu Jun 18 07:28:47 2009 From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Thu Jun 18 07:28:53 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: (Dmitry Morozovsky's message of "Thu, 18 Jun 2009 00:04:50 +0400 (MSD)") References: <200906171731.n5HHVktG082752@svn.freebsd.org> Message-ID: <86my86dmqa.fsf@ds4.des.no> Dmitry Morozovsky writes: > Great. There's only > > stable/7/sys/contrib/pf/ (props changed) > > on every MFC to stable/7 left yet ;-P That one's not quite so simple, because the mergeinfo there is from merging pf from the vendor tree into head, whence it gets copied to stable/7. DES -- Dag-Erling Sm?rgrav - des@des.no From marck at rinet.ru Thu Jun 18 10:16:15 2009 From: marck at rinet.ru (Dmitry Morozovsky) Date: Thu Jun 18 10:16:21 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <86my86dmqa.fsf@ds4.des.no> References: <200906171731.n5HHVktG082752@svn.freebsd.org> <86my86dmqa.fsf@ds4.des.no> Message-ID: On Thu, 18 Jun 2009, Dag-Erling Sm?rgrav wrote: DS> Dmitry Morozovsky writes: DS> > Great. There's only DS> > DS> > stable/7/sys/contrib/pf/ (props changed) DS> > DS> > on every MFC to stable/7 left yet ;-P DS> DS> That one's not quite so simple, because the mergeinfo there is from DS> merging pf from the vendor tree into head, whence it gets copied to DS> stable/7. Ah I see. Well, maybe then we can skip (at least from the subject) directories with props-only changes? For now, looking for commit destination is not simple... -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From des at des.no Thu Jun 18 18:00:45 2009 From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Thu Jun 18 18:00:51 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: (Dmitry Morozovsky's message of "Thu, 18 Jun 2009 14:16:11 +0400 (MSD)") References: <200906171731.n5HHVktG082752@svn.freebsd.org> <86my86dmqa.fsf@ds4.des.no> Message-ID: <86iqit5sms.fsf@ds4.des.no> Dmitry Morozovsky writes: > Ah I see. Well, maybe then we can skip (at least from the subject) > directories with props-only changes? On the contrary. If prop changes were included in commit email, we would be able to catch mistakes much sooner. > For now, looking for commit destination is not simple... http://wiki.freebsd.org/SubversionPrimer/Merging DES -- Dag-Erling Sm?rgrav - des@des.no From jhb at freebsd.org Thu Jun 18 18:55:38 2009 From: jhb at freebsd.org (John Baldwin) Date: Thu Jun 18 18:55:57 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <86iqit5sms.fsf@ds4.des.no> References: <200906171731.n5HHVktG082752@svn.freebsd.org> <86iqit5sms.fsf@ds4.des.no> Message-ID: <200906181455.26797.jhb@freebsd.org> On Thursday 18 June 2009 2:00:43 pm Dag-Erling Sm?rgrav wrote: > Dmitry Morozovsky writes: > > For now, looking for commit destination is not simple... > > http://wiki.freebsd.org/SubversionPrimer/Merging I think Dmitry means more that all the prop changes stuff clutters the actual commit messages. I would like to see them removed from the subject line at least so that the subject line clearly shows where real changes are being made. -- John Baldwin From marck at rinet.ru Thu Jun 18 19:54:31 2009 From: marck at rinet.ru (Dmitry Morozovsky) Date: Thu Jun 18 19:54:42 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <86iqit5sms.fsf@ds4.des.no> References: <200906171731.n5HHVktG082752@svn.freebsd.org> <86my86dmqa.fsf@ds4.des.no> <86iqit5sms.fsf@ds4.des.no> Message-ID: On Thu, 18 Jun 2009, Dag-Erling Sm?rgrav wrote: DS> > Ah I see. Well, maybe then we can skip (at least from the subject) DS> > directories with props-only changes? DS> DS> On the contrary. If prop changes were included in commit email, we DS> would be able to catch mistakes much sooner. Actually, I did not argued for eliminating lines with props changes from the mail body -- only from subject. I tried to look through mailer.py, but got a bit frightened (my python skills are very limited) DS> > For now, looking for commit destination is not simple... DS> DS> http://wiki.freebsd.org/SubversionPrimer/Merging Yes, I'm aware of this recipe; I meant it's not simple for average svn-mailing-list-reader (especially when you look at the list of subjects) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From marck at rinet.ru Thu Jun 18 19:56:00 2009 From: marck at rinet.ru (Dmitry Morozovsky) Date: Thu Jun 18 19:56:12 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <200906181455.26797.jhb@freebsd.org> References: <200906171731.n5HHVktG082752@svn.freebsd.org> <86iqit5sms.fsf@ds4.des.no> <200906181455.26797.jhb@freebsd.org> Message-ID: On Thu, 18 Jun 2009, John Baldwin wrote: JB> > > For now, looking for commit destination is not simple... JB> > JB> > http://wiki.freebsd.org/SubversionPrimer/Merging JB> JB> I think Dmitry means more that all the prop changes stuff clutters the actual JB> commit messages. I would like to see them removed from the subject line at JB> least so that the subject line clearly shows where real changes are being JB> made. Exactly. Thank you John :) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From des at des.no Thu Jun 18 21:02:44 2009 From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Thu Jun 18 21:02:55 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <200906181455.26797.jhb@freebsd.org> (John Baldwin's message of "Thu, 18 Jun 2009 14:55:26 -0400") References: <200906171731.n5HHVktG082752@svn.freebsd.org> <86iqit5sms.fsf@ds4.des.no> <200906181455.26797.jhb@freebsd.org> Message-ID: <86eith5k7h.fsf@ds4.des.no> John Baldwin writes: > I think Dmitry means more that all the prop changes stuff clutters the actual > commit messages. I would like to see them removed from the subject line at > least so that the subject line clearly shows where real changes are being > made. That's reasonable - but I would still very much like to see prop changes in the commit email. It's not just svn:mergeinfo, there have also been cases of incorrect svn:keywords, and even someone who set svn:mime-type to application/octet-stream on a couple of files because they couldn't figure out the correct svn:keywords syntax. BTW, if you do as Dmitry suggests, how will you handle props-only commits like r192599, r192646 or r192653? DES -- Dag-Erling Sm?rgrav - des@des.no From marck at rinet.ru Thu Jun 18 21:08:32 2009 From: marck at rinet.ru (Dmitry Morozovsky) Date: Thu Jun 18 21:08:38 2009 Subject: svn commit: r194377 - stable/7/sys/dev/ath/ath_hal In-Reply-To: <86eith5k7h.fsf@ds4.des.no> References: <200906171731.n5HHVktG082752@svn.freebsd.org> <86iqit5sms.fsf@ds4.des.no> <200906181455.26797.jhb@freebsd.org> <86eith5k7h.fsf@ds4.des.no> Message-ID: On Thu, 18 Jun 2009, Dag-Erling Sm?rgrav wrote: DS> > I think Dmitry means more that all the prop changes stuff clutters the actual DS> > commit messages. I would like to see them removed from the subject line at DS> > least so that the subject line clearly shows where real changes are being DS> > made. DS> DS> That's reasonable - but I would still very much like to see prop changes DS> in the commit email. It's not just svn:mergeinfo, there have also been DS> cases of incorrect svn:keywords, and even someone who set svn:mime-type DS> to application/octet-stream on a couple of files because they couldn't DS> figure out the correct svn:keywords syntax. DS> DS> BTW, if you do as Dmitry suggests, how will you handle props-only DS> commits like r192599, r192646 or r192653? As for last question: there are _only_ props changes lines in the changes list. This can be treated as a stop-case for changing subject at all (also, these cases are rather rare comparing to normal development/merging) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From jhb at FreeBSD.org Thu Jun 18 21:17:05 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Thu Jun 18 21:17:22 2009 Subject: svn commit: r194462 - stable/7/sys/netinet Message-ID: <200906182117.n5ILH4oD022986@svn.freebsd.org> Author: jhb Date: Thu Jun 18 21:17:04 2009 New Revision: 194462 URL: http://svn.freebsd.org/changeset/base/194462 Log: MFC: Fix overflow edge cases with comparing ticks to t_rcvtime including fixing the TCP keepalive timer to work properly when ticks overflows from INT_MAX to INT_MIN. Note that to preserve the ABI this change just downcasts t_rcvtime to an int when it is subtracted from ticks rather than changing the type of t_rcvtime. Modified: stable/7/sys/netinet/tcp_output.c stable/7/sys/netinet/tcp_timer.c Modified: stable/7/sys/netinet/tcp_output.c ============================================================================== --- stable/7/sys/netinet/tcp_output.c Thu Jun 18 21:15:41 2009 (r194461) +++ stable/7/sys/netinet/tcp_output.c Thu Jun 18 21:17:04 2009 (r194462) @@ -161,7 +161,7 @@ tcp_output(struct tcpcb *tp) * to send, then transmit; otherwise, investigate further. */ idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); - if (idle && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) { + if (idle && (ticks - (int)tp->t_rcvtime) >= tp->t_rxtcur) { /* * We have been idle for "a while" and no acks are * expected to clock out any data we send -- Modified: stable/7/sys/netinet/tcp_timer.c ============================================================================== --- stable/7/sys/netinet/tcp_timer.c Thu Jun 18 21:15:41 2009 (r194461) +++ stable/7/sys/netinet/tcp_timer.c Thu Jun 18 21:17:04 2009 (r194462) @@ -234,7 +234,7 @@ tcp_timer_2msl(void *xtp) tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && - (ticks - tp->t_rcvtime) <= tcp_maxidle) + (ticks - (int)tp->t_rcvtime) <= tcp_maxidle) callout_reset(&tp->t_timers->tt_2msl, tcp_keepintvl, tcp_timer_2msl, tp); else @@ -293,7 +293,7 @@ tcp_timer_keep(void *xtp) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { - if ((ticks - tp->t_rcvtime) >= tcp_keepidle + tcp_maxidle) + if ((ticks - (int)tp->t_rcvtime) >= tcp_keepidle + tcp_maxidle) goto dropit; /* * Send a packet designed to force a response @@ -387,8 +387,8 @@ tcp_timer_persist(void *xtp) * backoff that we would use if retransmitting. */ if (tp->t_rxtshift == TCP_MAXRXTSHIFT && - ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle || - (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { + ((ticks - (int)tp->t_rcvtime) >= tcp_maxpersistidle || + (ticks - (int)tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { tcpstat.tcps_persistdrop++; tp = tcp_drop(tp, ETIMEDOUT); goto out; From edwin at FreeBSD.org Fri Jun 19 07:34:31 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Fri Jun 19 07:34:38 2009 Subject: svn commit: r194475 - stable/7/share/syscons/keymaps Message-ID: <200906190734.n5J7YUaW034638@svn.freebsd.org> Author: edwin Date: Fri Jun 19 07:34:30 2009 New Revision: 194475 URL: http://svn.freebsd.org/changeset/base/194475 Log: MFC of 194055 French translations for keyboards keymaps descriptions French translations for keyboards keymaps descriptions with some corrections on existing translations in the /usr/share/syscons/keymaps/INDEX.keymaps PR: conf/71767 Submitted by: Henri Michelon Modified: stable/7/share/syscons/keymaps/ (props changed) stable/7/share/syscons/keymaps/INDEX.keymaps Modified: stable/7/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/7/share/syscons/keymaps/INDEX.keymaps Fri Jun 19 07:18:45 2009 (r194474) +++ stable/7/share/syscons/keymaps/INDEX.keymaps Fri Jun 19 07:34:30 2009 (r194475) @@ -43,10 +43,12 @@ FONT:hy:haik8-8x16.fnt # be.iso.kbd:en:Belgian ISO-8859-1 be.iso.kbd:de:Belgisch ISO-8859-1 +be.iso.kbd:fr:Belge ISO-8859-1 be.iso.kbd:pt,es:Belga ISO-8859-1 be.iso.acc.kbd:en:Belgian ISO-8859-1 (accent keys) be.iso.acc.kbd:de:Belgisch ISO-8859-1 (mit Akzenten) +be.iso.acc.kbd:fr:Belge ISO-8859-1 (avec accents) be.iso.acc.kbd:pt:Belga ISO-8859-1 (com acentos) be.iso.acc.kbd:es:Belga ISO-8859-1 (con acentos) @@ -55,34 +57,43 @@ bg.phonetic.ctrlcaps.kbd:bg:Bulgarian Ph br275.iso.kbd:en:Brazilian 275 ISO-8859-1 br275.iso.kbd:de:Brasilianisch 275 ISO-8859-1 +br275.iso.kbd:fr:Brésilien 275 ISO-8859-1 br275.iso.kbd:pt:Brasileiro 275 ISO-8859-1 br275.iso.kbd:es:Brasileño 275 ISO-8859-1 br275.iso.acc.kbd:en:Brazilian 275 ISO-8859-1 (accent keys) br275.iso.acc.kbd:de:Brasilianisch 275 ISO-8859-1 (mit Akzenten) +br275.iso.acc.kbd:fr:Brésilien 275 ISO-8859-1 (avec accents) br275.iso.acc.kbd:pt:Brasileiro 275 ISO-8859-1 (com acentos) br275.iso.acc.kbd:es:Brasileño 275 ISO-8859-1 (con acentos) br275.cp850.kbd:en:Brazilian 275 Codepage 850 br275.cp850.kbd:de:Brasilianisch 275 Codeseite 850 +br275.cp850.kbd:fr:Brésilien 275 Code page 850 br275.cp850.kbd:pt:Brasileiro 275 Codepage 850 br275.cp850.kbd:es:Brasileño 275 Codepage 850 by.cp1131.kbd:en:Belarusian Codepage 1131 +by.cp1131.kbd:fr:Biélorusse Code page 1131 by.cp1251.kbd:en:Belarusian Codepage 1251 +by.cp1251.kbd:fr:Biélorusse Code page 1251 by.iso5.kbd:en:Belarusian ISO-8859-5 +by.iso5.kbd:fr:Biélorusse ISO-8859-5 ce.iso2.kbd:en:Central European ISO-8859-2 ce.iso2.kbd:de:Zentral Europäisch ISO-8859-2 +ce.iso2.kbd:fr:Centre européen ISO-8859-2 ce.iso2.kbd:es:Centroeuropeo ISO-8859-2 colemak.iso15.acc.kbd:en:Colemak ergonomic alternative cs.latin2.qwertz.kbd:en:Czech ISO-8859-2 (QWERTZ, accent keys) +cs.latin2.qwertz.kbd:fr:Tchèque ISO-8859-2 (QWERTZ, avec accents) cs.latin2.qwertz.kbd:es:Checo ISO-8859-2 (QWERTZ, con acentos) cz.iso2.kbd:en:Czech ISO-8859-2 cz.iso2.kbd:de:Tschechisch ISO-8859-2 +cz.iso2.kbd:fr:Tchèque ISO-8859-2 cz.iso2.kbd:es:Checo ISO-8859-2 danish.iso.kbd:en:Danish ISO-8859-1 @@ -100,26 +111,32 @@ danish.cp865.kbd:pt:Dinamarquês Codepage danish.cp865.kbd:es:Danés Codepage 865 el.iso07.kbd:en:Greek ISO-8859-7 (104 keys) +el.iso07.kbd:fr:Grec ISO-8859-7 (104 touches) el.iso07.kbd:el:Åëëçíéêü ISO-8859-7 (104 ðëÞêôñùí) estonian.iso.kbd:en:Estonian ISO-8859-1 estonian.iso.kbd:de:Estnisch ISO-8859-1 +estonian.iso.kbd:fr:Estonien ISO-8859-1 estonian.iso.kbd:es:Estonio ISO-8859-1 estonian.iso15.kbd:en:Estonian ISO-8859-15 estonian.iso15.kbd:de:Estnisch ISO-8859-15 +estonian.iso15.kbd:fr:Estonien ISO-8859-15 estonian.iso15.kbd:es:Estonio ISO-8859-15 estonian.cp850.kbd:en:Estonian Codepage 850 estonian.cp850.kbd:de:Estnisch Codeseite 850 +estonian.cp850.kbd:fr:Estonien Code page 850 estonian.cp850.kbd:es:Estonio Codepage 850 finnish.iso.kbd:en:Finnish ISO-8859-1 finnish.iso.kbd:de:Finnisch ISO-8859-1 +finnish.iso.kbd:fr:Finlandais ISO-8859-1 finnish.iso.kbd:es:Finlandés ISO-8859-1 finnish.cp850.kbd:en:Finnish Codepage 850 finnish.cp850.kbd:de:Finnisch Codeseite 850 +finnish.cp850.kbd:fr:Finlandais Code page 850 finnish.cp850.kbd:es:Finlandés Codepage 850 fr.iso.kbd:en:French ISO-8859-1 @@ -131,7 +148,7 @@ fr.iso.kbd:uk:æÒÁÎÃÕÚØËÁ ISO-8859-1 fr.iso.acc.kbd:en:French ISO-8859-1 (accent keys) fr.iso.acc.kbd:de:Französisch ISO-8859-1 (mit Akzenten) -fr.iso.acc.kbd:fr:Français ISO-8859-1 (accent keys) +fr.iso.acc.kbd:fr:Français ISO-8859-1 (avec accents) fr.iso.acc.kbd:pt:Francês ISO-8859-1 (com acentos) fr.iso.acc.kbd:es:Francés ISO-8859-1 (con acentos) fr.iso.acc.kbd:uk:æÒÁÎÃÕÚØËÁ ISO-8859-1 (accent keys) @@ -158,6 +175,7 @@ fr.dvorak.acc.kbd:uk:French Dvorak-like fr_CA.iso.acc.kbd:en:French Canadian ISO-8859-1 (accent keys) fr_CA.iso.acc.kbd:de:Französisch Kanada ISO-8859-1 (mit Akzenten) +fr_CA.iso.acc.kbd:fr:Français Canadien ISO-8859-1 (avec accents) fr_CA.iso.acc.kbd:es:Francocanadiense ISO-8859-1 (con acentos) fr_CA.iso.acc.kbd:uk:æÒÁÎÃÕÚØËÏ-ËÁÎÁÄÓØËÁ ISO-8859-1 (accent keys) @@ -183,100 +201,124 @@ german.cp850.kbd:es:Alemán Codepage 850 german.cp850.kbd:uk:î¦ÍÅÃØËÁ CP-850 gr.elot.acc.kbd:en:Greek ISO-8859-7 ELOT +gr.elot.acc.kbd:fr:Grec ISO-8859-7 ELOT gr.elot.acc.kbd:el:Åëëçíéêü ISO-8859-7 ÅËÏÔ gr.us101.acc.kbd:en:Greek ISO-8859-7 (101 keys) +gr.us101.acc.kbd:fr:Grec ISO-8859-7 (101 touches) gr.us101.acc.kbd:el:Åëëçíéêü ISO-8859-7 (101 ðëÞêôñùí) iw.iso8.kbd:en:Hebrew ISO-8859-8 +iw.iso8.kbd:fr:Hébreu ISO-8859-8 iw.iso8.kbd:he:ISO-8859-8 úéøáò hr.iso.kbd:en:Croatian ISO-8859-2 hr.iso.kbd:de:Kroatisch ISO-8859-2 +hr.iso.kbd:fr:Croate ISO-8859-2 hr.iso.kbd:es:Croata ISO-8859-2 hu.iso2.101keys.kbd:en:Hungarian 101 ISO-8859-2 hu.iso2.101keys.kbd:de:Ungarisch 101 ISO-8859-2 +hu.iso2.101keys.kbd:fr:Hongrois 101 ISO-8859-2 hu.iso2.101keys.kbd:es:Húngaro 101 ISO-8859-2 hu.iso2.102keys.kbd:en:Hungarian 102 ISO-8859-2 hu.iso2.102keys.kbd:de:Ungarisch 102 ISO-8859-2 +hu.iso2.102keys.kbd:fr:Hongrois 102 ISO-8859-2 hu.iso2.102keys.kbd:es:Húngaro 102 ISO-8859-2 hy.armscii-8.kbd:hy:гۻñ»Ý ÑÝãÛáõݳÛÇÝ ¥Phonetic¤ ¹³ë³íáñáõÃÛáõÝ hy.armscii-8.kbd:ru:áÒÍÑÎÓËÁÑ ÆÏÎÅÔÉÞÅÓËÁÑ ÒÁÓËÌÁÄËÁ hy.armscii-8.kbd:en:Armenian phonetic layout +hy.armscii-8.kbd:fr:Arménien phonétique hy.armscii-8.kbd:de:Armenische phonetische Tastenbelegung icelandic.iso.kbd:en:Icelandic ISO-8859-1 icelandic.iso.kbd:de:Isländisch ISO-8859-1 +icelandic.iso.kbd:fr:Islandais ISO-8859-1 icelandic.iso.kbd:pt:Islandês ISO-8859-1 icelandic.iso.kbd:es:Islandés ISO-8859-1 icelandic.iso.acc.kbd:en:Icelandic ISO-8859-1 (accent keys) icelandic.iso.acc.kbd:de:Isländisch ISO-8859-1 (mit Akzenten) +icelandic.iso.acc.kbd:fr:Islandais ISO-8859-1 (avec accents) icelandic.iso.acc.kbd:pt:Islandês ISO-8859-1 (com acentos) icelandic.iso.acc.kbd:es:Islandés ISO-8859-1 (con acentos) it.iso.kbd:en:Italian ISO-8859-1 it.iso.kbd:de:Italienisch ISO-8859-1 +it.iso.kbd:fr:Italien ISO-8859-1 it.iso.kbd:pt,es:Italiano ISO-8859-1 it.iso.kbd:uk:¶ÔÁ̦ÊÓØËÁ ISO-8859-1 jp.106.kbd:en:Japanese 106 jp.106.kbd:de:Japanisch 106 +jp.106.kbd:fr:Japonais 106 jp.106.kbd:pt:Japonês 106 jp.106.kbd:es:Japonés 106 jp.106.kbd:uk:ñÐÏÎÓØËÁ 106 jp.106x.kbd:en:Japanese 106x jp.106x.kbd:de:Japanisch 106x +jp.106x.kbd:fr:Japonais 106x jp.106x.kbd:pt:Japonês 106x jp.106x.kbd:es:Japonés 106x jp.106x.kbd:uk:ñÐÏÎÓØËÁ 106x jp.pc98.kbd:en:Japanese PC-98x1 +jp.pc98.kbd:fr:Japonais PC-98x1 jp.pc98.iso.kbd:en:Japanese PC-98x1 (ISO) +jp.pc98.iso.kbd:fr:Japonais PC-98x1 (ISO) kk.pt154.kst.kbd:en:Kazakh PT154 codepage +kk.pt154.kst.kbd:fr:Kazakh PT154 code page kk.pt154.io.kbd:en:Kazakh PT154 codepage +kk.pt154.io.kbd:fr:Kazakh PT154 code page latinamerican.kbd:en:Latin American latinamerican.kbd:de:Latein Amerikanisch +latinamerican.kbd:fr:Amérique latine latinamerican.kbd:pt,es:América Latina latinamerican.iso.acc.kbd:en:Latin American (accent keys) latinamerican.iso.acc.kbd:de:Latein Amerikanisch (mit Akzenten) +latinamerican.iso.acc.kbd:fr:Amérique latine (avec accents) latinamerican.iso.acc.kbd:pt,es:América Latina (com acentos) lt.iso4.kbd:en:Lithuanian ISO-8859-4 +lt.iso4.kbd:fr:Lithuanien ISO-8859-4 lt.iso4.kbd:es:Lituano ISO-8859-4 norwegian.iso.kbd:en:Norwegian ISO-8859-1 norwegian.iso.kbd:no:Norsk ISO-8859-1 norwegian.iso.kbd:de:Norwegisch ISO-8859-1 +norwegian.iso.kbd:fr:Norvégien ISO-8859-1 norwegian.iso.kbd:pt:Norueguês ISO-8859-1 norwegian.iso.kbd:es:Noruego ISO-8859-1 norwegian.dvorak.kbd:en:Norwegian dvorak norwegian.dvorak.kbd:no:Norsk dvorak norwegian.dvorak.kbd:de:Norwegisch dvorak +norwegian.dvorak.kbd:fr:Norvégien dvorak norwegian.dvorak.kbd:pt:Norueguês dvorak norwegian.dvorak.kbd:es:Noruego Idvorak pl_PL.ISO8859-2.kbd:en:Polish ISO-8859-2 (programmer's) pl_PL.ISO8859-2.kbd:de:Polnisch ISO-8859-2 (für Programmierer) +pl_PL.ISO8859-2.kbd:fr:Polonais ISO-8859-2 (pour programmeurs) pl_PL.ISO8859-2.kbd:pl:Polska ISO-8859-2 (programisty) pl_PL.ISO8859-2.kbd:pt:Polonês ISO-8859-2 (para programadores) pl_PL.ISO8859-2.kbd:es:Polaco ISO-8859-2 (para programadores) pt.iso.kbd:en:Portuguese ISO-8859-1 pt.iso.kbd:de:Portugisisch ISO-8859-1 +pt.iso.kbd:fr:Portugais ISO-8859-1 pt.iso.kbd:pt:Português ISO-8859-1 pt.iso.kbd:es:Portugués ISO-8859-1 pt.iso.acc.kbd:en:Portuguese ISO-8859-1 (accent keys) pt.iso.acc.kbd:de:Portugisisch ISO-8859-1 (mit Akzenten) +pt.iso.acc.kbd:fr:Portugais ISO-8859-1 (avec accents) pt.iso.acc.kbd:pt:Português ISO-8859-1 (com acentos) pt.iso.acc.kbd:es:Portugués ISO-8859-1 (con acentos) @@ -289,6 +331,7 @@ ru.cp866.kbd:es:Ruso Codepage 866 (alter ru.cp866.kbd:uk:òÏÓ¦ÊÓØËÁ CP-866 (ÁÌØÔÅÒÎÁÔÉ×ÎÁ) ru.iso5.kbd:en:Russian ISO-8859-5 +ru.iso5.kbd:fr:Russe ISO-8859-5 ru.iso5.kbd:ru:òÕÓÓËÉÊ ISO-8859-5 ru.iso5.kbd:uk:òÏÓ¦ÊÓØËÉÊ ISO-8859-5 @@ -310,26 +353,31 @@ ru.koi8-r.shift.kbd:uk:òÏÓ¦ÊÓØËÁ koi8-r spanish.iso.kbd:en:Spanish ISO-8859-1 spanish.iso.kbd:de:Spanisch ISO-8859-1 +spanish.iso.kbd:fr:Espagnol ISO-8859-1 spanish.iso.kbd:pt:Espanhol ISO-8859-1 spanish.iso.kbd:es:Español ISO-8859-1 spanish.iso.acc.kbd:en:Spanish ISO-8859-1 (accent keys) spanish.iso.acc.kbd:de:Spanisch ISO-8859-1 (accent keys) +spanish.iso.acc.kbd:fr:Espagnol ISO-8859-1 (avec accents) spanish.iso.acc.kbd:pt:Espanhol ISO-8859-1 (com acentos) spanish.iso.acc.kbd:es:Español ISO-8859-1 (con acentos) spanish.iso15.acc.kbd:en:Spanish ISO-8859-15 (accent keys) spanish.iso15.acc.kbd:de:Spanisch ISO-8859-15 (accent keys) +spanish.iso15.acc.kbd:fr:Espagnol ISO-8859-15 (avec accents) spanish.iso15.acc.kbd:pt:Espanhol ISO-8859-15 (com acentos) spanish.iso15.acc.kbd:es:Español ISO-8859-15 (con acentos) si.iso.kbd:en:Slovenian ISO-8859-2 si.iso.kbd:de:Slovenisch ISO-8859-2 +si.iso.kbd:fr:Slovène ISO-8859-2 si.iso.kbd:pt:Eslovênio ISO-8859-2 si.iso.kbd:es:Esloveno ISO-8859-2 sk.iso2.kbd:en:Slovak ISO-8859-2 sk.iso2.kbd:de:Slovakisch ISO-8859-2 +sk.iso2.kbd:fr:Slovène ISO-8859-2 sk.iso2.kbd:es:Eslovaco ISO-8859-2 swedish.iso.kbd:en:Swedish ISO-8859-1 @@ -376,6 +424,7 @@ swissgerman.cp850.kbd:pt:Suiço-Alemão Co swissgerman.cp850.kbd:es:Germanosuizo Codepage 850 tr.iso9.q.kbd:en:Turkish ISO-8859-9 +tr.iso9.q.kbd:fr:Turc ISO-8859-9 tr.iso9.q.kbd:uk:ôÕÒÅÃØËÁ ISO-8859-9 uk.iso.kbd:en:United Kingdom ISO-8859-1 @@ -392,58 +441,61 @@ uk.cp850.kbd:es:Británico Codepage 850 us.iso.kbd:en:United States of America ISO-8859-1 us.iso.kbd:de:US-amerikanisch ISO-8859-1 -us.iso.kbd:fr:États Unis d'Amérique ISO-8859-1 +us.iso.kbd:fr:États Unis d'Amérique ISO-8859-1 us.iso.kbd:pt:Estados Unidos da América ISO-8859-1 us.iso.kbd:es:Estadounidense ISO-8859-1 us.iso.acc.kbd:en:United States of America ISO-8859-1 (accent keys) us.iso.acc.kbd:de:US-amerikanisch ISO-8859-1 (mit Akzenten) -us.iso.acc.kbd:fr:États Unis d'Amérique ISO-8859-1 (avec accents) +us.iso.acc.kbd:fr:États Unis d'Amérique ISO-8859-1 (avec accents) us.iso.acc.kbd:pt:Estados Unidos da América ISO-8859-1 (com acentos) us.iso.acc.kbd:es:Estadounidense ISO-8859-1 (con acentos) us.dvorak.kbd:en:United States of America dvorak us.dvorak.kbd:de:US-amerikanisch dvorak -us.dvorak.kbd:fr:États Unis d'Amérique dvorak +us.dvorak.kbd:fr:États Unis d'Amérique dvorak us.dvorak.kbd:pt:Estados Unidos da América dvorak us.dvorak.kbd:es:Estadounidense dvorak us.dvorakr.kbd:en:United States of America righthand dvorak us.dvorakr.kbd:de:US-amerikanisch dvorak rechte Hand -us.dvorakr.kbd:fr:États Unis d'Amérique dvorakr +us.dvorakr.kbd:fr:États Unis d'Amérique dvorakr us.dvorakr.kbd:pt:Estados Unidos da América dvorakr us.dvorakr.kbd:es:Estadounidense dvorak diestro us.dvorakl.kbd:en:United States of America lefthand dvorak us.dvorakl.kbd:de:US-amerikanisch dvorak linke Hand -us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl +us.dvorakl.kbd:fr:États Unis d'Amérique dvorakl us.dvorakl.kbd:pt:Estados Unidos da América dvorakl us.dvorakl.kbd:es:Estadounidense dvorak zurdo us.dvorakx.kbd:en:United States of America dvorakx us.dvorakx.kbd:de:US-amerikanisch dvorakx -us.dvorakx.kbd:fr:États Unis d'Amérique dvorakx +us.dvorakx.kbd:fr:États Unis d'Amérique dvorakx us.dvorakx.kbd:pt:Estados Unidos da América dvorakx us.dvorakx.kbd:es:Estadounidense dvorakx us.emacs.kbd:en:United States of America Emacs optimized layout us.emacs.kbd:de:US-amerikanisch für Emacs optimiert -us.emacs.kbd:fr:États Unis d'Amérique emacs +us.emacs.kbd:fr:États Unis d'Amérique emacs us.emacs.kbd:pt:Estados Unidos da América emacs us.emacs.kbd:es:Estadounidense optimizado para Emacs us.unix.kbd:en:United States of America Traditional Unix Workstation us.unix.kbd:de:US-amerikanisch traditionelles Unix Layout -us.unix.kbd:fr:États Unis d'Amérique unix +us.unix.kbd:fr:États Unis d'Amérique unix us.unix.kbd:pt:Estados Unidos da América unix us.unix.kbd:es:Estadounidense Unix tradicional ua.iso5.kbd:en:Ukrainian ISO-8859-5 +ua.iso5.kbd:fr:Ukrainien ISO-8859-5 ua.iso5.kbd:ru:õËÒÁÉÎÓËÉÊ ISO-8859-5 ua.iso5.kbd:uk:õËÒÁ§ÎÓØËÁ ISO-8859-5 ua.koi8-u.kbd:en:Ukrainian koi8-u +ua.koi8-u.kbd:fr:Ukrainien koi8-u ua.koi8-u.kbd:uk:õËÒÁ§ÎÓØËÁ koi8-u ua.koi8-u.shift.alt.kbd:en:Ukrainian koi8-u with koi8-r (shift) +ua.koi8-u.shift.alt.kbd:fr:Ukrainien koi8-u avec koi8-r (shift) ua.koi8-u.shift.alt.kbd:uk:õËÒÁ§ÎÓØËÁ koi8-u Ú koi8-r (shift) From edwin at FreeBSD.org Fri Jun 19 07:37:38 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Fri Jun 19 07:37:57 2009 Subject: svn commit: r194476 - stable/7/share/syscons/keymaps Message-ID: <200906190737.n5J7bbxr034738@svn.freebsd.org> Author: edwin Date: Fri Jun 19 07:37:37 2009 New Revision: 194476 URL: http://svn.freebsd.org/changeset/base/194476 Log: MFC of 194084 Add various new keymaps: addition: danish syscons keymap with accents There are two danish keymap files shipping with FreeBSD: danish.iso.kbd and danish.cp865.kbd. None of these support accents by use of dead keys, which isn't crucial to Danes but often used. This is a new keymap, danish.iso.acc.kbd, that's based on danish.iso.kbd with the accent part taken from german.iso.acc.kbd. pl_PL.dvorak keymap for syscons. Polish dvorak keymap by Robert Sebastian Gerus (17:05 01-07-2006 CEST) . Based on pl_PL.ISO-8859-2 and us.dvorak keymaps. British English Dvorak keymap for syscons. Attached is a Dvorak keymap for British English, with a pound-sterling symbol on on Shift-3 and some other characters in different places to the US Dvorak keymap. I've based the layout on the X.org GB keymap, Dvorak variant. PR: conf/72978, kern/99692, conf/117257 Submitted by: Kim Norgaard , Robert Sebastian Gerus , "Benjamin A'Lee" Added: stable/7/share/syscons/keymaps/danish.iso.acc.kbd - copied unchanged from r194084, head/share/syscons/keymaps/danish.iso.acc.kbd stable/7/share/syscons/keymaps/pl_PL.dvorak.kbd - copied unchanged from r194084, head/share/syscons/keymaps/pl_PL.dvorak.kbd stable/7/share/syscons/keymaps/uk.dvorak.kbd - copied unchanged from r194084, head/share/syscons/keymaps/uk.dvorak.kbd Modified: stable/7/share/syscons/keymaps/ (props changed) stable/7/share/syscons/keymaps/INDEX.keymaps stable/7/share/syscons/keymaps/Makefile Modified: stable/7/share/syscons/keymaps/INDEX.keymaps ============================================================================== --- stable/7/share/syscons/keymaps/INDEX.keymaps Fri Jun 19 07:34:30 2009 (r194475) +++ stable/7/share/syscons/keymaps/INDEX.keymaps Fri Jun 19 07:37:37 2009 (r194476) @@ -103,6 +103,13 @@ danish.iso.kbd:fr:Danois ISO-8859-1 danish.iso.kbd:pt:Dinamarquês ISO-8859-1 danish.iso.kbd:es:Danés ISO-8859-1 +danish.iso.acc.kbd:en:Danish ISO-8859-1 (accent keys) +danish.iso.acc.kbd:da:Dansk ISO-8859-1 (accent taster) +danish.iso.acc.kbd:de:Dänisch ISO-8859-1 (mit Akzenten) +danish.iso.acc.kbd:fr:Danois ISO-8859-1 (avec accents) +danish.iso.acc.kbd:pt:Dinamarquês ISO-8859-1 (com acentos) +danish.iso.acc.kbd:es:Danés ISO-8859-1 (con acentos) + danish.cp865.kbd:en:Danish Codepage 865 danish.cp865.kbd:da:Dansk Code page 865 danish.cp865.kbd:de:Dänisch Codeseite 865 @@ -310,6 +317,13 @@ pl_PL.ISO8859-2.kbd:pl:Polska ISO-8859-2 pl_PL.ISO8859-2.kbd:pt:Polonês ISO-8859-2 (para programadores) pl_PL.ISO8859-2.kbd:es:Polaco ISO-8859-2 (para programadores) +pl_PL.dvorak.kbd:en:Polish Dvorak +pl_PL.dvorak.kbd:de:Polnisch Dvorak +pl_PL.dvorak.kbd:fr:Polonais Dvorak +pl_PL.dvorak.kbd:pl:Polska Dvorak +pl_PL.dvorak.kbd:pt:Polonês Dvorak +pl_PL.dvorak.kbd:es:Polaco Dvorak + pt.iso.kbd:en:Portuguese ISO-8859-1 pt.iso.kbd:de:Portugisisch ISO-8859-1 pt.iso.kbd:fr:Portugais ISO-8859-1 @@ -439,6 +453,12 @@ uk.cp850.kbd:fr:Royaume Uni Code page 85 uk.cp850.kbd:pt:Reino Unido Codepage 850 uk.cp850.kbd:es:Británico Codepage 850 +uk.dvorak.kbd:en:United Kingdom Dvorak +uk.dvorak.kbd:de:Vereinigtes K\xf6nigreich Dvorak +uk.dvorak.kbd:fr:Royaume Uni Dvorak +uk.dvorak.kbd:pt:Reino Unido Dvorak +uk.dvorak.kbd:es:Británico Dvorak + us.iso.kbd:en:United States of America ISO-8859-1 us.iso.kbd:de:US-amerikanisch ISO-8859-1 us.iso.kbd:fr:États Unis d'Amérique ISO-8859-1 Modified: stable/7/share/syscons/keymaps/Makefile ============================================================================== --- stable/7/share/syscons/keymaps/Makefile Fri Jun 19 07:34:30 2009 (r194475) +++ stable/7/share/syscons/keymaps/Makefile Fri Jun 19 07:37:37 2009 (r194476) @@ -9,7 +9,8 @@ FILES= INDEX.keymaps \ colemak.iso15.acc.kbd \ cs.latin2.qwertz.kbd \ cz.iso2.kbd \ - danish.iso.kbd danish.cp865.kbd dutch.iso.acc.kbd \ + danish.iso.kbd danish.iso.acc.kbd danish.cp865.kbd \ + dutch.iso.acc.kbd \ el.iso07.kbd \ estonian.iso.kbd estonian.iso15.kbd estonian.cp850.kbd \ finnish.iso.kbd finnish.cp850.kbd \ @@ -29,7 +30,7 @@ FILES= INDEX.keymaps \ latinamerican.kbd latinamerican.iso.acc.kbd \ lt.iso4.kbd \ norwegian.iso.kbd norwegian.dvorak.kbd \ - pl_PL.ISO8859-2.kbd \ + pl_PL.ISO8859-2.kbd pl_PL.dvorak.kbd \ pt.iso.kbd pt.iso.acc.kbd \ ru.koi8-r.kbd ru.koi8-r.shift.kbd ru.koi8-r.win.kbd \ ru.cp866.kbd ru.iso5.kbd \ @@ -42,6 +43,7 @@ FILES= INDEX.keymaps \ tr.iso9.q.kbd \ ua.koi8-u.kbd ua.koi8-u.shift.alt.kbd ua.iso5.kbd \ uk.iso.kbd uk.iso-ctrl.kbd uk.cp850.kbd uk.cp850-ctrl.kbd \ + uk.dvorak.kbd \ us.iso.kbd us.dvorak.kbd us.dvorakx.kbd us.emacs.kbd us.pc-ctrl.kbd \ us.unix.kbd us.iso.acc.kbd Copied: stable/7/share/syscons/keymaps/danish.iso.acc.kbd (from r194084, head/share/syscons/keymaps/danish.iso.acc.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/syscons/keymaps/danish.iso.acc.kbd Fri Jun 19 07:37:37 2009 (r194476, copy of r194084, head/share/syscons/keymaps/danish.iso.acc.kbd) @@ -0,0 +1,164 @@ +# Copyright (c) 2004 +# Kim Norgaard , Denmark. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer as +# the first lines of this file unmodified. +# 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. +# +# THIS SOFTWARE IS PROVIDED BY KIM NOORGAARD ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL KIM NOORGAARD BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop 161 185 nop nop O + 003 '2' '"' nul nul '@' 178 nul nul O + 004 '3' '#' nop nop 158 179 nop nop O + 005 '4' 164 nop nop '$' 164 nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '&' nop nop '6' '&' nop nop O + 008 '7' '/' nop nop '{' '/' nop nop O + 009 '8' '(' esc esc '[' '8' esc esc O + 010 '9' ')' gs gs ']' ')' gs gs O + 011 '0' '=' nop nop '}' '=' nop nop O + 012 '+' '?' nop nop '+' 191 nop nop O + 013 dacu dgra nop nop '|' '`' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 164 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 229 197 nop nop 134 143 nop nop C + 027 duml dcir rs rs dtil '^' rs rs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 223 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 230 198 nop nop 145 146 nop nop C + 040 248 216 nop nop 155 157 nop nop C + 041 189 167 nop nop 189 167 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 ''' '*' nop nop ''' '*' nop nop O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' ';' nop nop ',' ';' nop nop O + 052 '.' ':' nop nop '.' ':' nop nop O + 053 '-' '_' us us '-' '_' us us O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' fs fs '\' '>' fs fs O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + duml '"' ( 'a' 228 ) ( 'A' 196 ) ( 'e' 235 ) ( 'E' 203 ) + ( 'i' 239 ) ( 'I' 207 ) ( 'o' 246 ) ( 'O' 214 ) + ( 'u' 252 ) ( 'U' 220 ) ( 'y' 255 ) + dcir '^' ( 'a' 226 ) ( 'A' 194 ) ( 'e' 234 ) ( 'E' 202 ) + ( 'i' 238 ) ( 'I' 206 ) ( 'o' 244 ) ( 'O' 212 ) + ( 'u' 251 ) ( 'U' 219 ) + dtil '~' ( 'a' 227 ) ( 'A' 195 ) ( 'n' 241 ) ( 'N' 209 ) + ( 'o' 245 ) ( 'O' 213 ) + dgra '`' ( 'a' 224 ) ( 'A' 192 ) ( 'e' 232 ) ( 'E' 200 ) + ( 'i' 236 ) ( 'I' 204 ) ( 'o' 242 ) ( 'O' 210 ) + ( 'u' 249 ) ( 'U' 217 ) + dacu ''' ( 'a' 225 ) ( 'A' 193 ) ( 'e' 233 ) ( 'E' 201 ) + ( 'i' 237 ) ( 'I' 205 ) ( 'o' 243 ) ( 'O' 211 ) + ( 'u' 250 ) ( 'U' 218 ) ( 'y' 253 ) ( 'Y' 221 ) + drin 176 ( 'a' 229 ) ( 'A' 197 ) + dced 184 ( 'c' 231 ) ( 'C' 199 ) + dmac 000 + dbre 000 + ddot 000 + dsla 000 + dapo 000 + ddac 000 + dogo 000 + dcar 000 Copied: stable/7/share/syscons/keymaps/pl_PL.dvorak.kbd (from r194084, head/share/syscons/keymaps/pl_PL.dvorak.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/syscons/keymaps/pl_PL.dvorak.kbd Fri Jun 19 07:37:37 2009 (r194476, copy of r194084, head/share/syscons/keymaps/pl_PL.dvorak.kbd) @@ -0,0 +1,118 @@ +# $FreeBSD$ +# +# Polish dvorak keymap by Robert Sebastian Gerus (17:05 01-07-2006 CEST) +# (arachnist@gmail.com) +# Based on pl_PL.ISO-8859-2 and us.dvorak keymaps. +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '@' nul nul O + 004 '3' '#' nop nop '3' '#' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '[' '{' esc esc '[' '{' esc esc O + 013 ']' '}' gs gs ']' '}' gs gs O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 ''' '"' nop nop ''' '"' nop nop O + 017 ',' '<' nop nop ',' '<' nop nop O + 018 '.' '>' nop nop '.' '>' nop nop O + 019 'p' 'P' dle dle 'p' 'P' dle dle C + 020 'y' 'Y' em em 'y' 'Y' em em C + 021 'f' 'F' ack ack 'f' 'F' ack ack C + 022 'g' 'G' bel bel 'g' 'G' bel bel C + 023 'c' 'C' etx etx 230 198 etx etx C + 024 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 025 'l' 'L' ff ff 179 163 ff ff C + 026 '/' '?' nop nop '/' '?' nop nop O + 027 '=' '+' nop nop '=' '+' nop nop O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 177 161 soh soh C + 031 'o' 'O' si si 243 211 si si C + 032 'e' 'E' enq enq 234 202 enq enq C + 033 'u' 'U' nak nak 'u' 'U' nak nak C + 034 'i' 'I' ht ht 'i' 'I' ht ht C + 035 'd' 'D' eot eot 'd' 'D' eot eot C + 036 'h' 'H' bs bs 'h' 'H' bs bs C + 037 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 038 'n' 'N' so so 241 209 so so C + 039 's' 'S' dc3 dc3 182 166 dc3 dc3 C + 040 '-' '_' us us '-' '_' us us O + 041 '`' '~' nop nop '`' '~' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 ';' ':' nop nop ';' ':' nop nop O + 045 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 046 'j' 'J' nl nl 'j' 'J' nl nl C + 047 'k' 'K' vt vt 'k' 'K' vt vt C + 048 'x' 'X' can can 'x' 'X' can can C + 049 'b' 'B' stx stx 'b' 'B' stx stx C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 'w' 'W' etb etb 'w' 'W' etb etb C + 052 'v' 'V' syn syn 188 172 syn syn C + 053 'z' 'Z' sub sub 191 175 sub sub C + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr cr cr cr cr cr cr O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + Copied: stable/7/share/syscons/keymaps/uk.dvorak.kbd (from r194084, head/share/syscons/keymaps/uk.dvorak.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/syscons/keymaps/uk.dvorak.kbd Fri Jun 19 07:37:37 2009 (r194476, copy of r194084, head/share/syscons/keymaps/uk.dvorak.kbd) @@ -0,0 +1,121 @@ +# $FreeBSD$ +# +# A Dvorak keyboard for UK English +# +# Based on us.dvorak.kbd and uk.iso.kbd, and on the X.org GB layout, Dvorak +# variant. +# +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '"' nul nul '2' '"' nul nul O + 004 '3' 163 nop nop '3' 163 nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '[' '{' esc esc '[' '{' esc esc O + 013 ']' '}' gs gs ']' '}' gs gs O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 ''' '@' nop nop ''' '@' nop nop O + 017 ',' '<' nop nop ',' '<' nop nop O + 018 '.' '>' nop nop '.' '>' nop nop O + 019 'p' 'P' dle dle 'p' 'P' dle dle C + 020 'y' 'Y' em em 'y' 'Y' em em C + 021 'f' 'F' ack ack 'f' 'F' ack ack C + 022 'g' 'G' bel bel 'g' 'G' bel bel C + 023 'c' 'C' etx etx 'c' 'C' etx etx C + 024 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 025 'l' 'L' ff ff 'l' 'L' ff ff C + 026 '/' '?' nop nop '/' '?' nop nop O + 027 '=' '+' nop nop '=' '+' nop nop O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 'o' 'O' si si 'o' 'O' si si C + 032 'e' 'E' enq enq 'e' 'E' enq enq C + 033 'u' 'U' nak nak 'u' 'U' nak nak C + 034 'i' 'I' ht ht 'i' 'I' ht ht C + 035 'd' 'D' eot eot 'd' 'D' eot eot C + 036 'h' 'H' bs bs 'h' 'H' bs bs C + 037 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 038 'n' 'N' so so 'n' 'N' so so C + 039 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 040 '-' '_' us us '-' '_' us us O + 041 '`' '~' nop nop '`' 172 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '#' '~' fs fs '#' '~' fs fs O + 044 ';' ':' nop nop ';' ':' nop nop O + 045 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 046 'j' 'J' nl nl 'j' 'J' nl nl C + 047 'k' 'K' vt vt 'k' 'K' vt vt C + 048 'x' 'X' can can 'x' 'X' can can C + 049 'b' 'B' stx stx 'b' 'B' stx stx C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 'w' 'W' etb etb 'w' 'W' etb etb C + 052 'v' 'V' syn syn 'v' 'V' syn syn C + 053 'z' 'Z' sub sub 'z' 'Z' sub sub C + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '\' '|' fs fs '\' '|' fs fs O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + + From edwin at FreeBSD.org Fri Jun 19 07:42:50 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Fri Jun 19 07:43:01 2009 Subject: svn commit: r194477 - stable/7/share/mklocale Message-ID: <200906190742.n5J7gn1b034876@svn.freebsd.org> Author: edwin Date: Fri Jun 19 07:42:49 2009 New Revision: 194477 URL: http://svn.freebsd.org/changeset/base/194477 Log: MFC of 194085 Fix printing of some wide-characters by iswprint() on ja_JP.eucJP and ja_JP.SJIS locale The iswprint() function does not return non-zero if used for some wide-character that it code was 0x824f-0x8258 on ja_JP.SJIS and 0xa3b0-0xa3b9 on ja_JP.eucJP locale. But those are right Japanese wide-character code. PR: conf/124511 Submitted by: Michihiro NAKAJIMA Modified: stable/7/share/mklocale/ (props changed) stable/7/share/mklocale/ja_JP.SJIS.src stable/7/share/mklocale/ja_JP.eucJP.src Modified: stable/7/share/mklocale/ja_JP.SJIS.src ============================================================================== --- stable/7/share/mklocale/ja_JP.SJIS.src Fri Jun 19 07:37:37 2009 (r194476) +++ stable/7/share/mklocale/ja_JP.SJIS.src Fri Jun 19 07:42:49 2009 (r194477) @@ -80,7 +80,7 @@ PUNCT 0x819f-0x81ac 0x81b8-0x81bf 0x81c PUNCT 0x81f0-0x81f7 0x81fc /* 300 */ -/* ?DIGIT 0x824f-0x8258 */ +PRINT 0x824f-0x8258 */ /* ?XDIGIT 0x8260-0x8265 0x8281-0x8286 */ ALPHA 0x8260-0x8279 0x8281-0x829a UPPER 0x8260-0x8279 Modified: stable/7/share/mklocale/ja_JP.eucJP.src ============================================================================== --- stable/7/share/mklocale/ja_JP.eucJP.src Fri Jun 19 07:37:37 2009 (r194476) +++ stable/7/share/mklocale/ja_JP.eucJP.src Fri Jun 19 07:42:49 2009 (r194477) @@ -54,7 +54,7 @@ SPECIAL 0xa2f2 - 0xa2f9 0xa2fe SWIDTH2 0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2ea SWIDTH2 0xa2f2 - 0xa2f9 0xa2fe -/* ?DIGIT 0xa3b0 - 0xa3b9 */ +PRINT 0xa3b0 - 0xa3b9 UPPER 0xa3c1 - 0xa3da /* Romaji */ LOWER 0xa3e1 - 0xa3fa /* Romaji */ SWIDTH2 0xa3b0 - 0xa3b9 /* Zenkaku Digit */ From edwin at FreeBSD.org Fri Jun 19 07:46:21 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Fri Jun 19 07:46:28 2009 Subject: svn commit: r194478 - in stable/7: etc share/termcap Message-ID: <200906190746.n5J7kKdw035022@svn.freebsd.org> Author: edwin Date: Fri Jun 19 07:46:20 2009 New Revision: 194478 URL: http://svn.freebsd.org/changeset/base/194478 Log: MFC of 194088 Fix typo in cons25l7 definition in etc/termcap.small and share/termcap There is a minor typo in the cons25l7 (':' instead of '|') entry in src/etc/termcap.small that causes syscons to complain about bogus characters in /etc/termcap.db. PR: conf/132777 Submitted by: Nikos Ntarmos Modified: stable/7/etc/termcap.small (contents, props changed) stable/7/share/termcap/ (props changed) stable/7/share/termcap/termcap.src Modified: stable/7/etc/termcap.small ============================================================================== --- stable/7/etc/termcap.small Fri Jun 19 07:42:49 2009 (r194477) +++ stable/7/etc/termcap.small Fri Jun 19 07:46:20 2009 (r194478) @@ -138,7 +138,7 @@ cons60l1|cons60-iso8859-1:\ cons60l1-m|cons60-iso8859-1-mono:\ :li#60:tc=cons25l1-m: # ISO 8859-7 FreeBSD console with ACS support -cons25l7:cons25-iso8859-7:\ +cons25l7|cons25-iso8859-7:\ :ac=f\260g\261{\360}\243+\253,\273i\247:\ :tc=cons25w: cons25l7-m|cons25-iso8859-7-mono:\ Modified: stable/7/share/termcap/termcap.src ============================================================================== --- stable/7/share/termcap/termcap.src Fri Jun 19 07:42:49 2009 (r194477) +++ stable/7/share/termcap/termcap.src Fri Jun 19 07:46:20 2009 (r194478) @@ -2390,7 +2390,7 @@ cons60l1|cons60-iso8859-1:\ cons60l1-m|cons60-iso8859-1-mono:\ :li#60:tc=cons25l1-m: # 132x25 ISO 8859-1 FreeBSD console -cons25l1-w|:cons25w-iso8859-1:\ +cons25l1-w|cons25w-iso8859-1:\ :co#132:tc=cons25l1: cons30l1-w|cons30w-iso8859-1:\ :co#132:tc=cons30l1: @@ -2401,7 +2401,7 @@ cons50l1-w|cons50w-iso8859-1:\ cons60l1-w|cons60w-iso8859-1:\ :co#132:tc=cons60l1: # ISO 8859-7 FreeBSD console with ACS support -cons25l7:cons25-iso8859-7:\ +cons25l7|cons25-iso8859-7:\ :ac=f\260g\261{\360}\243+\253,\273i\247:\ :tc=cons25w: cons25l7-m|cons25-iso8859-7-mono:\ From edwin at FreeBSD.org Fri Jun 19 11:28:58 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Fri Jun 19 11:29:16 2009 Subject: svn commit: r194482 - stable/7/share/zoneinfo Message-ID: <200906191128.n5JBSvA4041993@svn.freebsd.org> Author: edwin Date: Fri Jun 19 11:28:57 2009 New Revision: 194482 URL: http://svn.freebsd.org/changeset/base/194482 Log: MFV of tzdata2009i: - Fix beginning of DST of Bangladesh Modified: stable/7/share/zoneinfo/ (props changed) stable/7/share/zoneinfo/asia Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Fri Jun 19 11:23:47 2009 (r194481) +++ stable/7/share/zoneinfo/asia Fri Jun 19 11:28:57 2009 (r194482) @@ -1,5 +1,5 @@ #
-# @(#)asia	8.34
+# @(#)asia	8.35
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -165,9 +165,12 @@ Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# 
 # http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
 # 
 
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Bang	2009	only	-	Jan	1	0:00	0	-
-Rule	Bang	2009	only	-	Jun	20	0:00	1:00	S
+# From A. N. M. Kamrus Saadat (2009-06-15):
+# Finally we've got the official mail regarding DST start time where DST start 
+# time is mentioned as Jun 19 2009, 23:00 from BTRC (Bangladesh 
+# Telecommunication Regulatory Commission). 
+#
+# No DST end date has been announced yet.
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
@@ -176,8 +179,8 @@ Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:30	-	IST	1942 Sep
 			6:30	-	BURT	1951 Sep 30
 			6:00	-	DACT	1971 Mar 26 # Dacca Time
-			6:00	-	BDT	2009 # Bangladesh Time
-			6:00	Bang	BD%sT
+			6:00	-	BDT	2009 Jun 19 23:00 # Bangladesh Time
+			6:00	1:00	BDST
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
From bz at FreeBSD.org  Fri Jun 19 15:31:41 2009
From: bz at FreeBSD.org (Bjoern A. Zeeb)
Date: Fri Jun 19 15:31:58 2009
Subject: svn commit: r194492 - in stable/7/sys: . conf contrib/pf
Message-ID: <200906191531.n5JFVe2K047228@svn.freebsd.org>

Author: bz
Date: Fri Jun 19 15:31:40 2009
New Revision: 194492
URL: http://svn.freebsd.org/changeset/base/194492

Log:
  MFC: r187413,187486,190514
  
    Reduce the impact of svnversion.  Just scan the src/sys tree,
    not all of src.
  
    Initially done by peter in 183528, backed out in 183566 due to
    problems with newvers.sh also called from other places during
    world build.  Those two commits were not MFCed.
  
    A working solution was put back in in the MFCed r190514.
  
    Also strip the machine arch from SRCDIR in case it is a cross
    build so svnversion works, done by thompsa r187413,187486.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/conf/newvers.sh
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/conf/newvers.sh
==============================================================================
--- stable/7/sys/conf/newvers.sh	Fri Jun 19 13:08:49 2009	(r194491)
+++ stable/7/sys/conf/newvers.sh	Fri Jun 19 15:31:40 2009	(r194492)
@@ -91,13 +91,22 @@ for dir in /bin /usr/bin /usr/local/bin;
 	if [ -x "${dir}/svnversion" ]; then
 		svnversion=${dir}/svnversion
 		SRCDIR=${d##*obj}
+		if [ -n "$MACHINE" ]; then
+			SRCDIR=${SRCDIR##/$MACHINE}
+		fi
 		SRCDIR=${SRCDIR%%/sys/*}
 		break
 	fi
 done
 
 if [ -n "$svnversion" -a -d "${SRCDIR}/.svn" ] ; then
-	svn=" r`cd $SRCDIR && $svnversion`"
+	# If we are called from the kernel build, limit
+	# the scope of svnversion to sys/ .
+	if [ -e "${SRCDIR}/sys/conf/newvers.sh" ] ; then
+		svn=" r`cd $SRCDIR/sys && $svnversion`"
+	else
+		svn=" r`cd $SRCDIR && $svnversion`"
+	fi
 else
 	svn=""
 fi
From stas at FreeBSD.org  Fri Jun 19 16:27:42 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Fri Jun 19 16:27:56 2009
Subject: svn commit: r194495 - in stable/7/sys: . contrib/pf gnu/fs/ext2fs
Message-ID: <200906191627.n5JGRfsk048501@svn.freebsd.org>

Author: stas
Date: Fri Jun 19 16:27:41 2009
New Revision: 194495
URL: http://svn.freebsd.org/changeset/base/194495

Log:
  - MFC r187395-187397,193377,193382,193390,193628.
    Add support for inode sizes other than 128 bytes.
    Cleanup.

Deleted:
  stable/7/sys/gnu/fs/ext2fs/sparc64-bitops.h
Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/gnu/fs/ext2fs/ext2_fs.h
  stable/7/sys/gnu/fs/ext2fs/ext2_fs_sb.h
  stable/7/sys/gnu/fs/ext2fs/ext2_inode.c
  stable/7/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
  stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c
  stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c
  stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c

Modified: stable/7/sys/gnu/fs/ext2fs/ext2_fs.h
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_fs.h	Fri Jun 19 15:58:24 2009	(r194494)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_fs.h	Fri Jun 19 16:27:41 2009	(r194495)
@@ -52,6 +52,8 @@
 #define umode_t mode_t
 #define loff_t  off_t
 
+#define	cpu_to_le32(x)	htole32(x)
+
 /*
  * The second extended filesystem constants/structures
  */
@@ -87,12 +89,10 @@
 #endif
 
 /*
- * Special inodes numbers
+ * Special inode numbers
  */
 #define	EXT2_BAD_INO		 1	/* Bad blocks inode */
 #define EXT2_ROOT_INO		 2	/* Root inode */
-#define EXT2_ACL_IDX_INO	 3	/* ACL inode */
-#define EXT2_ACL_DATA_INO	 4	/* ACL inode */
 #define EXT2_BOOT_LOADER_INO	 5	/* Boot loader inode */
 #define EXT2_UNDEL_DIR_INO	 6	/* Undelete directory inode */
 
@@ -104,17 +104,29 @@
  */
 #define EXT2_SUPER_MAGIC	0xEF53
 
+#ifdef __KERNEL__
+#include 
+static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
+{
+	return sb->s_fs_info;
+}
+#elif defined(_KERNEL)
 /*
- * Maximal count of links to a file
+ * FreeBSD passes the pointer to the in-core struct with relevant
+ * fields to EXT2_SB macro when accessing superblock fields.
  */
-#define EXT2_LINK_MAX		32000
+#define EXT2_SB(sb)	(sb)
+#else
+/* Assume that user mode programs are passing in an ext2fs superblock, not
+ * a kernel struct super_block.  This will allow us to call the feature-test
+ * macros from user land. */
+#define EXT2_SB(sb)	(sb)
+#endif
 
 /*
- * Note: under FreeBSD, the "user" versions of the following macros are
- * used (and must be used) in most cases, because ((s)->u.ext2_sb.s_es is
- * not accessible.  This depends on __KERNEL__ not being defined for
- * kernel builds under FreeBSD.
+ * Maximal count of links to a file
  */
+#define EXT2_LINK_MAX		32000
 
 /*
  * Macro-instructions used to manage several block sizes
@@ -122,23 +134,22 @@
 #define EXT2_MIN_BLOCK_SIZE		1024
 #define	EXT2_MAX_BLOCK_SIZE		4096
 #define EXT2_MIN_BLOCK_LOG_SIZE		  10
-#if defined(__KERNEL__) || (defined(__FreeBSD__) && defined(_KERNEL))
+#if defined(__KERNEL__) || defined(_KERNEL)
 # define EXT2_BLOCK_SIZE(s)		((s)->s_blocksize)
 #else
 # define EXT2_BLOCK_SIZE(s)		(EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
 #endif
-#define EXT2_ACLE_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_acl_entry))
 #define	EXT2_ADDR_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (__u32))
-#ifdef __KERNEL__
+#if defined(__KERNEL__) || defined(_KERNEL)
 # define EXT2_BLOCK_SIZE_BITS(s)	((s)->s_blocksize_bits)
 #else
 # define EXT2_BLOCK_SIZE_BITS(s)	((s)->s_log_block_size + 10)
 #endif
-#ifdef notyet
-#ifdef __KERNEL__
-#define	EXT2_ADDR_PER_BLOCK_BITS(s)	((s)->u.ext2_sb.s_addr_per_block_bits)
-#define EXT2_INODE_SIZE(s)		((s)->u.ext2_sb.s_inode_size)
-#define EXT2_FIRST_INO(s)		((s)->u.ext2_sb.s_first_ino)
+#if defined(__KERNEL__) || defined(_KERNEL)
+#define	EXT2_ADDR_PER_BLOCK_BITS(s)	(EXT2_SB(s)->s_addr_per_block_bits)
+#define EXT2_INODE_SIZE(s)		(EXT2_SB(s)->s_inode_size)
+#define EXT2_FIRST_INO(s)		(EXT2_SB(s)->s_first_ino)
+#define	EXT2_INODES_PER_BLOCK(s)	((s)->s_inodes_per_block)
 #else
 #define EXT2_INODE_SIZE(s)	(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
 				 EXT2_GOOD_OLD_INODE_SIZE : \
@@ -147,12 +158,6 @@
 				 EXT2_GOOD_OLD_FIRST_INO : \
 				 (s)->s_first_ino)
 #endif
-#else /* !notyet */
-#define	EXT2_INODES_PER_BLOCK(s)	((s)->s_inodes_per_block)
-/* Should be sizeof(struct ext2_inode): */
-#define EXT2_INODE_SIZE			128
-#define EXT2_FIRST_INO			11
-#endif /* notyet */
 
 /*
  * Macro-instructions used to manage fragments
@@ -160,15 +165,11 @@
 #define EXT2_MIN_FRAG_SIZE		1024
 #define	EXT2_MAX_FRAG_SIZE		4096
 #define EXT2_MIN_FRAG_LOG_SIZE		  10
-#ifdef __KERNEL__
-# define EXT2_FRAG_SIZE(s)		((s)->u.ext2_sb.s_frag_size)
-# define EXT2_FRAGS_PER_BLOCK(s)	((s)->u.ext2_sb.s_frags_per_block)
+#if defined(__KERNEL__) || defined(_KERNEL)
+# define EXT2_FRAG_SIZE(s)		(EXT2_SB(s)->s_frag_size)
+# define EXT2_FRAGS_PER_BLOCK(s)	(EXT2_SB(s)->s_frags_per_block)
 #else
-# if defined(_KERNEL) && defined(__FreeBSD__)
-# define EXT2_FRAG_SIZE(s)		((s)->s_frag_size)
-# else
 # define EXT2_FRAG_SIZE(s)		(EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
-# endif
 # define EXT2_FRAGS_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))
 #endif
 
@@ -212,11 +213,11 @@ struct ext2_group_desc
 /*
  * Macro-instructions used to manage group descriptors
  */
-#ifdef __KERNEL__
-# define EXT2_BLOCKS_PER_GROUP(s)	((s)->u.ext2_sb.s_blocks_per_group)
-# define EXT2_DESC_PER_BLOCK(s)		((s)->u.ext2_sb.s_desc_per_block)
-# define EXT2_INODES_PER_GROUP(s)	((s)->u.ext2_sb.s_inodes_per_group)
-# define EXT2_DESC_PER_BLOCK_BITS(s)	((s)->u.ext2_sb.s_desc_per_block_bits)
+#if defined(__KERNEL__) || defined(_KERNEL)
+# define EXT2_BLOCKS_PER_GROUP(s)	(EXT2_SB(s)->s_blocks_per_group)
+# define EXT2_DESC_PER_BLOCK(s)		(EXT2_SB(s)->s_desc_per_block)
+# define EXT2_INODES_PER_GROUP(s)	(EXT2_SB(s)->s_inodes_per_group)
+# define EXT2_DESC_PER_BLOCK_BITS(s)	(EXT2_SB(s)->s_desc_per_block_bits)
 #else
 # define EXT2_BLOCKS_PER_GROUP(s)	((s)->s_blocks_per_group)
 # define EXT2_DESC_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
@@ -366,7 +367,7 @@ struct ext2_inode {
 
 #define clear_opt(o, opt)		o &= ~EXT2_MOUNT_##opt
 #define set_opt(o, opt)			o |= EXT2_MOUNT_##opt
-#define test_opt(sb, opt)		((sb)->u.ext2_sb.s_mount_opt & \
+#define test_opt(sb, opt)		(EXT2_SB(sb)->s_mount_opt & \
 					 EXT2_MOUNT_##opt)
 /*
  * Maximal mount counts between two filesystem checks
@@ -444,15 +445,6 @@ struct ext2_super_block {
 	__u32	s_reserved[204];	/* Padding to the end of the block */
 };
 
-#ifdef __KERNEL__
-#define EXT2_SB(sb)	(&((sb)->u.ext2_sb))
-#else
-/* Assume that user mode programs are passing in an ext2fs superblock, not
- * a kernel struct super_block.  This will allow us to call the feature-test
- * macros from user land. */
-#define EXT2_SB(sb)	(sb)
-#endif
-
 /*
  * Codes for operating systems
  */
@@ -478,11 +470,11 @@ struct ext2_super_block {
  */
 
 #define EXT2_HAS_COMPAT_FEATURE(sb,mask)			\
-	( EXT2_SB(sb)->s_feature_compat & (mask) )
+	( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
 #define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask)			\
-	( EXT2_SB(sb)->s_feature_ro_compat & (mask) )
+	( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
 #define EXT2_HAS_INCOMPAT_FEATURE(sb,mask)			\
-	( EXT2_SB(sb)->s_feature_incompat & (mask) )
+	( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
 
 #define EXT2_FEATURE_COMPAT_DIR_PREALLOC	0x0001
 

Modified: stable/7/sys/gnu/fs/ext2fs/ext2_fs_sb.h
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_fs_sb.h	Fri Jun 19 15:58:24 2009	(r194494)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_fs_sb.h	Fri Jun 19 16:27:41 2009	(r194495)
@@ -60,7 +60,7 @@ struct ext2_sb_info {
 	unsigned long s_blocks_per_group;/* Number of blocks in a group */
 	unsigned long s_inodes_per_group;/* Number of inodes in a group */
 	unsigned long s_itb_per_group;	/* Number of inode table blocks per group */
-	unsigned long s_db_per_group;	/* Number of descriptor blocks per group */
+	unsigned long s_gdb_count;	/* Number of group descriptor blocks */
 	unsigned long s_desc_per_block;	/* Number of group descriptors per block */
 	unsigned long s_groups_count;	/* Number of groups in the fs */
 	struct buffer_head * s_sbh;	/* Buffer containing the super block */
@@ -72,10 +72,13 @@ struct ext2_sb_info {
 	struct buffer_head * s_inode_bitmap[EXT2_MAX_GROUP_LOADED];
 	unsigned long s_block_bitmap_number[EXT2_MAX_GROUP_LOADED];
 	struct buffer_head * s_block_bitmap[EXT2_MAX_GROUP_LOADED];
-	int s_rename_lock;
 	unsigned long  s_mount_opt;
-	unsigned short s_resuid;
-	unsigned short s_resgid;
+#ifdef notyet
+	uid_t s_resuid;
+	gid_t s_resgid;
+#endif
+	unsigned short s_inode_size;
+	unsigned int s_first_ino;
 	unsigned short s_mount_state;
 	/* 
 	   stuff that FFS keeps in its super block or that linux

Modified: stable/7/sys/gnu/fs/ext2fs/ext2_inode.c
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_inode.c	Fri Jun 19 15:58:24 2009	(r194494)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_inode.c	Fri Jun 19 16:27:41 2009	(r194495)
@@ -91,7 +91,7 @@ ext2_update(vp, waitfor)
 		return (error);
 	}
 	ext2_i2ei(ip, (struct ext2_inode *)((char *)bp->b_data +
-	    EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number)));
+	    EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)));
 	if (waitfor && (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) == 0)
 		return (bwrite(bp));
 	else {

Modified: stable/7/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c	Fri Jun 19 15:58:24 2009	(r194494)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c	Fri Jun 19 16:27:41 2009	(r194495)
@@ -225,7 +225,7 @@ void ext2_free_inode (struct inode * ino
 
 	sb = inode->i_e2fs;
 	lock_super (DEVVP(inode));
-	if (inode->i_number < EXT2_FIRST_INO ||
+	if (inode->i_number < EXT2_FIRST_INO(sb) ||
 	    inode->i_number > sb->s_es->s_inodes_count) {
 		printf ("free_inode reserved inode or nonexistent inode");
 		unlock_super (DEVVP(inode));
@@ -435,7 +435,7 @@ repeat:
 		goto repeat;
 	}
 	j += i * EXT2_INODES_PER_GROUP(sb) + 1;
-	if (j < EXT2_FIRST_INO || j > es->s_inodes_count) {
+	if (j < EXT2_FIRST_INO(sb) || j > es->s_inodes_count) {
 		printf ( "ext2_new_inode:"
 			    "reserved inode or inode > inodes count - "
 			    "block_group = %d,inode=%d", i, j);

Modified: stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c	Fri Jun 19 15:58:24 2009	(r194494)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_lookup.c	Fri Jun 19 16:27:41 2009	(r194495)
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -772,7 +773,7 @@ ext2_direnter(ip, dvp, cnp)
 	dp = VTOI(dvp);
 	newdir.inode = ip->i_number;
 	newdir.name_len = cnp->cn_namelen;
-	if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es,
+	if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs,
 	    EXT2_FEATURE_INCOMPAT_FILETYPE))
 		newdir.file_type = DTTOFT(IFTODT(ip->i_mode));
 	else
@@ -950,7 +951,7 @@ ext2_dirrewrite(dp, ip, cnp)
 	    &bp)) != 0)
 		return (error);
 	ep->inode = ip->i_number;
-	if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs->s_es,
+	if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs,
 	    EXT2_FEATURE_INCOMPAT_FILETYPE))
 		ep->file_type = DTTOFT(IFTODT(ip->i_mode));
 	else

Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c	Fri Jun 19 15:58:24 2009	(r194494)
+++ stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c	Fri Jun 19 16:27:41 2009	(r194495)
@@ -5,7 +5,7 @@
  *  University of Utah, Department of Computer Science
  */
 /*-
- * Copyright (c) 1989, 1991, 1993, 1994	
+ * Copyright (c) 1989, 1991, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -78,13 +78,13 @@
 
 #include 
 #include 
-#include 
 #include 
+#include 
 
-static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td);
-static int ext2_mountfs(struct vnode *, struct mount *, struct thread *);
-static int ext2_reload(struct mount *mp, struct thread *td);
-static int ext2_sbupdate(struct ext2mount *, int);
+static int	ext2_flushfiles(struct mount *mp, int flags, struct thread *td);
+static int	ext2_mountfs(struct vnode *, struct mount *, struct thread *);
+static int	ext2_reload(struct mount *mp, struct thread *td);
+static int	ext2_sbupdate(struct ext2mount *, int);
 
 static vfs_unmount_t		ext2_unmount;
 static vfs_root_t		ext2_root;
@@ -109,9 +109,6 @@ static struct vfsops ext2fs_vfsops = {
 
 VFS_SET(ext2fs_vfsops, ext2fs, 0);
 
-#define bsd_malloc malloc
-#define bsd_free free
-
 static int	ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev,
 		    int ronly);
 static int	compute_sb_data(struct vnode * devvp,
@@ -120,25 +117,23 @@ static int	compute_sb_data(struct vnode 
 static const char *ext2_opts[] = { "from", "export", "acls", "noexec",
     "noatime", "union", "suiddir", "multilabel", "nosymfollow",
     "noclusterr", "noclusterw", "force", NULL };
- 
+
 /*
  * VFS Operations.
  *
  * mount system call
  */
 static int
-ext2_mount(mp, td)
-	struct mount *mp;
-	struct thread *td;
+ext2_mount(struct mount *mp, struct thread *td)
 {
 	struct vfsoptlist *opts;
 	struct vnode *devvp;
 	struct ext2mount *ump = 0;
 	struct ext2_sb_info *fs;
+	struct nameidata nd, *ndp = &nd;
+	mode_t accessmode;
 	char *path, *fspec;
 	int error, flags, len;
-	mode_t accessmode;
-	struct nameidata nd, *ndp = &nd;
 
 	opts = mp->mnt_optnew;
 
@@ -195,6 +190,7 @@ ext2_mount(mp, td)
 		if (fs->s_rd_only && !vfs_flagopt(opts, "ro", NULL, 0)) {
 			if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev, 0))
 				return (EPERM);
+
 			/*
 			 * If upgrade to read-write by non-root, then verify
 			 * that user has necessary permissions on the device.
@@ -221,8 +217,7 @@ ext2_mount(mp, td)
 			    (fs->s_es->s_state & EXT2_ERROR_FS)) {
 				if (mp->mnt_flag & MNT_FORCE) {
 					printf(
-"WARNING: %s was not properly dismounted\n",
-					    fs->fs_fsmnt);
+"WARNING: %s was not properly dismounted\n", fs->fs_fsmnt);
 				} else {
 					printf(
 "WARNING: R/W mount of %s denied.  Filesystem is not clean - run fsck\n",
@@ -242,6 +237,7 @@ ext2_mount(mp, td)
 			return (error);
 		}
 	}
+
 	/*
 	 * Not an update, or updating the name: look up the name
 	 * and verify that it refers to a sensible disk device.
@@ -291,6 +287,7 @@ ext2_mount(mp, td)
 	}
 	ump = VFSTOEXT2(mp);
 	fs = ump->um_e2fs;
+
 	/*
 	 * Note that this strncpy() is ok because of a check at the start
 	 * of ext2_mount().
@@ -302,63 +299,55 @@ ext2_mount(mp, td)
 }
 
 /*
- * checks that the data in the descriptor blocks make sense
- * this is taken from ext2/super.c
+ * Checks that the data in the descriptor blocks make sense
+ * this is taken from ext2/super.c.
  */
-static int ext2_check_descriptors (struct ext2_sb_info * sb)
+static int
+ext2_check_descriptors(struct ext2_sb_info *sb)
 {
-        int i;
-        int desc_block = 0;
-        unsigned long block = sb->s_es->s_first_data_block;
-        struct ext2_group_desc * gdp = NULL;
-
-        /* ext2_debug ("Checking group descriptors"); */
+	struct ext2_group_desc *gdp = NULL;
+	unsigned long block = sb->s_es->s_first_data_block;
+	int desc_block = 0;
+	int i;
 
-        for (i = 0; i < sb->s_groups_count; i++)
-        {
+	for (i = 0; i < sb->s_groups_count; i++) {
 		/* examine next descriptor block */
-                if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0)
-                        gdp = (struct ext2_group_desc *) 
-				sb->s_group_desc[desc_block++]->b_data;
-                if (gdp->bg_block_bitmap < block ||
-                    gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb))
-                {
-                        printf ("ext2_check_descriptors: "
-                                    "Block bitmap for group %d"
-                                    " not in group (block %lu)!\n",
-                                    i, (unsigned long) gdp->bg_block_bitmap);
-                        return 0;
-                }
-                if (gdp->bg_inode_bitmap < block ||
-                    gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb))
-                {
-                        printf ("ext2_check_descriptors: "
-                                    "Inode bitmap for group %d"
-                                    " not in group (block %lu)!\n",
-                                    i, (unsigned long) gdp->bg_inode_bitmap);
-                        return 0;
-                }
-                if (gdp->bg_inode_table < block ||
-                    gdp->bg_inode_table + sb->s_itb_per_group >=
-                    block + EXT2_BLOCKS_PER_GROUP(sb))
-                {
-                        printf ("ext2_check_descriptors: "
-                                    "Inode table for group %d"
-                                    " not in group (block %lu)!\n",
-                                    i, (unsigned long) gdp->bg_inode_table);
-                        return 0;
-                }
-                block += EXT2_BLOCKS_PER_GROUP(sb);
-                gdp++;
-        }
-        return 1;
+		if ((i % EXT2_DESC_PER_BLOCK(sb)) == 0)
+			gdp = (struct ext2_group_desc *)
+			    sb->s_group_desc[desc_block++]->b_data;
+		if (gdp->bg_block_bitmap < block ||
+		    gdp->bg_block_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) {
+			printf ("ext2_check_descriptors: "
+			    "Block bitmap for group %d"
+			    " not in group (block %lu)!\n",
+			    i, (unsigned long) gdp->bg_block_bitmap);
+			return (0);
+		}
+		if (gdp->bg_inode_bitmap < block ||
+		    gdp->bg_inode_bitmap >= block + EXT2_BLOCKS_PER_GROUP(sb)) {
+			printf ("ext2_check_descriptors: "
+			    "Inode bitmap for group %d"
+			    " not in group (block %lu)!\n",
+			    i, (unsigned long) gdp->bg_inode_bitmap);
+			return (0);
+		}
+		if (gdp->bg_inode_table < block ||
+		    gdp->bg_inode_table + sb->s_itb_per_group >=
+		    block + EXT2_BLOCKS_PER_GROUP(sb)) {
+			printf ("ext2_check_descriptors: "
+			    "Inode table for group %d"
+			    " not in group (block %lu)!\n",
+			    i, (unsigned long) gdp->bg_inode_table);
+			return (0);
+		}
+		block += EXT2_BLOCKS_PER_GROUP(sb);
+		gdp++;
+	}
+	return (1);
 }
 
 static int
-ext2_check_sb_compat(es, dev, ronly)
-	struct ext2_super_block *es;
-	struct cdev *dev;
-	int ronly;
+ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev, int ronly)
 {
 
 	if (es->s_magic != EXT2_SUPER_MAGIC) {
@@ -375,9 +364,8 @@ ext2_check_sb_compat(es, dev, ronly)
 		}
 		if (!ronly &&
 		    (es->s_feature_ro_compat & ~EXT2_FEATURE_RO_COMPAT_SUPP)) {
-			printf(
-"WARNING: R/W mount of %s denied due to unsupported optional features\n",
-			    devtoname(dev));
+			printf("WARNING: R/W mount of %s denied due to "
+			    "unsupported optional features\n", devtoname(dev));
 			return (1);
 		}
 	}
@@ -385,107 +373,101 @@ ext2_check_sb_compat(es, dev, ronly)
 }
 
 /*
- * this computes the fields of the  ext2_sb_info structure from the
- * data in the ext2_super_block structure read in
+ * This computes the fields of the  ext2_sb_info structure from the
+ * data in the ext2_super_block structure read in.
  */
-static int compute_sb_data(devvp, es, fs)
-	struct vnode * devvp;
-	struct ext2_super_block * es;
-	struct ext2_sb_info * fs;
+static int
+compute_sb_data(struct vnode *devvp, struct ext2_super_block *es,
+    struct ext2_sb_info *fs)
 {
-    int db_count, error;
-    int i, j;
-    int logic_sb_block = 1;	/* XXX for now */
-
-#if 1
-#define V(v)  
-#else
-#define V(v)  printf(#v"= %d\n", fs->v);
-#endif
+	int db_count, error;
+	int i, j;
+	int logic_sb_block = 1;	/* XXX for now */
+
+	fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size;
+	fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size;
+	fs->s_fsbtodb = es->s_log_block_size + 1;
+	fs->s_qbmask = fs->s_blocksize - 1;
+	fs->s_blocksize_bits = es->s_log_block_size + 10;
+	fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size;
+	if (fs->s_frag_size)
+		fs->s_frags_per_block = fs->s_blocksize / fs->s_frag_size;
+	fs->s_blocks_per_group = es->s_blocks_per_group;
+	fs->s_frags_per_group = es->s_frags_per_group;
+	fs->s_inodes_per_group = es->s_inodes_per_group;
+	if (es->s_rev_level == EXT2_GOOD_OLD_REV) {
+		fs->s_first_ino = EXT2_GOOD_OLD_FIRST_INO;
+		fs->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE;
+	} else {
+		fs->s_first_ino = es->s_first_ino;
+		fs->s_inode_size = es->s_inode_size;
 
-    fs->s_blocksize = EXT2_MIN_BLOCK_SIZE << es->s_log_block_size; 
-    V(s_blocksize)
-    fs->s_bshift = EXT2_MIN_BLOCK_LOG_SIZE + es->s_log_block_size;
-    V(s_bshift)
-    fs->s_fsbtodb = es->s_log_block_size + 1;
-    V(s_fsbtodb)
-    fs->s_qbmask = fs->s_blocksize - 1;
-    V(s_bmask)
-    fs->s_blocksize_bits = EXT2_BLOCK_SIZE_BITS(es);
-    V(s_blocksize_bits)
-    fs->s_frag_size = EXT2_MIN_FRAG_SIZE << es->s_log_frag_size;
-    V(s_frag_size)
-    if (fs->s_frag_size)
-	fs->s_frags_per_block = fs->s_blocksize / fs->s_frag_size;
-    V(s_frags_per_block)
-    fs->s_blocks_per_group = es->s_blocks_per_group;
-    V(s_blocks_per_group)
-    fs->s_frags_per_group = es->s_frags_per_group;
-    V(s_frags_per_group)
-    fs->s_inodes_per_group = es->s_inodes_per_group;
-    V(s_inodes_per_group)
-    fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE;
-    V(s_inodes_per_block)
-    fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block;
-    V(s_itb_per_group)
-    fs->s_desc_per_block = fs->s_blocksize / sizeof (struct ext2_group_desc);
-    V(s_desc_per_block)
-    /* s_resuid / s_resgid ? */
-    fs->s_groups_count = (es->s_blocks_count -
-			  es->s_first_data_block +
-			  EXT2_BLOCKS_PER_GROUP(fs) - 1) /
-			 EXT2_BLOCKS_PER_GROUP(fs);
-    V(s_groups_count)
-    db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) /
-	EXT2_DESC_PER_BLOCK(fs);
-    fs->s_db_per_group = db_count;
-    V(s_db_per_group)
+		/*
+		 * Simple sanity check for superblock inode size value.
+		 */
+		if (fs->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE ||
+		    fs->s_inode_size > fs->s_blocksize ||
+		    (fs->s_inode_size & (fs->s_inode_size - 1)) != 0) {
+			printf("EXT2-fs: invalid inode size %d\n",
+			    fs->s_inode_size);
+			return (EIO);
+		}
+	}
+	fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs);
+	fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block;
+	fs->s_desc_per_block = fs->s_blocksize / sizeof (struct ext2_group_desc);
+	/* s_resuid / s_resgid ? */
+	fs->s_groups_count = (es->s_blocks_count - es->s_first_data_block +
+	    EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs);
+	db_count = (fs->s_groups_count + EXT2_DESC_PER_BLOCK(fs) - 1) /
+	    EXT2_DESC_PER_BLOCK(fs);
+	fs->s_gdb_count = db_count;
+	fs->s_group_desc = malloc(db_count * sizeof (struct buf *),
+	    M_EXT2MNT, M_WAITOK);
 
-    fs->s_group_desc = bsd_malloc(db_count * sizeof (struct buf *),
-		M_EXT2MNT, M_WAITOK);
+	/*
+	 * Adjust logic_sb_block.
+	 * Godmar thinks: if the blocksize is greater than 1024, then
+	 * the superblock is logically part of block zero.
+	 */
+	if(fs->s_blocksize > SBSIZE)
+		logic_sb_block = 0;
 
-    /* adjust logic_sb_block */
-    if(fs->s_blocksize > SBSIZE) 
-	/* Godmar thinks: if the blocksize is greater than 1024, then
-	   the superblock is logically part of block zero. 
-	 */
-        logic_sb_block = 0;
-    
-    for (i = 0; i < db_count; i++) {
-	error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1), 
-		fs->s_blocksize, NOCRED, &fs->s_group_desc[i]);
-	if(error) {
-	    for (j = 0; j < i; j++)
-		brelse(fs->s_group_desc[j]);
-	    bsd_free(fs->s_group_desc, M_EXT2MNT);
-	    printf("EXT2-fs: unable to read group descriptors (%d)\n", error);
-	    return EIO;
-	}
-	LCK_BUF(fs->s_group_desc[i])
-    }
-    if(!ext2_check_descriptors(fs)) {
-	    for (j = 0; j < db_count; j++)
-		    ULCK_BUF(fs->s_group_desc[j])
-	    bsd_free(fs->s_group_desc, M_EXT2MNT);
-	    printf("EXT2-fs: (ext2_check_descriptors failure) "
-		   "unable to read group descriptors\n");
-	    return EIO;
-    }
-
-    for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) {
-	    fs->s_inode_bitmap_number[i] = 0;
-	    fs->s_inode_bitmap[i] = NULL;
-	    fs->s_block_bitmap_number[i] = 0;
-	    fs->s_block_bitmap[i] = NULL;
-    }
-    fs->s_loaded_inode_bitmaps = 0;
-    fs->s_loaded_block_bitmaps = 0;
-    if (es->s_rev_level == EXT2_GOOD_OLD_REV || (es->s_feature_ro_compat &
-        EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0)
-	fs->fs_maxfilesize = 0x7fffffff;
-    else
-	fs->fs_maxfilesize = 0x7fffffffffffffff;
-    return 0;
+	for (i = 0; i < db_count; i++) {
+		error = bread(devvp , fsbtodb(fs, logic_sb_block + i + 1),
+		    fs->s_blocksize, NOCRED, &fs->s_group_desc[i]);
+		if(error) {
+			for (j = 0; j < i; j++)
+				brelse(fs->s_group_desc[j]);
+			free(fs->s_group_desc, M_EXT2MNT);
+			printf("EXT2-fs: unable to read group descriptors"
+			    " (%d)\n", error);
+			return (EIO);
+		}
+		LCK_BUF(fs->s_group_desc[i])
+	}
+	if(!ext2_check_descriptors(fs)) {
+		for (j = 0; j < db_count; j++)
+			ULCK_BUF(fs->s_group_desc[j])
+		free(fs->s_group_desc, M_EXT2MNT);
+		printf("EXT2-fs: (ext2_check_descriptors failure) "
+		    "unable to read group descriptors\n");
+		return (EIO);
+	}
+	for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++) {
+		fs->s_inode_bitmap_number[i] = 0;
+		fs->s_inode_bitmap[i] = NULL;
+		fs->s_block_bitmap_number[i] = 0;
+		fs->s_block_bitmap[i] = NULL;
+	}
+	fs->s_loaded_inode_bitmaps = 0;
+	fs->s_loaded_block_bitmaps = 0;
+	if (es->s_rev_level == EXT2_GOOD_OLD_REV ||
+	    (es->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_LARGE_FILE) == 0)
+		fs->fs_maxfilesize = 0x7fffffff;
+	else
+		fs->fs_maxfilesize = 0x7fffffffffffffff;
+	return (0);
 }
 
 /*
@@ -507,7 +489,7 @@ ext2_reload(struct mount *mp, struct thr
 	struct vnode *vp, *mvp, *devvp;
 	struct inode *ip;
 	struct buf *bp;
-	struct ext2_super_block * es;
+	struct ext2_super_block *es;
 	struct ext2_sb_info *fs;
 	int error;
 
@@ -538,7 +520,7 @@ ext2_reload(struct mount *mp, struct thr
 
 	if((error = compute_sb_data(devvp, es, fs)) != 0) {
 		brelse(bp);
-		return error;
+		return (error);
 	}
 #ifdef UNKLAR
 	if (fs->fs_sbsize < SBSIZE)
@@ -564,12 +546,12 @@ loop:
 		}
 		if (vinvalbuf(vp, 0, td, 0, 0))
 			panic("ext2_reload: dirty2");
+
 		/*
 		 * Step 5: re-read inode data for all active vnodes.
 		 */
 		ip = VTOI(vp);
-		error =
-		    bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
+		error = bread(devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
 		    (int)fs->s_blocksize, NOCRED, &bp);
 		if (error) {
 			VOP_UNLOCK(vp, 0, td);
@@ -578,7 +560,7 @@ loop:
 			return (error);
 		}
 		ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data +
-		    EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number)), ip);
+		    EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip);
 		brelse(bp);
 		VOP_UNLOCK(vp, 0, td);
 		vrele(vp);
@@ -589,18 +571,15 @@ loop:
 }
 
 /*
- * Common code for mount and mountroot
+ * Common code for mount and mountroot.
  */
 static int
-ext2_mountfs(devvp, mp, td)
-	struct vnode *devvp;
-	struct mount *mp;
-	struct thread *td;
+ext2_mountfs(struct vnode *devvp, struct mount *mp, struct thread *td)
 {
 	struct ext2mount *ump;
 	struct buf *bp;
 	struct ext2_sb_info *fs;
-	struct ext2_super_block * es;
+	struct ext2_super_block *es;
 	struct cdev *dev = devvp->v_rdev;
 	struct g_consumer *cp;
 	struct bufobj *bo;
@@ -658,19 +637,22 @@ ext2_mountfs(devvp, mp, td)
 			goto out;
 		}
 	}
-	ump = bsd_malloc(sizeof *ump, M_EXT2MNT, M_WAITOK);
+	ump = malloc(sizeof *ump, M_EXT2MNT, M_WAITOK);
 	bzero((caddr_t)ump, sizeof *ump);
-	/* I don't know whether this is the right strategy. Note that
-	   we dynamically allocate both an ext2_sb_info and an ext2_super_block
-	   while Linux keeps the super block in a locked buffer
+
+	/*
+	 * I don't know whether this is the right strategy. Note that
+	 * we dynamically allocate both an ext2_sb_info and an ext2_super_block
+	 * while Linux keeps the super block in a locked buffer.
 	 */
-	ump->um_e2fs = bsd_malloc(sizeof(struct ext2_sb_info), 
+	ump->um_e2fs = malloc(sizeof(struct ext2_sb_info),
 		M_EXT2MNT, M_WAITOK);
-	ump->um_e2fs->s_es = bsd_malloc(sizeof(struct ext2_super_block), 
+	ump->um_e2fs->s_es = malloc(sizeof(struct ext2_super_block),
 		M_EXT2MNT, M_WAITOK);
 	bcopy(es, ump->um_e2fs->s_es, (u_int)sizeof(struct ext2_super_block));
 	if ((error = compute_sb_data(devvp, ump->um_e2fs->s_es, ump->um_e2fs)))
 		goto out;
+
 	/*
 	 * We don't free the group descriptors allocated by compute_sb_data()
 	 * until ext2_unmount().  This is OK since the mount will succeed.
@@ -679,8 +661,10 @@ ext2_mountfs(devvp, mp, td)
 	bp = NULL;
 	fs = ump->um_e2fs;
 	fs->s_rd_only = ronly;	/* ronly is set according to mnt_flags */
-	/* if the fs is not mounted read-only, make sure the super block is 
-	   always written back on a sync()
+
+	/*
+	 * If the fs is not mounted read-only, make sure the super block is
+	 * always written back on a sync().
 	 */
 	fs->s_wasvalid = fs->s_es->s_state & EXT2_VALID_FS ? 1 : 0;
 	if (ronly == 0) {
@@ -699,13 +683,15 @@ ext2_mountfs(devvp, mp, td)
 	ump->um_devvp = devvp;
 	ump->um_bo = &devvp->v_bufobj;
 	ump->um_cp = cp;
-	/* setting those two parameters allowed us to use
-	   ufs_bmap w/o changse !
-	*/
+
+	/*
+	 * Setting those two parameters allowed us to use
+	 * ufs_bmap w/o changse!
+	 */
 	ump->um_nindir = EXT2_ADDR_PER_BLOCK(fs);
 	ump->um_bptrtodb = fs->s_es->s_log_block_size + 1;
 	ump->um_seqinc = EXT2_FRAGS_PER_BLOCK(fs);
-	if (ronly == 0) 
+	if (ronly == 0)
 		ext2_sbupdate(ump, MNT_WAIT);
 	return (0);
 out:
@@ -719,22 +705,19 @@ out:
 		PICKUP_GIANT();
 	}
 	if (ump) {
-		bsd_free(ump->um_e2fs->s_es, M_EXT2MNT);
-		bsd_free(ump->um_e2fs, M_EXT2MNT);
-		bsd_free(ump, M_EXT2MNT);
+		free(ump->um_e2fs->s_es, M_EXT2MNT);
+		free(ump->um_e2fs, M_EXT2MNT);
+		free(ump, M_EXT2MNT);
 		mp->mnt_data = (qaddr_t)0;
 	}
 	return (error);
 }
 
 /*
- * unmount system call
+ * Unmount system call.
  */
 static int
-ext2_unmount(mp, mntflags, td)
-	struct mount *mp;
-	int mntflags;
-	struct thread *td;
+ext2_unmount(struct mount *mp, int mntflags, struct thread *td)
 {
 	struct ext2mount *ump;
 	struct ext2_sb_info *fs;
@@ -758,18 +741,17 @@ ext2_unmount(mp, mntflags, td)
 	}
 
 	/* release buffers containing group descriptors */
-	for(i = 0; i < fs->s_db_per_group; i++) 
+	for(i = 0; i < fs->s_gdb_count; i++)
 		ULCK_BUF(fs->s_group_desc[i])
-	bsd_free(fs->s_group_desc, M_EXT2MNT);
+	free(fs->s_group_desc, M_EXT2MNT);
 
 	/* release cached inode/block bitmaps */
-        for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++)
-                if (fs->s_inode_bitmap[i])
-			ULCK_BUF(fs->s_inode_bitmap[i])
-
-        for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++)
-                if (fs->s_block_bitmap[i])
-			ULCK_BUF(fs->s_block_bitmap[i])
+	for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++)
+		if (fs->s_inode_bitmap[i])
+		    ULCK_BUF(fs->s_inode_bitmap[i])
+	for (i = 0; i < EXT2_MAX_GROUP_LOADED; i++)
+		if (fs->s_block_bitmap[i])
+		    ULCK_BUF(fs->s_block_bitmap[i])
 
 	DROP_GIANT();
 	g_topology_lock();
@@ -777,9 +759,9 @@ ext2_unmount(mp, mntflags, td)
 	g_topology_unlock();
 	PICKUP_GIANT();
 	vrele(ump->um_devvp);
-	bsd_free(fs->s_es, M_EXT2MNT);
-	bsd_free(fs, M_EXT2MNT);
-	bsd_free(ump, M_EXT2MNT);
+	free(fs->s_es, M_EXT2MNT);
+	free(fs, M_EXT2MNT);
+	free(ump, M_EXT2MNT);
 	mp->mnt_data = (qaddr_t)0;
 	MNT_ILOCK(mp);
 	mp->mnt_flag &= ~MNT_LOCAL;
@@ -791,10 +773,7 @@ ext2_unmount(mp, mntflags, td)
  * Flush out all the files in a filesystem.
  */
 static int
-ext2_flushfiles(mp, flags, td)
-	struct mount *mp;
-	int flags;
-	struct thread *td;
+ext2_flushfiles(struct mount *mp, int flags, struct thread *td)
 {
 	int error;
 
@@ -804,18 +783,15 @@ ext2_flushfiles(mp, flags, td)
 
 /*
  * Get file system statistics.
- * taken from ext2/super.c ext2_statfs
+ * taken from ext2/super.c ext2_statfs.
  */
 static int
-ext2_statfs(mp, sbp, td)
-	struct mount *mp;
-	struct statfs *sbp;
-	struct thread *td;
+ext2_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
 {
-        unsigned long overhead;
 	struct ext2mount *ump;
 	struct ext2_sb_info *fs;
 	struct ext2_super_block *es;
+	unsigned long overhead;
 	int i, nsb;
 
 	ump = VFSTOEXT2(mp);
@@ -835,19 +811,19 @@ ext2_statfs(mp, sbp, td)
 				nsb++;
 	} else
 		nsb = fs->s_groups_count;
-	overhead = es->s_first_data_block + 
-	    /* Superblocks and block group descriptors: */
-	    nsb * (1 + fs->s_db_per_group) +
-	    /* Inode bitmap, block bitmap, and inode table: */
-	    fs->s_groups_count * (1 + 1 + fs->s_itb_per_group);
+	overhead = es->s_first_data_block +
+	/* Superblocks and block group descriptors: */
+	nsb * (1 + fs->s_gdb_count) +
+	/* Inode bitmap, block bitmap, and inode table: */
+	fs->s_groups_count * (1 + 1 + fs->s_itb_per_group);
 
-	sbp->f_bsize = EXT2_FRAG_SIZE(fs);	
+	sbp->f_bsize = EXT2_FRAG_SIZE(fs);
 	sbp->f_iosize = EXT2_BLOCK_SIZE(fs);
 	sbp->f_blocks = es->s_blocks_count - overhead;
-	sbp->f_bfree = es->s_free_blocks_count; 
-	sbp->f_bavail = sbp->f_bfree - es->s_r_blocks_count; 
-	sbp->f_files = es->s_inodes_count; 
-	sbp->f_ffree = es->s_free_inodes_count; 
+	sbp->f_bfree = es->s_free_blocks_count;
+	sbp->f_bavail = sbp->f_bfree - es->s_r_blocks_count;
+	sbp->f_files = es->s_inodes_count;
+	sbp->f_ffree = es->s_free_inodes_count;
 	return (0);
 }
 
@@ -859,10 +835,7 @@ ext2_statfs(mp, sbp, td)
  * Note: we are always called with the filesystem marked `MPBUSY'.
  */
 static int
-ext2_sync(mp, waitfor, td)
-	struct mount *mp;
-	int waitfor;
-	struct thread *td;
+ext2_sync(struct mount *mp, int waitfor, struct thread *td)
 {
 	struct vnode *mvp, *vp;
 	struct inode *ip;
@@ -875,6 +848,7 @@ ext2_sync(mp, waitfor, td)
 		printf("fs = %s\n", fs->fs_fsmnt);
 		panic("ext2_sync: rofs mod");
 	}
+
 	/*
 	 * Write back each (modified) inode.
 	 */
@@ -912,6 +886,7 @@ loop:
 		MNT_ILOCK(mp);
 	}
 	MNT_IUNLOCK(mp);
+
 	/*
 	 * Force stale file system control information to be flushed.
 	 */
@@ -921,6 +896,7 @@ loop:
 			allerror = error;
 		VOP_UNLOCK(ump->um_devvp, 0, td);
 	}
+
 	/*
 	 * Write back modified superblock.
 	 */
@@ -940,11 +916,7 @@ loop:
  * done by the calling routine.
  */
 static int
-ext2_vget(mp, ino, flags, vpp)
-	struct mount *mp;
-	ino_t ino;
-	int flags;
-	struct vnode **vpp;
+ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
 {
 	struct ext2_sb_info *fs;
 	struct inode *ip;
@@ -952,9 +924,9 @@ ext2_vget(mp, ino, flags, vpp)
 	struct buf *bp;
 	struct vnode *vp;
 	struct cdev *dev;
+	struct thread *td;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
From jhb at FreeBSD.org  Fri Jun 19 17:07:16 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Fri Jun 19 17:07:28 2009
Subject: svn commit: r194496 - stable/7/share/man/man4
Message-ID: <200906191707.n5JH7GUQ049346@svn.freebsd.org>

Author: jhb
Date: Fri Jun 19 17:07:15 2009
New Revision: 194496
URL: http://svn.freebsd.org/changeset/base/194496

Log:
  MFC: mfi(4) supports the LSI MegaRAID SAS 1078 and Dell PERC6.
  
  PR:		docs/135712

Modified:
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/igb.4   (props changed)
  stable/7/share/man/man4/mfi.4

Modified: stable/7/share/man/man4/mfi.4
==============================================================================
--- stable/7/share/man/man4/mfi.4	Fri Jun 19 16:27:41 2009	(r194495)
+++ stable/7/share/man/man4/mfi.4	Fri Jun 19 17:07:15 2009	(r194496)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 3, 2006
+.Dd January 17, 2008
 .Dt MFI 4
 .Os
 .Sh NAME
@@ -83,7 +83,11 @@ LSI MegaRAID SAS 8408E
 .It
 LSI MegaRAID SAS 8480E
 .It
-Dell PERC5/i
+LSI MegaRAID SAS 1078
+.It
+Dell PERC5
+.It
+Dell PERC6
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /dev/mfid?" -compact
From jhb at FreeBSD.org  Fri Jun 19 17:54:56 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Fri Jun 19 17:55:20 2009
Subject: svn commit: r194500 - stable/7/share/man/man4
Message-ID: <200906191754.n5JHstEe051041@svn.freebsd.org>

Author: jhb
Date: Fri Jun 19 17:54:55 2009
New Revision: 194500
URL: http://svn.freebsd.org/changeset/base/194500

Log:
  Remove mergeinfo from this file, it is a subset of the parent mergeinfo.

Modified:
  stable/7/share/man/man4/igb.4   (props changed)
From jhb at FreeBSD.org  Fri Jun 19 18:18:10 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Fri Jun 19 18:18:27 2009
Subject: svn commit: r194502 - in stable/7/sys: . contrib/pf fs/cd9660
Message-ID: <200906191818.n5JII9IT051701@svn.freebsd.org>

Author: jhb
Date: Fri Jun 19 18:18:09 2009
New Revision: 194502
URL: http://svn.freebsd.org/changeset/base/194502

Log:
  MFC: Update the inline version of vn_vget_ino() for ".." lookups to match
  the recentish changes to vn_vget_ino().

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/fs/cd9660/cd9660_lookup.c

Modified: stable/7/sys/fs/cd9660/cd9660_lookup.c
==============================================================================
--- stable/7/sys/fs/cd9660/cd9660_lookup.c	Fri Jun 19 17:59:29 2009	(r194501)
+++ stable/7/sys/fs/cd9660/cd9660_lookup.c	Fri Jun 19 18:18:09 2009	(r194502)
@@ -375,15 +375,17 @@ found:
 		 */
 		mp = pdp->v_mount;
 		ltype = VOP_ISLOCKED(pdp, td);
-		for (;;) {
-			error = vfs_busy(mp, LK_NOWAIT, NULL, curthread);
-			if (error == 0)
-				break;
+		error = vfs_busy(mp, LK_NOWAIT, NULL, td);
+		if (error != 0) {
 			VOP_UNLOCK(pdp, 0, td);
-			pause("vn_vget", 1);
+			error = vfs_busy(mp, 0, NULL, td);
 			vn_lock(pdp, ltype | LK_RETRY, td);
-			if (pdp->v_iflag & VI_DOOMED)
+			if (error)
+				return (ENOENT);
+			if (pdp->v_iflag & VI_DOOMED) {
+				vfs_unbusy(mp, td);
 				return (ENOENT);
+			}
 		}
 		VOP_UNLOCK(pdp, 0, td);
 		error = cd9660_vget_internal(vdp->v_mount, i_ino,
From edwin at FreeBSD.org  Sat Jun 20 08:54:04 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sat Jun 20 08:54:30 2009
Subject: svn commit: r194527 - stable/7/etc
Message-ID: <200906200854.n5K8s47A069426@svn.freebsd.org>

Author: edwin
Date: Sat Jun 20 08:54:03 2009
New Revision: 194527
URL: http://svn.freebsd.org/changeset/base/194527

Log:
  MFC of 194107
  
  Sync termcap.small with main termcap; add xterm entry for libteken
  
  PR:           conf/135530
  Submitted by: Alex Kozlov 

Modified:
  stable/7/etc/termcap.small   (contents, props changed)

Modified: stable/7/etc/termcap.small
==============================================================================
--- stable/7/etc/termcap.small	Sat Jun 20 08:46:40 2009	(r194526)
+++ stable/7/etc/termcap.small	Sat Jun 20 08:54:03 2009	(r194527)
@@ -71,6 +71,17 @@ cons60|ansi80x60:\
 	:li#60:tc=cons25:
 cons60-m|ansi80x60-mono:\
 	:li#60:tc=cons25-m:
+# Syscons console with 132 characters (VESA modes)
+cons25-w|ansi132x25:\
+	:co#132:tc=cons25:
+cons30-w|ansi132x30:\
+	:co#132:tc=cons30:
+cons43-w|ansi132x43:\
+	:co#132:tc=cons43:
+cons50-w|ansil-w|ansi132x50:\
+	:co#132:tc=cons50:
+cons60-w|ansi132x60:\
+	:co#132:tc=cons60:
 # KOI8-R/KOI8-U FreeBSD console with ACS support
 cons25r|cons25u|pc3r|ibmpc3r|cons25-koi8:\
 	:ac=q\200x\201m\204v\211j\205t\206n\212u\207l\202w\210k\203y\230z\231f\234~\225a\220h\2210\215:\
@@ -93,6 +104,28 @@ cons60r|cons60u|cons60-koi8:\
 	:li#60:tc=cons25r:
 cons60r-m|cons60u-m|cons60-koi8-mono:\
 	:li#60:tc=cons25r-m:
+# Syscons console with 90 characters (VGA modes)
+# KOI8-R/KOI8-U FreeBSD console with ACS support.
+cons25r-v|cons25u-v|pc3r-v|ibmpc3r-vga|cons25-koi8-vga:\
+	:co#90:tc=cons25r:
+cons25r-mv|cons25u-mv|pc3r-mv|ibmpc3r-monovga|cons25-koi8-monovga:\
+	:co#90:tc=cons25r-m:
+cons30r-v|cons30u-v|cons30-koi8-vga:\
+	:co#90:tc=cons30r:
+cons30r-mv|cons30u-mv|cons30-koi8-monovga:\
+	:co#90:tc=cons30r-m:
+cons43r-v|cons43u-v|cons43-koi8-vga:\
+	:co#90:tc=cons43r:
+cons43r-mv|cons43u-mv|cons43-koi8-monovga:\
+	:co#90:tc=cons43r-m:
+cons50r-v|cons50u-v|cons50-koi8-vga:\
+	:co#90:tc=cons50r:
+cons50r-mv|cons50u-mv|cons50-koi8-monovga:\
+	:co#90:tc=cons50r-m:
+cons60r-v|cons60u-v|cons60-koi8-vga:\
+	:co#90:tc=cons60r:
+cons60r-mv|cons60u-mv|cons60-koi8-monovga:\
+	:co#90:tc=cons60r-m:
 # ISO 8859-2 FreeBSD console with ACS support
 cons25l2|cons25-iso8859-2:\
 	:ac=f\260i\247:\
@@ -137,6 +170,17 @@ cons60l1|cons60-iso8859-1:\
 	:li#60:tc=cons25l1:
 cons60l1-m|cons60-iso8859-1-mono:\
 	:li#60:tc=cons25l1-m:
+# 132x25 ISO 8859-1 FreeBSD console
+cons25l1-w|:cons25w-iso8859-1:\
+	:co#132:tc=cons25l1:
+cons30l1-w|cons30w-iso8859-1:\
+	:co#132:tc=cons30l1:
+cons43l1-w|cons43w-iso8859-1:\
+	:co#132:tc=cons43l1:
+cons50l1-w|cons50w-iso8859-1:\
+	:co#132:tc=cons50l1:
+cons60l1-w|cons60w-iso8859-1:\
+	:co#132:tc=cons60l1:
 # ISO 8859-7 FreeBSD console with ACS support
 cons25l7|cons25-iso8859-7:\
 	:ac=f\260g\261{\360}\243+\253,\273i\247:\
@@ -180,8 +224,6 @@ pc|ibmpc|ibm pc PC/IX:\
 	:li#24:co#80:am:bs:bw:eo:\
 	:cd=\E[J:ce=\E[K:cl=\Ec:cm=\E[%i%2;%2H:do=\E[B:ho=\E[;H:\
 	:nd=\E[C:up=\E[A:so=\E[7m:se=\E[0m:us=\E[4m:ue=\E[0m:
-pc3mono|IBM PC 386BSD Console with monochrome monitor:\
-	:so=\E[0;1r\E[m:tc=pc3:
 pc3|ibmpc3|IBM PC 386BSD Console:\
 	:Co#8:\
 	:DO=\E[%dB:\
@@ -194,10 +236,10 @@ pc3|ibmpc3|IBM PC 386BSD Console:\
 	:K5=\E[G:\
 	:LE=\E[%dD:\
 	:RI=\E[%dC:\
-	:Sb=\E[1;%dx:\
-	:Sf=\E[2;%dx:\
+	:AB=\E[1;%dx:\
+	:AF=\E[2;%dx:\
 	:UP=\E[%dA:\
-	:ac=l\332m\300k\277j\331u\264t\303v\301w\302q\304x\263n\305`^Da\260f\370g\361~\371.^Y-^Xh\261I^U0\333y\363z\362:\
+	:ac=l\332m\300k\277j\331u\264t\303v\301w\302q\304x\263n\305`^Da\260f\370g\361~\371.^Y-^Xh\261i^U0\333y\363z\362:\
 	:am:\
 	:bl=^G:\
 	:bs:\
@@ -248,3 +290,33 @@ pc3|ibmpc3|IBM PC 386BSD Console:\
 	:ti=\E[m:\
 	:up=\E[A:\
 	:ut:
+
+# $XFree86: xc/programs/xterm/termcap,v 3.28 2001/01/17 23:46:39 dawes Exp $
+#
+xterm-xfree86|XFree86 xterm:\
+	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
+	:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
+	:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
+	:@7=\EOF:@8=\EOM:kI=\E[2~:\
+	:kh=\EOH:kP=\E[5~:kN=\E[6~:\
+	:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:Km=\E[M:tc=xterm-basic:
+#
+# This chunk is used for building the VT220/Sun/PC keyboard variants.
+xterm-basic|xterm common (XFree86):\
+	:li#24:co#80:am:kn#12:km:mi:ms:xn:AX:bl=^G:\
+	:is=\E[!p\E[?3;4l\E[4l\E>:rs=\E[!p\E[?3;4l\E[4l\E>:le=^H:\
+	:AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:al=\E[L:dc=\E[P:dl=\E[M:\
+	:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:\
+	:ho=\E[H:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:\
+	:im=\E[4h:ei=\E[4l:ks=\E[?1h\E=:ke=\E[?1l\E>:kD=\E[3~:kb=^H:\
+	:sf=\n:sr=\EM:st=\EH:ct=\E[3g:sc=\E7:rc=\E8:\
+	:eA=\E(B\E)0:as=\E(0:ae=\E(B:ml=\El:mu=\Em:up=\E[A:nd=\E[C:\
+	:md=\E[1m:me=\E[m:mr=\E[7m:so=\E[7m:se=\E[27m:us=\E[4m:ue=\E[24m:\
+	:ti=\E[?1049h:te=\E[?1049l:vi=\E[?25l:ve=\E[?25h:\
+	:ut:Co#8:pa#64:op=\E[39;49m:AB=\E[4%dm:AF=\E[3%dm:\
+#
+# This is the only entry which you should have to customize, since "xterm"
+# is widely used for a variety of incompatible terminal emulations including
+# color_xterm and rxvt.
+xterm|xterm-color|X11 terminal emulator:\
+	:ti@:te@:tc=xterm-xfree86:
From edwin at FreeBSD.org  Sun Jun 21 02:45:24 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sun Jun 21 02:45:35 2009
Subject: svn commit: r194565 - stable/7/share/termcap
Message-ID: <200906210245.n5L2jNLY093281@svn.freebsd.org>

Author: edwin
Date: Sun Jun 21 02:45:23 2009
New Revision: 194565
URL: http://svn.freebsd.org/changeset/base/194565

Log:
  MFC of 194146
  
  Add missing termcap entry for rxvt-unicode.
  
        The termcap database does not have an entry for rxvt-unicode.
        This means that programs that need an entry such as vi fail
        to work when connecting via ssh using this terminal emulator.
  
  The added data is not the same as the PR submitted by Richard, it
  uses the :tc=xxx: option to inherit everything from rxvt-mono.
  
  PR:		conf/117323
  Submitted by:	Richard Bradshaw 

Modified:
  stable/7/share/termcap/   (props changed)
  stable/7/share/termcap/termcap.src

Modified: stable/7/share/termcap/termcap.src
==============================================================================
--- stable/7/share/termcap/termcap.src	Sun Jun 21 01:54:47 2009	(r194564)
+++ stable/7/share/termcap/termcap.src	Sun Jun 21 02:45:23 2009	(r194565)
@@ -4547,6 +4547,12 @@ rxvt-mono|rxvt terminal emulator (monoch
 	:te=\E[?47l\E8:ti=\E7\E[?47h:ue=\E[24m:up=\E[A:us=\E[4m:\
 	:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h:
 
+# Termcap entry for rxvt-unicode, taken from http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.html#I_need_a_termcap_file_entry
+rxvt-unicode|rxvt-unicode terminal (X Window System):\
+	:SF=\E[%dS:SR=\E[%dT:bw:ec=\E[%dX:kb=\177:kd=\EOB:ke=\E[?1l\E>:\
+	:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:lm#0:te=\E[r\E[?1049l:\
+	:ti=\E[?1049h:tc=rxvt-mono:
+
 rxvt|rxvt terminal emulator (X Window System):\
 	:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:
 
From edwin at FreeBSD.org  Sun Jun 21 02:46:57 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sun Jun 21 02:47:03 2009
Subject: svn commit: r194566 - stable/7/share/termcap
Message-ID: <200906210246.n5L2kuRt093418@svn.freebsd.org>

Author: edwin
Date: Sun Jun 21 02:46:56 2009
New Revision: 194566
URL: http://svn.freebsd.org/changeset/base/194566

Log:
  MFC of 194152
  
  Add missing terminal definition for Wyse 120 in termcap
  
  Although the PR contains also the definitions of the Wyse 60, they
  are not copied into it since there are already definition for them
  in the termcap file since 1997.
  
  Also, the PR didn't use the :tc=xxx: feature, so I've imploded them.
  
  PR:           conf/81882
  Submitted by: Meister des Chaos 

Modified:
  stable/7/share/termcap/   (props changed)
  stable/7/share/termcap/termcap.src

Modified: stable/7/share/termcap/termcap.src
==============================================================================
--- stable/7/share/termcap/termcap.src	Sun Jun 21 02:45:23 2009	(r194565)
+++ stable/7/share/termcap/termcap.src	Sun Jun 21 02:46:56 2009	(r194566)
@@ -3998,6 +3998,31 @@ wy100q|Wyse 100 for Quotron:\
 	:dc=\EW:dl=\ER:do=^J:ei=\Er:im=\Eq:is=\E`\072\200\EC\EDF\E0\E'\E(\EA21:\
 	:kd=^J:kl=^H:kr=^L:ku=^K:li#24:nd=^L:up=^K:us=\EG8:ue=\EG0:\
 	:so=\EG4:se=\EG0:sg#1:sr=\Ej:ho=^^:ug#1:
+# Wyse 120 definitions from conf/81882 by Meister des Chaos 
+wy120|wyse120|wy150|wyse150|Wyse 120/150:\
+        :am:bw:hs:km:mi:ms:xo:\
+        :co#80:it#8:li#24:pb#9601:ws#45:\
+        :ae=\EcD:al=\EE:as=\EcE:bl=^G:bt=\EI:cd=\EY:ce=\ET:cl=\E+:\
+        :cm=\E=%+ %+ :cr=^M:ct=\E0:dc=\EW:dl=\ER:do=^J:ds=\EF\r:\
+        :ei=\Er:fs=^M:ho=^^:i1=\EcB0\EcC1:i2=\EwJ\Ew1:im=\Eq:ip=:\
+        :is=\Ed$\EcD\E'\Er\EH\003\Ed/\EO\Ee1\Ed*\E`@\E`9\E`1\016\024\El:\
+        :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:\
+        :k7=^AF\r:k8=^AG\r:k9=^AH\r:kD=\EW:kI=\EQ:kN=\EK:kP=\EJ:\
+        :kb=^H:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:le=^H:ll=^^^K:mb=\EG2:\
+        :me=\E(\EH\003\EG0\EcD:mh=\EGp:mr=\EG4:nd=^L:nw=\r\n:\
+        :se=\EG0:sf=\n:so=\EGt:sr=\Ej:st=\E1:ta=\011:te=\Ew1:\
+        :ti=\Ew0:ts=\EF:ue=\EG0:up=^K:us=\EG8:vb=\E`8\E`9:ve=\E`1:\
+        :vi=\E`0:
+wy120-w|wyse120-w|wy150-w|wyse150-w|wyse 120/150 132-column:\
+	:cm=\Ea%i%dR%dC:co#132:ws#97:tc=wy120:
+wy120-25|wyse120-25|wy150-25|wyse150-25|wyse 120/150 80-column 25-lines:\
+        :li#25:tc=wy120:
+wy120-25-w|wyse120-25-w|wy150-25-w|wyse150-25-w|wyse 120/150 132-column 25-lines:\
+	:cm=\Ea%i%dR%dC:co#132:li#25:ws#97:tc=wy120:
+wy120-vb|wyse120-vb|wy150-vb|wyse150-vb|Wyse 120/150 visible bell:\
+	:bl@:tc=wy120:
+wy120-w-vb|wy120-wvb|wyse120-wvb|wy150-w-vb|wyse150-w-vb|Wyse 120/150 132-column visible bell:\
+	:bl@:cm=\Ea%i%dR%dC:co#132:ws#97:tc=wy120:
 # # --------------------------------
 #
 # y: TELERAY
From edwin at FreeBSD.org  Sun Jun 21 02:48:17 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sun Jun 21 02:48:29 2009
Subject: svn commit: r194567 - stable/7/share/termcap
Message-ID: <200906210248.n5L2mGYY093491@svn.freebsd.org>

Author: edwin
Date: Sun Jun 21 02:48:16 2009
New Revision: 194567
URL: http://svn.freebsd.org/changeset/base/194567

Log:
  MFC of 194172
  
  Termcap updates for screen and linux console:
  
      screen entry: F11-F20 keys added
      linux entry: F10-F20 keys added, ACS line graphics added
  
  PR:           kern/108899
  Submitted by: Joseph Terner

Modified:
  stable/7/share/termcap/   (props changed)
  stable/7/share/termcap/termcap.src

Modified: stable/7/share/termcap/termcap.src
==============================================================================
--- stable/7/share/termcap/termcap.src	Sun Jun 21 02:46:56 2009	(r194566)
+++ stable/7/share/termcap/termcap.src	Sun Jun 21 02:48:16 2009	(r194567)
@@ -2771,6 +2771,8 @@ SC|screen|VT 100/ANSI X3.64 virtual term
 	:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
 	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
 	:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
+	:F3=\E[25~:F4=\E[26~:F5=\E[28~:F6=\E[29~:\
+	:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\
 	:kh=\E[1~:kI=\E[2~:kD=\E[3~:@7=\E[4~:kP=\E[5~:\
 	:kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\
 	:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
@@ -4526,7 +4528,9 @@ linux|Linux Console:\
 	:me=\E[0;10m:mh=\E[2m:mr=\E[7m:nd=\E[C:nw=^M^J:rc=\E8:\
 	:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
 	:ue=\E[24m:up=\E[A:us=\E[4m:vb=200\E[?5h\E[?5l:\
-	:ve=\E[?25h:vi=\E[?25l:
+	:ve=\E[?25h:vi=\E[?25l:\
+	:k;=\E[21~:F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\
+	:F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:
 linux-m|Linux Console no color:\
 	:pa@:Co@:AF@:AB@:op@:\
 	:tc=linux:
From edwin at FreeBSD.org  Sun Jun 21 02:49:22 2009
From: edwin at FreeBSD.org (Edwin Groothuis)
Date: Sun Jun 21 02:49:38 2009
Subject: svn commit: r194568 - stable/7/share/termcap
Message-ID: <200906210249.n5L2nLP0093562@svn.freebsd.org>

Author: edwin
Date: Sun Jun 21 02:49:21 2009
New Revision: 194568
URL: http://svn.freebsd.org/changeset/base/194568

Log:
  Add missing passthrough printing entries for VT100 and workalikes
  in /etc/termcap:
  
      VT100 spec indicates that passthrough printing can be enabled
      by sending ESC[5i and disabled by sending ESC[4i These entries
      should be listed as po and pf in /etc/termcap, but are absent.
      See http://www.vt100.net/docs/vt102-ug/chapter5.html#S5.5.2.23
  
  PR:           conf/71549
  Submitted by: Andrew Webster 

Modified:
  stable/7/share/termcap/   (props changed)
  stable/7/share/termcap/termcap.src

Modified: stable/7/share/termcap/termcap.src
==============================================================================
--- stable/7/share/termcap/termcap.src	Sun Jun 21 02:48:16 2009	(r194567)
+++ stable/7/share/termcap/termcap.src	Sun Jun 21 02:49:21 2009	(r194568)
@@ -2481,7 +2481,7 @@ vt100|dec-vt100|vt100-am|vt100am|dec vt1
 	:K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:pt:sr=2*\EM:xn:\
 	:sc=2\E7:rc=2\E8:cs=5\E[%i%d;%dr:UP=2\E[%dA:DO=2\E[%dB:RI=2\E[%dC:\
 	:LE=2\E[%dD:ct=2\E[3g:st=2\EH:ta=^I:ms:bl=^G:cr=^M:eo:it#8:\
-	:RA=\E[?7l:SA=\E[?7h:
+	:RA=\E[?7l:SA=\E[?7h:po=\E[5i:pf=\E[4i:
 vt100-nam|dec-vt100-nam|vt100nam|vt100 w/no am:\
 	:am@:xn@:\
 	:is=\E>\E[?1;3;4;5;7l\E[?8h\E[1;24r\E[24;1H:\
From jilles at FreeBSD.org  Sun Jun 21 15:36:12 2009
From: jilles at FreeBSD.org (Jilles Tjoelker)
Date: Sun Jun 21 15:36:29 2009
Subject: svn commit: r194587 - stable/7/bin/cp
Message-ID: <200906211536.n5LFaBsc010527@svn.freebsd.org>

Author: jilles
Date: Sun Jun 21 15:36:10 2009
New Revision: 194587
URL: http://svn.freebsd.org/changeset/base/194587

Log:
  MFC r193086: Preserve file flags on symlinks in cp -Rp.
  This reported ENOSYS before.
  
  PR:		bin/111226 (part of)
  Submitted by:	Martin Kammerhofer
  Approved by:	ed (mentor) (implicit)

Modified:
  stable/7/bin/cp/   (props changed)
  stable/7/bin/cp/utils.c

Modified: stable/7/bin/cp/utils.c
==============================================================================
--- stable/7/bin/cp/utils.c	Sun Jun 21 13:41:32 2009	(r194586)
+++ stable/7/bin/cp/utils.c	Sun Jun 21 15:36:10 2009	(r194587)
@@ -339,7 +339,7 @@ setfile(struct stat *fs, int fd)
 	if (!gotstat || fs->st_flags != ts.st_flags)
 		if (fdval ?
 		    fchflags(fd, fs->st_flags) :
-		    (islink ? (errno = ENOSYS) :
+		    (islink ? lchflags(to.p_path, fs->st_flags) :
 		    chflags(to.p_path, fs->st_flags))) {
 			warn("chflags: %s", to.p_path);
 			rval = 1;
From jilles at FreeBSD.org  Sun Jun 21 15:40:40 2009
From: jilles at FreeBSD.org (Jilles Tjoelker)
Date: Sun Jun 21 15:40:57 2009
Subject: svn commit: r194588 - in stable/7: bin/rm usr.bin/find
Message-ID: <200906211540.n5LFed72010644@svn.freebsd.org>

Author: jilles
Date: Sun Jun 21 15:40:39 2009
New Revision: 194588
URL: http://svn.freebsd.org/changeset/base/194588

Log:
  MFC r193087: rm, find -delete: f
;\ +# remains + <-a>;<-o> From marck at rinet.ru Fri Jun 12 10:26:56 2009 From: marck at rinet.ru (Dmitry Morozovsky) Date: Fri Jun 12 10:27:08 2009 Subject: svn commit: r194040 - stable/7/lib/libc/gen In-Reply-To: <200906112137.n5BLbO2S060767@svn.freebsd.org> References: <200906112137.n5BLbO2S060767@svn.freebsd.org> Message-ID: On Thu, 11 Jun 2009, John Baldwin wrote: JB> Author: jhb JB> Date: Thu Jun 11 21:37:23 2009 JB> New Revision: 194040 JB> URL: http://svn.freebsd.org/changeset/base/194040 JB> JB> Log: JB> If the running kernel has support for shm_open() and shm_unlink() as JB> system calls (i.e. 8.0+), then invoke the system calls instead of using JB> open/fcntl/unlink. This is a direct commit instead of an MFC since libc JB> in 8.0 always uses the system calls directly. So it could help running RELENG_7 jails under 8 host? Great, thanks! -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From jhb at freebsd.org Fri Jun 12 12:59:26 2009 From: jhb at freebsd.org (John Baldwin) Date: Fri Jun 12 12:59:49 2009 Subject: svn commit: r194040 - stable/7/lib/libc/gen In-Reply-To: References: <200906112137.n5BLbO2S060767@svn.freebsd.org> Message-ID: <200906120851.32846.jhb@freebsd.org> On Friday 12 June 2009 6:13:08 am Dmitry Morozovsky wrote: > On Thu, 11 Jun 2009, John Baldwin wrote: > > JB> Author: jhb > JB> Date: Thu Jun 11 21:37:23 2009 > JB> New Revision: 194040 > JB> URL: http://svn.freebsd.org/changeset/base/194040 > JB> > JB> Log: > JB> If the running kernel has support for shm_open() and shm_unlink() as > JB> system calls (i.e. 8.0+), then invoke the system calls instead of using > JB> open/fcntl/unlink. This is a direct commit instead of an MFC since libc > JB> in 8.0 always uses the system calls directly. > > So it could help running RELENG_7 jails under 8 host? In that case it probably doesn't matter either way. The goal is that if you have an 8.x binary and a 7.x binary that are both using shm_open() with a path to open a SHM region for IPC, they will both access the same object. If you have all 8.x binaries or all < 8.x binaries in the group that shares access to a named SHM region then that case would work regardless. -- John Baldwin From jilles at stack.nl Fri Jun 12 13:34:47 2009 From: jilles at stack.nl (Jilles Tjoelker) Date: Fri Jun 12 13:34:59 2009 Subject: svn commit: r194040 - stable/7/lib/libc/gen In-Reply-To: <200906120851.32846.jhb@freebsd.org> References: <200906112137.n5BLbO2S060767@svn.freebsd.org> <200906120851.32846.jhb@freebsd.org> Message-ID: <20090612133418.GA8206@stack.nl> On Fri, Jun 12, 2009 at 08:51:32AM -0400, John Baldwin wrote: > On Friday 12 June 2009 6:13:08 am Dmitry Morozovsky wrote: > > On Thu, 11 Jun 2009, John Baldwin wrote: > > > > JB> Author: jhb > > JB> Date: Thu Jun 11 21:37:23 2009 > > JB> New Revision: 194040 > > JB> URL: http://svn.freebsd.org/changeset/base/194040 > > JB> > > JB> Log: > > JB> If the running kernel has support for shm_open() and shm_unlink() as > > JB> system calls (i.e. 8.0+), then invoke the system calls instead of using > > JB> open/fcntl/unlink. This is a direct commit instead of an MFC since libc > > JB> in 8.0 always uses the system calls directly. > > > > So it could help running RELENG_7 jails under 8 host? > In that case it probably doesn't matter either way. The goal is that if you > have an 8.x binary and a 7.x binary that are both using shm_open() with a > path to open a SHM region for IPC, they will both access the same object. > If you have all 8.x binaries or all < 8.x binaries in the group that shares > access to a named SHM region then that case would work regardless. where "< 8.x binaries" refers to those using 7.x's libc.so.7. Normally, a 7.x binary running on 8.x will link to 8.x's libc.so.7 and therefore use the new SHM objects even without this change. The change will likely help people that link statically to libc (boo!) or do weird things with the 7.x libc.so.7 file. -- Jilles Tjoelker From jhb at FreeBSD.org Fri Jun 12 15:53:57 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Fri Jun 12 15:54:15 2009 Subject: svn commit: r194063 - stable/7/lib/libutil Message-ID: <200906121553.n5CFrufc086111@svn.freebsd.org> Author: jhb Date: Fri Jun 12 15:53:56 2009 New Revision: 194063 URL: http://svn.freebsd.org/changeset/base/194063 Log: MFC: Add manpages for kinfo_getfile() and kinfo_getvmmap(). Added: stable/7/lib/libutil/kinfo_getfile.3 - copied unchanged from r185729, head/lib/libutil/kinfo_getfile.3 stable/7/lib/libutil/kinfo_getvmmap.3 - copied unchanged from r185729, head/lib/libutil/kinfo_getvmmap.3 Modified: stable/7/lib/libutil/ (props changed) stable/7/lib/libutil/Makefile Modified: stable/7/lib/libutil/Makefile ============================================================================== --- stable/7/lib/libutil/Makefile Fri Jun 12 15:44:35 2009 (r194062) +++ stable/7/lib/libutil/Makefile Fri Jun 12 15:53:56 2009 (r194063) @@ -30,7 +30,8 @@ MAN+= kld.3 login.3 login_auth.3 login_t login_cap.3 login_class.3 login_times.3 login_ok.3 \ _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ realhostname_sa.3 trimdomain.3 fparseln.3 humanize_number.3 \ - pidfile.3 flopen.3 expand_number.3 + pidfile.3 flopen.3 expand_number.3 \ + kinfo_getfile.3 kinfo_getvmmap.3 MAN+= login.conf.5 auth.conf.5 MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3 MLINKS+= property.3 properties_read.3 property.3 properties_free.3 Copied: stable/7/lib/libutil/kinfo_getfile.3 (from r185729, head/lib/libutil/kinfo_getfile.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libutil/kinfo_getfile.3 Fri Jun 12 15:53:56 2009 (r194063, copy of r185729, head/lib/libutil/kinfo_getfile.3) @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 2008 Peter Wemm +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 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. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 6, 2008 +.Os +.Dt KINFO_GETFILE 3 +.Sh NAME +.Nm kinfo_getfile +.Nd function for getting per-process file descriptor information +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.In sys/types.h +.In libutil.h +.Ft struct kinfo_file * +.Fn kinfo_getfile "pid_t pid" "int *cntp" +.Sh DESCRIPTION +This function is used for obtaining the file descriptor information +of a particular process. +.Pp +The +.Ar pid +field contains the process identifier. +This should be the a process that you have privilige to access. +The +.Ar cntp +field is allows the caller to know how many records are returned. +.Pp +This function is a wrapper around +.Xr sysctl 3 +with the +.Dv KERN_PROC_FILEDESC +mib. +While the kernel returns a packed structure, this function expands the +data into a fixed record format. +.Sh RETURN VALUES +The +.Fn kinfo_getfile +function returns a pointer to an array of +.Vt struct kinfo_file +structures. +The array was obtained by an internal call to +.Xr malloc 3 +and must be freed by the caller with a call to +.Xr free 3 . +.Sh SEE ALSO +.Xr free 3 , +.Xr kinfo_getvmmap 3 , +.Xr malloc 3 , +.Xr sysctl 3 Copied: stable/7/lib/libutil/kinfo_getvmmap.3 (from r185729, head/lib/libutil/kinfo_getvmmap.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libutil/kinfo_getvmmap.3 Fri Jun 12 15:53:56 2009 (r194063, copy of r185729, head/lib/libutil/kinfo_getvmmap.3) @@ -0,0 +1,73 @@ +.\" +.\" Copyright (c) 2008 Peter Wemm +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 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. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 6, 2008 +.Os +.Dt KINFO_GETVMMAP 3 +.Sh NAME +.Nm kinfo_getvmmap +.Nd function for getting per-process memory map information +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.In sys/types.h +.In libutil.h +.Ft struct kinfo_vmentry * +.Fn kinfo_getfile "pid_t pid" "int *cntp" +.Sh DESCRIPTION +This function is used for obtaining the file descriptor information +of a particular process. +.Pp +The +.Ar pid +field contains the process identifier. +This should be the a process that you have privilige to access. +The +.Ar cntp +field is allows the caller to know how many records are returned. +.Pp +This function is a wrapper around +.Xr sysctl 3 +with the +.Dv KERN_PROC_VMMAP +mib. +While the kernel returns a packed structure, this function expands the +data into a fixed record format. +.Sh RETURN VALUES +The +.Fn kinfo_getvmmap +function returns a pointer to an array of +.Vt struct kinfo_vmentry +structures. +The array was obtained by an internal call to +.Xr malloc 3 +and must be freed by the caller with a call to +.Xr free 3 . +.Sh SEE ALSO +.Xr free 3 , +.Xr kinfo_getfile 3 , +.Xr malloc 3 From jhb at freebsd.org Fri Jun 12 18:46:03 2009 From: jhb at freebsd.org (John Baldwin) Date: Fri Jun 12 18:46:08 2009 Subject: svn commit: r194040 - stable/7/lib/libc/gen In-Reply-To: <20090612133418.GA8206@stack.nl> References: <200906112137.n5BLbO2S060767@svn.freebsd.org> <200906120851.32846.jhb@freebsd.org> <20090612133418.GA8206@stack.nl> Message-ID: <200906121444.25292.jhb@freebsd.org> On Friday 12 June 2009 9:34:18 am Jilles Tjoelker wrote: > On Fri, Jun 12, 2009 at 08:51:32AM -0400, John Baldwin wrote: > > On Friday 12 June 2009 6:13:08 am Dmitry Morozovsky wrote: > > > On Thu, 11 Jun 2009, John Baldwin wrote: > > > > > > JB> Author: jhb > > > JB> Date: Thu Jun 11 21:37:23 2009 > > > JB> New Revision: 194040 > > > JB> URL: http://svn.freebsd.org/changeset/base/194040 > > > JB> > > > JB> Log: > > > JB> If the running kernel has support for shm_open() and shm_unlink() as > > > JB> system calls (i.e. 8.0+), then invoke the system calls instead of using > > > JB> open/fcntl/unlink. This is a direct commit instead of an MFC since libc > > > JB> in 8.0 always uses the system calls directly. > > > > > > So it could help running RELENG_7 jails under 8 host? > > > In that case it probably doesn't matter either way. The goal is that if you > > have an 8.x binary and a 7.x binary that are both using shm_open() with a > > path to open a SHM region for IPC, they will both access the same object. > > > If you have all 8.x binaries or all < 8.x binaries in the group that shares > > access to a named SHM region then that case would work regardless. > > where "< 8.x binaries" refers to those using 7.x's libc.so.7. > Normally, a 7.x binary running on 8.x will link to 8.x's libc.so.7 and > therefore use the new SHM objects even without this change. True. It is more relevant to libc.so.[46] which I plan to update next week when the MFC after timer expires, and that is the true target audience I have in mind (many people still use 4.x and 6.x binaries on newer kernels). -- John Baldwin From jkim at FreeBSD.org Fri Jun 12 20:41:45 2009 From: jkim at FreeBSD.org (Jung-uk Kim) Date: Fri Jun 12 20:41:56 2009 Subject: svn commit: r194075 - in stable/7/sys: . amd64/amd64 amd64/include contrib/pf dev/ath/ath_hal i386/i386 i386/include Message-ID: <200906122041.n5CKfij7092288@svn.freebsd.org> Author: jkim Date: Fri Jun 12 20:41:44 2009 New Revision: 194075 URL: http://svn.freebsd.org/changeset/base/194075 Log: MFC: r175904, r175905, r186009 Sync amd64 and i386 CPUID feature flags with -CURRENT. - amd64 only: DTES64, SSE4.1, SSE4.2, x2APIC, POPCNT - both: ABM, SSE4A, MAS, OSVW, IBS, SSE5, SKINIT, WDT PR: kern/135202 Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/include/specialreg.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/i386/i386/identcpu.c stable/7/sys/i386/include/specialreg.h Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Fri Jun 12 20:29:55 2009 (r194074) +++ stable/7/sys/amd64/amd64/identcpu.c Fri Jun 12 20:41:44 2009 (r194075) @@ -223,7 +223,7 @@ printcpuinfo(void) "\020" "\001SSE3" /* SSE3 */ "\002" - "\003RSVD2" /* "Reserved" bit 2 */ + "\003DTES64" /* 64-bit Debug Trace */ "\004MON" /* MONITOR/MWAIT Instructions */ "\005DS_CPL" /* CPL Qualified Debug Store */ "\006VMX" /* Virtual Machine Extensions */ @@ -240,11 +240,11 @@ printcpuinfo(void) "\021" "\022" "\023DCA" /* Direct Cache Access */ - "\024" - "\025" - "\026" + "\024SSE4.1" + "\025SSE4.2" + "\026x2APIC" /* xAPIC Extensions */ "\027" - "\030" + "\030POPCNT" "\031" "\032" "\033XSAVE" @@ -311,15 +311,15 @@ printcpuinfo(void) "\003SVM" /* Secure Virtual Mode */ "\004ExtAPIC" /* Extended APIC register */ "\005CR8" /* CR8 in legacy mode */ - "\006" - "\007" - "\010" + "\006ABM" /* LZCNT instruction */ + "\007SSE4A" /* SSE4A */ + "\010MAS" /* Misaligned SSE mode */ "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ - "\012" - "\013" - "\014" - "\015" - "\016" + "\012OSVW" /* OS visible workaround */ + "\013IBS" /* Instruction based sampling */ + "\014SSE5" /* SSE5 */ + "\015SKINIT" /* SKINIT/STGI */ + "\016WDT" /* Watchdog timer */ "\017" "\020" "\021" Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Fri Jun 12 20:29:55 2009 (r194074) +++ stable/7/sys/amd64/include/specialreg.h Fri Jun 12 20:41:44 2009 (r194075) @@ -113,6 +113,7 @@ #define CPUID_PBE 0x80000000 #define CPUID2_SSE3 0x00000001 +#define CPUID2_DTES64 0x00000004 #define CPUID2_MON 0x00000008 #define CPUID2_DS_CPL 0x00000010 #define CPUID2_VMX 0x00000020 @@ -125,6 +126,10 @@ #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 #define CPUID2_DCA 0x00040000 +#define CPUID2_SSE41 0x00080000 +#define CPUID2_SSE42 0x00100000 +#define CPUID2_X2APIC 0x00200000 +#define CPUID2_POPCNT 0x00800000 /* * Important bits in the AMD extended cpuid flags @@ -145,7 +150,15 @@ #define AMDID2_SVM 0x00000004 #define AMDID2_EXT_APIC 0x00000008 #define AMDID2_CR8 0x00000010 +#define AMDID2_ABM 0x00000020 +#define AMDID2_SSE4A 0x00000040 +#define AMDID2_MAS 0x00000080 #define AMDID2_PREFETCH 0x00000100 +#define AMDID2_OSVW 0x00000200 +#define AMDID2_IBS 0x00000400 +#define AMDID2_SSE5 0x00000800 +#define AMDID2_SKINIT 0x00001000 +#define AMDID2_WDT 0x00002000 /* * CPUID instruction 1 eax info Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Fri Jun 12 20:29:55 2009 (r194074) +++ stable/7/sys/i386/i386/identcpu.c Fri Jun 12 20:41:44 2009 (r194075) @@ -808,15 +808,15 @@ printcpuinfo(void) "\003SVM" /* Secure Virtual Mode */ "\004ExtAPIC" /* Extended APIC register */ "\005CR8" /* CR8 in legacy mode */ - "\006" - "\007" - "\010" + "\006ABM" /* LZCNT instruction */ + "\007SSE4A" /* SSE4A */ + "\010MAS" /* Misaligned SSE mode */ "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ - "\012" - "\013" - "\014" - "\015" - "\016" + "\012OSVW" /* OS visible workaround */ + "\013IBS" /* Instruction based sampling */ + "\014SSE5" /* SSE5 */ + "\015SKINIT" /* SKINIT/STGI */ + "\016WDT" /* Watchdog timer */ "\017" "\020" "\021" Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Fri Jun 12 20:29:55 2009 (r194074) +++ stable/7/sys/i386/include/specialreg.h Fri Jun 12 20:41:44 2009 (r194075) @@ -147,7 +147,15 @@ #define AMDID2_SVM 0x00000004 #define AMDID2_EXT_APIC 0x00000008 #define AMDID2_CR8 0x00000010 +#define AMDID2_ABM 0x00000020 +#define AMDID2_SSE4A 0x00000040 +#define AMDID2_MAS 0x00000080 #define AMDID2_PREFETCH 0x00000100 +#define AMDID2_OSVW 0x00000200 +#define AMDID2_IBS 0x00000400 +#define AMDID2_SSE5 0x00000800 +#define AMDID2_SKINIT 0x00001000 +#define AMDID2_WDT 0x00002000 /* * CPUID instruction 1 eax info From edwin at FreeBSD.org Sat Jun 13 13:09:20 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Sat Jun 13 13:09:28 2009 Subject: svn commit: r194105 - stable/7/share/misc Message-ID: <200906131309.n5DD9J6a014512@svn.freebsd.org> Author: edwin Date: Sat Jun 13 13:09:19 2009 New Revision: 194105 URL: http://svn.freebsd.org/changeset/base/194105 Log: MFC of r175407 r187024 r193586 r193609 r175407 Correct that LSI 0060 is a mfi device and not mpt. r187024 Correct description for the Marvell 88SE6101. r193586 Regen: * Hart: rev 671 of pcidevs.txt; 22-01-2008 (D-M-Y). * Boemler: vendors.txt (2008-06-06) r193609 Remove cruft at 0E11-0002. Informed upstream. Modified: stable/7/share/misc/pci_vendors (contents, props changed) Modified: stable/7/share/misc/pci_vendors ============================================================================== --- stable/7/share/misc/pci_vendors Sat Jun 13 13:07:56 2009 (r194104) +++ stable/7/share/misc/pci_vendors Sat Jun 13 13:09:19 2009 (r194105) @@ -3,14 +3,14 @@ ; Automatically generated by src/tools/tools/pciid/mk_pci_vendors.pl ; (with the -l option), using the following source lists: ; -; http://www.pcidatabase.com/reports.php?type=tab-delimeted +; http://www.pcidatabase.com/reports.php?type=csv ; http://members.datafast.net.au/dft0802/downloads/pcidevs.txt ; ; Manual edits on this file will be lost! ; 0000 Gammagraphx Inc 001A Ascend Communications Inc -0033 Paradyne Corp. +0033 Paradyne Corp 003D Real 3D (Was: Lockheed Martin-Marietta Corp) 00D1 i740 PCI Graphics Accelerator 0070 Hauppauge Computer Works Inc. @@ -18,11 +18,12 @@ 4001 WinTV PVR-250 (v1) 4009 WinTV PVR-250 4801 WinTV PVR-250 MCE + 6800 Hauppage Nova -TD-500 DVB-T Tuner Device 0071 Nebula Electronics Ltd -0100 Ncipher Corp. Ltd +0100 Ncipher Corp Ltd 0123 General Dynamics 0246 Addtron(??) -0315 SK - Electronics Co., Ltd. +0315 SK - Electronics Co Ltd 0357 TTTech AG 000A TTP-Monitoring Card V2.0 0403 Future Technology Devices International Ltd @@ -68,7 +69,64 @@ FFA8 Scitel Quadro 09C1 Arris 0704 CM 200E Cable Modem -0A89 BREA Technologies Inc. +0A5C Broadcom Corporation + 0201 Broadcom USB iLine10(tm) Network Adapter + 2000 Broadcom Bluetooth Firmware Upgrade Device + 2009 Broadcom Bluetooth Controller + 200A Broadcom Bluetooth Controller + 200F Broadcom Bluetooth Controller + 201D BROADCOM Bluetooth Device + 201E IBM Integrated Bluetooth IV + 2020 Broadcom Bluetooth Dongle + 2021 BCM2035B3 ROM Adapter Generic + 2033 Broadcom Blutonium Device Firmware Downloader + 2035 BCM2035 Bluetooth + 2038 Broadcom Blutonium Device Firmware Downloader (BCM2038) + 2039 BROADCOM Bluetooth Device + 2045 Broadcom Bluetooth Controller + 2046 Broadcom USB Bluetooth Device + 2047 Broadcom USB Bluetooth Device + 205E Broadcom Bluetooth Firmware Upgrade Device + 2100 Broadcom Bluetooth 2.0+eDR USB dongle + 2101 Broadcom Bluetooth 2.0+EDR USB dongle + 2102 ANYCOM Blue USB-200/250 + 2110 Broadcom Bluetooth Controller + 2111 ANYCOM Blue USB-UHE 200/250 + 2120 Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter ( 2045) + 2121 Broadcom 2045 Bluetooth 2.0 USB Device with trace filter + 2122 Broadcom Bluetooth 2.0+EDR USB dongle + 2124 2045B3ROM Bluetooth Dongle + 2130 Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter + 2131 Broadcom 2045 Bluetooth 2.0 USB Device with trace filter + 2140 2046 Flash UHE Class 2 + 2141 2046 Flash non UHE Class 2 + 2142 2046 Flash non UHE Class 1 + 2143 2046 Flash non UHE Class 1 + 2144 2046 Flash non UHE module Class 2 + 2145 Broadcom BCM9204MD LENO Module + 2146 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2147 Broadcom 2046 Bluetooth 2.1 USB Dongle + 2148 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2149 Broadcom 2046 Bluetooth 2.1 USB Dongle + 214A Broadcom 2046 Bluetooth 2.1 USB Module + 214B Broadcom 2046 Bluetooth 2.1 USB Module + 214C Broadcom 2046 Bluetooth 2.1 USB Module + 214D Broadcom Bluetooth 2.1 UHE Module + 214E Thinkpad Bluetooth with Enhanced Data Rate II + 214F Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2150 Broadcom 2046 Bluetooth 2.1 USB Dongle + 2151 Broadcom 2046 Bluetooth 2.1 USB Dongle + 2152 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2153 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2154 Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2155 Broadcom Bluetooth USB Dongle + 2157 BCM2046 B1 USB 500 + 2158 Broadcom 2046 Bluetooth 2.1 Device + 4502 USB Human Interface Device + 4503 USB Human Interface Device + 5800 Unified Security Hub + 6300 Pirelli ISB Remote NDIS Device +0A89 BREA Technologies Inc 0B0B Rhino Equiment Corp. 0105 Rhino R1T1 0205 Rhino R4FXO @@ -89,11 +147,11 @@ 0E11 Compaq Computer Corp (Now owned by Hewlett-Packard) 0001 PCI to EISA Bridge 0002 PCI to ISA Bridge - 000F CPQB1A9 StorageWorks Library Adapter (HVD) - 0012 686P7 686P7 - 0046 Smart Array 64xx Controller - 0049 NC7132 Gigabit Upgrade Module - 004A NC6136 Gigabit Server Adapter + 000F StorageWorks Library Adapter (HVD) (CPQB1A9) + 0012 686P7 (686P7) + 0046 Smart Array 64xx/6i Controller + 0049 Gigabit Upgrade Module (NC7132) + 004A Gigabit Server Adapter (NC6136) 007C NC7770 1000BaseTX 007D NC6770 1000BaseTX 0085 NC7780 1000BaseTX @@ -105,13 +163,13 @@ 00D0 NC7782 00D1 NC7783 00E3 NC7761 - 0508 Netelligent 4/16 TR PCI UTP/STP Controller - 1000 Triflex/Pentium Bridge, Model 1000 - 2000 Triflex/Pentium Bridge, Model 2000 - 3032 QVision 1280/p v0 GUI Accelerator - 3033 QVision 1280/p v1 GUI Accelerator - 3034 QVision 1280/p v2 GUI Accelerator - 4000 Triflex Model 4000 Pentium Bridge + 0508 PCI UTP/STP Controller (Neteligent 4/16 TR) + 1000 Pentium Bridge (Triflex Model 1000) + 2000 Pentium Bridge (Triflex Model 2000) + 3032 GUI Accelerator (QVision 1280/p v0) + 3033 GUI Accelerator (QVision 1280/p v1) + 3034 GUI Accelerator (QVision 1280/p v2) + 4000 Pentium Bridge (Triflex Model 4000) 4030 SMART-2/P 4031 SMART-2SL 4032 Smart Array 3200 @@ -131,57 +189,57 @@ 409B Smart Array 642 409C Smart Array 6400 409D Smart Array 6400 EM - 6010 Model 6010 HotPlug PCI Bridge + 6010 HotPlug PCI Bridge (Model 6010) 7020 USB Controller A0EC Original Compaq fibre Channel HBA A0F0 Advanced System Management Controller A0F3 Triflex PCI to ISA PnP Bridge A0F7 PCI Hot Plug Controller - A0F8 ZFMicro USB Open Host Controller + A0F8 USB Open Host Controller (ZFMicro) A0FC HPFC-5166A Tachyon TL 64-bit/66MHz Fibre Channel Adapter AE10 Smart-2 Array Controller - AE29 MIS-L PCI to ISA Bridge - AE2A MPC CPU to PCI Bridge - AE2B MIS-E PCI to ISA PnP Bridge - AE31 System Management Controller + AE29 PCI to ISA Bridge (MIS-L) + AE2A CPU to PCI Bridge (MPC) + AE2B PCI to ISA PnP Bridge (MIS-E) + AE31 System Management Controller (1002&DEV-4385&SUBSY) AE32 Netelligent 10/100 TX PCI UTP TLAN 2.3 - AE33 Triflex Dual EIDE Controller + AE33 Dual EIDE Controller (Triflex) AE34 Netelligent 10 T PCI UTP TLAN 2.3 - AE35 Integrated NetFlex 3/P TLAN 2.3 + AE35 Integrated NetFlex-3/P TLAN 2.3 AE40 Dual-port Netelligent 10/100 TX PCI TLAN 3.03 AE43 Integrated Netelligent 10/100 TX PCI TLAN 2.3 - AE69 CETUS-L PCI to ISA Bridge - AE6C DRACO PCI Bridge - AE6D NorthStar CPU to PCI Bridge - B011 Dual Port Netelligent 10/100 TX - B012 Netelligent 10 T/2 UTP/Coax PCI - B01E NC3120 Fast Ethernet NIC - B01F NC3122 Fast Ethernet NIC - B02F NC1120 Ethernet NIC - B030 Netelligent WS 1500 10/100TX Embedded UTP/Coax Controller - B04A 699209-003 10/100TX WOL UTP Controller + AE69 PCI to ISA Bridge (CETUS-L) + AE6C PCI Bridge (DRACO) + AE6D CPU to PCI Bridge (NorthStar) + B011 Dual-port Netelligent 10/100 TX + B012 UTP/Coax PCI (Netelligent 10 T/2) + B01E Fast Ethernet NIC (NC3120) + B01F Fast Ethernet NIC (NC3122) + B02F Ethernet NIC (NC1120) + B030 10/100TX Embedded UTP/Coax Controller (Netelligent WS 1500) + B04A 10/100TX WOL UTP Controller (699209-003) B060 CISS SMART2 Array Controller B0C6 NC3161 Fast Ethernet Embedded Controller with WOL - B0C7 NC3160 Fast Ethernet NIC - B0D7 NC3121 Fast Ethernet NIC (Rev A & B) - B0DD NC3131 Fast Ethernet NIC + B0C7 Fast Ethernet NIC (NC3160) + B0D7 Fast Ethernet NIC (NC3121 rev. A & B) + B0DD Fast Ethernet NIC (NC3131) B0DE NC3132 Fast Ethernet Module - B0DF NC6132 Gigabit Module - B0E0 NC6133 Gigabit Module - B0E1 NC3133 Fast Ethernet Module - B123 NC6134 Gigabit NIC - B134 NC3163 Fast Ethernet NIC - B13C NC3162 Fast Ethernet NIC - B144 NC3123 Fast Ethernet NIC - B163 NC3134 Fast Ethernet NIC - B164 NC3135 Fast Ethernet Upgrade Module - B178 CISSB SMART2 Array Controller - B196 0230 Conexant SoftK56 Modem - B1A4 NC7131 Gigabit Server Adapter + B0DF Gigabit Module (NC6132) + B0E0 Gigabit Module (NC6133) + B0E1 Fast Ethernet Module (NC3133) + B123 Gigabit NIC (NC6134) + B134 Fast Ethernet NIC (NC3163) + B13C Fast Ethernet NIC (NC3162) + B144 Fast Ethernet NIC (NC3123) + B163 Fast Ethernet NIC (NC3134) + B164 Fast Ethernet Upgrade Module (NC3135) + B178 SMART2 Array Controller (CISSB) + B196 Conexant SoftK56 Modem (0230) + B1A4 Gigabit Server Adapter (NC7131) B200 Memory Hot-Plug Controller - B203 iLo Integrated Lights Out Processor - B204 iLo Integrated Lights Out Processor - F095 FCA2101 HP StorageWorks 2 Gb, 64-Bit/66-MHz PCI-to-Fibre Channel Host Bus Adapter for Windows 2000, Windows + B203 Integrated Lights Out Processor (iLo) + B204 Integrated Lights Out Processor (iLo) + F095 HP StorageWorks 2 Gb, 64-Bit/66-MHz PCI-to-Fibre Channel Host Bus Adapter for Windows 2000, Windows (FCA2101) F130 ThunderLAN 1.0 NetFlex-3/P F150 ThunderLAN 2.3 NetFlex-3/P with BNC F700 LP7000 Compaq/Emulex Fibre Channel HBA @@ -191,89 +249,93 @@ 0001 LSI53C810/A/AE PCI-SCSI I/O Processor 0002 53C820 820 Fast-Wide-SCSI Adapter 0003 LSI53C825/A/AE PCI to SCSI I/O Processor (Fast Wide) - 0004 53C815 815X Fast-SCSI Adapter + 0004 SCSI raid controllers (53C815) 0005 53C810AP,810ASP, 2081X Fast/Ultra/Wide SCSI Adapter - 0006 LSI53C860/860E PCI to Ultra SCSI I/O Processor + 0006 PCI to Ultra SCSI I/O Processor (LSI53C860/860E) 000A LSI53C1510 PCI to Dual Channel Wide Ultra2 SCSI Controller (Nonintelligent mode) 000B LSI53C896/7 PCI to Dual Channel Ultra2 SCSI Multifunction Controller 000C LSI53C895 PCI to Ultra2 SCSI I/O Processor with LVD Link - 000D 53C885 Ultra Wide SCSI, Ethernet + 000D Ultra Wide SCSI, Ethernet (53C885) 000F LSI53C875/E,LSI53C876/E PCI to Ultra SCSI I/O Processor 0010 LSI53C1510 I2O-Ready PCI RAID Ultra2 SCSI Controller (Intelligent mode) - 0012 LSI53C895A PCI to Ultra2 SCSI Controller - 0013 LSI53C875A PCI to Ultra SCSI Controller + 0012 PCI to Ultra2 SCSI Controller (LSI53C895A) + 0013 PCI to Ultra SCSI Controller (LSI53C875A) 0020 LSI53C1010-33 PCI to Dual Channel Ultra160 SCSI Multifunction Controller - 0021 LSI53C1000/1000R/1010R/1010-66 PCI to Ultra160 SCSI Controller - 0030 LSI53C1020/1030 PCI-X to Ultra320 SCSI Controller - 0031 LSI53C1030ZC PCI-X SCSI Controller - 0032 LSI53C1035 PCI-X to Ultra320 SCSI Controller + 0021 PCI to Ultra160 SCSI Controller (LSI53C1000/1000R/1010R/1010-66) + 0030 PCI-X to Ultra320 SCSI Controller (LSI53C1020/1030) + 0031 PCI-X SCSI Controller (LSI53C1030ZC) + 0032 PCI-X to Ultra320 SCSI Controller (LSI53C1035) 0033 1030ZC_53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI - 0035 LSI53C1035 PCI-X SCSI Controller + 0035 PCI-X SCSI Controller (LSI53C1035) 0040 LSI53C1035 LSI53C1035 PCI-X to Ultra320 SCSI Controller (RAID mode) 0041 53C1035ZC PCI-X Fusion-MPT Dual Ultra320 SCSI 0050 SAS 3000 series, 4-port with 1064 -StorPort 0054 SAS 3000 series, 8-port with 1068 -StorPort + 0055 SAS1068 PCI-X Fusion-MPT SAS 0056 SAS 3000 series, 4-port with 1064E -StorPort + 0057 M1064E MegaRAID SAS 0058 SAS 3000 series, 8-port with 1068E -StorPort 005A SAS 3000 series, 6-port with 1066E -StorPort 005C SAS1064A PCI-X Fusion-MPT SAS 005E SAS 3000 series, 6-port with 1066 -StorPort 0060 SAS1078 PCI-X Fusion-MPT SAS - 0062 LSISAS1078 PCI-Express Fusion-MPT SAS - 008F 53C810 LSI 53C8xx SCSI host adapter chip + 0062 PCI-Express Fusion-MPT SAS (LSISAS1078) + 008F LSI 53C8xx SCSI host adapter chip (53C810) 0407 MegaRAID 0408 MegaRAID 0409 MegaRAID Family RAID Controller 0411 MegaRAID Family RAID Controller - 0621 LSIFC909 Fibre Channel I/O Processor - 0622 LSIFC929 Dial Channel Fibre Channel I/O Processor - 0623 LSIFC929 Dual Channel Fibre Channel I/O Processor + 0413 MegaRAID SAS Verde ZCR + 0621 Fibre Channel I/O Processor (LSIFC909) + 0622 Dial Channel Fibre Channel I/O Processor (LSIFC929) + 0623 Dual Channel Fibre Channel I/O Processor (LSIFC929) 0624 LSIFC919 Single Channel Fibre Channel I/O Processor 0625 LSIFC919 Single Channel Fibre Channel I/O Processor 0626 LSIFC929X Dual Channel Fibre Channel I/O Processor 0627 LSIFC929X Dual Channel Fibre Channel I/O Processor 0628 LSIFC919X Single Channel Fibre Channel I/O Processor 0629 LSIFC919X Single Channel Fibre Channel I/O Processor - 0630 LSIFC920 Fibre Channel I/O Processor - 0640 LSIFC949X Fibre Channel Adapter - 0642 LSIFC939X Fibre Channel Adapter - 0646 LSIFC949ES Fibre Channel Adapter + 0630 Fibre Channel I/O Processor (LSIFC920) + 0640 Fibre Channel Adapter (LSIFC949X) + 0642 Fibre Channel Adapter (LSIFC939X) + 0646 Fibre Channel Adapter (LSIFC949ES) 0701 53C885 NT50 DigitalScape Fast Ethernet Adapter - 0702 Yellowfin G-NIC Gigabit Ethernet Controller + 0702 Gigabit Ethernet Controller (Yellowfin G-NIC) 0804 SA2010 0805 SA2010ZC 0806 SA2020 0807 SA2020ZC - 0901 61C102 USB Controller - 1000 63C815 Fast SCSI Controller - 1001 53C895 Symbios Ultra2 SCSI controller - 1010 LSI 53C102000 Single channel SCSI controller + 0901 USB Controller (61C102) + 1000 Fast SCSI Controller (63C815) + 1001 Symbios Ultra2 SCSI controller (53C895) + 1010 Single channel SCSI controller (LSI 53C102000) 1960 MegaRAID 1001 Kolter Electronic - Germany 0010 PCI1616 Measurement Card with 32 digital I/O lines - 0011 ispLSI1032E OPTO-PCI, 16 IN / 16 OUT 24 VDC - 0012 ispLSI1032E PCI-AD, PCI-ADDA analog I/O-card - 0013 ispLSI1032E PCI-OptoRel, PCI-Relais 16 Relais & Opto - 0014 ispLSI1032E Timer, Pulse & Counter-card 16..32 bit - 0015 ispLSI1032E PCI-DAC416, 4 channel D/A16bit precision - 0016 ispLSI1032E PCI-MFB high-speed analog I/O - 0017 ispLSI1032E PROTO-3 PCI, digital I/O with chipselect - 0020 ispLSI1032E Universal digital I/O PCI-Interface -1002 ATI Technologies Inc - 0B12 ati 1900 ati 1900 - 3150 M24 1P Radeon Mobility X600 + 0011 OPTO-PCI, 16 IN / 16 OUT 24 VDC (ispLSI1032E) + 0012 PCI-AD, PCI-ADDA analog I/O-card (ispLSI1032E) + 0013 PCI-OptoRel, PCI-Relais 16 Relais & Opto (ispLSI1032E) + 0014 Timer, Pulse & Counter-card 16..32 bit (ispLSI1032E) + 0015 PCI-DAC416, 4 channel D/A16bit precision (ispLSI1032E) + 0016 PCI-MFB high-speed analog I/O (ispLSI1032E) + 0017 PROTO-3 PCI, digital I/O with chipselect (ispLSI1032E) + 0020 Universal digital I/O PCI-Interface (ispLSI1032E) +1002 ATI Technologies Inc. / Advanced Micro Devices, Inc. + 0B12 ati 1900 (ati 1900) + 1002 0F2A1787 (0F2A1787) + 3150 Radeon Mobility X600 (M24 1P) 3151 FIREMV 2400 3152 Mobility Radeon X300 - 3154 M24 1T FireGL - 3171 FIREMV 2400 Secondary - 3E50 Radeon X600 Series - 3E54 RV380 FireGL V3200 + 3154 Mobility FireGL V3200 + 3171 FireMV 2400 Secondary + 3E50 Radeon X600/X650 Series + 3E54 FireGL V3200 (RV380) 3E70 Radeon X600 Series Secondary 3E74 FIREGL V3200 Secondary - 4136 A3 Radeon IGP 320 - 4137 RS200 Radeon IGP 340 + 4136 Radeon IGP 320 (A3) + 4137 Radeon IGP 340 (RS200) 4144 Radeon 9500 Series (R300) - 4145 R300 Radeon 9200 (M+X) + 4145 Radeon 9200 (M+X) (R300) 4146 Radeon 9700 (R300) 4147 Fire GL Z1 AGP/Pro Video Accelerator (128 MB, 4P) 4148 Radeon 9800 SE (R350) @@ -282,105 +344,117 @@ 414B Fire GL X2 4150 Radeon 9600 Series (V350) 4151 Radeon 9600 (RV350) - 4152 Radeon 9600 XT (V350) - 4153 RV350 Radeon 9550 + 4152 Radeon 9600 XT (RV360) + 4153 Radeon 9550 (RV350) 4154 Fire GL T2 4155 Fire GL T2 4156 Fire GL T2 4157 Fire GL T2 - 4158 200E17af Mach 32 - 4164 Radeon 9500 Series, secondary R300 (128bit mem bus) + 4158 vga video (4c59h) + 4164 R300 (128bit mem bus) (Radeon 9500 Series, secondary) 4165 Radeon 9700 Pro (R300 AE) - Secondary 4166 Radeon 9600TX - Secondary 4167 Fire GL Z1 AGP/Pro Secondary Video Accelerator (128 MB, 4P) 4168 Radeon 9800 SE - Secondary (R350) 4169 Radeon 9500 Family - Secondary - 4170 Radeon 9600 Series - Secondary + 4170 Radeon 9600 - Secondary (RV350) 4171 Radeon 9600 (RV350) - Secondary - 4172 RV360 Radeon 9600 XT - Secondary - 4173 RV350 Radeon 9550 - Secondary + 4172 Radeon 9600 XT - Secondary (RV360) + 4173 Radeon 9550 - Secondary (RV350) 4174 FireGL T2 - Seocndary 4175 Radeon 9600 Series Secondary 4237 Radeon 7000 IGP - 4242 R200AIW All-In-Wonder 8500DV + 4242 All-In-Wonder 8500DV (R200AIW) 4243 Radeon 8500 DV OHCI FireWire Controller - 4336 rs200 Radeon IGP 320M - 4337 RS200M Mobility M6 (U2) - 4341 AD1981 AC'97 Audio Controller - 4342 IXP 150 HUB Bridge - 4345 IXP 150 EHCI USB Controller - 4347 IXP 150 OHCI USB Controller #1 - 4348 IXP 150 OHCI USB Controller #2 - 4349 IXP SB200 ATA Controller - 434C IXP 150 LPC Controller - 434D a75-s226 Agere Systems AC'97 Modem device + 4336 Radeon IGP 320M (rs200) + 4337 Mobility M6 (U2) (RS200M) + 4341 AC'97 Audio Controller (AD1981) + 4342 HUB Bridge (IXP 150) + 4345 EHCI USB Controller (IXP 150) + 4347 OHCI USB Controller *1 (IXP 150) + 4348 OHCI USB Controller *2 (IXP 150) + 4349 PATA 100 Controller (IXP 1xx/2xx) + 434C LPC Controller (IXP 150) + 434D Agere Systems AC'97 Modem device (a75-s226) 4353 IXP SB200 SMBUS Controller - 4354 Mach64 CT (215CT222) - 4358 216l0sas25 Mach64 CX + 4354 mach64 ct pci (215r2qzua21) + 4358 Mach64 CX (216l0sas25) 4361 AC'97 Audio Controller 4363 IXP SB300 SMBUS Controller - 4369 IXP SB300 ATA Controller + 4369 PATA 133 Controller (IXP 3xx) 436D IXP SB300 AC'97 Modem Controller 436E IXP SB300 Serial ATA Controller - 4370 IXP_AUDIO_400 IXP AC'97 Audio Controller + 4370 IXP AC'97 Audio Controller (IXP_AUDIO_400) 4371 IXP SB400 PCI-PCI Bridge - 4372 IXP SB400 SMBus + 4372 ATI SMBus (x200) 4373 IXP SB400 EHCI USB 2.0 Controller 4374 IXP SB400 OHCI USB Controller 4375 IXP SB400 OHCI USB Controller - 4376 ? Radeo SB400 = RS480 Southbridge/IDE Controller + 4376 PATA 133 Controller (SB4xx) 4377 IXP SB400 PCI-ISA Bridge 4378 IXP SB400 AC'97 Modem Controller 4379 IXP SB400 Serial ATA Controller 437A IXP SB400 Serial ATA Controller - 437B OEM Intel Corporation& Microsoft UAA Bus Driver for High Definition Audio + 437B IXP SB450 High Definition Audio Controller (Intel Corporation) 4380 IXP SB600 Serial ATA Controller 4381 IXP SB600 Serial ATA RAID Controller 4382 IXP SB600 AC'97 Audio Controller 4383 IXP SB600 High Definition Audio Controller 4384 IXP SB600 PCI to PCI Bridge - 4385 IXP SB600 SMBUS Controller + 4385 ATI SMBus (ATI RD600/RS600) 4386 IXP SB600 USB Controller (EHCI) 4387 IXP SB600 USB Controller (OHCI0) 4388 IXP SB600 USB Controller (OHCI1) 4389 IXP SB600 USB Controller (OHCI2) 438A IXP SB600 USB Controller (OHCI3) 438B IXP SB600 USB Controller (OHCI4) - 438C IXP SB600 ATA Controller - 438D IXP SB600 PCI to LPC Bridge + 438C ATI RD600/RS600 IDE Controller (RD600/RS600) + 438D ATK0110 ACPI Utility (1043.4.0.0) 438E IXP SB600 AC'97 Modem Controller + 4390 SB700 SATA Controller [IDE mode] + 4391 SB700 SATA Controller [AHCI mode] + 4392 SB700 SATA Controller [Non-RAID5 mode] + 4393 SB700 SATA Controller [RAID5 mode] + 4394 SB700 SATA Controller [SATA and FC Enabled] + 4395 SB SATA Controller [AHCI mode with HyperFlash-PCIE] + 4396 SB700 USB EHCI Controller + 4397 SB700 USB OHCI0 Controller + 4398 SB700 USB OHCI1 Controller + 4399 SB700 USB OHCI2 Controller + 439C PATA 133 Controller (SB7xx) + 439D SB700 LPC host controller 4437 Radeon Mobility 7000 IGP 4554 Mach64 ET - 4654 Mach64 VT 113--34004-104 - 4742 (GT-C2U2) ATI Rage Pro AGP 2X 8mb - 4744 Rage 3D Pro AGP 2x Rage 3D Pro AGP 2x - 4747 Rage 3D Pro GT-C2U2 - 4749 ATI 3D RAGE PRO AGP 2X (GT-C2U2) ATI ALL IN WONDER PRO (8MB) - 474C Rage XC PCI-66 k7 som+ - 474D Rage XL AGP 2x SLAT + 4654 113--34004-104 (Mach64 VT) + 4742 ATI 3D Rage Pro AGP 2X 8mb (gt-c2u2) ((GT-C2U2)) + 4744 Rage 3D Pro AGP 2x (Rage 3D Pro AGP 2x) + 4747 GT-C2U2 (Rage 3D Pro) + 4749 ATI ALL IN WONDER PRO (8MB) (RAGE PRO TURBO AGP 2X) + 474C k7 som+ (Rage XC PCI-66) + 474D SLAT (Rage XL AGP 2x) 474E Rage XC AGP 2x - 474F Rage XL PCI-66 I Need Driver for the Chip - 4750 ATI 3D Rage Pro 215GP ATI 3D Rage Pro 215GP + 474F I Need Driver for the Chip (Rage XL PCI-66) + 4750 ATI 3D Rage Pro 215GP (ATI 3D Rage Pro 215GP) 4751 Rage 3D Pro PCI (PQFP Package, Limited 3D) - 4752 Rage XL PCI + 4752 ATI On-Board VGA for HP Proliant 350 G3 (Rage XL PCI) 4753 Rage XC PCI - 4754 Mach 64 VT Rage 3D II Graphics Accelerator - 4755 Rage 3D II+pci 3d rage 2 + dvd + 4754 Rage 3D II Graphics Accelerator (Mach 64 VT) + 4755 3d rage 2 + dvd (Rage 3D II+pci) 4756 Rage 3D IIC PCI [Mach64 GT IIC] (PQFP Package) 4757 Rage 3D IIC AGP (BGA Package) - 4758 Mach64 GX (210888GX) - 4759 215r2qzua21 m3d agp card on agp slot + 4758 Mach 64 GT (210888GXControladores ATI 210888GX [Mach64 GX]) + 4759 m3d agp card on agp slot (215r2qzua21) 475A Rage 3D IIC AGP (PQFP Package) 4964 Radeon 9000 Series (RV250 Id) 4965 Radeon 9000 Series (RV250 Ie) - 4966 RV250 Radeon 9000/9000 Pro + 4966 Radeon 9000/9000 Pro (RV250) 4967 Radeon 9000 (RV250) - 496E RV250 Radeon 9000/9000 Pro - Secondary + 496E Radeon 9000/9000 Pro - Secondary (RV250) 496F Radeon 9000 (RV250) - Secondary 4A48 Radeon X800 Series (R420 JH) - 4A49 R423 Radeon X800 gt + 4A49 Radeon X800 gt (R423) 4A4A Radeon X800 Series - 4A4B Radeon X800 Series + 4A4B RADEON X800 XT (R420) 4A4C Radeon X800 Series (R420 JL) 4A4D FireGL X3 (R420 JM) 4A4E Radeon Mobility 9800 (M18 JN) @@ -390,7 +464,7 @@ 4A68 Radeon X800 Series Secondary 4A69 Radeon X800 Series - Secondary 4A6A Radeon X800 Series - Secondary - 4A6B Radeon X800 - Secondary + 4A6B RADEON X800 XT Secondary (R420) 4A6C Radeon X800 Series Secondary 4A6D FIREGL X3-256 Secondary 4A6F Radeon X800 SE Secondary @@ -405,32 +479,32 @@ 4B6B Radeon X850 PRO secondary 4B6C Radeon X850XT-PE Secondary 4C42 Rage 3D LT Pro AGP 133MHz (BGA-312 Package) - 4C44 Rage 3D LT Pro AGP Rage 3D LT Pro AGP 133 MHz + 4C44 Rage 3D LT Pro AGP 133 MHz (Rage 3D LT Pro AGP) 4C45 Rage Mobility M3 AGP - 4C46 Rage Mobility M3 AGP 2x - 4C47 ati rage pro Rage 3D LT-G + 4C46 0x4c46 (Mobility M3 AGP) + 4C47 Rage 3D LT-G (ati rage pro) 4C49 Rage 3D LT Pro PCI (BGA-312 Package) - 4C4D 01541014 Rage P/M Mobility AGP 2x - 4C4E 216lo sasa25 Rage Mobility l - 4C50 VEN_1002&DEV_4C50&SUBSYS_4C501002&REV_DC Rage 3D LT Pro PCI + 4C4D Rage P/M Mobility AGP 2x (01541014) + 4C4E Rage Mobility l (216lo sasa25) + 4C50 Rage 3D LT Pro PCI (VEN_1002&DEV_4C50&SUBSYS_4C501002&REV_DC) 4C51 Rage 3D LT Pro PCI (BGA-256 Package, Limited 3D) - 4C52 1241243 Rage P/M Mobility agp - 4C53 216L0SASA25 Rage L Mobility PCI + 4C52 Rage P/M Mobility PCI + 4C53 Rage L Mobility PCI (216L0SASA25) 4C54 Mach64 LT (264LT) - 4C57 fdds Radeon Mobility M7 LW + 4C57 Mobility Radeon 7500 (fdds) 4C58 FireGL Mobility - 4C59 Mobility 6 Radeon Mobility M6 LY + 4C59 Radeon Mobility M6 Series (Mobility 6) 4C5A Radeon Mobility M6 LZ 4C64 Radeon Mobility M9-GL 4C65 Radeon Mobility 9000 (R250 Le) - 4C66 ATI MOBILITY RADEON 9000 (Microsoft Corporation - Radeon Mobility M9 + 4C66 Radeon Mobility 9000 series (ATI MOBILITY RADEON 9000 (Microsoft Corporation -) 4C67 Radeon Mobility 9000 (R250 Lg) 4C6E Radeon Mobility 9000 - Secondary (R250 Ln) - 4D46 Rage Mobility 128 AGP 4x - 4D4C Rage Mobility 128 AGP + 4D46 Rage Mobility 128 AGP 4x (ATI mobility128) + 4D4C Rage Mobility 128 AGP (216l0sasa25) 4D50 Unified AVStream Driver 4D51 Unified AVStream Driver - 4D52 ATI Theater 550 Pro ATI Theater 550 Pro + 4D52 ATI Theater 550 Pro (ATI Theater 550 Pro) 4D53 Unified AVStream Driver 4E44 Radeon 9700/Pro, 9500 Series (R300) 4E45 Radeon 9700/9500 Series (R300) @@ -439,7 +513,7 @@ 4E48 Radeon 9800 Pro (R350) 4E49 Radeon 9800 (R350) (??) 4E4A Radeon 9800 XT (R350) - 4E4B FGL9800XT ATI FIREGL X2-256T + 4E4B ATI FIREGL X2-256T (FGL9800XT) 4E50 Mobility Radeon 9700 (M10 NP) (RV350) 4E51 Mobility Radeon 9600 (M10 NQ) 4E52 Mobility Radeon 9500/9600 (M10) (RV350) @@ -453,94 +527,94 @@ 4E68 Radeon 9800 Pro (R350) - Secondary 4E69 Radeon 9800 (R350) - Secondary 4E6A Radeon 9800 XT (R350) - Secondary - 4E6B FGL9800XT ATI FIREGL X2-256T Secondary + 4E6B ATI FIREGL X2-256T Secondary (FGL9800XT) 4E71 Radeon Mobility 9600 (M10 NQ) (secondary) 4F72 Radeon 9000 Series (RV250) 4F73 Radeon 9000 Series (RV250) (Secondary) - 5041 gt Rage 128 Pro PA PCI - 5042 Rage 128 Pro PB AGP 2x - 5043 1231324445 Rage 128 Pro PC AGP 4x - 5044 Rage 128 PD/Pro PCI (TMDS) + 5041 Rage 128 Pro PA PCI (gt) + 5042 Rage 128 Pro PB AGP 2x (rage 128 pf pro agp ) + 5043 Rage 128 PC/Pro AGP 4x + 5044 Rage 128 Pro PD PCI (rv100) 5045 Rage 128 PE/Pro AGP 2x (TMDS) 5046 Rage 128 PF/Pro AGP 4x (TMDS) - 5047 215R3BUA22 3d Rage pro agp 2x - 5048 Rage 128 Pro PH AGP Rage 128 Pro PH AGP 2x - 5049 bk2.0.2.vr001.001.002.002.004.025.prt3.ty.t Rage 128 Pro PI AGP 4x - 504A Rage 128 Pro PJ PCI Rage 128 Pro PJ PCI (TMDS) - 504B Rage 128 Pro PK AGP Rage 128 Pro PK AGP 2x (TMDS) - 504C Rage 128 Pro PL AGP 4x (TMDS) - 504D Rage 128 Pro PM PCI Rage 128 Pro PM PCI - 504E Rage 128 Pro PN AGP Rage 128 Pro PN AGP 2x - 504F Rage 128 Pro PO AGP Rage 128 Pro PO AGP 4x - 5050 Rage 128 Pro PP PCI Rage 128 Pro PP PCI (TMDS) - 5051 Rage 128 Pro PQ AGP Rage 128 Pro PQ AGP 2x (TMDS) - 5052 Rage 128 Pro PR AGP Rage 128 Pro PR AGP 4x (TMDS) - 5053 Rage 128 Pro PS PCI Rage 128 Pro PS PCI - 5054 Rage 128 Pro PT AGP Rage 128 Pro PT AGP 2x - 5055 rage 128 pro agp 4x tmds rage 128 pro agp 4x tmds - 5056 Rage 128 Pro PV PCI Rage 128 Pro PV PCI (TMDS) - 5057 Rage 128 Pro PW AGP Rage 128 Pro PW AGP 2x (TMDS) - 5058 Rage 128 Pro PX AGP 4x (TMDS) - 5144 Radeon 7200 QD SDR/DDR Radeon 7200 QD SDR/DDR + 5047 3d Rage pro agp 2x (215R3BUA22) + 5048 Rage 128 Pro PH AGP 2x (Rage 128 Pro PH AGP) + 5049 Rage 128 Pro PI AGP 4x (bk2.0.2.vr001.001.002.002.004.025.prt3.ty.t) + 504A Rage 128 Pro PJ PCI (TMDS) (Rage 128 Pro PJ PCI) + 504B Rage 128 Pro PK AGP 2x (TMDS) (Rage 128 Pro PK AGP) + 504C 4x (TMDS) (Rage 128 Pro PL AGP) + 504D Rage 128 Pro PM PCI (Rage 128 Pro PM PCI) + 504E Rage 128 Pro PN AGP 2x (Rage 128 Pro PN AGP) + 504F Rage 128 Pro PO AGP 4x (Rage 128 Pro PO AGP) + 5050 Rage 128 Pro PP PCI (TMDS) (Scheda Grafica Standard PCI(VGA)) + 5051 Rage 128 Pro PQ AGP 2x (TMDS) (Rage 128 Pro PQ AGP) + 5052 Rage 128 Pro PR AGP 4x (TMDS) (Rage 128 Pro PR AGP) + 5053 Rage 128 Pro PS PCI (Rage 128 Pro PS PCI) + 5054 Rage 128 Pro PT AGP 2x (Rage 128 Pro PT AGP) + 5055 rage 128 pro agp 4x tmds (rage 128 pro agp 4x tmds) + 5056 Rage 128 Pro PV PCI (TMDS) (Rage 128 Pro PV PCI) + 5057 Rage 128 Pro PW AGP 2x (TMDS) (Rage 128 Pro PW AGP) + 5058 PX AGP 4x (TMDS) (Rage 128 Pro) + 5144 Radeon 7200 QD SDR/DDR (Radeon 7200 QD SDR/DDR) 5145 Radeon QE 5146 Radeon QF 5147 Radeon QG - 5148 R200 Radeon R200 QH + 5148 Radeon R200 QH (R200) 5149 Radeon R200 QI 514A Radeon R200 QJ 514B Radeon R200 QK - 514C R200 Radeon 8500 / 8500LE + 514C Radeon 8500 / 8500LE (R200) 514D Radeon 9100 Series (R200) 514E Radeon R200 QM 514F Radeon R200 QN 5154 Radeon 8500 R200 QT 5155 Radeon 9100 R200 QU 5157 Radeon 7500 Series (RV200) - 5158 radeon 9700 or 9200 Radeon 7500 QX - 5159 RV100 Radeon 7000 / Radeon VE + 5158 Radeon 7500 QX (radeon 9700 or 9200) + 5159 Radeon 7000 / Radeon VE (RV100) 515A Radeon VE QZ - 515E Radeon ES1000 Radeon ES1000 + 515E Radeon ES1000 (Radeon ES1000) 515F ES1000 - 5168 Radeon R200 Qh + 5168 Radeon R200 Qh (ati) 5169 Radeon R200 Qi 516A Radeon R200 Qj 516B Radeon R200 Qk - 516C Radeon 8500 / 8500LE + 516C Radeon 8500 / 8500LE (E7505) 516D Radeon 9100 Series (R200) - Secondary - 5245 215R46ASA22 Rage 128 GL PCI - 5246 Rage 128 PRO Rage 32MB + 5245 Rage 128 GL PCI (215R46ASA22) + 5246 Rage 32MB (Rage 128 PRO) 5247 Rage 128 RG - 524B g01080-108 Rage 128 VR RK PCI - 524C Rage 128 VR RL AGP 2x - 5345 Rage 128 4x SE PCI - 5346 Rage 128 SF 4x AGP 2x Rage 128 SF 4x AGP 2x - 5347 Rage 128 SG 4x AGP 4x + 524B Rage 128 VR RK PCI (g01080-108) + 524C Rage 128 RL/VR AGP 2x + 5345 Rage 128 SE/4x PCI + 5346 Rage 128 SF 4x AGP 2x (Rage 128 SF 4x AGP 2x) + 5347 Rage 128 SG/4x AGP 4x 5348 Rage 128 4x SH - 534B Rage 128 SK PCI Rage 128 4x SK PCI - 534C Rage 128 SL AGP 2x Rage 128 4x SL AGP 2x - 534D Rage 128 SM AGP 4x Rage 128 4x SM AGP 4x + 534B Rage 128 4x SK PCI (Rage 128 SK PCI) + 534C Rage 128 4x SL AGP 2x (Rage 128 SL AGP 2x) + 534D Rage 128 4x SM AGP 4x (Rage 128 SM AGP 4x) 534E Rage 128 4x 5354 Mach 64 ST - 5446 Rage 128 PRO ULTRA Video Controller (VGA Compatible) + 5446 Video Controller (VGA Compatible) (ewmewm) 544C Rage 128 Pro TL 5452 Rage 128 Pro TR 5453 Rage 128 Pro Ultra TS 5454 Rage 128 Pro Ultra TT - 5455 Rage 128 Pro Ultra TU - 5460 RV370 Radeon X300 Mobility (M22) + 5455 Rade 128 Pro Ultra TU + 5460 Radeon X300 Mobility (M22) (RV370) 5461 Mobility Radeon X300 5462 Mobility Radeon X600 SE 5464 FireGL GL (M22) 5548 Radeon X800 (R423 UH) 5549 Radeon X800 Pro 554A Radeon X800 XT Platinum - 554B Radeon X800 SE + 554B Primary (X800GT) 554C R430 XTP - 554D R430 Radeon X800 XL + 554D Radeon X800 XL (R430) 554E Radeon X800 Series 554F Radeon X800 Series 5550 FireGL V7100 (R423) - 5551 R423GL-SE ATI FIREGL V5100 PCI-EX Primary + 5551 ATI FIREGL V5100 PCI-EX Primary (R423GL-SE) 5552 FireGL V5100 (R423 UR) 5554 FireGL V7100 (R423 UT) 5568 Radeon X800 Series Secondary @@ -548,51 +622,52 @@ 556A Radeon X800 XT Platinum - Secondary 556B Radeon X800 SE - Secondary 556C R430 XTP Secondary - 556D R430 Radeon X800 XL - Secondary + 556D Radeon X800 XL - Secondary (R430) 556E Radeon X800 Series - Secondary 556F Radeon X800 Series - Secondary 5570 FIREGL V7100 Secondary - 5571 R423GL-SE ATI FIREGL V5100 PCI-EX Secondary + 5571 ATI FIREGL V5100 PCI-EX Secondary (R423GL-SE) 564A Mobility FIREGL V5000 (M26) 564B Mobility FIREGL V5000 564F Mobility Radeon X700 XL PCIe (M26) 5652 Mobility Radeon X700 5653 Mobility Radeon X700 - 5654 215VT2CA42 Mach 64 VT VIDEO XPRESSION + 5654 Mach 64 VT VIDEO XPRESSION (215VT2CA42) 5655 Mach 64 VT3 - 5656 Mach 64 VT4 PCI Mach 64 VT4 PCI + 5656 Mach 64 VT4 PCI (Mach 64 VT4 PCI) 5657 Radeon X550/X700 Series + 566F RADEON X700 SERIES SECONDARY 5673 Mobility Radeon X700 Secondary 5677 Radeon X550/X700 Series Secondary 5830 RS300/100 Host Bridge 5831 RS300/133 Host Bridge 5832 RS300/166 Host Bridge 5833 Radeon IGP9100 RS300/200 Host Bridge - 5834 RS300 Radeon 9100 IGP + 5834 Radeon 9100 IGP (RS300) 5835 Mobility Radeon 9100 IGP (RS300M AGP) - 5838 Radeon 9100 IGP AGP Bridge + 5838 AGP Bridge (Radeon 9100 IGP) 5854 Radeon XPRESS 200 Series Secondary 5874 Radeon XPRESS 200 Series Secondary - 5940 RV280 Radeon 9200 Pro - Secondary - 5941 RV280 ATI Radeon 9200 - Secondary + 5940 www.ati.comRadeon 9200 Pro - Secondary (RV280) + 5941 ATI Radeon 9200 - Secondary (RV280) 5942 Radeon 9000U Family - Secondary 5944 Radeon 9200SE PCI (RV280) 5950 RS480 Host Bridge 5951 Radeon Xpress 200 (RS480/RS482/RX480/RX482) Host bridge 5952 CrossFire Xpress 3200 (RD580) Chipset Host Bridge - 5954 na ATI Radeon Xpress 200 Series - RS480 - 5955 ??? Mobility Radeon XPRESS 200 + 5954 ATI Radeon Xpress 200 Series - RS480 (na) + 5955 Mobility Radeon XPRESS 200 5956 RD790 GFX Dual Slot 5957 RX790 GFX Single Slot 5958 RD780 GFX Dual Slot - 5960 RV280 Radeon 9200 Pro - 5961 RV280 ATI RADEON 9200 se agp + 5960 Radeon 9200 Pro (RV280) + 5961 ATI RADEON 9200 se agp (RV280) 5962 Radeon 9000U Family - 5964 Radeon 9200 Radeon 9200 SE Series - 5965 Nvidia FireMV 2200 + 5964 Radeon 9200 SE Series (Radeon 9200) + 5965 FireMV 2200 (Nvidia) 5969 ES1000 5974 Radeon XPRESS 200 Series - 5975 Radeon XPRESS 200M SERIES + 5975 ATI Radeon X1100 (Radeon Xpress 1100) 5978 RD790 PCI to PCI bridge (external gfx0 port A) 5979 RD790 PCI to PCI bridge (external gfx0 port B) 597A RD790 PCI to PCI bridge (PCIe gpp port A) @@ -623,7 +698,7 @@ 5A30 RS400/100 Host Bridge 5A31 RS400/133 Host Bridge 5A32 RS400/166 Host Bridge - 5A33 RC410 Northbridge: Radeon Xpress 200 + 5A33 Northbridge: Radeon Xpress 200 (RC410) 5A34 RS480 PCI-X Root Port 5A36 RS480 PCI Bridge 5A37 RS480 PCI Bridge @@ -631,43 +706,43 @@ 5A39 RS480 PCI Bridge 5A3F RS480 PCI Bridge 5A41 Radeon XPRESS 200 - 5A42 X200M SUBSYS_11821043&REV_00\4&1CF2FBB4&0&2808 + 5A42 SUBSYS_11821043&REV_004&1CF2FBB4&0&2808 (X200M) 5A43 Radeon XPRESS 200 Series Secondary - 5A61 Radeon XPress 200 (RC410) Radeon Xpress 200 (RC410) VGA card - 5A62 Radeon Xpress 200M (RS410) + 5A61 Radeon Xpress 200 (RC410) VGA card (Radeon XPress 200 (RC410)) + 5A62 ATI RADEON XPRESS 1100 (RC410M) 5A63 Radeon XPRESS 200 Series Secondary - 5B60 Radeon X300 ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)] + 5B60 ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)] (Radeon X300) 5B61 RV371 - 5B62 RV380 RADEON X600 Series 265MB - 5B63 Radeon X550 Series + 5B62 RADEON X600 Series 265MB (RV380) + 5B63 ATI Radoen X1050 (Unknown) 5B64 FireGL V3100 (RV370 5B64) 5B65 FireGL D1100 (RV370 5B65) 5B66 RV370X - 5B70 Radeon X300 Series - Secondary + 5B70 Radeon X300/X550/X1050 Series - Secondary 5B71 RV371 Secondary 5B72 Radeon X600 Series - Secondary 5B73 Radeon X550 Series - Secondary - 5B74 FireGL V3100 (RV370)- Secondary + 5B74 ATI 128MB PCI Express x16 ATI FireGL V3100 (FireGL V3100) 5B75 FIREMV 2200 Secondary 5B76 RV370X Secondary - 5C61 bk-ati ver008.016m.085.006 Mobility Radeon 9200 - 5C63 RV280 (M9+) Mobility Radeon 9200 + 5C61 Mobility Radeon 9200 (bk-ati ver008.016m.085.006) + 5C63 Mobility Radeon 9200 (RV280 (M9+)) 5D44 Radeon 9200 SE Series - Secondary (RV280) - 5D45 RV280 ATI FireMV 2200 PCI Secondary + 5D45 ATI FireMV 2200 PCI Secondary (RV280) 5D48 Mobility Radeon X800 XT 5D49 Mobility FireGL V5100 - 5D4A Mobility Radeon X800 PCI-E Graphics adapter from Clevo D900T notebook + 5D4A PCI-E Graphics adapter from Clevo D900T notebook (Mobility Radeon X800) 5D4C R480 CONSUMER 4P - 5D4D Radeon XT850 Radeon XT850 + 5D4D Radeon XT850 (Radeon XT850) 5D4E Radeon X800 GT - 5D4F r480 x800gto 256 pci-e + 5D4F x800gto 256 pci-e (r480) 5D50 FIREGL V7200 - 5D52 Radeon X850 Series + 5D52 Radeon X850XT (PCIE) Primary (R480) 5D57 Radeon X800 XT 5D6C R480 CONSUMER 4P Secondary 5D6D Radeon X850 Series - Secondary 5D6E Radeon X800 GT Secondary - 5D6F Radeon X850 Series - Secondary + 5D6F Radeon X850 Pro 256M (01131002) 5D70 FIREGL V7200 Secondary 5D72 Radeon X850 Series - Secondary 5D77 Radeon X800 XT - Secondary @@ -685,13 +760,13 @@ 5E6D Radeon X700 Series - Secondary 5E6F Radeon X700 SE - Secondary 5F57 Radeon X800XT PCIe (R423) - 700F A3/U1 PCI to AGP Bridge - 7010 RS200 PCI to AGP Bridge + 700F PCI to AGP Bridge (A3/U1) + 7010 PCI to AGP Bridge (RS200) 7100 Radeon X1800 Series 7101 Mobility Radeon X1800 XT 7102 Radeon Mobility X1800 7103 Mobility FireGL V7200 - 7104 FireGL V7200 (R520 GL) + 7104 ATI FireGL 7200 or 3200 7105 R520 [FireGL] 7106 Mobility FireGL V7100 7108 Radeon Mobility X1800 @@ -700,7 +775,7 @@ 710B Radeon X1800 710C Radeon X1800 710E FIREGL V7300 - 710F FIREGL V7350 + 710F ATI FireGL (V7350) 7120 Radeon X1800 Series Secondary 7124 FireGL V7200 (R520 GL) - Secondary 7125 Radeon X1800 Series Secondary @@ -710,15 +785,15 @@ 712B Radeon X1800 Series Secondary 712C Radeon X1800 Series Secondary 712E FIREGL V7300 Secondary - 712F FIREGL V7350 Secondary + 712F ATI FireGL (V 7350 Secondary) 7140 Radeon X1300 Series 7141 RV505 - 7142 N/A Radeon X1300 Pro or X1550 + 7142 Radeon X1300 Pro or X1550 (rv515) 7143 Radeon X1550 Series (RV505) - 7145 x1400 PCI\VEN_1002&DEV_7145&SUBSYS_20031028&REV_00\4&1C9EC085&0&0008 - 7146 N/A Radeon X1300 XGE + 7145 PCIVEN_104C&DEV_803B&SUBSYS_FF101179&REV_00 (x1400) + 7146 Radeon X1300 XGE (N/A) 7147 Radeon X1550 64-bit (RV505) - 7149 216CZJAKA12FAG ATI Mobility Radeon X1300, M52-64 + 7149 ATI Mobility Radeon X1300, M52-64 (216CZJAKA12FAG) 714A Mobility Radeon X1300 714B Mobility Radeon X1300 714C Mobility Radeon X1300 @@ -726,7 +801,7 @@ 714E Radeon X1300 (RV515) 714F RV505 7151 RV505 - 7152 FireGL V3300 (RV515GL) + 7152 HP Fire GL v3300 (Fire GL v3300) 7153 FireGL V3350 (RV515GL) 715E Radeon X1300 Series 715F Radeon X1300 Series @@ -742,50 +817,61 @@ 716F RV505 Secondary 7171 RV505 Secondary 7172 FireGL V3300 (RV515GL) Secondary + 7173 FireGL V3350 (RV515GL) Secondary 717E Radeon X1300 Series Secondary 717F Radeon X1300 Series Secondary 7180 Radeon X1300 Series 7181 Radeon X1600 Series (RV516XT) - 7183 RV505 Radeon X1300/X1550 Series - 7186 Mobility Radeon X1450 PCI\VEN_1002&DEV_7186&SUBSYS_12311043&REV_00\4&2D404BB6&0&0008 - 7187 Radeon 1300 Radeon 1300 + 7183 Radeon X1300/X1550 Series (RV505) + 7186 PCIVEN_1002&DEV_7186&SUBSYS_12311043&REV_004&2D404BB6&0&0008 (Mobility Radeon X1450) + 7187 Radeon 1300 (Radeon 1300) + 7188 ATI Mobility Radeon X2300 (Mobility X2300) + 718A Mobility Radeon X2300 Series 718B Mobility Radeon X1350 718C Mobility Radeon X1350 718D Mobility Radeon X1450 718F Radeon X1300 Series 7193 Radeon X1550 Series 7196 Mobility Radeon X1350 + 719B FireMV 2250 719F Radeon X1550 Series 71A0 Radeon X1300 Series Secondary 71A1 Radeon X1600 Series (RV516XT) Secondary 71A3 Radeon X1300 Series Secondary - 71A7 Radeon 1300 Radeon 1300 Secondary + 71A7 Radeon 1300 Secondary (Radeon 1300) 71B3 Radeon X1550 Series Secondary + 71BB FireMV 2250 Secondary 71C0 Radeon X1600 Series - 71C1 Radeon X1650 Series - 71C2 ATI X1600 Pro PCI-E ATI X1600 Pro PCI-E + 71C1 Radeon X1650 Pro (RV535) + 71C2 ATI X1600 Pro PCI-E (ATI X1600 Pro PCI-E) 71C3 Radeon X1600 Series 71C4 Mobility FIREGL V5200 - 71C5 RV530? Radeon X1600 Mobility + 71C5 Radeon X1600 Mobility (RV530?) 71C6 Radeon X1650 Series (RV530 LE) + 71C7 RADEON X1650 SERIES 71CD Radeon X1600 Series 71CE Radeon X1600 PRO / X1300XT (RV530 VE) - 71D2 FIREGL V3400 + 71D2 FireGL V3400 (RV530GL) + 71D4 Mobility FireGL V5250 (M56GL) 71D5 Mobility Radeon X1700 (M66-P) 71D6 Mobility Radeon X1700 (M66-XT) 71DA FIREGL V5200 - 71DE RV530 SE + 71DE Ati Radeon X2500 (Uknown) 71E0 Radeon X1600 Series Secondary 71E1 Radeon X1650 Series Secondary 71E2 Radeon X1600 Series Secondary 71E3 Radeon X1600 Series Secondary 71E5 M56 Secondary 71E6 Radeon X1650 Series Secondary (RV530 LE) + 71E7 RADEON X1650 SERIES SECONDARY 71ED Radeon X1600 Series Secondary 71EE Radeon X1600 PRO / X1300XT Secondary (RV530 VE) - 71F2 FIREGL V3400 Secondary + 71F2 ATI FireGL V3400 Secondary (RV530GL) 71FA FIREGL V5200 Secondary 71FE RV530 SE Secondary + 7205 S3G Unichrome IGP KM400/KN400 (1106) + 7210 Mobility Radeon X2100 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From kmacy at FreeBSD.org Sat Jun 13 22:02:56 2009 From: kmacy at FreeBSD.org (Kip Macy) Date: Sat Jun 13 22:03:13 2009 Subject: svn commit: r194131 - stable/7/sys/boot/i386/loader Message-ID: <200906132202.n5DM2tQi025447@svn.freebsd.org> Author: kmacy Date: Sat Jun 13 22:02:55 2009 New Revision: 194131 URL: http://svn.freebsd.org/changeset/base/194131 Log: comment out zfs support until I have time for a proper fix Modified: stable/7/sys/boot/i386/loader/Makefile Modified: stable/7/sys/boot/i386/loader/Makefile ============================================================================== --- stable/7/sys/boot/i386/loader/Makefile Sat Jun 13 21:55:08 2009 (r194130) +++ stable/7/sys/boot/i386/loader/Makefile Sat Jun 13 22:02:55 2009 (r194131) @@ -16,12 +16,12 @@ LIBFIREWIRE= ${.OBJDIR}/../libfirewire/l .endif # Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support -.if ${MK_ZFS} != "no" -CFLAGS+= -DLOADER_ZFS_SUPPORT -LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a -.else +#.if ${MK_ZFS} != "no" +#CFLAGS+= -DLOADER_ZFS_SUPPORT +#LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a +#.else LIBZFS= -.endif +#.endif # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) From jilles at FreeBSD.org Sun Jun 14 17:04:00 2009 From: jilles at FreeBSD.org (Jilles Tjoelker) Date: Sun Jun 14 17:04:11 2009 Subject: svn commit: r194199 - stable/7/bin/chflags Message-ID: <200906141703.n5EH3x04054944@svn.freebsd.org> Author: jilles Date: Sun Jun 14 17:03:59 2009 New Revision: 194199 URL: http://svn.freebsd.org/changeset/base/194199 Log: MFC r192687: fix chflags -h PR: bin/131999 Submitted by: bde Approved by: ed (mentor) Modified: stable/7/bin/chflags/ (props changed) stable/7/bin/chflags/chflags.c Modified: stable/7/bin/chflags/chflags.c ============================================================================== --- stable/7/bin/chflags/chflags.c Sun Jun 14 17:00:35 2009 (r194198) +++ stable/7/bin/chflags/chflags.c Sun Jun 14 17:03:59 2009 (r194199) @@ -115,7 +115,7 @@ main(int argc, char *argv[]) fts_options |= FTS_LOGICAL; } } else - fts_options = FTS_LOGICAL; + fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL; /* XXX: Why don't chflags and lchflags have compatible prototypes? */ if (hflag) From jilles at FreeBSD.org Sun Jun 14 17:05:55 2009 From: jilles at FreeBSD.org (Jilles Tjoelker) Date: Sun Jun 14 17:06:13 2009 Subject: svn commit: r194200 - stable/7/bin/ps Message-ID: <200906141705.n5EH5sHg055022@svn.freebsd.org> Author: jilles Date: Sun Jun 14 17:05:54 2009 New Revision: 194200 URL: http://svn.freebsd.org/changeset/base/194200 Log: MFC r192688: fix nonsense in ps etime field for swapped out processes PR: bin/123069 Submitted by: Vladimir Kozbin Approved by: ed (mentor) Modified: stable/7/bin/ps/ (props changed) stable/7/bin/ps/print.c Modified: stable/7/bin/ps/print.c ============================================================================== --- stable/7/bin/ps/print.c Sun Jun 14 17:03:59 2009 (r194199) +++ stable/7/bin/ps/print.c Sun Jun 14 17:05:54 2009 (r194200) @@ -572,6 +572,10 @@ elapsed(KINFO *k, VARENT *ve) char obuff[128]; v = ve->var; + if (!k->ki_valid) { + (void)printf("%-*s", v->width, "-"); + return; + } val = now - k->ki_p->ki_start.tv_sec; days = val / (24 * 60 * 60); val %= 24 * 60 * 60; From kib at FreeBSD.org Sun Jun 14 18:04:23 2009 From: kib at FreeBSD.org (Konstantin Belousov) Date: Sun Jun 14 18:04:34 2009 Subject: svn commit: r194205 - in stable/7/sys: . contrib/pf dev/ath/ath_hal fs/pseudofs Message-ID: <200906141804.n5EI4MOO056333@svn.freebsd.org> Author: kib Date: Sun Jun 14 18:04:22 2009 New Revision: 194205 URL: http://svn.freebsd.org/changeset/base/194205 Log: MFC r193176: Unlock the pseudofs vnode before calling fill method for pfs_readlink(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/fs/pseudofs/pseudofs_vnops.c Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/7/sys/fs/pseudofs/pseudofs_vnops.c Sun Jun 14 18:01:35 2009 (r194204) +++ stable/7/sys/fs/pseudofs/pseudofs_vnops.c Sun Jun 14 18:04:22 2009 (r194205) @@ -746,9 +746,10 @@ pfs_readlink(struct vop_readlink_args *v struct pfs_node *pn = pvd->pvd_pn; struct uio *uio = va->a_uio; struct proc *proc = NULL; + struct thread *td = curthread; char buf[PATH_MAX]; struct sbuf sb; - int error; + int error, locked; PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); @@ -770,14 +771,19 @@ pfs_readlink(struct vop_readlink_args *v _PHOLD(proc); PROC_UNLOCK(proc); } + vhold(vn); + locked = VOP_ISLOCKED(vn, td); + VOP_UNLOCK(vn, 0, td); /* sbuf_new() can't fail with a static buffer */ sbuf_new(&sb, buf, sizeof buf, 0); - error = pn_fill(curthread, proc, pn, &sb, NULL); + error = pn_fill(td, proc, pn, &sb, NULL); if (proc != NULL) PRELE(proc); + vn_lock(vn, locked | LK_RETRY, td); + vdrop(vn); if (error) { sbuf_delete(&sb); From ps at FreeBSD.org Sun Jun 14 20:12:14 2009 From: ps at FreeBSD.org (Paul Saab) Date: Sun Jun 14 20:12:20 2009 Subject: svn commit: r194211 - stable/7/lib/libstand Message-ID: <200906142012.n5EKCDRY059167@svn.freebsd.org> Author: ps Date: Sun Jun 14 20:12:12 2009 New Revision: 194211 URL: http://svn.freebsd.org/changeset/base/194211 Log: Merge r192679 Increase the number of available file descriptors to 64. This fixes the reported zfsboot problems for systems where more than seven drives are part of ZFS pools. Modified: stable/7/lib/libstand/ (props changed) stable/7/lib/libstand/stand.h Modified: stable/7/lib/libstand/stand.h ============================================================================== --- stable/7/lib/libstand/stand.h Sun Jun 14 19:53:52 2009 (r194210) +++ stable/7/lib/libstand/stand.h Sun Jun 14 20:12:12 2009 (r194211) @@ -167,7 +167,7 @@ struct open_file { #define SOPEN_RASIZE 512 }; -#define SOPEN_MAX 8 +#define SOPEN_MAX 64 extern struct open_file files[]; /* f_flags values */ From kmacy at FreeBSD.org Sun Jun 14 21:11:40 2009 From: kmacy at FreeBSD.org (Kip Macy) Date: Sun Jun 14 21:11:46 2009 Subject: svn commit: r194214 - stable/7 Message-ID: <200906142111.n5ELBdWv060525@svn.freebsd.org> Author: kmacy Date: Sun Jun 14 21:11:39 2009 New Revision: 194214 URL: http://svn.freebsd.org/changeset/base/194214 Log: further clarify ZFS upgrade requirements Modified: stable/7/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Sun Jun 14 21:04:54 2009 (r194213) +++ stable/7/UPDATING Sun Jun 14 21:11:39 2009 (r194214) @@ -18,7 +18,8 @@ portupgrade. 20090520: Update ZFS to version 13. ZFS users will need to re-build - kernel and world. Existing pools will continue to work + and install both kernel and world simultaneously in order + for the ZFS tools to work. Existing pools will continue to work without upgrade. If a pool is upgraded it will no longer be usable by older kernel revs. ZFS send / recv between pool version 6 and pool version 13 is not supported. From des at FreeBSD.org Sun Jun 14 23:11:11 2009 From: des at FreeBSD.org (Dag-Erling Smorgrav) Date: Sun Jun 14 23:11:23 2009 Subject: svn commit: r194219 - in stable/7/contrib/groff: . font/devutf8 Message-ID: <200906142311.n5ENB9WI064758@svn.freebsd.org> Author: des Date: Sun Jun 14 23:11:09 2009 New Revision: 194219 URL: http://svn.freebsd.org/changeset/base/194219 Log: merge r192561: fix hyphens. Modified: stable/7/contrib/groff/ (props changed) stable/7/contrib/groff/font/devutf8/R.proto Modified: stable/7/contrib/groff/font/devutf8/R.proto ============================================================================== --- stable/7/contrib/groff/font/devutf8/R.proto Sun Jun 14 22:35:33 2009 (r194218) +++ stable/7/contrib/groff/font/devutf8/R.proto Sun Jun 14 23:11:09 2009 (r194219) @@ -726,7 +726,7 @@ st 24 0 0x220B product 24 0 0x220F coproduct 24 0 0x2210 sum 24 0 0x2211 -\- 24 0 0x2212 +\- 24 0 0x002D mi " -+ 24 0 0x2213 ** 24 0 0x2217 From brian at FreeBSD.org Mon Jun 15 07:17:56 2009 From: brian at FreeBSD.org (Brian Somers) Date: Mon Jun 15 07:18:23 2009 Subject: svn commit: r194234 - stable/7/sbin/fdisk Message-ID: <200906150717.n5F7HtaW082406@svn.freebsd.org> Author: brian Date: Mon Jun 15 07:17:55 2009 New Revision: 194234 URL: http://svn.freebsd.org/changeset/base/194234 Log: MFC: r192745: Enhance the 'p' command so that it understands size qualifiers (K/M/G) and so that it understands '*' as 'DTRT'. PR: 68312 Modified: stable/7/sbin/fdisk/ (props changed) stable/7/sbin/fdisk/fdisk.8 stable/7/sbin/fdisk/fdisk.c Modified: stable/7/sbin/fdisk/fdisk.8 ============================================================================== --- stable/7/sbin/fdisk/fdisk.8 Mon Jun 15 04:31:34 2009 (r194233) +++ stable/7/sbin/fdisk/fdisk.8 Mon Jun 15 07:17:55 2009 (r194234) @@ -372,6 +372,31 @@ starting at sector for .Ar length sectors. +If the +.Ar start +or +.Ar length +is suffixed with a +.Em K , +.Em M +or +.Em G , +it is taken as a +.Em Kilobyte , +.Em Megabyte +or +.Em Gigabyte +measurement respectively. +If the +.Ar start +is given as +.Qq * +it is set to the value of the previous partition end. +If the +.Ar length +is given as +.Qq * +the partition end is set to the end of the disk. .Pp Only those slices explicitly mentioned by these lines are modified; any slice not referenced by a @@ -421,6 +446,17 @@ for 2503871 sectors (note: these numbers downwards to correspond to head and cylinder boundaries): .Pp .Dl "p 1 165 1 2503871" +.Pp +Example: to set slices 1, 2 and 4 to +.Fx +slices, the first being 2 Gigabytes, the second being 10 Gigabytes and the +forth being the remainder of the disk (again, numbers will be rounded +appropriately): +.Pp +.Dl "p 1 165 63 2G" +.Dl "p 2 165 * 10G" +.Dl "p 3 0 0 0" +.Dl "p 4 165 * *" .It Ic a Ar slice Make .Ar slice Modified: stable/7/sbin/fdisk/fdisk.c ============================================================================== --- stable/7/sbin/fdisk/fdisk.c Mon Jun 15 04:31:34 2009 (r194233) +++ stable/7/sbin/fdisk/fdisk.c Mon Jun 15 07:17:55 2009 (r194234) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); int iotest; +#define NOSECTORS ((u_int32_t)-1) #define LBUF 100 static char lbuf[LBUF]; @@ -107,6 +108,7 @@ typedef struct cmd { struct arg { char argtype; int arg_val; + char *arg_str; } args[MAX_ARGS]; } CMD; @@ -1001,16 +1003,23 @@ parse_config_line(char *line, CMD *comma */ while (1) { while (isspace(*cp)) ++cp; + if (*cp == '\0') + break; /* eol */ if (*cp == '#') break; /* found comment */ if (isalpha(*cp)) command->args[command->n_args].argtype = *cp++; - if (!isdigit(*cp)) - break; /* assume end of line */ end = NULL; command->args[command->n_args].arg_val = strtol(cp, &end, 0); - if (cp == end) - break; /* couldn't parse number */ + if (cp == end || (!isspace(*end) && *end != '\0')) { + char ch; + end = cp; + while (!isspace(*end) && *end != '\0') ++end; + ch = *end; *end = '\0'; + command->args[command->n_args].arg_str = strdup(cp); + *end = ch; + } else + command->args[command->n_args].arg_str = NULL; cp = end; command->n_args++; } @@ -1109,6 +1118,33 @@ process_geometry(CMD *command) return (status); } +static u_int32_t +str2sectors(const char *str) +{ + char *end; + unsigned long val; + + val = strtoul(str, &end, 0); + if (str == end || *end == '\0') { + warnx("ERROR line %d: unexpected size: \'%s\'", + current_line_number, str); + return NOSECTORS; + } + + if (*end == 'K') + val *= 1024UL / secsize; + else if (*end == 'M') + val *= 1024UL * 1024UL / secsize; + else if (*end == 'G') + val *= 1024UL * 1024UL * 1024UL / secsize; + else { + warnx("ERROR line %d: unexpected modifier: %c " + "(not K/M/G)", current_line_number, *end); + return NOSECTORS; + } + + return val; +} static int process_partition(CMD *command) @@ -1134,8 +1170,48 @@ process_partition(CMD *command) partp = ((struct dos_partition *) &mboot.parts) + partition - 1; bzero((char *)partp, sizeof (struct dos_partition)); partp->dp_typ = command->args[1].arg_val; - partp->dp_start = command->args[2].arg_val; - partp->dp_size = command->args[3].arg_val; + if (command->args[2].arg_str != NULL) { + if (strcmp(command->args[2].arg_str, "*") == 0) { + int i; + partp->dp_start = dos_sectors; + for (i = 1; i < partition; i++) { + struct dos_partition *prev_partp; + prev_partp = ((struct dos_partition *) + &mboot.parts) + i - 1; + if (prev_partp->dp_typ != 0) + partp->dp_start = prev_partp->dp_start + + prev_partp->dp_size; + } + if (partp->dp_start % dos_sectors != 0) { + prev_head_boundary = partp->dp_start / + dos_sectors * dos_sectors; + partp->dp_start = prev_head_boundary + + dos_sectors; + } + } else { + partp->dp_start = str2sectors(command->args[2].arg_str); + if (partp->dp_start == NOSECTORS) + break; + } + } else + partp->dp_start = command->args[2].arg_val; + + if (command->args[3].arg_str != NULL) { + if (strcmp(command->args[3].arg_str, "*") == 0) + partp->dp_size = ((disksecs / dos_cylsecs) * + dos_cylsecs) - partp->dp_start; + else { + partp->dp_size = str2sectors(command->args[3].arg_str); + if (partp->dp_size == NOSECTORS) + break; + } + prev_cyl_boundary = ((partp->dp_start + partp->dp_size) / + dos_cylsecs) * dos_cylsecs; + if (prev_cyl_boundary > partp->dp_start) + partp->dp_size = prev_cyl_boundary - partp->dp_start; + } else + partp->dp_size = command->args[3].arg_val; + max_end = partp->dp_start + partp->dp_size; if (partp->dp_typ == 0) { From brian at FreeBSD.org Mon Jun 15 07:24:18 2009 From: brian at FreeBSD.org (Brian Somers) Date: Mon Jun 15 07:24:35 2009 Subject: svn commit: r194235 - stable/7/sbin/dhclient Message-ID: <200906150724.n5F7OHtp082658@svn.freebsd.org> Author: brian Date: Mon Jun 15 07:24:16 2009 New Revision: 194235 URL: http://svn.freebsd.org/changeset/base/194235 Log: MFC: r193765: Fix an off by one error when we limit append/prepend text sizes based on our internal buffer sizes. When we 'append', assume we're appending to text. Some MS dhcp servers will give us a string with the length including the trailing NUL. when we 'append domain-name', we get something like "search x.y\000 z" in resolv.conf :( Modified: stable/7/sbin/dhclient/ (props changed) stable/7/sbin/dhclient/dhclient.c Modified: stable/7/sbin/dhclient/dhclient.c ============================================================================== --- stable/7/sbin/dhclient/dhclient.c Mon Jun 15 07:17:55 2009 (r194234) +++ stable/7/sbin/dhclient/dhclient.c Mon Jun 15 07:24:16 2009 (r194235) @@ -1977,7 +1977,7 @@ supersede: len = ip->client-> config->defaults[i].len + lease->options[i].len; - if (len > sizeof(dbuf)) { + if (len >= sizeof(dbuf)) { warning("no space to %s %s", "prepend option", dhcp_options[i].name); @@ -1996,24 +1996,34 @@ supersede: dp[len] = '\0'; break; case ACTION_APPEND: + /* + * When we append, we assume that we're + * appending to text. Some MS servers + * include a NUL byte at the end of + * the search string provided. + */ len = ip->client-> config->defaults[i].len + lease->options[i].len; - if (len > sizeof(dbuf)) { + if (len >= sizeof(dbuf)) { warning("no space to %s %s", "append option", dhcp_options[i].name); goto supersede; } - dp = dbuf; - memcpy(dp, + memcpy(dbuf, lease->options[i].data, lease->options[i].len); - memcpy(dp + lease->options[i].len, + for (dp = dbuf + lease->options[i].len; + dp > dbuf; dp--, len--) + if (dp[-1] != '\0') + break; + memcpy(dp, ip->client-> config->defaults[i].data, ip->client-> config->defaults[i].len); + dp = dbuf; dp[len] = '\0'; } } else { From vanhu at FreeBSD.org Mon Jun 15 13:17:06 2009 From: vanhu at FreeBSD.org (VANHULLEBUS Yvan) Date: Mon Jun 15 13:17:17 2009 Subject: svn commit: r194236 - in stable/7/sys: . contrib/pf dev/ath/ath_hal netipsec Message-ID: <200906151317.n5FDH5cE090678@svn.freebsd.org> Author: vanhu Date: Mon Jun 15 13:17:05 2009 New Revision: 194236 URL: http://svn.freebsd.org/changeset/base/194236 Log: MFC: Lock SPTREE before parsing it in key_spddump() Obtained from: NETASQ Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/netipsec/key.c Modified: stable/7/sys/netipsec/key.c ============================================================================== --- stable/7/sys/netipsec/key.c Mon Jun 15 07:24:16 2009 (r194235) +++ stable/7/sys/netipsec/key.c Mon Jun 15 13:17:05 2009 (r194236) @@ -2363,14 +2363,17 @@ key_spddump(so, m, mhp) /* search SPD entry and get buffer size. */ cnt = 0; + SPTREE_LOCK(); for (dir = 0; dir < IPSEC_DIR_MAX; dir++) { LIST_FOREACH(sp, &sptree[dir], chain) { cnt++; } } - if (cnt == 0) + if (cnt == 0) { + SPTREE_UNLOCK(); return key_senderror(so, m, ENOENT); + } for (dir = 0; dir < IPSEC_DIR_MAX; dir++) { LIST_FOREACH(sp, &sptree[dir], chain) { @@ -2383,6 +2386,7 @@ key_spddump(so, m, mhp) } } + SPTREE_UNLOCK(); m_freem(m); return 0; } From vanhu at FreeBSD.org Mon Jun 15 13:48:32 2009 From: vanhu at FreeBSD.org (VANHULLEBUS Yvan) Date: Mon Jun 15 13:49:07 2009 Subject: svn commit: r194238 - in stable/7/sys: . contrib/pf crypto/via dev/ath/ath_hal Message-ID: <200906151348.n5FDmVda091395@svn.freebsd.org> Author: vanhu Date: Mon Jun 15 13:48:31 2009 New Revision: 194238 URL: http://svn.freebsd.org/changeset/base/194238 Log: MFC: Changed to M_NOWAIT when reallocing psc_buf in padlock_sha_update(), as we already hold the non sleepable crypto_driver_mutex. Obtained from: NETASQ Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/crypto/via/padlock_hash.c stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/crypto/via/padlock_hash.c ============================================================================== --- stable/7/sys/crypto/via/padlock_hash.c Mon Jun 15 13:47:49 2009 (r194237) +++ stable/7/sys/crypto/via/padlock_hash.c Mon Jun 15 13:48:31 2009 (r194238) @@ -171,7 +171,9 @@ padlock_sha_update(struct padlock_sha_ct if (ctx->psc_size - ctx->psc_offset < bufsize) { ctx->psc_size = MAX(ctx->psc_size * 2, ctx->psc_size + bufsize); ctx->psc_buf = realloc(ctx->psc_buf, ctx->psc_size, M_PADLOCK, - M_WAITOK); + M_NOWAIT); + if(ctx->psc_buf == NULL) + return (ENOMEM); } bcopy(buf, ctx->psc_buf + ctx->psc_offset, bufsize); ctx->psc_offset += bufsize; From n_hibma at FreeBSD.org Mon Jun 15 19:15:29 2009 From: n_hibma at FreeBSD.org (Nick Hibma) Date: Mon Jun 15 19:15:45 2009 Subject: svn commit: r194253 - stable/7/sys/dev/usb Message-ID: <200906151915.n5FJFShx098710@svn.freebsd.org> Author: n_hibma Date: Mon Jun 15 19:15:28 2009 New Revision: 194253 URL: http://svn.freebsd.org/changeset/base/194253 Log: Hide 'Unsupported ATAPI command - trying anyway' under bootverbose. This caused more noise than was actually useful. Modified: stable/7/sys/dev/usb/umass.c Modified: stable/7/sys/dev/usb/umass.c ============================================================================== --- stable/7/sys/dev/usb/umass.c Mon Jun 15 19:01:53 2009 (r194252) +++ stable/7/sys/dev/usb/umass.c Mon Jun 15 19:15:28 2009 (r194253) @@ -3529,9 +3529,10 @@ umass_atapi_transform(struct umass_softc case READ_12: case WRITE_12: default: - printf("%s: Unsupported ATAPI command 0x%02x" - " - trying anyway\n", - device_get_nameunit(sc->sc_dev), cmd[0]); + if (bootverbose) + printf("%s: Unsupported ATAPI command 0x%02x" + " - trying anyway\n", + device_get_nameunit(sc->sc_dev), cmd[0]); memcpy(*rcmd, cmd, cmdlen); return 1; } From jhb at FreeBSD.org Mon Jun 15 19:16:25 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Mon Jun 15 19:16:31 2009 Subject: svn commit: r194254 - in stable/7/sys: . boot/i386/libi386 contrib/pf dev/ath/ath_hal Message-ID: <200906151916.n5FJGOQj098776@svn.freebsd.org> Author: jhb Date: Mon Jun 15 19:16:24 2009 New Revision: 194254 URL: http://svn.freebsd.org/changeset/base/194254 Log: MFC: Pack PnP structures instead of individual fields. Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/biospnp.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/boot/i386/libi386/biospnp.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biospnp.c Mon Jun 15 19:15:28 2009 (r194253) +++ stable/7/sys/boot/i386/libi386/biospnp.c Mon Jun 15 19:16:24 2009 (r194254) @@ -49,38 +49,38 @@ struct pnphandler biospnphandler = struct pnp_ICstructure { - u_int8_t pnp_signature[4] __packed; - u_int8_t pnp_version __packed; - u_int8_t pnp_length __packed; - u_int16_t pnp_BIOScontrol __packed; - u_int8_t pnp_checksum __packed; - u_int32_t pnp_eventflag __packed; - u_int16_t pnp_rmip __packed; - u_int16_t pnp_rmcs __packed; - u_int16_t pnp_pmip __packed; - u_int32_t pnp_pmcs __packed; - u_int8_t pnp_OEMdev[4] __packed; - u_int16_t pnp_rmds __packed; - u_int32_t pnp_pmds __packed; -}; + u_int8_t pnp_signature[4]; + u_int8_t pnp_version; + u_int8_t pnp_length; + u_int16_t pnp_BIOScontrol; + u_int8_t pnp_checksum; + u_int32_t pnp_eventflag; + u_int16_t pnp_rmip; + u_int16_t pnp_rmcs; + u_int16_t pnp_pmip; + u_int32_t pnp_pmcs; + u_int8_t pnp_OEMdev[4]; + u_int16_t pnp_rmds; + u_int32_t pnp_pmds; +} __packed; struct pnp_devNode { - u_int16_t dn_size __packed; - u_int8_t dn_handle __packed; - u_int8_t dn_id[4] __packed; - u_int8_t dn_type[3] __packed; - u_int16_t dn_attrib __packed; - u_int8_t dn_data[1] __packed; -}; + u_int16_t dn_size; + u_int8_t dn_handle; + u_int8_t dn_id[4]; + u_int8_t dn_type[3]; + u_int16_t dn_attrib; + u_int8_t dn_data[1]; +} __packed; struct pnp_isaConfiguration { - u_int8_t ic_revision __packed; - u_int8_t ic_nCSN __packed; - u_int16_t ic_rdport __packed; - u_int16_t ic_reserved __packed; -}; + u_int8_t ic_revision; + u_int8_t ic_nCSN; + u_int16_t ic_rdport; + u_int16_t ic_reserved; +} __packed; static struct pnp_ICstructure *pnp_Icheck = NULL; static u_int16_t pnp_NumNodes; From n_hibma at FreeBSD.org Mon Jun 15 19:26:35 2009 From: n_hibma at FreeBSD.org (Nick Hibma) Date: Mon Jun 15 19:26:55 2009 Subject: svn commit: r194258 - stable/7/sys/dev/usb Message-ID: <200906151926.n5FJQYAN099129@svn.freebsd.org> Author: n_hibma Date: Mon Jun 15 19:26:34 2009 New Revision: 194258 URL: http://svn.freebsd.org/changeset/base/194258 Log: Rearrange the init code in the stub driver, using a task to initialise the card. This allows better error handling and re-issuing of commands if one fails. Implement another initialisation sequence used buy the ZTE_STOR variants. Fix a bug where the driver would panic during initialisation reported by many (Mike Tancsa amongst others). Testing done and hardware supplied by belkin (a person, not the company). Modified: stable/7/sys/dev/usb/u3g.c stable/7/sys/dev/usb/usbdevs Modified: stable/7/sys/dev/usb/u3g.c ============================================================================== --- stable/7/sys/dev/usb/u3g.c Mon Jun 15 19:24:47 2009 (r194257) +++ stable/7/sys/dev/usb/u3g.c Mon Jun 15 19:26:34 2009 (r194258) @@ -53,8 +53,8 @@ //#define U3G_DEBUG #ifdef U3G_DEBUG -#define DPRINTF(x...) do { if (u3gdebug) device_printf(sc->sc_dev, ##x); } while (0) -int u3gdebug = 1; +#define DPRINTF(x...) device_printf(sc->sc_dev, ##x) +#define bootverbose (1) #else #define DPRINTF(x...) /* nop */ #endif @@ -67,7 +67,7 @@ struct u3g_softc { device_t sc_dev; usbd_device_handle sc_udev; u_int8_t sc_speed; - u_int8_t sc_flags; + u_int8_t sc_init; u_char sc_numports; }; @@ -117,81 +117,83 @@ static const struct u3g_speeds_s u3g_spe struct u3g_dev_type_s { struct usb_devno devno; u_int8_t speed; - u_int8_t flags; -#define U3GFL_NONE 0x00 -#define U3GFL_HUAWEI_INIT 0x01 // Requires init command (Huawei cards) -#define U3GFL_SCSI_EJECT 0x02 // Requires SCSI eject command (Novatel) -#define U3GFL_SIERRA_INIT 0x04 // Requires init command (Sierra cards) -#define U3GFL_CMOTECH_INIT 0x08 // Requires init command (CMOTECH cards) -#define U3GFL_STUB_WAIT 0x80 // Device reappears after a short delay + u_int8_t init; +#define U3GINIT_NONE 0 +#define U3GINIT_HUAWEI 1 // Requires init command (Huawei) +#define U3GINIT_SIERRA 2 // Requires init command (Sierra) +#define U3GINIT_EJECT 3 // Requires SCSI eject command (Novatel, Qualcomm) +#define U3GINIT_ZTESTOR 4 // Requires SCSI command (ZTE STOR) +#define U3GINIT_CMOTECH 5 // Requires init command (CMOTECH) +#define U3GINIT_WAIT 6 // Device reappears after a short delay (none) }; // Note: The entries marked with XXX should be checked for the correct speed // indication to set the buffer sizes. static const struct u3g_dev_type_s u3g_devs[] = { /* OEM: Option */ - {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, U3GSP_UMTS, U3GFL_NONE }, - {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD }, U3GSP_UMTS, U3GFL_NONE }, - {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, U3GSP_UMTS, U3GFL_NONE }, - {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36 }, U3GSP_HSDPA, U3GFL_NONE }, - {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAXHSUPA }, U3GSP_HSDPA, U3GFL_NONE }, - {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, U3GSP_UMTS, U3GFL_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, U3GSP_UMTS, U3GINIT_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD }, U3GSP_UMTS, U3GINIT_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, U3GSP_UMTS, U3GINIT_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36 }, U3GSP_HSDPA, U3GINIT_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAXHSUPA }, U3GSP_HSDPA, U3GINIT_NONE }, + {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, U3GSP_UMTS, U3GINIT_NONE }, /* OEM: Qualcomm, Inc. */ - {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_STOR }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_STOR }, U3GSP_CDMA, U3GINIT_ZTESTOR }, + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_CDMA, U3GINIT_EJECT }, + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_ZTE_MSM }, U3GSP_CDMA, U3GINIT_NONE }, /* OEM: Huawei */ - {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, U3GSP_HSDPA, U3GFL_HUAWEI_INIT }, - {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, U3GSP_HSPA, U3GFL_HUAWEI_INIT }, + {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, U3GSP_HSDPA, U3GINIT_HUAWEI }, + {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, U3GSP_HSPA, U3GINIT_HUAWEI }, /* OEM: Novatel */ - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, U3GSP_CDMA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ES620 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_MC950D }, U3GSP_HSUPA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U720 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U727 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740_2 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U870 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V620 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V640 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V720 }, U3GSP_UMTS, U3GFL_SCSI_EJECT }, // XXX - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V740 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_X950D }, U3GSP_HSUPA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_XU870 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ZEROCD }, U3GSP_HSUPA, U3GFL_SCSI_EJECT }, - {{ USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, U3GSP_HSDPA, U3GFL_SCSI_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, U3GSP_CDMA, U3GINIT_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ES620 }, U3GSP_UMTS, U3GINIT_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_MC950D }, U3GSP_HSUPA, U3GINIT_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U720 }, U3GSP_UMTS, U3GINIT_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U727 }, U3GSP_UMTS, U3GINIT_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, U3GSP_HSDPA, U3GINIT_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740_2 }, U3GSP_HSDPA, U3GINIT_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U870 }, U3GSP_UMTS, U3GINIT_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V620 }, U3GSP_UMTS, U3GINIT_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V640 }, U3GSP_UMTS, U3GINIT_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V720 }, U3GSP_UMTS, U3GINIT_EJECT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V740 }, U3GSP_HSDPA, U3GINIT_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_X950D }, U3GSP_HSUPA, U3GINIT_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_XU870 }, U3GSP_HSDPA, U3GINIT_EJECT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ZEROCD }, U3GSP_HSUPA, U3GINIT_EJECT }, + {{ USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, U3GSP_HSDPA, U3GINIT_EJECT }, /* OEM: Merlin */ - {{ USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 }, U3GSP_UMTS, U3GFL_NONE }, // XXX + {{ USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX /* OEM: Sierra Wireless: */ - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD580 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD595 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC595U }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC597E }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_C597 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880E }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880U }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881E }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881U }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_EM5625 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720_2 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5725 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MINI5725 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD875 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_2 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_3 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8765 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875U }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_HSDPA, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8780 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 }, U3GSP_UMTS, U3GFL_NONE }, // XXX - {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GFL_SIERRA_INIT }, - {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GFL_NONE }, + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD580 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD595 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC595U }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC597E }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_C597 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880E }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC880U }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881E }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC881U }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_EM5625 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5720_2 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC5725 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MINI5725 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AIRCARD875 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_2 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8755_3 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8765 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_AC875U }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8775_2 }, U3GSP_HSDPA, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8780 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_MC8781 }, U3GSP_UMTS, U3GINIT_NONE }, // XXX + {{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_TRUINSTALL }, U3GSP_UMTS, U3GINIT_SIERRA }, + {{ USB_VENDOR_HP, USB_PRODUCT_HP_HS2300 }, U3GSP_HSDPA, U3GINIT_NONE }, /* OEM: CMOTECH */ - {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 }, U3GSP_HSDPA, U3GFL_CMOTECH_INIT }, - {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_DISK }, U3GSP_HSDPA, U3GFL_NONE }, + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CGU628 }, U3GSP_HSDPA, U3GINIT_CMOTECH }, + {{ USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_DISK }, U3GSP_HSDPA, U3GINIT_NONE }, }; #define u3g_lookup(v, p) ((const struct u3g_dev_type_s *)usb_lookup(u3g_devs, v, p)) @@ -208,16 +210,13 @@ u3g_match(device_t self) if (!u3g_dev_type) return UMATCH_NONE; - if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT) { - /* If the interface class of the first interface is no longer - * mass storage the card has changed to modem (see u3g_attach() - * below). - */ - usb_interface_descriptor_t *id; - id = usbd_get_interface_descriptor(uaa->iface); - if (!id || id->bInterfaceClass == UICLASS_MASS) - return UMATCH_NONE; - } + /* If the interface class of the first interface is no longer + * mass storage the card has changed to modem. + */ + usb_interface_descriptor_t *id; + id = usbd_get_interface_descriptor(uaa->iface); + if (!id || id->bInterfaceClass == UICLASS_MASS) + return UMATCH_NONE; return UMATCH_VENDOR_PRODUCT_CONF_IFACE; } @@ -253,7 +252,7 @@ u3g_attach(device_t self) sc->sc_udev = dev; u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); - sc->sc_flags = u3g_dev_type->flags; + sc->sc_init = u3g_dev_type->init; sc->sc_speed = u3g_dev_type->speed; sprintf(devnamefmt,"U%d.%%d", device_get_unit(self)); @@ -269,12 +268,10 @@ u3g_attach(device_t self) * Claim the first umass device (cdX) as it contains * only Windows drivers anyway (CD-ROM), hiding it. */ -#ifndef U3G_DEBUG if (!bootverbose) if (uaa->vendor == USB_VENDOR_HUAWEI) if (id->bInterfaceNumber == 2) uaa->ifaces[i] = NULL; -#endif continue; } @@ -402,9 +399,6 @@ u3g_close(void *addr, int portno) struct u3g_softc *sc = addr; struct ucom_softc *ucom = &sc->sc_ucom[portno]; struct tty *tp = ucom->sc_tty; -#ifdef U3G_DEBUG - device_t self = sc->sc_dev; -#endif tp->t_ispeedwat = (speed_t)-1; tp->t_ospeedwat = (speed_t)-1; @@ -441,227 +435,271 @@ MODULE_VERSION(u3g, 1); struct u3gstub_softc { device_t sc_dev; usbd_device_handle sc_udev; + usbd_interface_handle sc_iface; usbd_pipe_handle sc_pipe_out, sc_pipe_in; usbd_xfer_handle sc_xfer; -}; + int sc_vendor; + int sc_product; -static int -u3gstub_huawei_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) -{ - usb_device_request_t req; + struct usb_task sc_task; - req.bmRequestType = UT_WRITE_DEVICE; - req.bRequest = UR_SET_FEATURE; - USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); - USETW(req.wIndex, UHF_PORT_SUSPEND); - USETW(req.wLength, 0); + u_char sc_dying; +}; - (void) usbd_do_request(uaa->device, &req, 0); /* ignore any error */ +/* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c for the SCSI/ATAPI command structs below. + */ - return 1; -} +/* + * See struct scsi_test_unit_ready in sys/cam/scsi/scsi_all.h . + */ +static unsigned char scsi_test_unit_ready[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x00, /* 12: CBW Flag: input */ + 0x00, /* 13: CBW Lun */ + 0x0c, /* 14: CBW Length */ + + 0x00, /* 15+0: opcode: SCSI TEST UNIT READY*/ + 0x00, /* 15+1: byte2: Not immediate */ + 0x00, 0x00, /* 15+2..3: reserved */ + 0x00, /* 15+4: Load/Eject command */ + 0x00, /* 15+5: control */ + 0x00, 0x00, 0x00, 0x00, /* 15+6..15: unused */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; -static void -u3gstub_BBB_cb(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status err) +/* + * See struct scsi_start_stop_unit in sys/cam/scsi/scsi_all.h . + */ +static unsigned char scsi_start_stop_unit[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x00, /* 12: CBW Flag: input */ + 0x00, /* 13: CBW Lun */ + 0x0c, /* 14: CBW Length */ + + 0x1b, /* 15+0: opcode: SCSI START/STOP */ + 0x00, /* 15+1: byte2: Not immediate */ + 0x00, 0x00, /* 15+2..3: reserved */ + 0x02, /* 15+4: Load/Eject command */ + 0x00, /* 15+5: control */ + 0x00, 0x00, 0x00, 0x00, /* 15+6..15: unused */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; + +static unsigned char ztestor_cmd[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x00, /* 12: CBW Flag: input */ + 0x00, /* 13: CBW Lun */ + 0x0c, /* 14: CBW Length */ + + 0x85, /* 15+0: opcode */ + 0x01, /* 15+1: byte2 */ + 0x01, 0x01, /* 15+2..3 */ + 0x18, /* 15+4: */ + 0x01, /* 15+5: */ + 0x01, 0x01, 0x01, 0x01, /* 15+6..15: */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; + +static unsigned char cmotech_cmd[31] = { + 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ + 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ + 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ + 0x80, /* 12: CBW Flag: output, so 0 */ + 0x00, /* 13: CBW Lun */ + 0x08, /* 14: CBW Length */ /* XXX Is this correct? Not 6,10,12, or 20? */ + + 0xff, /* 15+0 */ + 0x52, /* 15+1 */ + 0x44, /* 15+2 */ + 0x45, /* 15+2 */ + 0x56, /* 15+4 */ + 0x43, /* 15+5 */ + 0x48, /* 15+5 */ + 0x47, /* 15+5 */ + 0x00, 0x00, 0x00, 0x00, /* 15+8..15: unused */ + 0x00, 0x00, 0x00, 0x00 +}; + + +/*! + * \brief Execute a command over BBB protocol (see umass driver). + * \param sc softc + * \param cmd 31 byte CBW buffer + * \returns 0 if transfer was cancelled, 1 otherwise. + * \note If 0 is returned detach was probably called and no data from the + * softc should be touched. + */ +static int +u3gstub_BBB_cmd(struct u3gstub_softc *sc, unsigned char *cmd) { - struct u3gstub_softc *sc = (struct u3gstub_softc *) priv; - unsigned char cmd[13]; + int err; - if (err) { + DPRINTF("Sending CBW\n"); + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, sc, + cmd, 31 /* CBW len */, + 0, USBD_DEFAULT_TIMEOUT, NULL); + err = usbd_sync_transfer(sc->sc_xfer); + + if (err == USBD_CANCELLED) { + return 0; + } else if (err == USBD_STALLED) { + DPRINTF("Sending CBW, STALLED\n"); + err = usbd_clear_endpoint_stall(sc->sc_pipe_out); + if (err != USBD_NORMAL_COMPLETION) { + device_printf(sc->sc_dev, + "Failed to send CBW to " + "change to modem mode, " + "clear endpoint stall failed: %s\n", + usbd_errstr(err)); + } + } else if (err) { device_printf(sc->sc_dev, - "Failed to send CD eject command to " - "change to modem mode\n"); + "Failed to send CBW to " + "change to modem mode: %s\n", + usbd_errstr(err)); } else { - usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_in, NULL, cmd, sizeof(cmd), + DPRINTF("Reading CSW\n"); + usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_in, sc, + cmd, sizeof(cmd), 0, USBD_DEFAULT_TIMEOUT, NULL); - int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; - if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) - DPRINTF("failed to start transfer (CSW)\n"); + err = usbd_sync_transfer(sc->sc_xfer); + if (err == USBD_CANCELLED) { + return 0; + } else if (err == USBD_STALLED) { + DPRINTF("Reading CSW, STALLED\n"); + err = usbd_clear_endpoint_stall(sc->sc_pipe_out); + if (err != USBD_NORMAL_COMPLETION) { + device_printf(sc->sc_dev, + "Failed to retrieve CSW to " + "change to modem mode, " + "clear endpoint stall failed: %s\n", + usbd_errstr(err)); + } + } else if (err != USBD_NORMAL_COMPLETION) { + if (bootverbose) + device_printf(sc->sc_dev, + "Failed to retrieve CSW to " + "change to modem mode: %s\n", + usbd_errstr(err)); + } } + + return 1; } static int -u3gstub_scsi_eject(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +u3gstub_sierra_init(struct u3gstub_softc *sc) { - /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c and struct - * scsi_start_stop_unit in sys/cam/scsi/scsi_all.h . - */ - unsigned char cmd[31] = { - 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ - 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ - 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ - 0x00, /* 12: CBW Flag: output */ - 0x00, /* 13: CBW Lun */ - 0x06, /* 14: CBW Length */ - - 0x1b, /* 15+0: opcode: SCSI START/STOP */ - 0x00, /* 15+1: byte2: Not immediate */ - 0x00, 0x00, /* 15+2..3: reserved */ - 0x02, /* 15+4: Load/Eject command */ - 0x00, /* 15+5: control */ - 0x00, 0x00, 0x00, 0x00, /* 15+6..15: unused */ - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 - }; - - usb_interface_descriptor_t *id; - usb_endpoint_descriptor_t *ed = NULL; - int i; + usb_device_request_t req; + int err; + req.bmRequestType = UT_VENDOR; + req.bRequest = UR_SET_INTERFACE; + USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); + USETW(req.wIndex, UHF_PORT_CONNECTION); + USETW(req.wLength, 0); - /* Find the bulk-out endpoints */ - id = usbd_get_interface_descriptor(uaa->iface); - for (i = 0 ; i < id->bNumEndpoints; i++) { - ed = usbd_interface2endpoint_descriptor(uaa->iface, i); - if (ed != NULL - && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { - if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { - if (usbd_open_pipe(uaa->iface, - ed->bEndpointAddress, - USBD_EXCLUSIVE_USE, - &sc->sc_pipe_out) - != USBD_NORMAL_COMPLETION) { - DPRINTF("failed to open bulk-out pipe on endpoint %d\n", - ed->bEndpointAddress); - return 0; - } - } else { - if (usbd_open_pipe(uaa->iface, - ed->bEndpointAddress, - USBD_EXCLUSIVE_USE, - &sc->sc_pipe_in) - != USBD_NORMAL_COMPLETION) { - DPRINTF("failed to open bulk-in pipe on endpoint %d\n", - ed->bEndpointAddress); - return 0; - } - } + err = usbd_do_request(sc->sc_udev, &req, 0); + if (bootverbose) { + if (err) { + device_printf(sc->sc_dev, + "Failed to send Sierra request: %s\n", + usbd_errstr(err)); } - if (sc->sc_pipe_out && sc->sc_pipe_in) - break; - } - - if (i == id->bNumEndpoints) { - DPRINTF("failed to find bulk-out pipe\n"); - return 0; - } - - sc->sc_xfer = usbd_alloc_xfer(uaa->device); - if (sc->sc_xfer == NULL) { - DPRINTF("failed to allocate xfer\n"); - return 0; - } - - usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), - 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); - int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; - if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { - DPRINTF("failed to start transfer (CBW)\n"); - return 0; } return 1; } static int -u3gstub_cmotech_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +u3gstub_huawei_init(struct u3gstub_softc *sc) { - /* See definition of umass_bbb_cbw_t in sys/dev/usb/umass.c - * in sys/cam/scsi/scsi_all.h . - */ - unsigned char cmd[31] = { - 0x55, 0x53, 0x42, 0x43, /* 0..3: Command Block Wrapper (CBW) signature */ - 0x01, 0x00, 0x00, 0x00, /* 4..7: CBW Tag, unique 32-bit number */ - 0x00, 0x00, 0x00, 0x00, /* 8..11: CBW Transfer Length, no data here */ - 0x80, /* 12: CBW Flag: output, so 0 */ - 0x00, /* 13: CBW Lun */ - 0x08, /* 14: CBW Length */ - - 0xff, /* 15+0 */ - 0x52, /* 15+1 */ - 0x44, /* 15+2 */ - 0x45, /* 15+2 */ - 0x56, /* 15+4 */ - 0x43, /* 15+5 */ - 0x48, /* 15+5 */ - 0x47, /* 15+5 */ - 0x00, 0x00, 0x00, 0x00, /* 15+8..15: unused */ - 0x00, 0x00, 0x00, 0x00 - }; - - usb_interface_descriptor_t *id; - usb_endpoint_descriptor_t *ed = NULL; - int i; + usb_device_request_t req; + int err; + req.bmRequestType = UT_WRITE_DEVICE; + req.bRequest = UR_SET_FEATURE; + USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); + USETW(req.wIndex, UHF_PORT_SUSPEND); + USETW(req.wLength, 0); - /* Find the bulk-out endpoints */ - id = usbd_get_interface_descriptor(uaa->iface); - for (i = 0 ; i < id->bNumEndpoints ; i++) { - ed = usbd_interface2endpoint_descriptor(uaa->iface, i); - if (ed != NULL - && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { - if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { - if (usbd_open_pipe(uaa->iface, - ed->bEndpointAddress, - USBD_EXCLUSIVE_USE, - &sc->sc_pipe_out) - != USBD_NORMAL_COMPLETION) { - DPRINTF("failed to open bulk-out pipe on endpoint %d\n", - ed->bEndpointAddress); - return 0; - } - } else { - if (usbd_open_pipe(uaa->iface, - ed->bEndpointAddress, - USBD_EXCLUSIVE_USE, - &sc->sc_pipe_in) - != USBD_NORMAL_COMPLETION) { - DPRINTF("failed to open bulk-in pipe on endpoint %d\n", - ed->bEndpointAddress); - return 0; - } - } + err = usbd_do_request(sc->sc_udev, &req, 0); + if (bootverbose) { + if (err) { + device_printf(sc->sc_dev, + "Failed to send Huawei request: %s\n", + usbd_errstr(err)); } - if (sc->sc_pipe_out && sc->sc_pipe_in) - break; - } - - if (i == id->bNumEndpoints) { - DPRINTF("failed to find bulk-out pipe\n"); - return 0; - } - - sc->sc_xfer = usbd_alloc_xfer(uaa->device); - if (sc->sc_xfer == NULL) { - DPRINTF("failed to allocate xfer\n"); - return 0; - } - - usbd_setup_xfer(sc->sc_xfer, sc->sc_pipe_out, NULL, cmd, sizeof(cmd), - 0, USBD_DEFAULT_TIMEOUT, u3gstub_BBB_cb); - int err = usbd_transfer(sc->sc_xfer) != USBD_NORMAL_COMPLETION; - if (err != USBD_NORMAL_COMPLETION && err != USBD_IN_PROGRESS) { - DPRINTF("failed to start transfer (CBW)\n"); - return 0; } return 1; } -static int -u3gstub_sierra_init(struct u3gstub_softc *sc, struct usb_attach_arg *uaa) +/*! + * \brief Execute the requested init command for the device. + * \param priv u3gstub_softc + * + * This is implemented as a task so we can do synchronous transfers. + */ +static void +u3gstub_do_init(void *priv) { - usb_device_request_t req; - - req.bmRequestType = UT_VENDOR; - req.bRequest = UR_SET_INTERFACE; - USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); - USETW(req.wIndex, UHF_PORT_CONNECTION); - USETW(req.wLength, 0); - - (void) usbd_do_request(uaa->device, &req, 0); /* ignore any error */ + struct u3gstub_softc *sc = priv; + const struct u3g_dev_type_s *u3g_dev_type; - return 1; + u3g_dev_type = u3g_lookup(sc->sc_vendor, sc->sc_product); + switch (u3g_dev_type->init) { + case U3GINIT_HUAWEI: + if (bootverbose) + device_printf(sc->sc_dev, + "changing Huawei modem to modem mode\n"); + u3gstub_huawei_init(sc); + break; + case U3GINIT_SIERRA: + if (bootverbose) + device_printf(sc->sc_dev, + "changing Sierra modem to modem mode\n"); + u3gstub_sierra_init(sc); + break; + case U3GINIT_EJECT: + if (bootverbose) + device_printf(sc->sc_dev, + "sending CD eject command to change to modem mode\n"); + while (!sc->sc_dying + && u3gstub_BBB_cmd(sc, scsi_test_unit_ready) + && u3gstub_BBB_cmd(sc, scsi_start_stop_unit)) + ; /* nop */ + break; + case U3GINIT_ZTESTOR: + if (bootverbose) + device_printf(sc->sc_dev, + "changing ZTE STOR modem to modem mode\n"); + u3gstub_BBB_cmd(sc, ztestor_cmd); + u3gstub_BBB_cmd(sc, scsi_test_unit_ready); + u3gstub_BBB_cmd(sc, scsi_start_stop_unit); + break; + case U3GINIT_CMOTECH: + if (bootverbose) + device_printf(sc->sc_dev, + "changing CMOTECH modem to modem mode\n"); + u3gstub_BBB_cmd(sc, cmotech_cmd); + break; + case U3GINIT_WAIT: + default: + if (bootverbose) + device_printf(sc->sc_dev, + "waiting for modem to change to modem mode\n"); + /* nop */ + } } static int @@ -683,21 +721,15 @@ u3gstub_match(device_t self) if (!u3g_dev_type) return UMATCH_NONE; - if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT - || u3g_dev_type->flags&U3GFL_SCSI_EJECT - || u3g_dev_type->flags&U3GFL_SIERRA_INIT - || u3g_dev_type->flags&U3GFL_CMOTECH_INIT - || u3g_dev_type->flags&U3GFL_STUB_WAIT) { + if (u3g_dev_type->init != U3GINIT_NONE) { /* We assume that if the first interface is still a mass * storage device the device has not yet changed appearance. */ id = usbd_get_interface_descriptor(uaa->iface); if (id && id->bInterfaceNumber == 0 && id->bInterfaceClass == UICLASS_MASS) { -#ifndef U3G_DEBUG if (!bootverbose) device_quiet(self); -#endif return UMATCH_VENDOR_PRODUCT; } @@ -711,52 +743,74 @@ u3gstub_attach(device_t self) { struct u3gstub_softc *sc = device_get_softc(self); struct usb_attach_arg *uaa = device_get_ivars(self); - const struct u3g_dev_type_s *u3g_dev_type; - int i; + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed; + int i, err; -#ifndef U3G_DEBUG if (!bootverbose) device_quiet(self); -#endif + + for (i = 0; i < uaa->nifaces; i++) + uaa->ifaces[i] = NULL; // claim all interfaces sc->sc_dev = self; sc->sc_udev = uaa->device; + sc->sc_iface = uaa->iface; + sc->sc_vendor = uaa->vendor; + sc->sc_product = uaa->product; - for (i = 0; i < uaa->nifaces; i++) - uaa->ifaces[i] = NULL; // claim all interfaces + sc->sc_xfer = usbd_alloc_xfer(sc->sc_udev); + if (sc->sc_xfer == NULL) { + DPRINTF("failed to allocate xfer\n"); + return ENOMEM; + } - u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); - if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT) { - if (bootverbose) - device_printf(sc->sc_dev, - "changing Huawei modem to modem mode\n"); - if (!u3gstub_huawei_init(sc, uaa)) - return ENXIO; - } else if (u3g_dev_type->flags&U3GFL_SCSI_EJECT) { - if (bootverbose) - device_printf(sc->sc_dev, "sending CD eject command to " - "change to modem mode\n"); - if (!u3gstub_scsi_eject(sc, uaa)) - return ENXIO; - } else if (u3g_dev_type->flags&U3GFL_SIERRA_INIT) { - if (bootverbose) - device_printf(sc->sc_dev, - "changing Sierra modem to modem mode\n"); - if (!u3gstub_sierra_init(sc, uaa)) - return ENXIO; - } else if (u3g_dev_type->flags&U3GFL_CMOTECH_INIT) { - if (bootverbose) - device_printf(sc->sc_dev, - "changing CMOTECH modem to modem mode\n"); - if (!u3gstub_cmotech_init(sc, uaa)) - return ENXIO; - } else if (u3g_dev_type->flags&U3GFL_STUB_WAIT) { - if (bootverbose) - device_printf(sc->sc_dev, "waiting for modem to change " - "to modem mode\n"); - /* nop */ + /* Find the bulk-out endpoints */ + id = usbd_get_interface_descriptor(sc->sc_iface); + for (i = 0 ; i < id->bNumEndpoints; i++) { + ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i); + if (ed != NULL + && (ed->bmAttributes & UE_XFERTYPE) == UE_BULK) { + if (!sc->sc_pipe_out + && UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) { + err = usbd_open_pipe(sc->sc_iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_out); + if (err != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-out pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } else { + DPRINTF("opening bulk-in pipe on endpoint %d\n", ed->bEndpointAddress); + } + } else if (!sc->sc_pipe_in + && UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN) { + err = usbd_open_pipe(sc->sc_iface, + ed->bEndpointAddress, + USBD_EXCLUSIVE_USE, + &sc->sc_pipe_in); + if (err != USBD_NORMAL_COMPLETION) { + DPRINTF("failed to open bulk-in pipe on endpoint %d\n", + ed->bEndpointAddress); + return 0; + } else { + DPRINTF("opening bulk-in pipe on endpoint %d\n", ed->bEndpointAddress); + } + } + } + if (sc->sc_pipe_out && sc->sc_pipe_in) + break; } + if (i == id->bNumEndpoints) { + device_printf(sc->sc_dev, "failed to find bulk-out and/or bulk-in pipe\n"); + return ENXIO; + } + + usb_init_task(&sc->sc_task, u3gstub_do_init, sc); + usb_add_task(sc->sc_udev, &sc->sc_task, USB_TASKQ_DRIVER); + return 0; } @@ -764,9 +818,9 @@ static int u3gstub_detach(device_t self) { struct u3gstub_softc *sc = device_get_softc(self); - - if (sc->sc_xfer) - usbd_free_xfer(sc->sc_xfer); + + sc->sc_dying = 1; + usb_rem_task(sc->sc_udev, &sc->sc_task); if (sc->sc_pipe_in) { usbd_abort_pipe(sc->sc_pipe_in); @@ -777,6 +831,9 @@ u3gstub_detach(device_t self) usbd_close_pipe(sc->sc_pipe_out); } + if (sc->sc_xfer) + usbd_free_xfer(sc->sc_xfer); + return 0; } Modified: stable/7/sys/dev/usb/usbdevs ============================================================================== --- stable/7/sys/dev/usb/usbdevs Mon Jun 15 19:24:47 2009 (r194257) +++ stable/7/sys/dev/usb/usbdevs Mon Jun 15 19:26:34 2009 (r194258) @@ -2039,6 +2039,7 @@ product QUALCOMM CDMA_MSM 0x6000 CDMA Te product QUALCOMM2 RWT_FCT 0x3100 RWT FCT-CDMA 2000 1xRTT modem product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem +product QUALCOMMINC ZTE_MSM 0x0031 CDMA Technologies MSM modem product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC AC8700 0xfffe CDMA 1xEVDO USB modem From n_hibma at FreeBSD.org Mon Jun 15 20:12:28 2009 From: n_hibma at FreeBSD.org (Nick Hibma) Date: Mon Jun 15 20:12:40 2009 Subject: svn commit: r194261 - in stable/7/sys/modules: acpi/acpi dtrace/dtrace linux Message-ID: <200906152012.n5FKCRsj000356@svn.freebsd.org> Author: n_hibma Date: Mon Jun 15 20:12:27 2009 New Revision: 194261 URL: http://svn.freebsd.org/changeset/base/194261 Log: Add opt_hwpmc_hooks.h to fix building individual modules from /sys/modules. Modified: stable/7/sys/modules/acpi/acpi/Makefile stable/7/sys/modules/dtrace/dtrace/Makefile stable/7/sys/modules/linux/Makefile Modified: stable/7/sys/modules/acpi/acpi/Makefile ============================================================================== --- stable/7/sys/modules/acpi/acpi/Makefile Mon Jun 15 20:00:19 2009 (r194260) +++ stable/7/sys/modules/acpi/acpi/Makefile Mon Jun 15 20:12:27 2009 (r194261) @@ -58,7 +58,7 @@ SRCS+= cpufreq_if.h device_if.h isa_if.h # XXX ACPI should not depend on the following headers but this is currently # needed for the build of assym.s. # This obviously needs a better and more structural fix. -SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h +SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h # Debugging support DBSRC= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c dbinput.c dbstats.c Modified: stable/7/sys/modules/dtrace/dtrace/Makefile ============================================================================== --- stable/7/sys/modules/dtrace/dtrace/Makefile Mon Jun 15 20:00:19 2009 (r194260) +++ stable/7/sys/modules/dtrace/dtrace/Makefile Mon Jun 15 20:12:27 2009 (r194261) @@ -23,7 +23,7 @@ SRCS+= bus_if.h device_if.h vnode_if.h SRCS+= assym.s # These are needed for assym.s -SRCS+= opt_compat.h opt_kstack_pages.h opt_nfs.h +SRCS+= opt_compat.h opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h .if ${MACHINE_ARCH} == "i386" SRCS+= opt_apic.h Modified: stable/7/sys/modules/linux/Makefile ============================================================================== --- stable/7/sys/modules/linux/Makefile Mon Jun 15 20:00:19 2009 (r194260) +++ stable/7/sys/modules/linux/Makefile Mon Jun 15 20:12:27 2009 (r194261) @@ -17,7 +17,7 @@ SRCS= linux${SFX}_dummy.c linux_emul.c l device_if.h bus_if.h assym.s # XXX: for assym.s -SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h +SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h opt_hwpmc_hooks.h OBJS= linux${SFX}_locore.o linux${SFX}_support.o From stas at FreeBSD.org Mon Jun 15 21:03:27 2009 From: stas at FreeBSD.org (Stanislav Sedov) Date: Mon Jun 15 21:03:44 2009 Subject: svn commit: r194265 - in stable/7/contrib/ipfilter: . lib Message-ID: <200906152103.n5FL3Q3Z001871@svn.freebsd.org> Author: stas Date: Mon Jun 15 21:03:25 2009 New Revision: 194265 URL: http://svn.freebsd.org/changeset/base/194265 Log: MFC r193043: - Prevent buffer overflow in IPFilter's load_http function used to load ipfilter tables via http by the user-level ippool utility. Previously the 1024-byte buffer used to store a http request coudld easily overflow if the length of the hostname part of the url passes exceeded 496 bytes. - Use snprintf to prevent possieble buffer overflows in future. - Do not try to close the descriptor twice on failure. Modified: stable/7/contrib/ipfilter/ (props changed) stable/7/contrib/ipfilter/lib/load_http.c Modified: stable/7/contrib/ipfilter/lib/load_http.c ============================================================================== --- stable/7/contrib/ipfilter/lib/load_http.c Mon Jun 15 20:45:51 2009 (r194264) +++ stable/7/contrib/ipfilter/lib/load_http.c Mon Jun 15 21:03:25 2009 (r194265) @@ -14,11 +14,13 @@ alist_t * load_http(char *url) { - int fd, len, left, port, endhdr, removed; - char *s, *t, *u, buffer[1024], *myurl; + char *s, *t, *u, buffer[1044], *myurl; alist_t *a, *rtop, *rbot; struct sockaddr_in sin; struct hostent *host; + size_t avail; + int fd, len, left, port, endhdr, removed; + int error; /* * More than this would just be absurd. @@ -32,7 +34,14 @@ load_http(char *url) rtop = NULL; rbot = NULL; - sprintf(buffer, "GET %s HTTP/1.0\r\n", url); + avail = sizeof(buffer); + error = snprintf(buffer, avail, "GET %s HTTP/1.0\r\n", url); + + /* + * error is always less then avail due to the constraint on + * the url length above. + */ + avail -= error; myurl = strdup(url); if (myurl == NULL) @@ -51,7 +60,11 @@ load_http(char *url) if (u != NULL) s = u + 1; /* AUTH */ - sprintf(buffer + strlen(buffer), "Host: %s\r\n\r\n", s); + error = snprintf(buffer + strlen(buffer), avail, "Host: %s\r\n\r\n", s); + if (error >= avail) { + fprintf(stderr, "URL is too large: %s\n", url); + goto done; + } u = strchr(s, ':'); if (u != NULL) { @@ -83,16 +96,12 @@ load_http(char *url) if (fd == -1) goto done; - if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) == -1) { - close(fd); + if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) == -1) goto done; - } len = strlen(buffer); - if (write(fd, buffer, len) != len) { - close(fd); + if (write(fd, buffer, len) != len) goto done; - } s = buffer; endhdr = 0; From gnn at FreeBSD.org Mon Jun 15 22:07:22 2009 From: gnn at FreeBSD.org (George V. Neville-Neil) Date: Mon Jun 15 22:07:39 2009 Subject: svn commit: r194270 - in stable/7/sys: . contrib/pf dev/ath/ath_hal netgraph Message-ID: <200906152207.n5FM7LPj003359@svn.freebsd.org> Author: gnn Date: Mon Jun 15 22:07:21 2009 New Revision: 194270 URL: http://svn.freebsd.org/changeset/base/194270 Log: MFC of 179973 Make it simpler to build netgraph modules outside of the kernel source tree. This change follows similar ones in the device tree. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/netgraph/netgraph.h Modified: stable/7/sys/netgraph/netgraph.h ============================================================================== --- stable/7/sys/netgraph/netgraph.h Mon Jun 15 21:55:29 2009 (r194269) +++ stable/7/sys/netgraph/netgraph.h Mon Jun 15 22:07:21 2009 (r194270) @@ -54,7 +54,9 @@ #include #include +#ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_netgraph.h" +#endif /* debugging options */ #define NG_SEPARATE_MALLOC /* make modules use their own malloc types */ From edwin at FreeBSD.org Tue Jun 16 02:35:22 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Tue Jun 16 02:35:28 2009 Subject: svn commit: r194276 - in stable/7/share: monetdef numericdef Message-ID: <200906160235.n5G2ZL5H009442@svn.freebsd.org> Author: edwin Date: Tue Jun 16 02:35:21 2009 New Revision: 194276 URL: http://svn.freebsd.org/changeset/base/194276 Log: MFC of r193867: Fix LC_NUMERIC and LC_MONETARY for de_CH locale With the de_CH (swiss german) locale, numbers should look like this: numbers: 1'234.45 monetary values: Fr. 1'234.45 Previously, the thousands separator was missing for numbers, and "." for monetary values, and "," was incorrectly used as decimal point. PR: conf/75502 Submitted by: Benjamin Lutz Added: stable/7/share/numericdef/de_CH.ISO8859-1.src - copied unchanged from r193867, head/share/numericdef/de_CH.ISO8859-1.src Modified: stable/7/share/monetdef/ (props changed) stable/7/share/monetdef/de_CH.ISO8859-1.src stable/7/share/numericdef/ (props changed) stable/7/share/numericdef/Makefile Modified: stable/7/share/monetdef/de_CH.ISO8859-1.src ============================================================================== --- stable/7/share/monetdef/de_CH.ISO8859-1.src Tue Jun 16 01:43:33 2009 (r194275) +++ stable/7/share/monetdef/de_CH.ISO8859-1.src Tue Jun 16 02:35:21 2009 (r194276) @@ -8,9 +8,9 @@ CHF # currency_symbol Fr. # mon_decimal_point -, -# mon_thousands_sep . +# mon_thousands_sep +' # mon_grouping, separated by ; 3;3 # positive_sign Modified: stable/7/share/numericdef/Makefile ============================================================================== --- stable/7/share/numericdef/Makefile Tue Jun 16 01:43:33 2009 (r194275) +++ stable/7/share/numericdef/Makefile Tue Jun 16 02:35:21 2009 (r194276) @@ -7,6 +7,7 @@ LOCALES= af_ZA.ISO8859-1 \ ca_ES.ISO8859-1 \ cs_CZ.ISO8859-2 \ da_DK.ISO8859-1 \ + de_CH.ISO8859-1 \ de_DE.ISO8859-1 \ el_GR.ISO8859-7 \ en_US.ISO8859-1 \ @@ -67,7 +68,7 @@ ENCODINGS= ARMSCII-8 Big5 Big5HKSCS \ KOI8-R KOI8-U PT154 SJIS US-ASCII UTF-8 BE_LINKS= fr_BE:nl_BE -DE_LINKS= de_DE:de_AT de_DE:de_CH +DE_LINKS= de_DE:de_AT FR_LINKS= fr_FR:fr_CA fr_FR:fr_CH GB_LINKS= en_GB:en_AU en_GB:en_NZ IT_LINKS= it_IT:it_CH @@ -90,15 +91,15 @@ eucJP_SJIS= ja_JP eucJP_UTF-8= ja_JP eucKR_CP949= ko_KR eucKR_UTF-8= ko_KR -ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_DE en_US es_ES eu_ES fi_FI \ - fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT sv_SE \ - ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ +ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES \ + fi_FI fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT \ + sv_SE ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ ${IT_LINKS} ${NO_LINKS} ${US_LINKS} ISO8859-1_ISO8859-1= ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ ${IT_LINKS} ${NO_LINKS} ${US_LINKS} ISO8859-1_US-ASCII= en_US ${GB_LINKS} ${US_LINKS} -ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_DE en_US es_ES eu_ES fi_FI fr_BE \ - fr_FR is_IS it_IT nl_NL no_NO pt_BR pt_PT sv_SE +ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES fi_FI \ + fr_BE fr_FR is_IS it_IT nl_NL no_NO pt_BR pt_PT sv_SE ISO8859-2_UTF-8= cs_CZ hr_HR hu_HU pl_PL ro_RO sk_SK sl_SI ISO8859-5_UTF-8= sr_YU uk_UA ISO8859-5_CP1251= uk_UA Copied: stable/7/share/numericdef/de_CH.ISO8859-1.src (from r193867, head/share/numericdef/de_CH.ISO8859-1.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/numericdef/de_CH.ISO8859-1.src Tue Jun 16 02:35:21 2009 (r194276, copy of r193867, head/share/numericdef/de_CH.ISO8859-1.src) @@ -0,0 +1,12 @@ +# $FreeBSD$ +# +# WARNING: spaces may be essential at the end of lines +# WARNING: empty lines are essential too +# +# decimal_point +. +# thousands_sep +' +# grouping, separated by ; +3;3 +# EOF From edwin at FreeBSD.org Tue Jun 16 02:36:50 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Tue Jun 16 02:37:07 2009 Subject: svn commit: r194278 - stable/7/share/timedef Message-ID: <200906160236.n5G2an8e009552@svn.freebsd.org> Author: edwin Date: Tue Jun 16 02:36:49 2009 New Revision: 194278 URL: http://svn.freebsd.org/changeset/base/194278 Log: MFC of 193869 ja_JP: AM/PM date format should be localized. ja_JP.eucJP and ja_JP.SJIS fixes. PR: conf/63527 Submitted by: Yukihiro Nakai Modified: stable/7/share/timedef/ (props changed) stable/7/share/timedef/ja_JP.SJIS.src stable/7/share/timedef/ja_JP.eucJP.src Modified: stable/7/share/timedef/ja_JP.SJIS.src ============================================================================== --- stable/7/share/timedef/ja_JP.SJIS.src Tue Jun 16 02:36:21 2009 (r194277) +++ stable/7/share/timedef/ja_JP.SJIS.src Tue Jun 16 02:36:49 2009 (r194278) @@ -67,13 +67,11 @@ # # am # -#Œß‘O -AM +Œß‘O # # pm # -#ŒßŒã -PM +ŒßŒã # # date_fmt # Modified: stable/7/share/timedef/ja_JP.eucJP.src ============================================================================== --- stable/7/share/timedef/ja_JP.eucJP.src Tue Jun 16 02:36:21 2009 (r194277) +++ stable/7/share/timedef/ja_JP.eucJP.src Tue Jun 16 02:36:49 2009 (r194278) @@ -68,13 +68,11 @@ # # am # -#¸áÁ° -AM +¸áÁ° # # pm # -#¸á¸å -PM +¸á¸å # # date_fmt # From dchagin at FreeBSD.org Tue Jun 16 05:05:47 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Tue Jun 16 05:06:04 2009 Subject: svn commit: r194281 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal Message-ID: <200906160505.n5G55kae012721@svn.freebsd.org> Author: dchagin Date: Tue Jun 16 05:05:46 2009 New Revision: 194281 URL: http://svn.freebsd.org/changeset/base/194281 Log: MFC r192203: Emulate SO_PEERCRED socket option. Temporarily use 0 for pid member as the FreeBSD does not cache remote UNIX domain socket peer pid. PR: kern/102956 Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_socket.c stable/7/sys/compat/linux/linux_socket.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 03:51:38 2009 (r194280) +++ stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:05:46 2009 (r194281) @@ -1159,7 +1159,9 @@ linux_getsockopt(struct thread *td, stru } */ bsd_args; l_timeval linux_tv; struct timeval tv; - socklen_t tv_len; + socklen_t tv_len, xulen; + struct xucred xu; + struct l_ucred lxu; int error, name; bsd_args.s = args->s; @@ -1182,6 +1184,23 @@ linux_getsockopt(struct thread *td, stru sizeof(linux_tv))); /* NOTREACHED */ break; + case LOCAL_PEERCRED: + if (args->optlen != sizeof(lxu)) + return (EINVAL); + xulen = sizeof(xu); + error = kern_getsockopt(td, args->s, bsd_args.level, + name, &xu, UIO_SYSSPACE, &xulen); + if (error) + return (error); + /* + * XXX Use 0 for pid as the FreeBSD does not cache peer pid. + */ + lxu.pid = 0; + lxu.uid = xu.cr_uid; + lxu.gid = xu.cr_gid; + return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu))); + /* NOTREACHED */ + break; default: break; } Modified: stable/7/sys/compat/linux/linux_socket.h ============================================================================== --- stable/7/sys/compat/linux/linux_socket.h Tue Jun 16 03:51:38 2009 (r194280) +++ stable/7/sys/compat/linux/linux_socket.h Tue Jun 16 05:05:46 2009 (r194281) @@ -59,4 +59,10 @@ #define LINUX_AF_APPLETALK 5 #define LINUX_AF_INET6 10 +struct l_ucred { + uint32_t pid; + uint32_t uid; + uint32_t gid; +}; + #endif /* _LINUX_SOCKET_H_ */ From dchagin at FreeBSD.org Tue Jun 16 05:07:35 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Tue Jun 16 05:09:30 2009 Subject: svn commit: r194282 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal Message-ID: <200906160507.n5G57YF8012799@svn.freebsd.org> Author: dchagin Date: Tue Jun 16 05:07:34 2009 New Revision: 194282 URL: http://svn.freebsd.org/changeset/base/194282 Log: MFC r192204: Use the protocol family constants for the domain argument validation. Return immediately when the socket() failed. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_socket.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:05:46 2009 (r194281) +++ stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:07:34 2009 (r194282) @@ -559,10 +559,12 @@ linux_socket(struct thread *td, struct l return (EAFNOSUPPORT); retval_socket = socket(td, &bsd_args); + if (retval_socket) + return (retval_socket); + if (bsd_args.type == SOCK_RAW && (bsd_args.protocol == IPPROTO_RAW || bsd_args.protocol == 0) - && bsd_args.domain == AF_INET - && retval_socket >= 0) { + && bsd_args.domain == PF_INET) { /* It's a raw IP socket: set the IP_HDRINCL option. */ int hdrincl; @@ -577,7 +579,7 @@ linux_socket(struct thread *td, struct l * default and some apps depend on this. So, set V6ONLY to 0 * for Linux apps if the sysctl value is set to 1. */ - if (bsd_args.domain == PF_INET6 && retval_socket >= 0 + if (bsd_args.domain == PF_INET6 #ifndef KLD_MODULE /* * XXX: Avoid undefined symbol error with an IPv4 only From dchagin at FreeBSD.org Tue Jun 16 05:08:49 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Tue Jun 16 05:09:41 2009 Subject: svn commit: r194283 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal Message-ID: <200906160508.n5G58mOM012870@svn.freebsd.org> Author: dchagin Date: Tue Jun 16 05:08:48 2009 New Revision: 194283 URL: http://svn.freebsd.org/changeset/base/194283 Log: MFC r192205: Return EINVAL in case when the incorrect or unsupported type argument is specified. Do not map type argument value as its Linux values are identical to FreeBSD values. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_socket.c stable/7/sys/compat/linux/linux_socket.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:07:34 2009 (r194282) +++ stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:08:48 2009 (r194283) @@ -554,6 +554,8 @@ linux_socket(struct thread *td, struct l bsd_args.protocol = args->protocol; bsd_args.type = args->type; + if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX) + return (EINVAL); bsd_args.domain = linux_to_bsd_domain(args->domain); if (bsd_args.domain == -1) return (EAFNOSUPPORT); Modified: stable/7/sys/compat/linux/linux_socket.h ============================================================================== --- stable/7/sys/compat/linux/linux_socket.h Tue Jun 16 05:07:34 2009 (r194282) +++ stable/7/sys/compat/linux/linux_socket.h Tue Jun 16 05:08:48 2009 (r194283) @@ -59,6 +59,16 @@ #define LINUX_AF_APPLETALK 5 #define LINUX_AF_INET6 10 +/* Supported socket types */ + +#define LINUX_SOCK_STREAM 1 +#define LINUX_SOCK_DGRAM 2 +#define LINUX_SOCK_RAW 3 +#define LINUX_SOCK_RDM 4 +#define LINUX_SOCK_SEQPACKET 5 + +#define LINUX_SOCK_MAX LINUX_SOCK_SEQPACKET + struct l_ucred { uint32_t pid; uint32_t uid; From dchagin at FreeBSD.org Tue Jun 16 05:10:22 2009 From: dchagin at FreeBSD.org (Dmitry Chagin) Date: Tue Jun 16 05:10:29 2009 Subject: svn commit: r194284 - in stable/7/sys: . amd64/linux32 compat/linux contrib/pf dev/ath/ath_hal i386/linux Message-ID: <200906160510.n5G5ALl0012954@svn.freebsd.org> Author: dchagin Date: Tue Jun 16 05:10:21 2009 New Revision: 194284 URL: http://svn.freebsd.org/changeset/base/194284 Log: MFC r192206: Somewhere between 2.6.23 and 2.6.27, Linux added SOCK_CLOEXEC and SOCK_NONBLOCK flags, that allow to save fcntl() calls. Implement a variation of the socket() syscall which takes a flags in addition to the type argument. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/linux32/linux.h stable/7/sys/compat/linux/linux_socket.c stable/7/sys/compat/linux/linux_socket.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/i386/linux/linux.h Modified: stable/7/sys/amd64/linux32/linux.h ============================================================================== --- stable/7/sys/amd64/linux32/linux.h Tue Jun 16 05:08:48 2009 (r194283) +++ stable/7/sys/amd64/linux32/linux.h Tue Jun 16 05:10:21 2009 (r194284) @@ -563,6 +563,7 @@ int linux_ioctl_unregister_handler(struc #define LINUX_O_DIRECTORY 00200000 /* Must be a directory */ #define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */ #define LINUX_O_NOATIME 01000000 +#define LINUX_O_CLOEXEC 02000000 #define LINUX_F_DUPFD 0 #define LINUX_F_GETFD 1 Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:08:48 2009 (r194283) +++ stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:10:21 2009 (r194284) @@ -550,10 +550,13 @@ linux_socket(struct thread *td, struct l int type; int protocol; } */ bsd_args; - int retval_socket; + int retval_socket, socket_flags; bsd_args.protocol = args->protocol; - bsd_args.type = args->type; + socket_flags = args->type & ~LINUX_SOCK_TYPE_MASK; + if (socket_flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) + return (EINVAL); + bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK; if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX) return (EINVAL); bsd_args.domain = linux_to_bsd_domain(args->domain); @@ -564,6 +567,23 @@ linux_socket(struct thread *td, struct l if (retval_socket) return (retval_socket); + if (socket_flags & LINUX_SOCK_NONBLOCK) { + retval_socket = kern_fcntl(td, td->td_retval[0], + F_SETFL, O_NONBLOCK); + if (retval_socket) { + (void)kern_close(td, td->td_retval[0]); + goto out; + } + } + if (socket_flags & LINUX_SOCK_CLOEXEC) { + retval_socket = kern_fcntl(td, td->td_retval[0], + F_SETFD, FD_CLOEXEC); + if (retval_socket) { + (void)kern_close(td, td->td_retval[0]); + goto out; + } + } + if (bsd_args.type == SOCK_RAW && (bsd_args.protocol == IPPROTO_RAW || bsd_args.protocol == 0) && bsd_args.domain == PF_INET) { @@ -599,6 +619,7 @@ linux_socket(struct thread *td, struct l } #endif +out: return (retval_socket); } Modified: stable/7/sys/compat/linux/linux_socket.h ============================================================================== --- stable/7/sys/compat/linux/linux_socket.h Tue Jun 16 05:08:48 2009 (r194283) +++ stable/7/sys/compat/linux/linux_socket.h Tue Jun 16 05:10:21 2009 (r194284) @@ -69,6 +69,13 @@ #define LINUX_SOCK_MAX LINUX_SOCK_SEQPACKET +#define LINUX_SOCK_TYPE_MASK 0xf + +/* Flags for socket, socketpair, accept4 */ + +#define LINUX_SOCK_CLOEXEC LINUX_O_CLOEXEC +#define LINUX_SOCK_NONBLOCK LINUX_O_NONBLOCK + struct l_ucred { uint32_t pid; uint32_t uid; Modified: stable/7/sys/i386/linux/linux.h ============================================================================== --- stable/7/sys/i386/linux/linux.h Tue Jun 16 05:08:48 2009 (r194283) +++ stable/7/sys/i386/linux/linux.h Tue Jun 16 05:10:21 2009 (r194284) @@ -534,6 +534,7 @@ int linux_ioctl_unregister_handler(struc #define LINUX_O_DIRECTORY 00200000 /* Must be a directory */ #define LINUX_O_NOFOLLOW 00400000 /* Do not follow links */ #define LINUX_O_NOATIME 01000000 +#define LINUX_O_CLOEXEC 02000000 #define LINUX_F_DUPFD 0 #define LINUX_F_GETFD 1 From jhb at FreeBSD.org Tue Jun 16 13:39:10 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Tue Jun 16 13:39:21 2009 Subject: svn commit: r194291 - stable/7/lib/libutil Message-ID: <200906161339.n5GDd9gO029232@svn.freebsd.org> Author: jhb Date: Tue Jun 16 13:39:09 2009 New Revision: 194291 URL: http://svn.freebsd.org/changeset/base/194291 Log: MFC: Note that these routines return NULL on failure and that the structures they return arrays of are defined in . Modified: stable/7/lib/libutil/ (props changed) stable/7/lib/libutil/kinfo_getfile.3 stable/7/lib/libutil/kinfo_getvmmap.3 Modified: stable/7/lib/libutil/kinfo_getfile.3 ============================================================================== --- stable/7/lib/libutil/kinfo_getfile.3 Tue Jun 16 13:31:01 2009 (r194290) +++ stable/7/lib/libutil/kinfo_getfile.3 Tue Jun 16 13:39:09 2009 (r194291) @@ -58,15 +58,20 @@ mib. While the kernel returns a packed structure, this function expands the data into a fixed record format. .Sh RETURN VALUES -The +On success the .Fn kinfo_getfile function returns a pointer to an array of .Vt struct kinfo_file -structures. +structures as defined by +.In sys/user.h . The array was obtained by an internal call to .Xr malloc 3 and must be freed by the caller with a call to .Xr free 3 . +On failure the +.Fn kinfo_getfile +function returns +.Dv NULL . .Sh SEE ALSO .Xr free 3 , .Xr kinfo_getvmmap 3 , Modified: stable/7/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- stable/7/lib/libutil/kinfo_getvmmap.3 Tue Jun 16 13:31:01 2009 (r194290) +++ stable/7/lib/libutil/kinfo_getvmmap.3 Tue Jun 16 13:39:09 2009 (r194291) @@ -58,15 +58,20 @@ mib. While the kernel returns a packed structure, this function expands the data into a fixed record format. .Sh RETURN VALUES -The +On success the .Fn kinfo_getvmmap function returns a pointer to an array of .Vt struct kinfo_vmentry -structures. +structures as defined by +.In sys/user.h . The array was obtained by an internal call to .Xr malloc 3 and must be freed by the caller with a call to .Xr free 3 . +On failure the +.Fn kinfo_getvmmap +function returns +.Dv NULL . .Sh SEE ALSO .Xr free 3 , .Xr kinfo_getfile 3 , From jhb at FreeBSD.org Tue Jun 16 15:09:18 2009 From: jhb at FreeBSD.org (John Baldwin) Date: Tue Jun 16 15:09:38 2009 Subject: svn commit: r194294 - in stable/7/sys: . contrib/pf dev/acpica dev/ath/ath_hal Message-ID: <200906161509.n5GF9Hed031691@svn.freebsd.org> Author: jhb Date: Tue Jun 16 15:09:17 2009 New Revision: 194294 URL: http://svn.freebsd.org/changeset/base/194294 Log: MFC: Rework the _BBN handling for Host-PCI bridges to always trust the first bus that claims to be bus 0. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_pcib_acpi.c stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_pcib_acpi.c Tue Jun 16 14:55:13 2009 (r194293) +++ stable/7/sys/dev/acpica/acpi_pcib_acpi.c Tue Jun 16 15:09:17 2009 (r194294) @@ -145,6 +145,7 @@ acpi_pcib_acpi_attach(device_t dev) { struct acpi_hpcib_softc *sc; ACPI_STATUS status; + static int bus0_seen = 0; u_int addr, slot, func, busok; uint8_t busno; @@ -155,6 +156,21 @@ acpi_pcib_acpi_attach(device_t dev) sc->ap_handle = acpi_get_handle(dev); /* + * Get our segment number by evaluating _SEG + * It's OK for this to not exist. + */ + status = acpi_GetInteger(sc->ap_handle, "_SEG", &sc->ap_segment); + if (ACPI_FAILURE(status)) { + if (status != AE_NOT_FOUND) { + device_printf(dev, "could not evaluate _SEG - %s\n", + AcpiFormatException(status)); + return_VALUE (ENXIO); + } + /* If it's not found, assume 0. */ + sc->ap_segment = 0; + } + + /* * Get our base bus number by evaluating _BBN. * If this doesn't work, we assume we're bus number 0. * @@ -168,8 +184,10 @@ acpi_pcib_acpi_attach(device_t dev) * XXX invoke _REG on this for the PCI config space address space? * XXX It seems many BIOS's with multiple Host-PCI bridges do not set * _BBN correctly. They set _BBN to zero for all bridges. Thus, - * if _BBN is zero and pcib0 already exists, we try to read our + * if _BBN is zero and PCI bus 0 already exists, we try to read our * bus number from the configuration registers at address _ADR. + * We only do this for domain/segment 0 in the hopes that this is + * only needed for old single-domain machines. */ status = acpi_GetInteger(sc->ap_handle, "_BBN", &sc->ap_bus); if (ACPI_FAILURE(status)) { @@ -184,11 +202,11 @@ acpi_pcib_acpi_attach(device_t dev) } /* - * If the bus is zero and pcib0 already exists, read the bus number - * via PCI config space. + * If this is segment 0, the bus is zero, and PCI bus 0 already + * exists, read the bus number via PCI config space. */ busok = 1; - if (sc->ap_bus == 0 && devclass_get_device(pcib_devclass, 0) != dev) { + if (sc->ap_segment == 0 && sc->ap_bus == 0 && bus0_seen) { busok = 0; status = acpi_GetInteger(sc->ap_handle, "_ADR", &addr); if (ACPI_FAILURE(status)) { @@ -225,20 +243,9 @@ acpi_pcib_acpi_attach(device_t dev) device_printf(dev, "trying bus number %d\n", sc->ap_bus); } - /* - * Get our segment number by evaluating _SEG - * It's OK for this to not exist. - */ - status = acpi_GetInteger(sc->ap_handle, "_SEG", &sc->ap_segment); - if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - device_printf(dev, "could not evaluate _SEG - %s\n", - AcpiFormatException(status)); - return_VALUE (ENXIO); - } - /* If it's not found, assume 0. */ - sc->ap_segment = 0; - } + /* If this is bus 0 on segment 0, note that it has been seen already. */ + if (sc->ap_segment == 0 && sc->ap_bus == 0) + bus0_seen = 1; return (acpi_pcib_attach(dev, &sc->ap_prt, sc->ap_bus)); } From brian at FreeBSD.org Wed Jun 17 02:20:28 2009 From: brian at FreeBSD.org (Brian Somers) Date: Wed Jun 17 02:20:45 2009 Subject: svn commit: r194318 - stable/7/usr.sbin/ppp Message-ID: <200906170220.n5H2KRg4059240@svn.freebsd.org> Author: brian Date: Wed Jun 17 02:20:26 2009 New Revision: 194318 URL: http://svn.freebsd.org/changeset/base/194318 Log: MFC: r192798: Fix a race that can stall the timer PR: 102747 Submitted by: Sergey Zaharchenko - doublef-ctm at yandex dot ru Modified: stable/7/usr.sbin/ppp/ (props changed) stable/7/usr.sbin/ppp/timer.c Modified: stable/7/usr.sbin/ppp/timer.c ============================================================================== --- stable/7/usr.sbin/ppp/timer.c Wed Jun 17 01:55:42 2009 (r194317) +++ stable/7/usr.sbin/ppp/timer.c Wed Jun 17 02:20:26 2009 (r194318) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1996 - 2001 Brian Somers + * Copyright (c) 1996 - 2001, 2009 Brian Somers * based on work by Toshiharu OHNO * Internet Initiative Japan, Inc (IIJ) * All rights reserved. @@ -94,9 +94,12 @@ timer_Start(struct pppTimer *tp) return; } - /* Adjust our first delta so that it reflects what's really happening */ + /* + * We just need to insert tp in the correct relative place. We don't + * need to adjust TimerList->rest (yet). + */ if (TimerList && getitimer(ITIMER_REAL, &itimer) == 0) - TimerList->rest = RESTVAL(itimer); + ticks = RESTVAL(itimer) - TimerList->rest; pt = NULL; for (t = TimerList; t; t = t->next) { @@ -132,6 +135,7 @@ timer_Start(struct pppTimer *tp) static void StopTimerNoBlock(struct pppTimer *tp) { + struct itimerval itimer; struct pppTimer *t, *pt; /* @@ -156,14 +160,11 @@ StopTimerNoBlock(struct pppTimer *tp) timer_TermService(); /* Terminate Timer Service */ } if (t->next) { - if (!pt) { /* t (tp) was the first in the list */ - struct itimerval itimer; - - if (getitimer(ITIMER_REAL, &itimer) == 0) - t->rest = RESTVAL(itimer); - } - t->next->rest += t->rest; - if (!pt) /* t->next is now the first in the list */ + if (!pt && getitimer(ITIMER_REAL, &itimer) == 0) + t->next->rest += RESTVAL(itimer); /* t (tp) was the first in the list */ + else + t->next->rest += t->rest; + if (!pt && t->next->rest > 0) /* t->next is now the first in the list */ timer_InitService(1); } } else { @@ -235,11 +236,19 @@ timer_Show(int LogLevel, struct prompt * { struct itimerval itimer; struct pppTimer *pt; - u_long rest = 0; + long rest; - /* Adjust our first delta so that it reflects what's really happening */ + /* + * Adjust the base time so that the deltas reflect what's really + * happening. Changing TimerList->rest might cause it to become zero + * (if getitimer() returns a value close to zero), and the + * timer_InitService() call will call setitimer() with zero it_value, + * stopping the itimer... so be careful! + */ if (TimerList && getitimer(ITIMER_REAL, &itimer) == 0) - TimerList->rest = RESTVAL(itimer); + rest = RESTVAL(itimer) - TimerList->rest; + else + rest = 0; #define SECS(val) ((val) / SECTICKS) #define HSECS(val) (((val) % SECTICKS) * 100 / SECTICKS) From edwin at FreeBSD.org Wed Jun 17 03:04:32 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Wed Jun 17 03:04:39 2009 Subject: svn commit: r194323 - in stable/7: etc/mtree share/colldef share/mklocale share/monetdef share/msgdef share/numericdef share/timedef Message-ID: <200906170304.n5H34V5H060505@svn.freebsd.org> Author: edwin Date: Wed Jun 17 03:04:30 2009 New Revision: 194323 URL: http://svn.freebsd.org/changeset/base/194323 Log: MFC of 193908: add ca_AD, ca_FR and ca_IT locales Catalan language is not only spoken in Spain (ca_ES), but also in Andorra, France and Italy. In Andorra it is the official language. (see http://en.wikipedia.org/wiki/Catalan_language#Geographic_distribution) PR: conf/92541 Submitted by: Modified: stable/7/etc/mtree/ (props changed) stable/7/etc/mtree/BSD.local.dist stable/7/etc/mtree/BSD.usr.dist stable/7/share/colldef/ (props changed) stable/7/share/colldef/Makefile stable/7/share/mklocale/ (props changed) stable/7/share/mklocale/Makefile stable/7/share/monetdef/ (props changed) stable/7/share/monetdef/Makefile stable/7/share/msgdef/ (props changed) stable/7/share/msgdef/Makefile stable/7/share/numericdef/ (props changed) stable/7/share/numericdef/Makefile stable/7/share/timedef/ (props changed) stable/7/share/timedef/Makefile Modified: stable/7/etc/mtree/BSD.local.dist ============================================================================== --- stable/7/etc/mtree/BSD.local.dist Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/etc/mtree/BSD.local.dist Wed Jun 17 03:04:30 2009 (r194323) @@ -541,12 +541,30 @@ .. bg_BG.UTF-8 .. + ca_AD.ISO8859-1 + .. ca_ES.ISO8859-1 .. + ca_FR.ISO8859-1 + .. + ca_IT.ISO8859-1 + .. + ca_AD.ISO8859-15 + .. ca_ES.ISO8859-15 .. + ca_FR.ISO8859-15 + .. + ca_IT.ISO8859-15 + .. + ca_AD.UTF-8 + .. ca_ES.UTF-8 .. + ca_FR.UTF-8 + .. + ca_IT.UTF-8 + .. cs_CZ.ISO8859-2 .. cs_CZ.UTF-8 Modified: stable/7/etc/mtree/BSD.usr.dist ============================================================================== --- stable/7/etc/mtree/BSD.usr.dist Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/etc/mtree/BSD.usr.dist Wed Jun 17 03:04:30 2009 (r194323) @@ -369,12 +369,30 @@ .. bg_BG.UTF-8 .. + ca_AD.ISO8859-1 + .. ca_ES.ISO8859-1 .. + ca_FR.ISO8859-1 + .. + ca_IT.ISO8859-1 + .. + ca_AD.ISO8859-15 + .. ca_ES.ISO8859-15 .. + ca_FR.ISO8859-15 + .. + ca_IT.ISO8859-15 + .. + ca_AD.UTF-8 + .. ca_ES.UTF-8 .. + ca_FR.UTF-8 + .. + ca_IT.UTF-8 + .. cs_CZ.ISO8859-2 .. cs_CZ.UTF-8 Modified: stable/7/share/colldef/Makefile ============================================================================== --- stable/7/share/colldef/Makefile Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/share/colldef/Makefile Wed Jun 17 03:04:30 2009 (r194323) @@ -69,6 +69,7 @@ ISO8859-1_ISO8859-1= ${ISO8859-15_ISO885 LATIN1LINKS= af_ZA da_DK en_AU en_CA en_GB en_NZ en_US eu_ES fi_FI \ fr_BE fr_CA fr_CH fr_FR it_CH it_IT nl_BE nl_NL pt_PT ISO8859-15_ISO8859-15= \ + ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT \ de_DE:de_AT de_DE:de_CH \ no_NO:nb_NO no_NO:nn_NO \ ${LATIN1LINKS:C/^/la_LN:/} @@ -89,11 +90,11 @@ US-ASCII_SJIS= la_LN:ja_JP ASCIILINKS= en_AU en_CA en_GB en_NZ en_US US-ASCII_US-ASCII= ${ASCIILINKS:C/^/la_LN:/} -UTF8LINKS= af_ZA am_ET be_BY bg_BG ca_ES cs_CZ da_DK de_AT de_CH \ - de_DE el_GR en_AU en_CA en_GB en_IE en_NZ en_US es_ES \ - et_EE eu_ES fi_FI fr_BE \ - fr_CA fr_CH fr_FR he_IL hr_HR hu_HU hy_AM is_IS it_CH it_IT \ - ja_JP kk_KZ ko_KR lt_LT mn_MN \ +UTF8LINKS= af_ZA am_ET be_BY bg_BG ca_AD ca_ES ca_FR ca_IT cs_CZ \ + da_DK de_AT de_CH de_DE \ + el_GR en_AU en_CA en_GB en_IE en_NZ en_US es_ES et_EE eu_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR he_IL hr_HR hu_HU hy_AM \ + is_IS it_CH it_IT ja_JP kk_KZ ko_KR lt_LT mn_MN \ nb_NO nl_BE nl_NL nn_NO no_NO pl_PL pt_BR pt_PT \ ro_RO ru_RU sk_SK sl_SI sr_YU sv_SE tr_TR uk_UA zh_CN zh_HK \ zh_TW Modified: stable/7/share/mklocale/Makefile ============================================================================== --- stable/7/share/mklocale/Makefile Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/share/mklocale/Makefile Wed Jun 17 03:04:30 2009 (r194323) @@ -51,8 +51,9 @@ ENCODINGS= CP1251 ISO8859-1 ISO8859-2 IS ASCIILINKS= en_AU en_CA en_GB en_NZ en_US US-ASCII_US-ASCII= ${ASCIILINKS:C/^/la_LN:/} -LATIN1XLINKS= af_ZA ca_ES da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_NZ \ - en_US es_ES eu_ES fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH \ +LATIN1XLINKS= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \ + en_AU en_CA en_GB en_NZ en_US es_ES eu_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH \ it_IT nb_NO nl_BE nl_NL nn_NO no_NO pt_PT sv_SE LATIN1LINKS= ${LATIN1XLINKS} pt_BR ISO8859-1_ISO8859-1= ${LATIN1LINKS:C/^/la_LN:/} @@ -72,7 +73,8 @@ ISO8859-5_ISO8859-5= ${LATIN5LINKS:C/^/r CP1251LINKS= ru_RU be_BY uk_UA CP1251_CP1251= ${CP1251LINKS:C/^/bg_BG:/} -UTF8LINKS= af_ZA be_BY bg_BG ca_ES cs_CZ da_DK de_AT de_CH de_DE el_GR \ +UTF8LINKS= af_ZA be_BY bg_BG ca_AD ca_ES ca_FR ca_IT cs_CZ \ + da_DK de_AT de_CH de_DE el_GR \ en_AU en_CA en_GB en_IE en_NZ en_US es_ES et_EE eu_ES fi_FI \ fr_BE \ fr_CA fr_CH fr_FR he_IL hr_HR hu_HU hy_AM is_IS it_CH it_IT \ Modified: stable/7/share/monetdef/Makefile ============================================================================== --- stable/7/share/monetdef/Makefile Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/share/monetdef/Makefile Wed Jun 17 03:04:30 2009 (r194323) @@ -100,13 +100,16 @@ Big5_UTF-8= zh_TW eucJP_SJIS= ja_JP eucKR_CP949= ko_KR GB2312_GBK= zh_CN -ISO8859-1_ISO8859-1= es_ES:eu_ES de_CH:fr_CH de_CH:it_CH no_NO:nb_NO no_NO:nn_NO -ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_AT de_CH de_DE en_AU en_CA \ - en_GB en_NZ en_US es_ES fi_FI fr_BE fr_CA fr_CH fr_FR \ +ISO8859-1_ISO8859-1= ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT es_ES:eu_ES \ + de_CH:fr_CH de_CH:it_CH no_NO:nb_NO no_NO:nn_NO +ISO8859-1_ISO8859-15= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \ + en_AU en_CA en_GB en_NZ en_US es_ES \ + fi_FI fr_BE fr_CA fr_CH fr_FR \ is_IS it_IT it_CH nl_BE nl_NL nb_NO nn_NO no_NO pt_PT sv_SE ISO8859-1_US-ASCII= en_AU en_CA en_GB en_NZ en_US -ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_AT de_CH de_DE en_AU en_CA en_NZ \ - en_US es_ES fi_FI fr_BE fr_CA fr_FR is_IS it_IT nl_BE \ +ISO8859-1_UTF-8= af_ZA ca_AD ca_ES ca_FR ca_IT da_DK de_AT de_CH de_DE \ + en_AU en_CA en_NZ en_US es_ES \ + fi_FI fr_BE fr_CA fr_FR is_IS it_IT nl_BE \ nl_NL nb_NO nn_NO no_NO pt_BR pt_PT sv_SE ISO8859-2_UTF-8= hr_HR hu_HU ro_RO sk_SK sl_SI sr_YU ISO8859-7_UTF-8= el_GR @@ -116,7 +119,8 @@ ISO8859-13_UTF-8= lt_LT ISO8859-15_ISO8859-15= es_ES:eu_ES ISO8859-15_UTF-8= et_EE UTF-8_Big5HKSCS= zh_HK -UTF-8_UTF-8= es_ES:eu_ES de_CH:fr_CH de_CH:it_CH +UTF-8_UTF-8= ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT \ + es_ES:eu_ES de_CH:fr_CH de_CH:it_CH SYMLINKS= .for enc1 in ${ENCODINGS} Modified: stable/7/share/msgdef/Makefile ============================================================================== --- stable/7/share/msgdef/Makefile Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/share/msgdef/Makefile Wed Jun 17 03:04:30 2009 (r194323) @@ -83,6 +83,7 @@ FILESDIR_${locale}.out= ${LOCALEDIR}/${l CLEANFILES= ${FILES} +CA_LINKS= ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT CZ_LINKS= cs_CZ:sk_SK DE_LINKS= de_DE:de_AT de_DE:de_CH FR_LINKS= fr_FR:fr_CA @@ -100,12 +101,12 @@ Big5_Big5HKSCS= zh_TW:zh_HK eucKR_CP949= ko_KR eucKR_UTF-8= ko_KR GB2312_GBK= zh_CN -ISO8859-1_ISO8859-1= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ - ${NL_LINKS} ${NO_LINKS} ${PT_LINKS} +ISO8859-1_ISO8859-1= ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ + ${IT_LINKS} ${NL_LINKS} ${NO_LINKS} ${PT_LINKS} ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_DE en_CA en_GB en_US es_ES \ eu_ES fi_FI fr_BE fr_CH fr_FR is_IS it_IT nl_NL no_NO \ pt_PT sv_SE \ - ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ + ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ ${NL_LINKS} ${NO_LINKS} ISO8859-1_US-ASCII= ${GB_LINKS} en_CA en_GB en_US ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_DE en_CA en_GB en_US es_ES eu_ES \ @@ -117,7 +118,8 @@ ISO8859-9_UTF-8= tr_TR ISO8859-13_ISO8859-4= lt_LT ISO8859-13_UTF-8= lt_LT ISO8859-15_UTF-8= et_EE -UTF-8_UTF-8= ${CZ_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} en_GB:en_IE \ +UTF-8_UTF-8= ${CA_LINKS} ${CZ_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ + en_GB:en_IE \ ${IT_LINKS} ${NL_LINKS} ${NO_LINKS} ${PT_LINKS} zh_TW:zh_HK SYMLINKS= Modified: stable/7/share/numericdef/Makefile ============================================================================== --- stable/7/share/numericdef/Makefile Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/share/numericdef/Makefile Wed Jun 17 03:04:30 2009 (r194323) @@ -68,6 +68,7 @@ ENCODINGS= ARMSCII-8 Big5 Big5HKSCS \ KOI8-R KOI8-U PT154 SJIS US-ASCII UTF-8 BE_LINKS= fr_BE:nl_BE +CA_LINKS= ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT DE_LINKS= de_DE:de_AT FR_LINKS= fr_FR:fr_CA fr_FR:fr_CH GB_LINKS= en_GB:en_AU en_GB:en_NZ @@ -92,11 +93,11 @@ eucJP_UTF-8= ja_JP eucKR_CP949= ko_KR eucKR_UTF-8= ko_KR ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES \ - fi_FI fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT \ - sv_SE ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ - ${IT_LINKS} ${NO_LINKS} ${US_LINKS} -ISO8859-1_ISO8859-1= ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ + fi_FI fr_BE fr_FR is_IS it_CH it_IT nl_NL no_NO pt_PT sv_SE \ + ${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ ${IT_LINKS} ${NO_LINKS} ${US_LINKS} +ISO8859-1_ISO8859-1= ${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} \ + ${GB_LINKS} ${IT_LINKS} ${NO_LINKS} ${US_LINKS} ISO8859-1_US-ASCII= en_US ${GB_LINKS} ${US_LINKS} ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES fi_FI \ fr_BE fr_FR is_IS it_IT nl_NL no_NO pt_BR pt_PT sv_SE @@ -114,8 +115,8 @@ KOI8-R_ISO8859-5= ru_RU KOI8-U_ISO8859-5= uk_UA PT154_UTF-8= kk_KZ US-ASCII_UTF-8= en_US:he_IL -UTF-8_UTF-8= ${BE_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} en_GB:en_IE \ - ${IT_LINKS} ${NO_LINKS} ${US_LINKS} +UTF-8_UTF-8= ${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ + en_GB:en_IE ${IT_LINKS} ${NO_LINKS} ${US_LINKS} SYMLINKS= .for enc1 in ${ENCODINGS} Modified: stable/7/share/timedef/Makefile ============================================================================== --- stable/7/share/timedef/Makefile Wed Jun 17 02:55:53 2009 (r194322) +++ stable/7/share/timedef/Makefile Wed Jun 17 03:04:30 2009 (r194323) @@ -114,6 +114,7 @@ ENCODINGS= Big5HKSCS CP949 eucKR GB2312 ISO8859-1 ISO8859-2 ISO8859-4 ISO8859-15 \ US-ASCII UTF-8 +CA_LINKS= ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT DE_LINKS= de_DE:de_CH FR_LINKS= fr_FR:fr_BE fr_FR:fr_CA fr_FR:fr_CH IT_LINKS= it_IT:it_CH @@ -123,20 +124,21 @@ GB_LINKS= en_GB:en_AU en_GB:en_CA en_GB: eucKR_CP949= ko_KR GB2312_GBK= zh_CN -ISO8859-1_ISO8859-1= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ - ${NL_LINKS} ${NO_LINKS} en_US:af_ZA +ISO8859-1_ISO8859-1= ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \ + ${IT_LINKS} ${NL_LINKS} ${NO_LINKS} en_US:af_ZA ISO8859-1_ISO8859-15= ca_ES da_DK de_AT de_DE en_GB en_US es_ES eu_ES \ fi_FI fr_FR is_IS it_IT la_LN nb_NO nl_NL nn_NO no_NO pt_PT \ sv_SE \ - ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} + ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ + ${NL_LINKS} ISO8859-1_US-ASCII= ${GB_LINKS} en_GB en_US la_LN ISO8859-1_ISO8859-2= la_LN ISO8859-1_ISO8859-4= la_LN ISO8859-1_UTF-8= en_GB en_US eu_ES nl_NL ISO8859-15_ISO8859-15= en_US:af_ZA UTF-8_Big5HKSCS= zh_TW:zh_HK -UTF-8_UTF-8= ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} ${NL_LINKS} \ - ${NO_LINKS} \ +UTF-8_UTF-8= ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} ${IT_LINKS} \ + ${NL_LINKS} ${NO_LINKS} \ en_GB:en_IE en_US:af_ZA zh_TW:zh_HK SYMLINKS= From edwin at FreeBSD.org Wed Jun 17 03:08:56 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Wed Jun 17 03:09:12 2009 Subject: svn commit: r194324 - stable/7/share/timedef Message-ID: <200906170308.n5H38tBX060637@svn.freebsd.org> Author: edwin Date: Wed Jun 17 03:08:55 2009 New Revision: 194324 URL: http://svn.freebsd.org/changeset/base/194324 Log: Invalid (long) date format in pl_PL.ISO8859-2.src Date format is %a %e %b %X %Y %Z (e.g "sob 19 sty 15:46:50 2008 CET") but should be "%a %e %b %Y %X %Z" (e.g. "sob 19 sty 2008 15:46:50 CET"). PR: conf/119804 Submitted by: Bodek Modified: stable/7/share/timedef/ (props changed) stable/7/share/timedef/pl_PL.ISO8859-2.src stable/7/share/timedef/pl_PL.UTF-8.src Modified: stable/7/share/timedef/pl_PL.ISO8859-2.src ============================================================================== --- stable/7/share/timedef/pl_PL.ISO8859-2.src Wed Jun 17 03:04:30 2009 (r194323) +++ stable/7/share/timedef/pl_PL.ISO8859-2.src Wed Jun 17 03:08:55 2009 (r194324) @@ -72,7 +72,7 @@ sobota # # date_fmt # -%a %e %b %X %Y %Z +%a %e %b %Y %X %Z # # Long months names (alternative) # Modified: stable/7/share/timedef/pl_PL.UTF-8.src ============================================================================== --- stable/7/share/timedef/pl_PL.UTF-8.src Wed Jun 17 03:04:30 2009 (r194323) +++ stable/7/share/timedef/pl_PL.UTF-8.src Wed Jun 17 03:08:55 2009 (r194324) @@ -72,7 +72,7 @@ sobota # # date_fmt # -%a %e %b %X %Y %Z +%a %e %b %Y %X %Z # # Long months names (alternative) # From edwin at FreeBSD.org Wed Jun 17 03:14:20 2009 From: edwin at FreeBSD.org (Edwin Groothuis) Date: Wed Jun 17 03:14:33 2009 Subject: svn commit: r194326 - stable/7/share/colldef Message-ID: <200906170314.n5H3EIq0060990@svn.freebsd.org> Author: edwin Date: Wed Jun 17 03:14:18 2009 New Revision: 194326 URL: http://svn.freebsd.org/changeset/base/194326 Log: Croatian locale support for hr_HR.ISO8859-2 Without this patch /usr/share/locale/hr_HR.ISO8859-2/LC_COLLATE is a link to the ../la_LN.ISO8859-2/LC_COLLATE. It means that there is no support for Croatian locale. PR: conf/120113 Submitted by: Simun Mikecin Added: stable/7/share/colldef/hr_HR.ISO8859-2.src - copied unchanged from r193961, head/share/colldef/hr_HR.ISO8859-2.src Modified: stable/7/share/colldef/ (props changed) stable/7/share/colldef/Makefile Modified: stable/7/share/colldef/Makefile ============================================================================== --- stable/7/share/colldef/Makefile Wed Jun 17 03:09:13 2009 (r194325) +++ stable/7/share/colldef/Makefile Wed Jun 17 03:14:18 2009 (r194326) @@ -14,6 +14,7 @@ LOCALES= bg_BG.CP1251 \ es_ES.ISO8859-15 \ et_EE.ISO8859-15 \ hi_IN.ISCII-DEV \ + hr_HR.ISO8859-2 \ hy_AM.ARMSCII-8 \ is_IS.ISO8859-1 \ is_IS.ISO8859-15 \ @@ -74,7 +75,7 @@ ISO8859-15_ISO8859-15= \ no_NO:nb_NO no_NO:nn_NO \ ${LATIN1LINKS:C/^/la_LN:/} -LATIN2LINKS= hr_HR hu_HU ro_RO sr_YU +LATIN2LINKS= hu_HU ro_RO sr_YU ISO8859-2_ISO8859-2= ${LATIN2LINKS:C/^/la_LN:/} cs_CZ:sk_SK US-ASCII_Big5HKSCS= la_LN:zh_HK Copied: stable/7/share/colldef/hr_HR.ISO8859-2.src (from r193961, head/share/colldef/hr_HR.ISO8859-2.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/share/colldef/hr_HR.ISO8859-2.src Wed Jun 17 03:14:18 2009 (r194326, copy of r193961, head/share/colldef/hr_HR.ISO8859-2.src) @@ -0,0 +1,39 @@ +# +# Croatian collation sequence +# 2007-01-29 numisemis at yahoo dot com +# +# $FreeBSD$ +# + +charmap map.ISO8859-2 +order \ +# controls + ;...;;;...;;\ +# + ;;!;\";;\ + ;;\ + %;&;<',>;<';>;';\(;\);*;+;<-:>;<*X>;\,;<-->;-;.;<'.>;/;\ +# digits + 0;...;9;\ +# + :;\;;\<;=;>;?;;;\ +# capital + (A,,>,,,);\ + B;(C,);;;(D,);;(E,,,,);\ + F;G;H;(I,,>);\ + J;K;(L,,,);M;(N,,);(O,,>,,);\ + P;Q;(R,,);(S,,);;(T,,);\ + (U,,,,);\ + V;W;X;(Y,);(Z,,);;\ +# + [;\\;];^;<':>;<'">;<'<>;<'(>;_;<''>;`;\ +# small + (a,,>,,,);\ + b;(c,);;;(d,);;(e,,,,);\ + f;g;h;(i,,>);\ + j;k;(l,,,);m;(n,,);(o,,>,,);\ + p;q;(r,,);(s,,,);;(t,,);\ + (u,,,,);\ + v;w;x;(y,);(z,,);;\ +# + \{;|;\};~;;