From owner-p4-projects@FreeBSD.ORG Fri Nov 21 05:34:52 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4228A16A4D0; Fri, 21 Nov 2003 05:34:52 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D34616A4CE for ; Fri, 21 Nov 2003 05:34:52 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84AEA43FA3 for ; Fri, 21 Nov 2003 05:34:51 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hALDYpXJ081449 for ; Fri, 21 Nov 2003 05:34:51 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hALDYpXp081446 for perforce@freebsd.org; Fri, 21 Nov 2003 05:34:51 -0800 (PST) (envelope-from areisse@nailabs.com) Message-Id: <200311211334.hALDYpXp081446@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 42887 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Fri, 21 Nov 2003 13:34:52 -0000 X-Original-Date: Fri, 21 Nov 2003 05:34:51 -0800 (PST) X-List-Received-Date: Fri, 21 Nov 2003 13:34:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=42887 Change 42887 by areisse@areisse_ibook on 2003/11/21 05:33:58 point flask sources back to the included ones Affected files ... .. //depot/projects/trustedbsd/sedarwin/policy/Makefile#4 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/policy/Makefile#4 (text+ko) ==== @@ -1,11 +1,9 @@ include ../Makeconfig -FLASK=$(DARWIN)/security/sebsd/flask - default: policy.h -INPUTS = $(FLASK)/security_classes $(FLASK)/initial_sids \ - $(FLASK)/access_vectors rules.m4 users initial_sid_contexts fs_use \ +INPUTS = flask/security_classes flask/initial_sids \ + flask/access_vectors rules.m4 users initial_sid_contexts fs_use \ devfs policy.conf: $(INPUTS) From owner-p4-projects@FreeBSD.ORG Fri Nov 21 12:34:57 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5F18316A4D1; Fri, 21 Nov 2003 12:34:57 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38A6116A4CE for ; Fri, 21 Nov 2003 12:34:57 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F7CA43FB1 for ; Fri, 21 Nov 2003 12:34:56 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hALKYtXJ008598 for ; Fri, 21 Nov 2003 12:34:55 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hALKYtiu008595 for perforce@freebsd.org; Fri, 21 Nov 2003 12:34:55 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Message-Id: <200311212034.hALKYtiu008595@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 42906 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Fri, 21 Nov 2003 20:34:57 -0000 X-Original-Date: Fri, 21 Nov 2003 12:34:55 -0800 (PST) X-List-Received-Date: Fri, 21 Nov 2003 20:34:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=42906 Change 42906 by rwatson@rwatson_powerbook on 2003/11/21 12:34:16 install and install-window-server-wrapper targets. Affected files ... .. //depot/projects/trustedbsd/sedarwin/sebsd_system/wslogin/Makefile#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/sebsd_system/wslogin/Makefile#3 (text+ko) ==== @@ -6,5 +6,18 @@ wslogin.dylib: $(OBJS) gcc -dynamiclib -o $@ $(OBJS) ../../libsebsd/libsebsd.a ../../libmac/*.o +install: + install -m 644 -o root -g wheel wslogin.dylib /usr/lib + cd build ; tar -cf - wsloginui.app | (cd /System/Library/CoreServices \ + ; tar -xf -) + chown -R root:wheel /System/Library/CoreServices/wsloginui.app + +# +# Really be careful here! I wonder if we can make Make fail if it's already +# there...? +# +install-window-server-wrapper: + install -m 755 -o root -g wheel WindowServer /System/Library/Coreservices + clean: rm -f $(OBJS) wslogin.dylib From owner-p4-projects@FreeBSD.ORG Sat Nov 29 11:34:11 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9247D16A4CF; Sat, 29 Nov 2003 11:34:11 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59BFA16A4D0 for ; Sat, 29 Nov 2003 11:34:11 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E40F143FE1 for ; Sat, 29 Nov 2003 11:34:09 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hATJY9XJ043371 for ; Sat, 29 Nov 2003 11:34:09 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hATJY9Z9043368 for perforce@freebsd.org; Sat, 29 Nov 2003 11:34:09 -0800 (PST) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Message-Id: <200311291934.hATJY9Z9043368@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 43156 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sat, 29 Nov 2003 19:34:12 -0000 X-Original-Date: Sat, 29 Nov 2003 11:34:09 -0800 (PST) X-List-Received-Date: Sat, 29 Nov 2003 19:34:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=43156 Change 43156 by rwatson@rwatson_powerbook on 2003/11/29 11:33:46 Clean up wslogin build, install. Affected files ... .. //depot/projects/trustedbsd/sedarwin/sebsd_system/wslogin/Makefile#5 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/sebsd_system/wslogin/Makefile#5 (text+ko) ==== @@ -3,16 +3,18 @@ OBJS = wslogin.o +all: wslogin.dylib build/wsloginui.app + wslogin.dylib: $(OBJS) gcc -dynamiclib -o $@ $(OBJS) ../../libsebsd/libsebsd.a ../../libmac/*.o -wsloginui.app: LabelChooser.m LabelChooser.h main.m +build/wsloginui.app: LabelChooser.m LabelChooser.h main.m pbxbuild install: install -m 644 -o root -g wheel wslogin.dylib /usr/lib - cd build ; tar -cf - wsloginui.app | (cd /System/Library/CoreServices \ - ; tar -xf -) + (cd build ; tar -cf - wsloginui.app) | (cd \ + /System/Library/CoreServices ; tar -xf -) chown -R root:wheel /System/Library/CoreServices/wsloginui.app # @@ -29,4 +31,4 @@ clean: rm -f $(OBJS) wslogin.dylib - rm -Rf wsloginui.app + rm -Rf build From owner-p4-projects@FreeBSD.ORG Wed Dec 10 12:34:54 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BB4EC16A4D0; Wed, 10 Dec 2003 12:34:54 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D64516A4CE for ; Wed, 10 Dec 2003 12:34:54 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51E1D43D1D for ; Wed, 10 Dec 2003 12:34:53 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hBAKYrXJ030031 for ; Wed, 10 Dec 2003 12:34:53 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hBAKYqDO030028 for perforce@freebsd.org; Wed, 10 Dec 2003 12:34:52 -0800 (PST) (envelope-from sam@freebsd.org) Message-Id: <200312102034.hBAKYqDO030028@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 43753 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 10 Dec 2003 20:34:55 -0000 X-Original-Date: Wed, 10 Dec 2003 12:34:52 -0800 (PST) X-List-Received-Date: Wed, 10 Dec 2003 20:34:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=43753 Change 43753 by sam@sam_ebb on 2003/12/10 12:34:18 strip spl's to indicate this code is properly locked Affected files ... .. //depot/projects/netperf+sockets/sys/kern/uipc_socket.c#5 edit Differences ... ==== //depot/projects/netperf+sockets/sys/kern/uipc_socket.c#5 (text+ko) ==== @@ -531,7 +531,7 @@ struct mbuf **mp; struct mbuf *m; long space, len, resid; - int clen = 0, error, s, dontroute, mlen; + int clen = 0, error, dontroute, mlen; int atomic = sosendallatonce(so) || top; #ifdef ZERO_COPY_SOCKETS int cow_send; @@ -563,20 +563,18 @@ td->td_proc->p_stats->p_ru.ru_msgsnd++; if (control) clen = control->m_len; -#define snderr(errno) { error = (errno); splx(s); goto release; } +#define snderr(errno) { error = (errno); goto release; } SOCKBUF_LOCK(&so->so_snd); error = sblock(&so->so_snd, SBLOCKWAIT(flags)); if (error) goto out; do { - s = splnet(); if (so->so_state & SS_CANTSENDMORE) snderr(EPIPE); if (so->so_error) { error = so->so_error; so->so_error = 0; - splx(s); goto release; } if ((so->so_state & SS_ISCONNECTED) == 0) { @@ -606,12 +604,10 @@ if (so->so_state & SS_NBIO) snderr(EWOULDBLOCK); error = sbwait(&so->so_snd); - splx(s); if (error) goto release; continue; } - splx(s); mp = ⊤ space -= clen; do { @@ -705,13 +701,12 @@ } while (space > 0 && atomic); if (dontroute) so->so_options |= SO_DONTROUTE; - s = splnet(); /* XXX */ /* * XXX all the SS_CANTSENDMORE checks previously * done could be out of date. We could have recieved * a reset packet in an interrupt or maybe we slept * while doing page faults in uiomove() etc. We could - * probably recheck again inside the splnet() protection + * probably recheck again inside the locking protection * here, but there are probably other places that this * also happens. We must rethink this. */ @@ -729,7 +724,6 @@ /* If there is more to send set PRUS_MORETOCOME */ (resid > 0 && space > 0) ? PRUS_MORETOCOME : 0, top, addr, control, td); - splx(s); if (dontroute) so->so_options &= ~SO_DONTROUTE; clen = 0; @@ -778,7 +772,7 @@ int *flagsp; { struct mbuf *m, **mp; - int flags, len, error, s, offset; + int flags, len, error, offset; struct protosw *pr = so->so_proto; struct mbuf *nextrecord; int moff, type = 0; @@ -840,7 +834,6 @@ error = sblock(&so->so_rcv, SBLOCKWAIT(flags)); if (error) goto out; - s = splnet(); restart: m = so->so_rcv.sb_mb; @@ -895,7 +888,6 @@ SBLASTRECORDCHK(&so->so_rcv); SBLASTMBUFCHK(&so->so_rcv); error = sbwait(&so->so_rcv); - splx(s); if (error) goto out; goto restart; @@ -1000,7 +992,6 @@ if (mp == 0) { SBLASTRECORDCHK(&so->so_rcv); SBLASTMBUFCHK(&so->so_rcv); - splx(s); SOCKBUF_UNLOCK(&so->so_rcv); #ifdef ZERO_COPY_SOCKETS if (so_zero_copy_receive) { @@ -1026,7 +1017,6 @@ #endif /* ZERO_COPY_SOCKETS */ error = uiomove(mtod(m, char *) + moff, (int)len, uio); SOCKBUF_LOCK(&so->so_rcv); - s = splnet(); if (error) goto release; } else @@ -1143,7 +1133,6 @@ if (orig_resid == uio->uio_resid && orig_resid && (flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) { sbunlock(&so->so_rcv); - splx(s); goto restart; } @@ -1151,7 +1140,6 @@ *flagsp |= flags; release: sbunlock(&so->so_rcv); - splx(s); out: SOCKBUF_UNLOCK(&so->so_rcv); return (error); From owner-p4-projects@FreeBSD.ORG Tue Jan 27 08:01:30 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6FAC816A4D0; Tue, 27 Jan 2004 08:01:30 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 493BF16A4CE for ; Tue, 27 Jan 2004 08:01:30 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0819043D2D for ; Tue, 27 Jan 2004 08:01:29 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0RG1S0B023582 for ; Tue, 27 Jan 2004 08:01:28 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0RG1STm023576 for perforce@freebsd.org; Tue, 27 Jan 2004 08:01:28 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Tue, 27 Jan 2004 08:01:28 -0800 (PST) Message-Id: <200401271601.i0RG1STm023576@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 45994 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 16:01:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=45994 Change 45994 by areisse@areisse_ibook on 2004/01/27 08:00:44 The makefile works (if you installed the libraries) Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/system_cmds/mach_init.tproj/Makefile#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/apsl/system_cmds/mach_init.tproj/Makefile#2 (text+ko) ==== @@ -26,7 +26,7 @@ NEXTSTEP_INSTALLDIR = /sbin WINDOWS_INSTALLDIR = /sbin PDO_UNIX_INSTALLDIR = /sbin -LIBS = +LIBS = -lsebsd -lmac DEBUG_LIBS = $(LIBS) PROF_LIBS = $(LIBS) From owner-p4-projects@FreeBSD.ORG Tue Jan 27 12:13:55 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 86F0E16A4D0; Tue, 27 Jan 2004 12:13:55 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 594AE16A4CE for ; Tue, 27 Jan 2004 12:13:55 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1142143D5C for ; Tue, 27 Jan 2004 12:13:01 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0RKD00B090072 for ; Tue, 27 Jan 2004 12:13:00 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0RKD0Ti090061 for perforce@freebsd.org; Tue, 27 Jan 2004 12:13:00 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 27 Jan 2004 12:13:00 -0800 (PST) Message-Id: <200401272013.i0RKD0Ti090061@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46014 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 20:13:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=46014 Change 46014 by sam@sam_ebb on 2004/01/27 12:12:00 Checkpoint in-progress merge of the netbsd and madwifi work. Affected files ... .. //depot/projects/netperf+sockets/sys/conf/files#7 edit .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#18 edit .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath_pci.c#3 edit .. //depot/projects/netperf+sockets/sys/dev/ath/if_athioctl.h#6 edit .. //depot/projects/netperf+sockets/sys/dev/ath/if_athvar.h#5 edit .. //depot/projects/netperf+sockets/sys/dev/awi/awi.c#6 edit .. //depot/projects/netperf+sockets/sys/dev/awi/awivar.h#3 edit .. //depot/projects/netperf+sockets/sys/dev/wi/if_wi.c#7 edit .. //depot/projects/netperf+sockets/sys/dev/wi/if_wivar.h#3 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#7 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.h#7 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_compat.c#3 delete .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_compat.h#4 delete .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_crypto.c#4 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_crypto.h#4 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.c#1 add .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.h#1 add .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#6 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#11 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#4 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.c#1 add .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.h#1 add .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.o#1 add .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_netbsd.c#1 add .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_netbsd.h#1 add .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#4 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#4 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#7 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#5 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.h#4 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_radiotap.h#5 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/conf/files#7 (text+ko) ==== @@ -1267,6 +1267,7 @@ net/zlib.c optional crypto net80211/ieee80211.c optional wlan net80211/ieee80211_crypto.c optional wlan +net80211/ieee80211_freebsd.c optional wlan net80211/ieee80211_input.c optional wlan net80211/ieee80211_ioctl.c optional wlan net80211/ieee80211_node.c optional wlan ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#18 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -105,7 +105,7 @@ static void ath_initkeytable(struct ath_softc *); static void ath_mode_init(struct ath_softc *); static int ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *); -static void ath_beacon_proc(void *, int); +static void ath_beacon_proc(struct ath_softc *); static void ath_beacon_free(struct ath_softc *); static void ath_beacon_config(struct ath_softc *); static int ath_desc_alloc(struct ath_softc *); @@ -121,6 +121,7 @@ static int ath_tx_start(struct ath_softc *, struct ieee80211_node *, struct ath_buf *, struct mbuf *); static void ath_tx_proc(void *, int); +static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); static void ath_draintxq(struct ath_softc *); static void ath_stoprecv(struct ath_softc *); @@ -131,9 +132,9 @@ static void ath_newassoc(struct ieee80211com *, struct ieee80211_node *, int); static int ath_getchannels(struct ath_softc *, u_int cc, - HAL_BOOL outdoor, HAL_BOOL xchans); + HAL_BOOL outdoor, HAL_BOOL xchanmode); -static int ath_rate_setup(struct ath_softc *sc, u_int mode); +static int ath_rate_setup(struct ath_softc *, u_int mode); static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode); static void ath_rate_update(struct ath_softc *, struct ieee80211_node *, int rate); @@ -204,7 +205,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; + struct ifnet *ifp = &sc->sc_if; struct ath_hal *ah; HAL_STATUS status; int error = 0; @@ -290,7 +291,6 @@ TASK_INIT(&sc->sc_txtask, 0, ath_tx_proc, sc); TASK_INIT(&sc->sc_rxtask, 0, ath_rx_proc, sc); - TASK_INIT(&sc->sc_swbatask, 0, ath_beacon_proc, sc); TASK_INIT(&sc->sc_rxorntask, 0, ath_rxorn_proc, sc); TASK_INIT(&sc->sc_fataltask, 0, ath_fatal_proc, sc); TASK_INIT(&sc->sc_bmisstask, 0, ath_bmiss_proc, sc); @@ -308,7 +308,7 @@ ); if (sc->sc_txhalq == (u_int) -1) { if_printf(ifp, "unable to setup a data xmit queue!\n"); - goto bad; + goto bad2; } sc->sc_bhalq = ath_hal_setuptxqueue(ah, HAL_TX_QUEUE_BEACON, @@ -316,7 +316,7 @@ ); if (sc->sc_bhalq == (u_int) -1) { if_printf(ifp, "unable to setup a beacon xmit queue!\n"); - goto bad; + goto bad2; } ifp->if_softc = sc; @@ -327,7 +327,7 @@ ifp->if_init = ath_init; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; - ic->ic_softc = sc; + ic->ic_ifp = ifp; ic->ic_reset = ath_reset; ic->ic_newassoc = ath_newassoc; /* XXX not right but it's not used anywhere important */ @@ -346,7 +346,7 @@ ath_hal_getmac(ah, ic->ic_myaddr); /* call MI attach routine. */ - ieee80211_ifattach(ifp); + ieee80211_ifattach(ic); /* override default methods */ ic->ic_node_alloc = ath_node_alloc; ic->ic_node_free = ath_node_free; @@ -355,7 +355,7 @@ sc->sc_newstate = ic->ic_newstate; ic->ic_newstate = ath_newstate; /* complete initialization */ - ieee80211_media_init(ifp, ath_media_change, ieee80211_media_status); + ieee80211_media_init(ic, ath_media_change, ieee80211_media_status); bpfattach2(ifp, DLT_IEEE802_11_RADIO, sizeof(struct ieee80211_frame) + sizeof(sc->sc_tx_th), @@ -375,6 +375,8 @@ if_printf(ifp, "802.11 address: %s\n", ether_sprintf(ic->ic_myaddr)); return 0; +bad2: + ath_desc_free(sc); bad: if (ah) ath_hal_detach(ah); @@ -385,7 +387,8 @@ int ath_detach(struct ath_softc *sc) { - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; + struct ieee80211com *ic = &sc->sc_ic; DPRINTF(ATH_DEBUG_ANY, ("%s: if_flags %x\n", __func__, ifp->if_flags)); @@ -395,7 +398,7 @@ ATH_TXQ_LOCK_DESTROY(sc); ath_desc_free(sc); ath_hal_detach(sc->sc_ah); - ieee80211_ifdetach(ifp); + ieee80211_ifdetach(ic); return 0; } @@ -403,7 +406,7 @@ void ath_suspend(struct ath_softc *sc) { - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; DPRINTF(ATH_DEBUG_ANY, ("%s: if_flags %x\n", __func__, ifp->if_flags)); @@ -413,7 +416,7 @@ void ath_resume(struct ath_softc *sc) { - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; DPRINTF(ATH_DEBUG_ANY, ("%s: if_flags %x\n", __func__, ifp->if_flags)); @@ -427,19 +430,22 @@ void ath_shutdown(struct ath_softc *sc) { - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; DPRINTF(ATH_DEBUG_ANY, ("%s: if_flags %x\n", __func__, ifp->if_flags)); ath_stop(ifp); } +/* + * Interrupt handler. Most of the actual processing is + * deferred to tasklets. + */ void ath_intr(void *arg) { struct ath_softc *sc = arg; - struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; + struct ifnet *ifp = &sc->sc_if; struct ath_hal *ah = sc->sc_ah; HAL_INT status; @@ -495,8 +501,14 @@ taskqueue_enqueue(taskqueue_swi, &sc->sc_rxtask); if (status & HAL_INT_TX) taskqueue_enqueue(taskqueue_swi, &sc->sc_txtask); - if (status & HAL_INT_SWBA) - taskqueue_enqueue(taskqueue_swi, &sc->sc_swbatask); + if (status & HAL_INT_SWBA) { + /* + * Handle beacon transmission directly; deferring + * this is too slow to meet timing constraints + * under load. + */ + ath_beacon_proc(sc); + } if (status & HAL_INT_BMISS) { sc->sc_stats.ast_bmiss++; taskqueue_enqueue(taskqueue_swi, &sc->sc_bmisstask); @@ -559,8 +571,8 @@ ath_init(void *arg) { struct ath_softc *sc = (struct ath_softc *) arg; + struct ifnet *ifp = &sc->sc_if; struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; struct ieee80211_node *ni; enum ieee80211_phymode mode; struct ath_hal *ah = sc->sc_ah; @@ -577,7 +589,20 @@ */ ath_stop(ifp); +#if 0 /* + * For the MAC address. When this is changed we + * are called after if_setlladdr has already copied + * the new address to the arpcom structure so just + * take it from there. + * + * XXX not right for multiple vap's + */ + IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_ac.ac_enaddr); + ath_hal_setmac(ah, ic->ic_myaddr); +#endif + + /* * The basic interface to setting the hardware in a good * state is ``reset''. On return the hardware is known to * be powered up and with interrupts disabled. This must @@ -637,8 +662,8 @@ static void ath_stop(struct ifnet *ifp) { - struct ieee80211com *ic = (struct ieee80211com *) ifp; struct ath_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; DPRINTF(ATH_DEBUG_ANY, ("%s: invalid %u if_flags 0x%x\n", @@ -688,7 +713,7 @@ static int ath_reset(struct ieee80211com *ic) { - struct ifnet *ifp = &ic->ic_if; + struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; struct ieee80211_channel *c; @@ -716,12 +741,19 @@ * hardware state we do this regardless. */ ath_initkeytable(sc); - ath_hal_intrset(ah, sc->sc_imask); if (ath_startrecv(sc) != 0) /* restart recv */ if_printf(ifp, "%s: unable to start recv logic\n", __func__); - ath_start(ifp); /* restart xmit */ + /* + * We may be doing a reset in response to an ioctl + * that changes the channel so update any state that + * might change as a result. + */ + ath_chan_change(sc, c); if (ic->ic_state == IEEE80211_S_RUN) ath_beacon_config(sc); /* restart beacons */ + ath_hal_intrset(ah, sc->sc_imask); + + ath_start(ifp); /* restart xmit */ return 0; } @@ -785,7 +817,7 @@ /* * Encapsulate the packet in prep for transmission. */ - m = ieee80211_encap(ifp, m, &ni); + m = ieee80211_encap(ic, m, &ni); if (m == NULL) { DPRINTF(ATH_DEBUG_ANY, ("%s: encapsulation failure\n", @@ -849,7 +881,7 @@ if (error == ENETRESET) { if ((ifp->if_flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP)) - ath_init(ifp); /* XXX lose error */ + ath_init(ifp->if_softc); /* XXX lose error */ error = 0; } return error; @@ -888,7 +920,7 @@ else ieee80211_iterate_nodes(ic, ath_rate_ctl, sc); } - ieee80211_watchdog(ifp); + ieee80211_watchdog(ic); } static int @@ -897,6 +929,7 @@ #define UP_RUNNING(_ifp) \ (((_ifp)->if_flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING)) struct ath_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; struct ifreq *ifr = (struct ifreq *)data; int error = 0; @@ -921,7 +954,7 @@ * probably a better way to deal with this. */ if (!sc->sc_invalid) - ath_init(ifp); /* XXX lose error */ + ath_init(sc); /* XXX lose error */ } else { /* * Interface marked down; clear the hardware. @@ -959,7 +992,7 @@ break; } default: - error = ieee80211_ioctl(ifp, cmd, data); + error = ieee80211_ioctl(ic, cmd, data); if (error == ENETRESET) { if (UP_RUNNING(ifp)) ath_init(sc); @@ -1011,9 +1044,9 @@ static u_int32_t ath_calcrxfilter(struct ath_softc *sc) { + struct ifnet *ifp = &sc->sc_if; struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = &ic->ic_if; u_int32_t rfilt; rfilt = (ath_hal_getrxfilter(ah) & HAL_RX_FILTER_PHYERR) @@ -1033,9 +1066,8 @@ static void ath_mode_init(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = &ic->ic_if; + struct ifnet *ifp = &sc->sc_if; u_int32_t rfilt, mfilt[2], val; u_int8_t pos; struct ifmultiaddr *ifma; @@ -1162,14 +1194,13 @@ } static void -ath_beacon_proc(void *arg, int pending) +ath_beacon_proc(struct ath_softc *sc) { - struct ath_softc *sc = arg; struct ieee80211com *ic = &sc->sc_ic; struct ath_buf *bf = sc->sc_bcbuf; struct ath_hal *ah = sc->sc_ah; - DPRINTF(ATH_DEBUG_BEACON_PROC, ("%s: pending %u\n", __func__, pending)); + DPRINTF(ATH_DEBUG_BEACON_PROC, ("%s\n", __func__)); if (ic->ic_opmode == IEEE80211_M_STA || bf == NULL || bf->bf_m == NULL) { DPRINTF(ATH_DEBUG_ANY, ("%s: ic_flags=%x bf=%p bf_m=%p\n", @@ -1432,7 +1463,8 @@ struct ath_node *an = malloc(sizeof(struct ath_node), M_DEVBUF, M_NOWAIT | M_ZERO); if (an) { - struct ath_softc *sc = ic->ic_if.if_softc; + struct ifnet *ifp = ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; int i; for (i = 0; i < ATH_RHIST_SIZE; i++) @@ -1447,7 +1479,8 @@ static void ath_node_free(struct ieee80211com *ic, struct ieee80211_node *ni) { - struct ath_softc *sc = ic->ic_if.if_softc; + struct ifnet *ifp = ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; struct ath_buf *bf; TAILQ_FOREACH(bf, &sc->sc_txq, bf_list) { @@ -1578,9 +1611,9 @@ ((struct ath_desc *)((caddr_t)(_sc)->sc_desc + \ ((_pa) - (_sc)->sc_desc_paddr))) struct ath_softc *sc = arg; + struct ifnet *ifp = &sc->sc_if; + struct ieee80211com *ic = &sc->sc_ic; struct ath_buf *bf; - struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds; struct mbuf *m; @@ -1630,7 +1663,26 @@ if (status == HAL_EINPROGRESS) break; TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); - if (ds->ds_rxstat.rs_status != 0) { + + if (ds->ds_rxstat.rs_more) { + /* + * Frame spans multiple descriptors; this + * cannot happen yet as we don't support + * jumbograms. If not in monitor mode, + * discard the frame. + */ +#ifdef ERROR_FRAMES + /* + * Enable this if you want to see + * error frames in Monitor mode. + */ + if (ic->ic_opmode != IEEE80211_M_MONITOR) { + /* XXX statistic */ + goto rx_next; + } +#endif + /* fall thru for monitor mode handling... */ + } else if (ds->ds_rxstat.rs_status != 0) { if (ds->ds_rxstat.rs_status & HAL_RXERR_CRC) sc->sc_stats.ast_rx_crcerr++; if (ds->ds_rxstat.rs_status & HAL_RXERR_FIFO) @@ -1641,6 +1693,7 @@ sc->sc_stats.ast_rx_phyerr++; phyerr = ds->ds_rxstat.rs_phyerr & 0x1f; sc->sc_stats.ast_rx_phy[phyerr]++; + goto rx_next; } else { /* * NB: don't count PHY errors as input errors; @@ -1651,7 +1704,14 @@ */ ifp->if_ierrors++; } - goto rx_next; + /* + * Reject error frames, we normally don't want + * to see them in monitor mode (in monitor mode + * allow through packets that cannot be decrypted.) + */ + if ((ds->ds_rxstat.rs_status & ~HAL_RXERR_DECRYPT) || + sc->sc_ic.ic_opmode != IEEE80211_M_MONITOR) + goto rx_next; } len = ds->ds_rxstat.rs_datalen; @@ -1670,6 +1730,17 @@ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = len; + /* + * Strip the CRC before tapping the frame as some + * applications get confused otherwise. If there's + * a good reason to send the CRC to applications + * we'll need to define a radiotap flag for that. + */ + m_adj(m, -IEEE80211_CRC_LEN); + + /* + * Tap and/or dump the received frame. + */ if (sc->sc_drvbpf) { sc->sc_rx_th.wr_rate = sc->sc_hwmap[ds->ds_rxstat.rs_rate]; @@ -1680,8 +1751,13 @@ bpf_mtap2(sc->sc_drvbpf, &sc->sc_rx_th, sizeof(sc->sc_rx_th), m); } + if (IFF_DUMPPKTS(ifp, ATH_DEBUG_RECV)) { + ieee80211_dump_pkt(mtod(m, u_int8_t *), len, + sc->sc_hwmap[ds->ds_rxstat.rs_rate] & + IEEE80211_RATE_VAL, + ds->ds_rxstat.rs_rssi); + } - m_adj(m, -IEEE80211_CRC_LEN); wh = mtod(m, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_WEP) { /* @@ -1727,7 +1803,7 @@ /* * Send frame up for processing. */ - ieee80211_input(ifp, m, ni, + ieee80211_input(ic, m, ni, ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); /* @@ -1739,7 +1815,7 @@ ieee80211_unref_node(&ni); else ieee80211_free_node(ic, ni); - rx_next: +rx_next: TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); } while (ath_rxbuf_init(sc, bf) == 0); @@ -1758,8 +1834,8 @@ struct mbuf *m0) { struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = &sc->sc_if; struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = &sc->sc_ic.ic_if; int i, error, iswep, hdrlen, pktlen, try0; u_int8_t rix, cix, txrate, ctsrate; struct ath_desc *ds; @@ -1785,7 +1861,7 @@ m_adj(m0, hdrlen); M_PREPEND(m0, sizeof(hdrbuf), M_DONTWAIT); if (m0 == NULL) { - sc->sc_stats.ast_tx_nombuf++; + sc->sc_stats.ast_tx_nobuf++; return ENOMEM; } ivp = hdrbuf + hdrlen; @@ -1845,7 +1921,7 @@ sc->sc_stats.ast_tx_linear++; MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { - sc->sc_stats.ast_tx_nombuf++; + sc->sc_stats.ast_tx_nobuf++; m_freem(m0); return ENOMEM; } @@ -2038,6 +2114,11 @@ &sc->sc_tx_th, sizeof(sc->sc_tx_th), m0); } + if (IFF_DUMPPKTS(ifp, ATH_DEBUG_XMIT)) + ieee80211_dump_pkt(mtod(m0, u_int8_t *), pktlen, + ni->ni_rates.rs_rates[ni->ni_txrate] & IEEE80211_RATE_VAL, + -1); + /* * Formulate first tx descriptor with tx controls. */ @@ -2132,10 +2213,10 @@ ath_tx_proc(void *arg, int npending) { struct ath_softc *sc = arg; + struct ifnet *ifp = &sc->sc_if; struct ath_hal *ah = sc->sc_ah; struct ath_buf *bf; struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; struct ath_desc *ds; struct ieee80211_node *ni; struct ath_node *an; @@ -2225,9 +2306,9 @@ static void ath_draintxq(struct ath_softc *sc) { + struct ifnet *ifp = &sc->sc_if; struct ath_hal *ah = sc->sc_ah; struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; struct ieee80211_node *ni; struct ath_buf *bf; @@ -2339,6 +2420,32 @@ return 0; } +/* + * Update internal state after a channel change. + */ +static void +ath_chan_change(struct ath_softc *sc, struct ieee80211_channel *chan) +{ + struct ieee80211com *ic = &sc->sc_ic; + enum ieee80211_phymode mode; + + /* + * Change channels and update the h/w rate map + * if we're switching; e.g. 11a to 11b/g. + */ + mode = ieee80211_chan2mode(ic, chan); + if (mode != sc->sc_curmode) + ath_setcurmode(sc, mode); + + /* + * Update BPF state. + */ + sc->sc_tx_th.wt_chan_freq = sc->sc_rx_th.wr_chan_freq = + htole16(chan->ic_freq); + sc->sc_tx_th.wt_chan_flags = sc->sc_rx_th.wr_chan_flags = + htole16(chan->ic_flags); +} + /* * Set/change channels. If the channel is really being changed, * it's done by resetting the chip. To accomplish this we must @@ -2358,7 +2465,6 @@ if (chan != ic->ic_ibss_chan) { HAL_STATUS status; HAL_CHANNEL hchan; - enum ieee80211_phymode mode; /* * To switch channels clear any pending DMA operations; @@ -2377,7 +2483,7 @@ hchan.channel = chan->ic_freq; hchan.channelFlags = ath_chan2flags(ic, chan); if (!ath_hal_reset(ah, ic->ic_opmode, &hchan, AH_TRUE, &status)) { - if_printf(&ic->ic_if, "ath_chan_set: unable to reset " + if_printf(&sc->sc_if, "ath_chan_set: unable to reset " "channel %u (%u Mhz)\n", ieee80211_chan2ieee(ic, chan), chan->ic_freq); return EIO; @@ -2386,27 +2492,17 @@ * Re-enable rx framework. */ if (ath_startrecv(sc) != 0) { - if_printf(&ic->ic_if, + if_printf(&sc->sc_if, "ath_chan_set: unable to restart recv logic\n"); return EIO; } /* - * Update BPF state. - */ - sc->sc_tx_th.wt_chan_freq = sc->sc_rx_th.wr_chan_freq = - htole16(chan->ic_freq); - sc->sc_tx_th.wt_chan_flags = sc->sc_rx_th.wr_chan_flags = - htole16(chan->ic_flags); - - /* * Change channels and update the h/w rate map * if we're switching; e.g. 11a to 11b/g. */ ic->ic_ibss_chan = chan; - mode = ieee80211_chan2mode(ic, chan); - if (mode != sc->sc_curmode) - ath_setcurmode(sc, mode); + ath_chan_change(sc, chan); /* * Re-enable interrupts. @@ -2421,10 +2517,9 @@ { struct ath_softc *sc = arg; struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; if (ic->ic_state == IEEE80211_S_SCAN) - ieee80211_next_scan(ifp); + ieee80211_next_scan(ic); } /* @@ -2473,7 +2568,7 @@ static int ath_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) { - struct ifnet *ifp = &ic->ic_if; + struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; struct ieee80211_node *ni; @@ -2592,8 +2687,8 @@ ath_getchannels(struct ath_softc *sc, u_int cc, HAL_BOOL outdoor, HAL_BOOL xchanmode) { + struct ifnet *ifp = &sc->sc_if; struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; struct ath_hal *ah = sc->sc_ah; HAL_CHANNEL *chans; int i, ix, nchan; @@ -2787,25 +2882,45 @@ { #define RATE(_ix) (ni->ni_rates.rs_rates[(_ix)] & IEEE80211_RATE_VAL) struct ieee80211com *ic = &sc->sc_ic; + int srate; + KASSERT(ni->ni_rates.rs_nrates > 0, ("no rates")); if (ic->ic_fixed_rate == -1) { - KASSERT(ni->ni_rates.rs_nrates > 0, ("no rates")); - /* start with highest negotiated rate */ - int srate = ni->ni_rates.rs_nrates - 1; + /* + * No fixed rate is requested. For 11b start with + * the highest negotiated rate; otherwise, for 11g + * and 11a, we start "in the middle" at 24Mb or 36Mb. + */ + srate = ni->ni_rates.rs_nrates - 1; if (sc->sc_curmode != IEEE80211_MODE_11B) { /* - * 11a and 11g work better if you start at 24Mb - * or 36Mb and raise the rate. Scan the negotiated - * rate set to find the closest rate. + * Scan the negotiated rate set to find the + * closest rate. */ - /* NB: rate set assumed sorted */ + /* NB: the rate set is assumed sorted */ for (; srate >= 0 && RATE(srate) > 72; srate--) ; KASSERT(srate >= 0, ("bogus rate set")); } - ath_rate_update(sc, ni, srate); - } else - ath_rate_update(sc, ni, ic->ic_fixed_rate); + } else { + /* + * A fixed rate is to be used; ic_fixed_rate is an + * index into the supported rate set. Convert this + * to the index into the negotiated rate set for + * the node. We know the rate is there because the + * rate set is checked when the station associates. + */ + const struct ieee80211_rateset *rs = + &ic->ic_sup_rates[ic->ic_curmode]; + int r = rs->rs_rates[ic->ic_fixed_rate] & IEEE80211_RATE_VAL; + /* NB: the rate set is assumed sorted */ + srate = ni->ni_rates.rs_nrates - 1; + for (; srate >= 0 && RATE(srate) != r; srate--) + ; + KASSERT(srate >= 0, + ("fixed rate %d not in rate set", ic->ic_fixed_rate)); + } + ath_rate_update(sc, ni, srate); #undef RATE } @@ -2849,7 +2964,7 @@ ath_rate_ctl(void *arg, struct ieee80211_node *ni) { struct ath_softc *sc = arg; - struct ath_node *an = (struct ath_node *) ni; + struct ath_node *an = ATH_NODE(ni); struct ieee80211_rateset *rs = &ni->ni_rates; int mod = 0, nrate, enough; ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath_pci.c#3 (text+ko) ==== @@ -67,10 +67,6 @@ #include #include -#include -#include -#include -#include #include #ifdef INET ==== //depot/projects/netperf+sockets/sys/dev/ath/if_athioctl.h#6 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,7 +55,7 @@ u_int32_t ast_tx_qstop; /* output stopped 'cuz no buffer */ u_int32_t ast_tx_encap; /* tx encapsulation failed */ u_int32_t ast_tx_nonode; /* tx failed 'cuz no node */ - u_int32_t ast_tx_nombuf; /* tx failed 'cuz no mbuf */ + u_int32_t ast_tx_nobuf; /* tx failed 'cuz no buf */ u_int32_t ast_tx_nomcl; /* tx failed 'cuz no cluster */ u_int32_t ast_tx_linear; /* tx linearized to cluster */ u_int32_t ast_tx_nodata; /* tx discarded empty frame */ @@ -77,10 +77,10 @@ u_int32_t ast_rx_crcerr; /* rx failed 'cuz of bad CRC */ u_int32_t ast_rx_fifoerr; /* rx failed 'cuz of FIFO overrun */ u_int32_t ast_rx_badcrypt;/* rx failed 'cuz decryption */ - u_int32_t ast_rx_phyerr; /* rx failed 'cuz of PHY err */ + u_int32_t ast_rx_phyerr; /* rx PHY error summary count */ u_int32_t ast_rx_phy[32]; /* rx PHY error per-code counts */ u_int32_t ast_rx_tooshort;/* rx discarded 'cuz frame too short */ - u_int32_t ast_rx_ctl; /* rx discarded 'cuz ctl frame */ + u_int8_t ast_rx_ctl; /* control frames received */ u_int32_t ast_be_nombuf; /* beacon setup failed 'cuz no mbuf */ u_int32_t ast_per_cal; /* periodic calibration calls */ u_int32_t ast_per_calfail;/* periodic calibration failed */ ==== //depot/projects/netperf+sockets/sys/dev/ath/if_athvar.h#5 (text+ko) ==== @@ -103,6 +103,7 @@ }; struct ath_softc { + struct arpcom sc_ac; struct ieee80211com sc_ic; /* IEEE 802.11 common */ int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int); @@ -157,13 +158,13 @@ u_int sc_bhalq; /* HAL q for outgoing beacons */ struct ath_buf *sc_bcbuf; /* beacon buffer */ struct ath_buf *sc_bufptr; /* allocated buffer ptr */ - struct task sc_swbatask; /* swba int processing */ struct task sc_bmisstask; /* bmiss int processing */ struct callout sc_cal_ch; /* callout handle for cals */ struct callout sc_scan_ch; /* callout handle for scan */ struct ath_stats sc_stats; /* interface statistics */ }; +#define sc_if sc_ac.ac_if #define sc_tx_th u_tx_rt.th #define sc_rx_th u_rx_rt.th @@ -211,6 +212,8 @@ #define ath_hal_getcountrycode(_ah) (_ah)->ah_countryCode #define ath_hal_getmac(_ah, _mac) \ ((*(_ah)->ah_getMacAddress)((_ah), (_mac))) +#define ath_hal_setmac(_ah, _mac) \ + ((*(_ah)->ah_setMacAddress)((_ah), (_mac))) #define ath_hal_detach(_ah) \ ((*(_ah)->ah_detach)((_ah))) #define ath_hal_intrset(_ah, _mask) \ ==== //depot/projects/netperf+sockets/sys/dev/awi/awi.c#6 (text+ko) ==== @@ -257,7 +257,7 @@ awi_attach(struct awi_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; + struct ifnet *ifp = &sc->sc_if; int s, i, error, nrate; int mword; enum ieee80211_phymode mode; @@ -324,7 +324,9 @@ #ifdef __NetBSD__ if_attach(ifp); #endif - ieee80211_ifattach(ifp); + ic->ic_ifp = ifp; + + ieee80211_ifattach(ic); sc->sc_newstate = ic->ic_newstate; ic->ic_newstate = awi_newstate; @@ -335,7 +337,7 @@ sc->sc_send_mgmt = ic->ic_send_mgmt; ic->ic_send_mgmt = awi_send_mgmt; - ieee80211_media_init(ifp, awi_media_change, awi_media_status); + ieee80211_media_init(ic, awi_media_change, awi_media_status); /* Melco compatibility mode. */ #define ADD(s, o) ifmedia_add(&ic->ic_media, \ @@ -371,7 +373,8 @@ int awi_detach(struct awi_softc *sc) { - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; + struct ieee80211com *ic = &sc->sc_ic; int s; if (!sc->sc_attached) @@ -386,7 +389,7 @@ (void)tsleep(sc, PWAIT, "awidet", 1); } sc->sc_attached = 0; - ieee80211_ifdetach(ifp); + ieee80211_ifdetach(ic); #ifdef __NetBSD__ if_detach(ifp); shutdownhook_disestablish(sc->sc_sdhook); @@ -401,7 +404,7 @@ awi_activate(struct device *self, enum devact act) { struct awi_softc *sc = (struct awi_softc *)self; - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; int s, error = 0; s = splnet(); @@ -422,7 +425,7 @@ awi_power(int why, void *arg) { struct awi_softc *sc = arg; - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; int s; int ocansleep; @@ -455,7 +458,7 @@ awi_shutdown(void *arg) { struct awi_softc *sc = arg; - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ifnet *ifp = &sc->sc_if; if (sc->sc_attached) awi_stop(ifp, 1); @@ -526,7 +529,7 @@ if (status & AWI_INT_SCAN_CMPLT) { if (sc->sc_ic.ic_state == IEEE80211_S_SCAN && sc->sc_substate == AWI_ST_NONE) - ieee80211_next_scan(&sc->sc_ic.ic_if); + ieee80211_next_scan(&sc->sc_ic); } } sc->sc_cansleep = ocansleep; @@ -541,7 +544,7 @@ { struct awi_softc *sc = arg; - (void)awi_init(&sc->sc_ic.ic_if); + (void)awi_init(&sc->sc_if); } #endif @@ -801,7 +804,7 @@ if ((ifp->if_flags & IFF_LINK0) || sc->sc_adhoc_ap) m0 = awi_ether_encap(sc, m0); else - m0 = ieee80211_encap(ifp, m0, &ni); + m0 = ieee80211_encap(ic, m0, &ni); if (m0 == NULL) { ifp->if_oerrors++; continue; @@ -826,7 +829,7 @@ bpf_mtap(ic->ic_rawbpf, m0); #endif if (wh->i_fc[1] & IEEE80211_FC1_WEP) { - if ((m0 = ieee80211_wep_crypt(ifp, m0, 1)) == NULL) { + if ((m0 = ieee80211_wep_crypt(ic, m0, 1)) == NULL) { ifp->if_oerrors++; continue; } @@ -834,7 +837,7 @@ #ifdef DIAGNOSTIC if (m0->m_pkthdr.len != len) { printf("%s: length %d should be %d\n", - ic->ic_if.if_xname, m0->m_pkthdr.len, len); + sc->sc_if.if_xname, m0->m_pkthdr.len, len); m_freem(m0); ifp->if_oerrors++; continue; @@ -874,6 +877,7 @@ awi_watchdog(struct ifnet *ifp) { struct awi_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; u_int32_t prevdone; int ocansleep; @@ -899,15 +903,14 @@ if (sc->sc_rx_timer) { if (--sc->sc_rx_timer == 0) { if (sc->sc_ic.ic_state == IEEE80211_S_RUN) { - ieee80211_new_state(&sc->sc_ic, - IEEE80211_S_SCAN, -1); + ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); goto out; } >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Jan 27 14:02:35 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7467316A4D0; Tue, 27 Jan 2004 14:02:35 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48D6016A4CE for ; Tue, 27 Jan 2004 14:02:35 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 109A043D53 for ; Tue, 27 Jan 2004 14:02:15 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0RM2E0B023132 for ; Tue, 27 Jan 2004 14:02:14 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0RM2EV1023126 for perforce@freebsd.org; Tue, 27 Jan 2004 14:02:14 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Tue, 27 Jan 2004 14:02:14 -0800 (PST) Message-Id: <200401272202.i0RM2EV1023126@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46017 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 22:02:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=46017 Change 46017 by jhb@jhb_slimer on 2004/01/27 14:01:38 Destroy the test mutex on unload as we can panic on unload otherwise. Oops. Affected files ... .. //depot/projects/smpng/sys/modules/crash/crash.c#9 edit Differences ... ==== //depot/projects/smpng/sys/modules/crash/crash.c#9 (text+ko) ==== @@ -254,6 +254,8 @@ TRYLOCK_TEST(&test2_mtx, "recursive locked test2"); mtx_unlock(&test2_mtx); #undef TRYLOCK_TEST + mtx_destroy(&test1_mtx); + mtx_destroy(&test2_mtx); break; default: panic("event %d is bogus\n", event); @@ -299,6 +301,7 @@ mtx_unlock(&event_mtx); mtx_destroy(&event_mtx); cv_destroy(&event_cv); + mtx_destroy(&test_mtx); sx_destroy(&foo); sx_destroy(&bar); sx_destroy(&bar2); From owner-p4-projects@FreeBSD.ORG Tue Jan 27 14:38:37 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1987C16A4D0; Tue, 27 Jan 2004 14:38:37 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E86F616A4CE for ; Tue, 27 Jan 2004 14:38:36 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 986B943D39 for ; Tue, 27 Jan 2004 14:38:10 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0RMax0B030706 for ; Tue, 27 Jan 2004 14:36:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0RMax4g030703 for perforce@freebsd.org; Tue, 27 Jan 2004 14:36:59 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 27 Jan 2004 14:36:59 -0800 (PST) Message-Id: <200401272236.i0RMax4g030703@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46022 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2004 22:38:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=46022 Change 46022 by sam@sam_ebb on 2004/01/27 14:36:01 fix shared key client authentication (again) Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#7 (text+ko) ==== @@ -913,6 +913,8 @@ return; } memcpy(ni->ni_challenge, &challenge[2], challenge[1]); + IEEE80211_SEND_MGMT(ic, ni, + IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); break; default: IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, @@ -1273,7 +1275,7 @@ status); else { IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, - ("%s: unsupported auth %d from %s\n", + ("%s: unsupported auth algorithm %d from %s\n", __func__, algo, ether_sprintf(wh->i_addr2))); ic->ic_stats.is_rx_auth_unsupported++; return; From owner-p4-projects@FreeBSD.ORG Tue Jan 27 16:15:02 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3315916A4D0; Tue, 27 Jan 2004 16:15:02 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07B2816A4CE for ; Tue, 27 Jan 2004 16:15:02 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24AC143D48 for ; Tue, 27 Jan 2004 16:15:00 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0S0Ex0B054112 for ; Tue, 27 Jan 2004 16:14:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0S0ExII054109 for perforce@freebsd.org; Tue, 27 Jan 2004 16:14:59 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 27 Jan 2004 16:14:59 -0800 (PST) Message-Id: <200401280014.i0S0ExII054109@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46026 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 00:15:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=46026 Change 46026 by sam@sam_ebb on 2004/01/27 16:14:46 cleanup shared key authentication debug msgs (again) Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#8 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#8 (text+ko) ==== @@ -722,7 +722,7 @@ IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, - ("station %s %s authenticated\n", + ("station %s %s authenticated (open)\n", ether_sprintf(ni->ni_macaddr), (allocbs ? "newly" : "already"))); break; @@ -736,7 +736,7 @@ if (status != 0) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, - ("authentication failed (reason %d) for %s\n", + ("open authentication failed (reason %d) for %s\n", status, ether_sprintf(wh->i_addr3))); if (ni != ic->ic_bss) @@ -770,7 +770,7 @@ if (frm + 1 < efrm) { if ((frm[1] + 2) > (efrm - frm)) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, - ("elt %d %d bytes too long\n", + ("%s: elt %d %d bytes too long\n", __func__, frm[0], (frm[1] + 2) - (efrm - frm))); ic->ic_stats.is_rx_bad_auth++; return; @@ -841,6 +841,11 @@ for (i = IEEE80211_CHALLENGE_LEN / sizeof(u_int32_t); --i >= 0; ) ni->ni_challenge[i] = arc4random(); + IEEE80211_DPRINTF(ic, + IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, + ("shared key %sauth request from station %s\n", + ether_sprintf(ni->ni_macaddr), + allocbs ? "" : "re")); break; case IEEE80211_AUTH_SHARED_RESPONSE: if (ni == ic->ic_bss) { @@ -862,20 +867,20 @@ ic->ic_stats.is_rx_auth_fail++; return; } + IEEE80211_DPRINTF(ic, + IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, + ("station %s authenticated (shared key)\n", + ether_sprintf(ni->ni_macaddr))); break; default: IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, - ("%s: bad seq %d from %s\n", __func__, - seq, ether_sprintf(wh->i_addr2))); + ("%s: bad shared key auth seq %d from %s\n", + __func__, seq, ether_sprintf(wh->i_addr2))); ic->ic_stats.is_rx_bad_auth++; return; } IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); - IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, - ("station %s %s authenticated\n", - ether_sprintf(ni->ni_macaddr), - (allocbs ? "newly" : "already"))); break; case IEEE80211_M_STA: From owner-p4-projects@FreeBSD.ORG Tue Jan 27 16:15:18 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BAA4316A4D7; Tue, 27 Jan 2004 16:15:17 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D95316A4D0 for ; Tue, 27 Jan 2004 16:15:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF6F643D39 for ; Tue, 27 Jan 2004 16:14:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0S0Ex0B054106 for ; Tue, 27 Jan 2004 16:14:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0S0ExMJ054102 for perforce@freebsd.org; Tue, 27 Jan 2004 16:14:59 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 27 Jan 2004 16:14:59 -0800 (PST) Message-Id: <200401280014.i0S0ExMJ054102@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46025 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 00:15:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=46025 Change 46025 by sam@sam_ebb on 2004/01/27 16:14:29 correct assertion on beacon frame length: ieee80211_getmgtframe allocates space for the 802.11 header so it must be included in the calculations Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#8 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#8 (text+ko) ==== @@ -705,9 +705,9 @@ } frm = ieee80211_add_xrates(frm, rs); m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *); - KASSERT(m->m_pkthdr.len <= pktlen, + KASSERT(m->m_pkthdr.len <= pktlen + sizeof(struct ieee80211_frame), ("beacon bigger than expected, len %u calculated %u", - m->m_pkthdr.len, pktlen)); + m->m_pkthdr.len, pktlen + sizeof(struct ieee80211_frame))); return m; } From owner-p4-projects@FreeBSD.ORG Tue Jan 27 17:12:26 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3E5CA16A4D0; Tue, 27 Jan 2004 17:12:26 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 126B316A4CE for ; Tue, 27 Jan 2004 17:12:26 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3330243D54 for ; Tue, 27 Jan 2004 17:12:11 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0S1CB0B072846 for ; Tue, 27 Jan 2004 17:12:11 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0S1CAjb072837 for perforce@freebsd.org; Tue, 27 Jan 2004 17:12:10 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 27 Jan 2004 17:12:10 -0800 (PST) Message-Id: <200401280112.i0S1CAjb072837@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46029 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 01:12:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=46029 Change 46029 by sam@sam_ebb on 2004/01/27 17:11:35 o correct ieee80211_node_dectestref o add comments describing reference counting macros Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.h#2 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_netbsd.h#2 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.h#2 (text+ko) ==== @@ -76,12 +76,19 @@ #define ALTQ_DECL(_x) /* - * Node reference counting definitions. + * Node reference counting definitions: + * + * ieee80211_node_initref initialize the reference count to 1 + * ieee80211_node_incref add a reference + * ieee80211_node_decref remove a reference + * ieee80211_node_dectestref remove a reference and return 1 if this + * is the last reference, otherwise 0 */ #define ieee80211_node_initref(_ni) ((_ni)->ni_refcnt = 1) #define ieee80211_node_incref(_ni) atomic_add_int(&(_ni)->ni_refcnt,1) #define ieee80211_node_decref(_ni) atomic_subtract_int(&(_ni)->ni_refcnt,1) +/* XXX handle circularity required by inline function */ #include #include @@ -92,7 +99,7 @@ do { orefcnt = ni->ni_refcnt; } while (atomic_cmpset_int(&ni->ni_refcnt, orefcnt, orefcnt - 1) == 0); - return orefcnt - 1; + return (orefcnt == 1); } extern struct mbuf *ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen); ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_netbsd.h#2 (text+ko) ==== @@ -74,6 +74,15 @@ void if_printf(struct ifnet *, const char *, ...) __attribute__((__format__(__printf__,2,3))); +/* + * Node reference counting definitions: + * + * ieee80211_node_initref initialize the reference count to 1 + * ieee80211_node_incref add a reference + * ieee80211_node_decref remove a reference + * ieee80211_node_dectestref remove a reference and return 1 if this + * is the last reference, otherwise 0 + */ #define ieee80211_node_incref(ni) \ do { \ int _s = splnet(); \ @@ -94,10 +103,12 @@ s = splnet(); refcnt = --ni->ni_refcnt; splx(s); - return refcnt; + return (refcnt == 0); } #define ifmedia_removeall(_media) \ ifmedia_delete_instance((_media), IFM_INST_ANY) +extern struct mbuf *ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen); + #endif /* _NET80211_IEEE80211_NETBSD_H_ */ From owner-p4-projects@FreeBSD.ORG Wed Jan 28 13:26:31 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 169D116A4D0; Wed, 28 Jan 2004 13:26:31 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E31F116A4CE for ; Wed, 28 Jan 2004 13:26:30 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A529443D1D for ; Wed, 28 Jan 2004 13:26:26 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0SLQQ0B079666 for ; Wed, 28 Jan 2004 13:26:26 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0SLQH6x079663 for perforce@freebsd.org; Wed, 28 Jan 2004 13:26:17 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Wed, 28 Jan 2004 13:26:17 -0800 (PST) Message-Id: <200401282126.i0SLQH6x079663@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46080 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 21:26:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=46080 Change 46080 by jhb@jhb_slimer on 2004/01/28 13:25:50 IFC @46073. Affected files ... .. //depot/projects/smpng/sys/Makefile#5 integrate .. //depot/projects/smpng/sys/alpha/alpha/support.s#9 integrate .. //depot/projects/smpng/sys/alpha/conf/GENERIC#35 integrate .. //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#7 integrate .. //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#5 integrate .. //depot/projects/smpng/sys/amd64/conf/GENERIC#12 integrate .. //depot/projects/smpng/sys/amd64/include/md_var.h#7 integrate .. //depot/projects/smpng/sys/amd64/pci/pci_cfgreg.c#4 integrate .. //depot/projects/smpng/sys/boot/Makefile#12 integrate .. //depot/projects/smpng/sys/boot/common/help.common#11 integrate .. //depot/projects/smpng/sys/boot/common/loader.8#25 integrate .. //depot/projects/smpng/sys/boot/forth/frames.4th#2 integrate .. //depot/projects/smpng/sys/boot/forth/loader.conf#20 integrate .. //depot/projects/smpng/sys/boot/i386/libi386/biosdisk.c#9 integrate .. //depot/projects/smpng/sys/boot/pc98/btx/btx/btx.s#3 integrate .. //depot/projects/smpng/sys/boot/pc98/libpc98/vidconsole.c#5 integrate .. //depot/projects/smpng/sys/cam/scsi/scsi_sa.c#18 integrate .. //depot/projects/smpng/sys/compat/linux/linux_util.c#10 integrate .. //depot/projects/smpng/sys/compat/ndis/hal_var.h#2 integrate .. //depot/projects/smpng/sys/compat/ndis/kern_ndis.c#6 integrate .. //depot/projects/smpng/sys/compat/ndis/ndis_var.h#6 integrate .. //depot/projects/smpng/sys/compat/ndis/ntoskrnl_var.h#3 integrate .. //depot/projects/smpng/sys/compat/ndis/pe_var.h#3 integrate .. //depot/projects/smpng/sys/compat/ndis/subr_hal.c#4 integrate .. //depot/projects/smpng/sys/compat/ndis/subr_ndis.c#6 integrate .. //depot/projects/smpng/sys/compat/ndis/subr_ntoskrnl.c#6 integrate .. //depot/projects/smpng/sys/compat/ndis/subr_pe.c#4 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#29 integrate .. //depot/projects/smpng/sys/conf/NOTES#61 integrate .. //depot/projects/smpng/sys/conf/files#100 integrate .. //depot/projects/smpng/sys/conf/files.i386#52 integrate .. //depot/projects/smpng/sys/conf/files.pc98#51 integrate .. //depot/projects/smpng/sys/conf/files.powerpc#16 integrate .. //depot/projects/smpng/sys/conf/files.sparc64#35 integrate .. //depot/projects/smpng/sys/conf/kern.post.mk#32 integrate .. //depot/projects/smpng/sys/conf/kern.pre.mk#28 integrate .. //depot/projects/smpng/sys/conf/options.i386#40 integrate .. //depot/projects/smpng/sys/conf/options.pc98#37 integrate .. //depot/projects/smpng/sys/conf/options.powerpc#8 integrate .. //depot/projects/smpng/sys/contrib/dev/acpica/exstore.c#18 integrate .. //depot/projects/smpng/sys/crypto/md5.c#5 integrate .. //depot/projects/smpng/sys/ddb/db_output.c#9 integrate .. //depot/projects/smpng/sys/dev/acpica/Osd/OsdTable.c#5 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi.c#57 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_pci_link.c#13 integrate .. //depot/projects/smpng/sys/dev/acpica/acpivar.h#35 integrate .. //depot/projects/smpng/sys/dev/amd/amd.c#10 integrate .. //depot/projects/smpng/sys/dev/ar/if_ar.c#11 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.c#45 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.h#22 integrate .. //depot/projects/smpng/sys/dev/ata/ata-card.c#17 integrate .. //depot/projects/smpng/sys/dev/ata/ata-cbus.c#8 integrate .. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#28 integrate .. //depot/projects/smpng/sys/dev/ata/ata-disk.c#36 integrate .. //depot/projects/smpng/sys/dev/ata/ata-dma.c#35 integrate .. //depot/projects/smpng/sys/dev/ata/ata-isa.c#15 integrate .. //depot/projects/smpng/sys/dev/ata/ata-lowlevel.c#8 integrate .. //depot/projects/smpng/sys/dev/ata/ata-pci.c#39 integrate .. //depot/projects/smpng/sys/dev/ata/ata-pci.h#17 integrate .. //depot/projects/smpng/sys/dev/ata/ata-queue.c#6 integrate .. //depot/projects/smpng/sys/dev/ata/ata-raid.c#27 integrate .. //depot/projects/smpng/sys/dev/ata/atapi-cam.c#18 integrate .. //depot/projects/smpng/sys/dev/ata/atapi-cd.c#46 integrate .. //depot/projects/smpng/sys/dev/ata/atapi-fd.c#21 integrate .. //depot/projects/smpng/sys/dev/ata/atapi-tape.c#24 integrate .. //depot/projects/smpng/sys/dev/awi/am79c930.c#5 integrate .. //depot/projects/smpng/sys/dev/awi/am79c930reg.h#2 integrate .. //depot/projects/smpng/sys/dev/awi/am79c930var.h#3 integrate .. //depot/projects/smpng/sys/dev/awi/awi.c#16 integrate .. //depot/projects/smpng/sys/dev/awi/awi_wep.c#14 delete .. //depot/projects/smpng/sys/dev/awi/awi_wicfg.c#10 delete .. //depot/projects/smpng/sys/dev/awi/awireg.h#2 integrate .. //depot/projects/smpng/sys/dev/awi/awivar.h#5 integrate .. //depot/projects/smpng/sys/dev/awi/if_awi_pccard.c#10 integrate .. //depot/projects/smpng/sys/dev/bktr/bktr_os.c#19 integrate .. //depot/projects/smpng/sys/dev/ciss/ciss.c#26 integrate .. //depot/projects/smpng/sys/dev/dpt/dpt_scsi.c#10 integrate .. //depot/projects/smpng/sys/dev/fb/fbreg.h#12 integrate .. //depot/projects/smpng/sys/dev/firewire/fwdev.c#14 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci.c#29 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci_pci.c#23 integrate .. //depot/projects/smpng/sys/dev/firewire/sbp_targ.c#4 integrate .. //depot/projects/smpng/sys/dev/gx/if_gx.c#13 integrate .. //depot/projects/smpng/sys/dev/ida/ida.c#14 integrate .. //depot/projects/smpng/sys/dev/ida/ida_disk.c#12 integrate .. //depot/projects/smpng/sys/dev/ida/idaio.h#1 branch .. //depot/projects/smpng/sys/dev/ida/idareg.h#4 integrate .. //depot/projects/smpng/sys/dev/ida/idavar.h#4 integrate .. //depot/projects/smpng/sys/dev/idt/idt.c#7 integrate .. //depot/projects/smpng/sys/dev/if_ndis/if_ndis.c#6 integrate .. //depot/projects/smpng/sys/dev/if_ndis/if_ndisvar.h#4 integrate .. //depot/projects/smpng/sys/dev/ips/ips.c#6 integrate .. //depot/projects/smpng/sys/dev/isp/isp.c#31 integrate .. //depot/projects/smpng/sys/dev/isp/isp_freebsd.c#26 integrate .. //depot/projects/smpng/sys/dev/isp/isp_ioctl.h#9 integrate .. //depot/projects/smpng/sys/dev/isp/ispmbox.h#15 integrate .. //depot/projects/smpng/sys/dev/ispfw/asm_12160.h#3 integrate .. //depot/projects/smpng/sys/dev/ispfw/asm_2200.h#4 integrate .. //depot/projects/smpng/sys/dev/ispfw/asm_2300.h#6 integrate .. //depot/projects/smpng/sys/dev/kbd/kbd.c#11 integrate .. //depot/projects/smpng/sys/dev/lnc/if_lnc_pci.c#7 integrate .. //depot/projects/smpng/sys/dev/mii/ukphy.c#8 integrate .. //depot/projects/smpng/sys/dev/mly/mly.c#20 integrate .. //depot/projects/smpng/sys/dev/pccard/pccarddevs#35 integrate .. //depot/projects/smpng/sys/dev/pccard/pccarddevs.h#35 integrate .. //depot/projects/smpng/sys/dev/pci/pci_pci.c#19 integrate .. //depot/projects/smpng/sys/dev/ppbus/vpo.c#7 integrate .. //depot/projects/smpng/sys/dev/sio/sio.c#38 integrate .. //depot/projects/smpng/sys/dev/sound/pci/neomagic-coeff.h#3 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/ac97.c#22 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/buffer.c#10 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/buffer.h#6 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/channel.c#25 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/channel.h#9 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/dsp.c#18 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/dsp.h#4 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/mixer.c#13 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/sound.c#21 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/sound.h#14 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/vchan.c#8 integrate .. //depot/projects/smpng/sys/dev/sr/if_sr.c#12 integrate .. //depot/projects/smpng/sys/dev/syscons/scgfbrndr.c#5 integrate .. //depot/projects/smpng/sys/dev/syscons/schistory.c#6 integrate .. //depot/projects/smpng/sys/dev/syscons/scterm-dumb.c#3 integrate .. //depot/projects/smpng/sys/dev/syscons/scterm-sc.c#5 integrate .. //depot/projects/smpng/sys/dev/syscons/syscons.c#33 integrate .. //depot/projects/smpng/sys/dev/usb/uftdi.c#9 integrate .. //depot/projects/smpng/sys/dev/usb/umass.c#33 integrate .. //depot/projects/smpng/sys/dev/usb/usb_quirks.c#8 integrate .. //depot/projects/smpng/sys/dev/usb/usb_subr.c#18 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs#45 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs.h#45 integrate .. //depot/projects/smpng/sys/dev/usb/usbdevs_data.h#45 integrate .. //depot/projects/smpng/sys/fs/devfs/devfs_rule.c#6 integrate .. //depot/projects/smpng/sys/fs/unionfs/union_subr.c#16 integrate .. //depot/projects/smpng/sys/fs/unionfs/union_vnops.c#14 integrate .. //depot/projects/smpng/sys/geom/bde/g_bde_crypt.c#14 integrate .. //depot/projects/smpng/sys/geom/geom_dev.c#32 integrate .. //depot/projects/smpng/sys/geom/geom_disk.c#32 integrate .. //depot/projects/smpng/sys/geom/geom_event.c#24 integrate .. //depot/projects/smpng/sys/geom/geom_io.c#26 integrate .. //depot/projects/smpng/sys/geom/geom_subr.c#35 integrate .. //depot/projects/smpng/sys/gnu/ext2fs/ext2_readwrite.c#4 integrate .. //depot/projects/smpng/sys/gnu/ext2fs/ext2_vfsops.c#28 integrate .. //depot/projects/smpng/sys/i386/acpica/madt.c#6 integrate .. //depot/projects/smpng/sys/i386/conf/GENERIC#45 integrate .. //depot/projects/smpng/sys/i386/conf/NOTES#74 integrate .. //depot/projects/smpng/sys/i386/i386/apic_vector.s#5 integrate .. //depot/projects/smpng/sys/i386/i386/identcpu.c#27 integrate .. //depot/projects/smpng/sys/i386/i386/local_apic.c#6 integrate .. //depot/projects/smpng/sys/i386/i386/longrun.c#1 branch .. //depot/projects/smpng/sys/i386/i386/mp_machdep.c#63 integrate .. //depot/projects/smpng/sys/i386/i386/p4tcc.c#1 branch .. //depot/projects/smpng/sys/i386/i386/pmap.c#56 integrate .. //depot/projects/smpng/sys/i386/i386/swtch.s#21 integrate .. //depot/projects/smpng/sys/i386/i386/trap.c#66 integrate .. //depot/projects/smpng/sys/i386/include/specialreg.h#7 integrate .. //depot/projects/smpng/sys/i386/isa/atpic_vector.s#4 integrate .. //depot/projects/smpng/sys/ia64/conf/GENERIC#36 integrate .. //depot/projects/smpng/sys/ia64/ia64/interrupt.c#24 integrate .. //depot/projects/smpng/sys/ia64/ia64/trap.c#62 integrate .. //depot/projects/smpng/sys/isofs/cd9660/cd9660_vnops.c#13 integrate .. //depot/projects/smpng/sys/kern/init_main.c#40 integrate .. //depot/projects/smpng/sys/kern/kern_condvar.c#32 integrate .. //depot/projects/smpng/sys/kern/kern_descrip.c#55 integrate .. //depot/projects/smpng/sys/kern/kern_exit.c#69 integrate .. //depot/projects/smpng/sys/kern/kern_fork.c#70 integrate .. //depot/projects/smpng/sys/kern/kern_idle.c#17 integrate .. //depot/projects/smpng/sys/kern/kern_intr.c#38 integrate .. //depot/projects/smpng/sys/kern/kern_jail.c#29 integrate .. //depot/projects/smpng/sys/kern/kern_ktrace.c#37 integrate .. //depot/projects/smpng/sys/kern/kern_malloc.c#26 integrate .. //depot/projects/smpng/sys/kern/kern_mutex.c#75 integrate .. //depot/projects/smpng/sys/kern/kern_ntptime.c#13 integrate .. //depot/projects/smpng/sys/kern/kern_poll.c#12 integrate .. //depot/projects/smpng/sys/kern/kern_prot.c#79 integrate .. //depot/projects/smpng/sys/kern/kern_shutdown.c#38 integrate .. //depot/projects/smpng/sys/kern/kern_sig.c#84 integrate .. //depot/projects/smpng/sys/kern/kern_subr.c#28 integrate .. //depot/projects/smpng/sys/kern/kern_sx.c#20 integrate .. //depot/projects/smpng/sys/kern/kern_synch.c#62 integrate .. //depot/projects/smpng/sys/kern/kern_tc.c#27 integrate .. //depot/projects/smpng/sys/kern/kern_thread.c#50 integrate .. //depot/projects/smpng/sys/kern/kern_uuid.c#7 integrate .. //depot/projects/smpng/sys/kern/sched_4bsd.c#21 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#24 integrate .. //depot/projects/smpng/sys/kern/subr_smp.c#28 integrate .. //depot/projects/smpng/sys/kern/subr_trap.c#60 integrate .. //depot/projects/smpng/sys/kern/subr_turnstile.c#6 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#110 integrate .. //depot/projects/smpng/sys/kern/sys_generic.c#29 integrate .. //depot/projects/smpng/sys/kern/sys_pipe.c#40 integrate .. //depot/projects/smpng/sys/kern/uipc_cow.c#14 integrate .. //depot/projects/smpng/sys/kern/uipc_sem.c#8 integrate .. //depot/projects/smpng/sys/kern/uipc_socket.c#45 integrate .. //depot/projects/smpng/sys/kern/uipc_syscalls.c#44 integrate .. //depot/projects/smpng/sys/kern/uipc_usrreq.c#31 integrate .. //depot/projects/smpng/sys/kern/vfs_syscalls.c#67 integrate .. //depot/projects/smpng/sys/libkern/ffs.c#5 integrate .. //depot/projects/smpng/sys/libkern/ffsl.c#2 integrate .. //depot/projects/smpng/sys/libkern/fls.c#2 integrate .. //depot/projects/smpng/sys/libkern/flsl.c#2 integrate .. //depot/projects/smpng/sys/modules/Makefile#69 integrate .. //depot/projects/smpng/sys/modules/awi/Makefile#2 integrate .. //depot/projects/smpng/sys/modules/firewire/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/if_ef/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/ncp/Makefile#3 integrate .. //depot/projects/smpng/sys/modules/netgraph/Makefile#10 integrate .. //depot/projects/smpng/sys/modules/nwfs/Makefile#4 integrate .. //depot/projects/smpng/sys/modules/smbfs/Makefile#6 integrate .. //depot/projects/smpng/sys/modules/syscons/Makefile#3 integrate .. //depot/projects/smpng/sys/net/if.c#40 integrate .. //depot/projects/smpng/sys/net/if_atm.h#10 integrate .. //depot/projects/smpng/sys/net/if_gre.c#13 integrate .. //depot/projects/smpng/sys/net/if_gre.h#6 integrate .. //depot/projects/smpng/sys/net/if_media.h#11 integrate .. //depot/projects/smpng/sys/net/if_ppp.c#24 integrate .. //depot/projects/smpng/sys/net/if_spppsubr.c#16 integrate .. //depot/projects/smpng/sys/net/if_vlan_var.h#11 integrate .. //depot/projects/smpng/sys/net80211/ieee80211.c#6 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_input.c#7 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_ioctl.c#9 integrate .. //depot/projects/smpng/sys/net80211/ieee80211_var.h#6 integrate .. //depot/projects/smpng/sys/netgraph/atm/ng_atm.c#7 integrate .. //depot/projects/smpng/sys/netgraph/atm/ng_atm.h#4 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/drivers/h4/ng_h4.c#4 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/include/ng_btsocket.h#4 integrate .. //depot/projects/smpng/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c#10 integrate .. //depot/projects/smpng/sys/netgraph/netgraph.h#7 integrate .. //depot/projects/smpng/sys/netgraph/ng_base.c#20 integrate .. //depot/projects/smpng/sys/netgraph/ng_bpf.h#4 integrate .. //depot/projects/smpng/sys/netgraph/ng_bridge.c#11 integrate .. //depot/projects/smpng/sys/netgraph/ng_cisco.c#7 integrate .. //depot/projects/smpng/sys/netgraph/ng_device.c#4 integrate .. //depot/projects/smpng/sys/netgraph/ng_etf.h#4 integrate .. //depot/projects/smpng/sys/netgraph/ng_ksocket.c#20 integrate .. //depot/projects/smpng/sys/netgraph/ng_message.h#7 integrate .. //depot/projects/smpng/sys/netgraph/ng_parse.c#10 integrate .. //depot/projects/smpng/sys/netgraph/ng_parse.h#5 integrate .. //depot/projects/smpng/sys/netgraph/ng_pppoe.c#16 integrate .. //depot/projects/smpng/sys/netgraph/ng_pppoe.h#7 integrate .. //depot/projects/smpng/sys/netgraph/ng_rfc1490.c#5 integrate .. //depot/projects/smpng/sys/netgraph/ng_rfc1490.h#3 integrate .. //depot/projects/smpng/sys/netgraph/ng_socket.c#19 integrate .. //depot/projects/smpng/sys/netgraph/ng_source.c#4 integrate .. //depot/projects/smpng/sys/netgraph/ng_source.h#3 integrate .. //depot/projects/smpng/sys/netinet/ip_gre.c#10 integrate .. //depot/projects/smpng/sys/netinet/raw_ip.c#34 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#45 integrate .. //depot/projects/smpng/sys/netinet/tcp_output.c#19 integrate .. //depot/projects/smpng/sys/netinet/tcp_syncache.c#25 integrate .. //depot/projects/smpng/sys/netinet/udp_usrreq.c#36 integrate .. //depot/projects/smpng/sys/netinet6/nd6.c#18 integrate .. //depot/projects/smpng/sys/netipsec/ipsec.c#8 integrate .. //depot/projects/smpng/sys/netipsec/ipsec.h#5 integrate .. //depot/projects/smpng/sys/netipsec/ipsec_output.c#9 integrate .. //depot/projects/smpng/sys/netipsec/xform_esp.c#6 integrate .. //depot/projects/smpng/sys/netipsec/xform_ipcomp.c#6 integrate .. //depot/projects/smpng/sys/netipsec/xform_ipip.c#6 integrate .. //depot/projects/smpng/sys/netkey/key.c#24 integrate .. //depot/projects/smpng/sys/pc98/conf/GENERIC#38 integrate .. //depot/projects/smpng/sys/pc98/conf/NOTES#20 integrate .. //depot/projects/smpng/sys/pc98/pc98/sio.c#35 integrate .. //depot/projects/smpng/sys/pci/if_rl.c#44 integrate .. //depot/projects/smpng/sys/pci/if_sk.c#28 integrate .. //depot/projects/smpng/sys/powerpc/conf/GENERIC#18 integrate .. //depot/projects/smpng/sys/powerpc/include/float.h#3 integrate .. //depot/projects/smpng/sys/powerpc/include/sc_machdep.h#1 branch .. //depot/projects/smpng/sys/powerpc/ofw/ofw_syscons.c#1 branch .. //depot/projects/smpng/sys/powerpc/ofw/ofw_syscons.h#1 branch .. //depot/projects/smpng/sys/powerpc/powermac/ata_macio.c#8 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/clock.c#12 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#47 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/sc_machdep.c#1 branch .. //depot/projects/smpng/sys/powerpc/powerpc/trap_subr.S#8 integrate .. //depot/projects/smpng/sys/powerpc/psim/ata_iobus.c#6 integrate .. //depot/projects/smpng/sys/rpc/rpcclnt.c#3 integrate .. //depot/projects/smpng/sys/security/mac_portacl/mac_portacl.c#4 integrate .. //depot/projects/smpng/sys/sparc64/conf/GENERIC#37 integrate .. //depot/projects/smpng/sys/sparc64/include/asmacros.h#14 integrate .. //depot/projects/smpng/sys/sys/_mutex.h#12 integrate .. //depot/projects/smpng/sys/sys/_task.h#1 branch .. //depot/projects/smpng/sys/sys/bio.h#17 integrate .. //depot/projects/smpng/sys/sys/filedesc.h#20 integrate .. //depot/projects/smpng/sys/sys/jail.h#8 integrate .. //depot/projects/smpng/sys/sys/libkern.h#12 integrate .. //depot/projects/smpng/sys/sys/lock.h#29 integrate .. //depot/projects/smpng/sys/sys/proc.h#109 integrate .. //depot/projects/smpng/sys/sys/systm.h#47 integrate .. //depot/projects/smpng/sys/sys/taskqueue.h#7 integrate .. //depot/projects/smpng/sys/sys/user.h#16 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_vnops.c#24 integrate .. //depot/projects/smpng/sys/vm/swap_pager.c#39 integrate .. //depot/projects/smpng/sys/vm/uma_int.h#19 integrate .. //depot/projects/smpng/sys/vm/vm_contig.c#20 integrate .. //depot/projects/smpng/sys/vm/vm_extern.h#19 integrate .. //depot/projects/smpng/sys/vm/vm_object.c#49 integrate .. //depot/projects/smpng/sys/vm/vm_zeroidle.c#13 integrate Differences ... ==== //depot/projects/smpng/sys/Makefile#5 (text+ko) ==== @@ -1,9 +1,9 @@ -# $FreeBSD: src/sys/Makefile,v 1.28 2003/06/26 03:52:48 peter Exp $ +# $FreeBSD: src/sys/Makefile,v 1.29 2004/01/17 03:28:27 ru Exp $ # The boot loader SUBDIR= boot -# KLD modules build for both a.out and ELF +# Loadable kernel modules .if defined(MODULES_WITH_WORLD) SUBDIR+=modules .endif ==== //depot/projects/smpng/sys/alpha/alpha/support.s#9 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/alpha/support.s,v 1.15 2003/07/24 07:49:45 marcel Exp $ + * $FreeBSD: src/sys/alpha/alpha/support.s,v 1.16 2004/01/19 21:27:10 phk Exp $ */ /* @@ -680,8 +680,10 @@ longjmp_botch: lda a0, longjmp_botchmsg - mov ra, a1 - CALL(panic) + mov 0, a1 + mov 0, a2 + mov ra, a3 + CALL(__panic) call_pal PAL_bugchk .data ==== //depot/projects/smpng/sys/alpha/conf/GENERIC#35 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.165 2003/12/08 05:20:34 obrien Exp $ +# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.168 2004/01/24 21:45:25 jeff Exp $ machine alpha cpu EV4 @@ -45,7 +45,7 @@ options DEC_KN300 # AlphaServer 4100 (Rawhide), # AlphaServer 1200 (Tincup) -options SCHED_4BSD #4BSD scheduler +options SCHED_ULE #ULE scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem @@ -68,6 +68,7 @@ options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options PFIL_HOOKS # pfil(9) framework # Debugging for use in -current options DDB #Enable the kernel debugger ==== //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#7 (text+ko) ==== @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.144 2003/11/17 08:58:12 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.145 2004/01/23 01:04:28 peter Exp $ */ #include @@ -243,7 +243,7 @@ pushq %r14 pushq %r15 pushq $sw0_1 - call panic + call __panic sw0_1: .asciz "cpu_throw: no newthread supplied" badsw2: @@ -263,7 +263,7 @@ pushq %r14 pushq %r15 pushq $sw0_2 - call panic + call __panic sw0_2: .asciz "cpu_switch: no curthread supplied" badsw3: @@ -283,7 +283,7 @@ pushq %r14 pushq %r15 pushq $sw0_3 - call panic + call __panic sw0_3: .asciz "cpu_switch: no newthread supplied" #endif ==== //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.231 2003/12/11 02:47:35 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.232 2004/01/25 06:19:37 alc Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" @@ -82,7 +82,6 @@ */ struct cpu_group mp_groups[MAXCPU]; struct cpu_top mp_top; -struct cpu_top *smp_topology; /* AP uses this during bootstrap. Do not staticize. */ char *bootSTK; ==== //depot/projects/smpng/sys/amd64/conf/GENERIC#12 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.399 2003/11/21 03:19:59 peter Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.401 2004/01/24 21:38:51 jeff Exp $ machine amd64 cpu HAMMER @@ -28,7 +28,7 @@ makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions NO_MODULES=not_yet -options SCHED_4BSD #4BSD scheduler +options SCHED_ULE #ULE scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem @@ -56,6 +56,7 @@ # output. Adds ~128k to driver. options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. +options PFIL_HOOKS # pfil(9) framework # Debugging for use in -current options DDB #Enable the kernel debugger ==== //depot/projects/smpng/sys/amd64/include/md_var.h#7 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.69 2003/11/17 08:58:14 peter Exp $ + * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.70 2004/01/17 13:13:48 phk Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -47,7 +47,6 @@ extern u_int cpu_id; extern u_int cpu_procinfo; extern char cpu_vendor[]; -extern uint16_t *elan_mmcr; extern char kstack[]; extern char sigcode[]; extern int szsigcode; ==== //depot/projects/smpng/sys/amd64/pci/pci_cfgreg.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_cfgreg.c,v 1.104 2003/12/06 23:19:47 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_cfgreg.c,v 1.105 2004/01/28 20:46:31 peter Exp $"); #include /* XXX trim includes */ #include @@ -286,7 +286,7 @@ devmax = 32; outl(CONF1_ADDR_PORT, CONF1_ENABLE_CHK); - outb(CONF1_ADDR_PORT + 3, 0); + DELAY(1); mode1res = inl(CONF1_ADDR_PORT); outl(CONF1_ADDR_PORT, oldval1); ==== //depot/projects/smpng/sys/boot/Makefile#12 (text+ko) ==== @@ -1,29 +1,29 @@ -# $FreeBSD: src/sys/boot/Makefile,v 1.19 2003/12/10 09:18:42 grehan Exp $ +# $FreeBSD: src/sys/boot/Makefile,v 1.20 2004/01/27 22:15:03 schweikh Exp $ .if ${MACHINE_ARCH} == "amd64" .MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true .endif .if !defined(NOFORTH) -# Build the add-in FORTH interpreter +# Build the add-in FORTH interpreter. SUBDIR+= ficl .endif -# Build OpenFirmware library +# Build OpenFirmware library. .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" SUBDIR+= ofw .endif -# Pick the machine-dependant subdir based on the target architecture. +# Pick the machine-dependent subdir based on the target architecture. SUBDIR+= ${MACHINE} # Build ARC / AlphaBIOS executable on the Alpha -# (this is a WIP (work in progress)) +# (this is a WIP (work in progress)). #.if ${MACHINE_ARCH} == "alpha" #SUBDIR+= arc #.endif -# Build EFI executable on ia64 +# Build EFI executable on ia64. .if ${MACHINE_ARCH} == "ia64" SUBDIR+= efi .endif ==== //depot/projects/smpng/sys/boot/common/help.common#11 (text+ko) ==== @@ -244,7 +244,7 @@ Set the number of sendfile buffers to be allocated. This overrides the value determined when the kernel was compiled. - set kern.vm.kmem.size= VM_KMEM_SIZE + set vm.kmem_size= VM_KMEM_SIZE Sets the size of kernel memory (bytes). This overrides the value determined when the kernel was compiled. ==== //depot/projects/smpng/sys/boot/common/loader.8#25 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.57 2003/06/29 20:57:55 brueffer Exp $ +.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.58 2004/01/27 15:59:38 des Exp $ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. @@ -451,11 +451,6 @@ buffers to be allocated. Overrides .Dv NSFBUFS . -.It Va kern.vm.kmem.size -Sets the size of kernel memory (bytes). -This overrides the value determined when the kernel was compiled. -Modifies -.Va VM_KMEM_SIZE . .It Va kern.maxswzone Limits the amount of KVM to be used to hold swap meta information, which directly governs the @@ -499,6 +494,11 @@ or the preset default of 512. Must be a power of 2. .El +.It Va vm.kmem_size +Sets the size of kernel memory (bytes). +This overrides the value determined when the kernel was compiled. +Modifies +.Va VM_KMEM_SIZE . .Ss BUILTIN PARSER When a builtin command is executed, the rest of the line is taken by it as arguments, and it is processed by a special parser which ==== //depot/projects/smpng/sys/boot/forth/frames.4th#2 (text+ko) ==== @@ -1,6 +1,6 @@ \ Words implementing frame drawing \ XXX Filled boxes are left as an exercise for the reader... ;-/ -\ $FreeBSD: src/sys/boot/forth/frames.4th,v 1.1 2003/05/30 09:29:23 scottl Exp $ +\ $FreeBSD: src/sys/boot/forth/frames.4th,v 1.2 2004/01/18 04:13:27 nyan Exp $ marker task-frames.4th @@ -12,27 +12,49 @@ variable rb_el variable fill -\ Single frames -196 constant sh_el -179 constant sv_el -218 constant slt_el -192 constant slb_el -191 constant srt_el -217 constant srb_el -\ Double frames -205 constant dh_el -186 constant dv_el -201 constant dlt_el -200 constant dlb_el -187 constant drt_el -188 constant drb_el -\ Fillings -0 constant fill_none -32 constant fill_blank -176 constant fill_dark -177 constant fill_med -178 constant fill_bright - +s" arch-pc98" environment? [if] + \ Single frames + 149 constant sh_el + 150 constant sv_el + 152 constant slt_el + 154 constant slb_el + 153 constant srt_el + 155 constant srb_el + \ Double frames + 149 constant dh_el + 150 constant dv_el + 152 constant dlt_el + 154 constant dlb_el + 153 constant drt_el + 155 constant drb_el + \ Fillings + 0 constant fill_none + 32 constant fill_blank + 135 constant fill_dark + 135 constant fill_med + 135 constant fill_bright +[else] + \ Single frames + 196 constant sh_el + 179 constant sv_el + 218 constant slt_el + 192 constant slb_el + 191 constant srt_el + 217 constant srb_el + \ Double frames + 205 constant dh_el + 186 constant dv_el + 201 constant dlt_el + 200 constant dlb_el + 187 constant drt_el + 188 constant drb_el + \ Fillings + 0 constant fill_none + 32 constant fill_blank + 176 constant fill_dark + 177 constant fill_med + 178 constant fill_bright +[then] : hline ( len x y -- ) \ Draw horizontal single line at-xy \ move cursor ==== //depot/projects/smpng/sys/boot/forth/loader.conf#20 (text+ko) ==== @@ -6,7 +6,7 @@ # # All arguments must be in double quotes. # -# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.72 2003/07/01 01:03:32 brueffer Exp $ +# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.73 2004/01/27 15:59:38 des Exp $ ############################################################## ### Basic configuration options ############################ @@ -96,10 +96,10 @@ #kern.ipc.nmbclusters="" # Set the number of mbuf clusters #kern.ipc.nmbufs="" # Set the maximum number of mbufs #kern.ipc.nsfbufs="" # Set the number of sendfile(2) bufs -#kern.vm.kmem.size="" # Sets the size of kernel memory (bytes) #net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE #vfs.root.mountfrom="" # Specify root partition in a way the # kernel understands +#vm.kmem_size="" # Sets the size of kernel memory (bytes) #debug.ktr.cpumask="0xf" # Bitmask of CPUs to enable KTR on #debug.ktr.mask="0x1200" # Bitmask of KTR events to enable #debug.ktr.verbose="1" # Enable console dump of KTR events ==== //depot/projects/smpng/sys/boot/i386/libi386/biosdisk.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.40 2003/08/25 23:28:31 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.41 2004/01/21 23:22:29 jhb Exp $"); /* * BIOS disk device handling. @@ -867,7 +867,7 @@ */ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); - if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(dest + x * BIOSDISK_SECSIZE) & 0xffff0000)) { + if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { breg = bbuf + x * BIOSDISK_SECSIZE; @@ -1000,7 +1000,7 @@ x = min(FLOPPY_BOUNCEBUF, (unsigned)blks); bbuf = malloc(x * 2 * BIOSDISK_SECSIZE); - if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(dest + x * BIOSDISK_SECSIZE) & 0xffff0000)) { + if (((u_int32_t)VTOP(bbuf) & 0xffff0000) == ((u_int32_t)VTOP(bbuf + x * BIOSDISK_SECSIZE) & 0xffff0000)) { breg = bbuf; } else { breg = bbuf + x * BIOSDISK_SECSIZE; ==== //depot/projects/smpng/sys/boot/pc98/btx/btx/btx.s#3 (text+ko) ==== @@ -13,7 +13,7 @@ # purpose. # -# $FreeBSD: src/sys/boot/pc98/btx/btx/btx.s,v 1.13 2001/11/17 13:58:04 nyan Exp $ +# $FreeBSD: src/sys/boot/pc98/btx/btx/btx.s,v 1.14 2004/01/28 04:15:31 nyan Exp $ # # Memory layout. @@ -323,7 +323,7 @@ exit.4: jmp exit.4 .else movw $0x1234, BDA_BOOT # Do a warm boot - ljmp $0xffff,$0x0 # reboot the machine + ljmp $0xf000,$0xfff0 # reboot the machine .endif # # Set IRQ offsets by reprogramming 8259A PICs. ==== //depot/projects/smpng/sys/boot/pc98/libpc98/vidconsole.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/vidconsole.c,v 1.11 2003/09/08 09:11:20 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/pc98/libpc98/vidconsole.c,v 1.12 2004/01/18 04:10:45 nyan Exp $"); #include #include @@ -422,7 +422,7 @@ { #ifdef PC98 - *crtat = (c == 0x5c ? 0xfc : c); + *crtat = (c == 0x5c ? 0xfc : (c & 0xff)); *(crtat + 0x1000) = at2pc98(fgcol, bgcol); #else v86.ctl = 0; ==== //depot/projects/smpng/sys/cam/scsi/scsi_sa.c#18 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.97 2003/09/13 02:01:56 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.98 2004/01/18 00:17:14 johan Exp $"); #include #include @@ -2403,7 +2403,7 @@ * Grotesque as it seems, the few times * I've actually seen a non-zero resid, * the tape drive actually lied and had - * writtent all the data!. + * written all the data!. */ csio->resid = 0; } ==== //depot/projects/smpng/sys/compat/linux/linux_util.c#10 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_util.c,v 1.23 2003/06/10 21:27:40 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_util.c,v 1.24 2004/01/14 22:38:03 truckman Exp $"); #include #include @@ -96,8 +96,6 @@ { struct nameidata nd; struct nameidata ndroot; - struct vattr vat; - struct vattr vatroot; int error; const char *prefix; char *ptr, *buf, *cp; @@ -169,17 +167,7 @@ goto keeporig; } - if ((error = VOP_GETATTR(nd.ni_vp, &vat, td->td_ucred, td)) != 0) { - goto bad; - } - - if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, td->td_ucred, td)) - != 0) { - goto bad; - } - - if (vat.va_fsid == vatroot.va_fsid && - vat.va_fileid == vatroot.va_fileid) { + if (nd.ni_vp == ndroot.ni_vp) { error = ENOENT; goto bad; } ==== //depot/projects/smpng/sys/compat/ndis/hal_var.h#2 (text+ko) ==== @@ -29,12 +29,20 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/ndis/hal_var.h,v 1.1 2003/12/11 22:34:37 wpaul Exp $ + * $FreeBSD: src/sys/compat/ndis/hal_var.h,v 1.2 2004/01/15 21:31:48 wpaul Exp $ */ #ifndef _HAL_VAR_H_ #define _HAL_VAR_H_ +#ifdef __amd64__ +#define NDIS_BUS_SPACE_IO AMD64_BUS_SPACE_IO +#define NDIS_BUS_SPACE_MEM AMD64_BUS_SPACE_MEM +#else +#define NDIS_BUS_SPACE_IO I386_BUS_SPACE_IO +#define NDIS_BUS_SPACE_MEM I386_BUS_SPACE_MEM +#endif + extern image_patch_table hal_functbl[]; #endif /* _HAL_VAR_H_ */ ==== //depot/projects/smpng/sys/compat/ndis/kern_ndis.c#6 (text+ko) ==== @@ -31,23 +31,25 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.28 2004/01/12 21:40:05 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.34 2004/01/26 21:21:53 wpaul Exp $"); #include +#include +#include #include #include #include #include #include #include -#include +#include #include #include #include #include -#include #include +#include #include #include #include @@ -75,7 +77,6 @@ #include #include -#define __stdcall __attribute__((__stdcall__)) #define NDIS_DUMMY_PATH "\\\\some\\bogus\\path" __stdcall static void ndis_status_func(ndis_handle, ndis_status, @@ -86,7 +87,37 @@ __stdcall static void ndis_resetdone_func(ndis_handle, ndis_status, uint8_t); __stdcall static void ndis_sendrsrcavail_func(ndis_handle); +struct nd_head ndis_devhead; + +struct ndis_req { + void (*nr_func)(void *); + void *nr_arg; + int nr_exit; + STAILQ_ENTRY(ndis_req) link; +}; + +struct ndisproc { + struct ndisqhead *np_q; + struct proc *np_p; +}; + +static int ndis_create_kthreads(void); +static void ndis_destroy_kthreads(void); +static void ndis_stop_thread(int); +static int ndis_enlarge_thrqueue(int); +static int ndis_shrink_thrqueue(int); +static void ndis_runq(void *); + +extern struct mtx_pool *ndis_mtxpool; static uma_zone_t ndis_packet_zone, ndis_buffer_zone; +struct mtx *ndis_thr_mtx; +static STAILQ_HEAD(ndisqhead, ndis_req) ndis_ttodo; +struct ndisqhead ndis_itodo; +struct ndisqhead ndis_free; +static int ndis_jobs = 32; + +static struct ndisproc ndis_tproc; +static struct ndisproc ndis_iproc; /* * This allows us to export our symbols to other modules. @@ -112,9 +143,29 @@ ndis_buffer_zone = uma_zcreate("NDIS buffer", sizeof(ndis_buffer), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + + ndis_create_kthreads(); + + TAILQ_INIT(&ndis_devhead); + break; + case MOD_SHUTDOWN: + /* stop kthreads */ + ndis_destroy_kthreads(); + if (TAILQ_FIRST(&ndis_devhead) != NULL) { + /* Shut down subsystems */ + ndis_libfini(); + ntoskrnl_libfini(); + + /* Remove zones */ + uma_zdestroy(ndis_packet_zone); + uma_zdestroy(ndis_buffer_zone); + } + break; case MOD_UNLOAD: - case MOD_SHUTDOWN: + /* stop kthreads */ + ndis_destroy_kthreads(); + /* Shut down subsystems */ ndis_libfini(); ntoskrnl_libfini(); @@ -133,7 +184,268 @@ DEV_MODULE(ndisapi, ndis_modevent, NULL); MODULE_VERSION(ndisapi, 1); +/* + * We create two kthreads for the NDIS subsystem. One of them is a task + * queue for performing various odd jobs. The other is an swi thread + * reserved exclusively for running interrupt handlers. The reason we + * have our own task queue is that there are some cases where we may + * need to sleep for a significant amount of time, and if we were to + * use one of the taskqueue threads, we might delay the processing + * of other pending tasks which might need to run right away. We have + * a separate swi thread because we don't want our interrupt handling + * to be delayed either. + * + * By default there are 32 jobs available to start, and another 8 + * are added to the free list each time a new device is created. + */ + +static void +ndis_runq(arg) + void *arg; +{ + struct ndis_req *r = NULL, *die = NULL; + struct ndisproc *p; + + p = arg; + + while (1) { + kthread_suspend(p->np_p, 0); + + /* Look for any jobs on the work queue. */ + + mtx_pool_lock(ndis_mtxpool, ndis_thr_mtx); + while(STAILQ_FIRST(p->np_q) != NULL) { + r = STAILQ_FIRST(p->np_q); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Jan 28 13:28:38 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 02A0216A4D0; Wed, 28 Jan 2004 13:28:38 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D161216A4CE for ; Wed, 28 Jan 2004 13:28:37 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB53243D3F for ; Wed, 28 Jan 2004 13:28:29 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0SLST0B079758 for ; Wed, 28 Jan 2004 13:28:29 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0SLSTC4079755 for perforce@freebsd.org; Wed, 28 Jan 2004 13:28:29 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Wed, 28 Jan 2004 13:28:29 -0800 (PST) Message-Id: <200401282128.i0SLSTC4079755@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46081 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 21:28:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=46081 Change 46081 by jhb@jhb_slimer on 2004/01/28 13:27:45 Reverse integrate extra witness test from jhb_lock. Affected files ... .. //depot/projects/smpng/sys/modules/crash/crash.c#10 integrate Differences ... ==== //depot/projects/smpng/sys/modules/crash/crash.c#10 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001 + * Copyright (c) 2001-2004 * John Baldwin . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,6 +36,7 @@ #define INVARIANTS #define INVARIANT_SUPPORT +#define WITNESS #include #include @@ -51,7 +52,7 @@ #include #include -#define MAX_EVENT 18 +#define MAX_EVENT 19 static struct sx foo, bar, bar2; static struct cv event_cv; @@ -77,7 +78,8 @@ "assert that foo is slocked while it is xlocked", "lock test, slock foo, sunlock foo, unlock test", "use test1 and test2 mutexes to test witness removal", - "try lock tests including recursion test" + "try lock tests including recursion test", + "test witness_defineorder and witness_checkorder", }; static int mod_event(struct module *module, int cmd, void *arg); @@ -257,6 +259,39 @@ mtx_destroy(&test1_mtx); mtx_destroy(&test2_mtx); break; + case 19: + bzero(&test1_mtx, sizeof(test1_mtx)); + bzero(&test2_mtx, sizeof(test2_mtx)); + mtx_init(&test1_mtx, "test1", NULL, MTX_DEF); + mtx_init(&test2_mtx, "test2", NULL, MTX_DEF); + Debugger("no order yet"); + status = WITNESS_DEFINEORDER(&test1_mtx, &test2_mtx); + printf("Status of test1 -> test2 set order should be 0: %d\n", + status); + Debugger("order should be test1 then test2"); + printf("Check order of test1 -> test2 should succeed.\n"); + mtx_lock(&test1_mtx); + witness_check_mutex(&test2_mtx); + mtx_unlock(&test1_mtx); + status = WITNESS_DEFINEORDER(&test2_mtx, &test1_mtx); + printf("Status of test2 -> test1 set order should be EDOOFUS: %d\n", + status); + printf("Clearing test order.\n"); + mtx_destroy(&test1_mtx); + mtx_destroy(&test2_mtx); + mtx_init(&test1_mtx, "test1", NULL, MTX_DEF); + mtx_init(&test2_mtx, "test2", NULL, MTX_DEF); + status = WITNESS_DEFINEORDER(&test1_mtx, &test2_mtx); + printf("Status of test1 -> test2 set order should be 0: %d\n", + status); + printf("Should get a reversal:\n"); + mtx_lock(&test2_mtx); + mtx_lock(&test1_mtx); + mtx_unlock(&test1_mtx); + mtx_unlock(&test2_mtx); + mtx_destroy(&test1_mtx); + mtx_destroy(&test2_mtx); + break; default: panic("event %d is bogus\n", event); } From owner-p4-projects@FreeBSD.ORG Wed Jan 28 13:50:49 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0C56316A4D0; Wed, 28 Jan 2004 13:50:49 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA3C016A4CE for ; Wed, 28 Jan 2004 13:50:48 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2F5343D41 for ; Wed, 28 Jan 2004 13:50:47 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0SLol0B084368 for ; Wed, 28 Jan 2004 13:50:47 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0SLoljL084364 for perforce@freebsd.org; Wed, 28 Jan 2004 13:50:47 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Wed, 28 Jan 2004 13:50:47 -0800 (PST) Message-Id: <200401282150.i0SLoljL084364@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46087 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2004 21:50:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=46087 Change 46087 by jhb@jhb_slimer on 2004/01/28 13:49:46 Update to trim committed stuff. Affected files ... .. //depot/projects/smpng/sys/notes#6 edit .. //depot/user/jhb/lock/notes#10 edit Differences ... ==== //depot/projects/smpng/sys/notes#6 (text+ko) ==== @@ -39,8 +39,6 @@ - Use panic_thread pointer instead of panic_cpu to allow for migration of the panic'ing thread - Untested -- Move loadav() into its own thread. - - Untested - Remove some bogus atomic_load_acq()'s and add ia32_pause()'s to stop_cpus() and restart_cpus(). - Untested ==== //depot/user/jhb/lock/notes#10 (text+ko) ==== @@ -67,11 +67,6 @@ - Add a witness check in exit1() if not done already. - Check should be in thread_exit(). witness_warn() will need tweaking since it freaks out if sched_lock is held. -+ Split witness_lock() into witness_checkorder() and witness_lock(). - + Tested -+ Add a witness_defineorder() that adds an order between two locks at - runtime. - + Tested - Fix show witness output to use paging. - Add generic sleep queue code and move msleep() and cv's to use it?? - Add a MTX_NEW flag to bypass the LO_INITIALIZED check. Here be dragons. From owner-p4-projects@FreeBSD.ORG Wed Jan 28 16:17:39 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F36B316A4D0; Wed, 28 Jan 2004 16:17:38 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B028616A4CE for ; Wed, 28 Jan 2004 16:17:38 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4918743D3F for ; Wed, 28 Jan 2004 16:17:01 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0T0H10B020123 for ; Wed, 28 Jan 2004 16:17:01 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0T0Gtsl020115 for perforce@freebsd.org; Wed, 28 Jan 2004 16:16:55 -0800 (PST) (envelope-from peter@freebsd.org) Date: Wed, 28 Jan 2004 16:16:55 -0800 (PST) Message-Id: <200401290016.i0T0Gtsl020115@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 46100 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 00:17:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=46100 Change 46100 by peter@peter_daintree on 2004/01/28 16:16:50 IFC @46099 Affected files ... .. //depot/projects/hammer/MAINTAINERS#14 integrate .. //depot/projects/hammer/Makefile.inc1#36 integrate .. //depot/projects/hammer/UPDATING#31 integrate .. //depot/projects/hammer/bin/kill/kill.c#3 integrate .. //depot/projects/hammer/bin/sh/eval.c#6 integrate .. //depot/projects/hammer/bin/sh/jobs.c#8 integrate .. //depot/projects/hammer/bin/sh/trap.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/FREEBSD-Xlist#1 branch .. //depot/projects/hammer/contrib/bsnmp/FREEBSD-upgrade#2 integrate .. //depot/projects/hammer/contrib/bsnmp/NEWS#2 integrate .. //depot/projects/hammer/contrib/bsnmp/README#2 integrate .. //depot/projects/hammer/contrib/bsnmp/TODO#2 integrate .. //depot/projects/hammer/contrib/bsnmp/VERSION#2 integrate .. //depot/projects/hammer/contrib/bsnmp/gensnmptree/gensnmptree.1#2 integrate .. //depot/projects/hammer/contrib/bsnmp/gensnmptree/gensnmptree.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/asn1.3#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/asn1.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/asn1.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/bsnmpagent.3#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/bsnmpclient.3#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/bsnmplib.3#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/snmp.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/snmp.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/snmpagent.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/snmpagent.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/snmpclient.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/snmpclient.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/lib/snmppriv.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_ifmib.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_ifstack.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_interfaces.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_ip.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_route.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_tcp.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_tree.def#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/mibII_udp.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/snmp_mibII.3#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmp_mibII/snmp_mibII.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/FOKUS-MIB.txt#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/action.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/bsnmpd.1#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/config.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/export.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/main.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/snmpd.config#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/snmpd.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/snmpd.sh#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/snmpmod.3#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/snmpmod.h#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/trans_lsock.c#1 branch .. //depot/projects/hammer/contrib/bsnmp/snmpd/trans_lsock.h#1 branch .. //depot/projects/hammer/contrib/bsnmp/snmpd/trans_udp.c#1 branch .. //depot/projects/hammer/contrib/bsnmp/snmpd/trans_udp.h#1 branch .. //depot/projects/hammer/contrib/bsnmp/snmpd/trap.c#2 integrate .. //depot/projects/hammer/contrib/bsnmp/snmpd/tree.def#2 integrate .. //depot/projects/hammer/contrib/isc-dhcp/client/dhclient.c#7 integrate .. //depot/projects/hammer/contrib/smbfs/lib/smb/nb_net.c#2 integrate .. //depot/projects/hammer/contrib/traceroute/traceroute.c#2 integrate .. //depot/projects/hammer/crypto/openssh/FREEBSD-upgrade#6 integrate .. //depot/projects/hammer/etc/pccard_ether#8 integrate .. //depot/projects/hammer/etc/rc.d/cleartmp#6 integrate .. //depot/projects/hammer/etc/rc.d/ipfilter#14 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/Makefile#6 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-alpha.h#2 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-amd64.h#1 branch .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-arm.h#2 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h#3 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-ia64.h#2 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-powerpc.h#2 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-sparc64.h#2 integrate .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/fbsd-kgdb-x86_64.h#2 delete .. //depot/projects/hammer/gnu/usr.bin/binutils/gdb/kvm-fbsd.c#6 integrate .. //depot/projects/hammer/gnu/usr.bin/cc/cc_tools/Makefile#13 integrate .. //depot/projects/hammer/include/Makefile#19 integrate .. //depot/projects/hammer/lib/Makefile#29 integrate .. //depot/projects/hammer/lib/libbsnmp/modules/Makefile.inc#3 integrate .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_mibII/Makefile#4 integrate .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_mibII/genfiles#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_mibII/mibII_oid.h#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_mibII/mibII_tree.c#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_mibII/mibII_tree.h#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/Makefile#4 integrate .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/genfiles#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/netgraph_oid.h#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/netgraph_tree.c#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/netgraph_tree.h#2 delete .. //depot/projects/hammer/lib/libbsnmp/modules/snmp_netgraph/snmp_netgraph.c#3 integrate .. //depot/projects/hammer/lib/libc/stdio/vfwprintf.c#11 integrate .. //depot/projects/hammer/lib/libc/sys/poll.2#4 integrate .. //depot/projects/hammer/lib/libc/sys/read.2#4 integrate .. //depot/projects/hammer/lib/libc/sys/select.2#5 integrate .. //depot/projects/hammer/lib/libc/xdr/xdr_stdio.c#2 integrate .. //depot/projects/hammer/lib/libdisk/change.c#5 integrate .. //depot/projects/hammer/lib/libdisk/write_ia64_disk.c#9 integrate .. //depot/projects/hammer/lib/libfetch/fetch.3#7 integrate .. //depot/projects/hammer/lib/libnetgraph/Makefile#3 integrate .. //depot/projects/hammer/lib/libnetgraph/msg.c#3 integrate .. //depot/projects/hammer/lib/libnetgraph/netgraph.3#5 integrate .. //depot/projects/hammer/lib/libnetgraph/netgraph.h#2 integrate .. //depot/projects/hammer/lib/libnetgraph/sock.c#4 integrate .. //depot/projects/hammer/lib/libpam/modules/pam_lastlog/pam_lastlog.c#5 integrate .. //depot/projects/hammer/lib/libsdp/Makefile#3 integrate .. //depot/projects/hammer/lib/libusbhid/parse.c#4 integrate .. //depot/projects/hammer/release/Makefile#43 integrate .. //depot/projects/hammer/release/Makefile.inc.docports#7 integrate .. //depot/projects/hammer/release/alpha/boot_crunch.conf#3 integrate .. //depot/projects/hammer/release/amd64/boot_crunch.conf#3 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/errata/article.sgml#13 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/hardware/common/dev.sgml#45 integrate .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#55 integrate .. //depot/projects/hammer/release/i386/boot_crunch.conf#4 integrate .. //depot/projects/hammer/release/i386/dokern.sh#14 delete .. //depot/projects/hammer/release/i386/drivers.conf#17 delete .. //depot/projects/hammer/release/ia64/boot_crunch.conf#6 integrate .. //depot/projects/hammer/release/pc98/boot_crunch.conf#5 integrate .. //depot/projects/hammer/release/pc98/dokern.sh#12 delete .. //depot/projects/hammer/release/pc98/drivers-small.conf#4 delete .. //depot/projects/hammer/release/pc98/drivers.conf#9 delete .. //depot/projects/hammer/release/scripts/doFS.sh#13 integrate .. //depot/projects/hammer/release/scripts/driver-copy2.awk#2 delete .. //depot/projects/hammer/release/scripts/driver-desc.awk#2 delete .. //depot/projects/hammer/release/scripts/driver-remove.awk#2 delete .. //depot/projects/hammer/release/scripts/split-file.sh#1 branch .. //depot/projects/hammer/release/sparc64/boot_crunch.conf#4 integrate .. //depot/projects/hammer/sbin/atm/atmconfig/diag.c#3 integrate .. //depot/projects/hammer/sbin/atm/atmconfig/diag.h#2 integrate .. //depot/projects/hammer/sbin/disklabel/Makefile#2 delete .. //depot/projects/hammer/sbin/disklabel/disklabel.5#5 delete .. //depot/projects/hammer/sbin/disklabel/disklabel.8#9 delete .. //depot/projects/hammer/sbin/disklabel/disklabel.c#10 delete .. //depot/projects/hammer/sbin/disklabel/pathnames.h#2 delete .. //depot/projects/hammer/sbin/ffsinfo/ffsinfo.8#4 integrate .. //depot/projects/hammer/sbin/fsck_ffs/pass1.c#6 integrate .. //depot/projects/hammer/sbin/fsck_ffs/setup.c#9 integrate .. //depot/projects/hammer/sbin/growfs/growfs.8#6 integrate .. //depot/projects/hammer/sbin/ifconfig/ifconfig.c#12 integrate .. //depot/projects/hammer/sbin/ifconfig/ifconfig.h#4 integrate .. //depot/projects/hammer/sbin/ipfw/ipfw.8#18 integrate .. //depot/projects/hammer/sbin/ipfw/ipfw2.c#19 integrate .. //depot/projects/hammer/sbin/mksnap_ffs/mksnap_ffs.c#4 integrate .. //depot/projects/hammer/share/examples/etc/make.conf#15 integrate .. //depot/projects/hammer/share/man/man4/ata.4#7 integrate .. //depot/projects/hammer/share/man/man4/gdb.4#3 integrate .. //depot/projects/hammer/share/man/man4/gre.4#3 integrate .. //depot/projects/hammer/share/man/man4/ng_one2many.4#3 integrate .. //depot/projects/hammer/share/man/man4/uplcom.4#3 integrate .. //depot/projects/hammer/share/man/man4/witness.4#2 integrate .. //depot/projects/hammer/share/man/man5/make.conf.5#16 integrate .. //depot/projects/hammer/share/man/man7/release.7#16 integrate .. //depot/projects/hammer/share/man/man9/MUTEX_PROFILING.9#1 branch .. //depot/projects/hammer/share/man/man9/Makefile#25 integrate .. //depot/projects/hammer/share/man/man9/bus_alloc_resource.9#5 integrate .. //depot/projects/hammer/share/man/man9/bus_set_resource.9#3 integrate .. //depot/projects/hammer/share/man/man9/ifnet.9#10 integrate .. //depot/projects/hammer/share/man/man9/mac.9#4 integrate .. //depot/projects/hammer/share/man/man9/mutex.9#8 integrate .. //depot/projects/hammer/share/man/man9/pmap.9#3 integrate .. //depot/projects/hammer/share/man/man9/sbuf.9#5 integrate .. //depot/projects/hammer/share/man/man9/zone.9#6 integrate .. //depot/projects/hammer/share/mk/bsd.dep.mk#8 integrate .. //depot/projects/hammer/share/mk/bsd.info.mk#3 integrate .. //depot/projects/hammer/share/mk/bsd.lib.mk#12 integrate .. //depot/projects/hammer/share/mk/bsd.prog.mk#7 integrate .. //depot/projects/hammer/share/mk/sys.mk#10 integrate .. //depot/projects/hammer/share/syscons/keymaps/it.iso.kbd#3 integrate .. //depot/projects/hammer/share/termcap/termcap.src#8 integrate .. //depot/projects/hammer/sys/alpha/conf/GENERIC#15 integrate .. //depot/projects/hammer/sys/amd64/amd64/cpu_switch.S#19 integrate .. //depot/projects/hammer/sys/amd64/amd64/db_trace.c#14 integrate .. //depot/projects/hammer/sys/amd64/amd64/fpu.c#7 integrate .. //depot/projects/hammer/sys/amd64/amd64/genassym.c#30 integrate .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#30 integrate .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#79 integrate .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#53 integrate .. //depot/projects/hammer/sys/amd64/amd64/trap.c#37 integrate .. //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#27 integrate .. //depot/projects/hammer/sys/amd64/conf/GENERIC#28 integrate .. //depot/projects/hammer/sys/amd64/include/cpufunc.h#18 integrate .. //depot/projects/hammer/sys/amd64/include/fpu.h#3 integrate .. //depot/projects/hammer/sys/amd64/include/md_var.h#22 integrate .. //depot/projects/hammer/sys/amd64/include/pcb.h#15 integrate .. //depot/projects/hammer/sys/amd64/include/reg.h#9 integrate .. //depot/projects/hammer/sys/amd64/include/smp.h#16 integrate .. //depot/projects/hammer/sys/amd64/include/specialreg.h#12 integrate .. //depot/projects/hammer/sys/amd64/isa/atpic.c#34 integrate .. //depot/projects/hammer/sys/amd64/pci/pci_cfgreg.c#11 integrate .. //depot/projects/hammer/sys/boot/Makefile#10 integrate .. //depot/projects/hammer/sys/boot/common/help.common#5 integrate .. //depot/projects/hammer/sys/boot/common/loader.8#8 integrate .. //depot/projects/hammer/sys/boot/forth/loader.conf#7 integrate .. //depot/projects/hammer/sys/boot/pc98/btx/btx/btx.s#2 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_misc.c#9 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_proto.h#9 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_syscall.h#9 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_syscalls.c#9 integrate .. //depot/projects/hammer/sys/compat/freebsd32/freebsd32_sysent.c#9 integrate .. //depot/projects/hammer/sys/compat/freebsd32/syscalls.master#12 integrate .. //depot/projects/hammer/sys/compat/ndis/kern_ndis.c#5 integrate .. //depot/projects/hammer/sys/compat/ndis/ndis_var.h#5 integrate .. //depot/projects/hammer/sys/compat/ndis/subr_ndis.c#5 integrate .. //depot/projects/hammer/sys/conf/NOTES#33 integrate .. //depot/projects/hammer/sys/conf/options.i386#24 integrate .. //depot/projects/hammer/sys/conf/options.pc98#19 integrate .. //depot/projects/hammer/sys/crypto/md5.c#4 integrate .. //depot/projects/hammer/sys/ddb/db_output.c#4 integrate .. //depot/projects/hammer/sys/dev/acpica/Osd/OsdTable.c#4 integrate .. //depot/projects/hammer/sys/dev/acpica/acpi.c#21 integrate .. //depot/projects/hammer/sys/dev/acpica/acpivar.h#17 integrate .. //depot/projects/hammer/sys/dev/ar/if_ar.c#8 integrate .. //depot/projects/hammer/sys/dev/ata/ata-all.h#12 integrate .. //depot/projects/hammer/sys/dev/ata/ata-chipset.c#25 integrate .. //depot/projects/hammer/sys/dev/ata/ata-disk.c#15 integrate .. //depot/projects/hammer/sys/dev/ata/ata-lowlevel.c#9 integrate .. //depot/projects/hammer/sys/dev/ata/ata-queue.c#7 integrate .. //depot/projects/hammer/sys/dev/ata/atapi-cd.c#17 integrate .. //depot/projects/hammer/sys/dev/ata/atapi-fd.c#8 integrate .. //depot/projects/hammer/sys/dev/ata/atapi-tape.c#9 integrate .. //depot/projects/hammer/sys/dev/firewire/fwohci_pci.c#19 integrate .. //depot/projects/hammer/sys/dev/firewire/sbp_targ.c#4 integrate .. //depot/projects/hammer/sys/dev/if_ndis/if_ndis.c#5 integrate .. //depot/projects/hammer/sys/dev/if_ndis/if_ndisvar.h#5 integrate .. //depot/projects/hammer/sys/dev/isp/isp.c#10 integrate .. //depot/projects/hammer/sys/dev/isp/isp_freebsd.c#10 integrate .. //depot/projects/hammer/sys/dev/isp/isp_ioctl.h#3 integrate .. //depot/projects/hammer/sys/dev/isp/ispmbox.h#5 integrate .. //depot/projects/hammer/sys/dev/kbd/kbd.c#6 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/ac97.c#10 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/buffer.c#6 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/buffer.h#5 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/channel.c#8 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/channel.h#4 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/dsp.c#10 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/sound.c#8 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/sound.h#6 integrate .. //depot/projects/hammer/sys/dev/sound/pcm/vchan.c#5 integrate .. //depot/projects/hammer/sys/dev/sr/if_sr.c#9 integrate .. //depot/projects/hammer/sys/dev/usb/uftdi.c#7 integrate .. //depot/projects/hammer/sys/dev/usb/umass.c#16 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs#25 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs.h#24 integrate .. //depot/projects/hammer/sys/dev/usb/usbdevs_data.h#24 integrate .. //depot/projects/hammer/sys/geom/bde/g_bde_crypt.c#10 integrate .. //depot/projects/hammer/sys/geom/geom_dev.c#20 integrate .. //depot/projects/hammer/sys/geom/geom_disk.c#21 integrate .. //depot/projects/hammer/sys/geom/geom_event.c#16 integrate .. //depot/projects/hammer/sys/geom/geom_io.c#19 integrate .. //depot/projects/hammer/sys/geom/geom_subr.c#22 integrate .. //depot/projects/hammer/sys/gnu/ext2fs/ext2_vfsops.c#11 integrate .. //depot/projects/hammer/sys/i386/acpica/madt.c#8 integrate .. //depot/projects/hammer/sys/i386/conf/GENERIC#18 integrate .. //depot/projects/hammer/sys/i386/conf/NOTES#28 integrate .. //depot/projects/hammer/sys/i386/i386/apic_vector.s#6 integrate .. //depot/projects/hammer/sys/i386/i386/identcpu.c#11 integrate .. //depot/projects/hammer/sys/i386/i386/local_apic.c#6 integrate .. //depot/projects/hammer/sys/i386/i386/longrun.c#1 branch .. //depot/projects/hammer/sys/i386/i386/mp_machdep.c#27 integrate .. //depot/projects/hammer/sys/i386/i386/p4tcc.c#2 integrate .. //depot/projects/hammer/sys/i386/i386/pmap.c#28 integrate .. //depot/projects/hammer/sys/i386/i386/trap.c#22 integrate .. //depot/projects/hammer/sys/i386/isa/atpic_vector.s#4 integrate .. //depot/projects/hammer/sys/ia64/conf/GENERIC#13 integrate .. //depot/projects/hammer/sys/kern/kern_condvar.c#13 integrate .. //depot/projects/hammer/sys/kern/kern_fork.c#23 integrate .. //depot/projects/hammer/sys/kern/kern_idle.c#9 integrate .. //depot/projects/hammer/sys/kern/kern_intr.c#21 integrate .. //depot/projects/hammer/sys/kern/kern_jail.c#7 integrate .. //depot/projects/hammer/sys/kern/kern_malloc.c#13 integrate .. //depot/projects/hammer/sys/kern/kern_mutex.c#16 integrate .. //depot/projects/hammer/sys/kern/kern_ntptime.c#6 integrate .. //depot/projects/hammer/sys/kern/kern_poll.c#7 integrate .. //depot/projects/hammer/sys/kern/kern_prot.c#12 integrate .. //depot/projects/hammer/sys/kern/kern_shutdown.c#10 integrate .. //depot/projects/hammer/sys/kern/kern_sig.c#31 integrate .. //depot/projects/hammer/sys/kern/kern_subr.c#9 integrate .. //depot/projects/hammer/sys/kern/kern_sx.c#4 integrate .. //depot/projects/hammer/sys/kern/kern_synch.c#26 integrate .. //depot/projects/hammer/sys/kern/kern_thread.c#41 integrate .. //depot/projects/hammer/sys/kern/sched_4bsd.c#13 integrate .. //depot/projects/hammer/sys/kern/sched_ule.c#24 integrate .. //depot/projects/hammer/sys/kern/subr_smp.c#14 integrate .. //depot/projects/hammer/sys/kern/subr_trap.c#16 integrate .. //depot/projects/hammer/sys/kern/subr_turnstile.c#5 integrate .. //depot/projects/hammer/sys/kern/subr_witness.c#24 integrate .. //depot/projects/hammer/sys/modules/Makefile#35 integrate .. //depot/projects/hammer/sys/modules/netgraph/Makefile#7 integrate .. //depot/projects/hammer/sys/net/if.c#14 integrate .. //depot/projects/hammer/sys/net/if_atm.h#9 integrate .. //depot/projects/hammer/sys/net/if_gre.c#11 integrate .. //depot/projects/hammer/sys/net/if_gre.h#5 integrate .. //depot/projects/hammer/sys/net/if_media.h#8 integrate .. //depot/projects/hammer/sys/netgraph/atm/ng_atm.c#7 integrate .. //depot/projects/hammer/sys/netgraph/atm/ng_atm.h#4 integrate .. //depot/projects/hammer/sys/netgraph/bluetooth/drivers/h4/ng_h4.c#4 integrate .. //depot/projects/hammer/sys/netgraph/bluetooth/include/ng_btsocket.h#4 integrate .. //depot/projects/hammer/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c#8 integrate .. //depot/projects/hammer/sys/netgraph/netgraph.h#5 integrate .. //depot/projects/hammer/sys/netgraph/ng_base.c#10 integrate .. //depot/projects/hammer/sys/netgraph/ng_bpf.h#3 integrate .. //depot/projects/hammer/sys/netgraph/ng_bridge.c#7 integrate .. //depot/projects/hammer/sys/netgraph/ng_device.c#3 integrate .. //depot/projects/hammer/sys/netgraph/ng_etf.h#3 integrate .. //depot/projects/hammer/sys/netgraph/ng_ksocket.c#7 integrate .. //depot/projects/hammer/sys/netgraph/ng_message.h#7 integrate .. //depot/projects/hammer/sys/netgraph/ng_parse.c#4 integrate .. //depot/projects/hammer/sys/netgraph/ng_parse.h#4 integrate .. //depot/projects/hammer/sys/netgraph/ng_pppoe.c#7 integrate .. //depot/projects/hammer/sys/netgraph/ng_pppoe.h#4 integrate .. //depot/projects/hammer/sys/netgraph/ng_socket.c#5 integrate .. //depot/projects/hammer/sys/netgraph/ng_source.c#3 integrate .. //depot/projects/hammer/sys/netgraph/ng_source.h#3 integrate .. //depot/projects/hammer/sys/netinet/ip_gre.c#8 integrate .. //depot/projects/hammer/sys/netinet/raw_ip.c#15 integrate .. //depot/projects/hammer/sys/netinet/tcp_syncache.c#12 integrate .. //depot/projects/hammer/sys/netinet/udp_usrreq.c#13 integrate .. //depot/projects/hammer/sys/netinet6/nd6.c#11 integrate .. //depot/projects/hammer/sys/netipsec/ipsec.c#6 integrate .. //depot/projects/hammer/sys/netipsec/ipsec.h#6 integrate .. //depot/projects/hammer/sys/netipsec/xform_esp.c#6 integrate .. //depot/projects/hammer/sys/netipsec/xform_ipcomp.c#6 integrate .. //depot/projects/hammer/sys/netkey/key.c#15 integrate .. //depot/projects/hammer/sys/pc98/conf/GENERIC#13 integrate .. //depot/projects/hammer/sys/pc98/conf/NOTES#17 integrate .. //depot/projects/hammer/sys/powerpc/conf/GENERIC#13 integrate .. //depot/projects/hammer/sys/sparc64/conf/GENERIC#19 integrate .. //depot/projects/hammer/sys/sparc64/include/asmacros.h#5 integrate .. //depot/projects/hammer/sys/sys/_mutex.h#4 integrate .. //depot/projects/hammer/sys/sys/_task.h#1 branch .. //depot/projects/hammer/sys/sys/bio.h#9 integrate .. //depot/projects/hammer/sys/sys/jail.h#3 integrate .. //depot/projects/hammer/sys/sys/lock.h#6 integrate .. //depot/projects/hammer/sys/sys/proc.h#43 integrate .. //depot/projects/hammer/sys/sys/taskqueue.h#4 integrate .. //depot/projects/hammer/sys/ufs/ffs/ffs_vnops.c#18 integrate .. //depot/projects/hammer/sys/vm/swap_pager.c#20 integrate .. //depot/projects/hammer/sys/vm/vm_zeroidle.c#8 integrate .. //depot/projects/hammer/tools/tools/tinderbox/etc/Makefile#4 integrate .. //depot/projects/hammer/tools/tools/tinderbox/etc/current.rc#2 integrate .. //depot/projects/hammer/tools/tools/tinderbox/etc/experimental.rc#3 delete .. //depot/projects/hammer/tools/tools/tinderbox/etc/releng_5.rc#3 integrate .. //depot/projects/hammer/tools/tools/tinderbox/etc/stanley.rc#2 delete .. //depot/projects/hammer/tools/tools/tinderbox/tbmaster.1#6 integrate .. //depot/projects/hammer/tools/tools/tinderbox/tbmaster.pl#16 integrate .. //depot/projects/hammer/tools/tools/tinderbox/tinderbox.1#6 integrate .. //depot/projects/hammer/tools/tools/tinderbox/tinderbox.pl#9 integrate .. //depot/projects/hammer/tools/tools/tinderbox/www/Makefile#5 integrate .. //depot/projects/hammer/tools/tools/tinderbox/www/index.cgi#8 integrate .. //depot/projects/hammer/usr.bin/Makefile#24 integrate .. //depot/projects/hammer/usr.bin/fetch/fetch.1#6 integrate .. //depot/projects/hammer/usr.bin/killall/killall.1#4 integrate .. //depot/projects/hammer/usr.bin/killall/killall.c#8 integrate .. //depot/projects/hammer/usr.bin/login/login.c#6 integrate .. //depot/projects/hammer/usr.bin/make/str.c#6 integrate .. //depot/projects/hammer/usr.bin/mklocale/mklocale.1#8 integrate .. //depot/projects/hammer/usr.bin/script/script.c#4 integrate .. //depot/projects/hammer/usr.sbin/Makefile#40 integrate .. //depot/projects/hammer/usr.sbin/acpi/acpiconf/acpiconf.8#7 integrate .. //depot/projects/hammer/usr.sbin/bluetooth/Makefile#4 integrate .. //depot/projects/hammer/usr.sbin/bluetooth/sdpd/Makefile#1 branch .. //depot/projects/hammer/usr.sbin/bsnmpd/bsnmpd/Makefile#2 integrate .. //depot/projects/hammer/usr.sbin/bsnmpd/bsnmpd/genfiles#2 delete .. //depot/projects/hammer/usr.sbin/bsnmpd/bsnmpd/oid.h#2 delete .. //depot/projects/hammer/usr.sbin/bsnmpd/bsnmpd/tree.c#2 delete .. //depot/projects/hammer/usr.sbin/bsnmpd/bsnmpd/tree.h#2 delete .. //depot/projects/hammer/usr.sbin/chkgrp/chkgrp.8#2 integrate .. //depot/projects/hammer/usr.sbin/ctm/mkCTM/mkctm.c#3 integrate .. //depot/projects/hammer/usr.sbin/kldxref/kldxref.8#3 integrate .. //depot/projects/hammer/usr.sbin/ndiscvt/inf.c#4 integrate .. //depot/projects/hammer/usr.sbin/ngctl/Makefile#3 integrate .. //depot/projects/hammer/usr.sbin/ngctl/config.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/connect.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/debug.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/dot.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/list.c#3 integrate .. //depot/projects/hammer/usr.sbin/ngctl/main.c#5 integrate .. //depot/projects/hammer/usr.sbin/ngctl/mkpeer.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/msg.c#3 integrate .. //depot/projects/hammer/usr.sbin/ngctl/name.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/rmhook.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/show.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/status.c#2 integrate .. //depot/projects/hammer/usr.sbin/ngctl/types.c#2 integrate .. //depot/projects/hammer/usr.sbin/pkg_install/add/extract.c#4 integrate .. //depot/projects/hammer/usr.sbin/sysinstall/tcpip.c#4 integrate .. //depot/projects/hammer/usr.sbin/syslogd/syslogd.c#11 integrate Differences ... ==== //depot/projects/hammer/MAINTAINERS#14 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/MAINTAINERS,v 1.77 2003/08/01 17:54:11 mbr Exp $ +$FreeBSD: src/MAINTAINERS,v 1.78 2004/01/27 14:33:33 cperciva Exp $ subsystem login notes ----------------------------- @@ -47,6 +47,7 @@ dhcp mbr Needs to pre-approve commits to contrib/isc-dhcp, so changes can be made to the isc.org CVS repository. RELENG_4_* security-officer Requires Security Officer approval. +RELENG_5_* security-officer Requires Security Officer approval. libfetch des Advance notification requested. fetch des Advance notification requested. libpam des Pre-commit review requested. ==== //depot/projects/hammer/Makefile.inc1#36 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile.inc1,v 1.402 2004/01/22 08:18:36 ru Exp $ +# $FreeBSD: src/Makefile.inc1,v 1.403 2004/01/23 16:22:48 harti Exp $ # # Make command line options: # -DNO_DYNAMICROOT do not link /bin and /sbin dynamically @@ -647,6 +647,10 @@ _crunchgen= usr.sbin/crunch/crunchgen .endif +.if ${BOOTSTRAPPING} < 501114 +_gensnmptree= usr.sbin/bsnmpd/gensnmptree +.endif + .if ${BOOTSTRAPPING} < 500019 _kbdcontrol= usr.sbin/kbdcontrol .endif @@ -667,6 +671,7 @@ ${_yacc} \ usr.sbin/config \ ${_crunchgen} \ + ${_gensnmptree} \ ${_kbdcontrol} @${ECHODIR} "===> ${_tool}"; \ cd ${.CURDIR}/${_tool}; \ ==== //depot/projects/hammer/UPDATING#31 (text+ko) ==== @@ -17,6 +17,14 @@ developers choose to disable these features on build machines to maximize performance. +20040125: + ULE has entered into its probationary period as the default scheduler + in GENERIC. For the average user, interactivity is reported to be + better in many cases. On SMP machines ULE will be able to make more + efficient use of the available parallel resources. If you are not + running it now, please switch over, replacing the kernel option + SCHED_4BSD with SCHED_ULE. + 20031213: src/lib/libc/gen/initgroups.c:1.8 now causes logins to fail if the login process is unable to successfully set the @@ -1451,4 +1459,4 @@ Contact Warner Losh if you have any questions about your use of this document. -$FreeBSD: src/UPDATING,v 1.285 2003/12/15 19:19:16 jhb Exp $ +$FreeBSD: src/UPDATING,v 1.286 2004/01/26 09:57:04 ale Exp $ ==== //depot/projects/hammer/bin/kill/kill.c#3 (text+ko) ==== @@ -43,7 +43,7 @@ #endif /* not lint */ #endif #include -__FBSDID("$FreeBSD: src/bin/kill/kill.c,v 1.16 2003/05/01 16:58:55 obrien Exp $"); +__FBSDID("$FreeBSD: src/bin/kill/kill.c,v 1.17 2004/01/28 19:04:14 njl Exp $"); #include #include @@ -82,7 +82,7 @@ errx(1, "illegal signal number: %s", *argv); if (numsig >= 128) numsig -= 128; - if (numsig <= 0 || numsig >= NSIG) + if (numsig <= 0 || numsig >= sys_nsig) nosig(*argv); printf("%s\n", sys_signame[numsig]); exit(0); @@ -112,7 +112,7 @@ numsig = strtol(*argv, &ep, 10); if (!**argv || *ep) errx(1, "illegal signal number: %s", *argv); - if (numsig < 0 || numsig >= NSIG) + if (numsig < 0 || numsig >= sys_nsig) nosig(*argv); } else nosig(*argv); @@ -146,7 +146,7 @@ if (!strncasecmp(sig, "sig", (size_t)3)) sig += 3; - for (n = 1; n < NSIG; n++) { + for (n = 1; n < sys_nsig; n++) { if (!strcasecmp(sys_signame[n], sig)) return (n); } @@ -167,9 +167,9 @@ { int n; - for (n = 1; n < NSIG; n++) { + for (n = 1; n < sys_nsig; n++) { (void)fprintf(fp, "%s", sys_signame[n]); - if (n == (NSIG / 2) || n == (NSIG - 1)) + if (n == (sys_nsig / 2) || n == (sys_nsig - 1)) (void)fprintf(fp, "\n"); else (void)fprintf(fp, " "); ==== //depot/projects/hammer/bin/sh/eval.c#6 (text+ko) ==== @@ -40,7 +40,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/sh/eval.c,v 1.40 2004/01/21 12:50:01 des Exp $"); +__FBSDID("$FreeBSD: src/bin/sh/eval.c,v 1.41 2004/01/28 18:22:19 cracauer Exp $"); #include #include @@ -273,7 +273,8 @@ if (pendingsigs) dotrap(); if ((flags & EV_EXIT) || (eflag && exitstatus - && !(flags & EV_TESTED) && (n->type == NCMD))) + && !(flags & EV_TESTED) && (n->type == NCMD || + n->type == NSUBSHELL))) exitshell(exitstatus); } ==== //depot/projects/hammer/bin/sh/jobs.c#8 (text+ko) ==== @@ -40,7 +40,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/sh/jobs.c,v 1.64 2003/07/05 15:18:44 dds Exp $"); +__FBSDID("$FreeBSD: src/bin/sh/jobs.c,v 1.65 2004/01/28 19:01:10 njl Exp $"); #include #include @@ -362,7 +362,7 @@ else #endif i = WTERMSIG(ps->status); - if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F]) + if ((i & 0x7F) < sys_nsig && sys_siglist[i & 0x7F]) scopy(sys_siglist[i & 0x7F], s); else fmtstr(s, 64, "Signal %d", i & 0x7F); @@ -985,7 +985,7 @@ if (!mflag || (thisjob->foreground && !WIFSTOPPED(status))) { i = WTERMSIG(status); - if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F]) + if ((i & 0x7F) < sys_nsig && sys_siglist[i & 0x7F]) out1str(sys_siglist[i & 0x7F]); else out1fmt("Signal %d", i & 0x7F); ==== //depot/projects/hammer/bin/sh/trap.c#2 (text+ko) ==== @@ -40,7 +40,7 @@ #endif #endif /* not lint */ #include -__FBSDID("$FreeBSD: src/bin/sh/trap.c,v 1.25 2002/07/24 02:06:07 tjr Exp $"); +__FBSDID("$FreeBSD: src/bin/sh/trap.c,v 1.26 2004/01/28 19:01:10 njl Exp $"); #include #include @@ -106,8 +106,8 @@ if (strncasecmp(sig, "sig", 3) == 0) sig += 3; - for (n = 1; n < NSIG; n++) - if (strcasecmp(sys_signame[n], sig) == 0) + for (n = 1; n < sys_nsig; n++) + if (sys_signame[n] && strcasecmp(sys_signame[n], sig) == 0) return (n); } return (-1); @@ -122,7 +122,7 @@ { int n; - for (n = 1; n < NSIG; n++) { + for (n = 1; n < sys_nsig; n++) { out1fmt("%s", sys_signame[n]); if (n == (NSIG / 2) || n == (NSIG - 1)) out1str("\n"); @@ -142,7 +142,7 @@ int signo; if (argc <= 1) { - for (signo = 0 ; signo < NSIG ; signo++) { + for (signo = 0 ; signo < sys_nsig ; signo++) { if (trap[signo] != NULL) out1fmt("trap -- '%s' %s\n", trap[signo], (signo) ? sys_signame[signo] : "exit"); ==== //depot/projects/hammer/contrib/bsnmp/FREEBSD-upgrade#2 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/contrib/bsnmp/FREEBSD-upgrade,v 1.1 2003/11/10 08:56:56 harti Exp $ +$FreeBSD: src/contrib/bsnmp/FREEBSD-upgrade,v 1.2 2004/01/26 10:28:31 harti Exp $ This is the Begemot micro-SNMP daemon. It is the base for the ILMI daemon for ngATM. Be careful to feed changes back to the maintainer @@ -17,9 +17,6 @@ 4. resolve conflicts - 5. regenerate files in src/usr.sbin/bsnmpd/bsnmpd and - src/lib/libbsnmp/modules/* - - 6. commit changed files + 5. check the makefile in lib/libbsnmp and usr.sbin/bsnmp harti ==== //depot/projects/hammer/contrib/bsnmp/NEWS#2 (text+ko) ==== @@ -1,3 +1,24 @@ +09-Dec-2003 + First step on factoring out the transport mapping stuff into + loadable modules. + + Local stream sockets that check the clients privileges. + +03-Dec-2003 + Bump version to 1.5 but leave library version intact. + +03-Dec-2003 + Now works with libbegemot polling stuff instead of libisc. + Use --with-libbegemot[=path] to configure. + +03-Dec-2003 + Fix parsing of non-minimal ASN.1 integers. They are now disallowed. + Non-minimal lengths are allowed. + + Remove copyright clause 3 everywhere. + + Make an autoconf build infrastructure. + 08-Nov-2003 WARNS=6 fixed. ==== //depot/projects/hammer/contrib/bsnmp/README#2 (text+ko) ==== @@ -1,4 +1,4 @@ -Mon Nov 10 09:50:22 CET 2003 +Fri Dec 5 15:01:16 CET 2003 This is a mini-SNMP daemon. The basic daemon implements the system group and a number of private extensions to manage the UDP transport mapping, @@ -13,16 +13,16 @@ Installation ------------ -You need to apply the patch in the patches directory to your system sources. -This adds a sysctl to retrieve multicast address information from the kernel. - As usual by doing: - make obj ; make depend ; make ; make install + configure [--with-libbegemot[=path]] + make + make install This does not install a configuration file. The standard location for the configuration is /etc/snmpd.config, but can be overwritten on the command -line. An example configuration file is provided. +line. An example configuration file is provided. Use --with-libbegemot +to use libbegemot instead of libisc. Running ------- ==== //depot/projects/hammer/contrib/bsnmp/TODO#2 (text+ko) ==== @@ -1,5 +1,17 @@ snmpd_mibII: - handle HC counters by periodically polling the kernel counters. -snmpd_netgraph: - - make some tables writeable +snmpd: + - rethink transports a little bit: make them loadable and make + a private subtree for transports: + OK. Table not writeable yet. + + There should be a transport table that is indexed by the transport name. + This table can be used to load/unload transports at run time. + OK. Table not writeable yet. + + Then there can be a port table that is indexed by transport name and + port name. Plus a transport-specific table indexed by port name only. + + The transport table could contain a column of type OID that points + to the transport-specific table. ==== //depot/projects/hammer/contrib/bsnmp/VERSION#2 (text+ko) ==== @@ -1,1 +1,1 @@ -1.4 +1.5a ==== //depot/projects/hammer/contrib/bsnmp/gensnmptree/gensnmptree.1#2 (text+ko) ==== @@ -28,7 +28,7 @@ .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Begemot: bsnmp/gensnmptree/gensnmptree.1,v 1.1 2002/08/15 13:27:44 hbb Exp $ +.\" $Begemot: bsnmp/gensnmptree/gensnmptree.1,v 1.2 2003/12/03 09:56:57 hbb Exp $ .\" .\" Author: Harti Brandt .\" ==== //depot/projects/hammer/contrib/bsnmp/gensnmptree/gensnmptree.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.34 2003/01/28 13:44:34 hbb Exp $ + * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.36 2003/12/03 09:56:57 hbb Exp $ * * Generate OID table from table description. * ==== //depot/projects/hammer/contrib/bsnmp/lib/asn1.3#2 (text+ko) ==== @@ -30,7 +30,7 @@ .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Begemot: bsnmp/lib/asn1.3,v 1.2 2002/08/16 10:02:53 hbb Exp $ +.\" $Begemot: bsnmp/lib/asn1.3,v 1.3 2003/12/02 15:45:48 hbb Exp $ .\" .Dd August 15, 2002 .Dt asn1 3 ==== //depot/projects/hammer/contrib/bsnmp/lib/asn1.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Begemot: bsnmp/lib/asn1.c,v 1.24 2003/01/28 13:44:34 hbb Exp $ + * $Begemot: bsnmp/lib/asn1.c,v 1.27 2003/12/08 17:11:58 hbb Exp $ * * ASN.1 for SNMP. */ @@ -244,6 +244,13 @@ err = ASN_ERR_OK; if (len > 8) err = ASN_ERR_RANGE; + else if (len > 1 && + ((*b->asn_cptr == 0x00 && (b->asn_cptr[1] & 0x80) == 0) || + (*b->asn_cptr == 0xff && (b->asn_cptr[1] & 0x80) == 0x80))) { + asn_error(b, "non-minimal integer"); + err = ASN_ERR_BADLEN; + } + if (*b->asn_cptr & 0x80) neg = 1; val = 0; @@ -332,6 +339,10 @@ /* negative integer or too larger */ *vp = 0xffffffffffffffffULL; err = ASN_ERR_RANGE; + } else if (len > 1 && + *b->asn_cptr == 0x00 && (b->asn_cptr[1] & 0x80) == 0) { + asn_error(b, "non-minimal unsigned"); + err = ASN_ERR_BADLEN; } while (len--) { @@ -718,7 +729,6 @@ return (ASN_ERR_OK); } - /* * Application types * ==== //depot/projects/hammer/contrib/bsnmp/lib/asn1.h#2 (text+ko) ==== @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Begemot: bsnmp/lib/asn1.h,v 1.16 2002/02/11 10:19:57 hbb Exp $ + * $Begemot: bsnmp/lib/asn1.h,v 1.17 2003/12/02 15:52:37 hbb Exp $ * * ASN.1 for SNMP */ ==== //depot/projects/hammer/contrib/bsnmp/lib/bsnmpagent.3#2 (text+ko) ==== @@ -30,7 +30,7 @@ .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Begemot: bsnmp/lib/bsnmpagent.3,v 1.1 2002/08/16 12:22:58 hbb Exp $ +.\" $Begemot: bsnmp/lib/bsnmpagent.3,v 1.2 2003/12/02 16:13:45 hbb Exp $ .\" .Dd August 16, 2002 .Dt bsnmpagent 3 ==== //depot/projects/hammer/contrib/bsnmp/lib/bsnmpclient.3#2 (text+ko) ==== @@ -30,7 +30,7 @@ .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Begemot: bsnmp/lib/bsnmpclient.3,v 1.3 2002/12/11 15:54:07 hbb Exp $ +.\" $Begemot: bsnmp/lib/bsnmpclient.3,v 1.5 2003/12/08 17:11:58 hbb Exp $ .\" .Dd August 15, 2002 .Dt bsnmpclient 3 @@ -107,7 +107,7 @@ .Bd -literal -offset indent struct snmp_client { enum snmp_version version; - int local; /* use local socket */ + int trans; /* transport type to use */ /* these two are read-only for the application */ char *cport; /* port number as string */ @@ -147,13 +147,19 @@ .Xr bsnmplib 3 for applicable values. The default version is .Li SNMP_V2c . -.It Va local -If this is set to true, the library opens a -.Ux -domain socket rather than -an UDP socket. It uses the +.It Va trans +If this is +.Dv SNMP_TRANS_LOC_DGRAM +a local datagram socket is used. +If it is +.Dv SNMP_TRANS_LOC_STREAM +a local stream socket is used. +For +.Dv SNMP_TRANS_UDP +a UDP socket is created. +It uses the .Va chost -field as the path to the server's socket. +field as the path to the server's socket for local sockets. .It Va cport The SNMP agent's UDP port number. This may be a symbolic port number (from .Pa /etc/services ==== //depot/projects/hammer/contrib/bsnmp/lib/bsnmplib.3#2 (text+ko) ==== @@ -30,7 +30,7 @@ .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Begemot: bsnmp/lib/bsnmplib.3,v 1.2 2002/08/16 10:02:53 hbb Exp $ +.\" $Begemot: bsnmp/lib/bsnmplib.3,v 1.3 2003/12/02 16:14:28 hbb Exp $ .\" .Dd August 15, 2002 .Dt bsnmplib 3 ==== //depot/projects/hammer/contrib/bsnmp/lib/snmp.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Begemot: bsnmp/lib/snmp.c,v 1.34 2003/01/28 13:44:34 hbb Exp $ + * $Begemot: bsnmp/lib/snmp.c,v 1.37 2003/12/08 17:11:58 hbb Exp $ * * SNMP */ @@ -432,6 +432,64 @@ } /* + * Check whether what we have is the complete PDU by snooping at the + * enclosing structure header. This returns: + * -1 if there are ASN.1 errors + * 0 if we need more data + * > 0 the length of this PDU + */ +int +snmp_pdu_snoop(const struct asn_buf *b0) +{ + u_int length; + asn_len_t len; + struct asn_buf b = *b0; + + /* <0x10|0x20> */ + + if (b.asn_len == 0) + return (0); + if (b.asn_cptr[0] != (ASN_TYPE_SEQUENCE | ASN_TYPE_CONSTRUCTED)) { + asn_error(&b, "bad sequence type %u", b.asn_cptr[0]); + return (-1); + } + b.asn_len--; + b.asn_cptr++; + + if (b.asn_len == 0) + return (0); + + if (*b.asn_cptr & 0x80) { + /* long length */ + length = *b.asn_cptr++ & 0x7f; + b.asn_len--; + if (length == 0) { + asn_error(&b, "indefinite length not supported"); + return (-1); + } + if (length > ASN_MAXLENLEN) { + asn_error(&b, "long length too long (%u)", length); + return (-1); + } + if (length > b.asn_len) + return (0); + len = 0; + while (length--) { + len = (len << 8) | *b.asn_cptr++; + b.asn_len--; + } + } else { + len = *b.asn_cptr++; + b.asn_len--; + } + + if (len > b.asn_len) + return (0); + + return (len + b.asn_cptr - b0->asn_cptr); +} + +/* * Encode the SNMP PDU without the variable bindings field. * We do this the rather uneffective way by * moving things around and assuming that the length field will never ==== //depot/projects/hammer/contrib/bsnmp/lib/snmp.h#2 (text+ko) ==== @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Begemot: bsnmp/lib/snmp.h,v 1.27 2002/03/08 14:24:58 hbb Exp $ + * $Begemot: bsnmp/lib/snmp.h,v 1.29 2003/12/08 17:11:58 hbb Exp $ * * Header file for SNMP functions. */ @@ -164,6 +164,8 @@ enum snmp_code snmp_pdu_decode(struct asn_buf *b, struct snmp_pdu *pdu, int32_t *); enum snmp_code snmp_pdu_encode(struct snmp_pdu *pdu, struct asn_buf *resp_b); +int snmp_pdu_snoop(const struct asn_buf *); + void snmp_pdu_dump(const struct snmp_pdu *pdu); extern void (*snmp_error)(const char *, ...); ==== //depot/projects/hammer/contrib/bsnmp/lib/snmpagent.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Begemot: bsnmp/lib/snmpagent.c,v 1.14 2003/01/30 11:23:00 hbb Exp $ + * $Begemot: bsnmp/lib/snmpagent.c,v 1.16 2003/12/03 09:55:58 hbb Exp $ * * SNMP Agent functions */ ==== //depot/projects/hammer/contrib/bsnmp/lib/snmpagent.h#2 (text+ko) ==== @@ -30,7 +30,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Jan 28 16:29:18 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AB8CD16A4D0; Wed, 28 Jan 2004 16:29:18 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8597216A4CE for ; Wed, 28 Jan 2004 16:29:18 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C265D43D1D for ; Wed, 28 Jan 2004 16:29:16 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0T0TG0B022815 for ; Wed, 28 Jan 2004 16:29:16 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0T0TGNN022809 for perforce@freebsd.org; Wed, 28 Jan 2004 16:29:16 -0800 (PST) (envelope-from peter@freebsd.org) Date: Wed, 28 Jan 2004 16:29:16 -0800 (PST) Message-Id: <200401290029.i0T0TGNN022809@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 46101 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 00:29:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=46101 Change 46101 by peter@peter_daintree on 2004/01/28 16:28:45 p4 integ -I -b i386_hammer Affected files ... .. //depot/projects/hammer/sys/amd64/acpica/madt.c#28 integrate .. //depot/projects/hammer/sys/amd64/amd64/apic_vector.S#14 integrate .. //depot/projects/hammer/sys/amd64/amd64/identcpu.c#19 integrate .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#31 integrate .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#54 integrate .. //depot/projects/hammer/sys/amd64/amd64/pmap.c#53 integrate .. //depot/projects/hammer/sys/amd64/amd64/trap.c#38 integrate .. //depot/projects/hammer/sys/amd64/conf/GENERIC#29 integrate .. //depot/projects/hammer/sys/amd64/isa/atpic_vector.S#12 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/acpica/madt.c#28 (text+ko) ==== @@ -320,13 +320,22 @@ } /* - * Run through the MP table enumerating I/O APICs. + * Enumerate I/O APICs and setup interrupt sources. */ static int madt_setup_io(void) { int i; + /* Try to initialize ACPI so that we can access the FADT. */ + i = acpi_Startup(); + if (ACPI_FAILURE(i)) { + printf("MADT: ACPI Startup failed with %s\n", + AcpiFormatException(i)); + printf("Try disabling either ACPI or apic support.\n"); + panic("Using MADT but ACPI doesn't work"); + } + /* First, we run through adding I/O APIC's. */ madt_walk_table(madt_parse_apics, NULL); @@ -523,6 +532,7 @@ { void *new_ioapic, *old_ioapic; u_int new_pin, old_pin; + int force_lo; if (bootverbose) printf("MADT: intr override: source %u, irq %u\n", @@ -535,9 +545,27 @@ return; } + /* + * If the SCI is remapped to a non-ISA global interrupt, + * force it to level trigger and active-lo polarity. + * If the SCI is identity mapped but has edge trigger and + * active-hi polarity, also force it to use level/lo. + */ + force_lo = 0; + if (intr->Source == AcpiGbl_FADT->SciInt) + if (intr->Interrupt > 15 || (intr->Interrupt == intr->Source && + intr->TriggerMode == TRIGGER_EDGE && + intr->Polarity == POLARITY_ACTIVE_HIGH)) + force_lo = 1; + if (intr->Source != intr->Interrupt) { - /* XXX: This assumes that the SCI uses IRQ 9. */ - if (intr->Interrupt > 15 && intr->Source == 9) + /* + * If the SCI is remapped to a non-ISA global interrupt, + * then override the vector we use to setup and allocate + * the interrupt. + */ + if (intr->Interrupt > 15 && + intr->Source == AcpiGbl_FADT->SciInt) acpi_OverrideInterruptLevel(intr->Interrupt); else ioapic_remap_vector(new_ioapic, new_pin, intr->Source); @@ -549,10 +577,18 @@ intr->Source) ioapic_disable_pin(old_ioapic, old_pin); } - ioapic_set_triggermode(new_ioapic, new_pin, - interrupt_trigger(intr->TriggerMode)); - ioapic_set_polarity(new_ioapic, new_pin, - interrupt_polarity(intr->Polarity)); + if (force_lo) { + printf( + "MADT: Forcing active-lo polarity and level trigger for IRQ %d\n", + intr->Source); + ioapic_set_polarity(new_ioapic, new_pin, 0); + ioapic_set_triggermode(new_ioapic, new_pin, 0); + } else { + ioapic_set_polarity(new_ioapic, new_pin, + interrupt_polarity(intr->Polarity)); + ioapic_set_triggermode(new_ioapic, new_pin, + interrupt_trigger(intr->TriggerMode)); + } } /* ==== //depot/projects/hammer/sys/amd64/amd64/apic_vector.S#14 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/identcpu.c#19 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#31 (text+ko) ==== @@ -643,7 +643,6 @@ * private the sys/i386 code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ -#define DETECT_DEADLOCK int lapic_ipi_wait(int delay) ==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#54 (text+ko) ==== @@ -80,8 +80,8 @@ /* * CPU topology map datastructures for HTT. */ -struct cpu_group mp_groups[MAXCPU]; -struct cpu_top mp_top; +static struct cpu_group mp_groups[MAXCPU]; +static struct cpu_top mp_top; /* AP uses this during bootstrap. Do not staticize. */ char *bootSTK; ==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#53 (text+ko) ==== @@ -117,6 +117,7 @@ #include #include #include +#include #include #ifdef SMP #include ==== //depot/projects/hammer/sys/amd64/amd64/trap.c#38 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/conf/GENERIC#29 (text+ko) ==== ==== //depot/projects/hammer/sys/amd64/isa/atpic_vector.S#12 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Wed Jan 28 17:36:43 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 10F8B16A4D0; Wed, 28 Jan 2004 17:36:43 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E10E316A4CE for ; Wed, 28 Jan 2004 17:36:42 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B96443D2F for ; Wed, 28 Jan 2004 17:36:42 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0T1af0B044081 for ; Wed, 28 Jan 2004 17:36:41 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0T1afCU044078 for perforce@freebsd.org; Wed, 28 Jan 2004 17:36:41 -0800 (PST) (envelope-from sam@freebsd.org) Date: Wed, 28 Jan 2004 17:36:41 -0800 (PST) Message-Id: <200401290136.i0T1afCU044078@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46107 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 01:36:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=46107 Change 46107 by sam@sam_ebb on 2004/01/28 17:36:25 add an AUTO authentication mode token for future use Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.h#8 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.h#8 (text+ko) ==== @@ -532,6 +532,7 @@ IEEE80211_AUTH_NONE = 0, IEEE80211_AUTH_OPEN = 1, IEEE80211_AUTH_SHARED = 2, + IEEE80211_AUTH_AUTO = 3, /* auto-select/accept */ }; #endif /* _NET80211_IEEE80211_H_ */ From owner-p4-projects@FreeBSD.ORG Wed Jan 28 17:39:03 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 94DB216A4D0; Wed, 28 Jan 2004 17:39:03 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FD4216A4CE for ; Wed, 28 Jan 2004 17:39:03 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A0A343D46 for ; Wed, 28 Jan 2004 17:38:45 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0T1cj0B044141 for ; Wed, 28 Jan 2004 17:38:45 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0T1ciXo044138 for perforce@freebsd.org; Wed, 28 Jan 2004 17:38:44 -0800 (PST) (envelope-from sam@freebsd.org) Date: Wed, 28 Jan 2004 17:38:44 -0800 (PST) Message-Id: <200401290138.i0T1ciXo044138@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46108 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 01:39:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=46108 Change 46108 by sam@sam_ebb on 2004/01/28 17:38:15 o add error status reponses for error conditions encountered in shared key authentication o hack the ieee80211_send_mgmt so the arg parameter for AUTH frames is interpreted to have the status code in the upper 16 bits; this allows error status codes to be returned w/o modifying any existing code Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#9 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#9 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#9 (text+ko) ==== @@ -752,19 +752,27 @@ } } -/* TBD send appropriate responses on error? */ static void ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh, u_int8_t *frm, u_int8_t *efrm, struct ieee80211_node *ni, int rssi, u_int32_t rstamp, u_int16_t seq, u_int16_t status) { u_int8_t *challenge = NULL; - int allocbs, i; + int allocbs, i, estatus; if ((ic->ic_flags & IEEE80211_F_WEPON) == 0) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: WEP is off\n", __func__)); - return; + estatus = IEEE80211_STATUS_ALG; + goto bad; + } + if (ic->ic_authmode != IEEE80211_AUTH_AUTO && + ic->ic_authmode != IEEE80211_AUTH_SHARED) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, + ("%s: operating in %u mode, reject\n", + __func__, ic->ic_authmode)); + estatus = IEEE80211_STATUS_ALG; + goto bad; } if (frm + 1 < efrm) { @@ -773,7 +781,8 @@ ("%s: elt %d %d bytes too long\n", __func__, frm[0], (frm[1] + 2) - (efrm - frm))); ic->ic_stats.is_rx_bad_auth++; - return; + estatus = IEEE80211_STATUS_CHALLENGE; + goto bad; } if (*frm == IEEE80211_ELEMID_CHALLENGE) challenge = frm; @@ -786,14 +795,16 @@ IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: no challenge sent\n", __func__)); ic->ic_stats.is_rx_bad_auth++; - return; + estatus = IEEE80211_STATUS_CHALLENGE; + goto bad; } if (challenge[1] != IEEE80211_CHALLENGE_LEN) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: bad challenge len %d\n", __func__, challenge[1])); ic->ic_stats.is_rx_bad_auth++; - return; + estatus = IEEE80211_STATUS_CHALLENGE; + goto bad; } default: break; @@ -809,7 +820,8 @@ if (ic->ic_state != IEEE80211_S_RUN) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: not running\n", __func__)); - return; + estatus = IEEE80211_STATUS_ALG; /* XXX */ + goto bad; } switch (seq) { case IEEE80211_AUTH_SHARED_REQUEST: @@ -817,6 +829,7 @@ ni = ieee80211_alloc_node(ic, wh->i_addr2); if (ni == NULL) { ic->ic_stats.is_rx_nodealloc++; + /* NB: no way to return an error */ return; } IEEE80211_ADDR_COPY(ni->ni_bssid, @@ -836,6 +849,7 @@ ("%s: challenge alloc failed\n", __func__)); /* XXX statistic */ + /* NB: don't return error so they rexmit */ return; } for (i = IEEE80211_CHALLENGE_LEN / sizeof(u_int32_t); @@ -851,6 +865,7 @@ if (ni == ic->ic_bss) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: unknown STA\n", __func__)); + /* NB: don't send a response */ return; } allocbs = 1; @@ -858,14 +873,16 @@ IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: no challenge recorded\n", __func__)); ic->ic_stats.is_rx_bad_auth++; - return; + estatus = IEEE80211_STATUS_CHALLENGE; + goto bad; } if (memcmp(ni->ni_challenge, &challenge[2], challenge[1]) != 0) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: challenge mismatch\n", __func__)); ic->ic_stats.is_rx_auth_fail++; - return; + estatus = IEEE80211_STATUS_CHALLENGE; + goto bad; } IEEE80211_DPRINTF(ic, IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, @@ -877,7 +894,8 @@ ("%s: bad shared key auth seq %d from %s\n", __func__, seq, ether_sprintf(wh->i_addr2))); ic->ic_stats.is_rx_bad_auth++; - return; + estatus = IEEE80211_STATUS_SEQUENCE; + goto bad; } IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); @@ -930,6 +948,17 @@ } break; } + return; +bad: + /* + * Send an error response; but only when operating as an AP. + */ + if (ic->ic_opmode == IEEE80211_M_HOSTAP) { + /* XXX hack to workaround calling convention */ + IEEE80211_SEND_MGMT(ic, ni, + IEEE80211_FC0_SUBTYPE_AUTH, + (seq + 1) | (estatus<<16)); + } } /* Verify the existence and length of __elem or get out. */ @@ -1283,6 +1312,12 @@ ("%s: unsupported auth algorithm %d from %s\n", __func__, algo, ether_sprintf(wh->i_addr2))); ic->ic_stats.is_rx_auth_unsupported++; + if (ic->ic_opmode == IEEE80211_M_HOSTAP) { + /* XXX not right */ + IEEE80211_SEND_MGMT(ic, ni, + IEEE80211_FC0_SUBTYPE_AUTH, + (seq+1) | (IEEE80211_STATUS_ALG<<16)); + } return; } break; ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#9 (text+ko) ==== @@ -317,7 +317,7 @@ u_int8_t *frm; enum ieee80211_phymode mode; u_int16_t capinfo; - int has_challenge, is_shared_key, ret, timer; + int has_challenge, is_shared_key, ret, timer, status; KASSERT(ni != NULL, ("null node")); @@ -428,6 +428,8 @@ break; case IEEE80211_FC0_SUBTYPE_AUTH: + status = arg >> 16; + arg &= 0xffff; has_challenge = ((arg == IEEE80211_AUTH_SHARED_CHALLENGE || arg == IEEE80211_AUTH_SHARED_RESPONSE) && ni->ni_challenge != NULL); @@ -446,7 +448,7 @@ m = ieee80211_getmgtframe(&frm, 3 * sizeof(u_int16_t) - + (has_challenge ? + + (has_challenge && status == IEEE80211_STATUS_SUCCESS ? sizeof(u_int16_t)+IEEE80211_CHALLENGE_LEN : 0)); if (m == NULL) senderr(ENOMEM, is_tx_nobuf); @@ -455,9 +457,9 @@ (is_shared_key) ? htole16(IEEE80211_AUTH_ALG_SHARED) : htole16(IEEE80211_AUTH_ALG_OPEN); ((u_int16_t *)frm)[1] = htole16(arg); /* sequence number */ - ((u_int16_t *)frm)[2] = 0; /* status */ + ((u_int16_t *)frm)[2] = htole16(status);/* status */ - if (has_challenge) { + if (has_challenge && status == IEEE80211_STATUS_SUCCESS) { ((u_int16_t *)frm)[3] = htole16((IEEE80211_CHALLENGE_LEN << 8) | IEEE80211_ELEMID_CHALLENGE); From owner-p4-projects@FreeBSD.ORG Wed Jan 28 21:19:17 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7602F16A4D0; Wed, 28 Jan 2004 21:19:17 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A39016A4CE for ; Wed, 28 Jan 2004 21:19:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4332D43D39 for ; Wed, 28 Jan 2004 21:19:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0T5JG0B098922 for ; Wed, 28 Jan 2004 21:19:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0T5JFUS098919 for perforce@freebsd.org; Wed, 28 Jan 2004 21:19:15 -0800 (PST) (envelope-from sam@freebsd.org) Date: Wed, 28 Jan 2004 21:19:15 -0800 (PST) Message-Id: <200401290519.i0T5JFUS098919@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46112 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 05:19:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=46112 Change 46112 by sam@sam_ebb on 2004/01/28 21:18:17 cleanup includes Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.c#2 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.h#3 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.c#2 (text+ko) ==== @@ -28,7 +28,16 @@ #include __FBSDID("$FreeBSD: src/sys/net80211/ieee80211.c,v 1.9 2004/01/15 08:44:27 onoe Exp $"); -#include +#include +#include +#include +#include +#include + +#include + +#include +#include struct mbuf * ieee80211_getmgtframe(u_int8_t **frm, u_int pktlen) ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.h#3 (text+ko) ==== @@ -29,37 +29,6 @@ #ifndef _NET80211_IEEE80211_FREEBSD_H_ #define _NET80211_IEEE80211_FREEBSD_H_ -#include "opt_inet.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#ifdef INET -#include -#include -#endif - #define NBPFILTER 1 /* always enabled */ /* From owner-p4-projects@FreeBSD.ORG Thu Jan 29 06:54:59 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2C2E16A4D0; Thu, 29 Jan 2004 06:54:59 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A22716A4CE for ; Thu, 29 Jan 2004 06:54:59 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B356B43D39 for ; Thu, 29 Jan 2004 06:54:58 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0TEsw0B076049 for ; Thu, 29 Jan 2004 06:54:58 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0TEswGZ076046 for perforce@freebsd.org; Thu, 29 Jan 2004 06:54:58 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Thu, 29 Jan 2004 06:54:58 -0800 (PST) Message-Id: <200401291454.i0TEswGZ076046@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46127 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 14:55:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=46127 Change 46127 by jhb@jhb_slimer on 2004/01/29 06:54:13 Move the enable of the interrupt source just a bit earlier. Affected files ... .. //depot/projects/smpng/sys/kern/kern_intr.c#39 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_intr.c#39 (text+ko) ==== @@ -548,13 +548,12 @@ if ((ih->ih_flags & IH_MPSAFE) == 0) mtx_unlock(&Giant); } + if (ithd->it_enable != NULL) + ithd->it_enable(ithd->it_vector); } WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); mtx_assert(&Giant, MA_NOTOWNED); - if (ithd->it_enable != NULL) - ithd->it_enable(ithd->it_vector); - /* * Processed all our interrupts. Now get the sched * lock. This may take a while and it_need may get From owner-p4-projects@FreeBSD.ORG Thu Jan 29 07:24:49 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5FB3016A4D0; Thu, 29 Jan 2004 07:24:49 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 345EC16A4CE for ; Thu, 29 Jan 2004 07:24:49 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29A7243D41 for ; Thu, 29 Jan 2004 07:24:42 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0TFOf0B083157 for ; Thu, 29 Jan 2004 07:24:41 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0TFOfCu083148 for perforce@freebsd.org; Thu, 29 Jan 2004 07:24:41 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Thu, 29 Jan 2004 07:24:41 -0800 (PST) Message-Id: <200401291524.i0TFOfCu083148@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46130 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 15:24:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=46130 Change 46130 by jhb@jhb_slimer on 2004/01/29 07:23:40 Implement simple throttling for interrupt storms. Affected files ... .. //depot/projects/smpng/sys/kern/kern_intr.c#40 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_intr.c#40 (text+ko) ==== @@ -72,6 +72,11 @@ static void ithread_loop(void *); static void start_softintr(void *); +static int intr_storm_threshold = 500; +TUNABLE_INT("hw.intr_storm_threshold", &intr_storm_threshold); +SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RW, &intr_storm_threshold, 0, + "Number of consecutive interrupts before interrupt storm protection is enabled."); + u_char ithread_priority(enum intr_type flags) { @@ -488,12 +493,15 @@ struct intrhand *ih; /* and our interrupt handler chain */ struct thread *td; struct proc *p; + int count, warned; td = curthread; p = td->td_proc; ithd = (struct ithd *)arg; /* point to myself */ KASSERT(ithd->it_td == td && td->td_ithd == ithd, ("%s: ithread and proc linkage out of sync", __func__)); + count = 0; + warned = 0; /* * As long as we have interrupts outstanding, go through the @@ -523,6 +531,22 @@ * another pass. */ atomic_store_rel_int(&ithd->it_need, 0); + + /* + * If we detect an interrupt storm, pause with the source masked + * for 1/10th of a second. + */ + if (count >= intr_storm_threshold) { + if (!warned) { + printf( + "Interrupt storm detected on \"%s\", throttling interrupt source\n", + p->p_comm); + warned = 1; + } + tsleep(&count, td->td_priority, "throttle", hz / 10); + count = 0; + } else + count++; restart: TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) { if (ithd->it_flags & IT_SOFT && !ih->ih_need) @@ -562,6 +586,7 @@ mtx_lock_spin(&sched_lock); if (!ithd->it_need) { TD_SET_IWAIT(td); + count = 0; CTR2(KTR_INTR, "%s: pid %d: done", __func__, p->p_pid); mi_switch(SW_VOL); CTR2(KTR_INTR, "%s: pid %d: resumed", __func__, p->p_pid); From owner-p4-projects@FreeBSD.ORG Thu Jan 29 09:06:51 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A055A16A4D0; Thu, 29 Jan 2004 09:06:51 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74AF716A4CE for ; Thu, 29 Jan 2004 09:06:51 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B88243D45 for ; Thu, 29 Jan 2004 09:06:50 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0TH6o0B042521 for ; Thu, 29 Jan 2004 09:06:50 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0TH6o1l042518 for perforce@freebsd.org; Thu, 29 Jan 2004 09:06:50 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Thu, 29 Jan 2004 09:06:50 -0800 (PST) Message-Id: <200401291706.i0TH6o1l042518@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46137 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 17:06:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=46137 Change 46137 by jhb@jhb_slimer on 2004/01/29 09:06:47 Threshold of 0 disables throttling. Affected files ... .. //depot/projects/smpng/sys/kern/kern_intr.c#41 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_intr.c#41 (text+ko) ==== @@ -536,7 +536,7 @@ * If we detect an interrupt storm, pause with the source masked * for 1/10th of a second. */ - if (count >= intr_storm_threshold) { + if (intr_storm_threshold != 0 && count >= intr_storm_threshold) { if (!warned) { printf( "Interrupt storm detected on \"%s\", throttling interrupt source\n", From owner-p4-projects@FreeBSD.ORG Thu Jan 29 10:40:32 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F387516A4D0; Thu, 29 Jan 2004 10:40:31 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B414F16A4CE for ; Thu, 29 Jan 2004 10:40:31 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16B2843D3F for ; Thu, 29 Jan 2004 10:39:52 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0TIdp0B063823 for ; Thu, 29 Jan 2004 10:39:51 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0TIdp6C063820 for perforce@freebsd.org; Thu, 29 Jan 2004 10:39:51 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Thu, 29 Jan 2004 10:39:51 -0800 (PST) Message-Id: <200401291839.i0TIdp6C063820@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46143 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 18:40:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=46143 Change 46143 by areisse@areisse_ibook on 2004/01/29 10:39:08 branch for bootloader changes Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/bootinfo.hdr#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/Control2.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/MAC-PARTS.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/ci.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/ci_io.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/ci.subproj/sl_words.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/CaseTables.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/HFSCompare.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/cache.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ext2fs.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ext2fs.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_bswap.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_dinode.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_dir.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/fs.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/hfs.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/net.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ufs.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ufs_byteorder.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/fs.subproj/ufs_byteorder.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/boot_args.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/ci.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/device_tree.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/fs.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/libclite.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/sl.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/sl_words.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/bsearch.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/bswap.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/mem.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/prf.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/printf.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/sprintf.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/string.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/strtol.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/libclite.subproj/zalloc.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/appleboot.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/clut.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/device_tree.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/display.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/drivers.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/elf.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/elf.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/failedboot.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/macho.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/main.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/netboot.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/fcode-to-c.tproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/fcode-to-c.tproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/fcode-to-c.tproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/fcode-to-c.tproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/fcode-to-c.tproj/fcode-to-c.c#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/macho-to-xcoff.tproj/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/macho-to-xcoff.tproj/Makefile.postamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/macho-to-xcoff.tproj/Makefile.preamble#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/macho-to-xcoff.tproj/PB.project#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/macho-to-xcoff.tproj/macho-to-xcoff.c#1 branch Differences ... From owner-p4-projects@FreeBSD.ORG Thu Jan 29 14:23:52 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7718C16A4D0; Thu, 29 Jan 2004 14:23:52 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5320016A4CE for ; Thu, 29 Jan 2004 14:23:52 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16DD743D1F for ; Thu, 29 Jan 2004 14:23:32 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0TMNW0B023030 for ; Thu, 29 Jan 2004 14:23:32 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0TMNW8H023027 for perforce@freebsd.org; Thu, 29 Jan 2004 14:23:32 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Thu, 29 Jan 2004 14:23:32 -0800 (PST) Message-Id: <200401292223.i0TMNW8H023027@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46158 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2004 22:23:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=46158 Change 46158 by jhb@jhb_slimer on 2004/01/29 14:22:41 Make this less messy. Affected files ... .. //depot/projects/smpng/sys/kern/kern_synch.c#63 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_synch.c#63 (text+ko) ==== @@ -593,18 +593,16 @@ sx_slock(&allproc_lock); nrun = 0; FOREACH_PROC_IN_SYSTEM(p) { + if ((p->p_flag & P_NOLOAD) != 0) + continue; FOREACH_THREAD_IN_PROC(p, td) { switch (td->td_state) { case TDS_RUNQ: case TDS_RUNNING: - if ((p->p_flag & P_NOLOAD) != 0) - goto nextproc; nrun++; /* XXXKSE */ default: break; } -nextproc: - continue; } } sx_sunlock(&allproc_lock); From owner-p4-projects@FreeBSD.ORG Thu Jan 29 17:59:02 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2B81D16A4D0; Thu, 29 Jan 2004 17:59:02 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF4D616A4CE for ; Thu, 29 Jan 2004 17:59:01 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7485B43D1D for ; Thu, 29 Jan 2004 17:58:58 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0U1ww0B075466 for ; Thu, 29 Jan 2004 17:58:58 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0U1wr6o075463 for perforce@freebsd.org; Thu, 29 Jan 2004 17:58:53 -0800 (PST) (envelope-from peter@freebsd.org) Date: Thu, 29 Jan 2004 17:58:53 -0800 (PST) Message-Id: <200401300158.i0U1wr6o075463@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 46161 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 01:59:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=46161 Change 46161 by peter@peter_daintree on 2004/01/29 17:58:29 IFC @46160 Affected files ... .. //depot/projects/hammer/etc/mtree/BSD.local.dist#14 integrate .. //depot/projects/hammer/etc/mtree/BSD.usr.dist#18 integrate .. //depot/projects/hammer/etc/namedb/named.root#3 integrate .. //depot/projects/hammer/lib/libc/locale/setlocale.3#7 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_kern.c#10 integrate .. //depot/projects/hammer/lib/libthr/thread/thr_rwlock.c#3 integrate .. //depot/projects/hammer/release/Makefile#44 integrate .. //depot/projects/hammer/sbin/mount/mount.8#7 integrate .. //depot/projects/hammer/sbin/mount/mount.c#11 integrate .. //depot/projects/hammer/sbin/routed/Makefile#2 integrate .. //depot/projects/hammer/sbin/sunlabel/Makefile#7 integrate .. //depot/projects/hammer/sbin/sunlabel/sunlabel.8#1 branch .. //depot/projects/hammer/share/colldef/Makefile#11 integrate .. //depot/projects/hammer/share/colldef/kk_KZ.PT154.src#1 branch .. //depot/projects/hammer/share/colldef/map.PT154#1 branch .. //depot/projects/hammer/share/mklocale/Makefile#10 integrate .. //depot/projects/hammer/share/mklocale/kk_KZ.PT154.src#1 branch .. //depot/projects/hammer/share/monetdef/Makefile#10 integrate .. //depot/projects/hammer/share/monetdef/kk_KZ.PT154.src#1 branch .. //depot/projects/hammer/share/msgdef/Makefile#10 integrate .. //depot/projects/hammer/share/msgdef/kk_KZ.PT154.src#1 branch .. //depot/projects/hammer/share/numericdef/Makefile#9 integrate .. //depot/projects/hammer/share/numericdef/kk_KZ.PT154.src#1 branch .. //depot/projects/hammer/share/syscons/keymaps/INDEX.keymaps#8 integrate .. //depot/projects/hammer/share/syscons/keymaps/Makefile#9 integrate .. //depot/projects/hammer/share/syscons/keymaps/kk.pt154.io.kbd#1 branch .. //depot/projects/hammer/share/syscons/keymaps/kk.pt154.kst.kbd#1 branch .. //depot/projects/hammer/share/timedef/Makefile#10 integrate .. //depot/projects/hammer/share/timedef/kk_KZ.PT154.src#1 branch .. //depot/projects/hammer/sys/amd64/acpica/madt.c#29 integrate .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#32 integrate .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#55 integrate .. //depot/projects/hammer/sys/amd64/amd64/pmap.c#54 integrate .. //depot/projects/hammer/sys/conf/files.powerpc#6 integrate .. //depot/projects/hammer/sys/conf/systags.sh#2 integrate .. //depot/projects/hammer/sys/dev/ata/ata-all.h#13 integrate .. //depot/projects/hammer/sys/dev/ata/ata-chipset.c#26 integrate .. //depot/projects/hammer/sys/dev/ata/ata-pci.h#16 integrate .. //depot/projects/hammer/sys/dev/if_ndis/if_ndis.c#6 integrate .. //depot/projects/hammer/sys/dev/isp/isp_target.c#6 integrate .. //depot/projects/hammer/sys/dev/sound/driver.c#2 integrate .. //depot/projects/hammer/sys/i386/conf/GENERIC#19 integrate .. //depot/projects/hammer/sys/i386/conf/NOTES#29 integrate .. //depot/projects/hammer/sys/kern/kern_sig.c#32 integrate .. //depot/projects/hammer/sys/powerpc/include/vmparam.h#2 integrate .. //depot/projects/hammer/sys/powerpc/powerpc/pmap.c#17 integrate .. //depot/projects/hammer/sys/powerpc/powerpc/uma_machdep.c#1 branch .. //depot/projects/hammer/sys/vm/vm_glue.c#21 integrate .. //depot/projects/hammer/tools/regression/atm/Funcs.sh#1 branch .. //depot/projects/hammer/tools/regression/atm/README#1 branch .. //depot/projects/hammer/tools/regression/atm/RunTest.sh#1 branch .. //depot/projects/hammer/tools/regression/atm/harp/atm_udp.ng#1 branch .. //depot/projects/hammer/tools/regression/atm/harp/memory_leak.sh#1 branch .. //depot/projects/hammer/tools/regression/atm/proto_sscfu/RunTest.sh#1 branch .. //depot/projects/hammer/tools/regression/atm/proto_sscop/RunTest.sh#1 branch .. //depot/projects/hammer/tools/regression/atm/proto_uni/RunTest.sh#1 branch .. //depot/projects/hammer/tools/regression/usr.bin/make/Makefile#6 integrate Differences ... ==== //depot/projects/hammer/etc/mtree/BSD.local.dist#14 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.106 2003/12/20 11:05:34 ache Exp $ +# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.107 2004/01/29 16:17:25 ache Exp $ # # Please see the file src/etc/mtree/README before making changes to this file. # @@ -389,6 +389,8 @@ .. ja_JP.eucJP .. + kk_KZ.PT154 + .. ko_KR.CP949 .. ko_KR.eucKR ==== //depot/projects/hammer/etc/mtree/BSD.usr.dist#18 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.291 2004/01/21 13:15:19 ru Exp $ +# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.292 2004/01/29 16:17:25 ache Exp $ # # Please see the file src/etc/mtree/README before making changes to this file. # @@ -459,6 +459,8 @@ .. ja_JP.eucJP .. + kk_KZ.PT154 + .. ko_KR.CP949 .. ko_KR.eucKR @@ -819,6 +821,8 @@ .. ja_JP.eucJP .. + kk_KZ.PT154 + .. ko_KR.CP949 .. ko_KR.eucKR ==== //depot/projects/hammer/etc/namedb/named.root#3 (text+ko) ==== @@ -1,5 +1,5 @@ ; -; $FreeBSD: src/etc/namedb/named.root,v 1.10 2002/11/06 09:21:39 dougb Exp $ +; $FreeBSD: src/etc/namedb/named.root,v 1.11 2004/01/29 16:24:30 dougb Exp $ ; ; This file holds the information on root name servers needed to @@ -11,9 +11,10 @@ ; under anonymous FTP as ; file /domain/named.root ; on server FTP.INTERNIC.NET +; -OR- RS.INTERNIC.NET ; -; last update: Nov 5, 2002 -; related version of root zone: 2002110501 +; last update: Jan 29, 2004 +; related version of root zone: 2004012900 ; ; ; formerly NS.INTERNIC.NET @@ -24,7 +25,7 @@ ; formerly NS1.ISI.EDU ; . 3600000 NS B.ROOT-SERVERS.NET. -B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107 +B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 ; ; formerly C.PSI.NET ; @@ -61,22 +62,22 @@ . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 ; -; operated by VeriSign, Inc. +; operated by VeriSign, Inc. ; . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 ; -; housed in LINX, operated by RIPE NCC +; operated by RIPE NCC ; . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 ; -; operated by IANA +; operated by ICANN ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12 ; -; housed in Japan, operated by WIDE +; operated by WIDE ; . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 ==== //depot/projects/hammer/lib/libc/locale/setlocale.3#7 (text+ko) ==== @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)setlocale.3 8.1 (Berkeley) 6/9/93 -.\" $FreeBSD: src/lib/libc/locale/setlocale.3,v 1.29 2003/12/07 06:00:00 tjr Exp $ +.\" $FreeBSD: src/lib/libc/locale/setlocale.3,v 1.30 2004/01/29 09:27:24 ache Exp $ .\" .Dd November 21, 2003 .Dt SETLOCALE 3 @@ -171,7 +171,8 @@ .Xr strxfrm 3 , .Xr euc 5 , .Xr utf2 5 , -.Xr utf8 5 +.Xr utf8 5 , +.Xr environ 7 .Sh STANDARDS The .Fn setlocale ==== //depot/projects/hammer/lib/libthr/thread/thr_kern.c#10 (text+ko) ==== @@ -23,7 +23,7 @@ * (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: src/lib/libthr/thread/thr_kern.c,v 1.16 2003/12/30 08:34:57 mtm Exp $ + * $FreeBSD: src/lib/libthr/thread/thr_kern.c,v 1.17 2004/01/29 09:44:36 mtm Exp $ */ #include @@ -137,6 +137,17 @@ remaining = *abstime; timespecsub(&remaining, &now); ts = &remaining; + + /* + * If the absolute timeout has already passed set the + * relative timeout to 0 sec. so that sigtimedwait() + * returns immediately. + * NOTE: timespecsub() makes sure the tv_nsec member >= 0. + */ + if (ts->tv_sec < 0) { + ts->tv_sec = 0; + ts->tv_nsec = 0; + } } else ts = NULL; ==== //depot/projects/hammer/lib/libthr/thread/thr_rwlock.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libthr/thread/thr_rwlock.c,v 1.4 2004/01/19 14:51:45 mtm Exp $ + * $FreeBSD: src/lib/libthr/thread/thr_rwlock.c,v 1.5 2004/01/29 12:03:17 mtm Exp $ */ #include @@ -42,17 +42,29 @@ */ enum rwlock_type {RWT_READ, RWT_WRITE}; +/* hack to accomodate libc */ +static struct umtx init_lock = UMTX_INITIALIZER; + +/* + * Single underscore versions are for libc useage. So, use double + * underscores for applications. + */ +__weak_reference(__pthread_rwlock_rdlock, pthread_rwlock_rdlock); +__weak_reference(__pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock); +__weak_reference(__pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock); +__weak_reference(__pthread_rwlock_tryrdlock, pthread_rwlock_tryrdlock); +__weak_reference(__pthread_rwlock_trywrlock, pthread_rwlock_trywrlock); +__weak_reference(__pthread_rwlock_wrlock, pthread_rwlock_wrlock); + +/* + * No difference between libc and application usage. + */ __weak_reference(_pthread_rwlock_destroy, pthread_rwlock_destroy); __weak_reference(_pthread_rwlock_init, pthread_rwlock_init); -__weak_reference(_pthread_rwlock_rdlock, pthread_rwlock_rdlock); -__weak_reference(_pthread_rwlock_timedrdlock, pthread_rwlock_timedrdlock); -__weak_reference(_pthread_rwlock_timedwrlock, pthread_rwlock_timedwrlock); -__weak_reference(_pthread_rwlock_tryrdlock, pthread_rwlock_tryrdlock); -__weak_reference(_pthread_rwlock_trywrlock, pthread_rwlock_trywrlock); __weak_reference(_pthread_rwlock_unlock, pthread_rwlock_unlock); -__weak_reference(_pthread_rwlock_wrlock, pthread_rwlock_wrlock); static int insert_rwlock(struct pthread_rwlock *, enum rwlock_type); +static int rwlock_init_static(struct pthread_rwlock **rwlock); static int rwlock_rdlock_common(pthread_rwlock_t *, int, const struct timespec *); static int rwlock_wrlock_common(pthread_rwlock_t *, int, @@ -212,22 +224,56 @@ } int +__pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) +{ + return (rwlock_rdlock_common(rwlock, 0, NULL)); +} + +int _pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) { - return (rwlock_rdlock_common(rwlock, 0, NULL)); + int error; + + error = rwlock_init_static(rwlock); + if (error == 0) + error = rwlock_rdlock_common(rwlock, 0, NULL); + return (error); +} + +int +__pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, + const struct timespec *timeout) +{ + return (rwlock_rdlock_common(rwlock, 0, timeout)); } int _pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, const struct timespec *timeout) { - return (rwlock_rdlock_common(rwlock, 0, timeout)); + int error; + + error = rwlock_init_static(rwlock); + if (error == 0) + rwlock_rdlock_common(rwlock, 0, timeout); + return (error); +} + +int +__pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) +{ + return (rwlock_rdlock_common(rwlock, 1, NULL)); } int _pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) { - return (rwlock_rdlock_common(rwlock, 1, NULL)); + int error; + + error = rwlock_init_static(rwlock); + if (error == 0) + rwlock_rdlock_common(rwlock, 1, NULL); + return (error); } int @@ -293,22 +339,56 @@ } int +__pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) +{ + return (rwlock_wrlock_common(rwlock, 0, NULL)); +} + +int _pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) { - return (rwlock_wrlock_common(rwlock, 0, NULL)); + int error; + + error = rwlock_init_static(rwlock); + if (error == 0) + error = rwlock_wrlock_common(rwlock, 0, NULL); + return (error); +} + +int +__pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock, + const struct timespec *timeout) +{ + return (rwlock_wrlock_common(rwlock, 0, timeout)); } int _pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock, const struct timespec *timeout) { - return (rwlock_wrlock_common(rwlock, 0, timeout)); + int error; + + error = rwlock_init_static(rwlock); + if (error == 0) + rwlock_wrlock_common(rwlock, 0, timeout); + return (error); +} + +int +__pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) +{ + return (rwlock_wrlock_common(rwlock, 1, NULL)); } int _pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) { - return (rwlock_wrlock_common(rwlock, 1, NULL)); + int error; + + error = rwlock_init_static(rwlock); + if (error == 0) + rwlock_wrlock_common(rwlock, 1, NULL); + return (error); } /* @@ -440,3 +520,30 @@ LIST_INSERT_HEAD(curthread->rwlockList, rh, rh_link); return (0); } + +/* + * libc version. + * There are several users of rwlocks in libc that depend on + * a bogus PTHREAD_RWLOCK_INITIALIZER to do for rwlocks that + * a similarly named symbol does for statically initialized mutexes. + * However, this symbol does not seem to be a valid POSIX symbol. Rather + * than fix libc, I choose to "fix" libthr. + */ +static int +rwlock_init_static(struct pthread_rwlock **rwlock) +{ + int error; + + /* + * The initial check is done without locks to not + * pessimize the common path. + */ + error = 0; + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) { + UMTX_LOCK(&init_lock); + if (*rwlock == PTHREAD_RWLOCK_INITIALIZER) + error = _pthread_rwlock_init(rwlock, NULL); + UMTX_UNLOCK(&init_lock); + } + return (error); +} ==== //depot/projects/hammer/release/Makefile#44 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/release/Makefile,v 1.837 2004/01/28 09:19:16 ru Exp $ +# $FreeBSD: src/release/Makefile,v 1.840 2004/01/29 19:01:58 jhb Exp $ # # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \ # [RELEASETAG=tag] @@ -171,11 +171,11 @@ .endif FLOPPYSIZE= 1440 FLOPPYSPLITSIZE= 1392 -MFSSIZE= 4320 FLOPPYINODE= 40000 +FLOPPYLABEL= fd1440 BOOTINODE= 80000 +MFSSIZE= 4320 MFSINODE= 8000 -FLOPPYLABEL= fd1440 MFSLABEL= minimum3 .elif ${TARGET_ARCH} == "alpha" MFSSIZE= 4320 @@ -190,9 +190,9 @@ MINIROOT= NO_FLOPPIES= .elif ${TARGET_ARCH} == "ia64" +MFSSIZE= 8192 MFSINODE= 8192 MFSLABEL= auto -MFSSIZE= 8192 NO_FLOPPIES= .elif ${TARGET_ARCH} == "amd64" MFSSIZE= 4096 @@ -245,7 +245,7 @@ .endif .endif -.if !defined(NOFLOPPIES) +.if !defined(NO_FLOPPIES) EXTRAS= floppies.1 floppies.2 floppies.3 .endif EXTRAS+= ftp.1 @@ -254,9 +254,7 @@ .if defined(MAKE_ISOS) EXTRAS+= iso.1 .endif -.if ${TARGET} == "i386" && defined(EMUL_BOOT) -BOOTABLE="-eb" -.elif ${TARGET} == "pc98" +.if ${TARGET} == "pc98" BOOTABLE= .else BOOTABLE="-b" @@ -497,7 +495,7 @@ .endif mkdir ${RD}/trees mkdir ${RD}/kernels - for i in ${DISTRIBUTIONS} special; do \ + for i in ${DISTRIBUTIONS}; do \ mkdir ${RD}/trees/$$i && \ mtree -deU -f ${MTREEFILES}/BSD.root.dist \ -p ${RD}/trees/$$i > /dev/null && \ @@ -653,12 +651,6 @@ # Build the memory root filesystem. release.9: -.if exists(${.CURDIR}/../sys/boot/${TARGET}/loader) - cd ${.CURDIR}/../sys/boot/${TARGET}/loader; \ - ${WMAKE} clean cleandepend; \ - ${WMAKE} -DNOMAN -DNOFORTH all; \ - ${WMAKE} -DNOMAN -DNOFORTH install DESTDIR=${RD}/trees/special -.endif cp ${RD}/trees/base/etc/disktab /etc rm -rf ${RD}/mfsfd mkdir ${RD}/mfsfd @@ -718,7 +710,7 @@ @mkdir -p ${RD}/mfsroot sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \ ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} - @gzip -9nv ${RD}/mfsroot/mfsroot + @gzip -9fnv ${RD}/mfsroot/mfsroot touch ${.TARGET} KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz @@ -758,7 +750,7 @@ KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot" .if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ + @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \ FDSIZE="SMALL" @@ -768,7 +760,7 @@ KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \ MFSROOTFILE=${RD}/mfsroot/mfsroot.gz .if defined(SMALLFLOPPYSIZE) - @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \ + @cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \ KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \ MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \ FDSIZE="SMALL" @@ -911,15 +903,6 @@ .endif .endif @cp -Rp ${CD_DISC2}/boot ${CD_DISC1} -.if ${TARGET} == "i386" && defined(EMUL_BOOT) && !defined(NO_FLOPPIES) - # In case bootable ISO with floppy emulation is desired. -.if defined(CD_BOOT) - @mkdir -p ${CD_BOOT}/floppies - @cp ${CD_DISC1}/floppies/boot.flp ${CD_BOOT}/floppies -.endif - @mkdir -p ${CD_DISC2}/floppies - @cp ${CD_DISC1}/floppies/boot.flp ${CD_DISC2}/floppies -.endif .endif touch ${.TARGET} @@ -1082,7 +1065,7 @@ .if !defined(SPLITFILE) @echo "SPLITFILE undefined in ${.TARGET}" && exit 1 .endif - ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \ + sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \ ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}" ( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \ lines=`cat $${splitfile} | wc -l`; \ @@ -1105,6 +1088,7 @@ .if make(buildBootFloppy) IMAGEDIR= ${RD}/image.${FSIMAGE} HINTSFILE= ${.CURDIR}/../sys/${TARGET}/conf/GENERIC.hints +ACPI_KO= ${RD}/trees/base/boot/kernel/acpi.ko IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp .if defined(FDSIZE) && ${FDSIZE} == "SMALL" FLPSIZE= ${SMALLFLOPPYSIZE} @@ -1132,9 +1116,9 @@ @mkdir -p ${IMAGEDIR}/boot .if ${TARGET} == "i386" @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \ - ${IMAGEDIR}/boot/loader ${RD}/trees/special/boot/loader + ${IMAGEDIR}/boot/loader ${RD}/trees/base/boot/loader .else - @cp ${RD}/trees/special/boot/loader ${IMAGEDIR}/boot + @cp ${RD}/trees/base/boot/loader ${IMAGEDIR}/boot .endif @[ -r ${HINTSFILE} ] && \ sed -e '/^hint/s/^/set /' -e '/^#/d' ${HINTSFILE} > \ @@ -1144,8 +1128,11 @@ @echo "echo \\007\\007" >> ${IMAGEDIR}/boot/loader.rc @echo "echo Please insert boot floppy and press enter:" >> ${IMAGEDIR}/boot/loader.rc @echo "read" >> ${IMAGEDIR}/boot/loader.rc +.if exists(${ACPI_KO}) + @gzip -9nc ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz + @echo "load /acpi.ko" >> ${IMAGEDIR}/boot/loader.rc +.endif @echo "load -t mfs_root /mfsroot" >> ${IMAGEDIR}/boot/loader.rc - @echo "set hint.acpi.0.disabled=1" >> ${IMAGEDIR}/boot/loader.rc @echo "echo \\007\\007" >> ${IMAGEDIR}/boot/loader.rc @echo "autoboot 10" >> ${IMAGEDIR}/boot/loader.rc .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT} ==== //depot/projects/hammer/sbin/mount/mount.8#7 (text+ko) ==== @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 -.\" $FreeBSD: src/sbin/mount/mount.8,v 1.60 2003/10/22 18:25:49 seanc Exp $ +.\" $FreeBSD: src/sbin/mount/mount.8,v 1.62 2004/01/29 15:14:03 guido Exp $ .\" .Dd April 7, 2003 .Dt MOUNT 8 @@ -42,6 +42,7 @@ .Nm .Op Fl adfpruvw .Op Fl F Ar fstab +.Op Fl o Ar options .Op Fl t Ar ufs | external_type .Nm .Op Fl dfpruvw ==== //depot/projects/hammer/sbin/mount/mount.c#11 (text+ko) ==== @@ -42,7 +42,7 @@ static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #endif static const char rcsid[] = - "$FreeBSD: src/sbin/mount/mount.c,v 1.58 2004/01/07 05:37:56 anholt Exp $"; + "$FreeBSD: src/sbin/mount/mount.c,v 1.61 2004/01/29 15:14:03 guido Exp $"; #endif /* not lint */ #include @@ -210,6 +210,8 @@ if (!(init_flags & MNT_UPDATE) && ismounted(fs, mntbuf, mntsize)) continue; + options = update_options(options, fs->fs_mntops, + mntbuf->f_flags); if (mountfs(fs->fs_vfstype, fs->fs_spec, fs->fs_file, init_flags, options, fs->fs_mntops)) @@ -704,7 +706,7 @@ (void)fprintf(stderr, "%s\n%s\n%s\n", "usage: mount [-dfpruvw] [-o options] [-t ufs | external_type] special node", -" mount [-adfpruvw] [ -F fstab] [-t ufs | external_type]", +" mount [-adfpruvw] [ -F fstab] [-o options] [-t ufs | external_type]", " mount [-dfpruvw] special | node"); exit(1); } ==== //depot/projects/hammer/sbin/routed/Makefile#2 (text+ko) ==== @@ -1,6 +1,5 @@ # Make `routed` for FreeBSD -# $FreeBSD: src/sbin/routed/Makefile,v 1.12 2001/12/04 02:19:56 obrien Exp $ -# $FreeBSD: src/sbin/routed/Makefile,v 1.12 2001/12/04 02:19:56 obrien Exp $ +# $FreeBSD: src/sbin/routed/Makefile,v 1.13 2004/01/29 14:36:16 ru Exp $ PROG= routed SRCS= if.c input.c main.c output.c parms.c radix.c rdisc.c table.c trace.c ==== //depot/projects/hammer/sbin/sunlabel/Makefile#7 (text+ko) ==== @@ -1,16 +1,20 @@ -# $FreeBSD: src/sbin/sunlabel/Makefile,v 1.8 2003/05/17 19:05:17 ru Exp $ +# $FreeBSD: src/sbin/sunlabel/Makefile,v 1.10 2004/01/29 18:15:19 obrien Exp $ + +.PATH: ${.CURDIR}/../../sys/geom + +PROG= sunlabel +SRCS= sunlabel.c geom_sunlabel_enc.c +MAN= sunlabel.8 -PROG=sunlabel -SRCS=sunlabel.c geom_sunlabel_enc.c -NOMAN= -WARNS=5 +WARNS?= 5 DPADD= ${LIBGEOM} LDADD= -lgeom -.PATH: ${.CURDIR}/../../sys/geom - .include test: ${PROG} sh ${.CURDIR}/runtest.sh + +testx: ${PROG} + sh -x ${.CURDIR}/runtest.sh ==== //depot/projects/hammer/share/colldef/Makefile#11 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/colldef/Makefile,v 1.62 2003/12/20 11:18:42 ache Exp $ +# $FreeBSD: src/share/colldef/Makefile,v 1.63 2004/01/29 16:28:20 ache Exp $ # NOMAN=YES @@ -21,6 +21,7 @@ hy_AM.ARMSCII-8 \ is_IS.ISO8859-1 \ is_IS.ISO8859-15 \ + kk_KZ.PT154 \ la_LN.ISO8859-1 \ la_LN.ISO8859-15 \ la_LN.ISO8859-2 \ @@ -79,6 +80,7 @@ hy_AM.ARMSCII-8.out: map.ARMSCII-8 is_IS.ISO8859-15.out: map.ISO8859-15 is_IS.ISO8859-1.out: map.ISO8859-1 +kk_KZ.PT154.out: map.PT154 la_LN.ISO8859-15.out: map.ISO8859-15 la_LN.ISO8859-1.out: map.ISO8859-1 la_LN.ISO8859-2.out: map.ISO8859-2 ==== //depot/projects/hammer/share/mklocale/Makefile#10 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/mklocale/Makefile,v 1.57 2003/12/20 11:18:42 ache Exp $ +# $FreeBSD: src/share/mklocale/Makefile,v 1.58 2004/01/29 16:28:20 ache Exp $ NOMAN=YES CLEANFILES+= ${LOCALES:S/$/.out/g} @@ -11,6 +11,7 @@ hy_AM.ARMSCII-8 \ ja_JP.SJIS \ ja_JP.eucJP \ + kk_KZ.PT154 \ ko_KR.CP949 \ ko_KR.eucKR \ la_LN.ISO8859-1 \ ==== //depot/projects/hammer/share/monetdef/Makefile#10 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/monetdef/Makefile,v 1.51 2003/12/20 11:18:42 ache Exp $ +# $FreeBSD: src/share/monetdef/Makefile,v 1.52 2004/01/29 16:28:20 ache Exp $ NOMAN=YES CLEANFILES+= ${LOCALES:S/$/.out/g} @@ -34,6 +34,7 @@ is_IS.ISO8859-1 \ it_IT.ISO8859-1 \ ja_JP.eucJP \ + kk_KZ.PT154 \ ko_KR.eucKR \ lt_LT.ISO8859-13 \ nl_BE.ISO8859-1 \ ==== //depot/projects/hammer/share/msgdef/Makefile#10 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/msgdef/Makefile,v 1.52 2003/12/20 11:18:43 ache Exp $ +# $FreeBSD: src/share/msgdef/Makefile,v 1.53 2004/01/29 16:28:21 ache Exp $ NOMAN=YES CLEANFILES+= ${LOCALES:S/$/.out/g} @@ -29,6 +29,7 @@ hy_AM.ARMSCII-8 \ is_IS.ISO8859-1 \ it_IT.ISO8859-1 \ + kk_KZ.PT154 \ lt_LT.ISO8859-13 \ nl_NL.ISO8859-1 \ no_NO.ISO8859-1 \ ==== //depot/projects/hammer/share/numericdef/Makefile#9 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/numericdef/Makefile,v 1.51 2003/12/20 11:18:43 ache Exp $ +# $FreeBSD: src/share/numericdef/Makefile,v 1.52 2004/01/29 16:28:21 ache Exp $ NOMAN=YES CLEANFILES+= ${LOCALES:S/$/.out/g} @@ -25,6 +25,7 @@ is_IS.ISO8859-1 \ it_IT.ISO8859-1 \ ja_JP.eucJP \ + kk_KZ.PT154 \ ko_KR.eucKR \ lt_LT.ISO8859-13 \ nl_NL.ISO8859-1 \ ==== //depot/projects/hammer/share/syscons/keymaps/INDEX.keymaps#8 (text+ko) ==== @@ -1,10 +1,10 @@ -# $FreeBSD: src/share/syscons/keymaps/INDEX.keymaps,v 1.53 2003/12/20 11:18:43 ache Exp $ +# $FreeBSD: src/share/syscons/keymaps/INDEX.keymaps,v 1.54 2004/01/29 16:28:22 ache Exp $ # # database for kbdmap(8) # # Format :: # -# lang: ar bg cs da de el en es fi fr hr hu hy is it iw ja ko nl no pl +# lang: ar bg cs da de el en es fi fr hr hu hy is it iw ja kk ko nl no pl # pt ro ru sh sk sl sv tr uk zh # lang: lang,lang # @@ -222,6 +222,9 @@ jp.pc98.iso.kbd:en:Japanese PC-98x1 (ISO) +kk.pt154.kst.kbd:en:Kazakh PT154 codepage +kk.pt154.io.kbd:en:Kazakh PT154 codepage + latinamerican.kbd:en:Latin American latinamerican.kbd:de:Latein Amerikanisch latinamerican.kbd:pt,es:América Latina ==== //depot/projects/hammer/share/syscons/keymaps/Makefile#9 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/syscons/keymaps/Makefile,v 1.66 2004/01/19 13:40:51 ru Exp $ +# $FreeBSD: src/share/syscons/keymaps/Makefile,v 1.67 2004/01/29 16:28:22 ache Exp $ FILES= INDEX.keymaps \ be.iso.kbd be.iso.acc.kbd \ @@ -23,6 +23,7 @@ it.iso.kbd \ iw.iso8.kbd \ jp.106.kbd jp.106x.kbd jp.pc98.kbd jp.pc98.iso.kbd \ + kk.pt154.kst.kbd kk.pt154.io.kbd \ latinamerican.kbd latinamerican.iso.acc.kbd \ lt.iso4.kbd \ norwegian.iso.kbd norwegian.dvorak.kbd \ ==== //depot/projects/hammer/share/timedef/Makefile#10 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/share/timedef/Makefile,v 1.39 2003/12/20 11:18:43 ache Exp $ +# $FreeBSD: src/share/timedef/Makefile,v 1.40 2004/01/29 16:28:22 ache Exp $ NOMAN=YES CLEANFILES+= ${LOCALES:S/$/.out/g} @@ -28,6 +28,7 @@ ja_JP.eucJP \ ja_JP.SJIS \ it_IT.ISO8859-1 \ + kk_KZ.PT154 \ ko_KR.eucKR \ la_LN.ISO8859-1 \ lt_LT.ISO8859-4 \ ==== //depot/projects/hammer/sys/amd64/acpica/madt.c#29 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.10 2003/12/09 03:04:19 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.11 2004/01/30 00:24:45 peter Exp $"); #include #include ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#32 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.6 2004/01/28 23:51:16 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.7 2004/01/30 00:24:45 peter Exp $"); #include #include ==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#55 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.233 2004/01/28 23:51:16 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/mp_machdep.c,v 1.234 2004/01/30 00:24:45 peter Exp $"); #include "opt_cpu.h" #include "opt_kstack_pages.h" ==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#54 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.450 2004/01/01 07:08:52 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.451 2004/01/30 00:24:45 peter Exp $"); /* * Manages physical address maps. ==== //depot/projects/hammer/sys/conf/files.powerpc#6 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.powerpc,v 1.34 2004/01/21 05:19:59 grehan Exp $ +# $FreeBSD: src/sys/conf/files.powerpc,v 1.35 2004/01/29 00:32:22 grehan Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -58,6 +58,7 @@ powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/swtch.S standard powerpc/powerpc/trap.c standard +powerpc/powerpc/uma_machdep.c standard powerpc/powerpc/vm_machdep.c standard powerpc/powerpc/db_disasm.c optional ddb ==== //depot/projects/hammer/sys/conf/systags.sh#2 (text+ko) ==== @@ -32,7 +32,7 @@ # SUCH DAMAGE. # # @(#)systags.sh 8.1 (Berkeley) 6/10/93 -# $FreeBSD: src/sys/conf/systags.sh,v 1.7 1999/08/28 00:41:02 peter Exp $ +# $FreeBSD: src/sys/conf/systags.sh,v 1.8 2004/01/29 14:58:22 kensmith Exp $ # # systags.sh - construct a system tags file using dependence relations # in a .depend file @@ -41,7 +41,7 @@ rm -f tags tags.tmp tags.cfiles tags.sfiles tags.hfiles MACHINE=`uname -m` -sed -e "s, machine/, ../../$MACHINE/include/,g" \ +sed -e "s, machine/, ../../../$MACHINE/include/,g" \ -e 's,[a-z][^/ ]*/\.\./,,g' .depend | awk '{ for (i = 1; i <= NF; ++i) { t = substr($i, length($i) - 1) ==== //depot/projects/hammer/sys/dev/ata/ata-all.h#13 (text+ko) ==== @@ -25,7 +25,7 @@ * (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: src/sys/dev/ata/ata-all.h,v 1.72 2004/01/28 20:38:51 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.73 2004/01/29 15:03:01 sos Exp $ */ /* ATA register defines */ @@ -135,7 +135,6 @@ #define ATA_BMCMD_START_STOP 0x01 #define ATA_BMCMD_WRITE_READ 0x08 -#define ATA_BMCTL_PORT 0x09 #define ATA_BMDEVSPEC_0 0x0a #define ATA_BMSTAT_PORT 0x0b #define ATA_BMSTAT_ACTIVE 0x01 ==== //depot/projects/hammer/sys/dev/ata/ata-chipset.c#26 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.59 2004/01/28 21:54:40 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.60 2004/01/29 15:03:01 sos Exp $"); #include "opt_ata.h" #include @@ -1196,6 +1196,7 @@ } break; } + ctlr->setmode = ata_promise_setmode; return 0; } @@ -1212,8 +1213,8 @@ } ch->r_io[ATA_ALTSTAT].res = ctlr->r_io2; ch->r_io[ATA_ALTSTAT].offset = 0x238 + (ch->unit << 7); - ch->r_io[ATA_BMCTL_PORT].res = ctlr->r_io2; - ch->r_io[ATA_BMCTL_PORT].offset = 0x260 + (ch->unit << 7); + ch->r_io[ATA_BMCMD_PORT].res = ctlr->r_io2; + ch->r_io[ATA_BMCMD_PORT].offset = 0x260 + (ch->unit << 7); ch->r_io[ATA_BMDTP_PORT].res = ctlr->r_io2; ch->r_io[ATA_BMDTP_PORT].offset = 0x244 + (ch->unit << 7); ch->r_io[ATA_BMDEVSPEC_0].res = ctlr->r_io2; @@ -1357,7 +1358,7 @@ case PRMIO: if (mode > ATA_UDMA2 && - (ATA_IDX_INL(atadev->channel, ATA_BMCTL_PORT) & 0x01000000)) { + (ATA_IDX_INL(atadev->channel, ATA_BMCMD_PORT) & 0x01000000)) { ata_prtdev(atadev, "DMA limited to UDMA33, non-ATA66 cable or device\n"); mode = ATA_UDMA2; @@ -1445,8 +1446,8 @@ ata_promise_mio_dmastart(struct ata_channel *ch) { ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->mdmatab); - ATA_IDX_OUTL(ch, ATA_BMCTL_PORT, - (ATA_IDX_INL(ch, ATA_BMCTL_PORT) & ~0x000000c0) | + ATA_IDX_OUTL(ch, ATA_BMCMD_PORT, + (ATA_IDX_INL(ch, ATA_BMCMD_PORT) & ~0x000000c0) | ((ch->dma->flags & ATA_DMA_READ) ? 0x00000080 : 0x000000c0)); return 0; } @@ -1454,8 +1455,8 @@ static int ata_promise_mio_dmastop(struct ata_channel *ch) { - ATA_IDX_OUTL(ch, ATA_BMCTL_PORT, - ATA_IDX_INL(ch, ATA_BMCTL_PORT) & ~0x00000080); + ATA_IDX_OUTL(ch, ATA_BMCMD_PORT, + ATA_IDX_INL(ch, ATA_BMCMD_PORT) & ~0x00000080); return 0; } ==== //depot/projects/hammer/sys/dev/ata/ata-pci.h#16 (text+ko) ==== >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Thu Jan 29 18:11:17 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8FFD616A4D0; Thu, 29 Jan 2004 18:11:17 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6587416A4CE for ; Thu, 29 Jan 2004 18:11:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD4E443D45 for ; Thu, 29 Jan 2004 18:11:13 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0U2BD0B079263 for ; Thu, 29 Jan 2004 18:11:13 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0U2BDKL079257 for perforce@freebsd.org; Thu, 29 Jan 2004 18:11:13 -0800 (PST) (envelope-from peter@freebsd.org) Date: Thu, 29 Jan 2004 18:11:13 -0800 (PST) Message-Id: <200401300211.i0U2BDKL079257@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 46162 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 02:11:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=46162 Change 46162 by peter@peter_daintree on 2004/01/29 18:10:59 Integ -b i386_hammer -I Affected files ... .. //depot/projects/hammer/sys/amd64/conf/GENERIC#30 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/conf/GENERIC#30 (text+ko) ==== @@ -12,8 +12,8 @@ # latest information. # # An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # # $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.401 2004/01/24 21:38:51 jeff Exp $ @@ -22,35 +22,35 @@ cpu HAMMER ident GENERIC -#To statically compile in device wiring instead of /boot/device.hints -#hints "GENERIC.hints" #Default places to look for devices. +# To statically compile in device wiring instead of /boot/device.hints +#hints "GENERIC.hints" # Default places to look for devices. -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions NO_MODULES=not_yet -options SCHED_ULE #ULE scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options SOFTUPDATES #Enable FFS soft updates support -options UFS_ACL #Support for access control lists -options UFS_DIRHASH #Improve performance on big directories -options MD_ROOT #MD is a potential root device -options NFSCLIENT #Network Filesystem Client -options NFSSERVER #Network Filesystem Server -options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options IA32 #Compatible with i386 binaries -options COMPAT_FREEBSD4 #Compatible with FreeBSD4 -options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SCHED_ULE # ULE scheduler +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options MD_ROOT # MD is a potential root device +options NFSCLIENT # Network Filesystem Client +options NFSSERVER # Network Filesystem Server +options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options IA32 # Compatible with i386 binaries +options COMPAT_FREEBSD4 # Compatible with FreeBSD4 +options SCSI_DELAY=15000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. @@ -59,17 +59,17 @@ options PFIL_HOOKS # pfil(9) framework # Debugging for use in -current -options DDB #Enable the kernel debugger -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS #Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed # Make an SMP-capable kernel by default -options SMP # Symmetric MultiProcessor Kernel +options SMP # Symmetric MultiProcessor Kernel # Workarounds for some known-to-be-broken chipsets (nVidia nForce3-Pro150) -device atpic # 8259A compatability -options NO_MIXED_MODE # Don't penalize working chipsets +device atpic # 8259A compatability +options NO_MIXED_MODE # Don't penalize working chipsets device acpi device isa @@ -84,12 +84,12 @@ # ATA and ATAPI devices device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID #Static device numbering +device atadisk # ATA disk drives +device ataraid # ATA RAID drives +device atapicd # ATAPI CDROM drives +device atapifd # ATAPI floppy drives +device atapist # ATAPI tape drives +options ATA_STATIC_ID # Static device numbering # SCSI Controllers device ahb # EISA AHA1742 family @@ -149,11 +149,11 @@ device sc # PCCARD (PCMCIA) support -# Pcmcia and cardbus bridge support -device cbb # cardbus (yenta) bridge -#device pcic # ExCA ISA and PCI bridges -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +# PCMCIA and cardbus bridge support +device cbb # cardbus (yenta) bridge +#device pcic # ExCA ISA and PCI bridges +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports device sio # 8250, 16[45]50 based serial ports @@ -198,7 +198,7 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') -# ISA Ethernet NICs. pccard nics included. +# ISA Ethernet NICs. pccard NICs included. device cs # Crystal Semiconductor CS89x0 NIC # 'device ed' requires 'device miibus' # XXX kvtop brokenness, pointer/int warnings @@ -218,7 +218,7 @@ # Wireless NIC cards device wlan # 802.11 support -device an # Aironet 4500/4800 802.11 wireless NICs. +device an # Aironet 4500/4800 802.11 wireless NICs. device awi # BayStack 660 and others device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. #device wl # Older non 802.11 Wavelan wireless NIC. From owner-p4-projects@FreeBSD.ORG Thu Jan 29 19:41:07 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 03ECE16A4D0; Thu, 29 Jan 2004 19:41:07 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5B6D16A4CE for ; Thu, 29 Jan 2004 19:41:06 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88F2843D2F for ; Thu, 29 Jan 2004 19:41:03 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0U3f30B099219 for ; Thu, 29 Jan 2004 19:41:03 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0U3f32d099120 for perforce@freebsd.org; Thu, 29 Jan 2004 19:41:03 -0800 (PST) (envelope-from sam@freebsd.org) Date: Thu, 29 Jan 2004 19:41:03 -0800 (PST) Message-Id: <200401300341.i0U3f32d099120@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46164 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 03:41:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=46164 Change 46164 by sam@sam_ebb on 2004/01/29 19:40:04 add (very suboptimal) locking of do_sendfile Affected files ... .. //depot/projects/netperf+sockets/sys/kern/uipc_syscalls.c#9 edit Differences ... ==== //depot/projects/netperf+sockets/sys/kern/uipc_syscalls.c#9 (text+ko) ==== @@ -1683,7 +1683,7 @@ struct writev_args nuap; struct sf_hdtr hdtr; off_t off, xfsize, hdtr_size, sbytes = 0; - int error, s; + int error; mtx_lock(&Giant); @@ -1692,7 +1692,8 @@ /* * The descriptor must be a regular file and have a backing VM object. */ - if ((error = fgetvp_read(td, uap->fd, &vp)) != 0) + error = fgetvp_read(td, uap->fd, &vp); + if (error != 0) goto done; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); if (vp->v_type != VREG || VOP_GETVOBJECT(vp, &obj) != 0) { @@ -1750,6 +1751,7 @@ /* * Protect against multiple writers to the socket. */ + SOCKBUF_LOCK(&so->so_snd); (void) sblock(&so->so_snd, M_WAITOK); /* @@ -1763,6 +1765,11 @@ vm_offset_t pgoff; pindex = OFF_TO_IDX(off); + /* + * XXX too many places where we can block + * XXX to make it worth holding the lock + */ + SOCKBUF_UNLOCK(&so->so_snd); VM_OBJECT_LOCK(obj); retry_lookup: /* @@ -1778,8 +1785,10 @@ xfsize = PAGE_SIZE - pgoff; if (uap->nbytes && xfsize > (uap->nbytes - sbytes)) xfsize = uap->nbytes - sbytes; - if (xfsize <= 0) - break; + if (xfsize <= 0) { + SOCKBUF_LOCK(&so->so_snd); + goto unlock; + } /* * Optimize the non-blocking case by looking at the socket space * before going to the extra work of constituting the sf_buf. @@ -1789,8 +1798,8 @@ error = EPIPE; else error = EAGAIN; - sbunlock(&so->so_snd); - goto done; + SOCKBUF_LOCK(&so->so_snd); + goto unlock; } VM_OBJECT_LOCK(obj); /* @@ -1873,8 +1882,8 @@ } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(obj); - sbunlock(&so->so_snd); - goto done; + SOCKBUF_LOCK(&so->so_snd); + goto unlock; } mbstat.sf_iocnt++; } else { @@ -1893,9 +1902,8 @@ if (pg->wire_count == 0 && pg->object == NULL) vm_page_free(pg); vm_page_unlock_queues(); - sbunlock(&so->so_snd); error = EINTR; - goto done; + goto unlock; } /* @@ -1905,8 +1913,8 @@ if (m == NULL) { error = ENOBUFS; sf_buf_free((void *)sf_buf_kva(sf), sf); - sbunlock(&so->so_snd); - goto done; + SOCKBUF_LOCK(&so->so_snd); /* XXX */ + goto unlock; } /* * Setup external storage for mbuf. @@ -1918,7 +1926,7 @@ /* * Add the buffer to the socket buffer chain. */ - s = splnet(); + SOCKBUF_LOCK(&so->so_snd); retry_space: /* * Make sure that the socket is still able to take more data. @@ -1939,9 +1947,7 @@ so->so_error = 0; } m_freem(m); - sbunlock(&so->so_snd); - splx(s); - goto done; + goto unlock; } /* * Wait for socket space to become available. We do this just @@ -1951,10 +1957,8 @@ if (sbspace(&so->so_snd) < so->so_snd.sb_lowat) { if (so->so_state & SS_NBIO) { m_freem(m); - sbunlock(&so->so_snd); - splx(s); error = EAGAIN; - goto done; + goto unlock; } error = sbwait(&so->so_snd); /* @@ -1964,25 +1968,22 @@ */ if (error) { m_freem(m); - sbunlock(&so->so_snd); - splx(s); - goto done; + goto unlock; } goto retry_space; } error = (*so->so_proto->pr_usrreqs->pru_send)(so, 0, m, 0, 0, td); - splx(s); - if (error) { - sbunlock(&so->so_snd); - goto done; - } + if (error) + goto unlock; } +unlock: sbunlock(&so->so_snd); + SOCKBUF_UNLOCK(&so->so_snd); /* * Send trailers. Wimp out and use writev(2). */ - if (uap->hdtr != NULL && hdtr.trailers != NULL) { + if (uap->hdtr != NULL && hdtr.trailers != NULL && error == 0) { nuap.fd = uap->s; nuap.iovp = hdtr.trailers; nuap.iovcnt = hdtr.trl_cnt; From owner-p4-projects@FreeBSD.ORG Fri Jan 30 08:36:53 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 964B916A4D0; Fri, 30 Jan 2004 08:36:53 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E72A16A4CE for ; Fri, 30 Jan 2004 08:36:53 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CBEB43D5F for ; Fri, 30 Jan 2004 08:36:16 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UGZF0B098129 for ; Fri, 30 Jan 2004 08:35:15 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UGZESl098126 for perforce@freebsd.org; Fri, 30 Jan 2004 08:35:14 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Fri, 30 Jan 2004 08:35:14 -0800 (PST) Message-Id: <200401301635.i0UGZESl098126@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46197 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 16:36:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=46197 Change 46197 by areisse@areisse_ibook on 2004/01/30 08:34:18 Support loading files that are made available to the kernel. To use this, add entries with the nvram command load_=. From the kernel, use preload_find_data to retrive the contents. Don't put symbolic links in the path, which must use \ instead of /. Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/boot_args.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/main.c#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/include.subproj/boot_args.h#2 (text+ko) ==== @@ -58,7 +58,7 @@ // Boot argument structure - passed into kernel at boot time. -#define kBootArgsRevision (1) +#define kBootArgsRevision (2) #define kBootArgsVersion (1) #define BOOT_LINE_LENGTH (256) @@ -73,6 +73,8 @@ void *deviceTreeP; /* Base of flattened device tree */ unsigned long deviceTreeLength; /* Length of flattened tree */ unsigned long topOfKernelData; /* Last address of kernel data area*/ + void *exdata; + unsigned long exdatalen; }; typedef struct boot_args boot_args, *boot_args_ptr; ==== //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/main.c#2 (text+ko) ==== @@ -467,6 +467,39 @@ args->deviceTreeP = (void *)gDeviceTreeAddr; args->deviceTreeLength = gDeviceTreeSize; + + /* Load arbitrary data */ + args->exdata = NULL; + args->exdatalen = 0; + + char *prevname = "", *propname; + while (1) { + if (1 != NextProp (gOptionsPH, prevname, propname)) + break; + prevname = propname; + if (!strncmp (propname, "load_", 5)) { + char pfilename[255]; + size = GetProp(gOptionsPH, propname, pfilename, 255); + + if (size > 0) { + char datfile[512]; + strcpy (datfile, gRootDir); + strcat (datfile, pfilename); + size = LoadFile (datfile); + if (size > 0) { + int *v = (int *) AllocateKernelMemory (size + sizeof (int) * 5); + *v = size; + strcpy ((char *) (v + 1), propname + 5); + memcpy (v + 5, kLoadAddr, size); + + if (args->exdata == NULL) + args->exdata = v; + args->exdatalen += size + sizeof(int) * 5; + } + } + } + } + args->topOfKernelData = AllocateKernelMemory(0); return 0; From owner-p4-projects@FreeBSD.ORG Fri Jan 30 10:03:46 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0F1D216A4EA; Fri, 30 Jan 2004 10:03:46 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B946616A531 for ; Fri, 30 Jan 2004 10:03:45 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 362BB43D2D for ; Fri, 30 Jan 2004 10:03:03 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UI330B024508 for ; Fri, 30 Jan 2004 10:03:03 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UI32uM024375 for perforce@freebsd.org; Fri, 30 Jan 2004 10:03:02 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Fri, 30 Jan 2004 10:03:02 -0800 (PST) Message-Id: <200401301803.i0UI32uM024375@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46200 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 18:03:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=46200 Change 46200 by areisse@areisse_ibook on 2004/01/30 10:02:08 Merge mach additions back to sedarwin development branch. Move mac initialization to mach startup, so that it is available for creation of mach tasks and ports. The policy (mac_late) initialization is also done here. (mac_late_init should be renamed mac_init_policy to better reflect its actual purpose) Add support for task and port labels to the mac framework and sebsd. A new lock was introduced to protect the task label. The lock order for two task labels is lower pointer first. Add object labelling events for mach tasks and ports. Tasks (and task ports) copy labels from the cred labels whenever the cred label is changed. (Currently, in fork, execve, bsd_init, and mac_relabel_cred) It is up to the policy to label newly created ports. Add access control checks for sending messages and port rights. Getting port rights from a message is not currently checked. Add a message trailer field for the sender's task label. Add a new mach kernel server, security. This server has calls for getting and setting labels on ports and tasks, and checking access. There are 3 generic access check calls so far: subject and object are tasks subject is task, object is port subject and object label strings are passed. The last check can be used by a userspace server, using the label from the message trailer, to use the client as subject. Add new access control check, mac_check_service_access. This uses an arbitrary subject, object, permission class, and permission name to check a permission. It can be called from userspace (currently only for tasks). sebsd: Add support for libsebsd security_change_context call. Support task and port labels. Both use the cred label structure (for now). Enable use of named permissions; implement mac_check_service_access (it assumes both labels are cred format). Print numbers in permission sets if there are no names. Add support for task and port labels and permission checks. Label new ports after the task. Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/bsd_init.c#5 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_exec.c#5 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_fork.c#3 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_mac.c#34 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_prot.c#8 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/mac.h#9 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/mac_policy.h#8 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/conf/MASTER#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/conf/files#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_kmsg.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_object.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_port.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_port.h#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_right.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_space.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_space.h#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/mach_msg.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/mach_port.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/kern/ipc_kobject.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/kern/ipc_tt.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/kern/startup.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/kern/task.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/kern/task.h#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/_label.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/mac.h#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/mach_port.defs#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/mach_types.defs#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/message.h#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/security.defs#1 branch .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ppc/ppc_init.c#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/pexpert/pexpert/ppc/boot.h#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/av_inherit.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/av_perm_to_string.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/av_permissions.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/avc.c#6 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/avc.h#4 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/avc_ss.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/class_to_string.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/common_perm_to_string.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/avc/initial_sid_to_string.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/flask.h#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/flask/access_vectors#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/flask/security_classes#2 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/sebsd.c#20 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/sebsd_syscall.c#5 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/sebsd_syscalls.h#4 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/ss/init.c#5 integrate .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/security/sebsd/ss/services.c#5 integrate Differences ... ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/bsd_init.c#5 (text+ko) ==== @@ -117,6 +117,8 @@ #include #include +#include + extern shared_region_mapping_t system_shared_region; extern int app_profile; /* on/off switch for pre-heat cache */ @@ -290,11 +292,9 @@ * Initialize the MAC Framework */ { - extern mac_init(void); - extern mac_late_init(void); + extern mac_init_bsd(void); - mac_init(); - mac_late_init(); + mac_init_bsd(); } #endif /* MAC */ @@ -352,6 +352,7 @@ #ifdef MAC mac_create_proc0(p->p_ucred); + mac_update_task_from_cred (p->p_ucred, (struct task *) p->task); #endif /* Create the file descriptor table. */ @@ -577,6 +578,7 @@ vm_set_shared_region(get_threadtask(th_act), system_shared_region); #ifdef MAC mac_create_proc1(p->p_ucred); + mac_update_task_from_cred (p->p_ucred, (struct task *) p->task); #endif load_init_program(p); /* turn on app-profiling i.e. pre-heating */ ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_exec.c#5 (text+ko) ==== @@ -89,6 +89,7 @@ #include #include #include +#include #include @@ -657,8 +658,10 @@ } #ifdef MAC - if (will_transition && !no_trans) + if (will_transition && !no_trans) { mac_execve_transition (cred, p->p_ucred, vp, scriptlabelp, execlabelp); + mac_update_task_from_cred (p->p_ucred, p->task); + } #endif crfree (cred); ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_fork.c#3 (text+ko) ==== @@ -71,6 +71,7 @@ #include #include #include +#include #if KTRACE #include #endif @@ -253,6 +254,7 @@ child->task = task; /* task->proc = child; */ set_bsdtask_info(task, child); + mac_update_task_from_cred (child->p_ucred, task); if (child->p_nice != 0) resetpriority(child); result = thread_create(task, &thread); ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_mac.c#34 (text+ko) ==== @@ -524,13 +524,17 @@ * Initialize the MAC subsystem, including appropriate SMP locks. */ void -mac_init(void) +mac_init_mach () { - LIST_INIT(&mac_static_policy_list); LIST_INIT(&mac_policy_list); mac_policy_mtx = mutex_alloc(ETAP_NO_TRACE); +} + +void +mac_init_bsd(void) +{ cv_init(&mac_policy_cv, "mac_policy_cv"); sysctl_register_oid(&sysctl__security); @@ -664,7 +668,8 @@ * We don't technically need exclusive access while !mac_late, * but hold it for assertion consistency. */ - mac_policy_grab_exclusive(); + if (mac_late) + mac_policy_grab_exclusive(); /* * If the module can potentially be unloaded, or we're loading @@ -724,7 +729,8 @@ mpc->mpc_name); out: - mac_policy_release_exclusive(); + if (mac_late) + mac_policy_release_exclusive(); return (error); } @@ -855,7 +861,7 @@ MAC_DEBUG_COUNTER_INC(&nmacbpfdescs); } -static void +void mac_init_cred_label(struct label *label) { mac_init_label(label); @@ -864,6 +870,19 @@ } void +mac_init_task_label(struct label *label) +{ + mac_init_label(label); + MAC_PERFORM(init_task_label, label); +} + +void +mac_copy_cred_to_task (struct label *cred, struct label *task) +{ + MAC_PERFORM (copy_cred_to_task, cred, task); +} + +void mac_init_cred(struct ucred *cred) { @@ -871,6 +890,18 @@ } void +mac_init_port_label (struct label *l) +{ + MAC_PERFORM (init_port_label, l); +} + +void +mac_destroy_port_label (struct label *l) +{ + MAC_PERFORM (destroy_port_label, l); +} + +void mac_init_devfsdirent(struct devnode *de) { mac_init_label(&de->dn_label); @@ -1105,6 +1136,13 @@ } void +mac_destroy_task_label(struct label *label) +{ + MAC_PERFORM(destroy_task_label, label); + mac_destroy_label(label); +} + +void mac_destroy_cred(struct ucred *cred) { @@ -1264,6 +1302,20 @@ } void +mac_copy_port_label(struct label *src, struct label *dest) +{ + + MAC_PERFORM(copy_port_label, src, dest); +} + +void +mac_update_port_from_cred_label (struct label *src, struct label *dest) +{ + + MAC_PERFORM(update_port_from_cred_label, src, dest); +} + +void mac_copy_devfs_label(struct label *src, struct label *dest) { MAC_PERFORM(copy_devfs_label, src, dest); @@ -1290,6 +1342,28 @@ return (error); } +int +mac_externalize_task_label(struct label *label, char *elements, + char *outbuf, size_t outbuflen, int flags) +{ + int error; + + MAC_EXTERNALIZE(cred_label, label, elements, outbuf, outbuflen); + + return (error); +} + +int +mac_externalize_port_label(struct label *label, char *elements, + char *outbuf, size_t outbuflen, int flags) +{ + int error; + + MAC_EXTERNALIZE(cred_label, label, elements, outbuf, outbuflen); + + return (error); +} + static int mac_externalize_ifnet_label(struct label *label, char *elements, char *outbuf, size_t outbuflen, int flags) @@ -1357,6 +1431,16 @@ return (error); } +int +mac_internalize_port_label(struct label *label, char *string) +{ + int error; + + MAC_INTERNALIZE(cred_label, label, string); + + return (error); +} + static int mac_internalize_ifnet_label(struct label *label, char *string) { @@ -1447,6 +1531,19 @@ } void +mac_create_task (struct task *parent, struct task *child, struct label *pl, + struct label *chl) +{ + MAC_PERFORM(create_task, parent, child, pl, chl); +} + +void +mac_create_port(struct label *it, struct label *st, struct label *port) +{ + MAC_PERFORM(create_port, it, st, port); +} + +void mac_update_devfsdirent(struct mount *mp, struct devnode *de, struct vnode *vp) { @@ -2642,6 +2739,66 @@ } int +mac_check_port_relabel (struct label *task, struct label *old, struct label *newlabel) +{ + int error; + + MAC_CHECK(check_port_relabel, task, old, newlabel); + + return (error); +} + +int +mac_check_port_send (struct label *task, struct label *port) +{ + int error; + + MAC_CHECK(check_port_send, task, port); + + return (error); +} + +int +mac_check_port_make_send (struct label *task, struct label *port) +{ + int error; + + MAC_CHECK(check_port_make_send, task, port); + + return (error); +} + +int +mac_check_port_copy_send (struct label *task, struct label *port) +{ + int error; + + MAC_CHECK(check_port_copy_send, task, port); + + return (error); +} + +int +mac_check_port_move_receive (struct label *task, struct label *port) +{ + int error; + + MAC_CHECK(check_port_move_receive, task, port); + + return (error); +} + +int +mac_check_service_access (struct label *subj, struct label *obj, + const char *s, const char *p) +{ + int error; + + MAC_CHECK (check_service_access, subj, obj, s, p); + return error; +} + +int mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *mbuf) { struct label *label; @@ -3630,6 +3787,7 @@ newcred = crdup(oldcred); mac_relabel_cred(newcred, &intlabel); p->p_ucred = newcred; + mac_update_task_from_cred (newcred, p->task); /* * Grab additional reference for use while revoking mmaps, prior ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_prot.c#8 (text+ko) ==== @@ -803,4 +803,6 @@ (sec_token.val[0]) ? HOST_PRIV_NULL : host_priv_self()); + + mac_update_task_from_cred (p->p_ucred, p->task); } ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/mac.h#9 (text+ko) ==== @@ -147,6 +147,8 @@ void mac_copy_mbuf_tag(struct m_tag *, struct m_tag *); void mac_copy_vnode_label(struct label *, struct label *label); void mac_copy_devfs_label(struct label *, struct label *label); +void mac_copy_cred_to_task (struct label *cred, struct label *task); +void mac_update_task_label (struct label *plabel, void *task); void mac_destroy_bpfdesc(struct bpf_d *); void mac_destroy_cred(struct ucred *); void mac_destroy_devfsdirent(struct devnode *); @@ -160,6 +162,9 @@ void mac_destroy_vnode(struct vnode *); void mac_destroy_vnode_label(struct label *); +#define mac_update_task_from_cred(cred,task) \ + mac_update_task_label (&((cred)->cr_label),task) + /* * Labeling event operations: file system objects, and things that * look a lot like file system objects. @@ -237,6 +242,8 @@ #endif /* Access control checks. */ +int mac_check_service_access (struct label *subj, struct label *obj, + const char *serv, const char *perm); int mac_check_bpfdesc_receive(struct bpf_d *bpf_d, struct ifnet *ifnet); int mac_check_cred_visible(struct ucred *u1, struct ucred *u2); int mac_check_ifnet_transmit(struct ifnet *ifnet, struct mbuf *m); ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/mac_policy.h#8 (text+ko) ==== @@ -63,6 +63,7 @@ struct ucred; struct vnode; struct devnode; +struct task; struct mac_policy_ops { /* @@ -95,6 +96,8 @@ void (*mpo_init_pipe_label)(struct label *label); #endif void (*mpo_init_proc_label)(struct label *label); + void (*mpo_init_task_label)(struct label *label); + void (*mpo_init_port_label)(struct label *label); void (*mpo_init_vnode_label)(struct label *label); void (*mpo_destroy_bpfdesc_label)(struct label *label); void (*mpo_destroy_cred_label)(struct label *label); @@ -110,9 +113,15 @@ void (*mpo_destroy_pipe_label)(struct label *label); #endif void (*mpo_destroy_proc_label)(struct label *label); + void (*mpo_destroy_task_label)(struct label *label); + void (*mpo_destroy_port_label)(struct label *label); void (*mpo_destroy_vnode_label)(struct label *label); + void (*mpo_copy_cred_to_task) (struct label *cred, struct label *task); void (*mpo_copy_mbuf_label)(struct label *src, struct label *dest); + + void (*mpo_update_port_from_cred_label) (struct label *cred, + struct label *task); #if 0 void (*mpo_copy_pipe_label)(struct label *src, struct label *dest); @@ -121,6 +130,8 @@ struct label *dest); void (*mpo_copy_devfs_label)(struct label *src, struct label *dest); + void (*mpo_copy_port_label)(struct label *src, + struct label *dest); int (*mpo_externalize_cred_label)(struct label *label, char *element_name, struct sbuf *sb, int *claimed); int (*mpo_externalize_ifnet_label)(struct label *label, @@ -223,6 +234,9 @@ struct label *pipelabel); #endif + void (*mpo_create_port)(struct label *it, struct label *st, + struct label *portlabel); + /* * Labeling event operations: network objects. */ @@ -279,6 +293,9 @@ void (*mpo_create_cred)(struct ucred *parent_cred, struct ucred *child_cred); + void (*mpo_create_task)(struct task *parent, struct task *child, struct label *pl, + struct label *cl); + void (*mpo_execve_transition)(struct ucred *old, struct ucred *new, struct vnode *vp, struct label *vnodelabel, @@ -290,7 +307,7 @@ struct label *interpvnodelabel, struct label *execlabel); - void (*mpo_create_proc0)(struct ucred *cred); + void (*mpo_create_proc0)(struct ucred *cred); void (*mpo_create_proc1)(struct ucred *cred); void (*mpo_relabel_cred)(struct ucred *cred, struct label *newlabel); @@ -301,11 +318,18 @@ /* * Access control checks. */ + int (*mpo_check_service_access)(struct label *subj, struct label *obj, const char *serv, const char *perm); int (*mpo_check_bpfdesc_receive)(struct bpf_d *bpf_d, struct label *bpflabel, struct ifnet *ifnet, struct label *ifnetlabel); int (*mpo_check_cred_relabel)(struct ucred *cred, struct label *newlabel); + int (*mpo_check_port_relabel)(struct label *task, struct label *old, + struct label *newlabel); + int (*mpo_check_port_send)(struct label *task, struct label *port); + int (*mpo_check_port_make_send)(struct label *task, struct label *port); + int (*mpo_check_port_copy_send)(struct label *task, struct label *port); + int (*mpo_check_port_move_receive)(struct label *task, struct label *port); int (*mpo_check_cred_visible)(struct ucred *u1, struct ucred *u2); int (*mpo_check_ifnet_relabel)(struct ucred *cred, struct ifnet *ifnet, struct label *ifnetlabel, ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/conf/MASTER#2 (text+ko) ==== @@ -196,3 +196,5 @@ # options MACH_COUNTERS # # + +options MAC ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/conf/files#2 (text+ko) ==== @@ -221,6 +221,7 @@ ./mach/task_server.c standard ./mach/thread_act_server.c standard ./mach/vm_map_server.c standard +./mach/security_server.c standard osfmk/mach-o/mach_header.c standard osfmk/vm/device_vm.c standard osfmk/vm/memory_object.c standard ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_kmsg.c#2 (text+ko) ==== @@ -647,7 +647,7 @@ { mach_msg_size_t msg_and_trailer_size; ipc_kmsg_t kmsg; - mach_msg_format_0_trailer_t *trailer; + mach_msg_mac_trailer_t *trailer; mach_port_name_t dest_name; ipc_entry_t dest_entry; ipc_port_t dest_port; @@ -675,11 +675,23 @@ * is initialized to the minimum (sizeof(mach_msg_trailer_t)), to optimize * the cases where no implicit data is requested. */ - trailer = (mach_msg_format_0_trailer_t *) ((vm_offset_t)&kmsg->ikm_header + size); + trailer = (mach_msg_mac_trailer_t *) ((vm_offset_t)&kmsg->ikm_header + size); trailer->msgh_sender = current_thread()->top_act->task->sec_token; trailer->msgh_trailer_type = MACH_MSG_TRAILER_FORMAT_0; trailer->msgh_trailer_size = MACH_MSG_TRAILER_MINIMUM_SIZE; + task_t cur = current_thread()->top_act->task; + if (cur) + { + tasklabel_lock (cur); + mac_externalize_task_label (&cur->maclabel, + "sebsd", trailer->msgh_labels.slabel, + 64, 0); + tasklabel_unlock (cur); + } + else + strcpy (trailer->msgh_labels.slabel, "system_u:system_r:kernel_t"); + *kmsgp = kmsg; return MACH_MSG_SUCCESS; } @@ -797,6 +809,19 @@ ip_lock(port); +#ifdef MAC + task_t self = current_task(); + tasklabel_lock (self); + + int rc = mac_check_port_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return KERN_NO_ACCESS; + } +#endif + if (port->ip_receiver == ipc_space_kernel) { /* @@ -839,6 +864,7 @@ ip_release(port); ip_check_unlock(port); + kmsg->ikm_header.msgh_remote_port = MACH_PORT_NULL; ipc_kmsg_destroy(kmsg); return MACH_MSG_SUCCESS; ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_object.c#2 (text+ko) ==== @@ -989,6 +989,10 @@ #if MACH_ASSERT ipc_port_track_dealloc(port); #endif /* MACH_ASSERT */ + +#ifdef MAC + mac_destroy_port_label (&port->ip_label); +#endif } zfree(ipc_object_zones[otype], (vm_offset_t) object); } ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_port.c#2 (text+ko) ==== @@ -462,6 +462,10 @@ #endif /* MACH_ASSERT */ ipc_mqueue_init(&port->ip_messages, FALSE /* set */); + +#ifdef MAC + mac_init_port_label (&port->ip_label); +#endif } /* @@ -498,6 +502,14 @@ ipc_port_init(port, space, name); +#ifdef MAC + task_t issuer = current_task(); + tasklabel_lock2 (issuer, space->is_task); + mac_create_port (&issuer->maclabel, &space->is_task->maclabel, + &port->ip_label); + tasklabel_unlock2 (issuer, space->is_task); +#endif + *namep = name; *portp = port; @@ -537,6 +549,14 @@ ipc_port_init(port, space, name); +#ifdef MAC + task_t issuer = current_task(); + tasklabel_lock2 (issuer, space->is_task); + mac_create_port (&issuer->maclabel, &space->is_task->maclabel, + &port->ip_label); + tasklabel_unlock2 (issuer, space->is_task); +#endif + *portp = port; return KERN_SUCCESS; @@ -1137,6 +1157,16 @@ ipc_port_init(port, space, 1); +#ifdef MACXXX + task_t issuer = current_task(); + if (issuer && space->is_task) { + tasklabel_lock2 (issuer, space->is_task); + mac_create_port (&issuer->maclabel, &space->is_task->maclabel, + &port->ip_label); + tasklabel_unlock2 (issuer, space->is_task); + } +#endif + return port; } ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_port.h#2 (text+ko) ==== @@ -80,6 +80,8 @@ #include #include +#include + /* * A receive right (port) can be in four states: * 1) dead (not active, ip_timestamp has death time) @@ -146,6 +148,10 @@ unsigned long ip_spares[IP_NSPARES]; /* for debugging */ #endif /* MACH_ASSERT */ int alias; + +#ifdef MAC + struct label ip_label; +#endif }; ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_right.c#2 (text+ko) ==== @@ -1316,6 +1316,9 @@ mach_msg_type_name_t msgt_name) { ipc_entry_bits_t bits; +#ifdef MAC + task_t self = current_task(); +#endif bits= entry->ie_bits; assert(space->is_active); @@ -1323,10 +1326,37 @@ switch (msgt_name) { case MACH_MSG_TYPE_MAKE_SEND: case MACH_MSG_TYPE_MAKE_SEND_ONCE: + if ((bits & MACH_PORT_TYPE_RECEIVE) == 0) + return FALSE; + +#ifdef MAC + ipc_port_t port; + + port = (ipc_port_t) entry->ie_object; + ip_lock (port); + tasklabel_lock (self); + int rc = mac_check_port_make_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + ip_unlock (port); + if (rc) + return FALSE; +#endif + break; + case MACH_MSG_TYPE_MOVE_RECEIVE: if ((bits & MACH_PORT_TYPE_RECEIVE) == 0) return FALSE; +#ifdef MAC + port = (ipc_port_t) entry->ie_object; + ip_lock (port); + tasklabel_lock (self); + rc = mac_check_port_move_receive (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + ip_unlock (port); + if (rc) + return FALSE; +#endif break; case MACH_MSG_TYPE_COPY_SEND: @@ -1346,6 +1376,16 @@ ip_lock(port); active = ip_active(port); +#ifdef MAC + tasklabel_lock (self); + rc = mac_check_port_copy_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return FALSE; + } +#endif ip_unlock(port); if (!active) { @@ -1404,6 +1444,11 @@ ipc_port_t *sorightp) { ipc_entry_bits_t bits; +#ifdef MAC + task_t self = current_task(); + int rc; +#endif + int dead; bits = entry->ie_bits; @@ -1424,6 +1469,17 @@ assert(port->ip_receiver_name == name); assert(port->ip_receiver == space); +#ifdef MAC + tasklabel_lock (self); + rc = mac_check_port_make_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return KERN_NO_ACCESS; + } +#endif + port->ip_mscount++; port->ip_srights++; ip_reference(port); @@ -1448,6 +1504,17 @@ assert(port->ip_receiver_name == name); assert(port->ip_receiver == space); +#ifdef MAC + tasklabel_lock (self); + rc = mac_check_port_make_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return KERN_NO_ACCESS; + } +#endif + port->ip_sorights++; ip_reference(port); ip_unlock(port); @@ -1472,6 +1539,17 @@ assert(port->ip_receiver_name == name); assert(port->ip_receiver == space); +#ifdef MAC + tasklabel_lock (self); + rc = mac_check_port_move_receive (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return KERN_NO_ACCESS; + } +#endif + if (bits & MACH_PORT_TYPE_SEND) { assert(IE_BITS_TYPE(bits) == MACH_PORT_TYPE_SEND_RECEIVE); @@ -1518,12 +1596,26 @@ port = (ipc_port_t) entry->ie_object; assert(port != IP_NULL); - if (ipc_right_check(space, port, name, entry)) { - bits = entry->ie_bits; - goto copy_dead; - } + dead = ipc_right_check(space, port, name, entry); /* port is locked and active */ +#ifdef MAC + tasklabel_lock (self); + rc = mac_check_port_copy_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return KERN_NO_ACCESS; + } +#endif + + if (dead) + { + bits = entry->ie_bits; + goto copy_dead; + } + if ((bits & MACH_PORT_TYPE_SEND) == 0) { assert(IE_BITS_TYPE(bits) == MACH_PORT_TYPE_SEND_ONCE); assert(port->ip_sorights > 0); @@ -1560,11 +1652,24 @@ port = (ipc_port_t) entry->ie_object; assert(port != IP_NULL); - if (ipc_right_check(space, port, name, entry)) { - bits = entry->ie_bits; - goto move_dead; + dead = ipc_right_check(space, port, name, entry); + /* port is locked and active */ + +#ifdef MAC + tasklabel_lock (self); + rc = mac_check_port_copy_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return KERN_NO_ACCESS; + } +#endif + + if (dead) { + bits = entry->ie_bits; + goto move_dead; } - /* port is locked and active */ if ((bits & MACH_PORT_TYPE_SEND) == 0) { assert(IE_BITS_TYPE(bits) == MACH_PORT_TYPE_SEND_ONCE); @@ -1626,11 +1731,24 @@ port = (ipc_port_t) entry->ie_object; assert(port != IP_NULL); - if (ipc_right_check(space, port, name, entry)) { - bits = entry->ie_bits; - goto move_dead; + dead = ipc_right_check(space, port, name, entry); + /* port is locked and active */ + +#ifdef MAC + tasklabel_lock (self); + rc = mac_check_port_copy_send (&self->maclabel, &port->ip_label); + tasklabel_unlock (self); + if (rc) + { + ip_unlock (port); + return KERN_NO_ACCESS; + } +#endif + + if (dead) { + bits = entry->ie_bits; + goto move_dead; } - /* port is locked and active */ if ((bits & MACH_PORT_TYPE_SEND_ONCE) == 0) { assert(bits & MACH_PORT_TYPE_SEND); @@ -1803,6 +1921,10 @@ mach_port_urefs_t urefs; ipc_port_t port; ipc_port_t dnrequest = IP_NULL; +#ifdef MAC + task_t self = current_task(); + int rc; +#endif assert(space->is_active); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Jan 30 10:21:58 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EA41316A4D0; Fri, 30 Jan 2004 10:21:57 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C40CD16A4CE for ; Fri, 30 Jan 2004 10:21:57 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78BAB43D48 for ; Fri, 30 Jan 2004 10:21:27 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UILR0B028537 for ; Fri, 30 Jan 2004 10:21:27 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UILQ9o028528 for perforce@freebsd.org; Fri, 30 Jan 2004 10:21:26 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Fri, 30 Jan 2004 10:21:26 -0800 (PST) Message-Id: <200401301821.i0UILQ9o028528@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46203 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 18:21:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=46203 Change 46203 by areisse@areisse_ibook on 2004/01/30 10:20:50 Merged policy with mach IPC rules back to sedarwin testing policy. Affected files ... .. //depot/projects/trustedbsd/sedarwin/policy/Makefile#6 edit .. //depot/projects/trustedbsd/sedarwin/policy/bininclude.C#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/devfs#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/fc#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/flask/Makefile#1 branch .. //depot/projects/trustedbsd/sedarwin/policy/flask/access_vectors#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/flask/initial_sids#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/flask/security_classes#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/fs_use#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/initial_sid_contexts#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/initial_sids#1 branch .. //depot/projects/trustedbsd/sedarwin/policy/isiddefs#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/macros/global_macros.te#2 integrate .. //depot/projects/trustedbsd/sedarwin/policy/rules#5 integrate .. //depot/projects/trustedbsd/sedarwin/policy/users#4 integrate Differences ... ==== //depot/projects/trustedbsd/sedarwin/policy/Makefile#6 (text+ko) ==== @@ -1,8 +1,8 @@ include ../Makeconfig -default: policy.h +default: policy.16 -INPUTS = flask/security_classes flask/initial_sids \ +INPUTS = flask/security_classes initial_sids \ flask/access_vectors rules.m4 users initial_sid_contexts fs_use \ devfs @@ -12,9 +12,6 @@ policy.16: policy.conf checkpolicy -o $@ $< -policy.h: bininclude policy.16 - ./bininclude policy.16 policy.h binpolicy - rules.m4: rules m4 -Imacros -s $< > $@ @@ -24,13 +21,9 @@ genfs: fc.out cat $< | sed -ne 's/^\/[a-zA-Z0-9\/\.]* *[^ ]*$$/genfscon hfs &/p' > $@ -bininclude: bininclude.C - gcc -o $@ $< - -install: - cp policy.h ../apsl/xnu/security/sebsd/sebsd_policy.h - clean: rm -f bininclude policy.16 policy.conf policy.h rules.m4 fc.out \ genfs +relabel: fc + setfsmac -s $^ / ==== //depot/projects/trustedbsd/sedarwin/policy/bininclude.C#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin/policy/devfs#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin/policy/fc#2 (text+ko) ==== @@ -1,3 +1,15 @@ /.* system_u:object_r:file_t /bin/.* system_u:object_r:bin_t /bin/.*sh system_u:object_r:shell_exec_t +/usr/bin/.* system_u:object_r:bin_t +/usr/local/bin/.* system_u:object_r:bin_t +/sbin/.* system_u:object_r:bin_t +/usr/sbin/.* system_u:object_r:bin_t +/Applications/.* system_u:object_r:appl_t +/sbin/SystemStarter system_u:object_r:systemstarter_exec_t +/System/Library/CoreServices/coreservicesd system_u:object_r:coreservices_exec_t +/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow.real system_u:object_r:loginwindow_exec_t +/System/Library/CoreServices/pbs system_u:object_r:pbs_exec_t +/System/Library/CoreServices/RealWindowServer system_u:object_r:windowserver_exec_t +/System/Library/CoreServices/SecurityServer system_u:object_r:securityserver_exec_t +/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Support/coreservicesd system_u:object_r:coreservices_exec_t ==== //depot/projects/trustedbsd/sedarwin/policy/flask/access_vectors#2 (text+ko) ==== @@ -233,10 +233,6 @@ getcap setcap share - signull - getattr - setexec - setfscreate noatsecure } @@ -261,21 +257,15 @@ { send receive - destroy } class shm inherits ipc - -class posix_sem { - associate - disassociate - destroy - write - read + lock } + # # Define the access vector interpretation for the security server. # @@ -283,12 +273,16 @@ class security { compute_av - compute_create - compute_member - check_context + notify_perm + transition_sid + member_sid + sid_to_context + context_to_sid load_policy - compute_relabel - compute_user + get_sids + register_avc + change_sid + get_user_sids } @@ -367,9 +361,28 @@ lease } -class passwd +class mach_port +{ + relabelfrom + relabelto + send + recv + make_send + copy_send + move_recv +} + +class mach_task { - passwd - chfn - chsh + terminate + set_special_port } + +class mach_names +{ + register + look_up + getparent + makesubset + create_server +}; ==== //depot/projects/trustedbsd/sedarwin/policy/flask/initial_sids#2 (text+ko) ==== @@ -28,7 +28,10 @@ sid sysctl_vm sid sysctl_dev sid kmod +sid devfs +sid devpts +sid nfs sid policy -sid scmp_packet +sid tmpfs # FLASK ==== //depot/projects/trustedbsd/sedarwin/policy/flask/security_classes#2 (text+ko) ==== @@ -40,14 +40,11 @@ class shm class ipc -#Posix.1b-related classes -class posix_sem +class mach_port -# -# userspace object manager classes -# +#classes only used by name -# passwd/chfn/chsh -class passwd +class mach_task +class mach_names # FLASK ==== //depot/projects/trustedbsd/sedarwin/policy/fs_use#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin/policy/initial_sid_contexts#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin/policy/isiddefs#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin/policy/macros/global_macros.te#2 (text+ko) ==== @@ -1158,3 +1158,23 @@ allow $1_t etc_t:dir r_dir_perms; ') + +##### + +define(`allow_mach_ipc', ` +allow $1 $2:mach_port { send copy_send make_send }; +allow $2 $1:mach_port { send copy_send make_send }; +') + +define(`mach_bootstrap', ` +allow $1 $2:mach_port { send copy_send make_send }; +allow $1 $3:mach_names look_up; +allow init_d $1:mach_port { send copy_send }; +') + +define(`mach_bootstrap_register', ` +allow $1 $2:mach_names register; +allow $1 $2:mach_port { send copy_send }; +allow init_d $1:mach_port { send copy_send }; +') + ==== //depot/projects/trustedbsd/sedarwin/policy/rules#5 (text+ko) ==== @@ -1,4 +1,5 @@ attribute domain; +attribute domain2; attribute file; attribute fs; @@ -9,12 +10,12 @@ type bin_t, file; type shell_exec_t, file; type login_exec_t, file; -type init_d, domain; -type login_d, domain; -type user_d, domain; -type user_secret_d, domain; -type sysadm_d, domain; -type kernel_d, domain; +type init_d, domain, domain2; +type login_d, domain, domain2; +type user_d, domain, domain2; +type user_secret_d, domain, domain2; +type sysadm_d, domain, domain2; +type kernel_d, domain, domain2; type security_t; type fs_t, fs; type devpts_t; @@ -28,14 +29,53 @@ type console_device_t; type random_device_t; type secret_t; +type user_port_t; +type time_port_t; + +type boot_names_t; +type user_names_t; + +type root_t, file; +type appl_t, file; +type lib_t, file; + +type pbs_d, domain, domain2; +type cron_d, domain, domain2; +type loginwindow_d, domain, domain2; +type windowserver_d, domain, domain2; +type securityserver_d, domain, domain2; +type coreservices_d, domain, domain2; +type systemstarter_d, domain, domain2; +type lookupd_d, domain, domain2; +type directoryservice_d, domain, domain2; +type pbs_exec_t, file; +type cron_exec_t, file; +type loginwindow_exec_t, file; +type windowserver_exec_t, file; +type securityserver_exec_t, file; +type coreservices_exec_t, file; +type systemstarter_exec_t, file; +type lookupd_exec_t, file; +type directoryservice_exec_t, file; + role system_r types init_d; role system_r types login_d; role system_r types user_d; role system_r types sysadm_d; +role system_r types pbs_d; +role system_r types cron_d; +role system_r types loginwindow_d; +role system_r types windowserver_d; +role system_r types securityserver_d; +role system_r types coreservices_d; +role system_r types systemstarter_d; +role system_r types directoryservice_d; +role system_r types lookupd_d; role system_r types security_t; role system_r types unlabeled_t; role system_r types kernel_d; +role system_r types boot_names_t; #role object_r types file_t; #role object_r types bin_t; role object_r types shell_exec_t; @@ -45,6 +85,7 @@ role object_r types sysadm_devpts_t; role object_r types secret_t; role user_r types user_d; +role user_r types user_port_t; role user_secret_r types user_secret_d; role sysadm_r types sysadm_d; @@ -61,19 +102,182 @@ domain_trans(login_d,shell_exec_t,user_d); domain_trans(login_d,shell_exec_t,user_secret_d); domain_trans(login_d,shell_exec_t,sysadm_d); + +domain_trans(windowserver_d,shell_exec_t,user_d); +domain_trans(windowserver_d,shell_exec_t,user_secret_d); +domain_trans(windowserver_d,shell_exec_t,sysadm_d); + type_change user_d devpts_t:chr_file user_devpts_t; -allow domain file:{file lnk_file sock_file} {create_file_perms execute }; -allow domain file:file execute_no_trans; -allow domain file:dir { create_dir_perms }; -allow domain {null_device_t console_device_t memory_device_t random_device_t zero_device_t device_t}:{file chr_file} create_file_perms; -allow domain device_t:blk_file create_file_perms; -allow domain {devpts_t user_devpts_t sysadm_devpts_t}:chr_file create_file_perms; -allow domain domain:process { signal sigkill setsched getsession }; -allow domain file:{dir file lnk_file sock_file} { relabelfrom relabelto }; +allow domain self:mach_port { send make_send copy_send move_recv }; +allow domain kernel_d:mach_port { send make_send copy_send }; +allow domain self:mach_task set_special_port; +allow domain self:mach_names { look_up }; +allow domain root_t:dir { search getattr read }; +allow kernel_d domain:mach_port { send make_send copy_send }; + +allow domain2 file:{file lnk_file sock_file} {create_file_perms execute }; +allow domain2 file:file execute_no_trans; +allow domain2 file:dir { create_dir_perms }; +allow domain2 {null_device_t console_device_t memory_device_t random_device_t zero_device_t device_t}:{file chr_file} create_file_perms; +allow domain2 device_t:blk_file create_file_perms; +allow domain2 {devpts_t user_devpts_t sysadm_devpts_t}:chr_file create_file_perms; +allow domain2 domain:process { signal sigkill setsched getsession }; +allow domain2 file:{dir file lnk_file sock_file} { relabelfrom relabelto }; + +domain_auto_trans(init_d,windowserver_exec_t,windowserver_d); +domain_auto_trans(systemstarter_d,windowserver_exec_t,windowserver_d); +domain_auto_trans(init_d,loginwindow_exec_t,loginwindow_d); +domain_auto_trans(init_d,systemstarter_exec_t,systemstarter_d); +domain_auto_trans(systemstarter_d,securityserver_exec_t,securityserver_d); +domain_auto_trans(systemstarter_d,coreservices_exec_t,coreservices_d); +domain_auto_trans(systemstarter_d,cron_exec_t,cron_d); +domain_auto_trans(systemstarter_d,lookupd_exec_t,lookupd_d); +domain_auto_trans(loginwindow_d,pbs_exec_t,pbs_d); allow user_secret_d secret_t:{file lnk_file} create_file_perms; allow user_secret_d secret_t:dir { create_file_perms rw_dir_perms }; allow user_secret_d { secret_t unlabeled_t file_t }:{file dir} { relabelfrom relabelto }; allow secret_t fs:filesystem associate; +#type_change user_d user_d:mach_port user_port_t; + +allow_mach_ipc(securityserver_d,coreservices_d); +allow_mach_ipc(securityserver_d,loginwindow_d); +allow_mach_ipc(securityserver_d,windowserver_d); + +allow_mach_ipc(loginwindow_d,windowserver_d); +allow_mach_ipc(loginwindow_d,unlabeled_t); +allow_mach_ipc(loginwindow_d,user_d); + +#allow init_d { unlabeled_t init_d login_d kernel_d user_d windowserver_d }:mach_port { send make_send copy_send move_recv }; +#allow kernel_d { unlabeled_t windowserver_d init_d kernel_d user_d }:mach_port { send make_send copy_send }; +#allow login_d { init_d windowserver_d unlabeled_t user_d }:mach_port { send make_send copy_send }; +#allow user_d { user_d init_d windowserver_d user_port_t unlabeled_t coreservices_d }:mach_port { send make_send copy_send }; +allow loginwindow_d { unlabeled_t windowserver_d }:mach_port { send make_send copy_send }; +#allow windowserver_d { init_d loginwindow_d coreservices_d unlabeled_t user_d securityserver_d }:mach_port { send make_send copy_send }; +#allow coreservices_d { user_d securityserver_d }:mach_port { send make_send copy_send }; +#allow securityserver_d { windowserver_d coreservices_d }:mach_port { send make_send copy_send }; +allow init_d self:mach_names { register look_up }; +allow user_d { user_d init_d }:mach_names { register look_up }; + +allow kernel_d {user_names_t boot_names_t}:mach_port send; + +allow_mach_ipc(init_d,coreservices_d); #??? +mach_bootstrap(init_d,boot_names_t,boot_names_t); #??? +type_change loginwindow_d loginwindow_d:mach_names user_names_t; +allow init_d init_d:mach_port relabelfrom; +allow init_d boot_names_t:mach_port relabelto; +allow init_d user_names_t:mach_port { copy_send relabelto }; +allow init_d boot_names_t:mach_names { register create_server }; #??? +mach_bootstrap(init_d,user_names_t,securityserver_d); #??? + +allow_mach_ipc(systemstarter_d,unlabeled_t); +allow_mach_ipc(systemstarter_d,boot_names_t); +allow_mach_ipc(systemstarter_d,init_d); +allow_mach_ipc(systemstarter_d,lookupd_d); +allow_mach_ipc(systemstarter_d,coreservices_d); +mach_bootstrap(systemstarter_d,boot_names_t,coreservices_d); +mach_bootstrap(systemstarter_d,boot_names_t,securityserver_d); +mach_bootstrap(systemstarter_d,boot_names_t,windowserver_d); +mach_bootstrap(systemstarter_d,boot_names_t,boot_names_t); +allow systemstarter_d init_d:mach_names look_up; +allow systemstarter_d boot_names_t:mach_names { register create_server }; + +mach_bootstrap(coreservices_d,boot_names_t,boot_names_t); +mach_bootstrap(coreservices_d,boot_names_t,init_d); +mach_bootstrap(coreservices_d,boot_names_t,systemstarter_d); #??? +mach_bootstrap_register(coreservices_d,boot_names_t); + +mach_bootstrap_register(windowserver_d,user_names_t); +allow_mach_ipc(windowserver_d,user_d); +mach_bootstrap(windowserver_d,user_names_t,systemstarter_d); +mach_bootstrap(windowserver_d,user_names_t,pbs_d); +mach_bootstrap(windowserver_d,user_names_t,coreservices_d); +mach_bootstrap(windowserver_d,user_names_t,user_names_t); +mach_bootstrap(windowserver_d,user_names_t,init_d); +mach_bootstrap(windowserver_d,boot_names_t,boot_names_t); +mach_bootstrap(windowserver_d,boot_names_t,coreservices_d); +mach_bootstrap(windowserver_d,boot_names_t,windowserver_d); +allow_mach_ipc(windowserver_d,systemstarter_d); +allow_mach_ipc(windowserver_d,pbs_d); +allow_mach_ipc(windowserver_d,lookupd_d); +allow_mach_ipc(windowserver_d,init_d); # for wsloginui +allow_mach_ipc(windowserver_d,coreservices_d); # for wsloginui +mach_bootstrap_register(windowserver_d,boot_names_t); + +allow_mach_ipc(loginwindow_d,coreservices_d); +allow_mach_ipc(loginwindow_d,init_d); +allow_mach_ipc(loginwindow_d,lookupd_d); +allow_mach_ipc(loginwindow_d,systemstarter_d); +mach_bootstrap(loginwindow_d,user_names_t,user_names_t); +mach_bootstrap(loginwindow_d,user_names_t,coreservices_d); +mach_bootstrap(loginwindow_d,boot_names_t,init_d); +mach_bootstrap(loginwindow_d,boot_names_t,boot_names_t); +mach_bootstrap(loginwindow_d,boot_names_t,windowserver_d); +mach_bootstrap(loginwindow_d,boot_names_t,securityserver_d); +mach_bootstrap(loginwindow_d,user_names_t,systemstarter_d); #??? +mach_bootstrap(loginwindow_d,user_names_t,user_d); #??? +mach_bootstrap_register(loginwindow_d,user_names_t); +mach_bootstrap_register(loginwindow_d,boot_names_t); +allow loginwindow_d boot_names_t:mach_names makesubset; +allow loginwindow_d user_names_t:mach_names create_server; + +mach_bootstrap(securityserver_d,user_names_t,user_names_t); +mach_bootstrap(securityserver_d,user_names_t,user_d); +mach_bootstrap_register(securityserver_d,user_names_t); +mach_bootstrap_register(securityserver_d,boot_names_t); +mach_bootstrap(securityserver_d,boot_names_t,init_d); +mach_bootstrap(securityserver_d,boot_names_t,boot_names_t); +mach_bootstrap(securityserver_d,boot_names_t,coreservices_d); +mach_bootstrap(securityserver_d,boot_names_t,windowserver_d); +mach_bootstrap(securityserver_d,boot_names_t,systemstarter_d); #??? +allow_mach_ipc(securityserver_d,init_d); #??? +allow_mach_ipc(securityserver_d,systemstarter_d); #??? +allow_mach_ipc(securityserver_d,lookupd_d); + +allow_mach_ipc(lookupd_d,coreservices_d); +allow_mach_ipc(lookupd_d,init_d); #DirectoryService? +allow_mach_ipc(lookupd_d,cron_d); +mach_bootstrap(lookupd_d,boot_names_t,boot_names_t); +allow lookupd_d boot_names_t:mach_names create_server; + +mach_bootstrap(cron_d,boot_names_t,init_d); +allow_mach_ipc(cron_d,init_d); + +allow_mach_ipc(user_d,systemstarter_d); +allow_mach_ipc(user_d,init_d); +allow_mach_ipc(user_d,coreservices_d); #SystemUIServer +mach_bootstrap(user_d,user_names_t,coreservices_d); +mach_bootstrap(user_d,user_names_t,pbs_d); +mach_bootstrap(user_d,user_names_t,loginwindow_d); +mach_bootstrap(user_d,user_names_t,securityserver_d); +mach_bootstrap(user_d,user_names_t,windowserver_d); +mach_bootstrap(user_d,user_names_t,systemstarter_d); #??? +mach_bootstrap_register(user_d,user_names_t); +mach_bootstrap(user_d,user_names_t,user_names_t); +allow_mach_ipc(user_d,securityserver_d); +allow_mach_ipc(user_d,lookupd_d); +allow_mach_ipc(pbs_d,user_d); + +allow pbs_d appl_t:dir { search getattr read }; +allow pbs_d appl_t:file { read getattr }; +allow pbs_d user_d:mach_port { send copy_send }; +allow pbs_d lib_t:dir { search getattr }; +allow pbs_d lib_t:file { read getattr }; +mach_bootstrap_register(pbs_d,user_names_t); +mach_bootstrap(pbs_d,user_names_t,coreservices_d); +allow_mach_ipc(pbs_d,init_d); +mach_bootstrap(pbs_d,user_names_t,init_d) #??? +allow_mach_ipc(pbs_d,lookupd_d); +allow_mach_ipc(pbs_d,coreservices_d); + +allow_mach_ipc(kernel_d,unlabeled_t); +allow_mach_ipc(cron_d,unlabeled_t); +allow_mach_ipc(init_d,unlabeled_t); +allow_mach_ipc(pbs_d,unlabeled_t); +allow_mach_ipc(user_d,unlabeled_t); +allow_mach_ipc(lookupd_d,unlabeled_t); +allow_mach_ipc(coreservices_d,unlabeled_t); +allow_mach_ipc(windowserver_d,unlabeled_t); +allow_mach_ipc(securityserver_d,unlabeled_t); ==== //depot/projects/trustedbsd/sedarwin/policy/users#4 (text+ko) ==== From owner-p4-projects@FreeBSD.ORG Fri Jan 30 10:29:42 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C53C116A4D2; Fri, 30 Jan 2004 10:29:41 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F0ED16A4CE for ; Fri, 30 Jan 2004 10:29:41 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E728143D1D for ; Fri, 30 Jan 2004 10:29:37 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UITb0B029606 for ; Fri, 30 Jan 2004 10:29:37 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UITbkj029603 for perforce@freebsd.org; Fri, 30 Jan 2004 10:29:37 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Fri, 30 Jan 2004 10:29:37 -0800 (PST) Message-Id: <200401301829.i0UITbkj029603@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46204 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 18:29:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=46204 Change 46204 by areisse@areisse_ibook on 2004/01/30 10:29:28 Build stubs for security.defs to be included in libmac. Affected files ... .. //depot/projects/trustedbsd/sedarwin/libmac/Makefile#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/libmac/Makefile#3 (text+ko) ==== @@ -1,7 +1,12 @@ include ../Makeconfig -OBJS = mac.o mac_get.o mac_set.o mac_exec.o +OBJS = mac.o mac_get.o mac_set.o mac_exec.o security.o + +VPATH = $(EXPORT_HDRS)/osfmk/mach /usr/include/mach + +%.c: %.defs + mig $(CFLAGS) -user $@ -header /dev/null -server /dev/null -sheader /dev/null $< libmac.a: $(OBJS) ar cr $@ $(OBJS) @@ -12,3 +17,6 @@ clean: rm -f $(OBJS) libmac.a + +security.o: security.c + gcc -c -o $@ $< From owner-p4-projects@FreeBSD.ORG Fri Jan 30 10:30:43 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D63DA16A4D1; Fri, 30 Jan 2004 10:30:42 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B204A16A4CE for ; Fri, 30 Jan 2004 10:30:42 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D217443D4C for ; Fri, 30 Jan 2004 10:30:39 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UIUd0B029782 for ; Fri, 30 Jan 2004 10:30:39 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UIUdDE029779 for perforce@freebsd.org; Fri, 30 Jan 2004 10:30:39 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Fri, 30 Jan 2004 10:30:39 -0800 (PST) Message-Id: <200401301830.i0UIUdDE029779@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46205 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 18:30:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=46205 Change 46205 by jhb@jhb_slimer on 2004/01/30 10:29:41 Add bde optimizations to reduce partial register stalls. Affected files ... .. //depot/projects/smpng/sys/i386/isa/atpic_vector.s#5 edit Differences ... ==== //depot/projects/smpng/sys/i386/isa/atpic_vector.s#5 (text+ko) ==== @@ -67,9 +67,12 @@ cmp $KPSEL,%ax ; /* are we already in the kernel? */ \ je 1f ; /* skip expensive segment reloads */ \ mov $KDSEL,%ax ; /* load kernel ds, es and fs */ \ + data16 ; \ mov %ax,%ds ; \ + data16 ; \ mov %ax,%es ; \ mov $KPSEL,%ax ; \ + data16 ; \ mov %ax,%fs ; \ 1: ; \ FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \ From owner-p4-projects@FreeBSD.ORG Fri Jan 30 10:31:45 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BF36516A4D0; Fri, 30 Jan 2004 10:31:44 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AE1016A4CE for ; Fri, 30 Jan 2004 10:31:44 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14DEE43D41 for ; Fri, 30 Jan 2004 10:31:42 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UIVf0B030920 for ; Fri, 30 Jan 2004 10:31:41 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UIVfpF030914 for perforce@freebsd.org; Fri, 30 Jan 2004 10:31:41 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Fri, 30 Jan 2004 10:31:41 -0800 (PST) Message-Id: <200401301831.i0UIVfpF030914@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46207 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 18:31:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=46207 Change 46207 by areisse@areisse_ibook on 2004/01/30 10:30:40 Document build procedure for init and bootloader, and configuring the bootloader to load the sebsd policy. Affected files ... .. //depot/projects/trustedbsd/sedarwin/bootstrap_instructions.txt#24 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/bootstrap_instructions.txt#24 (text+ko) ==== @@ -162,6 +162,30 @@ make ; sudo make install cd .. +Step 9.1: Build and install modified MiG program + cd apsl/bootstrap_cmds/migcom.tproj + make ; sudo make install + cd ../../.. + + This mig program is compatible with old kernels as well, as long as the + new features are not used. + +Step 9.2: Build modified mach_init + cd apsl/system_cmds/mach_init.tproj + make ; sudo make install + cd ../../.. + +Step 9.3: Build modified bootloader + The modified bootloader is necessary to read the security policy before + the root filesystem is available. It might work with other kernels as + well. + BEFORE installing this bootloader, make sure you have a working backup + partition (that boots) on the same machine. + cd apsl/BootX + chmod u+w bootx.tproj/bootinfo.hdr + make + sudo cp bootx.bootinfo /System/Library/CoreServices/BootX + Step 10: Build, Install wslogin and WindowServer wrapper In order to allow users to select roles during GUI login, you must @@ -190,22 +214,16 @@ Step 11: Build SEDarwin Sample Policy - We provide a minimal sample policy; due to current limitations in loading the - policy at boot-time, we link the sample policy directly into the Darwin kernel - (yes, this is just temporary!). When the policy is built, you end up with - a policy.h file that will get copied into the XNU tree for the kernel build. - Our sample policy file ships with three users: root, andrew, and rwatson. Chances are, you'll want to add a line for your own user based on one of those lines. cd policy - make ; make install + make + sudo cp policy.16 / + sudo nvram load_sebsd_policy=policy.16 cd .. - Until we have this fixed, remember that when you change the policy, you need - to re-install and remake the XNU kernel. - Step 12: Build XNU NOTE: If you skipped the long and tedious elements of Step 2 above, @@ -306,10 +324,10 @@ /sbin/fsck -y /sbin/mount -uw / - Now set the label on the WindowServer binary so that it can transition - during login: + Now set the label on various binaries so they can transition + during system startup: - setfmac sebsd/system_u:object_r:login_exec_t \ - /System/Library/CoreServices/RealWindowServer + cd policy; make relabel - Missing this step will result in login attempts failing. + Missing this step will result in login attempts failing, or + the entire system not working if enforcing mode is enabled. From owner-p4-projects@FreeBSD.ORG Fri Jan 30 11:56:32 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C07C016A4D0; Fri, 30 Jan 2004 11:56:31 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9442316A4CE for ; Fri, 30 Jan 2004 11:56:31 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D10F643D1F for ; Fri, 30 Jan 2004 11:56:30 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UJuU0B050176 for ; Fri, 30 Jan 2004 11:56:30 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UJuUJv050173 for perforce@freebsd.org; Fri, 30 Jan 2004 11:56:30 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 11:56:30 -0800 (PST) Message-Id: <200401301956.i0UJuUJv050173@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46217 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 19:56:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=46217 Change 46217 by sam@sam_ebb on 2004/01/30 11:56:18 add 802.1x authentication type Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.h#9 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.h#9 (text+ko) ==== @@ -530,9 +530,10 @@ enum { IEEE80211_AUTH_NONE = 0, - IEEE80211_AUTH_OPEN = 1, - IEEE80211_AUTH_SHARED = 2, - IEEE80211_AUTH_AUTO = 3, /* auto-select/accept */ + IEEE80211_AUTH_OPEN = 1, /* open */ + IEEE80211_AUTH_SHARED = 2, /* shared-key */ + IEEE80211_AUTH_8021X = 3, /* 802.1x */ + IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */ }; #endif /* _NET80211_IEEE80211_H_ */ From owner-p4-projects@FreeBSD.ORG Fri Jan 30 11:57:34 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0DA9416A4D0; Fri, 30 Jan 2004 11:57:34 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD6EC16A4CE for ; Fri, 30 Jan 2004 11:57:33 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA1B143D31 for ; Fri, 30 Jan 2004 11:57:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UJvW0B050200 for ; Fri, 30 Jan 2004 11:57:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UJvWI2050197 for perforce@freebsd.org; Fri, 30 Jan 2004 11:57:32 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 11:57:32 -0800 (PST) Message-Id: <200401301957.i0UJvWI2050197@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46218 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 19:57:34 -0000 http://perforce.freebsd.org/chv.cgi?CH=46218 Change 46218 by sam@sam_ebb on 2004/01/30 11:57:18 o define a per-station/node statistics block o add stat for frames dropped 'cuz a station hadn't completed 802.1x authentication Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#5 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#5 (text+ko) ==== @@ -39,6 +39,46 @@ * IEEE 802.11 ioctls. */ +/* + * Per/node (station) statistics available when operating as an AP. + */ +struct ieee80211_nodestats { + u_int32_t ns_rx_data; /* rx data frames */ + u_int32_t ns_rx_mgmt; /* rx management frames */ + u_int32_t ns_rx_ctrl; /* rx control frames */ + u_int32_t ns_rx_ucast; /* rx unicast frames */ + u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */ + u_int64_t ns_rx_bytes; /* rx data count (bytes) */ + + u_int32_t ns_rx_dup; /* rx discard 'cuz dup */ + u_int32_t ns_rx_nowep; /* rx w/ wep but wep !config */ + u_int32_t ns_rx_wepfail; /* rx wep processing failed */ + u_int32_t ns_rx_decap; /* rx decapsulation failed */ + u_int32_t ns_rx_disassoc; /* rx disassociation */ + u_int32_t ns_rx_deauth; /* rx deauthentication */ + u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */ + u_int32_t ns_rx_not1xauth; /* rx data before 802.1x auth */ + + u_int32_t ns_tx_data; /* tx data frames */ + u_int32_t ns_tx_mgmt; /* tx management frames */ + u_int32_t ns_tx_ucast; /* tx unicast frames */ + u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */ + u_int64_t ns_tx_bytes; /* tx data count (bytes) */ + + /* MIB-related state */ + u_int32_t ns_mib_assoc; /* [re]associations */ + u_int32_t ns_mib_assoc_fail; /* [re]association failures */ + u_int32_t ns_mib_auth; /* [re]authentications */ + u_int32_t ns_mib_auth_fail; /* [re]authentication failures*/ + u_int32_t ns_mib_deauth; /* deauthentications */ + u_int32_t ns_mib_deauth_code; /* last deauth reason */ + u_int32_t ns_mib_disassoc; /* disassociations */ + u_int32_t ns_mib_disassoc_code; /* last disassociation reason */ +}; + +/* + * Summary statistics. + */ struct ieee80211_stats { u_int32_t is_rx_badversion; /* rx frame with bad version */ u_int32_t is_rx_tooshort; /* rx frame too short */ @@ -74,6 +114,7 @@ u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */ u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/ u_int32_t is_rx_bad_auth; /* rx bad auth request */ + u_int32_t is_rx_not1xauth; /* rx data before 802.1x auth */ u_int32_t is_tx_nobuf; /* tx failed for lack of buf */ u_int32_t is_tx_nonode; /* tx failed for no node */ u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */ From owner-p4-projects@FreeBSD.ORG Fri Jan 30 12:00:39 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4711016A4D0; Fri, 30 Jan 2004 12:00:39 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2068416A4CE for ; Fri, 30 Jan 2004 12:00:39 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C845A43D1F for ; Fri, 30 Jan 2004 12:00:37 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UK0b0B050377 for ; Fri, 30 Jan 2004 12:00:37 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UK0bvb050374 for perforce@freebsd.org; Fri, 30 Jan 2004 12:00:37 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 12:00:37 -0800 (PST) Message-Id: <200401302000.i0UK0bvb050374@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46220 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 20:00:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=46220 Change 46220 by sam@sam_ebb on 2004/01/30 11:59:45 o add include ieee80211_ioctl.h for per-station/node statistics block o add per-station statistics block o add per-station authentication mode o add per-station txpower o add flags field o replace power save field with a bit flag o shuffle members around to pack structure a bit; the old organization by function was too fragile Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#5 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#5 (text+ko) ==== @@ -35,6 +35,8 @@ #ifndef _NET80211_IEEE80211_NODE_H_ #define _NET80211_IEEE80211_NODE_H_ +#include /* for ieee80211_nodestats */ + #define IEEE80211_PSCAN_WAIT 5 /* passive scan wait */ #define IEEE80211_TRANS_WAIT 5 /* transition wait */ #define IEEE80211_INACT_WAIT 5 /* inactivity timer interval */ @@ -64,6 +66,22 @@ LIST_ENTRY(ieee80211_node) ni_hash; u_int ni_refcnt; u_int ni_scangen; /* gen# for timeout scan */ + u_int8_t ni_fragno; /* frag # of previous frame */ + u_int8_t ni_authmode; /* authentication algorithm */ + u_int16_t ni_flags; /* special-purpose state */ +#define IEEE80211_NODE_AUTH 0x0001 /* 802.1x auth complete */ +#define IEEE80211_NODE_WPA 0x0002 /* WPA enabled */ +#define IEEE80211_NODE_QOS 0x0004 /* QoS enabled */ +/* NB: this must have the same value as IEEE80211_FC1_PWR_MGT */ +#define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ + u_int16_t ni_associd; /* assoc response */ + u_int16_t ni_txpower; /* current transmit power */ + u_int32_t *ni_challenge; /* shared-key challenge */ + u_int16_t ni_txseq; /* seq to be transmitted */ + u_int16_t ni_rxseq; /* seq previous received */ + u_int16_t ni_rxseqs[16]; /* seq previous for qos frames*/ + u_int32_t ni_rxfragstamp; /* time stamp of last rx frag */ + struct mbuf *ni_rxfrag[3]; /* rx frag reassembly */ /* hardware */ u_int32_t ni_rstamp; /* recv timestamp */ @@ -96,24 +114,12 @@ u_int16_t ni_timoffset; #endif - /* power saving mode */ - u_int8_t ni_pwrsave; + /* others */ struct ifqueue ni_savedq; /* packets queued for pspoll */ - - /* fragment reassembly */ - u_int8_t ni_fragno; /* frag # of previous frame */ - u_int32_t ni_rxfragstamp; /* time stamp of last rx frag */ - struct mbuf *ni_rxfrag[3]; /* rx frag reassembly */ - - /* others */ - u_int16_t ni_associd; /* assoc response */ - u_int16_t ni_txseq; /* seq to be transmitted */ - u_int16_t ni_rxseq; /* seq previous received */ - u_int16_t ni_rxseqs[16]; /* seq previous for qos frames*/ int ni_fails; /* failure count to associate */ int ni_inact; /* inactivity mark count */ int ni_txrate; /* index to ni_rates[] */ - u_int32_t *ni_challenge; /* shared-key challenge */ + struct ieee80211_nodestats ni_stats; /* per-node statistics */ }; static __inline struct ieee80211_node * From owner-p4-projects@FreeBSD.ORG Fri Jan 30 12:03:49 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F089D16A4D0; Fri, 30 Jan 2004 12:03:48 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3E6016A4CF for ; Fri, 30 Jan 2004 12:03:48 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9689F43D2D for ; Fri, 30 Jan 2004 12:03:42 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UK3g0B053054 for ; Fri, 30 Jan 2004 12:03:42 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UK3fQE053051 for perforce@freebsd.org; Fri, 30 Jan 2004 12:03:41 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 12:03:41 -0800 (PST) Message-Id: <200401302003.i0UK3fQE053051@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46221 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 20:03:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=46221 Change 46221 by sam@sam_ebb on 2004/01/30 12:03:05 o move authentication mode and transmit power from per-ap to per-instance; each station automatically inherits the default setting from ic_bss o update ioctl authemod checks to allow 802.1x o relax check on setting shared key authentication: instead of requiring wep be enabled, settle for wep being supported; this allows folks to set things out of order (otherwise folks will get confused when setting shared key auth fails because wep hasn't yet been enabled) Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#12 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#5 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#12 (text+ko) ==== @@ -225,7 +225,7 @@ wreq.wi_len = 1; break; case WI_RID_CNFAUTHMODE: - wreq.wi_val[0] = htole16(ic->ic_authmode); + wreq.wi_val[0] = htole16(ic->ic_bss->ni_authmode); wreq.wi_len = 1; break; case WI_RID_ENCRYPTION: @@ -657,13 +657,15 @@ case WI_RID_CNFAUTHMODE: if (len != 2) return EINVAL; - if (le16toh(wreq.wi_val[0]) > IEEE80211_AUTH_SHARED) + /* XXX no AUTO mode support yet */ + if (le16toh(wreq.wi_val[0]) > IEEE80211_AUTH_8021X) return EINVAL; - /* shared key authentication requires WEP */ - if (le16toh(wreq.wi_val[0]) == IEEE80211_AUTH_SHARED && - (ic->ic_flags & IEEE80211_F_WEPON) == 0) + /* shared key/802.1x authentication requires WEP support */ + if ((le16toh(wreq.wi_val[0]) == IEEE80211_AUTH_SHARED || + le16toh(wreq.wi_val[0]) == IEEE80211_AUTH_8021X) && + (ic->ic_caps & IEEE80211_C_WEP) == 0) return EINVAL; - ic->ic_authmode = le16toh(wreq.wi_val[0]); + ic->ic_bss->ni_authmode = le16toh(wreq.wi_val[0]); error = ieee80211_reset(ic); break; case WI_RID_ENCRYPTION: @@ -878,7 +880,7 @@ ireq->i_val = ic->ic_wep_txkey; break; case IEEE80211_IOC_AUTHMODE: - ireq->i_val = ic->ic_authmode; + ireq->i_val = ic->ic_bss->ni_authmode; break; case IEEE80211_IOC_CHANNEL: ireq->i_val = ieee80211_chan2ieee(ic, getcurchan(ic)); @@ -971,18 +973,19 @@ break; case IEEE80211_IOC_AUTHMODE: if (!(IEEE80211_AUTH_NONE <= ireq->i_val && - ireq->i_val <= IEEE80211_AUTH_SHARED)) { + ireq->i_val <= IEEE80211_AUTH_8021X)) { error = EINVAL; break; } - if (ireq->i_val == IEEE80211_AUTH_SHARED && - (ic->ic_flags & IEEE80211_F_WEPON) == 0) { - /* shared key authentication requires WEP */ + /* shared key/802.1x authentication requires WEP */ + if ((ireq->i_val == IEEE80211_AUTH_SHARED || + ireq->i_val == IEEE80211_AUTH_8021X) && + (ic->ic_caps & IEEE80211_C_WEP) == 0) { error = EINVAL; break; } - if (ic->ic_authmode != ireq->i_val) { - ic->ic_authmode = ireq->i_val; + if (ic->ic_bss->ni_authmode != ireq->i_val) { + ic->ic_bss->ni_authmode = ireq->i_val; error = ieee80211_reset(ic); } break; ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#5 (text+ko) ==== @@ -98,10 +98,19 @@ void ieee80211_node_lateattach(struct ieee80211com *ic) { + struct ieee80211_node *ni; - ic->ic_bss = (*ic->ic_node_alloc)(ic); - KASSERT(ic->ic_bss != NULL, ("unable to setup inital BSS node")); - ic->ic_bss->ni_chan = IEEE80211_CHAN_ANYC; + /* NB: allocator is responsible for initializing the structure */ + ni = (*ic->ic_node_alloc)(ic); + KASSERT(ni != NULL, ("unable to setup inital BSS node")); + /* + * Setup "global settings" in the bss node so that + * each new station automatically inherits them. + */ + ni->ni_chan = IEEE80211_CHAN_ANYC; + ni->ni_authmode = ic->ic_authmode; + ni->ni_txpower = ic->ic_txpower; + ic->ic_bss = ni; } void From owner-p4-projects@FreeBSD.ORG Fri Jan 30 12:10:41 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D784416A4D0; Fri, 30 Jan 2004 12:10:40 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91AC016A4CE for ; Fri, 30 Jan 2004 12:10:40 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADE9D43D1D for ; Fri, 30 Jan 2004 12:10:36 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0UKAa0B053323 for ; Fri, 30 Jan 2004 12:10:36 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0UKAamq053320 for perforce@freebsd.org; Fri, 30 Jan 2004 12:10:36 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 12:10:36 -0800 (PST) Message-Id: <200401302010.i0UKAamq053320@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46223 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2004 20:10:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=46223 Change 46223 by sam@sam_ebb on 2004/01/30 12:09:35 o change pspoll handling to reflect replacement of ni_pwrsave by ni_flags (with power save flag chosen to be identical to frame bit to simplify checking on the input path) o move bpf tap at the 802.11 layer to be after fragment reassembly; the idea is that radiotap handles "raw frames" at the driver level and the 802.11-level tap provides reassembled and decrypted frames (based on discussion with David Young) o add 802.1x check to reject data frames received prior to port authentication Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#10 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#10 (text+ko) ==== @@ -202,31 +202,33 @@ ni->ni_inact = 0; } - if (ic->ic_set_tim != NULL && - (wh->i_fc[1] & IEEE80211_FC1_PWR_MGT) - && ni->ni_pwrsave == 0) { - /* turn on power save mode */ + /* + * Check for ps-poll state change for the station. + * XXX is there a response when pspoll is not supported? + */ + if (ic->ic_opmode == IEEE80211_M_HOSTAP && + ic->ic_set_tim != NULL && + ((wh->i_fc[1] & IEEE80211_FC1_PWR_MGT) ^ + (ni->ni_flags & IEEE80211_NODE_PWR_MGT))) { + /* XXX statistics? */ IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER, - ("power save mode on for %s\n", + ("power save mode %s for %s\n", + (wh->i_fc[1] & IEEE80211_FC1_PWR_MGT ? "on" : "off"), ether_sprintf(wh->i_addr2))); - ni->ni_pwrsave = IEEE80211_PS_SLEEP; - } - if (ic->ic_set_tim != NULL && - (wh->i_fc[1] & IEEE80211_FC1_PWR_MGT) == 0 && - ni->ni_pwrsave != 0) { - /* turn off power save mode, dequeue stored packets */ - ni->ni_pwrsave = 0; - if (ic->ic_set_tim) - ic->ic_set_tim(ic, ni->ni_associd, 0); - IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER, - ("power save mode off for %s\n", - ether_sprintf(wh->i_addr2))); - while (!_IF_QLEN(&ni->ni_savedq) != 0) { - struct mbuf *m0; - IF_DEQUEUE(&ni->ni_savedq, m0); - /* XXX need different driver interface */ - IF_ENQUEUE(&ic->ic_pwrsaveq, m); - (*ifp->if_start)(ifp); + if ((wh->i_fc[1] & IEEE80211_FC1_PWR_MGT) == 0) { + /* turn off power save mode, dequeue stored packets */ + ni->ni_flags &= ~IEEE80211_NODE_PWR_MGT; + (*ic->ic_set_tim)(ic, ni->ni_associd, 0); + while (!_IF_QLEN(&ni->ni_savedq) != 0) { + struct mbuf *m0; + IF_DEQUEUE(&ni->ni_savedq, m0); + /* XXX need different driver interface */ + IF_ENQUEUE(&ic->ic_pwrsaveq, m); + (*ifp->if_start)(ifp); + } + } else { + /* turn on power save mode */ + ni->ni_flags |= IEEE80211_NODE_PWR_MGT; } } @@ -292,11 +294,29 @@ ic->ic_stats.is_rx_notassoc++; goto err; } + /* + * When station is to be authenticated with 802.1x + * deny any data frames until authentication has + * been completed. + */ + if (ni->ni_authmode == IEEE80211_AUTH_8021X && + (ni->ni_flags & IEEE80211_NODE_AUTH) == 0) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_INPUT, + ("%s: data from unauthenticated src %s\n", + __func__, ether_sprintf(wh->i_addr2))); + ieee80211_unref_node(&ni); + ic->ic_stats.is_rx_not1xauth++; + /* XXX node statistic */ + goto err; + } break; case IEEE80211_M_MONITOR: break; } if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + /* + * Device didn't handle WEP; do it in software. + */ if (ic->ic_flags & IEEE80211_F_WEPON) { m = ieee80211_wep_crypt(ic, m, 0); if (m == NULL) { @@ -309,16 +329,19 @@ goto out; } } - /* copy to listener after decrypt */ - if (ic->ic_rawbpf) - bpf_mtap(ic->ic_rawbpf, m); - /* XXX tap before or after defrag? */ m = ieee80211_defrag(ic, ni, m); if (m == NULL) { /* XXX statistic */ /* Fragment dropped or frame not complete yet */ goto out; } + /* + * Copy to listener after decrypt and defrag. + * If someone wants fragments they can tap at + * the driver level. + */ + if (ic->ic_rawbpf) + bpf_mtap(ic->ic_rawbpf, m); m = ieee80211_decap(ic, m); if (m == NULL) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_INPUT, From owner-p4-projects@FreeBSD.ORG Fri Jan 30 17:36:27 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DA8B516A4D0; Fri, 30 Jan 2004 17:36:26 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B60E216A4CE for ; Fri, 30 Jan 2004 17:36:26 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88C9A43D46 for ; Fri, 30 Jan 2004 17:36:25 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0V1aP0B040353 for ; Fri, 30 Jan 2004 17:36:25 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0V1aOi0040350 for perforce@freebsd.org; Fri, 30 Jan 2004 17:36:24 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 17:36:24 -0800 (PST) Message-Id: <200401310136.i0V1aOi0040350@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46235 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2004 01:36:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=46235 Change 46235 by sam@sam_ebb on 2004/01/30 17:35:45 check interrupt pending immediately in the isr Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#19 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#19 (text+ko) ==== @@ -457,6 +457,8 @@ DPRINTF(ATH_DEBUG_ANY, ("%s: invalid; ignored\n", __func__)); return; } + if (!ath_hal_intrpend(ah)) /* shared irq, not for us */ + return; if ((ifp->if_flags & (IFF_RUNNING|IFF_UP)) != (IFF_RUNNING|IFF_UP)) { DPRINTF(ATH_DEBUG_ANY, ("%s: if_flags 0x%x\n", __func__, ifp->if_flags)); From owner-p4-projects@FreeBSD.ORG Fri Jan 30 22:01:53 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 578D516A4D0; Fri, 30 Jan 2004 22:01:53 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B8BC16A4CE for ; Fri, 30 Jan 2004 22:01:53 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7ACD443D1F for ; Fri, 30 Jan 2004 22:01:50 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0V61o0B005063 for ; Fri, 30 Jan 2004 22:01:50 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0V61nSf005054 for perforce@freebsd.org; Fri, 30 Jan 2004 22:01:50 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 22:01:50 -0800 (PST) Message-Id: <200401310601.i0V61nSf005054@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46242 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2004 06:01:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=46242 Change 46242 by sam@sam_ebb on 2004/01/30 22:01:27 o revamp beacon handling to do dynamic updates required for 11g and pspoll (dtim) o set slot time correctly (for 11g) Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#20 edit .. //depot/projects/netperf+sockets/sys/dev/ath/if_athvar.h#6 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#20 (text+ko) ==== @@ -1116,48 +1116,31 @@ bcopy(seg, bf->bf_segs, nseg * sizeof (seg[0])); } +/* + * Setup the beacon frame. The frame is mapped for DMA + * and the transmit descriptor is filled in. + */ static int -ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) +ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf, struct mbuf *m) { +#define USE_SHPREAMBLE(_ic) \ + (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\ + == IEEE80211_F_SHPREAMBLE) struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; - struct ath_node *an = ATH_NODE(ni); - struct ath_buf *bf; + struct ath_node *an = ATH_NODE(bf->bf_node); struct ath_desc *ds; - struct mbuf *m; int error; u_int8_t rate; - bf = sc->sc_bcbuf; - if (bf->bf_m != NULL) { - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); - m_freem(bf->bf_m); - bf->bf_m = NULL; - bf->bf_node = NULL; - } - /* - * NB: the beacon data buffer must be 32-bit aligned; - * we assume the mbuf routines will return us something - * with this alignment (perhaps should assert). - */ - m = ieee80211_beacon_alloc(ic, ni); - if (m == NULL) { - DPRINTF(ATH_DEBUG_BEACON, ("%s: cannot get mbuf/cluster\n", - __func__)); - sc->sc_stats.ast_be_nombuf++; - return ENOMEM; - } DPRINTF(ATH_DEBUG_BEACON, ("%s: m %p len %u\n", __func__, m, m->m_len)); error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_dmamap, m, ath_mbuf_load_cb, bf, BUS_DMA_NOWAIT); - if (error != 0) { - m_freem(m); + if (error != 0) return error; - } KASSERT(bf->bf_nseg == 1, ("%s: multi-segment packet; nseg %u", __func__, bf->bf_nseg)); - bf->bf_m = m; /* setup descriptors */ ds = bf->bf_desc; @@ -1168,7 +1151,7 @@ * Calculate rate code. * XXX everything at min xmit rate */ - if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) + if (USE_SHPREAMBLE(ic)) rate = an->an_tx_mgtratesp; else rate = an->an_tx_mgtrate; @@ -1191,16 +1174,78 @@ , AH_TRUE /* first segment */ , AH_TRUE /* last segment */ ); + return 0; +#undef USE_SHPREAMBLE +} - return 0; +/* + * Set the slot time based on the current setting. + */ +static void +ath_setslottime(struct ath_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + + if (ic->ic_flags & IEEE80211_F_SHSLOT) + ath_hal_setslottime(ah, HAL_SLOT_TIME_9); + else + ath_hal_setslottime(ah, HAL_SLOT_TIME_20); + sc->sc_icflags = ic->ic_flags; +} + +/* + * Allocate and setup an initial beacon frame. + */ +static int +ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ath_buf *bf; + struct mbuf *m; + int error; + + bf = sc->sc_bcbuf; + if (bf->bf_m != NULL) { + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + m_freem(bf->bf_m); + bf->bf_m = NULL; + bf->bf_node = NULL; + } + /* + * NB: the beacon data buffer must be 32-bit aligned; + * we assume the mbuf routines will return us something + * with this alignment (perhaps should assert). + */ + m = ieee80211_beacon_alloc(ic, ni, &sc->sc_boff); + if (m == NULL) { + DPRINTF(ATH_DEBUG_BEACON, ("%s: cannot get mbuf/cluster\n", + __func__)); + sc->sc_stats.ast_be_nombuf++; + return ENOMEM; + } + bf->bf_node = ni; + error = ath_beacon_setup(sc, bf, m); + if (error == 0) + bf->bf_m = m; + else + m_freem(m); + ath_setslottime(sc); /* initialize slot time state */ + return error; } +/* + * Transmit a beacon frame at SWBA. Dynamic updates to the + * frame contents are done as needed and the slot time is + * also adjusted based on current state. + */ static void ath_beacon_proc(struct ath_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; struct ath_buf *bf = sc->sc_bcbuf; struct ath_hal *ah = sc->sc_ah; + struct mbuf *m; DPRINTF(ATH_DEBUG_BEACON_PROC, ("%s\n", __func__)); if (ic->ic_opmode == IEEE80211_M_STA || @@ -1209,7 +1254,34 @@ __func__, ic->ic_flags, bf, bf ? bf->bf_m : NULL)); return; } - /* TODO: update beacon to reflect PS poll state */ + + /* + * Update dynamic beacon contents. If this returns non-zero + * then we need to update the descriptor state because the + * beacon frame changed size and/or was re-allocated. + */ + m = bf->bf_m; + if (ieee80211_beacon_update(ic, bf->bf_node, &sc->sc_boff, &m)) { + /* NB: the old mbuf is free'd */ + bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); + bf->bf_m = NULL; + if (ath_beacon_setup(sc, bf, m) != 0) { + m_freem(m); + /* XXX statistic */ + return; /* XXX??? */ + } + bf->bf_m = m; + } + + /* + * Check for slot time change. + */ + if ((ic->ic_flags ^ sc->sc_icflags) & IEEE80211_F_SHSLOT) + ath_setslottime(sc); + + /* + * Stop any current dma and put the new frame on the queue. + */ if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { DPRINTF(ATH_DEBUG_ANY, ("%s: beacon queue %u did not stop?\n", __func__, sc->sc_bhalq)); @@ -1224,6 +1296,9 @@ sc->sc_bhalq, (caddr_t)bf->bf_daddr, bf->bf_desc)); } +/* + * Reclaim beacon resources. + */ static void ath_beacon_free(struct ath_softc *sc) { @@ -1839,7 +1914,8 @@ struct ifnet *ifp = &sc->sc_if; struct ath_hal *ah = sc->sc_ah; int i, error, iswep, hdrlen, pktlen, try0; - u_int8_t rix, cix, txrate, ctsrate; + u_int8_t rix, txrate, ctsrate; + u_int8_t cix = 0xff; /* NB: silence compiler */ struct ath_desc *ds; struct mbuf *m; struct ieee80211_frame *wh; @@ -2037,10 +2113,26 @@ sc->sc_stats.ast_tx_noack++; } else if (pktlen > ic->ic_rtsthreshold) { flags |= HAL_TXDESC_RTSENA; /* RTS based on frame length */ + cix = rt->info[rix].controlRate; sc->sc_stats.ast_tx_rts++; } /* + * Determine whether to use RTS/CTS or just CTS for + * 802.11g protection. + * XXX use only before transmitting OFDM, not CCK. + */ + if ((ic->ic_flags & IEEE80211_F_USEPROT) && + (ni->ni_flags & IEEE80211_NODE_ERP)) { + if (ic->ic_protmode == IEEE80211_PROT_RTSCTS) + flags |= HAL_TXDESC_RTSENA; + else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) + flags |= HAL_TXDESC_CTSENA; + cix = rt->info[sc->sc_protrix].controlRate; + /* XXX statistics */ + } + + /* * Calculate duration. This logically belongs in the 802.11 * layer but it lacks sufficient information to calculate it. */ @@ -2060,12 +2152,14 @@ */ ctsduration = 0; if (flags & (HAL_TXDESC_RTSENA|HAL_TXDESC_CTSENA)) { + /* XXX optimize a la data transmit rate */ /* * CTS transmit rate is derived from the transmit rate * by looking in the h/w rate table. We must also factor * in whether or not a short preamble is to be used. */ - cix = rt->info[rix].controlRate; + /* NB: cix is set above where RTS/CTS is enabled */ + KASSERT(cix != 0xff, ("cix not setup")); ctsrate = rt->info[cix].rateCode; if (shortPreamble) ctsrate |= rt->info[cix].shortPreamble; @@ -2796,6 +2890,12 @@ } sc->sc_currates = rt; sc->sc_curmode = mode; + /* + * All protection frames are transmited at 2Mb/s for + * 11g, otherwise at 1Mb/s. + * XXX select protection rate index from rate table. + */ + sc->sc_protrix = (mode == IEEE80211_MODE_11G ? 1 : 0); /* NB: caller is responsible for reseting rate control state */ } ==== //depot/projects/netperf+sockets/sys/dev/ath/if_athvar.h#6 (text+ko) ==== @@ -121,7 +121,9 @@ enum ieee80211_phymode sc_curmode; /* current phy mode */ u_int8_t sc_rixmap[256]; /* IEEE to h/w rate table ix */ u_int8_t sc_hwmap[32]; /* h/w rate ix to IEEE table */ + u_int8_t sc_protrix; /* protection rate index */ HAL_INT sc_imask; /* interrupt mask copy */ + u_int32_t sc_icflags; /* shadow of ic_flags */ struct bpf_if *sc_drvbpf; union { @@ -158,6 +160,7 @@ u_int sc_bhalq; /* HAL q for outgoing beacons */ struct ath_buf *sc_bcbuf; /* beacon buffer */ struct ath_buf *sc_bufptr; /* allocated buffer ptr */ + struct ieee80211_beacon_offsets sc_boff;/* dynamic update state */ struct task sc_bmisstask; /* bmiss int processing */ struct callout sc_cal_ch; /* callout handle for cals */ @@ -303,6 +306,8 @@ ((*(_ah)->ah_getRfGain)((_ah))) #define ath_hal_rxmonitor(_ah) \ ((*(_ah)->ah_rxMonitor)((_ah))) +#define ath_hal_setslottime(_ah, _us) \ + ((*(_ah)->ah_setSlotTime)((_ah), (_us))) #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) From owner-p4-projects@FreeBSD.ORG Fri Jan 30 22:07:00 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 800A516A4D0; Fri, 30 Jan 2004 22:07:00 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5969116A4CE for ; Fri, 30 Jan 2004 22:07:00 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4801B43D3F for ; Fri, 30 Jan 2004 22:06:57 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0V66v0B006817 for ; Fri, 30 Jan 2004 22:06:57 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0V66ujq006814 for perforce@freebsd.org; Fri, 30 Jan 2004 22:06:56 -0800 (PST) (envelope-from sam@freebsd.org) Date: Fri, 30 Jan 2004 22:06:56 -0800 (PST) Message-Id: <200401310606.i0V66ujq006814@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46243 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2004 06:07:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=46243 Change 46243 by sam@sam_ebb on 2004/01/30 22:06:28 Add 11g support based on ViVATO contribution: o correct basic rate set munging o handle short/long preamble more correctly o handle short/long slot time o implement 11g protection for AP (track long slot stations) o implement ERP for AP (track non-ERP stations) o honor ERP for station/IBSS operation o add ioctl to control 11g protection mode o revise beacon interface to support dynamic updates o add dynamic beacon update interface that handles capabilities changes (but not yet TIM) o shuffle some function decls from public ieee80211_var.h to private files Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#8 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#11 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#13 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#6 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#6 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#6 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#10 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#6 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.h#5 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#8 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#8 (text+ko) ==== @@ -646,11 +646,13 @@ ieee80211_set11gbasicrates(struct ieee80211_rateset *rs, enum ieee80211_phymode mode) { static const struct ieee80211_rateset basic[] = { - { 3, { 12, 24, 48 } }, /* IEEE80211_MODE_11A */ - { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_11B */ - { 7, { 2, 4, 11, 22, 12, 24, 48 } },/* IEEE80211_MODE_11G */ - { 0 }, /* IEEE80211_MODE_FH */ - { 0 }, /* IEEE80211_MODE_TURBO */ + { 0 }, /* IEEE80211_MODE_AUTO */ + { 3, { 12, 24, 48 } }, /* IEEE80211_MODE_11A */ + { 2, { 2, 4 } }, /* IEEE80211_MODE_11B */ + { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_11G (mixed b/g) */ + { 0 }, /* IEEE80211_MODE_FH */ + /* IEEE80211_MODE_PUREG (not yet) */ + { 7, { 2, 4, 11, 22, 12, 24, 48 } }, }; int i, j; @@ -753,21 +755,21 @@ } /* - * Set/reset state flags that influence beacon contents, etc. - * - * XXX what if we have stations already associated??? - * XXX probably not right for autoselect? + * Do 11b/11g mixed-mode state setup. */ - if (ic->ic_caps & IEEE80211_C_SHPREAMBLE) - ic->ic_flags |= IEEE80211_F_SHPREAMBLE; if (mode == IEEE80211_MODE_11G) { - if (ic->ic_caps & IEEE80211_C_SHSLOT) - ic->ic_flags |= IEEE80211_F_SHSLOT; + /* use mixed 11b/11g rate set */ ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode], IEEE80211_MODE_11G); + } else if (mode == IEEE80211_MODE_11B) { + /* force pure 11b rate set */ + ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode], + IEEE80211_MODE_11B); + ic->ic_flags &= ~IEEE80211_F_SHSLOT; } else { ic->ic_flags &= ~IEEE80211_F_SHSLOT; } + ieee80211_reset_erp(ic, mode); /* reset ERP state */ /* * Setup an initial rate set according to the @@ -784,6 +786,29 @@ } /* + * Reset 11g-related state. + */ +void +ieee80211_reset_erp(struct ieee80211com *ic, enum ieee80211_phymode mode) +{ + ic->ic_flags &= ~IEEE80211_F_USEPROT; + ic->ic_nonerpsta = 0; + ic->ic_longslotsta = 0; + if (mode == IEEE80211_MODE_11G && (ic->ic_caps & IEEE80211_C_SHSLOT)) + ic->ic_flags &= ~IEEE80211_F_SHSLOT; + /* + * Set short preamble and ERP barker-preamble flags. + */ + if (ic->ic_caps & IEEE80211_C_SHPREAMBLE) { + ic->ic_flags |= IEEE80211_F_SHPREAMBLE; + ic->ic_flags &= ~IEEE80211_F_USEBARKER; + } else { + ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; + ic->ic_flags |= IEEE80211_F_USEBARKER; + } +} + +/* * Return the phy mode for with the specified channel so the * caller can select a rate set. This is problematic and the * work here assumes how things work elsewhere in this code. ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#11 (text+ko) ==== @@ -1220,7 +1220,15 @@ ni->ni_chan = &ic->ic_channels[chan]; ni->ni_fhdwell = fhdwell; ni->ni_fhindex = fhindex; - ni->ni_erp = erp; + /* + * Honor ERP: enable protection and/or disable + * the use of short slot time. + * XXX where do we reset this state? + */ + if (erp & IEEE80211_ERP_USE_PROTECTION) + ic->ic_flags |= IEEE80211_F_USEPROT; + if (erp & IEEE80211_ERP_LONG_PREAMBLE) + ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; /* NB: must be after ni_chan is setup */ ieee80211_setup_rates(ic, ni, rates, xrates, IEEE80211_F_DOSORT); ieee80211_unref_node(&ni); @@ -1493,8 +1501,39 @@ } } else newassoc = 0; - /* XXX for 11g must turn off short slot time if long - slot time sta associates */ + /* + * Station isn't capable of short slot time. Bump + * the count of long slot time stations and disable + * use of short slot time. Note that the actual switch + * over to long slot time use will not occur until the + * next beacon transmission (per sec. 7.3.1.4 of 11g). + */ + if ((capinfo & IEEE80211_CAPINFO_SHORT_SLOTTIME) == 0) { + ic->ic_longslotsta++; + ic->ic_flags &= ~IEEE80211_F_SHSLOT; + } + /* + * If the new station is not an ERP station + * then bump the counter and enable protection + * if configured. + */ + if (!ieee80211_iserp_rateset(ic, &ni->ni_rates)) { + ic->ic_nonerpsta++; + /* + * If protection is configured, enable it. + */ + if (ic->ic_protmode != IEEE80211_PROT_NONE) + ic->ic_flags |= IEEE80211_F_USEPROT; + /* + * If station does not support long preamble then + * we must enable use of Barker preamble. + */ + if ((capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) == 0) { + ic->ic_flags |= IEEE80211_F_USEBARKER; + ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; + } + } else + ni->ni_flags |= IEEE80211_NODE_ERP; IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS); IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, ("station %s %s associated at aid %d\n", @@ -1585,6 +1624,7 @@ ("station %s deauthenticated by " "peer (reason %d)\n", ether_sprintf(ni->ni_macaddr), reason)); + ieee80211_node_leave(ic, ni); /* node will be free'd on return */ ieee80211_unref_node(&ni); } @@ -1618,7 +1658,8 @@ IEEE80211_AID_CLR(ni->ni_associd, ic->ic_aid_bitmap); ni->ni_associd = 0; - /* XXX node reclaimed how? */ + ieee80211_node_leave(ic, ni); + ieee80211_unref_node(&ni); /* XXX??? */ } break; default: ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#13 (text+ko) ==== @@ -897,6 +897,9 @@ case IEEE80211_IOC_RTSTHRESHOLD: ireq->i_val = ic->ic_rtsthreshold; break; + case IEEE80211_IOC_PROTECTION: + ireq->i_val = ic->ic_protmode; + break; default: error = EINVAL; } @@ -1048,6 +1051,15 @@ ic->ic_rtsthreshold = ireq->i_val; error = ieee80211_reset(ic); break; + case IEEE80211_IOC_PROTECTION: + if (!(IEEE80211_PROTECTION_OFF <= ireq->i_val && + ireq->i_val <= IEEE80211_PROTECTION_RTSCTS)) { + error = EINVAL; + break; + } + ic->ic_protmode = ireq->i_val; + error = ieee80211_reset(ic); /* ???XXX */ + break; default: error = EINVAL; break; ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#6 (text+ko) ==== @@ -161,6 +161,11 @@ #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM #define IEEE80211_IOC_POWERSAVESLEEP 11 #define IEEE80211_IOC_RTSTHRESHOLD 12 +#define IEEE80211_IOC_PROTECTION 13 +#define IEEE80211_PROTECTION_NOSUP -1 +#define IEEE80211_PROTECTION_OFF 0 +#define IEEE80211_PROTECTION_CTS 1 +#define IEEE80211_PROTECTION_RTSCTS 2 #ifndef IEEE80211_CHAN_ANY #define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#6 (text+ko) ==== @@ -613,6 +613,7 @@ ("station %s timed out due to inactivity (%u secs)\n", ether_sprintf(ni->ni_macaddr), ni->ni_inact)); + ieee80211_node_leave(ic, ni); /* * Send a deauthenticate frame. * ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#6 (text+ko) ==== @@ -72,6 +72,7 @@ #define IEEE80211_NODE_AUTH 0x0001 /* 802.1x auth complete */ #define IEEE80211_NODE_WPA 0x0002 /* WPA enabled */ #define IEEE80211_NODE_QOS 0x0004 /* QoS enabled */ +#define IEEE80211_NODE_ERP 0x0008 /* ERP enabled */ /* NB: this must have the same value as IEEE80211_FC1_PWR_MGT */ #define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ u_int16_t ni_associd; /* assoc response */ @@ -102,7 +103,6 @@ struct ieee80211_channel *ni_chan; u_int16_t ni_fhdwell; /* FH only */ u_int8_t ni_fhindex; /* FH only */ - u_int8_t ni_erp; /* 11g only */ #ifdef notyet /* DTIM and contention free period (CFP) */ ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#10 (text+ko) ==== @@ -304,6 +304,27 @@ } /* + * Add an erp element to a frame. + */ +static u_int8_t * +ieee80211_add_erp(u_int8_t *frm, struct ieee80211com *ic) +{ + u_int8_t erp; + + *frm++ = IEEE80211_ELEMID_ERP; + *frm++ = 1; + erp = 0; + if (ic->ic_nonerpsta != 0) + erp |= IEEE80211_ERP_NON_ERP_PRESENT; + if (ic->ic_flags & IEEE80211_F_USEPROT) + erp |= IEEE80211_ERP_USE_PROTECTION; + if (ic->ic_flags & IEEE80211_F_USEBARKER) + erp |= IEEE80211_ERP_LONG_PREAMBLE; + *frm++ = erp; + return frm; +} + +/* * Send a management frame. The node is for the destination (or ic_bss * when in station mode). Nodes other than ic_bss have their reference * count bumped to reflect our use for an indeterminant time. @@ -362,6 +383,7 @@ * [tlv] supported rates * [tlv] parameter set (FH/DS) * [tlv] parameter set (IBSS) + * [tlv] extended rate phy (ERP) * [tlv] extended supported rates */ m = ieee80211_getmgtframe(&frm, @@ -370,6 +392,7 @@ + 2 + IEEE80211_RATE_SIZE + (ic->ic_phytype == IEEE80211_T_FH ? 7 : 3) + 6 + + (ic->ic_curmode == IEEE80211_MODE_11G ? 3 : 0) + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)); if (m == NULL) senderr(ENOMEM, is_tx_nobuf); @@ -387,6 +410,8 @@ if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE; + if (ic->ic_flags & IEEE80211_F_SHSLOT) + capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME; *(u_int16_t *)frm = htole16(capinfo); frm += 2; @@ -414,15 +439,9 @@ *frm++ = IEEE80211_ELEMID_IBSSPARMS; *frm++ = 2; *frm++ = 0; *frm++ = 0; /* TODO: ATIM window */ - } else { /* IEEE80211_M_HOSTAP */ - /* TODO: TIM */ - *frm++ = IEEE80211_ELEMID_TIM; - *frm++ = 4; /* length */ - *frm++ = 0; /* DTIM count */ - *frm++ = 1; /* DTIM period */ - *frm++ = 0; /* bitmap control */ - *frm++ = 0; /* Partial Virtual Bitmap (variable length) */ } + if (ic->ic_curmode == IEEE80211_MODE_11G) + ieee80211_add_erp(frm, ic); frm = ieee80211_add_xrates(frm, &ic->ic_bss->ni_rates); m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *); break; @@ -613,13 +632,14 @@ * Allocate a beacon frame and fillin the appropriate bits. */ struct mbuf * -ieee80211_beacon_alloc(struct ieee80211com *ic, struct ieee80211_node *ni) +ieee80211_beacon_alloc(struct ieee80211com *ic, struct ieee80211_node *ni, + struct ieee80211_beacon_offsets *bo) { struct ifnet *ifp = ic->ic_ifp; struct ieee80211_frame *wh; struct mbuf *m; int pktlen; - u_int8_t *frm; + u_int8_t *frm, *efrm; u_int16_t capinfo; struct ieee80211_rateset *rs; @@ -632,6 +652,7 @@ * [tlv] supported rates * [3] parameter set (DS) * [tlv] parameter set (IBSS/TIM) + * [tlv] extended rate phy (ERP) * [tlv] extended supported rates * XXX WME, WPA, etc. * XXX Vendor-specific OIDs (e.g. Atheros) @@ -645,6 +666,8 @@ + 6; if (ic->ic_curmode != IEEE80211_MODE_FH) pktlen += 3; /* DS parameter set */ + if (ic->ic_curmode == IEEE80211_MODE_11G) + pktlen += 3; /* ERP information element */ if (rs->rs_nrates > IEEE80211_RATE_SIZE) pktlen += 2; /* extended rate set */ m = ieee80211_getmgtframe(&frm, pktlen); @@ -680,6 +703,7 @@ capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE; if (ic->ic_flags & IEEE80211_F_SHSLOT) capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME; + bo->bo_caps = (u_int16_t *)frm; *(u_int16_t *)frm = htole16(capinfo); frm += 2; *frm++ = IEEE80211_ELEMID_SSID; @@ -696,7 +720,10 @@ *frm++ = IEEE80211_ELEMID_IBSSPARMS; *frm++ = 2; *frm++ = 0; *frm++ = 0; /* TODO: ATIM window */ + bo->bo_dtim = NULL; + bo->bo_dtim_len = 0; } else { + bo->bo_dtim = frm; /* TODO: TIM */ *frm++ = IEEE80211_ELEMID_TIM; *frm++ = 4; /* length */ @@ -704,9 +731,14 @@ *frm++ = 1; /* DTIM period */ *frm++ = 0; /* bitmap control */ *frm++ = 0; /* Partial Virtual Bitmap (variable length) */ + bo->bo_dtim_len = 6; } - frm = ieee80211_add_xrates(frm, rs); - m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *); + if (ic->ic_curmode == IEEE80211_MODE_11G) + ieee80211_add_erp(frm, ic); + bo->bo_xrates = frm; + efrm = ieee80211_add_xrates(frm, rs); + bo->bo_xrates_len = efrm - frm; + m->m_pkthdr.len = m->m_len = efrm - mtod(m, u_int8_t *); KASSERT(m->m_pkthdr.len <= pktlen + sizeof(struct ieee80211_frame), ("beacon bigger than expected, len %u calculated %u", m->m_pkthdr.len, pktlen + sizeof(struct ieee80211_frame))); @@ -714,6 +746,45 @@ } /* + * Update the dynamic parts of a beacon frame based on the current state. + */ +int +ieee80211_beacon_update(struct ieee80211com *ic, struct ieee80211_node *ni, + struct ieee80211_beacon_offsets *bo, struct mbuf **m0) +{ + u_int16_t capinfo; + + /* XXX lock out changes */ + /* XXX only update as needed */ + /* XXX faster to recalculate entirely or just changes? */ + if (ic->ic_opmode == IEEE80211_M_IBSS) + capinfo = IEEE80211_CAPINFO_IBSS; + else + capinfo = IEEE80211_CAPINFO_ESS; + if (ic->ic_flags & IEEE80211_F_WEPON) + capinfo |= IEEE80211_CAPINFO_PRIVACY; + if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE; + if (ic->ic_flags & IEEE80211_F_SHSLOT) + capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME; + *bo->bo_caps = htole16(capinfo); + + if (ic->ic_flags & IEEE80211_F_DTIMUPDATE) { + /* + * DTIM needs updating. If it fits in the current + * space allocated then just copy in the new bits. + * Otherwise we need to move any extended rate set + * the follows and, possibly, allocate a new mbuf + * if the this current mbuf isn't large enough. + */ + /* XXX fillin */ + ic->ic_flags &= ~IEEE80211_F_DTIMUPDATE; + } + return 0; +} + +/* * Save an outbound packet for a node in power-save sleep state. * The new packet is placed on the node's saved queue, and the TIM * is changed, if necessary. ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#6 (text+ko) ==== @@ -305,6 +305,70 @@ #undef RV } +/* + * Check if the specified rate set supports ERP. + * NB: the rate set is assumed to be sorted. + */ +int +ieee80211_iserp_rateset(struct ieee80211com *ic, struct ieee80211_rateset *rs) +{ +#define N(a) (sizeof(a) / sizeof(a[0])) + static const int rates[] = { 2, 4, 11, 22, 12, 24, 48 }; + int i, j; + + if (rs->rs_nrates < N(rates)) + return 0; + for (i = 0; i < N(rates); i++) { + for (j = 0; j < rs->rs_nrates && rates[i] < rs->rs_rates[j]; j++) + ; + if (j == rs->rs_nrates || rates[i] > rs->rs_rates[j]) + return 0; + } + return 1; +#undef N +} + +/* + * Handle bookkeeping for station deauthentication/disassociation + * when operating as an ap. + */ +void +ieee80211_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni) +{ + KASSERT(ic->ic_opmode == IEEE80211_M_HOSTAP, + ("not in ap mode, mode %u", ic->ic_opmode)); + + /* + * If a long slot station do the slot time bookkeeping. + */ + if ((ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_SLOTTIME) == 0) { + KASSERT(ic->ic_longslotsta > 0, + ("bogus long slot station count %d", ic->ic_longslotsta)); + ic->ic_longslotsta--; + if (ic->ic_longslotsta == 0 && + ic->ic_curmode == IEEE80211_MODE_11G) { + /* XXX check capability */ + ic->ic_flags |= IEEE80211_F_SHSLOT; + } + } + /* + * If a non-ERP station do the protection-related bookkeeping. + */ + if ((ni->ni_flags & IEEE80211_NODE_ERP) == 0) { + KASSERT(ic->ic_nonerpsta > 0, + ("bogus non-ERP station count %d", ic->ic_nonerpsta)); + ic->ic_nonerpsta--; + if (ic->ic_nonerpsta == 0) { + ic->ic_flags &= ~IEEE80211_F_USEPROT; + /* XXX verify mode? */ + if (ic->ic_caps & IEEE80211_C_SHPREAMBLE) { + ic->ic_flags |= IEEE80211_F_SHPREAMBLE; + ic->ic_flags &= ~IEEE80211_F_USEBARKER; + } + } + } +} + static int ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int mgt) { @@ -359,6 +423,8 @@ IEEE80211_REASON_AUTH_LEAVE); } IEEE80211_NODE_UNLOCK(ic); + /* XXX??? */ + ieee80211_reset_erp(ic, ic->ic_curmode); break; default: break; ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.h#5 (text+ko) ==== @@ -63,16 +63,38 @@ struct ieee80211_node *, int, int, u_int32_t); extern int ieee80211_send_mgmt(struct ieee80211com *, struct ieee80211_node *, int, int); -extern struct mbuf * ieee80211_beacon_alloc(struct ieee80211com *, - struct ieee80211_node *); extern void ieee80211_pwrsave(struct ieee80211com *, struct ieee80211_node *, struct mbuf *); extern struct mbuf *ieee80211_encap(struct ieee80211com *, struct mbuf *, struct ieee80211_node **); +extern int ieee80211_fix_rate(struct ieee80211com *, + struct ieee80211_node *, int); +extern int ieee80211_iserp_rateset(struct ieee80211com *, + struct ieee80211_rateset *); +extern void ieee80211_node_leave(struct ieee80211com *, + struct ieee80211_node *); #define ieee80211_new_state(_ic, _nstate, _arg) \ (((_ic)->ic_newstate)((_ic), (_nstate), (_arg))) extern void ieee80211_print_essid(u_int8_t *, int); extern void ieee80211_dump_pkt(u_int8_t *, int, int, int); extern const char *ieee80211_state_name[IEEE80211_S_MAX]; + +/* + * Beacon frames constructed by ieee80211_beacon_alloc + * have the following structure filled in so drivers + * can update the frame later w/ minimal overhead. + */ +struct ieee80211_beacon_offsets { + u_int16_t *bo_caps; /* capabilities */ + u_int8_t *bo_dtim; /* start of dtim */ + u_int8_t *bo_xrates; /* start of extended rates */ + u_int16_t bo_dtim_len; /* dtim length in bytes */ + u_int16_t bo_xrates_len; /* xrates length in bytes */ +}; +extern struct mbuf * ieee80211_beacon_alloc(struct ieee80211com *, + struct ieee80211_node *, struct ieee80211_beacon_offsets *); +extern int ieee80211_beacon_update(struct ieee80211com *, + struct ieee80211_node *, struct ieee80211_beacon_offsets *, + struct mbuf **); #endif /* _NET80211_IEEE80211_PROTO_H_ */ ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#8 (text+ko) ==== @@ -89,6 +89,15 @@ }; /* + * 802.11g protection mode. + */ +enum ieee80211_protmode { + IEEE80211_PROT_NONE = 0, /* no protection */ + IEEE80211_PROT_CTSONLY = 1, /* CTS to self */ + IEEE80211_PROT_RTSCTS = 2, /* RTS-CTS */ +}; + +/* * Channels are specified by frequency and attributes. */ struct ieee80211_channel { @@ -188,6 +197,7 @@ enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */ enum ieee80211_opmode ic_opmode; /* operation mode */ enum ieee80211_state ic_state; /* 802.11 state */ + enum ieee80211_protmode ic_protmode; /* 802.11g protection mode */ u_int32_t ic_aid_bitmap[IEEE80211_MAX_AID / 32 + 1]; u_int16_t ic_max_aid; struct ifmedia ic_media; /* interface media config */ @@ -217,6 +227,8 @@ u_int16_t ic_txpower; /* tx power setting (dbM) */ u_int16_t ic_bmisstimeout;/* beacon miss threshold (ms) */ u_int16_t ic_authmode; /* authentication mode */ + u_int16_t ic_nonerpsta; /* # non-ERP stations */ + u_int16_t ic_longslotsta; /* # long slot time stations */ int ic_mgt_timer; /* mgmt timeout */ int ic_inact_timer; /* inactivity timer wait */ int ic_des_esslen; @@ -249,6 +261,9 @@ #define IEEE80211_F_SHSLOT 0x00020000 /* CONF: short slot time */ #define IEEE80211_F_SHPREAMBLE 0x00040000 /* CONF: short preamble */ #define IEEE80211_F_DATAPAD 0x00080000 /* CONF: do alignment pad */ +#define IEEE80211_F_USEPROT 0x00100000 /* STATUS: protection enabled */ +#define IEEE80211_F_USEBARKER 0x00200000 /* STATUS: use barker preamble*/ +#define IEEE80211_F_DTIMUPDATE 0x00400000 /* STATUS: update beacon dtim */ /* ic_caps */ #define IEEE80211_C_WEP 0x00000001 /* CAPABILITY: WEP available */ @@ -262,6 +277,7 @@ #define IEEE80211_C_SHPREAMBLE 0x00000100 /* CAPABILITY: short preamble */ #define IEEE80211_C_MONITOR 0x00000200 /* CAPABILITY: monitor mode */ #define IEEE80211_C_RCVMGT 0x00000400 /* CAPABILITY: rcv mgt frames */ +/* XXX protection/barker? */ /* flags for ieee80211_fix_rate() */ #define IEEE80211_F_DOSORT 0x00000001 /* sort rate list */ @@ -279,7 +295,6 @@ int ieee80211_cfgget(struct ieee80211com *, u_long, caddr_t); int ieee80211_cfgset(struct ieee80211com *, u_long, caddr_t); void ieee80211_watchdog(struct ieee80211com *); -int ieee80211_fix_rate(struct ieee80211com *, struct ieee80211_node *, int); int ieee80211_rate2media(struct ieee80211com *, int, enum ieee80211_phymode); int ieee80211_media2rate(int); @@ -287,6 +302,7 @@ u_int ieee80211_chan2ieee(struct ieee80211com *, struct ieee80211_channel *); u_int ieee80211_ieee2mhz(u_int, u_int); int ieee80211_setmode(struct ieee80211com *, enum ieee80211_phymode); +void ieee80211_reset_erp(struct ieee80211com *, enum ieee80211_phymode); enum ieee80211_phymode ieee80211_chan2mode(struct ieee80211com *, struct ieee80211_channel *); From owner-p4-projects@FreeBSD.ORG Sat Jan 31 19:36:21 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6114816A4D0; Sat, 31 Jan 2004 19:36:21 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BFAA16A4CE for ; Sat, 31 Jan 2004 19:36:21 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5787743D3F for ; Sat, 31 Jan 2004 19:36:20 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i113aK0B030912 for ; Sat, 31 Jan 2004 19:36:20 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i113aJfh030909 for perforce@freebsd.org; Sat, 31 Jan 2004 19:36:19 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sat, 31 Jan 2004 19:36:19 -0800 (PST) Message-Id: <200402010336.i113aJfh030909@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46286 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 03:36:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=46286 Change 46286 by sam@sam_ebb on 2004/01/31 19:36:13 add ioctl to control the transmit power Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#14 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#14 (text+ko) ==== @@ -900,6 +900,9 @@ case IEEE80211_IOC_PROTECTION: ireq->i_val = ic->ic_protmode; break; + case IEEE80211_IOC_TXPOWER: + ireq->i_val = ic->ic_bss->ic_txpower; + break; default: error = EINVAL; } @@ -1060,6 +1063,11 @@ ic->ic_protmode = ireq->i_val; error = ieee80211_reset(ic); /* ???XXX */ break; + case IEEE80211_IOC_TXPOWER: + /* XXX units? */ + ic->ic_bss->ic_txpower = ic->ic_ival; + error = ieee80211_reset(ic); + break; default: error = EINVAL; break; ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#7 (text+ko) ==== @@ -166,6 +166,7 @@ #define IEEE80211_PROTECTION_OFF 0 #define IEEE80211_PROTECTION_CTS 1 #define IEEE80211_PROTECTION_RTSCTS 2 +#define IEEE80211_IOC_TXPOWER 14 #ifndef IEEE80211_CHAN_ANY #define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ From owner-p4-projects@FreeBSD.ORG Sat Jan 31 19:43:32 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3D01E16A4D0; Sat, 31 Jan 2004 19:43:32 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1905016A4CE for ; Sat, 31 Jan 2004 19:43:32 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8676F43D31 for ; Sat, 31 Jan 2004 19:43:29 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i113hT0B032897 for ; Sat, 31 Jan 2004 19:43:29 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i113hTVm032888 for perforce@freebsd.org; Sat, 31 Jan 2004 19:43:29 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sat, 31 Jan 2004 19:43:29 -0800 (PST) Message-Id: <200402010343.i113hTVm032888@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46287 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 03:43:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=46287 Change 46287 by sam@sam_ebb on 2004/01/31 19:42:55 grr, fix typos Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#15 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#15 (text+ko) ==== @@ -901,7 +901,7 @@ ireq->i_val = ic->ic_protmode; break; case IEEE80211_IOC_TXPOWER: - ireq->i_val = ic->ic_bss->ic_txpower; + ireq->i_val = ic->ic_bss->ni_txpower; break; default: error = EINVAL; @@ -1065,7 +1065,7 @@ break; case IEEE80211_IOC_TXPOWER: /* XXX units? */ - ic->ic_bss->ic_txpower = ic->ic_ival; + ic->ic_bss->ni_txpower = ireq->i_val; error = ieee80211_reset(ic); break; default: From owner-p4-projects@FreeBSD.ORG Sat Jan 31 19:43:33 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EC9F216A4D6; Sat, 31 Jan 2004 19:43:32 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5AD016A4D0 for ; Sat, 31 Jan 2004 19:43:32 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF85E43D53 for ; Sat, 31 Jan 2004 19:43:29 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i113hT0B032907 for ; Sat, 31 Jan 2004 19:43:29 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i113hT1P032900 for perforce@freebsd.org; Sat, 31 Jan 2004 19:43:29 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sat, 31 Jan 2004 19:43:29 -0800 (PST) Message-Id: <200402010343.i113hT1P032900@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46288 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 03:43:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=46288 Change 46288 by sam@sam_ebb on 2004/01/31 19:43:27 use per-node transmit power setting Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#21 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#21 (text+ko) ==== @@ -1127,8 +1127,9 @@ (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\ == IEEE80211_F_SHPREAMBLE) struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_node *ni = bf->bf_node; struct ath_hal *ah = sc->sc_ah; - struct ath_node *an = ATH_NODE(bf->bf_node); + struct ath_node *an = ATH_NODE(ni); struct ath_desc *ds; int error; u_int8_t rate; @@ -1159,7 +1160,7 @@ , m->m_pkthdr.len + IEEE80211_CRC_LEN /* packet length */ , sizeof(struct ieee80211_frame) /* header length */ , HAL_PKT_TYPE_BEACON /* Atheros packet type */ - , 0x20 /* txpower XXX */ + , MIN(ni->ni_txpower,60) /* txpower XXX */ , rate, 1 /* series 0 rate/tries */ , HAL_TXKEYIX_INVALID /* no encryption */ , 0 /* antenna mode */ @@ -2203,7 +2204,7 @@ if (iswep) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; sc->sc_tx_th.wt_rate = ni->ni_rates.rs_rates[ni->ni_txrate]; - sc->sc_tx_th.wt_txpower = 60/2; /* XXX */ + sc->sc_tx_th.wt_txpower = ni->ni_txpower/2; /* XXX units */ sc->sc_tx_th.wt_antenna = antenna; bpf_mtap2(sc->sc_drvbpf, @@ -2223,7 +2224,7 @@ , pktlen /* packet length */ , hdrlen /* header length */ , atype /* Atheros packet type */ - , 60 /* txpower XXX */ + , MIN(ni->ni_txpower,60)/* txpower */ , txrate, try0 /* series 0 rate/tries */ , iswep ? sc->sc_ic.ic_wep_txkey : HAL_TXKEYIX_INVALID , antenna /* antenna mode */ From owner-p4-projects@FreeBSD.ORG Sat Jan 31 21:40:56 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7751816A4D0; Sat, 31 Jan 2004 21:40:56 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A82516A4CE for ; Sat, 31 Jan 2004 21:40:56 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C91D143D2D for ; Sat, 31 Jan 2004 21:40:54 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i115es0B063592 for ; Sat, 31 Jan 2004 21:40:54 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i115esoM063589 for perforce@freebsd.org; Sat, 31 Jan 2004 21:40:54 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sat, 31 Jan 2004 21:40:54 -0800 (PST) Message-Id: <200402010540.i115esoM063589@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46293 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 05:40:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=46293 Change 46293 by sam@sam_ebb on 2004/01/31 21:40:15 add privacy vlan mechanism Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#9 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#12 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#8 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#7 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#11 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#9 (text+ko) ==== @@ -101,6 +101,14 @@ struct ieee80211_channel *c; int i; + /* + * Mark interface as having hardware VLAN support. + * This is a bit of a cheat; we don't actually + * send/recv VLAN encapsulated frames; we use + * vlans only for privacy. + */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capenable |= IFCAP_VLAN_HWTAGGING; ether_ifattach(ifp, ic->ic_myaddr); #if NBPFILTER > 0 bpfattach2(ifp, DLT_IEEE802_11, ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#12 (text+ko) ==== @@ -56,6 +56,7 @@ #include #include #include +#include #include @@ -385,8 +386,13 @@ ifp->if_obytes += len; } } - if (m != NULL) + if (m != NULL) { + if (ni->ni_vlan != 0) { + /* attach vlan tag */ + VLAN_INPUT_TAG(ifp, m, ni->ni_vlan,); + } (*ifp->if_input)(ifp, m); + } return; case IEEE80211_FC0_TYPE_MGT: ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#8 (text+ko) ==== @@ -65,6 +65,9 @@ u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */ u_int64_t ns_tx_bytes; /* tx data count (bytes) */ + u_int32_t ns_tx_novlantag; /* tx discard 'cuz no tag */ + u_int32_t ns_tx_vlanmismatch; /* tx discard 'cuz bad tag */ + /* MIB-related state */ u_int32_t ns_mib_assoc; /* [re]associations */ u_int32_t ns_mib_assoc_fail; /* [re]association failures */ ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#7 (text+ko) ==== @@ -77,6 +77,7 @@ #define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ u_int16_t ni_associd; /* assoc response */ u_int16_t ni_txpower; /* current transmit power */ + u_int16_t ni_vlan; /* vlan tag */ u_int32_t *ni_challenge; /* shared-key challenge */ u_int16_t ni_txseq; /* seq to be transmitted */ u_int16_t ni_rxseq; /* seq previous received */ ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#11 (text+ko) ==== @@ -57,6 +57,7 @@ #include #include #include +#include #include @@ -199,6 +200,23 @@ ni = ic->ic_bss; ni->ni_inact = 0; + /* + * If node has a vlan tag then all traffic + * to it must have a matching tag. + */ + if (ni->ni_vlan != 0) { + struct m_tag *mtag = VLAN_OUTPUT_TAG(ic->ic_ifp, m); + if (!mtag) { + ni->ni_stats.ns_tx_novlantag++; + goto bad; + } + if (VLAN_TAG_VALUE(mtag) != ni->ni_vlan) { + ni->ni_stats.ns_tx_vlanmismatch++; + goto bad; + } + } + + m_adj(m, sizeof(struct ether_header) - sizeof(struct llc)); llc = mtod(m, struct llc *); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; From owner-p4-projects@FreeBSD.ORG Sun Feb 1 10:01:56 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6377D16A4D0; Sun, 1 Feb 2004 10:01:56 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39A9116A4CE for ; Sun, 1 Feb 2004 10:01:56 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B48843D31 for ; Sun, 1 Feb 2004 10:01:55 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11I1t0B049673 for ; Sun, 1 Feb 2004 10:01:55 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11I1tYE049667 for perforce@freebsd.org; Sun, 1 Feb 2004 10:01:55 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 10:01:55 -0800 (PST) Message-Id: <200402011801.i11I1tYE049667@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46309 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 18:01:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=46309 Change 46309 by sam@sam_ebb on 2004/02/01 10:01:23 stamp out another assumption about where struct ieee80211com is located Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#22 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#22 (text+ko) ==== @@ -2776,8 +2776,10 @@ static void ath_newassoc(struct ieee80211com *ic, struct ieee80211_node *ni, int isnew) { - if (isnew) - ath_rate_ctl_start((struct ath_softc *)ic, ni); + if (isnew) { + struct ifnet *ifp = ic->ic_ifp; + ath_rate_ctl_start(ifp->if_softc, ni); + } } static int From owner-p4-projects@FreeBSD.ORG Sun Feb 1 10:32:38 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7989316A4D1; Sun, 1 Feb 2004 10:32:38 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5494E16A4CE for ; Sun, 1 Feb 2004 10:32:38 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CBCD143D2D for ; Sun, 1 Feb 2004 10:32:36 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11IWa0B058175 for ; Sun, 1 Feb 2004 10:32:36 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11IWaQi058172 for perforce@freebsd.org; Sun, 1 Feb 2004 10:32:36 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 10:32:36 -0800 (PST) Message-Id: <200402011832.i11IWaQi058172@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46312 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 18:32:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=46312 Change 46312 by sam@sam_ebb on 2004/02/01 10:31:38 make M_80211_NODE visible for use by drivers Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#8 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.h#8 (text+ko) ==== @@ -122,6 +122,7 @@ int ni_txrate; /* index to ni_rates[] */ struct ieee80211_nodestats ni_stats; /* per-node statistics */ }; +MALLOC_DECLARE(M_80211_NODE); static __inline struct ieee80211_node * ieee80211_ref_node(struct ieee80211_node *ni) From owner-p4-projects@FreeBSD.ORG Sun Feb 1 10:32:39 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A267B16A4D2; Sun, 1 Feb 2004 10:32:38 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61EEC16A4CF for ; Sun, 1 Feb 2004 10:32:38 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3909143D31 for ; Sun, 1 Feb 2004 10:32:37 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11IWb0B058181 for ; Sun, 1 Feb 2004 10:32:37 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11IWa0P058178 for perforce@freebsd.org; Sun, 1 Feb 2004 10:32:36 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 10:32:36 -0800 (PST) Message-Id: <200402011832.i11IWa0P058178@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46313 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 18:32:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=46313 Change 46313 by sam@sam_ebb on 2004/02/01 10:32:08 add malloc.h include for circularity kludge after we exposed M_80211_NODE Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.h#4 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_freebsd.h#4 (text+ko) ==== @@ -58,6 +58,7 @@ #define ieee80211_node_decref(_ni) atomic_subtract_int(&(_ni)->ni_refcnt,1) /* XXX handle circularity required by inline function */ +#include #include #include From owner-p4-projects@FreeBSD.ORG Sun Feb 1 10:34:48 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CDF0E16A4D1; Sun, 1 Feb 2004 10:34:47 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A66EF16A4CE for ; Sun, 1 Feb 2004 10:34:47 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D7FA43D45 for ; Sun, 1 Feb 2004 10:34:41 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11IYe0B058249 for ; Sun, 1 Feb 2004 10:34:40 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11IYeEj058246 for perforce@freebsd.org; Sun, 1 Feb 2004 10:34:40 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 10:34:40 -0800 (PST) Message-Id: <200402011834.i11IYeEj058246@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46315 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 18:34:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=46315 Change 46315 by sam@sam_ebb on 2004/02/01 10:34:16 tag node allocations with M_80211_NODE Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#23 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#23 (text+ko) ==== @@ -1538,8 +1538,8 @@ static struct ieee80211_node * ath_node_alloc(struct ieee80211com *ic) { - struct ath_node *an = - malloc(sizeof(struct ath_node), M_DEVBUF, M_NOWAIT | M_ZERO); + struct ath_node *an = malloc(sizeof(struct ath_node), + M_80211_NODE, M_NOWAIT | M_ZERO); if (an) { struct ifnet *ifp = ic->ic_ifp; struct ath_softc *sc = ifp->if_softc; @@ -1565,7 +1565,7 @@ if (bf->bf_node == ni) bf->bf_node = NULL; } - free(ni, M_DEVBUF); + free(ni, M_80211_NODE); } static void From owner-p4-projects@FreeBSD.ORG Sun Feb 1 10:34:49 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 74B9F16A4D0; Sun, 1 Feb 2004 10:34:49 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5007116A4CE for ; Sun, 1 Feb 2004 10:34:49 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7075743D39 for ; Sun, 1 Feb 2004 10:34:40 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11IYe0B058243 for ; Sun, 1 Feb 2004 10:34:40 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11IYdcS058240 for perforce@freebsd.org; Sun, 1 Feb 2004 10:34:39 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 10:34:39 -0800 (PST) Message-Id: <200402011834.i11IYdcS058240@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46314 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 18:34:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=46314 Change 46314 by sam@sam_ebb on 2004/02/01 10:33:57 o don't reuse ni when doing ap bridge forwarding; besides being bad programming practice it's now used later and so this caused a null reference o remove some bogus node_unref calls on error conditions--the caller holds the node ref and is responsible for doing the unref Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#13 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#13 (text+ko) ==== @@ -121,7 +121,6 @@ IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, ("receive packet with wrong version: %x\n", wh->i_fc[0])); - ieee80211_unref_node(&ni); ic->ic_stats.is_rx_badversion++; goto err; } @@ -291,7 +290,6 @@ IEEE80211_SEND_MGMT(ic, ni, IEEE80211_FC0_SUBTYPE_DISASSOC, IEEE80211_REASON_NOT_ASSOCED); - ieee80211_unref_node(&ni); ic->ic_stats.is_rx_notassoc++; goto err; } @@ -305,7 +303,6 @@ IEEE80211_DPRINTF(ic, IEEE80211_MSG_INPUT, ("%s: data from unauthenticated src %s\n", __func__, ether_sprintf(wh->i_addr2))); - ieee80211_unref_node(&ni); ic->ic_stats.is_rx_not1xauth++; /* XXX node statistic */ goto err; @@ -364,13 +361,14 @@ else m1->m_flags |= M_MCAST; } else { - ni = ieee80211_find_node(ic, eh->ether_dhost); - if (ni != NULL) { - if (ni->ni_associd != 0) { + struct ieee80211_node *ni1 = + ieee80211_find_node(ic, eh->ether_dhost); + if (ni1 != NULL) { + if (ni1->ni_associd != 0) { m1 = m; m = NULL; } - ieee80211_unref_node(&ni); + ieee80211_unref_node(&ni1); } } if (m1 != NULL) { From owner-p4-projects@FreeBSD.ORG Sun Feb 1 11:27:48 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F1F316A4D0; Sun, 1 Feb 2004 11:27:48 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09CF316A4CE for ; Sun, 1 Feb 2004 11:27:47 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9FE943D69 for ; Sun, 1 Feb 2004 11:27:46 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11JRk0B071103 for ; Sun, 1 Feb 2004 11:27:46 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11JRkOe071100 for perforce@freebsd.org; Sun, 1 Feb 2004 11:27:46 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 11:27:46 -0800 (PST) Message-Id: <200402011927.i11JRkOe071100@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46318 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 19:27:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=46318 Change 46318 by sam@sam_ebb on 2004/02/01 11:26:45 destroy ni_savedq interface mutex on node cleanup Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#7 (text+ko) ==== @@ -546,6 +546,7 @@ if (ic->ic_set_tim) ic->ic_set_tim(ic, ni->ni_associd, 0); } + mtx_destroy(&ni->ni_savedq.ifq_mtx); /* XXX */ if (TAILQ_EMPTY(&ic->ic_node)) ic->ic_inact_timer = 0; for (i = 0; i < N(ni->ni_rxfrag); i++) From owner-p4-projects@FreeBSD.ORG Sun Feb 1 12:07:36 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B558916A4D0; Sun, 1 Feb 2004 12:07:36 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F9BB16A4CE for ; Sun, 1 Feb 2004 12:07:36 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C522F43D2F for ; Sun, 1 Feb 2004 12:07:35 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11K7Z0B080689 for ; Sun, 1 Feb 2004 12:07:35 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11K7ZZ8080686 for perforce@freebsd.org; Sun, 1 Feb 2004 12:07:35 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 12:07:35 -0800 (PST) Message-Id: <200402012007.i11K7ZZ8080686@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46320 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 20:07:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=46320 Change 46320 by sam@sam_ebb on 2004/02/01 12:07:27 when switching modes reset any desired channel that becomes invalidated; otherwise it'll stick and scanning will fail Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#10 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#10 (text+ko) ==== @@ -761,6 +761,12 @@ ("Bad IBSS channel %u", ieee80211_chan2ieee(ic, ic->ic_ibss_chan))); } + /* + * If the desired channel is set but no longer valid then reset it. + */ + if (ic->ic_des_chan != IEEE80211_CHAN_ANYC && + isclr(ic->ic_chan_active, ieee80211_chan2ieee(ic, ic->ic_des_chan))) + ic->ic_des_chan = IEEE80211_CHAN_ANYC; /* * Do 11b/11g mixed-mode state setup. From owner-p4-projects@FreeBSD.ORG Sun Feb 1 13:07:50 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3495D16A4D0; Sun, 1 Feb 2004 13:07:50 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C23816A4CE for ; Sun, 1 Feb 2004 13:07:50 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B2DC43D39 for ; Sun, 1 Feb 2004 13:07:49 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11L7n0B099826 for ; Sun, 1 Feb 2004 13:07:49 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11L7mWG099823 for perforce@freebsd.org; Sun, 1 Feb 2004 13:07:48 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 13:07:48 -0800 (PST) Message-Id: <200402012107.i11L7mWG099823@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46322 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 21:07:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=46322 Change 46322 by sam@sam_ebb on 2004/02/01 13:07:22 adjust pointer after appending the erp element id Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#12 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#12 (text+ko) ==== @@ -459,7 +459,7 @@ *frm++ = 0; *frm++ = 0; /* TODO: ATIM window */ } if (ic->ic_curmode == IEEE80211_MODE_11G) - ieee80211_add_erp(frm, ic); + frm = ieee80211_add_erp(frm, ic); frm = ieee80211_add_xrates(frm, &ic->ic_bss->ni_rates); m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *); break; @@ -752,7 +752,7 @@ bo->bo_dtim_len = 6; } if (ic->ic_curmode == IEEE80211_MODE_11G) - ieee80211_add_erp(frm, ic); + frm = ieee80211_add_erp(frm, ic); bo->bo_xrates = frm; efrm = ieee80211_add_xrates(frm, rs); bo->bo_xrates_len = efrm - frm; From owner-p4-projects@FreeBSD.ORG Sun Feb 1 14:14:15 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8ABD216A4D0; Sun, 1 Feb 2004 14:14:15 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6646E16A4CE for ; Sun, 1 Feb 2004 14:14:15 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E52C943D70 for ; Sun, 1 Feb 2004 14:14:11 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11MEB0B015669 for ; Sun, 1 Feb 2004 14:14:11 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11MEBlk015666 for perforce@freebsd.org; Sun, 1 Feb 2004 14:14:11 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 14:14:11 -0800 (PST) Message-Id: <200402012214.i11MEBlk015666@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46326 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 22:14:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=46326 Change 46326 by sam@sam_ebb on 2004/02/01 14:13:40 indicate driver is capable of short slot time Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#24 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#24 (text+ko) ==== @@ -338,6 +338,7 @@ | IEEE80211_C_HOSTAP /* hostap mode */ | IEEE80211_C_MONITOR /* monitor mode */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ + | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_RCVMGT /* recv management frames */ ; ic->ic_flags |= IEEE80211_F_DATAPAD; From owner-p4-projects@FreeBSD.ORG Sun Feb 1 14:17:27 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3BAB016A4E1; Sun, 1 Feb 2004 14:17:27 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F1D2E16A4DB for ; Sun, 1 Feb 2004 14:17:26 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5414543D2D for ; Sun, 1 Feb 2004 14:17:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i11MHG0B015829 for ; Sun, 1 Feb 2004 14:17:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i11MHFcQ015826 for perforce@freebsd.org; Sun, 1 Feb 2004 14:17:15 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 14:17:15 -0800 (PST) Message-Id: <200402012217.i11MHFcQ015826@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46327 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 22:17:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=46327 Change 46327 by sam@sam_ebb on 2004/02/01 14:16:29 o correct short slot time handling: enable it only for 11g when not operating in ibss mode and when the driver says it can do it o move short slot time handling into ieee80211_reset_erp where it can be shared o move ieee80211_reset_erp call in the state machine from the transition assoc->init to run->init; it's not clear what the original patch was intended to do and/or if this reset logic is even needed Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#11 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#11 (text+ko) ==== @@ -769,19 +769,20 @@ ic->ic_des_chan = IEEE80211_CHAN_ANYC; /* - * Do 11b/11g mixed-mode state setup. + * Do mode-specific rate setup. */ if (mode == IEEE80211_MODE_11G) { - /* use mixed 11b/11g rate set */ + /* + * Use a mixed 11b/11g rate set. + */ ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode], IEEE80211_MODE_11G); } else if (mode == IEEE80211_MODE_11B) { - /* force pure 11b rate set */ + /* + * Force pure 11b rate set. + */ ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode], IEEE80211_MODE_11B); - ic->ic_flags &= ~IEEE80211_F_SHSLOT; - } else { - ic->ic_flags &= ~IEEE80211_F_SHSLOT; } ieee80211_reset_erp(ic, mode); /* reset ERP state */ @@ -808,7 +809,17 @@ ic->ic_flags &= ~IEEE80211_F_USEPROT; ic->ic_nonerpsta = 0; ic->ic_longslotsta = 0; - if (mode == IEEE80211_MODE_11G && (ic->ic_caps & IEEE80211_C_SHSLOT)) + /* + * Short slot time is enabled only when operating in 11g + * and not in an IBSS. We must also honor whether or not + * the driver is capable of doing it. + */ + /* XXX what about auto? */ + if (mode == IEEE80211_MODE_11G && + ic->ic_opmode != IEEE80211_M_IBSS && + (ic->ic_caps & IEEE80211_C_SHSLOT)) + ic->ic_flags |= IEEE80211_F_SHSLOT; + else ic->ic_flags &= ~IEEE80211_F_SHSLOT; /* * Set short preamble and ERP barker-preamble flags. ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#7 (text+ko) ==== @@ -347,8 +347,13 @@ ic->ic_longslotsta--; if (ic->ic_longslotsta == 0 && ic->ic_curmode == IEEE80211_MODE_11G) { - /* XXX check capability */ - ic->ic_flags |= IEEE80211_F_SHSLOT; + /* + * Re-enable use of short slot time if supported + * and not operating in IBSS mode (per spec). + */ + if ((ic->ic_caps & IEEE80211_C_SHSLOT) && + ic->ic_opmode != IEEE80211_M_IBSS) + ic->ic_flags |= IEEE80211_F_SHSLOT; } } /* @@ -403,6 +408,7 @@ IEEE80211_REASON_ASSOC_LEAVE); } IEEE80211_NODE_UNLOCK(ic); + ieee80211_reset_erp(ic, ic->ic_curmode); break; default: break; @@ -423,8 +429,6 @@ IEEE80211_REASON_AUTH_LEAVE); } IEEE80211_NODE_UNLOCK(ic); - /* XXX??? */ - ieee80211_reset_erp(ic, ic->ic_curmode); break; default: break; From owner-p4-projects@FreeBSD.ORG Sun Feb 1 17:46:32 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A76E916A4D0; Sun, 1 Feb 2004 17:46:31 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F44C16A4CE for ; Sun, 1 Feb 2004 17:46:31 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 917D043D2D for ; Sun, 1 Feb 2004 17:46:30 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i121kU0B069768 for ; Sun, 1 Feb 2004 17:46:30 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i121kUph069765 for perforce@freebsd.org; Sun, 1 Feb 2004 17:46:30 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 17:46:30 -0800 (PST) Message-Id: <200402020146.i121kUph069765@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46332 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 01:46:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=46332 Change 46332 by sam@sam_ebb on 2004/02/01 17:46:14 add non-ap slot time setup Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#25 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#25 (text+ko) ==== @@ -104,6 +104,7 @@ static void ath_bmiss_proc(void *, int); static void ath_initkeytable(struct ath_softc *); static void ath_mode_init(struct ath_softc *); +static void ath_setslottime(struct ath_softc *); static int ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *); static void ath_beacon_proc(struct ath_softc *); static void ath_beacon_free(struct ath_softc *); @@ -1079,8 +1080,9 @@ rfilt = ath_calcrxfilter(sc); ath_hal_setrxfilter(ah, rfilt); - /* configure operational mode */ + /* configure operational mode and slot time */ ath_hal_setopmode(ah); + ath_setslottime(sc); /* calculate and install multicast filter */ if ((ifp->if_flags & IFF_ALLMULTI) == 0) { @@ -1232,7 +1234,6 @@ bf->bf_m = m; else m_freem(m); - ath_setslottime(sc); /* initialize slot time state */ return error; } @@ -2720,6 +2721,8 @@ if (ath_hal_keyisvalid(ah, i)) ath_hal_keysetmac(ah, i, bssid); } + if ((ic->ic_flags ^ sc->sc_icflags) & IEEE80211_F_SHSLOT) + ath_setslottime(sc); if (nstate == IEEE80211_S_RUN) { DPRINTF(ATH_DEBUG_ANY, ("%s(RUN): ic_flags=0x%08x iv=%d bssid=%s " From owner-p4-projects@FreeBSD.ORG Sun Feb 1 20:05:21 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4B60F16A4D0; Sun, 1 Feb 2004 20:05:21 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24C0716A4CE for ; Sun, 1 Feb 2004 20:05:21 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5995143D41 for ; Sun, 1 Feb 2004 20:05:20 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1245K0B001804 for ; Sun, 1 Feb 2004 20:05:20 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1245J0r001801 for perforce@freebsd.org; Sun, 1 Feb 2004 20:05:19 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sun, 1 Feb 2004 20:05:19 -0800 (PST) Message-Id: <200402020405.i1245J0r001801@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46336 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 04:05:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=46336 Change 46336 by sam@sam_ebb on 2004/02/01 20:05:19 whitespace Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#13 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#13 (text+ko) ==== @@ -215,7 +215,6 @@ goto bad; } } - m_adj(m, sizeof(struct ether_header) - sizeof(struct llc)); llc = mtod(m, struct llc *); From owner-p4-projects@FreeBSD.ORG Mon Feb 2 14:49:34 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 727C816A4D0; Mon, 2 Feb 2004 14:49:34 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E58516A4CE for ; Mon, 2 Feb 2004 14:49:34 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 874E043D3F for ; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i12MnW0B089387 for ; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i12MnWkw089384 for perforce@freebsd.org; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 2 Feb 2004 14:49:32 -0800 (PST) Message-Id: <200402022249.i12MnWkw089384@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46381 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 22:49:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=46381 Change 46381 by sam@sam_ebb on 2004/02/02 14:49:08 purge unused cruft Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#12 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#12 (text+ko) ==== @@ -557,12 +557,6 @@ break; case IEEE80211_M_IBSS: ic->ic_flags |= IEEE80211_F_IBSSON; -#ifdef notdef - if (ic->ic_curmode == IEEE80211_MODE_11G) - ieee80211_set11gbasicrates( - &ic->ic_suprates[newphymode], - IEEE80211_MODE_11B); -#endif break; } error = ENETRESET; From owner-p4-projects@FreeBSD.ORG Mon Feb 2 14:49:35 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C035B16A4D2; Mon, 2 Feb 2004 14:49:34 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 736D516A4CE for ; Mon, 2 Feb 2004 14:49:34 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED50043D41 for ; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i12MnW0B089393 for ; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i12MnWZY089390 for perforce@freebsd.org; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 2 Feb 2004 14:49:32 -0800 (PST) Message-Id: <200402022249.i12MnWZY089390@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46382 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 22:49:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=46382 Change 46382 by sam@sam_ebb on 2004/02/02 14:49:22 whitespace sync with madwifi Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#14 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#14 (text+ko) ==== @@ -468,9 +468,9 @@ /* should not come here */ break; } - err: +err: ifp->if_ierrors++; - out: +out: if (m != NULL) { if (ic->ic_rawbpf) bpf_mtap(ic->ic_rawbpf, m); @@ -1227,7 +1227,6 @@ /* * Honor ERP: enable protection and/or disable * the use of short slot time. - * XXX where do we reset this state? */ if (erp & IEEE80211_ERP_USE_PROTECTION) ic->ic_flags |= IEEE80211_F_USEPROT; From owner-p4-projects@FreeBSD.ORG Mon Feb 2 14:49:35 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6580316A4E0; Mon, 2 Feb 2004 14:49:35 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C72816A522 for ; Mon, 2 Feb 2004 14:49:35 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 147D043D39 for ; Mon, 2 Feb 2004 14:49:32 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i12MnV0B089381 for ; Mon, 2 Feb 2004 14:49:31 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i12MnVv3089378 for perforce@freebsd.org; Mon, 2 Feb 2004 14:49:31 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 2 Feb 2004 14:49:31 -0800 (PST) Message-Id: <200402022249.i12MnVv3089378@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46380 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 22:49:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=46380 Change 46380 by sam@sam_ebb on 2004/02/02 14:48:53 beacons may have dtim or atim dependiny on whether they are for ibss or ap operation; change various names to be agnostic Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#14 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.h#6 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#9 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#14 (text+ko) ==== @@ -687,6 +687,7 @@ pktlen += 3; /* ERP information element */ if (rs->rs_nrates > IEEE80211_RATE_SIZE) pktlen += 2; /* extended rate set */ + /* XXX may be better to just allocate a max-sized buffer */ m = ieee80211_getmgtframe(&frm, pktlen); if (m == NULL) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, @@ -733,14 +734,13 @@ *frm++ = 1; *frm++ = ieee80211_chan2ieee(ic, ni->ni_chan); } + bo->bo_tim = frm; if (ic->ic_opmode == IEEE80211_M_IBSS) { *frm++ = IEEE80211_ELEMID_IBSSPARMS; *frm++ = 2; *frm++ = 0; *frm++ = 0; /* TODO: ATIM window */ - bo->bo_dtim = NULL; - bo->bo_dtim_len = 0; + bo->bo_tim_len = 4; } else { - bo->bo_dtim = frm; /* TODO: TIM */ *frm++ = IEEE80211_ELEMID_TIM; *frm++ = 4; /* length */ @@ -748,7 +748,7 @@ *frm++ = 1; /* DTIM period */ *frm++ = 0; /* bitmap control */ *frm++ = 0; /* Partial Virtual Bitmap (variable length) */ - bo->bo_dtim_len = 6; + bo->bo_tim_len = 6; } if (ic->ic_curmode == IEEE80211_MODE_11G) frm = ieee80211_add_erp(frm, ic); @@ -787,16 +787,18 @@ capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME; *bo->bo_caps = htole16(capinfo); - if (ic->ic_flags & IEEE80211_F_DTIMUPDATE) { + if (ic->ic_flags & IEEE80211_F_TIMUPDATE) { /* - * DTIM needs updating. If it fits in the current - * space allocated then just copy in the new bits. - * Otherwise we need to move any extended rate set - * the follows and, possibly, allocate a new mbuf - * if the this current mbuf isn't large enough. + * ATIM/DTIM needs updating. If it fits in the + * current space allocated then just copy in the + * new bits. Otherwise we need to move any extended + * rate set the follows and, possibly, allocate a + * new buffer if the this current one isn't large + * enough. XXX It may be better to just allocate + * a max-sized buffer so we don't re-allocate. */ /* XXX fillin */ - ic->ic_flags &= ~IEEE80211_F_DTIMUPDATE; + ic->ic_flags &= ~IEEE80211_F_TIMUPDATE; } return 0; } ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.h#6 (text+ko) ==== @@ -87,12 +87,12 @@ */ struct ieee80211_beacon_offsets { u_int16_t *bo_caps; /* capabilities */ - u_int8_t *bo_dtim; /* start of dtim */ + u_int8_t *bo_tim; /* start of atim/dtim */ u_int8_t *bo_xrates; /* start of extended rates */ - u_int16_t bo_dtim_len; /* dtim length in bytes */ + u_int16_t bo_tim_len; /* atim/dtim length in bytes */ u_int16_t bo_xrates_len; /* xrates length in bytes */ }; -extern struct mbuf * ieee80211_beacon_alloc(struct ieee80211com *, +extern struct mbuf *ieee80211_beacon_alloc(struct ieee80211com *, struct ieee80211_node *, struct ieee80211_beacon_offsets *); extern int ieee80211_beacon_update(struct ieee80211com *, struct ieee80211_node *, struct ieee80211_beacon_offsets *, ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#9 (text+ko) ==== @@ -263,7 +263,7 @@ #define IEEE80211_F_DATAPAD 0x00080000 /* CONF: do alignment pad */ #define IEEE80211_F_USEPROT 0x00100000 /* STATUS: protection enabled */ #define IEEE80211_F_USEBARKER 0x00200000 /* STATUS: use barker preamble*/ -#define IEEE80211_F_DTIMUPDATE 0x00400000 /* STATUS: update beacon dtim */ +#define IEEE80211_F_TIMUPDATE 0x00400000 /* STATUS: update beacon tim */ /* ic_caps */ #define IEEE80211_C_WEP 0x00000001 /* CAPABILITY: WEP available */ From owner-p4-projects@FreeBSD.ORG Mon Feb 2 14:50:36 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6360F16A4D0; Mon, 2 Feb 2004 14:50:36 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E5CF16A4CE for ; Mon, 2 Feb 2004 14:50:36 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AFFC43D39 for ; Mon, 2 Feb 2004 14:50:35 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i12MoY0B089610 for ; Mon, 2 Feb 2004 14:50:34 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i12MoYI9089606 for perforce@freebsd.org; Mon, 2 Feb 2004 14:50:34 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 2 Feb 2004 14:50:34 -0800 (PST) Message-Id: <200402022250.i12MoYI9089606@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46383 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 22:50:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=46383 Change 46383 by sam@sam_ebb on 2004/02/02 14:49:37 sync with madwifi Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#9 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#9 (text+ko) ==== @@ -189,7 +189,8 @@ enum { IEEE80211_PARAM_TURBO = 1, /* turbo mode */ - IEEE80211_PARAM_MODE = 2 /* phy mode (11a, 11b, etc.) */ + IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */ + IEEE80211_PARAM_AUTHMODE= 3 /* authentication mode */ }; #define SIOCG80211STATS (SIOCDEVPRIVATE+2) From owner-p4-projects@FreeBSD.ORG Mon Feb 2 15:42:28 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 72F7D16A4D1; Mon, 2 Feb 2004 15:42:28 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30A3616A4CE for ; Mon, 2 Feb 2004 15:42:28 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5416243D68 for ; Mon, 2 Feb 2004 15:41:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i12Nfd0B002434 for ; Mon, 2 Feb 2004 15:41:39 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i12Nfd3K002425 for perforce@freebsd.org; Mon, 2 Feb 2004 15:41:39 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 2 Feb 2004 15:41:39 -0800 (PST) Message-Id: <200402022341.i12Nfd3K002425@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46388 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 23:42:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=46388 Change 46388 by sam@sam_ebb on 2004/02/02 15:41:05 remove unused variable Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_athvar.h#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_athvar.h#7 (text+ko) ==== @@ -83,7 +83,6 @@ u_int8_t an_tx_rate1sp; /* series 1 short preamble h/w rate */ u_int8_t an_tx_rate2sp; /* series 2 short preamble h/w rate */ u_int8_t an_tx_rate3sp; /* series 3 short preamble h/w rate */ - u_int an_rx_antenna; /* antenna for last rcvd frame */ struct ath_recv_hist an_rx_hist[ATH_RHIST_SIZE]; u_int an_rx_hist_next;/* index of next ``free entry'' */ }; From owner-p4-projects@FreeBSD.ORG Mon Feb 2 15:42:35 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BC75016A4D1; Mon, 2 Feb 2004 15:42:35 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B23616A4D0 for ; Mon, 2 Feb 2004 15:42:35 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05FAE43D58 for ; Mon, 2 Feb 2004 15:42:02 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i12Nfe0B002443 for ; Mon, 2 Feb 2004 15:41:40 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i12NfdhM002437 for perforce@freebsd.org; Mon, 2 Feb 2004 15:41:39 -0800 (PST) (envelope-from sam@freebsd.org) Date: Mon, 2 Feb 2004 15:41:39 -0800 (PST) Message-Id: <200402022341.i12NfdhM002437@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46389 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2004 23:42:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=46389 Change 46389 by sam@sam_ebb on 2004/02/02 15:41:23 cleanups from madwifi Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#26 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#26 (text+ko) ==== @@ -2057,7 +2057,7 @@ shortPreamble = AH_FALSE; } - an = (struct ath_node *) ni; + an = ATH_NODE(ni); /* * Calculate Atheros packet type from IEEE80211 packet header * and setup for rate calculations. @@ -2228,7 +2228,7 @@ , atype /* Atheros packet type */ , MIN(ni->ni_txpower,60)/* txpower */ , txrate, try0 /* series 0 rate/tries */ - , iswep ? sc->sc_ic.ic_wep_txkey : HAL_TXKEYIX_INVALID + , iswep ? ic->ic_wep_txkey : HAL_TXKEYIX_INVALID , antenna /* antenna mode */ , flags /* flags */ , ctsrate /* rts/cts rate */ @@ -2350,7 +2350,7 @@ ni = bf->bf_node; if (ni != NULL) { - an = (struct ath_node *) ni; + an = ATH_NODE(ni); if (ds->ds_txstat.ts_status == 0) { an->an_tx_ok++; an->an_tx_antenna = ds->ds_txstat.ts_antenna; @@ -2909,7 +2909,7 @@ static void ath_rate_update(struct ath_softc *sc, struct ieee80211_node *ni, int rate) { - struct ath_node *an = (struct ath_node *) ni; + struct ath_node *an = ATH_NODE(ni); const HAL_RATE_TABLE *rt = sc->sc_currates; u_int8_t rix; From owner-p4-projects@FreeBSD.ORG Tue Feb 3 08:22:24 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C6F3316A4D0; Tue, 3 Feb 2004 08:22:23 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B53D16A4CE for ; Tue, 3 Feb 2004 08:22:23 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06AFC43D2D for ; Tue, 3 Feb 2004 08:22:19 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i13GMI0B053975 for ; Tue, 3 Feb 2004 08:22:18 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i13GMHoE053951 for perforce@freebsd.org; Tue, 3 Feb 2004 08:22:17 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Tue, 3 Feb 2004 08:22:17 -0800 (PST) Message-Id: <200402031622.i13GMHoE053951@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46420 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 16:22:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=46420 Change 46420 by jhb@jhb_slimer on 2004/02/03 08:21:53 IFC @46414. Affected files ... .. //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#24 integrate .. //depot/projects/smpng/sys/amd64/acpica/madt.c#3 integrate .. //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#8 integrate .. //depot/projects/smpng/sys/amd64/amd64/db_trace.c#4 integrate .. //depot/projects/smpng/sys/amd64/amd64/fpu.c#4 integrate .. //depot/projects/smpng/sys/amd64/amd64/genassym.c#10 integrate .. //depot/projects/smpng/sys/amd64/amd64/local_apic.c#3 integrate .. //depot/projects/smpng/sys/amd64/amd64/machdep.c#20 integrate .. //depot/projects/smpng/sys/amd64/amd64/mp_machdep.c#6 integrate .. //depot/projects/smpng/sys/amd64/amd64/pmap.c#21 integrate .. //depot/projects/smpng/sys/amd64/amd64/trap.c#15 integrate .. //depot/projects/smpng/sys/amd64/amd64/vm_machdep.c#14 integrate .. //depot/projects/smpng/sys/amd64/conf/GENERIC#13 integrate .. //depot/projects/smpng/sys/amd64/include/cpufunc.h#6 integrate .. //depot/projects/smpng/sys/amd64/include/fpu.h#2 integrate .. //depot/projects/smpng/sys/amd64/include/md_var.h#8 integrate .. //depot/projects/smpng/sys/amd64/include/pcb.h#6 integrate .. //depot/projects/smpng/sys/amd64/include/reg.h#4 integrate .. //depot/projects/smpng/sys/amd64/include/smp.h#3 integrate .. //depot/projects/smpng/sys/amd64/include/specialreg.h#5 integrate .. //depot/projects/smpng/sys/amd64/isa/atpic.c#4 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c#6 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_proto.h#6 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscall.h#6 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_syscalls.c#6 integrate .. //depot/projects/smpng/sys/compat/freebsd32/freebsd32_sysent.c#6 integrate .. //depot/projects/smpng/sys/compat/freebsd32/syscalls.master#6 integrate .. //depot/projects/smpng/sys/compat/ndis/kern_ndis.c#7 integrate .. //depot/projects/smpng/sys/compat/ndis/subr_ndis.c#7 integrate .. //depot/projects/smpng/sys/conf/files.i386#53 integrate .. //depot/projects/smpng/sys/conf/files.powerpc#17 integrate .. //depot/projects/smpng/sys/conf/majors#34 integrate .. //depot/projects/smpng/sys/conf/systags.sh#2 integrate .. //depot/projects/smpng/sys/dev/aac/aac.c#33 integrate .. //depot/projects/smpng/sys/dev/aac/aac_pci.c#27 integrate .. //depot/projects/smpng/sys/dev/aac/aacvar.h#20 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_thermal.c#22 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.c#46 integrate .. //depot/projects/smpng/sys/dev/ata/ata-all.h#23 integrate .. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#29 integrate .. //depot/projects/smpng/sys/dev/ata/ata-lowlevel.c#9 integrate .. //depot/projects/smpng/sys/dev/ata/ata-pci.h#18 integrate .. //depot/projects/smpng/sys/dev/ata/ata-queue.c#7 integrate .. //depot/projects/smpng/sys/dev/firewire/firewire.c#30 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci.c#30 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci_pci.c#24 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohcireg.h#12 integrate .. //depot/projects/smpng/sys/dev/gem/if_gem_pci.c#13 integrate .. //depot/projects/smpng/sys/dev/hifn/hifn7751.c#14 integrate .. //depot/projects/smpng/sys/dev/if_ndis/if_ndis.c#7 integrate .. //depot/projects/smpng/sys/dev/isp/isp_target.c#11 integrate .. //depot/projects/smpng/sys/dev/sound/driver.c#2 integrate .. //depot/projects/smpng/sys/dev/usb/umass.c#34 integrate .. //depot/projects/smpng/sys/dev/usb/uscanner.c#19 integrate .. //depot/projects/smpng/sys/geom/geom_event.c#25 integrate .. //depot/projects/smpng/sys/geom/geom_mirror.c#7 integrate .. //depot/projects/smpng/sys/geom/geom_subr.c#36 integrate .. //depot/projects/smpng/sys/i386/conf/GENERIC#46 integrate .. //depot/projects/smpng/sys/i386/conf/NOTES#75 integrate .. //depot/projects/smpng/sys/i386/i386/local_apic.c#7 integrate .. //depot/projects/smpng/sys/i386/i386/longrun.c#2 integrate .. //depot/projects/smpng/sys/i386/i386/machdep.c#72 integrate .. //depot/projects/smpng/sys/i386/i386/pmap.c#57 integrate .. //depot/projects/smpng/sys/i386/i386/trap.c#67 integrate .. //depot/projects/smpng/sys/kern/init_sysent.c#40 integrate .. //depot/projects/smpng/sys/kern/kern_mac.c#34 integrate .. //depot/projects/smpng/sys/kern/kern_mutex.c#76 integrate .. //depot/projects/smpng/sys/kern/kern_sig.c#85 integrate .. //depot/projects/smpng/sys/kern/kern_subr.c#29 integrate .. //depot/projects/smpng/sys/kern/kern_switch.c#35 integrate .. //depot/projects/smpng/sys/kern/kern_synch.c#64 integrate .. //depot/projects/smpng/sys/kern/sched_4bsd.c#22 integrate .. //depot/projects/smpng/sys/kern/sched_ule.c#25 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#111 integrate .. //depot/projects/smpng/sys/kern/sys_pipe.c#41 integrate .. //depot/projects/smpng/sys/kern/syscalls.c#40 integrate .. //depot/projects/smpng/sys/kern/syscalls.master#39 integrate .. //depot/projects/smpng/sys/kern/uipc_mbuf.c#24 integrate .. //depot/projects/smpng/sys/kern/uipc_sem.c#9 integrate .. //depot/projects/smpng/sys/kern/uipc_socket.c#46 integrate .. //depot/projects/smpng/sys/kern/uipc_syscalls.c#45 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#23 integrate .. //depot/projects/smpng/sys/net/if.c#41 integrate .. //depot/projects/smpng/sys/net/if_gre.c#14 integrate .. //depot/projects/smpng/sys/netgraph/ng_source.c#5 integrate .. //depot/projects/smpng/sys/netinet/ip_gre.c#11 integrate .. //depot/projects/smpng/sys/netinet/ip_icmp.c#24 integrate .. //depot/projects/smpng/sys/netinet/ip_input.c#47 integrate .. //depot/projects/smpng/sys/netinet/udp_usrreq.c#37 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_vfsops.c#33 integrate .. //depot/projects/smpng/sys/opencrypto/cryptodev.h#7 integrate .. //depot/projects/smpng/sys/opencrypto/cryptosoft.c#6 integrate .. //depot/projects/smpng/sys/pc98/conf/GENERIC#39 integrate .. //depot/projects/smpng/sys/pc98/conf/NOTES#21 integrate .. //depot/projects/smpng/sys/posix4/_semaphore.h#2 integrate .. //depot/projects/smpng/sys/posix4/semaphore.h#5 integrate .. //depot/projects/smpng/sys/powerpc/include/vmparam.h#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/openpic_macio.c#2 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/pmap.c#35 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/uma_machdep.c#1 branch .. //depot/projects/smpng/sys/security/mac/mac_pipe.c#5 integrate .. //depot/projects/smpng/sys/security/mac_biba/mac_biba.c#24 integrate .. //depot/projects/smpng/sys/security/mac_lomac/mac_lomac.c#19 integrate .. //depot/projects/smpng/sys/security/mac_mls/mac_mls.c#23 integrate .. //depot/projects/smpng/sys/security/mac_stub/mac_stub.c#5 integrate .. //depot/projects/smpng/sys/security/mac_test/mac_test.c#19 integrate .. //depot/projects/smpng/sys/sys/mac.h#24 integrate .. //depot/projects/smpng/sys/sys/mac_policy.h#20 integrate .. //depot/projects/smpng/sys/sys/mount.h#25 integrate .. //depot/projects/smpng/sys/sys/param.h#54 integrate .. //depot/projects/smpng/sys/sys/pipe.h#7 integrate .. //depot/projects/smpng/sys/sys/sched.h#8 integrate .. //depot/projects/smpng/sys/sys/socket.h#16 integrate .. //depot/projects/smpng/sys/sys/syscall.h#40 integrate .. //depot/projects/smpng/sys/sys/syscall.mk#40 integrate .. //depot/projects/smpng/sys/sys/sysproto.h#42 integrate .. //depot/projects/smpng/sys/sys/uio.h#14 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_vnops.c#25 integrate .. //depot/projects/smpng/sys/vm/swap_pager.c#40 integrate .. //depot/projects/smpng/sys/vm/uma_core.c#41 integrate .. //depot/projects/smpng/sys/vm/vm_glue.c#36 integrate .. //depot/projects/smpng/sys/vm/vm_map.c#53 integrate .. //depot/projects/smpng/sys/vm/vm_zeroidle.c#14 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#24 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.43 2003/08/17 06:42:08 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.44 2004/02/02 12:57:49 phk Exp $"); #include #include @@ -683,16 +683,7 @@ } -#if 1 #define bsd2osf_dev(dev) (umajor(dev) << 20 | uminor(dev)) -#define osf2bsd_dev(dev) umakedev((umajor(dev) >> 20) & 0xfff, uminor(dev) & 0xfffff) -#else -#define minor(x) ((int)((x)&0xffff00ff)) -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) -#define bsd2osf_dev(dev) (major(dev) << 20 | minor(dev)) -#define osf2bsd_dev(dev) makedev(((dev) >> 20) & 0xfff, (dev) & 0xfffff) -#endif /* * Convert from a stat structure to an osf1 stat structure. */ @@ -728,19 +719,7 @@ struct thread *td; struct osf1_mknod_args *uap; { -#if notanymore - struct mknod_args a; - caddr_t sg; - - sg = stackgap_init(); - CHECKALTEXIST(td, &sg, uap->path); - a.path = uap->path; - a.mode = uap->mode; - a.dev = osf2bsd_dev(uap->dev); - - return mknod(td, &a); -#endif printf("osf1_mknod no longer implemented\n"); return ENOSYS; } ==== //depot/projects/smpng/sys/amd64/acpica/madt.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.10 2003/12/09 03:04:19 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.11 2004/01/30 00:24:45 peter Exp $"); #include #include @@ -320,13 +320,22 @@ } /* - * Run through the MP table enumerating I/O APICs. + * Enumerate I/O APICs and setup interrupt sources. */ static int madt_setup_io(void) { int i; + /* Try to initialize ACPI so that we can access the FADT. */ + i = acpi_Startup(); + if (ACPI_FAILURE(i)) { + printf("MADT: ACPI Startup failed with %s\n", + AcpiFormatException(i)); + printf("Try disabling either ACPI or apic support.\n"); + panic("Using MADT but ACPI doesn't work"); + } + /* First, we run through adding I/O APIC's. */ madt_walk_table(madt_parse_apics, NULL); @@ -523,6 +532,7 @@ { void *new_ioapic, *old_ioapic; u_int new_pin, old_pin; + int force_lo; if (bootverbose) printf("MADT: intr override: source %u, irq %u\n", @@ -535,9 +545,27 @@ return; } + /* + * If the SCI is remapped to a non-ISA global interrupt, + * force it to level trigger and active-lo polarity. + * If the SCI is identity mapped but has edge trigger and + * active-hi polarity, also force it to use level/lo. + */ + force_lo = 0; + if (intr->Source == AcpiGbl_FADT->SciInt) + if (intr->Interrupt > 15 || (intr->Interrupt == intr->Source && + intr->TriggerMode == TRIGGER_EDGE && + intr->Polarity == POLARITY_ACTIVE_HIGH)) + force_lo = 1; + if (intr->Source != intr->Interrupt) { - /* XXX: This assumes that the SCI uses IRQ 9. */ - if (intr->Interrupt > 15 && intr->Source == 9) + /* + * If the SCI is remapped to a non-ISA global interrupt, + * then override the vector we use to setup and allocate + * the interrupt. + */ + if (intr->Interrupt > 15 && + intr->Source == AcpiGbl_FADT->SciInt) acpi_OverrideInterruptLevel(intr->Interrupt); else ioapic_remap_vector(new_ioapic, new_pin, intr->Source); @@ -549,10 +577,18 @@ intr->Source) ioapic_disable_pin(old_ioapic, old_pin); } - ioapic_set_triggermode(new_ioapic, new_pin, - interrupt_trigger(intr->TriggerMode)); - ioapic_set_polarity(new_ioapic, new_pin, - interrupt_polarity(intr->Polarity)); + if (force_lo) { + printf( + "MADT: Forcing active-lo polarity and level trigger for IRQ %d\n", + intr->Source); + ioapic_set_polarity(new_ioapic, new_pin, 0); + ioapic_set_triggermode(new_ioapic, new_pin, 0); + } else { + ioapic_set_polarity(new_ioapic, new_pin, + interrupt_polarity(intr->Polarity)); + ioapic_set_triggermode(new_ioapic, new_pin, + interrupt_trigger(intr->TriggerMode)); + } } /* ==== //depot/projects/smpng/sys/amd64/amd64/cpu_switch.S#8 (text+ko) ==== @@ -34,10 +34,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.145 2004/01/23 01:04:28 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.146 2004/01/29 00:02:54 peter Exp $ */ #include +#include #include "assym.s" @@ -130,16 +131,36 @@ movl %fs,PCB_FS(%r8) movl %gs,PCB_GS(%r8) + /* Test if debug registers should be saved. */ + testl $PCB_DBREGS,PCB_FLAGS(%r8) + jz 1f /* no, skip over */ + movq %dr7,%rax /* yes, do the save */ + movq %rax,PCB_DR7(%r8) + andq $0x0000fc00, %rax /* disable all watchpoints */ + movq %rax,%dr7 + movq %dr6,%rax + movq %rax,PCB_DR6(%r8) + movq %dr3,%rax + movq %rax,PCB_DR3(%r8) + movq %dr2,%rax + movq %rax,PCB_DR2(%r8) + movq %dr1,%rax + movq %rax,PCB_DR1(%r8) + movq %dr0,%rax + movq %rax,PCB_DR0(%r8) +1: + /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) jne 1f - pushq %rdi - pushq %rsi - addq $PCB_SAVEFPU,%r8 /* h/w bugs make saving complicated */ - movq %r8, %rdi - call fpusave /* do it in a big C function */ - popq %rsi - popq %rdi + addq $PCB_SAVEFPU,%r8 + clts + fxsave (%r8) + smsw %ax + orb $CR0_TS,%al + lmsw %ax + xorq %rax,%rax + movq %rax,PCPU(FPCURTHREAD) 1: /* Save is done. Now fire up new thread. Leave old vmspace. */ @@ -148,12 +169,19 @@ jz badsw3 /* no, panic */ #endif movq TD_PCB(%rsi),%r8 - movl PCPU(CPUID), %eax /* switch address space */ movq PCB_CR3(%r8),%rdx +#ifdef LAZY_SWITCH + cmpq %rdx,KPML4phys /* Kernel address space? */ + je sw1 +#endif + movq %cr3,%rax + cmpq %rdx,%rax /* Same address space? */ + je sw1 movq %rdx,%cr3 /* new address space */ + movl PCPU(CPUID), %eax /* Release bit from old pmap->pm_active */ movq TD_PROC(%rdi), %rdx /* oldproc */ movq P_VMSPACE(%rdx), %rdx @@ -223,6 +251,28 @@ movq %r8, PCPU(CURPCB) movq %rsi, PCPU(CURTHREAD) /* into next thread */ + /* Test if debug registers should be restored. */ + testl $PCB_DBREGS,PCB_FLAGS(%r8) + jz 1f + movq PCB_DR6(%r8),%rax + movq %rax,%dr6 + movq PCB_DR3(%r8),%rax + movq %rax,%dr3 + movq PCB_DR2(%r8),%rax + movq %rax,%dr2 + movq PCB_DR1(%r8),%rax + movq %rax,%dr1 + movq PCB_DR0(%r8),%rax + movq %rax,%dr0 + /* But preserve reserved bits in %dr7 */ + movq %dr7,%rax + andq $0x0000fc00,%rax + movq PCB_DR7(%r8),%rcx + andq $~0x0000fc00,%rcx + orq %rcx,%rax + movq %rax,%dr7 +1: + ret #ifdef INVARIANTS @@ -242,7 +292,9 @@ pushq %r13 pushq %r14 pushq %r15 - pushq $sw0_1 + movq $0,%rdi + movq $0,%rsi + leaq sw0_1,%rdx call __panic sw0_1: .asciz "cpu_throw: no newthread supplied" @@ -262,7 +314,9 @@ pushq %r13 pushq %r14 pushq %r15 - pushq $sw0_2 + movq $0,%rdi + movq $0,%rsi + leaq sw0_2,%rdx call __panic sw0_2: .asciz "cpu_switch: no curthread supplied" @@ -282,7 +336,9 @@ pushq %r13 pushq %r14 pushq %r15 - pushq $sw0_3 + movq $0,%rdi + movq $0,%rsi + leaq sw0_3,%rdx call __panic sw0_3: .asciz "cpu_switch: no newthread supplied" #endif @@ -332,17 +388,17 @@ testq %rax,%rax je 1f - pushq %rcx - pushq %rax movq TD_PCB(%rax),%rdi leaq PCB_SAVEFPU(%rdi),%rdi - call fpusave - popq %rax - popq %rcx + clts + fxsave (%rdi) + smsw %ax + orb $CR0_TS,%al + lmsw %ax movq $PCB_SAVEFPU_SIZE,%rdx /* arg 3 */ leaq PCB_SAVEFPU(%rcx),%rsi /* arg 2 */ - movq %rax,%rdi /* arg 1 */ + /* arg 1 (%rdi) already loaded */ call bcopy 1: popfq ==== //depot/projects/smpng/sys/amd64/amd64/db_trace.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.59 2003/11/17 08:58:12 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.60 2004/01/28 23:57:40 peter Exp $"); #include #include @@ -46,7 +46,6 @@ #include #include -#if 0 db_varfcn_t db_dr0; db_varfcn_t db_dr1; db_varfcn_t db_dr2; @@ -55,7 +54,6 @@ db_varfcn_t db_dr5; db_varfcn_t db_dr6; db_varfcn_t db_dr7; -#endif /* * Machine register set. @@ -87,7 +85,6 @@ { "r15", &ddb_regs.tf_r15, FCN_NULL }, { "rip", &ddb_regs.tf_rip, FCN_NULL }, { "rflags", &ddb_regs.tf_rflags, FCN_NULL }, -#if 0 { "dr0", NULL, db_dr0 }, { "dr1", NULL, db_dr1 }, { "dr2", NULL, db_dr2 }, @@ -96,7 +93,6 @@ { "dr5", NULL, db_dr5 }, { "dr6", NULL, db_dr6 }, { "dr7", NULL, db_dr7 }, -#endif }; struct db_variable *db_eregs = db_regs + sizeof(db_regs)/sizeof(db_regs[0]); @@ -124,12 +120,10 @@ struct proc *p, struct amd64_frame *frame, db_addr_t callpc); -#if 0 static char * watchtype_str(int type); int amd64_set_watch(int watchnum, unsigned int watchaddr, int size, int access, struct dbreg * d); int amd64_clr_watch(int watchnum, struct dbreg * d); -#endif int db_md_set_watchpoint(db_expr_t addr, db_expr_t size); int db_md_clr_watchpoint(db_expr_t addr, db_expr_t size); void db_md_list_watchpoints(void); @@ -517,7 +511,6 @@ db_stack_trace_cmd(ebp, 1, -1, NULL); } -#if 0 #define DB_DRX_FUNC(reg) \ int \ db_ ## reg (vp, valuep, op) \ @@ -709,9 +702,9 @@ unsigned type, len; type = (d.dr[7] >> (16+(i*4))) & 3; len = (d.dr[7] >> (16+(i*4)+2)) & 3; - db_printf(" %-5d %-8s %10s %3d 0x%08x\n", + db_printf(" %-5d %-8s %10s %3d 0x%016lx\n", i, "enabled", watchtype_str(type), - len+1, DBREG_DRX((&d),i)); + len + 1, DBREG_DRX((&d), i)); } else { db_printf(" %-5d disabled\n", i); @@ -720,30 +713,7 @@ db_printf("\ndebug register values:\n"); for (i=0; i<8; i++) { - db_printf(" dr%d 0x%08x\n", i, DBREG_DRX((&d),i)); + db_printf(" dr%d 0x%016lx\n", i, DBREG_DRX((&d), i)); } db_printf("\n"); } - -#else -int -db_md_set_watchpoint(addr, size) - db_expr_t addr; - db_expr_t size; -{ - return (-1); -} - -int -db_md_clr_watchpoint(addr, size) - db_expr_t addr; - db_expr_t size; -{ - return (-1); -} - -void -db_md_list_watchpoints() -{ -} -#endif ==== //depot/projects/smpng/sys/amd64/amd64/fpu.c#4 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/fpu.c,v 1.147 2003/12/06 23:19:47 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/fpu.c,v 1.148 2004/01/28 23:55:58 peter Exp $"); #include #include @@ -112,26 +112,17 @@ * Initialize floating point unit. */ void -fpuinit() +fpuinit(void) { register_t savecrit; u_short control; - /* - * fpusave() initializes the fpu and sets fpcurthread = NULL - */ savecrit = intr_disable(); - fpusave(&fpu_cleanstate); /* XXX borrow for now */ + PCPU_SET(fpcurthread, 0); stop_emulating(); - /* XXX fpusave() doesn't actually initialize the fpu in the SSE case. */ fninit(); control = __INITIAL_FPUCW__; fldcw(&control); - start_emulating(); - intr_restore(savecrit); - - savecrit = intr_disable(); - stop_emulating(); fxsave(&fpu_cleanstate); start_emulating(); fpu_cleanstate_ready = 1; @@ -147,8 +138,12 @@ register_t savecrit; savecrit = intr_disable(); - if (curthread == PCPU_GET(fpcurthread)) - fpusave(&PCPU_GET(curpcb)->pcb_save); + if (curthread == PCPU_GET(fpcurthread)) { + stop_emulating(); + fxsave(&PCPU_GET(curpcb)->pcb_save); + start_emulating(); + PCPU_SET(fpcurthread, 0); + } intr_restore(savecrit); } @@ -422,42 +417,14 @@ control = __INITIAL_FPUCW__; fldcw(&control); pcb->pcb_flags |= PCB_FPUINITDONE; - } else { - /* - * The following frstor may cause a trap when the state - * being restored has a pending error. The error will - * appear to have been triggered by the current (fpu) user - * instruction even when that instruction is a no-wait - * instruction that should not trigger an error (e.g., - * instructions are broken the same as frstor, so our - * treatment does not amplify the breakage. - */ + } else fxrstor(&pcb->pcb_save); - } intr_restore(s); return (1); } /* - * Wrapper for fnsave instruction. - * - * fpusave() must be called with interrupts disabled, so that it clears - * fpcurthread atomically with saving the state. We require callers to do the - * disabling, since most callers need to disable interrupts anyway to call - * fpusave() atomically with checking fpcurthread. - */ -void -fpusave(struct savefpu *addr) -{ - - stop_emulating(); - fxsave(addr); - start_emulating(); - PCPU_SET(fpcurthread, NULL); -} - -/* * This should be called with interrupts disabled and only when the owning * FPU thread is non-null. */ ==== //depot/projects/smpng/sys/amd64/amd64/genassym.c#10 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.151 2003/11/21 03:01:59 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.152 2004/01/28 23:57:02 peter Exp $"); #include "opt_compat.h" #include "opt_kstack_pages.h" @@ -135,6 +135,13 @@ ASSYM(PCB_ES, offsetof(struct pcb, pcb_es)); ASSYM(PCB_FS, offsetof(struct pcb, pcb_fs)); ASSYM(PCB_GS, offsetof(struct pcb, pcb_gs)); +ASSYM(PCB_DR0, offsetof(struct pcb, pcb_dr0)); +ASSYM(PCB_DR1, offsetof(struct pcb, pcb_dr1)); +ASSYM(PCB_DR2, offsetof(struct pcb, pcb_dr2)); +ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3)); +ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6)); +ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7)); +ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_FULLCTX, PCB_FULLCTX); @@ -206,10 +213,5 @@ ASSYM(KUC32SEL, GSEL(GUCODE32_SEL, SEL_UPL)); ASSYM(SEL_RPL_MASK, SEL_RPL_MASK); -ASSYM(MSR_FSBASE, MSR_FSBASE); -ASSYM(MSR_GSBASE, MSR_GSBASE); -ASSYM(MSR_KGSBASE, MSR_KGSBASE); -ASSYM(GPROC0_SEL, GPROC0_SEL); - ASSYM(MTX_LOCK, offsetof(struct mtx, mtx_lock)); ASSYM(MTX_RECURSECNT, offsetof(struct mtx, mtx_recurse)); ==== //depot/projects/smpng/sys/amd64/amd64/local_apic.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.5 2003/12/06 23:14:44 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.7 2004/01/30 00:24:45 peter Exp $"); #include #include @@ -600,6 +600,10 @@ if (retval != 0) printf("%s: Failed to setup the local APIC: returned %d\n", best_enum->apic_name, retval); +#ifdef SMP + /* Last, setup the cpu topology now that we have probed CPUs */ + mp_topology(); +#endif } SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_FIRST, apic_setup_local, NULL) @@ -634,7 +638,6 @@ * private the sys/i386 code. The public interface for the rest of the * kernel is defined in mp_machdep.c. */ -#define DETECT_DEADLOCK int lapic_ipi_wait(int delay) ==== //depot/projects/smpng/sys/amd64/amd64/machdep.c#20 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.602 2004/01/03 02:02:24 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.603 2004/01/29 00:07:29 peter Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -147,7 +147,7 @@ long Maxmem = 0; -vm_paddr_t phys_avail[10]; +vm_paddr_t phys_avail[20]; /* must be 2 less so 0 0 can signal end of chunks */ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) @@ -266,7 +266,7 @@ } else sp = (char *)regs->tf_rsp - sizeof(struct sigframe) - 128; /* Align to 16 bytes. */ - sfp = (struct sigframe *)((unsigned long)sp & ~0xF); + sfp = (struct sigframe *)((unsigned long)sp & ~0xFul); /* Translate the signal if appropriate. */ if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) @@ -527,13 +527,35 @@ bzero((char *)regs, sizeof(struct trapframe)); regs->tf_rip = entry; - regs->tf_rsp = ((stack - 8) & ~0xF) + 8; + regs->tf_rsp = ((stack - 8) & ~0xFul) + 8; regs->tf_rdi = stack; /* argv */ regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); regs->tf_ss = _udatasel; regs->tf_cs = _ucodesel; /* + * Reset the hardware debug registers if they were in use. + * They won't have any meaning for the newly exec'd process. + */ + if (pcb->pcb_flags & PCB_DBREGS) { + pcb->pcb_dr0 = 0; + pcb->pcb_dr1 = 0; + pcb->pcb_dr2 = 0; + pcb->pcb_dr3 = 0; + pcb->pcb_dr6 = 0; + pcb->pcb_dr7 = 0; + if (pcb == PCPU_GET(curpcb)) { + /* + * Clear the debug registers on the running + * CPU, otherwise they will end up affecting + * the next process we switch to. + */ + reset_dbregs(); + } + pcb->pcb_flags &= ~PCB_DBREGS; + } + + /* * Arrange to trap the next fpu or `fwait' instruction (see fpu.c * for why fwait must be trapped at least if there is an fpu or an * emulator). This is mainly to handle the case where npx0 is not @@ -819,7 +841,8 @@ * "Consumer may safely assume that size value precedes data." * ie: an int32_t immediately precedes smap. */ - smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); + smapbase = (struct bios_smap *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase == NULL) panic("No BIOS smap info from loader!"); @@ -983,30 +1006,26 @@ * Test for alternating 1's and 0's */ *(volatile int *)ptr = 0xaaaaaaaa; - if (*(volatile int *)ptr != 0xaaaaaaaa) { + if (*(volatile int *)ptr != 0xaaaaaaaa) page_bad = TRUE; - } /* * Test for alternating 0's and 1's */ *(volatile int *)ptr = 0x55555555; - if (*(volatile int *)ptr != 0x55555555) { - page_bad = TRUE; - } + if (*(volatile int *)ptr != 0x55555555) + page_bad = TRUE; /* * Test for all 1's */ *(volatile int *)ptr = 0xffffffff; - if (*(volatile int *)ptr != 0xffffffff) { + if (*(volatile int *)ptr != 0xffffffff) page_bad = TRUE; - } /* * Test for all 0's */ *(volatile int *)ptr = 0x0; - if (*(volatile int *)ptr != 0x0) { + if (*(volatile int *)ptr != 0x0) page_bad = TRUE; - } /* * Restore original value. */ @@ -1015,9 +1034,8 @@ /* * Adjust array of valid/good pages. */ - if (page_bad == TRUE) { + if (page_bad == TRUE) continue; - } /* * If this good page is a continuation of the * previous set of good pages, then just increase @@ -1040,7 +1058,7 @@ break; } phys_avail[pa_indx++] = pa; /* start */ - phys_avail[pa_indx] = pa + PAGE_SIZE; /* end */ + phys_avail[pa_indx] = pa + PAGE_SIZE; /* end */ } physmem++; } @@ -1127,7 +1145,8 @@ if (x != GPROC0_SEL && x != (GPROC0_SEL + 1)) ssdtosd(&gdt_segs[x], &gdt[x]); } - ssdtosyssd(&gdt_segs[GPROC0_SEL], (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); + ssdtosyssd(&gdt_segs[GPROC0_SEL], + (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); r_gdt.rd_limit = NGDT * sizeof(gdt[0]) - 1; r_gdt.rd_base = (long) gdt; @@ -1136,7 +1155,7 @@ wrmsr(MSR_FSBASE, 0); /* User value */ wrmsr(MSR_GSBASE, (u_int64_t)pc); - wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */ + wrmsr(MSR_KGSBASE, 0); /* User value while in the kernel */ pcpu_init(pc, 0, sizeof(struct pcpu)); PCPU_SET(prvspace, pc); @@ -1204,7 +1223,7 @@ common_tss[0].tss_rsp0 = thread0.td_kstack + \ KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); /* Ensure the stack is aligned to 16 bytes */ - common_tss[0].tss_rsp0 &= ~0xF; + common_tss[0].tss_rsp0 &= ~0xFul; PCPU_SET(rsp0, common_tss[0].tss_rsp0); /* doublefault stack space, runs on ist1 */ @@ -1559,17 +1578,197 @@ int fill_dbregs(struct thread *td, struct dbreg *dbregs) { + struct pcb *pcb; + if (td == NULL) { + dbregs->dr[0] = rdr0(); + dbregs->dr[1] = rdr1(); + dbregs->dr[2] = rdr2(); + dbregs->dr[3] = rdr3(); + dbregs->dr[6] = rdr6(); + dbregs->dr[7] = rdr7(); + } else { + pcb = td->td_pcb; + dbregs->dr[0] = pcb->pcb_dr0; + dbregs->dr[1] = pcb->pcb_dr1; + dbregs->dr[2] = pcb->pcb_dr2; + dbregs->dr[3] = pcb->pcb_dr3; + dbregs->dr[6] = pcb->pcb_dr6; + dbregs->dr[7] = pcb->pcb_dr7; + } + dbregs->dr[4] = 0; + dbregs->dr[5] = 0; + dbregs->dr[8] = 0; + dbregs->dr[9] = 0; + dbregs->dr[10] = 0; + dbregs->dr[11] = 0; + dbregs->dr[12] = 0; + dbregs->dr[13] = 0; + dbregs->dr[14] = 0; + dbregs->dr[15] = 0; return (0); } int set_dbregs(struct thread *td, struct dbreg *dbregs) { + struct pcb *pcb; + int i; + u_int64_t mask1, mask2; + + if (td == NULL) { + load_dr0(dbregs->dr[0]); + load_dr1(dbregs->dr[1]); + load_dr2(dbregs->dr[2]); + load_dr3(dbregs->dr[3]); + load_dr6(dbregs->dr[6]); + load_dr7(dbregs->dr[7]); + } else { + /* + * Don't let an illegal value for dr7 get set. Specifically, + * check for undefined settings. Setting these bit patterns + * result in undefined behaviour and can lead to an unexpected + * TRCTRAP or a general protection fault right here. + */ + for (i = 0, mask1 = 0x3<<16, mask2 = 0x2<<16; i < 8; + i++, mask1 <<= 2, mask2 <<= 2) + if ((dbregs->dr[7] & mask1) == mask2) + return (EINVAL); + + pcb = td->td_pcb; + /* + * Don't let a process set a breakpoint that is not within the + * process's address space. If a process could do this, it + * could halt the system by setting a breakpoint in the kernel + * (if ddb was enabled). Thus, we need to check to make sure + * that no breakpoints are being enabled for addresses outside + * process's address space, unless, perhaps, we were called by + * uid 0. + * + * XXX - what about when the watched area of the user's + * address space is written into from within the kernel + * ... wouldn't that still cause a breakpoint to be generated + * from within kernel mode? + */ + + if (suser(td) != 0) { + if (dbregs->dr[7] & 0x3) { + /* dr0 is enabled */ + if (dbregs->dr[0] >= VM_MAXUSER_ADDRESS) + return (EINVAL); + } + if (dbregs->dr[7] & 0x3<<2) { + /* dr1 is enabled */ + if (dbregs->dr[1] >= VM_MAXUSER_ADDRESS) + return (EINVAL); + } + if (dbregs->dr[7] & 0x3<<4) { + /* dr2 is enabled */ + if (dbregs->dr[2] >= VM_MAXUSER_ADDRESS) + return (EINVAL); + } + if (dbregs->dr[7] & 0x3<<6) { + /* dr3 is enabled */ + if (dbregs->dr[3] >= VM_MAXUSER_ADDRESS) + return (EINVAL); + } + } + + pcb->pcb_dr0 = dbregs->dr[0]; + pcb->pcb_dr1 = dbregs->dr[1]; + pcb->pcb_dr2 = dbregs->dr[2]; + pcb->pcb_dr3 = dbregs->dr[3]; + pcb->pcb_dr6 = dbregs->dr[6]; + pcb->pcb_dr7 = dbregs->dr[7]; + + pcb->pcb_flags |= PCB_DBREGS; + } + return (0); } +void +reset_dbregs(void) +{ + >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Feb 3 14:12:59 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4F54516A4D0; Tue, 3 Feb 2004 14:12:59 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 004C416A4CF for ; Tue, 3 Feb 2004 14:12:59 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 630BA43D5E for ; Tue, 3 Feb 2004 14:12:52 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i13MCq0B045823 for ; Tue, 3 Feb 2004 14:12:52 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i13MCpvk045816 for perforce@freebsd.org; Tue, 3 Feb 2004 14:12:51 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 14:12:51 -0800 (PST) Message-Id: <200402032212.i13MCpvk045816@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46441 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 22:13:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=46441 Change 46441 by sam@sam_ebb on 2004/02/03 14:12:16 add some comments about pre-shared key Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#15 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#15 (text+ko) ==== @@ -779,6 +779,7 @@ } } +/* XXX TODO: add statistics */ static void ieee80211_auth_shared(struct ieee80211com *ic, struct ieee80211_frame *wh, u_int8_t *frm, u_int8_t *efrm, struct ieee80211_node *ni, int rssi, @@ -787,17 +788,31 @@ u_int8_t *challenge = NULL; int allocbs, i, estatus; + /* + * NB: this can happen as we allow pre-shared key + * authentication to be enabled w/o wep being turned + * on so that configuration of these can be done + * in any order. It may be better to enforce the + * ordering in which case this check would just be + * for sanity/consistency. + */ if ((ic->ic_flags & IEEE80211_F_WEPON) == 0) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: WEP is off\n", __func__)); estatus = IEEE80211_STATUS_ALG; goto bad; } + /* + * Pre-shared key authentication is evil; accept + * it only if explicitly configured (it is supported + * mainly for compatibility with clients like OS X). + */ if (ic->ic_authmode != IEEE80211_AUTH_AUTO && ic->ic_authmode != IEEE80211_AUTH_SHARED) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: operating in %u mode, reject\n", __func__, ic->ic_authmode)); + ic->ic_stats.is_rx_bad_auth++; /* XXX maybe a unique error? */ estatus = IEEE80211_STATUS_ALG; goto bad; } From owner-p4-projects@FreeBSD.ORG Tue Feb 3 14:14:00 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9733016A4D0; Tue, 3 Feb 2004 14:13:59 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F64516A4CE for ; Tue, 3 Feb 2004 14:13:59 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 31C9743D5C for ; Tue, 3 Feb 2004 14:13:54 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i13MDs0B046456 for ; Tue, 3 Feb 2004 14:13:54 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i13MDrSN046451 for perforce@freebsd.org; Tue, 3 Feb 2004 14:13:53 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 14:13:53 -0800 (PST) Message-Id: <200402032213.i13MDrSN046451@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46442 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2004 22:14:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=46442 Change 46442 by sam@sam_ebb on 2004/02/03 14:13:15 correct byte order in PAE ether type check Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#15 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#15 (text+ko) ==== @@ -259,7 +259,8 @@ goto bad; } /* NB: PAE frames have their own encryption policy */ - if (ic->ic_flags & IEEE80211_F_WEPON && eh.ether_type != ETHERTYPE_PAE) + if (ic->ic_flags & IEEE80211_F_WEPON && + eh.ether_type != htons(ETHERTYPE_PAE)) wh->i_fc[1] |= IEEE80211_FC1_WEP; *pni = ni; return m; From owner-p4-projects@FreeBSD.ORG Tue Feb 3 22:59:43 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 11C0D16A4D0; Tue, 3 Feb 2004 22:59:43 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E212016A4CE for ; Tue, 3 Feb 2004 22:59:42 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 247A243D1D for ; Tue, 3 Feb 2004 22:59:42 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i146xf0B040330 for ; Tue, 3 Feb 2004 22:59:41 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i146xfjv040327 for perforce@freebsd.org; Tue, 3 Feb 2004 22:59:41 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 22:59:41 -0800 (PST) Message-Id: <200402040659.i146xfjv040327@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46461 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 06:59:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=46461 Change 46461 by sam@sam_ebb on 2004/02/03 22:59:15 add counter of frames sent with 11g protection Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_athioctl.h#7 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_athioctl.h#7 (text+ko) ==== @@ -71,6 +71,7 @@ u_int32_t ast_tx_cts; /* tx frames with cts enabled */ u_int32_t ast_tx_shortpre;/* tx frames with short preamble */ u_int32_t ast_tx_altrate; /* tx frames with alternate rate */ + u_int32_t ast_tx_protect; /* tx frames with protection */ u_int32_t ast_rx_nombuf; /* rx setup failed 'cuz no mbuf */ u_int32_t ast_rx_busdma; /* rx setup failed for dma resrcs */ u_int32_t ast_rx_orn; /* rx failed 'cuz of desc overrun */ From owner-p4-projects@FreeBSD.ORG Tue Feb 3 23:01:49 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8A98316A4D0; Tue, 3 Feb 2004 23:01:48 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4952816A4CE for ; Tue, 3 Feb 2004 23:01:48 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 391A743D4C for ; Tue, 3 Feb 2004 23:01:45 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1471j0B041411 for ; Tue, 3 Feb 2004 23:01:45 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1471iax041402 for perforce@freebsd.org; Tue, 3 Feb 2004 23:01:44 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 23:01:44 -0800 (PST) Message-Id: <200402040701.i1471iax041402@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46462 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 07:01:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=46462 Change 46462 by sam@sam_ebb on 2004/02/03 23:01:25 o mark driver capable of transmit power control o complete 11g protection logic by only applying protection for ofdm unicast frames o add comment about issue to be dealt with for sending fragments o count frames sent with protection o disable use of multi-rate retry when applying rts/cts Affected files ... .. //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#27 edit Differences ... ==== //depot/projects/netperf+sockets/sys/dev/ath/if_ath.c#27 (text+ko) ==== @@ -340,6 +340,7 @@ | IEEE80211_C_MONITOR /* monitor mode */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_SHSLOT /* short slot time supported */ + | IEEE80211_C_TXPMGT /* transmit power control */ | IEEE80211_C_RCVMGT /* recv management frames */ ; ic->ic_flags |= IEEE80211_F_DATAPAD; @@ -2121,18 +2122,20 @@ } /* - * Determine whether to use RTS/CTS or just CTS for - * 802.11g protection. - * XXX use only before transmitting OFDM, not CCK. + * If 802.11g protection is enabled, determine whether + * to use RTS/CTS or just CTS. Note that this is only + * done for OFDM unicast frames. */ if ((ic->ic_flags & IEEE80211_F_USEPROT) && - (ni->ni_flags & IEEE80211_NODE_ERP)) { + rt->info[rix].phy == IEEE80211_T_OFDM && + (flags & HAL_TXDESC_NOACK) == 0) { + /* XXX fragments must use CCK rates w/ protection */ if (ic->ic_protmode == IEEE80211_PROT_RTSCTS) flags |= HAL_TXDESC_RTSENA; else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) flags |= HAL_TXDESC_CTSENA; cix = rt->info[sc->sc_protrix].controlRate; - /* XXX statistics */ + sc->sc_stats.ast_tx_protect++; } /* @@ -2183,6 +2186,10 @@ ctsduration += ath_hal_computetxtime(ah, rt, IEEE80211_ACK_SIZE, cix, shortPreamble); } + /* + * Must disable multi-rate retry when using RTS/CTS. + */ + try0 = ATH_TXMAXTRY; } else ctsrate = 0; From owner-p4-projects@FreeBSD.ORG Tue Feb 3 23:02:49 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EB9B316A4D1; Tue, 3 Feb 2004 23:02:48 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0D9216A4CE for ; Tue, 3 Feb 2004 23:02:48 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10E2343D1F for ; Tue, 3 Feb 2004 23:02:47 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1472k0B042217 for ; Tue, 3 Feb 2004 23:02:46 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1472ks4042214 for perforce@freebsd.org; Tue, 3 Feb 2004 23:02:46 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 23:02:46 -0800 (PST) Message-Id: <200402040702.i1472ks4042214@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46463 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 07:02:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=46463 Change 46463 by sam@sam_ebb on 2004/02/03 23:01:58 remove comment now that we've dealt with the issue Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#13 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#13 (text+ko) ==== @@ -808,7 +808,6 @@ * and not in an IBSS. We must also honor whether or not * the driver is capable of doing it. */ - /* XXX what about auto? */ if (mode == IEEE80211_MODE_11G && ic->ic_opmode != IEEE80211_M_IBSS && (ic->ic_caps & IEEE80211_C_SHSLOT)) From owner-p4-projects@FreeBSD.ORG Tue Feb 3 23:02:50 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5189A16A4E5; Tue, 3 Feb 2004 23:02:49 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D6CF016A4CF for ; Tue, 3 Feb 2004 23:02:48 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7716E43D45 for ; Tue, 3 Feb 2004 23:02:47 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1472l0B042223 for ; Tue, 3 Feb 2004 23:02:47 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1472l40042220 for perforce@freebsd.org; Tue, 3 Feb 2004 23:02:47 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 23:02:47 -0800 (PST) Message-Id: <200402040702.i1472l40042220@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46464 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 07:02:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=46464 Change 46464 by sam@sam_ebb on 2004/02/03 23:02:14 sync comment w/ madwifi Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_crypto.c#5 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_crypto.c#5 (text+ko) ==== @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto.c,v 1.3 2003/10/17 23:15:30 sam Exp $"); __KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto.c,v 1.4 2003/09/23 16:03:46 dyoung Exp $"); +/* + * IEEE 802.11 crypto support (when done in the host). + */ #include "opt_inet.h" #include From owner-p4-projects@FreeBSD.ORG Tue Feb 3 23:03:51 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB3BA16A4DA; Tue, 3 Feb 2004 23:03:50 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94C9016A4D2 for ; Tue, 3 Feb 2004 23:03:50 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EECC43D45 for ; Tue, 3 Feb 2004 23:03:49 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1473n0B043124 for ; Tue, 3 Feb 2004 23:03:49 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1473mBL043121 for perforce@freebsd.org; Tue, 3 Feb 2004 23:03:48 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 23:03:48 -0800 (PST) Message-Id: <200402040703.i1473mBL043121@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46465 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 07:03:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=46465 Change 46465 by sam@sam_ebb on 2004/02/03 23:03:29 o s/PROTECTION/PROTMODE/ o bounds check transmit power setting o sync w/ madwifi Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#16 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#10 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.c#16 (text+ko) ==== @@ -897,7 +897,7 @@ case IEEE80211_IOC_RTSTHRESHOLD: ireq->i_val = ic->ic_rtsthreshold; break; - case IEEE80211_IOC_PROTECTION: + case IEEE80211_IOC_PROTMODE: ireq->i_val = ic->ic_protmode; break; case IEEE80211_IOC_TXPOWER: @@ -1054,9 +1054,9 @@ ic->ic_rtsthreshold = ireq->i_val; error = ieee80211_reset(ic); break; - case IEEE80211_IOC_PROTECTION: - if (!(IEEE80211_PROTECTION_OFF <= ireq->i_val && - ireq->i_val <= IEEE80211_PROTECTION_RTSCTS)) { + case IEEE80211_IOC_PROTMODE: + if (!(IEEE80211_PROTMODE_OFF <= ireq->i_val && + ireq->i_val <= IEEE80211_PROTMODE_RTSCTS)) { error = EINVAL; break; } @@ -1065,6 +1065,11 @@ break; case IEEE80211_IOC_TXPOWER: /* XXX units? */ + if (!(IEEE80211_TXPOWER_MIN <= ireq->i_val && + ireq->i_val <= IEEE80211_TXPOWER_MAX)) { + error = EINVAL; + break; + } ic->ic_bss->ni_txpower = ireq->i_val; error = ieee80211_reset(ic); break; ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_ioctl.h#10 (text+ko) ==== @@ -164,11 +164,10 @@ #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM #define IEEE80211_IOC_POWERSAVESLEEP 11 #define IEEE80211_IOC_RTSTHRESHOLD 12 -#define IEEE80211_IOC_PROTECTION 13 -#define IEEE80211_PROTECTION_NOSUP -1 -#define IEEE80211_PROTECTION_OFF 0 -#define IEEE80211_PROTECTION_CTS 1 -#define IEEE80211_PROTECTION_RTSCTS 2 +#define IEEE80211_IOC_PROTMODE 13 +#define IEEE80211_PROTMODE_OFF 0 +#define IEEE80211_PROTMODE_CTS 1 +#define IEEE80211_PROTMODE_RTSCTS 2 #define IEEE80211_IOC_TXPOWER 14 #ifndef IEEE80211_CHAN_ANY @@ -190,7 +189,8 @@ enum { IEEE80211_PARAM_TURBO = 1, /* turbo mode */ IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */ - IEEE80211_PARAM_AUTHMODE= 3 /* authentication mode */ + IEEE80211_PARAM_AUTHMODE= 3, /* authentication mode */ + IEEE80211_PARAM_PROTMODE= 4 /* 802.11g protection */ }; #define SIOCG80211STATS (SIOCDEVPRIVATE+2) From owner-p4-projects@FreeBSD.ORG Tue Feb 3 23:04:53 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9425416A4D0; Tue, 3 Feb 2004 23:04:52 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A89616A4CE for ; Tue, 3 Feb 2004 23:04:52 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 270F943D1D for ; Tue, 3 Feb 2004 23:04:51 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1474o0B043144 for ; Tue, 3 Feb 2004 23:04:50 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1474okm043141 for perforce@freebsd.org; Tue, 3 Feb 2004 23:04:50 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 23:04:50 -0800 (PST) Message-Id: <200402040704.i1474okm043141@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46466 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 07:04:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=46466 Change 46466 by sam@sam_ebb on 2004/02/03 23:03:50 sync w/ madwifi Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.c#2 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.h#2 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.c#2 (text+ko) ==== @@ -28,6 +28,20 @@ #define EXPORT_SYMTAB #endif +/* + * IEEE 802.11 support (Linux-specific code) + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "if_media.h" + #include /* @@ -110,6 +124,33 @@ } EXPORT_SYMBOL(ieee80211_ioctl); +#if IEEE80211_VLAN_TAG_USED +/* + * VLAN support. + */ + +/* + * Register a vlan group. + */ +void +ieee80211_vlan_register(struct ieee80211com *ic, struct vlan_group *grp) +{ + ic->ic_vlgrp = grp; +} +EXPORT_SYMBOL(ieee80211_vlan_register); + +/* + * Kill (i.e. delete) a vlan identifier. + */ +void +ieee80211_vlan_kill_vid(struct ieee80211com *ic, unsigned short vid) +{ + if (ic->ic_vlgrp) + ic->ic_vlgrp->vlan_devices[vid] = NULL; +} +EXPORT_SYMBOL(ieee80211_vlan_kill_vid); +#endif /* IEEE80211_VLAN_TAG_USED */ + #ifdef CONFIG_PROC_FS #include #include ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.h#2 (text+ko) ==== @@ -29,19 +29,6 @@ #ifndef _NET80211_IEEE80211_LINUX_H_ #define _NET80211_IEEE80211_LINUX_H_ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "if_llc.h" -#include "if_ethersubr.h" -#include "if_media.h" - /* * Locking definitions. */ @@ -132,6 +119,15 @@ extern void ieee80211_proc_remove(struct ieee80211com *); #endif /* CONFIG_PROC_FS */ +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) +#define IEEE80211_VLAN_TAG_USED 1 + +extern void ieee80211_vlan_register(struct ieee80211com *, struct vlan_group*); +extern void ieee80211_vlan_kill_vid(struct ieee80211com *, unsigned short); +#else +#define IEEE80211_VLAN_TAG_USED 0 +#endif + #ifdef CONFIG_NET_WIRELESS struct iw_statistics; extern void ieee80211_iw_getstats(struct ieee80211com*, struct iw_statistics*); From owner-p4-projects@FreeBSD.ORG Tue Feb 3 23:11:37 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2A54416A4D0; Tue, 3 Feb 2004 23:11:37 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F209B16A4CE for ; Tue, 3 Feb 2004 23:11:36 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F34B243D4C for ; Tue, 3 Feb 2004 23:10:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i147Ax0B043612 for ; Tue, 3 Feb 2004 23:10:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i147AxvV043609 for perforce@freebsd.org; Tue, 3 Feb 2004 23:10:59 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 3 Feb 2004 23:10:59 -0800 (PST) Message-Id: <200402040710.i147AxvV043609@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46468 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 07:11:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=46468 Change 46468 by sam@sam_ebb on 2004/02/03 23:09:58 o simplify transmit power handling: only one flag bit now to indicate a fixed rate is set (check ni_txpower != 0 to see if the radio was disabled) o remove global txpower and authmode setings; we get these from ic_bss as they are inherited by associating stations o add #defines for max/min transmit power (.5 dbm units); probably need to revise this after discussion o fix ieee80211_iserp_rateset o add debugging messages about erp handling o default 11g protection mode to CTS only o correct station/ibss short slot time handling (set state on channel lock after scan so capabilities sent in the assocation request are correct and honor capabilities return in the assocation response frame) o correct problem where stations re-associating were being multiply counted in the longsta and nonerpsta counts Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#16 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#8 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#16 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#8 edit .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#10 edit Differences ... ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_input.c#16 (text+ko) ==== @@ -33,6 +33,9 @@ #include __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.13 2004/01/15 08:44:27 onoe Exp $"); +/* + * IEEE 802.11 input handling. + */ #include "opt_inet.h" #include @@ -807,11 +810,11 @@ * it only if explicitly configured (it is supported * mainly for compatibility with clients like OS X). */ - if (ic->ic_authmode != IEEE80211_AUTH_AUTO && - ic->ic_authmode != IEEE80211_AUTH_SHARED) { + if (ni->ni_authmode != IEEE80211_AUTH_AUTO && + ni->ni_authmode != IEEE80211_AUTH_SHARED) { IEEE80211_DPRINTF(ic, IEEE80211_MSG_AUTH, ("%s: operating in %u mode, reject\n", - __func__, ic->ic_authmode)); + __func__, ni->ni_authmode)); ic->ic_stats.is_rx_bad_auth++; /* XXX maybe a unique error? */ estatus = IEEE80211_STATUS_ALG; goto bad; @@ -1243,10 +1246,18 @@ * Honor ERP: enable protection and/or disable * the use of short slot time. */ - if (erp & IEEE80211_ERP_USE_PROTECTION) + if (erp & IEEE80211_ERP_USE_PROTECTION) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("station %s requires protection\n", + ether_sprintf(wh->i_addr2))); ic->ic_flags |= IEEE80211_F_USEPROT; - if (erp & IEEE80211_ERP_LONG_PREAMBLE) + } + if (erp & IEEE80211_ERP_LONG_PREAMBLE) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("station %s requires long preamble\n", + ether_sprintf(wh->i_addr2))); ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; + } /* NB: must be after ni_chan is setup */ ieee80211_setup_rates(ic, ni, rates, xrates, IEEE80211_F_DOSORT); ieee80211_unref_node(&ni); @@ -1511,47 +1522,58 @@ IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_REASON_ASSOC_TOOMANY); return; - } else { - ni->ni_associd = aid | 0xc000; - IEEE80211_AID_SET(ni->ni_associd, - ic->ic_aid_bitmap); - newassoc = 1; } - } else - newassoc = 0; - /* - * Station isn't capable of short slot time. Bump - * the count of long slot time stations and disable - * use of short slot time. Note that the actual switch - * over to long slot time use will not occur until the - * next beacon transmission (per sec. 7.3.1.4 of 11g). - */ - if ((capinfo & IEEE80211_CAPINFO_SHORT_SLOTTIME) == 0) { - ic->ic_longslotsta++; - ic->ic_flags &= ~IEEE80211_F_SHSLOT; - } - /* - * If the new station is not an ERP station - * then bump the counter and enable protection - * if configured. - */ - if (!ieee80211_iserp_rateset(ic, &ni->ni_rates)) { - ic->ic_nonerpsta++; + ni->ni_associd = aid | 0xc000; + IEEE80211_AID_SET(ni->ni_associd, ic->ic_aid_bitmap); + newassoc = 1; /* - * If protection is configured, enable it. + * Station isn't capable of short slot time. Bump + * the count of long slot time stations and disable + * use of short slot time. Note that the actual switch + * over to long slot time use will not occur until the + * next beacon transmission (per sec. 7.3.1.4 of 11g). */ - if (ic->ic_protmode != IEEE80211_PROT_NONE) - ic->ic_flags |= IEEE80211_F_USEPROT; + if ((capinfo & IEEE80211_CAPINFO_SHORT_SLOTTIME) == 0) { + ic->ic_longslotsta++; + ic->ic_flags &= ~IEEE80211_F_SHSLOT; + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("station %s needs long slot time, " + "count %d\n", + ether_sprintf(ni->ni_macaddr), + ic->ic_longslotsta)); + } /* - * If station does not support long preamble then - * we must enable use of Barker preamble. + * If the new station is not an ERP station + * then bump the counter and enable protection + * if configured. */ - if ((capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) == 0) { - ic->ic_flags |= IEEE80211_F_USEBARKER; - ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; - } + if (!ieee80211_iserp_rateset(ic, &ni->ni_rates)) { + ic->ic_nonerpsta++; + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("station %s is !erp, count %d\n", + ether_sprintf(ni->ni_macaddr), + ic->ic_nonerpsta)); + /* + * If protection is configured, enable it. + */ + if (ic->ic_protmode != IEEE80211_PROT_NONE) + ic->ic_flags |= IEEE80211_F_USEPROT; + /* + * If station does not support short preamble + * then we must enable use of Barker preamble. + */ + if ((capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) == 0) { + IEEE80211_DPRINTF(ic, + IEEE80211_MSG_ASSOC, + ("station %s needs long preamble\n", + ether_sprintf(ni->ni_macaddr))); + ic->ic_flags |= IEEE80211_F_USEBARKER; + ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; + } + } else + ni->ni_flags |= IEEE80211_NODE_ERP; } else - ni->ni_flags |= IEEE80211_NODE_ERP; + newassoc = 0; IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS); IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, ("station %s %s associated at aid %d\n", @@ -1583,6 +1605,14 @@ IEEE80211_VERIFY_LENGTH(efrm - frm, 6); ni = ic->ic_bss; ni->ni_capinfo = le16toh(*(u_int16_t *)frm); + if (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) + ic->ic_flags |= IEEE80211_F_SHPREAMBLE; + else + ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; + if (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_SLOTTIME) + ic->ic_flags |= IEEE80211_F_SHSLOT; + else + ic->ic_flags &= ~IEEE80211_F_SHSLOT; frm += 2; status = le16toh(*(u_int16_t *)frm); ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_node.c#8 (text+ko) ==== @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.13 2003/11/09 23:36:46 sam Exp $"); __KERNEL_RCSID(0, "$NetBSD: ieee80211_node.c,v 1.8 2003/11/02 01:29:05 dyoung Exp $"); +/* + * IEEE 802.11 node handling support. + */ #include "opt_inet.h" #include @@ -108,8 +111,8 @@ * each new station automatically inherits them. */ ni->ni_chan = IEEE80211_CHAN_ANYC; - ni->ni_authmode = ic->ic_authmode; - ni->ni_txpower = ic->ic_txpower; + ni->ni_authmode = IEEE80211_AUTH_OPEN; + ni->ni_txpower = IEEE80211_TXPOWER_MAX; ic->ic_bss = ni; } @@ -390,6 +393,12 @@ if (selbs == NULL) goto notfound; (*ic->ic_node_copy)(ic, ic->ic_bss, selbs); + /* + * Set the erp state (mostly the slot time) to deal with + * the auto-select case; this should be redundant if the + * mode is locked. + */ + ieee80211_reset_erp(ic, ieee80211_chan2mode(ic, ic->ic_bss->ni_chan)); if (ic->ic_opmode == IEEE80211_M_IBSS) { ieee80211_fix_rate(ic, ic->ic_bss, IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO | IEEE80211_F_DODEL); ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_output.c#16 (text+ko) ==== @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.9 2003/10/17 23:15:30 sam Exp $"); __KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.9 2003/11/02 00:17:27 dyoung Exp $"); +/* + * IEEE 802.11 output handling. + */ #include "opt_inet.h" #include @@ -481,7 +484,7 @@ is_shared_key = has_challenge || arg >= IEEE80211_AUTH_SHARED_RESPONSE || (arg == IEEE80211_AUTH_SHARED_REQUEST && - ic->ic_authmode == IEEE80211_AUTH_SHARED); + ic->ic_bss->ni_authmode == IEEE80211_AUTH_SHARED); m = ieee80211_getmgtframe(&frm, 3 * sizeof(u_int16_t) @@ -603,6 +606,8 @@ if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE; + if (ic->ic_flags & IEEE80211_F_SHSLOT) + capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME; *(u_int16_t *)frm = htole16(capinfo); frm += 2; ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#8 (text+ko) ==== @@ -103,7 +103,7 @@ #endif ic->ic_fragthreshold = 2346; /* XXX not used yet */ ic->ic_fixed_rate = -1; /* no fixed rate */ - ic->ic_authmode = IEEE80211_AUTH_OPEN; + ic->ic_protmode = IEEE80211_PROT_CTSONLY; mtx_init(&ic->ic_mgtq.ifq_mtx, ifp->if_xname, "mgmt send q", MTX_DEF); mtx_init(&ic->ic_pwrsaveq.ifq_mtx, ifp->if_xname, "power save q", MTX_DEF); @@ -319,10 +319,16 @@ if (rs->rs_nrates < N(rates)) return 0; for (i = 0; i < N(rates); i++) { - for (j = 0; j < rs->rs_nrates && rates[i] < rs->rs_rates[j]; j++) - ; - if (j == rs->rs_nrates || rates[i] > rs->rs_rates[j]) - return 0; + for (j = 0; j < rs->rs_nrates; j++) { + int r = rs->rs_rates[j] & IEEE80211_RATE_VAL; + if (rates[i] == r) + goto next; + if (r > rates[i]) + return 0; + } + return 0; + next: + ; } return 1; #undef N @@ -345,6 +351,10 @@ KASSERT(ic->ic_longslotsta > 0, ("bogus long slot station count %d", ic->ic_longslotsta)); ic->ic_longslotsta--; + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("long slot time station %s leaves, count now %d\n", + ether_sprintf(ni->ni_macaddr), ic->ic_longslotsta)); + /* XXX auto mode? */ if (ic->ic_longslotsta == 0 && ic->ic_curmode == IEEE80211_MODE_11G) { /* @@ -352,8 +362,11 @@ * and not operating in IBSS mode (per spec). */ if ((ic->ic_caps & IEEE80211_C_SHSLOT) && - ic->ic_opmode != IEEE80211_M_IBSS) + ic->ic_opmode != IEEE80211_M_IBSS) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("re-enable use of short slot time\n")); ic->ic_flags |= IEEE80211_F_SHSLOT; + } } } /* @@ -363,10 +376,17 @@ KASSERT(ic->ic_nonerpsta > 0, ("bogus non-ERP station count %d", ic->ic_nonerpsta)); ic->ic_nonerpsta--; + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("non-ERP station %s leaves, count now %d\n", + ether_sprintf(ni->ni_macaddr), ic->ic_nonerpsta)); if (ic->ic_nonerpsta == 0) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("disable use of protection\n")); ic->ic_flags &= ~IEEE80211_F_USEPROT; /* XXX verify mode? */ if (ic->ic_caps & IEEE80211_C_SHPREAMBLE) { + IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC, + ("re-enable use of short preamble\n")); ic->ic_flags |= IEEE80211_F_SHPREAMBLE; ic->ic_flags &= ~IEEE80211_F_USEBARKER; } ==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_var.h#10 (text+ko) ==== @@ -57,10 +57,13 @@ #include #define IEEE80211_CHAN_MAX 255 -#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ +#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ #define IEEE80211_CHAN_ANYC \ ((struct ieee80211_channel *) IEEE80211_CHAN_ANY) +#define IEEE80211_TXPOWER_MAX 60 /* .5 dbM (XXX units?) */ +#define IEEE80211_TXPOWER_MIN 0 /* kill radio */ + enum ieee80211_phytype { IEEE80211_T_DS, /* direct sequence spread spectrum */ IEEE80211_T_FH, /* frequency hopping */ @@ -224,9 +227,7 @@ u_int16_t ic_txmin; /* min tx retry count */ u_int16_t ic_txmax; /* max tx retry count */ u_int16_t ic_txlifetime; /* tx lifetime */ - u_int16_t ic_txpower; /* tx power setting (dbM) */ u_int16_t ic_bmisstimeout;/* beacon miss threshold (ms) */ - u_int16_t ic_authmode; /* authentication mode */ u_int16_t ic_nonerpsta; /* # non-ERP stations */ u_int16_t ic_longslotsta; /* # long slot time stations */ int ic_mgt_timer; /* mgmt timeout */ @@ -254,16 +255,13 @@ #define IEEE80211_F_SCANAP 0x00001000 /* CONF: Scanning AP */ #define IEEE80211_F_ROAMING 0x00002000 /* CONF: roaming enabled */ #define IEEE80211_F_SWRETRY 0x00004000 /* CONF: sw tx retry enabled */ -#define IEEE80211_F_TXPMGT 0x00018000 /* STATUS: tx power */ -#define IEEE80211_F_TXPOW_OFF 0x00000000 /* TX Power: radio disabled */ #define IEEE80211_F_TXPOW_FIXED 0x00008000 /* TX Power: fixed rate */ -#define IEEE80211_F_TXPOW_AUTO 0x00010000 /* TX Power: undefined */ -#define IEEE80211_F_SHSLOT 0x00020000 /* CONF: short slot time */ -#define IEEE80211_F_SHPREAMBLE 0x00040000 /* CONF: short preamble */ -#define IEEE80211_F_DATAPAD 0x00080000 /* CONF: do alignment pad */ -#define IEEE80211_F_USEPROT 0x00100000 /* STATUS: protection enabled */ -#define IEEE80211_F_USEBARKER 0x00200000 /* STATUS: use barker preamble*/ -#define IEEE80211_F_TIMUPDATE 0x00400000 /* STATUS: update beacon tim */ +#define IEEE80211_F_SHSLOT 0x00010000 /* CONF: short slot time */ +#define IEEE80211_F_SHPREAMBLE 0x00020000 /* CONF: short preamble */ +#define IEEE80211_F_DATAPAD 0x00040000 /* CONF: do alignment pad */ +#define IEEE80211_F_USEPROT 0x00080000 /* STATUS: protection enabled */ +#define IEEE80211_F_USEBARKER 0x00100000 /* STATUS: use barker preamble*/ +#define IEEE80211_F_TIMUPDATE 0x00200000 /* STATUS: update beacon tim */ /* ic_caps */ #define IEEE80211_C_WEP 0x00000001 /* CAPABILITY: WEP available */ From owner-p4-projects@FreeBSD.ORG Wed Feb 4 14:22:00 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4674D16A4D0; Wed, 4 Feb 2004 14:21:59 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AAB916A4CE for ; Wed, 4 Feb 2004 14:21:59 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C15843D31 for ; Wed, 4 Feb 2004 14:21:52 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i14MLq0B081201 for ; Wed, 4 Feb 2004 14:21:52 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i14MLpRi081178 for perforce@freebsd.org; Wed, 4 Feb 2004 14:21:51 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Wed, 4 Feb 2004 14:21:51 -0800 (PST) Message-Id: <200402042221.i14MLpRi081178@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46502 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2004 22:22:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=46502 Change 46502 by jhb@jhb_slimer on 2004/02/04 14:20:53 IFC @46501, loop back limit locking. Affected files ... .. //depot/projects/smpng/sys/alpha/linux/linux_machdep.c#16 integrate .. //depot/projects/smpng/sys/alpha/linux/linux_proto.h#10 integrate .. //depot/projects/smpng/sys/alpha/linux/linux_syscall.h#8 integrate .. //depot/projects/smpng/sys/alpha/linux/linux_sysent.c#8 integrate .. //depot/projects/smpng/sys/alpha/linux/syscalls.master#9 integrate .. //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#25 integrate .. //depot/projects/smpng/sys/alpha/osf1/osf1_proto.h#6 integrate .. //depot/projects/smpng/sys/alpha/osf1/osf1_syscall.h#5 integrate .. //depot/projects/smpng/sys/alpha/osf1/osf1_sysent.c#5 integrate .. //depot/projects/smpng/sys/alpha/osf1/syscalls.master#5 integrate .. //depot/projects/smpng/sys/compat/ia32/ia32_sysvec.c#8 integrate .. //depot/projects/smpng/sys/compat/linux/linux_misc.c#45 integrate .. //depot/projects/smpng/sys/compat/ndis/subr_ndis.c#8 integrate .. //depot/projects/smpng/sys/compat/svr4/imgact_svr4.c#10 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_filio.c#14 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#30 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_proto.h#5 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_resource.c#9 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_syscall.h#4 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_syscallnames.c#4 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_sysent.c#4 integrate .. //depot/projects/smpng/sys/compat/svr4/syscalls.master#4 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.c#18 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.h#15 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.reg#13 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.seq#12 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_inline.h#12 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx_pci.c#16 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aic7xxx.c#18 integrate .. //depot/projects/smpng/sys/dev/ofw/ofw_disk.c#9 integrate .. //depot/projects/smpng/sys/dev/puc/pucdata.c#23 integrate .. //depot/projects/smpng/sys/fs/fdescfs/fdesc_vfsops.c#11 integrate .. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vnops.c#23 integrate .. //depot/projects/smpng/sys/fs/nwfs/nwfs_io.c#11 integrate .. //depot/projects/smpng/sys/fs/procfs/procfs_rlimit.c#4 integrate .. //depot/projects/smpng/sys/fs/smbfs/smbfs_io.c#15 integrate .. //depot/projects/smpng/sys/gnu/ext2fs/ext2_readwrite.c#5 integrate .. //depot/projects/smpng/sys/i386/i386/apic_vector.s#6 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_isc_syscall.h#3 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_isc_sysent.c#4 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_misc.c#13 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_proto.h#5 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_syscall.h#4 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_sysent.c#5 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_xenix.h#5 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_xenix_syscall.h#4 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_xenix_sysent.c#5 integrate .. //depot/projects/smpng/sys/i386/ibcs2/syscalls.isc#3 integrate .. //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#4 integrate .. //depot/projects/smpng/sys/i386/ibcs2/syscalls.xenix#3 integrate .. //depot/projects/smpng/sys/i386/isa/atpic_vector.s#6 integrate .. //depot/projects/smpng/sys/i386/linux/imgact_linux.c#14 integrate .. //depot/projects/smpng/sys/i386/linux/linux_machdep.c#24 integrate .. //depot/projects/smpng/sys/i386/linux/linux_proto.h#14 integrate .. //depot/projects/smpng/sys/i386/linux/linux_syscall.h#13 integrate .. //depot/projects/smpng/sys/i386/linux/linux_sysent.c#14 integrate .. //depot/projects/smpng/sys/i386/linux/syscalls.master#13 integrate .. //depot/projects/smpng/sys/kern/imgact_aout.c#21 integrate .. //depot/projects/smpng/sys/kern/imgact_elf.c#31 integrate .. //depot/projects/smpng/sys/kern/imgact_gzip.c#9 integrate .. //depot/projects/smpng/sys/kern/init_main.c#41 integrate .. //depot/projects/smpng/sys/kern/kern_acct.c#31 integrate .. //depot/projects/smpng/sys/kern/kern_descrip.c#56 integrate .. //depot/projects/smpng/sys/kern/kern_exit.c#70 integrate .. //depot/projects/smpng/sys/kern/kern_fork.c#71 integrate .. //depot/projects/smpng/sys/kern/kern_resource.c#40 integrate .. //depot/projects/smpng/sys/kern/kern_sig.c#86 integrate .. //depot/projects/smpng/sys/kern/kern_subr.c#30 integrate .. //depot/projects/smpng/sys/kern/kern_sx.c#21 integrate .. //depot/projects/smpng/sys/kern/subr_trap.c#61 integrate .. //depot/projects/smpng/sys/kern/sys_generic.c#30 integrate .. //depot/projects/smpng/sys/kern/tty.c#39 integrate .. //depot/projects/smpng/sys/kern/uipc_mbuf.c#25 integrate .. //depot/projects/smpng/sys/kern/uipc_socket2.c#30 integrate .. //depot/projects/smpng/sys/kern/uipc_syscalls.c#46 integrate .. //depot/projects/smpng/sys/net/if.c#42 integrate .. //depot/projects/smpng/sys/netinet/ip_output.c#49 integrate .. //depot/projects/smpng/sys/netinet/raw_ip.c#35 integrate .. //depot/projects/smpng/sys/netinet/tcp_input.c#46 integrate .. //depot/projects/smpng/sys/netinet/tcp_output.c#20 integrate .. //depot/projects/smpng/sys/netinet/udp_usrreq.c#38 integrate .. //depot/projects/smpng/sys/netinet6/icmp6.c#21 integrate .. //depot/projects/smpng/sys/netinet6/in6_src.c#17 integrate .. //depot/projects/smpng/sys/netinet6/ip6_output.c#28 integrate .. //depot/projects/smpng/sys/netinet6/ipsec.c#14 integrate .. //depot/projects/smpng/sys/netinet6/ipsec.h#8 integrate .. //depot/projects/smpng/sys/netinet6/ipsec6.h#4 integrate .. //depot/projects/smpng/sys/netinet6/nd6_nbr.c#10 integrate .. //depot/projects/smpng/sys/netinet6/raw_ip6.c#23 integrate .. //depot/projects/smpng/sys/netinet6/udp6_output.c#15 integrate .. //depot/projects/smpng/sys/netinet6/udp6_usrreq.c#26 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_bio.c#24 integrate .. //depot/projects/smpng/sys/opencrypto/rijndael.c#3 integrate .. //depot/projects/smpng/sys/posix4/_semaphore.h#3 integrate .. //depot/projects/smpng/sys/posix4/semaphore.h#6 integrate .. //depot/projects/smpng/sys/powerpc/include/pcpu.h#5 integrate .. //depot/projects/smpng/sys/powerpc/powermac/openpic_macio.c#3 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/genassym.c#19 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/locore.S#3 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#48 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/nexus.c#6 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/pmap.c#36 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/trap_subr.S#9 integrate .. //depot/projects/smpng/sys/powerpc/psim/psim-tree#2 integrate .. //depot/projects/smpng/sys/sys/proc.h#110 integrate .. //depot/projects/smpng/sys/sys/resource.h#9 integrate .. //depot/projects/smpng/sys/sys/resourcevar.h#14 integrate .. //depot/projects/smpng/sys/sys/sockio.h#7 integrate .. //depot/projects/smpng/sys/sys/sx.h#12 integrate .. //depot/projects/smpng/sys/sys/ttycom.h#2 integrate .. //depot/projects/smpng/sys/sys/uio.h#15 integrate .. //depot/projects/smpng/sys/ufs/ffs/ffs_vnops.c#26 integrate .. //depot/projects/smpng/sys/vm/vm_glue.c#37 integrate .. //depot/projects/smpng/sys/vm/vm_map.c#54 integrate .. //depot/projects/smpng/sys/vm/vm_mmap.c#39 integrate .. //depot/projects/smpng/sys/vm/vm_pageout.c#40 integrate .. //depot/projects/smpng/sys/vm/vm_unix.c#9 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/linux/linux_machdep.c#16 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_machdep.c,v 1.32 2003/08/22 07:20:26 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_machdep.c,v 1.33 2004/02/04 21:52:52 jhb Exp $"); #include #include @@ -382,7 +382,7 @@ if ((error = copyin(uap->rlim, &rlim, sizeof (struct rlimit)))) return (error); - return dosetrlimit(td, which, &rlim); + return (kern_setrlimit(td, which, &rlim)); } int @@ -390,7 +390,9 @@ struct thread *td; struct linux_getrlimit_args *uap; { + struct rlimit rlim; u_int which; + int error; #ifdef DEBUG if (ldebug(getrlimit)) @@ -405,6 +407,9 @@ if (which == -1) return EINVAL; - return (copyout(&td->td_proc->p_rlimit[which], - uap->rlim, sizeof (struct rlimit))); + PROC_LOCK(td->td_proc); + lim_rlimit(td->td_proc, which, &rlim); + PROC_UNLOCK(td->td_proc); + error = copyout(&rlim, uap->rlim, sizeof (struct rlimit)); + return (error); } ==== //depot/projects/smpng/sys/alpha/linux/linux_proto.h#10 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/alpha/linux/linux_proto.h,v 1.14 2003/12/23 03:53:50 peter Exp $ - * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.54 2003/12/23 03:53:21 peter Exp + * $FreeBSD: src/sys/alpha/linux/linux_proto.h,v 1.15 2004/02/04 22:00:41 jhb Exp $ + * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.55 2004/02/04 21:56:59 jhb Exp */ #ifndef _LINUX_SYSPROTO_H_ ==== //depot/projects/smpng/sys/alpha/linux/linux_syscall.h#8 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/alpha/linux/linux_syscall.h,v 1.12 2003/12/23 03:53:50 peter Exp $ - * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.54 2003/12/23 03:53:21 peter Exp + * $FreeBSD: src/sys/alpha/linux/linux_syscall.h,v 1.13 2004/02/04 22:00:41 jhb Exp $ + * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.55 2004/02/04 21:56:59 jhb Exp */ #define LINUX_SYS_exit 1 ==== //depot/projects/smpng/sys/alpha/linux/linux_sysent.c#8 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/alpha/linux/linux_sysent.c,v 1.12 2003/12/23 03:53:50 peter Exp $ - * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.54 2003/12/23 03:53:21 peter Exp + * $FreeBSD: src/sys/alpha/linux/linux_sysent.c,v 1.13 2004/02/04 22:00:41 jhb Exp $ + * created from FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.55 2004/02/04 21:56:59 jhb Exp */ #include "opt_compat.h" @@ -161,8 +161,8 @@ { AS(ogetpeername_args), (sy_call_t *)ogetpeername }, /* 141 = ogetpeername */ { 0, (sy_call_t *)nosys }, /* 142 = */ { 0, (sy_call_t *)nosys }, /* 143 = */ - { AS(linux_getrlimit_args), (sy_call_t *)linux_getrlimit }, /* 144 = linux_getrlimit */ - { AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit }, /* 145 = linux_setrlimit */ + { SYF_MPSAFE | AS(linux_getrlimit_args), (sy_call_t *)linux_getrlimit }, /* 144 = linux_getrlimit */ + { SYF_MPSAFE | AS(linux_setrlimit_args), (sy_call_t *)linux_setrlimit }, /* 145 = linux_setrlimit */ { 0, (sy_call_t *)nosys }, /* 146 = */ { SYF_MPSAFE | 0, (sy_call_t *)setsid }, /* 147 = setsid */ { 0, (sy_call_t *)linux_quotactl }, /* 148 = linux_quotactl */ ==== //depot/projects/smpng/sys/alpha/linux/syscalls.master#9 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.54 2003/12/23 03:53:21 peter Exp $ + $FreeBSD: src/sys/alpha/linux/syscalls.master,v 1.55 2004/02/04 21:56:59 jhb Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from LINUX). @@ -194,9 +194,9 @@ 141 NOPROTO { int ogetpeername(int fdes, caddr_t asa, int *alen); } 142 UNIMPL 143 UNIMPL -144 STD { int linux_getrlimit(l_uint resource, \ +144 MSTD { int linux_getrlimit(l_uint resource, \ struct l_rlimit *rlim); } -145 STD { int linux_setrlimit(l_uint resource, \ +145 MSTD { int linux_setrlimit(l_uint resource, \ struct l_rlimit *rlim); } 146 UNIMPL 147 MNOPROTO { int setsid(void); } ==== //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#25 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.44 2004/02/02 12:57:49 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_misc.c,v 1.45 2004/02/04 21:52:52 jhb Exp $"); #include #include @@ -390,23 +390,25 @@ struct thread *td; struct osf1_getrlimit_args *uap; { - struct __getrlimit_args /* { - syscallarg(u_int) which; - syscallarg(struct rlimit *) rlp; - } */ a; + struct rlimit bsd_rlim; + struct proc *p; + int which; if (uap->which >= OSF1_RLIMIT_NLIMITS) return (EINVAL); if (uap->which <= OSF1_RLIMIT_LASTCOMMON) - a.which = uap->which; + which = uap->which; else if (uap->which == OSF1_RLIMIT_NOFILE) - a.which = RLIMIT_NOFILE; + which = RLIMIT_NOFILE; else return (0); - a.rlp = (struct rlimit *)uap->rlp; - return getrlimit(td, &a); + p = td->td_proc; + PROC_LOCK(p); + lim_rlimit(p, which, &bsd_rlim); + PROC_UNLOCK(p); + return (copyout(&bsd_rlim, uap->rlp, sizeof(bsd_rlim))); } @@ -415,23 +417,24 @@ struct thread *td; struct osf1_setrlimit_args *uap; { - struct __setrlimit_args /* { - syscallarg(u_int) which; - syscallarg(struct rlimit *) rlp; - } */ a; + struct rlimit bsd_rlim; + int error, which; if (uap->which >= OSF1_RLIMIT_NLIMITS) return (EINVAL); if (uap->which <= OSF1_RLIMIT_LASTCOMMON) - a.which = uap->which; + which = uap->which; else if (uap->which == OSF1_RLIMIT_NOFILE) - a.which = RLIMIT_NOFILE; + which = RLIMIT_NOFILE; else return (0); - a.rlp = (struct rlimit *)uap->rlp; + + error = copyin(uap->rlp, &bsd_rlim, sizeof(bsd_rlim)); + if (error) + return (error); - return setrlimit(td, &a); + return (kern_setrlimit(td, which, &bsd_rlim)); } ==== //depot/projects/smpng/sys/alpha/osf1/osf1_proto.h#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/alpha/osf1/osf1_proto.h,v 1.8 2003/12/24 00:26:34 peter Exp $ - * created from; FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.7 2003/12/24 00:26:09 peter Exp + * $FreeBSD: src/sys/alpha/osf1/osf1_proto.h,v 1.9 2004/02/04 22:00:41 jhb Exp $ + * created from; FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.8 2004/02/04 21:57:00 jhb Exp */ #ifndef _OSF1_SYSPROTO_H_ ==== //depot/projects/smpng/sys/alpha/osf1/osf1_syscall.h#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/alpha/osf1/osf1_syscall.h,v 1.7 2003/12/24 00:26:34 peter Exp $ - * created from; FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.7 2003/12/24 00:26:09 peter Exp + * $FreeBSD: src/sys/alpha/osf1/osf1_syscall.h,v 1.8 2004/02/04 22:00:41 jhb Exp $ + * created from; FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.8 2004/02/04 21:57:00 jhb Exp */ #define OSF1_SYS_nosys 0 ==== //depot/projects/smpng/sys/alpha/osf1/osf1_sysent.c#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/alpha/osf1/osf1_sysent.c,v 1.7 2003/12/24 00:26:34 peter Exp $ - * created from; FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.7 2003/12/24 00:26:09 peter Exp + * $FreeBSD: src/sys/alpha/osf1/osf1_sysent.c,v 1.8 2004/02/04 22:00:41 jhb Exp $ + * created from; FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.8 2004/02/04 21:57:00 jhb Exp */ #include "opt_compat.h" @@ -162,8 +162,8 @@ { AS(ogetpeername_args), (sy_call_t *)ogetpeername }, /* 141 = ogetpeername */ { SYF_MPSAFE | 0, (sy_call_t *)ogethostid }, /* 142 = ogethostid */ { SYF_MPSAFE | AS(osethostid_args), (sy_call_t *)osethostid }, /* 143 = osethostid */ - { AS(osf1_getrlimit_args), (sy_call_t *)osf1_getrlimit }, /* 144 = osf1_getrlimit */ - { AS(osf1_setrlimit_args), (sy_call_t *)osf1_setrlimit }, /* 145 = osf1_setrlimit */ + { SYF_MPSAFE | AS(osf1_getrlimit_args), (sy_call_t *)osf1_getrlimit }, /* 144 = osf1_getrlimit */ + { SYF_MPSAFE | AS(osf1_setrlimit_args), (sy_call_t *)osf1_setrlimit }, /* 145 = osf1_setrlimit */ { 0, (sy_call_t *)nosys }, /* 146 = old killpg */ { SYF_MPSAFE | 0, (sy_call_t *)setsid }, /* 147 = setsid */ { 0, (sy_call_t *)nosys }, /* 148 = quotactl */ ==== //depot/projects/smpng/sys/alpha/osf1/syscalls.master#5 (text+ko) ==== @@ -1,4 +1,4 @@ -; $FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.7 2003/12/24 00:26:09 peter Exp $ +; $FreeBSD: src/sys/alpha/osf1/syscalls.master,v 1.8 2004/02/04 21:57:00 jhb Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from OSF1). @@ -199,8 +199,8 @@ 141 NOPROTO { int ogetpeername(int fdes, caddr_t asa, int *alen); } 142 MNOPROTO { int32_t ogethostid(void); } 143 MNOPROTO { int osethostid(int32_t hostid); } -144 STD { int osf1_getrlimit(u_int which, struct rlimit *rlp); } -145 STD { int osf1_setrlimit(u_int which, struct rlimit *rlp); } +144 MSTD { int osf1_getrlimit(u_int which, struct rlimit *rlp); } +145 MSTD { int osf1_setrlimit(u_int which, struct rlimit *rlp); } 146 UNIMPL old killpg 147 MNOPROTO { int setsid(void); } 148 UNIMPL quotactl ==== //depot/projects/smpng/sys/compat/ia32/ia32_sysvec.c#8 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/ia32/ia32_sysvec.c,v 1.15 2003/12/23 02:42:38 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ia32/ia32_sysvec.c,v 1.16 2004/02/04 21:52:52 jhb Exp $"); #include "opt_compat.h" @@ -273,50 +273,33 @@ ia32_fixlimits(struct image_params *imgp) { struct proc *p = imgp->proc; + struct plimit *oldlim, *newlim; + if (ia32_maxdsiz == 0 && ia32_maxssiz == 0 && ia32_maxvmem == 0) + return; + newlim = lim_alloc(); + PROC_LOCK(p); + oldlim = p->p_limit; + lim_copy(newlim, oldlim); if (ia32_maxdsiz != 0) { - if (p->p_rlimit[RLIMIT_DATA].rlim_cur > ia32_maxdsiz || - p->p_rlimit[RLIMIT_DATA].rlim_max > ia32_maxdsiz) { - if (p->p_limit->p_refcnt > 1) { - p->p_limit->p_refcnt--; - p->p_limit = limcopy(p->p_limit); - } - if (p->p_rlimit[RLIMIT_DATA].rlim_cur > ia32_maxdsiz) - p->p_rlimit[RLIMIT_DATA].rlim_cur = - ia32_maxdsiz; - if (p->p_rlimit[RLIMIT_DATA].rlim_max > ia32_maxdsiz) - p->p_rlimit[RLIMIT_DATA].rlim_max = - ia32_maxdsiz; - } + if (newlim->pl_rlimit[RLIMIT_DATA].rlim_cur > ia32_maxdsiz) + newlim->pl_rlimit[RLIMIT_DATA].rlim_cur = ia32_maxdsiz; + if (newlim->pl_rlimit[RLIMIT_DATA].rlim_max > ia32_maxdsiz) + newlim->pl_rlimit[RLIMIT_DATA].rlim_max = ia32_maxdsiz; } if (ia32_maxssiz != 0) { - if (p->p_rlimit[RLIMIT_STACK].rlim_cur > ia32_maxssiz || - p->p_rlimit[RLIMIT_STACK].rlim_max > ia32_maxssiz) { - if (p->p_limit->p_refcnt > 1) { - p->p_limit->p_refcnt--; - p->p_limit = limcopy(p->p_limit); - } - if (p->p_rlimit[RLIMIT_STACK].rlim_cur > ia32_maxssiz) - p->p_rlimit[RLIMIT_STACK].rlim_cur = - ia32_maxssiz; - if (p->p_rlimit[RLIMIT_STACK].rlim_max > ia32_maxssiz) - p->p_rlimit[RLIMIT_STACK].rlim_max = - ia32_maxssiz; - } + if (newlim->pl_rlimit[RLIMIT_STACK].rlim_cur > ia32_maxssiz) + newlim->pl_rlimit[RLIMIT_STACK].rlim_cur = ia32_maxssiz; + if (newlim->pl_rlimit[RLIMIT_STACK].rlim_max > ia32_maxssiz) + newlim->pl_rlimit[RLIMIT_STACK].rlim_max = ia32_maxssiz; } if (ia32_maxvmem != 0) { - if (p->p_rlimit[RLIMIT_VMEM].rlim_cur > ia32_maxvmem || - p->p_rlimit[RLIMIT_VMEM].rlim_max > ia32_maxvmem) { - if (p->p_limit->p_refcnt > 1) { - p->p_limit->p_refcnt--; - p->p_limit = limcopy(p->p_limit); - } - if (p->p_rlimit[RLIMIT_VMEM].rlim_cur > ia32_maxvmem) - p->p_rlimit[RLIMIT_VMEM].rlim_cur = - ia32_maxvmem; - if (p->p_rlimit[RLIMIT_VMEM].rlim_max > ia32_maxvmem) - p->p_rlimit[RLIMIT_VMEM].rlim_max = - ia32_maxvmem; - } + if (newlim->pl_rlimit[RLIMIT_VMEM].rlim_cur > ia32_maxvmem) + newlim->pl_rlimit[RLIMIT_VMEM].rlim_cur = ia32_maxvmem; + if (newlim->pl_rlimit[RLIMIT_VMEM].rlim_max > ia32_maxvmem) + newlim->pl_rlimit[RLIMIT_VMEM].rlim_max = ia32_maxvmem; } + p->p_limit = newlim; + PROC_UNLOCK(p); + lim_free(oldlim); } ==== //depot/projects/smpng/sys/compat/linux/linux_misc.c#45 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.151 2004/01/02 19:29:31 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.152 2004/02/04 21:52:53 jhb Exp $"); #include "opt_mac.h" @@ -378,20 +378,19 @@ goto cleanup; } - /* To protect td->td_proc->p_rlimit in the if condition. */ - mtx_assert(&Giant, MA_OWNED); - /* * text/data/bss must not exceed limits * XXX - this is not complete. it should check current usage PLUS * the resources needed by this library. */ + PROC_LOCK(td->td_proc); if (a_out->a_text > maxtsiz || - a_out->a_data + bss_size > - td->td_proc->p_rlimit[RLIMIT_DATA].rlim_cur) { + a_out->a_data + bss_size > lim_cur(td->td_proc, RLIMIT_DATA)) { + PROC_UNLOCK(td->td_proc); error = ENOMEM; goto cleanup; } + PROC_UNLOCK(td->td_proc); mp_fixme("Unlocked vflags access."); /* prevent more writers */ @@ -1111,7 +1110,7 @@ bsd_rlim.rlim_cur = (rlim_t)rlim.rlim_cur; bsd_rlim.rlim_max = (rlim_t)rlim.rlim_max; - return (dosetrlimit(td, which, &bsd_rlim)); + return (kern_setrlimit(td, which, &bsd_rlim)); } int @@ -1119,7 +1118,7 @@ { struct l_rlimit rlim; struct proc *p = td->td_proc; - struct rlimit *bsd_rlp; + struct rlimit bsd_rlim; u_int which; #ifdef DEBUG @@ -1134,12 +1133,15 @@ which = linux_to_bsd_resource[args->resource]; if (which == -1) return (EINVAL); - bsd_rlp = &p->p_rlimit[which]; + + PROC_LOCK(p); + lim_rlimit(p, which, &bsd_rlim); + PROC_UNLOCK(p); - rlim.rlim_cur = (unsigned long)bsd_rlp->rlim_cur; + rlim.rlim_cur = (unsigned long)bsd_rlim.rlim_cur; if (rlim.rlim_cur == ULONG_MAX) rlim.rlim_cur = LONG_MAX; - rlim.rlim_max = (unsigned long)bsd_rlp->rlim_max; + rlim.rlim_max = (unsigned long)bsd_rlim.rlim_max; if (rlim.rlim_max == ULONG_MAX) rlim.rlim_max = LONG_MAX; return (copyout(&rlim, args->rlim, sizeof(rlim))); @@ -1150,7 +1152,7 @@ { struct l_rlimit rlim; struct proc *p = td->td_proc; - struct rlimit *bsd_rlp; + struct rlimit bsd_rlim; u_int which; #ifdef DEBUG @@ -1165,10 +1167,13 @@ which = linux_to_bsd_resource[args->resource]; if (which == -1) return (EINVAL); - bsd_rlp = &p->p_rlimit[which]; + + PROC_LOCK(p); + lim_rlimit(p, which, &bsd_rlim); + PROC_UNLOCK(p); - rlim.rlim_cur = (l_ulong)bsd_rlp->rlim_cur; - rlim.rlim_max = (l_ulong)bsd_rlp->rlim_max; + rlim.rlim_cur = (l_ulong)bsd_rlim.rlim_cur; + rlim.rlim_max = (l_ulong)bsd_rlim.rlim_max; return (copyout(&rlim, args->rlim, sizeof(rlim))); } #endif /*!__alpha__*/ ==== //depot/projects/smpng/sys/compat/ndis/subr_ndis.c#8 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.41 2004/02/03 07:39:23 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.42 2004/02/04 04:44:16 wpaul Exp $"); /* * This file implements a translation layer between the BSD networking @@ -171,7 +171,8 @@ static void ndis_mapshared_cb(void *, bus_dma_segment_t *, int, int); __stdcall static void ndis_alloc_sharedmem(ndis_handle, uint32_t, uint8_t, void **, ndis_physaddr *); -__stdcall static void ndis_alloc_sharedmem_async(ndis_handle, +static void ndis_asyncmem_complete(void *); +__stdcall static ndis_status ndis_alloc_sharedmem_async(ndis_handle, uint32_t, uint8_t, void *); __stdcall static void ndis_free_sharedmem(ndis_handle, uint32_t, uint8_t, void *, ndis_physaddr); @@ -1319,32 +1320,68 @@ return; } -__stdcall static void -ndis_alloc_sharedmem_async(adapter, len, cached, ctx) - ndis_handle adapter; - uint32_t len; - uint8_t cached; - void *ctx; +struct ndis_allocwork { + ndis_handle na_adapter; + uint32_t na_len; + uint8_t na_cached; + void *na_ctx; +}; + +static void +ndis_asyncmem_complete(arg) + void *arg; { ndis_miniport_block *block; struct ndis_softc *sc; + struct ndis_allocwork *w; void *vaddr; ndis_physaddr paddr; __stdcall ndis_allocdone_handler donefunc; - if (adapter == NULL) - return; + w = arg; + block = (ndis_miniport_block *)w->na_adapter; + sc = (struct ndis_softc *)(block->nmb_ifp); + + vaddr = NULL; + paddr.np_quad = 0; - block = (ndis_miniport_block *)adapter; - sc = (struct ndis_softc *)(block->nmb_ifp); donefunc = sc->ndis_chars.nmc_allocate_complete_func; + ndis_alloc_sharedmem(w->na_adapter, w->na_len, + w->na_cached, &vaddr, &paddr); + donefunc(w->na_adapter, vaddr, &paddr, w->na_len, w->na_ctx); - ndis_alloc_sharedmem(adapter, len, cached, &vaddr, &paddr); - donefunc(adapter, vaddr, &paddr, len, ctx); + free(arg, M_TEMP); return; } +__stdcall static ndis_status +ndis_alloc_sharedmem_async(adapter, len, cached, ctx) + ndis_handle adapter; + uint32_t len; + uint8_t cached; + void *ctx; +{ + struct ndis_allocwork *w; + + if (adapter == NULL) + return(NDIS_STATUS_FAILURE); + + w = malloc(sizeof(struct ndis_allocwork), M_TEMP, M_NOWAIT); + + if (w == NULL) + return(NDIS_STATUS_FAILURE); + + w->na_adapter = adapter; + w->na_cached = cached; + w->na_len = len; + w->na_ctx = ctx; + + ndis_sched(ndis_asyncmem_complete, w, NDIS_TASKQUEUE); + + return(NDIS_STATUS_PENDING); +} + __stdcall static void ndis_free_sharedmem(adapter, len, cached, vaddr, paddr) ndis_handle adapter; ==== //depot/projects/smpng/sys/compat/svr4/imgact_svr4.c#10 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/svr4/imgact_svr4.c,v 1.21 2003/06/10 21:35:15 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/svr4/imgact_svr4.c,v 1.22 2004/02/04 21:52:53 jhb Exp $"); #include #include @@ -104,14 +104,16 @@ /* text + data can't exceed file size */ if (a_out->a_data + a_out->a_text > imgp->attr->va_size) return (EFAULT); - /* For p_rlimit below. */ - mtx_assert(&Giant, MA_OWNED); /* * text/data/bss must not exceed limits */ + PROC_LOCK(imgp->proc); if (a_out->a_text > maxtsiz || - a_out->a_data + bss_size > imgp->proc->p_rlimit[RLIMIT_DATA].rlim_cur) + a_out->a_data + bss_size > lim_cur(imgp->proc, RLIMIT_DATA)) { + PROC_UNLOCK(imgp->proc); return (ENOMEM); + } + PROC_UNLOCK(imgp->proc); VOP_UNLOCK(imgp->vp, 0, td); ==== //depot/projects/smpng/sys/compat/svr4/svr4_filio.c#14 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_filio.c,v 1.30 2003/10/20 10:38:48 tjr Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_filio.c,v 1.31 2004/02/04 21:52:53 jhb Exp $"); #include #include @@ -66,10 +66,13 @@ int idx = 0, cerr; u_long siz; - mtx_assert(&Giant, MA_OWNED); - if (uap->nfds > td->td_proc->p_rlimit[RLIMIT_NOFILE].rlim_cur && - uap->nfds > FD_SETSIZE) - return (EINVAL); + PROC_LOCK(td->td_proc); + if (uap->nfds > lim_cur(td->td_proc, RLIMIT_NOFILE) && + uap->nfds > FD_SETSIZE) { + PROC_UNLOCK(td->td_proc); + return (EINVAL); + } + PROC_UNLOCK(td->td_proc); pa.fds = uap->fds; pa.nfds = uap->nfds; ==== //depot/projects/smpng/sys/compat/svr4/svr4_misc.c#30 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.69 2004/01/21 17:10:47 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_misc.c,v 1.70 2004/02/04 21:52:53 jhb Exp $"); #include "opt_mac.h" @@ -820,15 +820,15 @@ base = round_page((vm_offset_t) vm->vm_daddr); ns = (vm_offset_t)uap->nsize; new = round_page(ns); - /* For p_rlimit. */ - mtx_assert(&Giant, MA_OWNED); if (new > base) { - if ((new - base) > (unsigned) td->td_proc->p_rlimit[RLIMIT_DATA].rlim_cur) { + PROC_LOCK(p); + if ((new - base) > (unsigned)lim_cur(p, RLIMIT_DATA)) { + PROC_UNLOCK(p); return ENOMEM; - } - if (new >= VM_MAXUSER_ADDRESS) { - return (ENOMEM); - } + } + PROC_UNLOCK(p); + if (new >= VM_MAXUSER_ADDRESS) + return (ENOMEM); } else if (new < base) { /* * This is simply an invalid value. If someone wants to @@ -843,8 +843,12 @@ if (new > old) { vm_size_t diff; diff = new - old; - if (vm->vm_map.size + diff > p->p_rlimit[RLIMIT_VMEM].rlim_cur) + PROC_LOCK(p); + if (vm->vm_map.size + diff > lim_cur(p, RLIMIT_VMEM)) { + PROC_UNLOCK(p); return(ENOMEM); + } + PROC_UNLOCK(p); rv = vm_map_find(&vm->vm_map, NULL, 0, &old, diff, FALSE, VM_PROT_ALL, VM_PROT_ALL, 0); if (rv != KERN_SUCCESS) { @@ -922,42 +926,33 @@ struct svr4_sys_ulimit_args *uap; { int *retval = td->td_retval; + int error; switch (uap->cmd) { case SVR4_GFILLIM: - /* For p_rlimit below. */ - mtx_assert(&Giant, MA_OWNED); - *retval = td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur / 512; + PROC_LOCK(td->td_proc); + *retval = lim_cur(td->td_proc, RLIMIT_FSIZE) / 512; + PROC_UNLOCK(td->td_proc); if (*retval == -1) *retval = 0x7fffffff; return 0; case SVR4_SFILLIM: { - int error; - struct __setrlimit_args srl; struct rlimit krl; - caddr_t sg = stackgap_init(); - struct rlimit *url = (struct rlimit *) - stackgap_alloc(&sg, sizeof *url); krl.rlim_cur = uap->newlimit * 512; - mtx_assert(&Giant, MA_OWNED); - krl.rlim_max = td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_max; + PROC_LOCK(td->td_proc); + krl.rlim_max = lim_max(td->td_proc, RLIMIT_FSIZE); + PROC_UNLOCK(td->td_proc); - error = copyout(&krl, url, sizeof(*url)); + error = kern_setrlimit(td, RLIMIT_FSIZE, &krl); if (error) return error; - srl.which = RLIMIT_FSIZE; - srl.rlp = url; - - error = setrlimit(td, &srl); - if (error) - return error; - - mtx_assert(&Giant, MA_OWNED); - *retval = td->td_proc->p_rlimit[RLIMIT_FSIZE].rlim_cur; + PROC_LOCK(td->td_proc); + *retval = lim_cur(td->td_proc, RLIMIT_FSIZE); + PROC_UNLOCK(td->td_proc); if (*retval == -1) *retval = 0x7fffffff; return 0; @@ -968,12 +963,15 @@ struct vmspace *vm = td->td_proc->p_vmspace; register_t r; - mtx_assert(&Giant, MA_OWNED); - r = td->td_proc->p_rlimit[RLIMIT_DATA].rlim_cur; + PROC_LOCK(td->td_proc); + r = lim_cur(td->td_proc, RLIMIT_DATA); + PROC_UNLOCK(td->td_proc); if (r == -1) r = 0x7fffffff; + mtx_lock(&Giant); /* XXX */ r += (long) vm->vm_daddr; + mtx_unlock(&Giant); if (r < 0) r = 0x7fffffff; *retval = r; @@ -981,8 +979,9 @@ } case SVR4_GDESLIM: - mtx_assert(&Giant, MA_OWNED); - *retval = td->td_proc->p_rlimit[RLIMIT_NOFILE].rlim_cur; + PROC_LOCK(td->td_proc); + *retval = lim_cur(td->td_proc, RLIMIT_NOFILE); + PROC_UNLOCK(td->td_proc); if (*retval == -1) *retval = 0x7fffffff; return 0; ==== //depot/projects/smpng/sys/compat/svr4/svr4_proto.h#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/svr4/svr4_proto.h,v 1.13 2003/12/24 00:02:08 peter Exp $ - * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.13 2003/12/24 00:00:47 peter Exp + * $FreeBSD: src/sys/compat/svr4/svr4_proto.h,v 1.14 2004/02/04 22:00:41 jhb Exp $ + * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.14 2004/02/04 21:57:00 jhb Exp */ #ifndef _SVR4_SYSPROTO_H_ ==== //depot/projects/smpng/sys/compat/svr4/svr4_resource.c#9 (text+ko) ==== @@ -66,7 +66,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_resource.c,v 1.15 2003/06/10 21:35:15 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/svr4/svr4_resource.c,v 1.16 2004/02/04 21:52:53 jhb Exp $"); #include #include @@ -136,9 +136,9 @@ if (rl == -1) return EINVAL; - /* For p_rlimit. */ - mtx_assert(&Giant, MA_OWNED); - blim = td->td_proc->p_rlimit[rl]; + PROC_LOCK(td->td_proc); + lim_rlimit(td->td_proc, rl, &blim); + PROC_UNLOCK(td->td_proc); /* * Our infinity, is their maxfiles. @@ -177,20 +177,20 @@ struct svr4_sys_setrlimit_args *uap; { int rl = svr4_to_native_rl(uap->which); - struct rlimit blim, *limp; + struct rlimit blim, curlim; struct svr4_rlimit slim; int error; if (rl == -1) return EINVAL; - /* For p_rlimit. */ - mtx_assert(&Giant, MA_OWNED); - limp = &td->td_proc->p_rlimit[rl]; - if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0) return error; + PROC_LOCK(td->td_proc); + lim_rlimit(td->td_proc, rl, &curlim); + PROC_UNLOCK(td->td_proc); + /* * if the limit is SVR4_RLIM_INFINITY, then we set it to our * unlimited. @@ -205,20 +205,20 @@ else if (OKLIMIT(slim.rlim_max)) blim.rlim_max = (rlim_t) slim.rlim_max; else if (slim.rlim_max == SVR4_RLIM_SAVED_MAX) - blim.rlim_max = limp->rlim_max; + blim.rlim_max = curlim.rlim_max; else if (slim.rlim_max == SVR4_RLIM_SAVED_CUR) - blim.rlim_max = limp->rlim_cur; + blim.rlim_max = curlim.rlim_cur; if (slim.rlim_cur == SVR4_RLIM_INFINITY) blim.rlim_cur = RLIM_INFINITY; else if (OKLIMIT(slim.rlim_cur)) blim.rlim_cur = (rlim_t) slim.rlim_cur; else if (slim.rlim_cur == SVR4_RLIM_SAVED_MAX) - blim.rlim_cur = limp->rlim_max; + blim.rlim_cur = curlim.rlim_max; else if (slim.rlim_cur == SVR4_RLIM_SAVED_CUR) - blim.rlim_cur = limp->rlim_cur; + blim.rlim_cur = curlim.rlim_cur; - return dosetrlimit(td, rl, &blim); + return (kern_setrlimit(td, rl, &blim)); } @@ -234,9 +234,9 @@ if (rl == -1) return EINVAL; - /* For p_rlimit. */ - mtx_assert(&Giant, MA_OWNED); - blim = td->td_proc->p_rlimit[rl]; + PROC_LOCK(td->td_proc); + lim_rlimit(td->td_proc, rl, &blim); + PROC_UNLOCK(td->td_proc); /* * Our infinity, is their maxfiles. @@ -275,20 +275,20 @@ struct svr4_sys_setrlimit64_args *uap; { int rl = svr4_to_native_rl(uap->which); - struct rlimit blim, *limp; + struct rlimit blim, curlim; struct svr4_rlimit64 slim; int error; if (rl == -1) return EINVAL; - /* For p_rlimit. */ - mtx_assert(&Giant, MA_OWNED); - limp = &td->td_proc->p_rlimit[rl]; - if ((error = copyin(uap->rlp, &slim, sizeof(slim))) != 0) return error; >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Wed Feb 4 22:25:16 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D277516A4D0; Wed, 4 Feb 2004 22:25:15 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A336516A4CE for ; Wed, 4 Feb 2004 22:25:15 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E66B43D48 for ; Wed, 4 Feb 2004 22:25:14 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i156PD0B008635 for ; Wed, 4 Feb 2004 22:25:13 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i156PDbI008632 for perforce@freebsd.org; Wed, 4 Feb 2004 22:25:13 -0800 (PST) (envelope-from marcel@freebsd.org) Date: Wed, 4 Feb 2004 22:25:13 -0800 (PST) Message-Id: <200402050625.i156PDbI008632@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 46524 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 06:25:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=46524 Change 46524 by marcel@marcel_nfs on 2004/02/04 22:25:02 Move gdb from under binutils. There's still a dependency on headers (and libraries) from binutils, but I'll solve that later. The makefiles are skeletal. This does not actually build yet. Affected files ... .. //depot/projects/gdb/gnu/usr.bin/Makefile#2 edit .. //depot/projects/gdb/gnu/usr.bin/binutils/Makefile#2 edit .. //depot/projects/gdb/gnu/usr.bin/gdb/Makefile#1 add .. //depot/projects/gdb/gnu/usr.bin/gdb/Makefile.inc#1 add .. //depot/projects/gdb/gnu/usr.bin/gdb/Makefile.inc0#1 add .. //depot/projects/gdb/gnu/usr.bin/gdb/gdb/Makefile#1 add .. //depot/projects/gdb/gnu/usr.bin/gdb/gdb/config.h#1 add .. //depot/projects/gdb/gnu/usr.bin/gdb/gdb/gdb.1#1 add .. //depot/projects/gdb/gnu/usr.bin/gdb/gdb/init.c#1 add Differences ... ==== //depot/projects/gdb/gnu/usr.bin/Makefile#2 (text+ko) ==== @@ -1,11 +1,14 @@ # $FreeBSD: src/gnu/usr.bin/Makefile,v 1.76 2003/08/29 10:35:00 phk Exp $ -SUBDIR= bc ${_binutils} ${_cc} cpio dc dialog diff diff3 \ +SUBDIR= bc ${_binutils} ${_cc} cpio dc dialog diff diff3 ${_gdb} \ ${_gperf} grep gzip man patch rcs sdiff send-pr sort tar texinfo .if !defined(NO_TOOLCHAIN) _cc=cc _binutils=binutils +.if !defined(NO_GDB) +_gdb=gdb +.endif .endif .if !defined(NO_CXX) ==== //depot/projects/gdb/gnu/usr.bin/binutils/Makefile#2 (text+ko) ==== @@ -4,11 +4,4 @@ addr2line ar as gasp ld nm objcopy objdump ranlib readelf \ size strings strip doc -TARGET_ARCH?= ${MACHINE_ARCH} -.if (${TARGET_ARCH} == "alpha" \ - || ${TARGET_ARCH} == "i386" ) \ - && !defined(NO_GDB) -SUBDIR+= gdb gdbreplay -.endif - .include From owner-p4-projects@FreeBSD.ORG Thu Feb 5 07:15:04 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6EBE016A4D0; Thu, 5 Feb 2004 07:15:03 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE7E016A4CF for ; Thu, 5 Feb 2004 07:15:02 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3265C43D55 for ; Thu, 5 Feb 2004 07:15:01 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i15FF00B042143 for ; Thu, 5 Feb 2004 07:15:00 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i15FEwj6042132 for perforce@freebsd.org; Thu, 5 Feb 2004 07:14:58 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Thu, 5 Feb 2004 07:14:58 -0800 (PST) Message-Id: <200402051514.i15FEwj6042132@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46536 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 15:15:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=46536 Change 46536 by areisse@areisse_ibook on 2004/02/05 07:14:21 tell users to install some mach headers. Affected files ... .. //depot/projects/trustedbsd/sedarwin/bootstrap_instructions.txt#25 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/bootstrap_instructions.txt#25 (text+ko) ==== @@ -170,7 +170,17 @@ This mig program is compatible with old kernels as well, as long as the new features are not used. +Step 9.15: Install some modified Mach headers. You may want to save the old + headers also. + su + cp /usr/include/mach/message.h /usr/include/mach/mach_types.defs /tmp + cd apsl/xnu/BUILD/obj/EXPORT_HDRS + cp message.h mach_types.defs /usr/include/mach + exit + Step 9.2: Build modified mach_init + BEFORE installing the new init program, save the original because this + one will only work with sedarwin kernels. cd apsl/system_cmds/mach_init.tproj make ; sudo make install cd ../../.. From owner-p4-projects@FreeBSD.ORG Thu Feb 5 07:21:17 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D306316A4D0; Thu, 5 Feb 2004 07:21:16 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8772A16A4CE for ; Thu, 5 Feb 2004 07:21:16 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3200143D67 for ; Thu, 5 Feb 2004 07:20:08 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i15FK70B042375 for ; Thu, 5 Feb 2004 07:20:07 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i15FK7dh042372 for perforce@freebsd.org; Thu, 5 Feb 2004 07:20:07 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Thu, 5 Feb 2004 07:20:07 -0800 (PST) Message-Id: <200402051520.i15FK7dh042372@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46537 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 15:21:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=46537 Change 46537 by areisse@areisse_ibook on 2004/02/05 07:19:54 Initial support for label handles that use the same namespace as ports. The label cannot be changed after creation, allowing them to be shared in the future. A new access control query, mac_check_port_access uses ports (or label handles) for both the subject and object. Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/conf/files#3 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_entry.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_init.c#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_labelh.c#1 add .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_labelh.h#1 add .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_object.c#3 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_object.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_right.c#3 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/mach_port.c#3 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/kern/task.c#3 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/port.h#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/security.defs#2 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/conf/files#3 (text+ko) ==== @@ -135,6 +135,7 @@ osfmk/ipc/ipc_space.c standard osfmk/ipc/ipc_splay.c standard osfmk/ipc/ipc_table.c standard +osfmk/ipc/ipc_labelh.c standard osfmk/ipc/mach_debug.c standard osfmk/ipc/mach_msg.c standard osfmk/ipc/mach_port.c standard ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_entry.h#2 (text+ko) ==== @@ -114,7 +114,7 @@ #define IE_BITS_UREFS_MASK 0x0000ffff /* 16 bits of user-reference */ #define IE_BITS_UREFS(bits) ((bits) & IE_BITS_UREFS_MASK) -#define IE_BITS_TYPE_MASK 0x001f0000 /* 5 bits of capability type */ +#define IE_BITS_TYPE_MASK 0x003f0000 /* 6 bits of capability type */ #define IE_BITS_TYPE(bits) ((bits) & IE_BITS_TYPE_MASK) #define IE_BITS_COLLISION 0x00800000 /* 1 bit for collisions */ ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_init.c#2 (text+ko) ==== @@ -76,6 +76,7 @@ #include #include #include /* NDR_record */ +#include vm_map_t ipc_kernel_map; vm_size_t ipc_kernel_map_size = 1024 * 1024; @@ -153,6 +154,12 @@ /* make it exhaustible */ zone_change(ipc_object_zones[IOT_PORT_SET], Z_EXHAUST, TRUE); + ipc_object_zones[IOT_LABELH] = + zinit(sizeof(struct ipc_labelh), + ipc_port_max * sizeof(struct ipc_labelh), + sizeof(struct ipc_labelh), + "label handles"); + /* create special spaces */ kr = ipc_space_create_special(&ipc_space_kernel); ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_object.c#3 (text+ko) ==== @@ -72,6 +72,7 @@ #include #include #include +#include zone_t ipc_object_zones[IOT_NUMBER]; @@ -972,6 +973,19 @@ return kr; } +struct label *io_getlabel (ipc_object_t objp) +{ + switch (io_otype (objp)) + { + case IOT_PORT: + return &((ipc_port_t) objp)->ip_label; + + case IOT_LABELH: + return &((ipc_labelh_t) objp)->lh_label; + } + return NULL; +} + #if MACH_ASSERT /* * Check whether the object is a port if so, free it. But @@ -992,7 +1006,11 @@ #ifdef MAC mac_destroy_port_label (&port->ip_label); -#endif + } + else if (otype == IOT_LABELH) { + ipc_labelh_t lh = (ipc_labelh_t) object; + mac_destroy_port_label (&lh->lh_label); +#endif } zfree(ipc_object_zones[otype], (vm_offset_t) object); } ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_object.h#2 (text+ko) ==== @@ -133,7 +133,8 @@ */ #define IOT_PORT 0 #define IOT_PORT_SET 1 -#define IOT_NUMBER 2 /* number of types used */ +#define IOT_LABELH 2 /* a label handle */ +#define IOT_NUMBER 3 /* number of types used */ extern zone_t ipc_object_zones[IOT_NUMBER]; @@ -223,6 +224,43 @@ (io)->io_references--; \ MACRO_END +/* There doesn't seem to be an established lock order for two + ipc_objects of the same type */ +extern inline void io_lock2 (ipc_object_t a, ipc_object_t b) +{ + if (a == b) + io_lock (a); + else if (a < b) + { + io_lock (a); + io_lock (b); + } + else + { + io_lock (b); + io_lock (a); + } +} + +extern inline void io_unlock2 (ipc_object_t a, ipc_object_t b) +{ + if (a == b) + io_unlock (a); + else if (a < b) + { + io_unlock (b); + io_unlock (a); + } + else + { + io_unlock (a); + io_unlock (b); + } +} + +struct label; +extern struct label *io_getlabel (ipc_object_t obj); + /* * Exported interfaces */ ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/ipc_right.c#3 (text+ko) ==== @@ -551,6 +551,10 @@ break; } + case MACH_PORT_TYPE_LABELH: + ipc_object_release (entry->ie_object); + break; + case MACH_PORT_TYPE_SEND: case MACH_PORT_TYPE_RECEIVE: case MACH_PORT_TYPE_SEND_RECEIVE: @@ -665,6 +669,14 @@ break; } + case MACH_PORT_TYPE_LABELH: { + ipc_object_t lh = entry->ie_object; + entry->ie_object = IO_NULL; + ipc_entry_dealloc (space, name, entry); + ipc_object_release (lh); + break; + } + case MACH_PORT_TYPE_SEND: case MACH_PORT_TYPE_RECEIVE: case MACH_PORT_TYPE_SEND_RECEIVE: @@ -999,6 +1011,21 @@ break; } + case MACH_PORT_RIGHT_LABELH: { + ipc_object_t lh = entry->ie_object; + if ((bits & MACH_PORT_TYPE_LABELH) == 0) + goto invalid_right; + if (delta == 0) + goto success; + else if (delta != -1) + goto invalid_value; + entry->ie_object = IO_NULL; + ipc_entry_dealloc (space, name, entry); + ipc_object_release (lh); + is_write_unlock (space); + break; + } + case MACH_PORT_RIGHT_RECEIVE: { ipc_port_t port; ipc_port_t dnrequest = IP_NULL; ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/ipc/mach_port.c#3 (text+ko) ==== @@ -81,6 +81,7 @@ #include #include #include +#include #include /* @@ -1753,7 +1754,7 @@ return kr; } -/* Don't pass something other than a port, it doesn't check the type yet. */ +/* also works on label handles */ kern_return_t mach_get_port_label (ipc_space_t space, mach_port_name_t name, vm_offset_t outlabel) @@ -1771,6 +1772,9 @@ if (kr != KERN_SUCCESS) return kr; + switch (io_otype (entry->ie_object)) + { + case IOT_PORT:{ ipc_port_t port = (ipc_port_t) entry->ie_object; ip_lock (port); @@ -1778,7 +1782,22 @@ mac_externalize_port_label (&port->ip_label, "sebsd", outlabel, 512, 0); ip_unlock (port); - return kr; + } + return 0; + + case IOT_LABELH: + { + ipc_labelh_t lh = (ipc_labelh_t) entry->ie_object; + io_lock (&lh->lh_object); + is_write_unlock (space); + mac_externalize_port_label (&lh->lh_label, "sebsd", outlabel, 512, 0); + io_unlock (&lh->lh_object); + } + return 0; + } + + is_write_unlock (space); + return KERN_INVALID_ARGUMENT; } kern_return_t @@ -1803,6 +1822,11 @@ if (kr != KERN_SUCCESS) return kr; + if (IOT_PORT != io_otype(entry->ie_object)) { + is_write_unlock (space); + return KERN_INVALID_RIGHT; + } + ipc_port_t port = (ipc_port_t) entry->ie_object; ip_lock (port); ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/kern/task.c#3 (text+ko) ==== @@ -1824,8 +1824,9 @@ { struct label subjl; ipc_entry_t entry; - ipc_port_t objp; + ipc_object_t objp; kern_return_t kr; + struct label *objl; if (space == IS_NULL || space->is_task == NULL) return KERN_INVALID_TASK; @@ -1848,18 +1849,71 @@ return kr; } - objp = (ipc_port_t) entry->ie_object; + objp = entry->ie_object; + io_lock (objp); + is_write_unlock (space); + + objl = io_getlabel (objp); + if (objl == NULL) { + io_unlock (objp); + return KERN_INVALID_ARGUMENT; + } + + rc = mac_check_service_access (&subjl, objl, serv, perm); + io_unlock (objp); + + mac_destroy_task_label (&subjl); + if (rc == /*EINVAL*/ 22) + return KERN_INVALID_ARGUMENT; + else if (rc != 0) + return KERN_NO_ACCESS; + else + return 0; +} + +kern_return_t +mac_check_port_access (ipc_space_t space, mach_port_name_t sub, mach_port_name_t obj, + vm_offset_t serv, vm_offset_t perm) +{ + ipc_entry_t subi, obji; + ipc_object_t subp, objp; + kern_return_t kr; + struct label *objl, *subl; + int rc; + + if (space == IS_NULL || space->is_task == NULL) + return KERN_INVALID_TASK; + + if (!MACH_PORT_VALID(obj) || !MACH_PORT_VALID(sub)) + return KERN_INVALID_NAME; + + kr = ipc_right_lookup_two_write(space, obj, &obji, sub, &subi); + if (kr != KERN_SUCCESS) + return kr; - ip_lock (objp); - rc = mac_check_service_access (&subjl, &objp->ip_label, serv, perm); - ip_unlock (objp); + objp = obji->ie_object; + subp = subi->ie_object; is_write_unlock (space); - mac_destroy_task_label (&subjl); + io_lock2 (objp, subp); + objl = io_getlabel (objp); + if (objl == NULL) + goto errout; + subl = io_getlabel (subp); + if (subl == NULL) + goto errout; + + rc = mac_check_service_access (subl, objl, serv, perm); + io_unlock2 (subp, objp); + if (rc == /*EINVAL*/ 22) return KERN_INVALID_ARGUMENT; else if (rc != 0) return KERN_NO_ACCESS; else return 0; + + errout: + io_unlock2 (subp, objp); + return KERN_INVALID_ARGUMENT; } ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/port.h#2 (text+ko) ==== @@ -192,7 +192,8 @@ #define MACH_PORT_RIGHT_SEND_ONCE ((mach_port_right_t) 2) #define MACH_PORT_RIGHT_PORT_SET ((mach_port_right_t) 3) #define MACH_PORT_RIGHT_DEAD_NAME ((mach_port_right_t) 4) -#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 5) +#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) +#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) typedef natural_t mach_port_type_t; typedef mach_port_type_t *mach_port_type_array_t; @@ -206,6 +207,7 @@ #define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE) #define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET) #define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME) +#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* Convenient combinations. */ ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/osfmk/mach/security.defs#2 (text+ko) ==== @@ -24,6 +24,8 @@ routine mach_get_task_label(task : task_t; out label : labelstr_t); +/* also works on label handles */ + routine mach_get_port_label(task : ipc_space_t; name : mach_port_name_t; out label : labelstr_t); @@ -45,3 +47,15 @@ object : mach_port_name_t; service : labelstr_t; perm : labelstr_t); + +/* Uses ports (or label handles) for both subject and object. */ + +routine mac_check_port_access(task : ipc_space_t; + subject : mach_port_name_t; + object : mach_port_name_t; + service : labelstr_t; + perm : labelstr_t); + +routine mac_label_new(task : ipc_space_t; + out name : mach_port_name_t; + label : labelstr_t); From owner-p4-projects@FreeBSD.ORG Thu Feb 5 07:38:33 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B90DE16A4D0; Thu, 5 Feb 2004 07:38:32 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9216616A4CE for ; Thu, 5 Feb 2004 07:38:32 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD95343D48 for ; Thu, 5 Feb 2004 07:38:30 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i15FcU0B046670 for ; Thu, 5 Feb 2004 07:38:30 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i15FcUfd046667 for perforce@freebsd.org; Thu, 5 Feb 2004 07:38:30 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Thu, 5 Feb 2004 07:38:30 -0800 (PST) Message-Id: <200402051538.i15FcUfd046667@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46538 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 15:38:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=46538 Change 46538 by jhb@jhb_blue on 2004/02/05 07:37:34 Shut this up. Affected files ... .. //depot/projects/smpng/sys/kern/subr_witness.c#112 edit Differences ... ==== //depot/projects/smpng/sys/kern/subr_witness.c#112 (text+ko) ==== @@ -483,7 +483,7 @@ witness_destroy(struct lock_object *lock) { struct witness *w; -#if 1 +#if 0 const char *name = NULL; #endif @@ -500,7 +500,7 @@ mtx_lock_spin(&w_mtx); MPASS(w->w_refcount > 0); w->w_refcount--; -#if 1 +#if 0 if (w->w_refcount == 0) name = w->w_name; #endif @@ -510,7 +510,7 @@ */ if (w->w_refcount != 0 || depart(w)) mtx_unlock_spin(&w_mtx); -#if 1 +#if 0 if (name != NULL) printf("dead witness: %s\n", w->w_name); #endif From owner-p4-projects@FreeBSD.ORG Thu Feb 5 12:26:20 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5B75E16A4D4; Thu, 5 Feb 2004 12:26:20 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E3A216A4D1 for ; Thu, 5 Feb 2004 12:26:20 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DAD343D75 for ; Thu, 5 Feb 2004 12:25:55 -0800 (PST) (envelope-from cvance@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i15KPT0B021950 for ; Thu, 5 Feb 2004 12:25:29 -0800 (PST) (envelope-from cvance@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i15KPTb8021947 for perforce@freebsd.org; Thu, 5 Feb 2004 12:25:29 -0800 (PST) (envelope-from cvance@nailabs.com) Date: Thu, 5 Feb 2004 12:25:29 -0800 (PST) Message-Id: <200402052025.i15KPTb8021947@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cvance@nailabs.com using -f From: Chris Vance To: Perforce Change Reviews Subject: PERFORCE change 46553 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 20:26:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=46553 Change 46553 by cvance@cvance_osx_laptop on 2004/02/05 12:24:59 add a label for lookupd Affected files ... .. //depot/projects/trustedbsd/sedarwin/policy/fc#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/policy/fc#3 (text+ko) ==== @@ -5,6 +5,7 @@ /usr/local/bin/.* system_u:object_r:bin_t /sbin/.* system_u:object_r:bin_t /usr/sbin/.* system_u:object_r:bin_t +/usr/sbin/lookupd system_u:object_r:lookupd_exec_t /Applications/.* system_u:object_r:appl_t /sbin/SystemStarter system_u:object_r:systemstarter_exec_t /System/Library/CoreServices/coreservicesd system_u:object_r:coreservices_exec_t From owner-p4-projects@FreeBSD.ORG Thu Feb 5 12:29:51 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AC14916A4D0; Thu, 5 Feb 2004 12:29:50 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5472916A4CF for ; Thu, 5 Feb 2004 12:29:50 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0E4843D41 for ; Thu, 5 Feb 2004 12:29:41 -0800 (PST) (envelope-from cvance@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i15KSX0B022095 for ; Thu, 5 Feb 2004 12:28:33 -0800 (PST) (envelope-from cvance@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i15KSXOY022092 for perforce@freebsd.org; Thu, 5 Feb 2004 12:28:33 -0800 (PST) (envelope-from cvance@nailabs.com) Date: Thu, 5 Feb 2004 12:28:33 -0800 (PST) Message-Id: <200402052028.i15KSXOY022092@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cvance@nailabs.com using -f From: Chris Vance To: Perforce Change Reviews Subject: PERFORCE change 46554 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 20:29:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=46554 Change 46554 by cvance@cvance_osx_laptop on 2004/02/05 12:28:31 Add a call to mac_create_vnode_extattr MAC entry point from hfs_makenode() Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/hfs/hfs_vnops.c#5 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/hfs/hfs_vnops.c#5 (text+ko) ==== @@ -3425,6 +3425,14 @@ goto exit; } } +#ifdef MAC + if (dvp->v_mount->mnt_flag & MNT_MULTILABEL) { + error = mac_create_vnode_extattr(cnp->cn_cred, dvp->v_mount, + dvp, tvp, cnp); + if (error) + goto exit; + } +#endif *vpp = tvp; exit: From owner-p4-projects@FreeBSD.ORG Thu Feb 5 14:21:27 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0F52A16A4D0; Thu, 5 Feb 2004 14:21:27 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB6BA16A4CE for ; Thu, 5 Feb 2004 14:21:26 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 272D743D46 for ; Thu, 5 Feb 2004 14:21:26 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i15MLP0B068643 for ; Thu, 5 Feb 2004 14:21:26 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i15MLPtK068637 for perforce@freebsd.org; Thu, 5 Feb 2004 14:21:25 -0800 (PST) (envelope-from sam@freebsd.org) Date: Thu, 5 Feb 2004 14:21:25 -0800 (PST) Message-Id: <200402052221.i15MLPtK068637@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 46566 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2004 22:21:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=46566 Change 46566 by sam@sam_ebb on 2004/02/05 14:20:33 didn't mean to submit this Affected files ... .. //depot/projects/netperf+sockets/sys/net80211/ieee80211_linux.o#2 delete Differences ... From owner-p4-projects@FreeBSD.ORG Fri Feb 6 04:12:26 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DF1EC16A4D0; Fri, 6 Feb 2004 04:12:25 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FDEF16A4CE for ; Fri, 6 Feb 2004 04:12:25 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D88D543D1D for ; Fri, 6 Feb 2004 04:12:17 -0800 (PST) (envelope-from cvance@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i16CCH0B075901 for ; Fri, 6 Feb 2004 04:12:17 -0800 (PST) (envelope-from cvance@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i16CCHQ9075898 for perforce@freebsd.org; Fri, 6 Feb 2004 04:12:17 -0800 (PST) (envelope-from cvance@nailabs.com) Date: Fri, 6 Feb 2004 04:12:17 -0800 (PST) Message-Id: <200402061212.i16CCHQ9075898@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cvance@nailabs.com using -f From: Chris Vance To: Perforce Change Reviews Subject: PERFORCE change 46580 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2004 12:12:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=46580 Change 46580 by cvance@cvance_sony on 2004/02/06 04:12:15 Copy modifications from the SEBSD branch - allow the -Z flag to work without requiring the long output format. Affected files ... .. //depot/projects/trustedbsd/mac/bin/ls/ls.c#28 edit .. //depot/projects/trustedbsd/mac/bin/ls/print.c#20 edit Differences ... ==== //depot/projects/trustedbsd/mac/bin/ls/ls.c#28 (text+ko) ==== @@ -368,7 +368,7 @@ * information, unless in color mode in which case we do * need this to determine which colors to display. */ - if (!f_inode && !f_longform && !f_size && !f_timesort && !f_type + if (!f_inode && !f_longform && !f_size && !f_timesort && !f_type && !f_label #ifdef COLORLS && !f_color #endif @@ -421,7 +421,7 @@ } /* Select a print function. */ - if (f_singlecol) + if (f_singlecol || (f_label && !f_longform)) printfcn = printscol; else if (f_longform) printfcn = printlong; @@ -547,7 +547,7 @@ if (list == NULL) return; - needstats = f_inode || f_longform || f_size; + needstats = f_inode || f_longform || f_size || f_label; flen = 0; btotal = 0; initmax = getenv("LS_COLWIDTHS"); @@ -673,7 +673,7 @@ maxsize = sp->st_size; btotal += sp->st_blocks; - if (f_longform) { + if (f_longform || f_label) { if (f_numericonly) { (void)snprintf(nuser, sizeof(nuser), "%u", sp->st_uid); @@ -812,7 +812,7 @@ printfcn(&d); output = 1; - if (f_longform) + if (f_longform || f_label) for (cur = list; cur; cur = cur->fts_link) free(cur->fts_pointer); } ==== //depot/projects/trustedbsd/mac/bin/ls/print.c#20 (text+ko) ==== @@ -65,7 +65,7 @@ #include "ls.h" #include "extern.h" -static int printaname(const FTSENT *, u_long, u_long); +static int printaname(const FTSENT *, u_long, u_long, u_long); static void printlink(const FTSENT *); static void printtime(time_t); static int printtype(u_int); @@ -135,7 +135,7 @@ for (p = dp->list; p; p = p->fts_link) { if (IS_NOPRINT(p)) continue; - (void)printaname(p, dp->s_inode, dp->s_block); + (void)printaname(p, dp->s_label, dp->s_inode, dp->s_block); (void)putchar('\n'); } } @@ -248,7 +248,7 @@ putchar('\n'); chcnt = 0; } - chcnt += printaname(p, dp->s_inode, dp->s_block); + chcnt += printaname(p, dp->s_label, dp->s_inode, dp->s_block); if (p->fts_link) { printf(", "); chcnt += 2; @@ -327,8 +327,8 @@ if (!f_sortacross) base = row; for (col = 0, chcnt = 0; col < numcols; ++col) { - chcnt += printaname(array[base], dp->s_inode, - dp->s_block); + chcnt += printaname(array[base], dp->s_label, + dp->s_inode, dp->s_block); if (f_sortacross) base++; else @@ -353,9 +353,11 @@ * return # of characters printed, no trailing characters. */ static int -printaname(const FTSENT *p, u_long inodefield, u_long sizefield) +printaname(const FTSENT *p, u_long labelfield, u_long inodefield, + u_long sizefield) { struct stat *sp; + NAMES *np; int chcnt; #ifdef COLORLS int color_printed = 0; @@ -363,6 +365,10 @@ sp = p->fts_statp; chcnt = 0; + if (f_label) { + np = p->fts_pointer; + chcnt += printf("%-*s ", (int)labelfield, np->label); + } if (f_inode) chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino); if (f_size) From owner-p4-projects@FreeBSD.ORG Fri Feb 6 10:23:36 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 79E7216A4D0; Fri, 6 Feb 2004 10:23:36 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51EC816A4CE for ; Fri, 6 Feb 2004 10:23:36 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D820243D2F for ; Fri, 6 Feb 2004 10:23:32 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i16INW0B097117 for ; Fri, 6 Feb 2004 10:23:32 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i16INWlg097114 for perforce@freebsd.org; Fri, 6 Feb 2004 10:23:32 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Fri, 6 Feb 2004 10:23:32 -0800 (PST) Message-Id: <200402061823.i16INWlg097114@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46589 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2004 18:23:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=46589 Change 46589 by jhb@jhb_slimer on 2004/02/06 10:23:08 IFC @46586. Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/db_interface.c#4 integrate .. //depot/projects/smpng/sys/amd64/amd64/pmap.c#22 integrate .. //depot/projects/smpng/sys/amd64/conf/NOTES#1 branch .. //depot/projects/smpng/sys/amd64/isa/isa_dma.c#4 integrate .. //depot/projects/smpng/sys/boot/i386/Makefile.inc#4 integrate .. //depot/projects/smpng/sys/boot/i386/boot0/Makefile#7 integrate .. //depot/projects/smpng/sys/boot/i386/boot2/Makefile#12 integrate .. //depot/projects/smpng/sys/boot/i386/cdboot/Makefile#3 integrate .. //depot/projects/smpng/sys/boot/i386/loader/Makefile#13 integrate .. //depot/projects/smpng/sys/boot/i386/mbr/Makefile#4 integrate .. //depot/projects/smpng/sys/boot/i386/pxeldr/Makefile#5 integrate .. //depot/projects/smpng/sys/conf/files#101 integrate .. //depot/projects/smpng/sys/conf/files.amd64#12 integrate .. //depot/projects/smpng/sys/conf/kern.post.mk#33 integrate .. //depot/projects/smpng/sys/dev/aac/aac_debug.c#12 integrate .. //depot/projects/smpng/sys/dev/aic7xxx/aicasm/Makefile#8 integrate .. //depot/projects/smpng/sys/dev/ata/ata-queue.c#8 integrate .. //depot/projects/smpng/sys/dev/ath/if_ath.c#15 integrate .. //depot/projects/smpng/sys/dev/patm/genrtab/Makefile#2 integrate .. //depot/projects/smpng/sys/dev/sab/sab.c#14 integrate .. //depot/projects/smpng/sys/dev/safe/safe.c#4 integrate .. //depot/projects/smpng/sys/dev/syscons/syscons.c#34 integrate .. //depot/projects/smpng/sys/dev/usb/umass.c#35 integrate .. //depot/projects/smpng/sys/dev/vinum/vinumconfig.c#18 integrate .. //depot/projects/smpng/sys/dev/zs/zs.c#11 integrate .. //depot/projects/smpng/sys/i386/conf/NOTES#76 integrate .. //depot/projects/smpng/sys/i386/i386/db_interface.c#22 integrate .. //depot/projects/smpng/sys/i386/isa/pcvt/pcvt_drv.c#12 integrate .. //depot/projects/smpng/sys/i386/isa/pcvt/pcvt_ext.c#12 integrate .. //depot/projects/smpng/sys/i386/isa/pcvt/pcvt_hdr.h#5 integrate .. //depot/projects/smpng/sys/kern/kern_fork.c#72 integrate .. //depot/projects/smpng/sys/kern/kern_idle.c#18 integrate .. //depot/projects/smpng/sys/kern/kern_resource.c#41 integrate .. //depot/projects/smpng/sys/kern/sysv_shm.c#21 integrate .. //depot/projects/smpng/sys/kern/tty_cons.c#23 integrate .. //depot/projects/smpng/sys/kern/uipc_mbuf.c#26 integrate .. //depot/projects/smpng/sys/netipsec/key.c#7 integrate .. //depot/projects/smpng/sys/sys/cons.h#7 integrate .. //depot/projects/smpng/sys/sys/resourcevar.h#15 integrate .. //depot/projects/smpng/sys/tools/emu10k1-mkalsa.sh#1 branch .. //depot/projects/smpng/sys/vm/vm_fault.c#32 integrate .. //depot/projects/smpng/sys/vm/vm_map.c#55 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/db_interface.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_interface.c,v 1.75 2003/11/17 08:58:12 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_interface.c,v 1.77 2004/02/05 17:35:28 kan Exp $"); /* * Interface to new debugger. @@ -87,7 +87,7 @@ * our breakpoints by disarming our breakpoints and fixing up * %eip. */ - if (cons_unavail && ddb_mode) { + if (cnunavailable() != 0 && ddb_mode) { if (type == T_TRCTRAP) { regs->tf_rflags &= ~PSL_T; return (1); @@ -327,7 +327,7 @@ * OK if the call is for the debugger hotkey but not if the call * is a weak form of panicing. */ - if (cons_unavail && !(boothowto & RB_GDB)) + if (cnunavailable() != 0 && !(boothowto & RB_GDB)) return; if (atomic_cmpset_acq_int(&in_Debugger, 0, 1)) { ==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#22 (text+ko) ==== @@ -75,7 +75,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.451 2004/01/30 00:24:45 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.452 2004/02/05 00:11:05 peter Exp $"); /* * Manages physical address maps. @@ -1637,7 +1637,7 @@ #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified((pt_entry_t) oldpte)) { printf( - "pmap_remove: modified page not writable: va: 0x%x, pte: 0x%x\n", + "pmap_remove: modified page not writable: va: 0x%lx, pte: 0x%lx\n", va, oldpte); } #endif @@ -1782,7 +1782,7 @@ * XXX This makes pmap_remove_all() illegal for non-managed pages! */ if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) { - panic("pmap_remove_all: illegal for unmanaged page, va: 0x%x", + panic("pmap_remove_all: illegal for unmanaged page, va: 0x%lx", VM_PAGE_TO_PHYS(m)); } #endif @@ -1804,7 +1804,7 @@ #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified((pt_entry_t) tpte)) { printf( - "pmap_remove_all: modified page not writable: va: 0x%x, pte: 0x%x\n", + "pmap_remove_all: modified page not writable: va: 0x%lx, pte: 0x%lx\n", pv->pv_va, tpte); } #endif @@ -1942,7 +1942,7 @@ if (va > VM_MAX_KERNEL_ADDRESS) panic("pmap_enter: toobig"); if ((va >= UPT_MIN_ADDRESS) && (va < UPT_MAX_ADDRESS)) - panic("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)", va); + panic("pmap_enter: invalid to pmap_enter page table pages (va: 0x%lx)", va); #endif mpte = NULL; @@ -1997,7 +1997,7 @@ #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified((pt_entry_t) origpte)) { printf( - "pmap_enter: modified page not writable: va: 0x%x, pte: 0x%x\n", + "pmap_enter: modified page not writable: va: 0x%lx, pte: 0x%lx\n", va, origpte); } #endif @@ -2631,7 +2631,7 @@ continue; #if defined(PMAP_DIAGNOSTIC) if (!pv->pv_pmap) { - printf("Null pmap (tb) at va: 0x%x\n", pv->pv_va); + printf("Null pmap (tb) at va: 0x%lx\n", pv->pv_va); continue; } #endif @@ -2697,7 +2697,7 @@ #if defined(PMAP_DIAGNOSTIC) if (!pv->pv_pmap) { - printf("Null pmap (cb) at va: 0x%x\n", pv->pv_va); + printf("Null pmap (cb) at va: 0x%lx\n", pv->pv_va); continue; } #endif ==== //depot/projects/smpng/sys/amd64/isa/isa_dma.c#4 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/isa/isa_dma.c,v 1.16 2003/11/21 03:02:00 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/isa_dma.c,v 1.17 2004/02/05 00:12:08 peter Exp $"); /* * code to manage AT bus @@ -228,7 +228,7 @@ panic("isa_dmastart: channel out of range"); if ((chan < 4 && nbytes > (1<<16)) - || (chan >= 4 && (nbytes > (1<<17) || (u_int)addr & 1))) + || (chan >= 4 && (nbytes > (1<<17) || (uintptr_t)addr & 1))) panic("isa_dmastart: impossible request"); if ((dma_inuse & (1 << chan)) == 0) ==== //depot/projects/smpng/sys/boot/i386/Makefile.inc#4 (text+ko) ==== @@ -1,6 +1,8 @@ # Common defines for all of /sys/boot/i386/ # -# $FreeBSD: src/sys/boot/i386/Makefile.inc,v 1.4 2003/06/26 03:51:57 peter Exp $ +# $FreeBSD: src/sys/boot/i386/Makefile.inc,v 1.6 2004/02/06 12:58:31 ru Exp $ + +BINDIR?= /boot LOADER_ADDRESS?= 0x200000 CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 @@ -9,8 +11,7 @@ .MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true .endif -.if defined(REALLY_AMD64) && !defined(__been_to_Makefile_inc) -__been_to_Makefile_inc= 1 +.if defined(REALLY_AMD64) CFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 ==== //depot/projects/smpng/sys/boot/i386/boot0/Makefile#7 (text+ko) ==== @@ -1,9 +1,8 @@ -# $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.20 2004/01/06 18:46:35 obrien Exp $ +# $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.21 2004/02/06 12:58:31 ru Exp $ PROG?= boot0 NOMAN= STRIP= -BINDIR?= /boot BINMODE= 444 M4?= m4 ==== //depot/projects/smpng/sys/boot/i386/boot2/Makefile#12 (text+ko) ==== @@ -1,9 +1,8 @@ -# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.47 2003/06/26 03:51:57 peter Exp $ +# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.48 2004/02/06 12:58:31 ru Exp $ PROG= boot2 NOMAN= STRIP= -BINDIR?= /boot BINMODE= 444 CLEANFILES= boot boot1 boot1.out boot1.o \ boot2.ldr boot2.bin boot2.ld boot2.out boot2.o boot2.h \ ==== //depot/projects/smpng/sys/boot/i386/cdboot/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/i386/cdboot/Makefile,v 1.5 2002/09/17 01:48:55 peter Exp $ +# $FreeBSD: src/sys/boot/i386/cdboot/Makefile,v 1.6 2004/02/06 12:58:31 ru Exp $ MAINTAINER=jhb@FreeBSD.org @@ -7,7 +7,6 @@ PROG= cdboot NOMAN= STRIP= -BINDIR?= /boot ${PROG}: ${PROG}.o ${LD} -N -e start -Ttext ${ORG} -o ${PROG}.out ${PROG}.o ==== //depot/projects/smpng/sys/boot/i386/loader/Makefile#13 (text+ko) ==== @@ -1,9 +1,8 @@ -# $FreeBSD: src/sys/boot/i386/loader/Makefile,v 1.66 2003/06/26 03:51:57 peter Exp $ +# $FreeBSD: src/sys/boot/i386/loader/Makefile,v 1.68 2004/02/06 12:58:31 ru Exp $ PROG= loader STRIP= NEWVERSWHAT= "bootstrap loader" i386 -BINDIR?= /boot INSTALLFLAGS= -b # architecture-specific loader code @@ -41,7 +40,7 @@ # Always add MI sources .PATH: ${.CURDIR}/../../common -.include <${.CURDIR}/../../common/Makefile.inc> +.include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -I. @@ -109,8 +108,6 @@ FILES+= ${.CURDIR}/loader.rc .endif -.include <${.CURDIR}/../Makefile.inc> - # Cannot use ${OBJS} above this line .include ==== //depot/projects/smpng/sys/boot/i386/mbr/Makefile#4 (text+ko) ==== @@ -1,9 +1,8 @@ -# $FreeBSD: src/sys/boot/i386/mbr/Makefile,v 1.6 2002/09/17 01:48:55 peter Exp $ +# $FreeBSD: src/sys/boot/i386/mbr/Makefile,v 1.7 2004/02/06 12:58:32 ru Exp $ PROG= mbr NOMAN= STRIP= -BINDIR?= /boot BINMODE= 444 ORG= 0x600 ==== //depot/projects/smpng/sys/boot/i386/pxeldr/Makefile#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.9 2003/09/03 08:12:20 phk Exp $ +# $FreeBSD: src/sys/boot/i386/pxeldr/Makefile,v 1.10 2004/02/06 12:58:32 ru Exp $ MAINTAINER=jhb@FreeBSD.org @@ -10,7 +10,6 @@ PROG= ${BOOT} MAN= ${BOOT}.8 STRIP= -BINDIR?= /boot M4?= m4 .if defined(BOOT_PXELDR_PROBE_KEYBOARD) ==== //depot/projects/smpng/sys/conf/files#101 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.861 2004/01/15 10:04:20 onoe Exp $ +# $FreeBSD: src/sys/conf/files,v 1.862 2004/02/05 22:51:15 peter Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -35,6 +35,11 @@ compile-with "${AWK} -f $S/tools/devlist2h.awk $S/dev/mii/miidevs" \ no-obj no-implicit-rule \ clean "miidevs.h" +emu10k1-alsa%diked.h optional pcm pci \ + dependency "$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ + compile-with "CC=${CC} AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \ + no-obj no-implicit-rule before-depend \ + clean "emu10k1-alsa%diked.h" kern/device_if.m standard kern/bus_if.m standard kern/clock_if.m optional genclock @@ -719,8 +724,7 @@ dev/sound/pci/csamidi.c optional midi csa dev/sound/pci/csapcm.c optional pcm pci dev/sound/pci/ds1.c optional pcm pci -dev/sound/pci/emu10k1.c optional pcm pci dependency "emu10k1-alsa%diked.h" \ - clean "emu10k1-alsa%diked.h" +dev/sound/pci/emu10k1.c optional pcm pci dependency "emu10k1-alsa%diked.h" dev/sound/pci/es137x.c optional pcm pci dev/sound/pci/fm801.c optional pcm pci dev/sound/pci/ich.c optional pcm pci ==== //depot/projects/smpng/sys/conf/files.amd64#12 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.amd64,v 1.27 2003/12/11 01:09:51 peter Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.28 2004/02/05 01:09:29 peter Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -70,6 +70,10 @@ amd64/isa/nmi.c standard amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci +crypto/blowfish/bf_enc.c optional ipsec ipsec_esp +crypto/des/des_enc.c optional ipsec ipsec_esp +crypto/blowfish/bf_enc.c optional crypto +crypto/des/des_enc.c optional crypto dev/fb/fb.c optional fb dev/fb/fb.c optional vga dev/fb/splash.c optional splash ==== //depot/projects/smpng/sys/conf/kern.post.mk#33 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/kern.post.mk,v 1.60 2004/01/21 08:23:46 ru Exp $ +# $FreeBSD: src/sys/conf/kern.post.mk,v 1.61 2004/02/05 22:51:15 peter Exp $ # Part of a unified Makefile for building kernels. This part includes all # the definitions that need to be after all the % directives except %RULES @@ -224,15 +224,6 @@ vnode_if.h: $S/tools/vnode_if.awk $S/kern/vnode_if.src ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -h -emu10k1-alsa%diked.h: $S/gnu/dev/sound/pci/emu10k1-alsa.h - grep -v '#include' ${.OODATE} | ${CC} -E -D__KERNEL__ -dM - \ - | awk -F"[ (]" '/define/ \ - { print "#ifndef " $$2 ; print ; print "#endif" }' \ - >${.TARGET} -.if !exists(${.OBJDIR}/.depend) -_kernel-depend: emu10k1-alsa%diked.h -.endif - # XXX strictly, everything depends on Makefile because changes to ${PROF} # only appear there, but we don't handle that. ==== //depot/projects/smpng/sys/dev/aac/aac_debug.c#12 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aac/aac_debug.c,v 1.16 2003/08/24 17:48:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aac/aac_debug.c,v 1.17 2004/02/06 01:47:52 peter Exp $"); /* * Debugging support. @@ -371,8 +371,8 @@ device_printf(sc->aac_dev, "(DiskSetEvent) event %d " "diskset %lld creator %lld\n", aif->data.EN.data.EDS.eventType, - aif->data.EN.data.EDS.DsNum, - aif->data.EN.data.EDS.CreatorId); + (long long)aif->data.EN.data.EDS.DsNum, + (long long)aif->data.EN.data.EDS.CreatorId); break; case AifDenMorphComplete: /* A morph operation * completed */ ==== //depot/projects/smpng/sys/dev/aic7xxx/aicasm/Makefile#8 (text+ko) ==== @@ -1,6 +1,6 @@ # $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aicasm/Makefile#2 $ # -# $FreeBSD: src/sys/dev/aic7xxx/aicasm/Makefile,v 1.16 2002/09/26 21:46:19 gibbs Exp $ +# $FreeBSD: src/sys/dev/aic7xxx/aicasm/Makefile,v 1.17 2004/02/05 22:44:24 ru Exp $ PROG= aicasm @@ -12,8 +12,8 @@ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS} CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g} -DPADD+= ${LIBL} -LDADD+= -ll +DPADD= ${LIBL} +LDADD= -ll # Correct path for kernel builds # Don't rely on the kernel's .depend file ==== //depot/projects/smpng/sys/dev/ata/ata-queue.c#8 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.19 2004/01/30 19:16:08 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.20 2004/02/06 11:36:50 sos Exp $"); #include "opt_ata.h" #include @@ -118,6 +118,7 @@ request->u.ata.feature = feature; request->flags = ATA_R_CONTROL; request->timeout = 5; + request->retries = -1; ata_queue_request(request); error = request->result; ata_free_request(request); ==== //depot/projects/smpng/sys/dev/ath/if_ath.c#15 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.44 2004/01/07 19:16:49 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.45 2004/02/06 00:10:54 peter Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -1387,8 +1387,8 @@ goto fail1; ds = sc->sc_desc; - DPRINTF(ATH_DEBUG_ANY, ("%s: DMA map: %p (%d) -> %p (%lu)\n", - __func__, ds, sc->sc_desc_len, (caddr_t) sc->sc_desc_paddr, + DPRINTF(ATH_DEBUG_ANY, ("%s: DMA map: %p (%lu) -> %p (%lu)\n", + __func__, ds, (u_long) sc->sc_desc_len, (caddr_t) sc->sc_desc_paddr, /*XXX*/ (u_long) sc->sc_desc_len)); /* allocate buffers */ @@ -2157,7 +2157,7 @@ DPRINTF(ATH_DEBUG_TX_PROC, ("%s: pending %u tx queue %p, link %p\n", __func__, npending, - (caddr_t) ath_hal_gettxbuf(sc->sc_ah, sc->sc_txhalq), + (caddr_t)(uintptr_t) ath_hal_gettxbuf(sc->sc_ah, sc->sc_txhalq), sc->sc_txlink)); for (;;) { ATH_TXQ_LOCK(sc); @@ -2249,12 +2249,12 @@ (void) ath_hal_stoptxdma(ah, sc->sc_txhalq); DPRINTF(ATH_DEBUG_RESET, ("%s: tx queue %p, link %p\n", __func__, - (caddr_t) ath_hal_gettxbuf(ah, sc->sc_txhalq), + (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, sc->sc_txhalq), sc->sc_txlink)); (void) ath_hal_stoptxdma(ah, sc->sc_bhalq); DPRINTF(ATH_DEBUG_RESET, ("%s: beacon queue %p\n", __func__, - (caddr_t) ath_hal_gettxbuf(ah, sc->sc_bhalq))); + (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, sc->sc_bhalq))); } for (;;) { ATH_TXQ_LOCK(sc); @@ -2310,7 +2310,7 @@ struct ath_buf *bf; printf("%s: rx queue %p, link %p\n", __func__, - (caddr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink); + (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink); TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { struct ath_desc *ds = bf->bf_desc; if (ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, ==== //depot/projects/smpng/sys/dev/patm/genrtab/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/dev/patm/genrtab/Makefile,v 1.1 2003/07/15 11:57:24 harti Exp $ +# $FreeBSD: src/sys/dev/patm/genrtab/Makefile,v 1.2 2004/02/05 22:01:28 ru Exp $ # # This program is used to generate the if_patm_rtables.c file # for the idt77252 driver. It is not installed. @@ -6,6 +6,7 @@ PROG=genrtab WARNS=5 NOMAN=true +DPADD=${LIBM} LDADD=-lm install: ==== //depot/projects/smpng/sys/dev/sab/sab.c#14 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/sab/sab.c,v 1.21 2003/11/09 09:17:22 tanimura Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sab/sab.c,v 1.22 2004/02/05 09:50:57 pjd Exp $"); /* * SAB82532 Dual UART driver @@ -646,7 +646,7 @@ if ((tp->t_state & TS_ISOPEN) != 0 && (tp->t_state & TS_XCLUDE) != 0 && - !suser(td)) + suser(td) != 0) return (EBUSY); if ((tp->t_state & TS_ISOPEN) == 0) { ==== //depot/projects/smpng/sys/dev/safe/safe.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/safe/safe.c,v 1.4 2003/08/22 07:04:09 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/safe/safe.c,v 1.5 2004/02/05 01:35:33 peter Exp $"); /* * SafeNet SafeXcel-1141 hardware crypto accelerator @@ -2103,11 +2103,11 @@ u_int32_t estat = READ_REG(sc, SAFE_PE_ERNGSTAT); /* NB: assume caller has lock on ring */ - printf("%s: ERNGSTAT %x (next %u) back %u front %u\n", + printf("%s: ERNGSTAT %x (next %u) back %lu front %lu\n", tag, estat, (estat >> SAFE_PE_ERNGSTAT_NEXT_S), - sc->sc_back - sc->sc_ring, - sc->sc_front - sc->sc_ring); + (unsigned long)(sc->sc_back - sc->sc_ring), + (unsigned long)(sc->sc_front - sc->sc_ring)); } static void @@ -2131,7 +2131,7 @@ for (nsegs = re->re_src.nsegs; nsegs; nsegs--) { printf(" spd[%u] %p: %p size %u flags %x" , ix, &sc->sc_spring[ix] - , (caddr_t) sc->sc_spring[ix].pd_addr + , (caddr_t)(uintptr_t) sc->sc_spring[ix].pd_addr , sc->sc_spring[ix].pd_size , sc->sc_spring[ix].pd_flags ); @@ -2148,7 +2148,7 @@ for (nsegs = re->re_dst.nsegs; nsegs; nsegs--) { printf(" dpd[%u] %p: %p flags %x\n" , ix, &sc->sc_dpring[ix] - , (caddr_t) sc->sc_dpring[ix].pd_addr + , (caddr_t)(uintptr_t) sc->sc_dpring[ix].pd_addr , sc->sc_dpring[ix].pd_flags ); if (++ix == SAFE_TOTAL_DPART) ==== //depot/projects/smpng/sys/dev/syscons/syscons.c#34 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/syscons/syscons.c,v 1.410 2004/01/21 05:08:51 grehan Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/syscons/syscons.c,v 1.411 2004/02/05 01:56:42 kan Exp $"); #include "opt_syscons.h" #include "opt_splash.h" @@ -97,6 +97,7 @@ static int sc_saver_keyb_only = 1; static scr_stat *sc_console; static struct tty *sc_console_tty; +static struct consdev *sc_consptr; static void *kernel_console_ts; static char init_done = COLD; @@ -526,7 +527,7 @@ DPRINTF(5, ("sc%d: scclose(), ", scp->sc->unit)); s = spltty(); if ((scp == scp->sc->cur_scp) && (scp->sc->unit == sc_console_unit)) - cons_unavail = FALSE; + cnavailable(sc_consptr, TRUE); if (finish_vt_rel(scp, TRUE, &s) == 0) /* force release */ DPRINTF(5, ("reset WAIT_REL, ")); if (finish_vt_acq(scp) == 0) /* force acknowledge */ @@ -927,7 +928,7 @@ scp->pid = 0; DPRINTF(5, ("VT_AUTO, ")); if ((scp == sc->cur_scp) && (sc->unit == sc_console_unit)) - cons_unavail = FALSE; + cnavailable(sc_consptr, TRUE); /* were we in the middle of the vty switching process? */ if (finish_vt_rel(scp, TRUE, &s) == 0) DPRINTF(5, ("reset WAIT_REL, ")); @@ -945,7 +946,7 @@ scp->proc = td->td_proc; scp->pid = scp->proc->p_pid; if ((scp == sc->cur_scp) && (sc->unit == sc_console_unit)) - cons_unavail = TRUE; + cnavailable(sc_consptr, FALSE); } splx(s); DPRINTF(5, ("\n")); @@ -1419,6 +1420,7 @@ scinit(unit, flags | SC_KERNEL_CONSOLE); sc_console_unit = unit; sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]); + sc_consptr = cp; #endif /* !__alpha__ */ #if __alpha__ @@ -1474,6 +1476,7 @@ scinit(unit, flags | SC_KERNEL_CONSOLE); sc_console_unit = unit; + sc_consptr = &consdev; sc_console = SC_STAT(sc_get_softc(unit, SC_KERNEL_CONSOLE)->dev[0]); sprintf(consdev.cn_name, "ttyv%r", 0); cnadd(&consdev); @@ -2356,7 +2359,7 @@ sc->switch_in_progress = 0; if (sc->unit == sc_console_unit) - cons_unavail = FALSE; + cnavailable(sc_consptr, TRUE); splx(s); DPRINTF(5, ("switch done\n")); @@ -2378,7 +2381,7 @@ if (!signal_vt_acq(sc->cur_scp)) { sc->switch_in_progress = 0; if (sc->unit == sc_console_unit) - cons_unavail = FALSE; + cnavailable(sc_consptr, TRUE); } return s; @@ -2420,7 +2423,7 @@ if (scp->smode.mode != VT_PROCESS) return FALSE; if (scp->sc->unit == sc_console_unit) - cons_unavail = TRUE; + cnavailable(sc_consptr, FALSE); scp->status |= SWITCH_WAIT_ACQ; PROC_LOCK(scp->proc); psignal(scp->proc, scp->smode.acqsig); ==== //depot/projects/smpng/sys/dev/usb/umass.c#35 (text+ko) ==== @@ -24,10 +24,17 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/usb/umass.c,v 1.102 2004/02/02 14:58:14 sanpei Exp $ + * $FreeBSD: src/sys/dev/usb/umass.c,v 1.103 2004/02/06 14:38:14 sanpei Exp $ * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ */ +/* Also already merged from NetBSD: + * $NetBSD: umass.c,v 1.67 2001/11/25 19:05:22 augustss Exp $ + * $NetBSD: umass.c,v 1.90 2002/11/04 19:17:33 pooka Exp $ + * $NetBSD: umass.c,v 1.108 2003/11/07 17:03:25 wiz Exp $ + * $NetBSD: umass.c,v 1.109 2003/12/04 13:57:31 keihan Exp $ + */ + /* * Universal Serial Bus Mass Storage Class specs: * http://www.usb.org/developers/devclass_docs/usb_msc_overview_1.2.pdf @@ -37,8 +44,8 @@ */ /* - * Ported to NetBSD by Lennart Augustsson . - * Parts of the code written my Jason R. Thorpe . + * Ported to NetBSD by Lennart Augustsson . + * Parts of the code written by Jason R. Thorpe . */ /* ==== //depot/projects/smpng/sys/dev/vinum/vinumconfig.c#18 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/vinum/vinumconfig.c,v 1.63 2003/12/15 00:44:05 grog Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/vinum/vinumconfig.c,v 1.64 2004/02/04 22:29:52 le Exp $"); #define STATIC static @@ -1281,7 +1281,9 @@ int namedplexno; enum plexstate state = plex_init; /* state to set at end */ int preferme; /* set if we want to be preferred access */ + int stripesize; + stripesize = 0; current_plex = -1; /* forget the previous plex */ preferme = 0; /* nothing special yet */ plexno = get_empty_plex(); /* allocate a plex */ @@ -1339,52 +1341,53 @@ case kw_striped: { - int stripesize = sizespec(token[++parameter]); + plex->organization = plex_striped; - plex->organization = plex_striped; - if (stripesize % DEV_BSIZE != 0) /* not a multiple of block size, */ - throw_rude_remark(EINVAL, "plex %s: stripe size %d not a multiple of sector size", - plex->name, - stripesize); + if (++parameter >= tokens) /* No stripe size specified. */ + stripesize = 0; else - plex->stripesize = stripesize / DEV_BSIZE; + stripesize = sizespec(token[parameter]); + break; } case kw_raid4: { - int stripesize = sizespec(token[++parameter]); + plex->organization = plex_raid4; - plex->organization = plex_raid4; - if (stripesize % DEV_BSIZE != 0) /* not a multiple of block size, */ - throw_rude_remark(EINVAL, "plex %s: stripe size %d not a multiple of sector size", - plex->name, - stripesize); + if (++parameter >= tokens) /* No stripe size specified. */ + stripesize = 0; else - plex->stripesize = stripesize / DEV_BSIZE; + stripesize = sizespec(token[parameter]); + break; } case kw_raid5: { - int stripesize = sizespec(token[++parameter]); + plex->organization = plex_raid5; - plex->organization = plex_raid5; - if (stripesize % DEV_BSIZE != 0) /* not a multiple of block size, */ - throw_rude_remark(EINVAL, "plex %s: stripe size %d not a multiple of sector size", - plex->name, - stripesize); + if (++parameter >= tokens) /* No stripe size specified. */ + stripesize = 0; else - plex->stripesize = stripesize / DEV_BSIZE; + stripesize = sizespec(token[parameter]); + break; } default: throw_rude_remark(EINVAL, "Invalid plex organization"); } - if (isstriped(plex) - && (plex->stripesize == 0)) /* didn't specify a valid stripe size */ - throw_rude_remark(EINVAL, "Need a stripe size parameter"); + if (isstriped(plex)) { + if (stripesize == 0) /* didn't specify a valid stripe size */ + throw_rude_remark(EINVAL, "Need a stripe size parameter"); + else if (stripesize % DEV_BSIZE != 0) + throw_rude_remark(EINVAL, "plex %s: stripe size %d not a multiple of sector size", + plex->name, + stripesize); + else + plex->stripesize = stripesize / DEV_BSIZE; + } break; /* ==== //depot/projects/smpng/sys/dev/zs/zs.c#11 (text+ko) ==== @@ -44,7 +44,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/zs/zs.c,v 1.15 2003/11/09 09:17:23 tanimura Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/zs/zs.c,v 1.16 2004/02/05 09:49:35 pjd Exp $"); /*- * Copyright (c) 2003 Jake Burkholder. * All rights reserved. @@ -465,7 +465,7 @@ if ((tp->t_state & TS_ISOPEN) != 0 && (tp->t_state & TS_XCLUDE) != 0 && - !suser(td)) + suser(td) != 0) return (EBUSY); if ((tp->t_state & TS_ISOPEN) == 0) { ==== //depot/projects/smpng/sys/i386/conf/NOTES#76 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1122 2004/01/29 21:07:54 schweikh Exp $ +# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1123 2004/02/05 13:02:14 rik Exp $ # # @@ -492,7 +492,8 @@ # ar: Arnet SYNC/570i hdlc sync 2/4 port V.35/X.21 serial driver # (requires sppp) # ath: Atheros a/b/g WiFi adapters (requires ath_hal and wlan) -# cx: Cronyx/Sigma multiport sync/async (with Cisco or PPP framing) +# cx: Cronyx/Sigma multiport sync/async adapter (requires sppp or NETGRAPH, +# depends on NETGRAPH_CRONYX option) # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 # HP PC Lan+, various PC Card devices (refer to etc/defaults/pccard.conf) # (requires miibus) @@ -524,6 +525,7 @@ hint.cx.0.port="0x240" hint.cx.0.irq="15" hint.cx.0.drq="7" +#options NETGRAPH_CRONYX # Enable NETGRAPH support for Cronyx adapter(s) device ed #options ED_NO_MIIBUS # Disable ed miibus support hint.ed.0.at="isa" ==== //depot/projects/smpng/sys/i386/i386/db_interface.c#22 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/db_interface.c,v 1.77 2003/11/08 03:01:26 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/db_interface.c,v 1.79 2004/02/05 17:35:28 kan Exp $"); /* * Interface to new debugger. @@ -90,7 +90,7 @@ * our breakpoints by disarming our breakpoints and fixing up * %eip. */ - if (cons_unavail && ddb_mode) { + if (cnunavailable() != 0 && ddb_mode) { if (type == T_TRCTRAP) { regs->tf_eflags &= ~PSL_T; return (1); @@ -320,7 +320,7 @@ * OK if the call is for the debugger hotkey but not if the call * is a weak form of panicing. */ - if (cons_unavail && !(boothowto & RB_GDB)) + if (cnunavailable() != 0 && !(boothowto & RB_GDB)) return; if (atomic_cmpset_acq_int(&in_Debugger, 0, 1)) { ==== //depot/projects/smpng/sys/i386/isa/pcvt/pcvt_drv.c#12 (text+ko) ==== @@ -50,7 +50,7 @@ * * Last Edit-Date: [Sat Jul 15 15:06:06 2000] * - * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_drv.c,v 1.80 2003/09/26 08:51:54 phk Exp $ + * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_drv.c,v 1.81 2004/02/05 01:56:43 kan Exp $ * *---------------------------------------------------------------------------*/ @@ -673,6 +673,7 @@ int i; pcvt_is_console = 1; + pcvt_consptr = cp; /* * Don't reset the keyboard via `kbdio' just yet. ==== //depot/projects/smpng/sys/i386/isa/pcvt/pcvt_ext.c#12 (text+ko) ==== @@ -44,7 +44,7 @@ * * Last Edit-Date: [Fri Mar 8 19:57:55 2002] * - * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_ext.c,v 1.30 2004/01/07 10:12:59 joerg Exp $ + * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_ext.c,v 1.32 2004/02/05 10:02:20 roam Exp $ * *---------------------------------------------------------------------------*/ @@ -2385,7 +2385,7 @@ * process mode. */ if(pcvt_is_console) - cons_unavail = 0; + cnavailable(pcvt_consptr, TRUE); } } return 0; @@ -2470,7 +2470,7 @@ * process mode. */ if(pcvt_is_console) - cons_unavail = (newmode.mode == VT_PROCESS); + cnavailable(pcvt_consptr, (newmode.mode != VT_PROCESS)); splx(opri); return 0; @@ -2549,7 +2549,7 @@ /* XXX */ if(pcvt_is_console) - cons_unavail = 0; + cnavailable(pcvt_consptr, TRUE); } return 0; } @@ -2563,7 +2563,7 @@ /* XXX */ if(pcvt_is_console) - cons_unavail = 1; + cnavailable(pcvt_consptr, FALSE); return 0; } ==== //depot/projects/smpng/sys/i386/isa/pcvt/pcvt_hdr.h#5 (text+ko) ==== @@ -41,7 +41,7 @@ * * Last Edit-Date: [Wed Apr 5 18:21:32 2000] * - * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_hdr.h,v 1.48 2003/07/27 14:01:33 robert Exp $ + * $FreeBSD: src/sys/i386/isa/pcvt/pcvt_hdr.h,v 1.49 2004/02/05 01:56:43 kan Exp $ * *---------------------------------------------------------------------------*/ @@ -763,6 +763,7 @@ u_char kbd_polling = 0; /* keyboard is being polled */ u_char reset_keyboard = 0; /* OK to reset keyboard */ keyboard_t *kbd = NULL; +struct consdev *pcvt_consptr = NULL; #if PCVT_SHOWKEYS u_char keyboard_show = 0; /* normal display */ @@ -899,6 +900,7 @@ extern u_char kbd_polling; extern u_char reset_keyboard; extern keyboard_t *kbd; +extern struct consdev *pcvt_consptr; #if PCVT_SHOWKEYS extern u_char keyboard_show; ==== //depot/projects/smpng/sys/kern/kern_fork.c#72 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.213 2004/02/04 21:52:55 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.214 2004/02/05 21:01:37 jhb Exp $"); >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Feb 6 11:33:08 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2B05F16A4D0; Fri, 6 Feb 2004 11:33:08 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05E0416A4CE for ; Fri, 6 Feb 2004 11:33:08 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DEA343D4C for ; Fri, 6 Feb 2004 11:33:03 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i16JX30B013071 for ; Fri, 6 Feb 2004 11:33:03 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i16JX25t013068 for perforce@freebsd.org; Fri, 6 Feb 2004 11:33:02 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Fri, 6 Feb 2004 11:33:02 -0800 (PST) Message-Id: <200402061933.i16JX25t013068@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46597 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2004 19:33:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=46597 Change 46597 by jhb@jhb_slimer on 2004/02/06 11:32:38 Loop back limit merges. Affected files ... .. //depot/projects/smpng/sys/kern/kern_resource.c#42 integrate .. //depot/projects/smpng/sys/sys/resourcevar.h#16 integrate Differences ... ==== //depot/projects/smpng/sys/kern/kern_resource.c#42 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.130 2004/02/05 20:53:24 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.132 2004/02/06 19:30:12 jhb Exp $"); #include "opt_compat.h" @@ -184,7 +184,6 @@ /* * MPSAFE */ -/* ARGSUSED */ int setpriority(td, uap) struct thread *td; @@ -267,8 +266,8 @@ /* * Set "nice" for a process. Doesn't really understand threaded processes * well but does try. Has the unfortunate side effect of making all the NICE - * values for a process's ksegrps the same.. This suggests that - * NICE valuse should be stored as a process nice and deltas for the ksegrps. + * values for a process's ksegrps the same. This suggests that + * NICE values should be stored as a process nice and deltas for the ksegrps. * (but not yet). */ static int @@ -287,7 +286,7 @@ n = PRIO_MIN; /* * Only allow nicing if to more than the lowest nice. - * E.g., for nices of 4,3,2 allow nice to 3 but not 1 + * E.g., for nices of 4,3,2 allow nice to 3 but not 1 */ FOREACH_KSEGRP_IN_PROC(p, kg) { if (kg->kg_nice < low) @@ -303,7 +302,11 @@ return (0); } -/* rtprio system call */ +/* + * Set realtime priority + * + * MPSAFE + */ #ifndef _SYS_SYSPROTO_H_ struct rtprio_args { int function; @@ -312,12 +315,6 @@ }; #endif -/* - * Set realtime priority - * - * MPSAFE - */ -/* ARGSUSED */ int rtprio(td, uap) struct thread *td; @@ -450,7 +447,6 @@ /* * MPSAFE */ -/* ARGSUSED */ int osetrlimit(td, uap) struct thread *td; @@ -477,7 +473,6 @@ /* * MPSAFE */ -/* ARGSUSED */ int ogetrlimit(td, uap) struct thread *td; @@ -494,8 +489,18 @@ PROC_LOCK(p); lim_rlimit(p, uap->which, &rl); PROC_UNLOCK(p); - olim.rlim_cur = rl.rlim_cur == -1 ? 0x7fffffff : rl.rlim_cur; - olim.rlim_max = rl.rlim_max == -1 ? 0x7fffffff : rl.rlim_max; + + /* + * XXX would be more correct to convert only RLIM_INFINITY to the + * old RLIM_INFINITY and fail with EOVERFLOW for other larger + * values. Most 64->32 and 32->16 conversions, including not + * unimportant ones of uids are even more broken than what we + * do here (they blindly truncate). We don't do this correctly + * here since we have little experience with EOVERFLOW yet. + * Elsewhere, getuid() can't fail... + */ + olim.rlim_cur = rl.rlim_cur > 0x7fffffff ? 0x7fffffff : rl.rlim_cur; + olim.rlim_max = rl.rlim_max > 0x7fffffff ? 0x7fffffff : rl.rlim_max; error = copyout(&olim, uap->rlp, sizeof(olim)); return (error); } @@ -510,7 +515,6 @@ /* * MPSAFE */ -/* ARGSUSED */ int setrlimit(td, uap) struct thread *td; @@ -659,8 +663,8 @@ struct thread *td; register struct __getrlimit_args *uap; { + struct rlimit rlim; struct proc *p; - struct rlimit rlim; int error; if (uap->which >= RLIM_NLIMITS) @@ -701,7 +705,7 @@ st = 1; tt = 1; } - if (curthread->td_proc == p) { + if (p == curthread->td_proc) { /* * Adjust for the current time slice. This is actually fairly * important since the error here is on the order of a time @@ -718,9 +722,8 @@ tu = (u_int64_t)tv.tv_sec * 1000000 + tv.tv_usec; ptu = p->p_uu + p->p_su + p->p_iu; if (tu < ptu || (int64_t)tu < 0) { - /* XXX no %qd in kernel. Truncate. */ - printf("calcru: negative time of %ld usec for pid %d (%s)\n", - (long)tu, p->p_pid, p->p_comm); + printf("calcru: negative time of %jd usec for pid %d (%s)\n", + (intmax_t)tu, p->p_pid, p->p_comm); tu = ptu; } @@ -728,7 +731,7 @@ uu = (tu * ut) / tt; su = (tu * st) / tt; iu = tu - uu - su; - + /* Enforce monotonicity. */ if (uu < p->p_uu || su < p->p_su || iu < p->p_iu) { if (uu < p->p_uu) @@ -779,35 +782,33 @@ register struct thread *td; register struct getrusage_args *uap; { - struct proc *p = td->td_proc; - register struct rusage *rup; - int error = 0; + struct rusage ru; + struct proc *p; - mtx_lock(&Giant); + p = td->td_proc; + switch (uap->who) { - switch (uap->who) { case RUSAGE_SELF: - rup = &p->p_stats->p_ru; + mtx_lock(&Giant); mtx_lock_spin(&sched_lock); - calcru(p, &rup->ru_utime, &rup->ru_stime, NULL); + calcru(p, &p->p_stats->p_ru.ru_utime, &p->p_stats->p_ru.ru_stime, + NULL); mtx_unlock_spin(&sched_lock); + ru = p->p_stats->p_ru; + mtx_unlock(&Giant); break; case RUSAGE_CHILDREN: - rup = &p->p_stats->p_cru; + mtx_lock(&Giant); + ru = p->p_stats->p_cru; + mtx_unlock(&Giant); break; default: - rup = NULL; - error = EINVAL; + return (EINVAL); break; } - mtx_unlock(&Giant); - if (error == 0) { - /* XXX Unlocked access to p_stats->p_ru or p_cru. */ - error = copyout(rup, uap->rusage, sizeof (struct rusage)); - } - return(error); + return (copyout(&ru, uap->rusage, sizeof(struct rusage))); } void @@ -1103,7 +1104,7 @@ s = splnet(); UIDINFO_LOCK(uip); new = uip->ui_sbsize + to - *hiwat; - /* don't allow them to exceed max, but allow subtraction */ + /* Don't allow them to exceed max, but allow subtraction */ if (to > *hiwat && new > max) { splx(s); UIDINFO_UNLOCK(uip); ==== //depot/projects/smpng/sys/sys/resourcevar.h#16 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)resourcevar.h 8.4 (Berkeley) 1/9/95 - * $FreeBSD: src/sys/sys/resourcevar.h,v 1.38 2004/02/05 20:53:25 jhb Exp $ + * $FreeBSD: src/sys/sys/resourcevar.h,v 1.39 2004/02/06 19:25:34 jhb Exp $ */ #ifndef _SYS_RESOURCEVAR_H_ @@ -106,9 +106,8 @@ #define UIDINFO_LOCK(ui) mtx_lock((ui)->ui_mtxp) #define UIDINFO_UNLOCK(ui) mtx_unlock((ui)->ui_mtxp) +struct proc; struct thread; -struct kse; -struct proc; void addupc_intr(struct thread *td, uintptr_t pc, u_int ticks); void addupc_task(struct thread *td, uintptr_t pc, u_int ticks); From owner-p4-projects@FreeBSD.ORG Fri Feb 6 12:35:40 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0D24116A4D0; Fri, 6 Feb 2004 12:35:40 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D92F116A4CE for ; Fri, 6 Feb 2004 12:35:39 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD58343D45 for ; Fri, 6 Feb 2004 12:34:54 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i16KXl0B027010 for ; Fri, 6 Feb 2004 12:33:47 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i16KXlZE027007 for perforce@freebsd.org; Fri, 6 Feb 2004 12:33:47 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Fri, 6 Feb 2004 12:33:47 -0800 (PST) Message-Id: <200402062033.i16KXlZE027007@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 46608 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2004 20:35:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=46608 Change 46608 by jhb@jhb_slimer on 2004/02/06 12:32:59 IFC @46607 (Loop back various merges). Affected files ... .. //depot/projects/smpng/sys/compat/svr4/svr4_proto.h#6 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_syscall.h#5 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_syscallnames.c#5 integrate .. //depot/projects/smpng/sys/compat/svr4/svr4_sysent.c#5 integrate .. //depot/projects/smpng/sys/compat/svr4/syscalls.master#5 integrate .. //depot/projects/smpng/sys/dev/acpica/acpivar.h#36 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_proto.h#6 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_syscall.h#5 integrate .. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_sysent.c#6 integrate .. //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#5 integrate .. //depot/projects/smpng/sys/kern/kern_resource.c#43 integrate .. //depot/projects/smpng/sys/sys/resourcevar.h#17 integrate Differences ... ==== //depot/projects/smpng/sys/compat/svr4/svr4_proto.h#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/svr4/svr4_proto.h,v 1.14 2004/02/04 22:00:41 jhb Exp $ - * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.14 2004/02/04 21:57:00 jhb Exp + * $FreeBSD: src/sys/compat/svr4/svr4_proto.h,v 1.15 2004/02/06 20:21:18 jhb Exp $ + * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp */ #ifndef _SVR4_SYSPROTO_H_ ==== //depot/projects/smpng/sys/compat/svr4/svr4_syscall.h#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/svr4/svr4_syscall.h,v 1.12 2004/02/04 22:00:42 jhb Exp $ - * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.14 2004/02/04 21:57:00 jhb Exp + * $FreeBSD: src/sys/compat/svr4/svr4_syscall.h,v 1.13 2004/02/06 20:21:18 jhb Exp $ + * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp */ #define SVR4_SYS_exit 1 ==== //depot/projects/smpng/sys/compat/svr4/svr4_syscallnames.c#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call names. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/svr4/svr4_syscallnames.c,v 1.12 2004/02/04 22:00:42 jhb Exp $ - * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.14 2004/02/04 21:57:00 jhb Exp + * $FreeBSD: src/sys/compat/svr4/svr4_syscallnames.c,v 1.13 2004/02/06 20:21:18 jhb Exp $ + * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp */ const char *svr4_syscallnames[] = { ==== //depot/projects/smpng/sys/compat/svr4/svr4_sysent.c#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/compat/svr4/svr4_sysent.c,v 1.13 2004/02/04 22:00:42 jhb Exp $ - * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.14 2004/02/04 21:57:00 jhb Exp + * $FreeBSD: src/sys/compat/svr4/svr4_sysent.c,v 1.14 2004/02/06 20:21:18 jhb Exp $ + * created from FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp */ #include @@ -22,10 +22,10 @@ { 0, (sy_call_t *)nosys }, /* 0 = unused */ { AS(sys_exit_args), (sy_call_t *)sys_exit }, /* 1 = exit */ { SYF_MPSAFE | 0, (sy_call_t *)fork }, /* 2 = fork */ - { AS(read_args), (sy_call_t *)read }, /* 3 = read */ - { AS(write_args), (sy_call_t *)write }, /* 4 = write */ + { SYF_MPSAFE | AS(read_args), (sy_call_t *)read }, /* 3 = read */ + { SYF_MPSAFE | AS(write_args), (sy_call_t *)write }, /* 4 = write */ { AS(svr4_sys_open_args), (sy_call_t *)svr4_sys_open }, /* 5 = svr4_sys_open */ - { AS(close_args), (sy_call_t *)close }, /* 6 = close */ + { SYF_MPSAFE | AS(close_args), (sy_call_t *)close }, /* 6 = close */ { AS(svr4_sys_wait_args), (sy_call_t *)svr4_sys_wait }, /* 7 = svr4_sys_wait */ { AS(svr4_sys_creat_args), (sy_call_t *)svr4_sys_creat }, /* 8 = svr4_sys_creat */ { AS(link_args), (sy_call_t *)link }, /* 9 = link */ @@ -39,35 +39,35 @@ { AS(svr4_sys_break_args), (sy_call_t *)svr4_sys_break }, /* 17 = svr4_sys_break */ { AS(svr4_sys_stat_args), (sy_call_t *)svr4_sys_stat }, /* 18 = svr4_sys_stat */ { AS(lseek_args), (sy_call_t *)lseek }, /* 19 = lseek */ - { 0, (sy_call_t *)getpid }, /* 20 = getpid */ + { SYF_MPSAFE | 0, (sy_call_t *)getpid }, /* 20 = getpid */ { 0, (sy_call_t *)nosys }, /* 21 = old_mount */ { 0, (sy_call_t *)nosys }, /* 22 = sysv_umount */ - { AS(setuid_args), (sy_call_t *)setuid }, /* 23 = setuid */ - { 0, (sy_call_t *)getuid }, /* 24 = getuid */ + { SYF_MPSAFE | AS(setuid_args), (sy_call_t *)setuid }, /* 23 = setuid */ + { SYF_MPSAFE | 0, (sy_call_t *)getuid }, /* 24 = getuid */ { 0, (sy_call_t *)nosys }, /* 25 = stime */ { 0, (sy_call_t *)nosys }, /* 26 = ptrace */ { AS(svr4_sys_alarm_args), (sy_call_t *)svr4_sys_alarm }, /* 27 = svr4_sys_alarm */ { AS(svr4_sys_fstat_args), (sy_call_t *)svr4_sys_fstat }, /* 28 = svr4_sys_fstat */ - { 0, (sy_call_t *)svr4_sys_pause }, /* 29 = svr4_sys_pause */ + { SYF_MPSAFE | 0, (sy_call_t *)svr4_sys_pause }, /* 29 = svr4_sys_pause */ { AS(svr4_sys_utime_args), (sy_call_t *)svr4_sys_utime }, /* 30 = svr4_sys_utime */ { 0, (sy_call_t *)nosys }, /* 31 = stty */ { 0, (sy_call_t *)nosys }, /* 32 = gtty */ { AS(svr4_sys_access_args), (sy_call_t *)svr4_sys_access }, /* 33 = svr4_sys_access */ - { AS(svr4_sys_nice_args), (sy_call_t *)svr4_sys_nice }, /* 34 = svr4_sys_nice */ + { SYF_MPSAFE | AS(svr4_sys_nice_args), (sy_call_t *)svr4_sys_nice }, /* 34 = svr4_sys_nice */ { 0, (sy_call_t *)nosys }, /* 35 = statfs */ { 0, (sy_call_t *)sync }, /* 36 = sync */ - { AS(svr4_sys_kill_args), (sy_call_t *)svr4_sys_kill }, /* 37 = svr4_sys_kill */ + { SYF_MPSAFE | AS(svr4_sys_kill_args), (sy_call_t *)svr4_sys_kill }, /* 37 = svr4_sys_kill */ { 0, (sy_call_t *)nosys }, /* 38 = fstatfs */ - { AS(svr4_sys_pgrpsys_args), (sy_call_t *)svr4_sys_pgrpsys }, /* 39 = svr4_sys_pgrpsys */ + { SYF_MPSAFE | AS(svr4_sys_pgrpsys_args), (sy_call_t *)svr4_sys_pgrpsys }, /* 39 = svr4_sys_pgrpsys */ { 0, (sy_call_t *)nosys }, /* 40 = xenix */ - { AS(dup_args), (sy_call_t *)dup }, /* 41 = dup */ - { 0, (sy_call_t *)pipe }, /* 42 = pipe */ + { SYF_MPSAFE | AS(dup_args), (sy_call_t *)dup }, /* 41 = dup */ + { SYF_MPSAFE | 0, (sy_call_t *)pipe }, /* 42 = pipe */ { AS(svr4_sys_times_args), (sy_call_t *)svr4_sys_times }, /* 43 = svr4_sys_times */ { 0, (sy_call_t *)nosys }, /* 44 = profil */ { 0, (sy_call_t *)nosys }, /* 45 = plock */ - { AS(setgid_args), (sy_call_t *)setgid }, /* 46 = setgid */ - { 0, (sy_call_t *)getgid }, /* 47 = getgid */ - { AS(svr4_sys_signal_args), (sy_call_t *)svr4_sys_signal }, /* 48 = svr4_sys_signal */ + { SYF_MPSAFE | AS(setgid_args), (sy_call_t *)setgid }, /* 46 = setgid */ + { SYF_MPSAFE | 0, (sy_call_t *)getgid }, /* 47 = getgid */ + { SYF_MPSAFE | AS(svr4_sys_signal_args), (sy_call_t *)svr4_sys_signal }, /* 48 = svr4_sys_signal */ #if defined(NOTYET) { AS(svr4_sys_msgsys_args), (sy_call_t *)svr4_sys_msgsys }, /* 49 = svr4_sys_msgsys */ #else @@ -83,7 +83,7 @@ { AS(svr4_sys_utssys_args), (sy_call_t *)svr4_sys_utssys }, /* 57 = svr4_sys_utssys */ { AS(fsync_args), (sy_call_t *)fsync }, /* 58 = fsync */ { AS(svr4_sys_execve_args), (sy_call_t *)svr4_sys_execve }, /* 59 = svr4_sys_execve */ - { AS(umask_args), (sy_call_t *)umask }, /* 60 = umask */ + { SYF_MPSAFE | AS(umask_args), (sy_call_t *)umask }, /* 60 = umask */ { AS(chroot_args), (sy_call_t *)chroot }, /* 61 = chroot */ { AS(svr4_sys_fcntl_args), (sy_call_t *)svr4_sys_fcntl }, /* 62 = svr4_sys_fcntl */ { SYF_MPSAFE | AS(svr4_sys_ulimit_args), (sy_call_t *)svr4_sys_ulimit }, /* 63 = svr4_sys_ulimit */ @@ -114,15 +114,15 @@ { AS(svr4_sys_lstat_args), (sy_call_t *)svr4_sys_lstat }, /* 88 = svr4_sys_lstat */ { AS(symlink_args), (sy_call_t *)symlink }, /* 89 = symlink */ { AS(readlink_args), (sy_call_t *)readlink }, /* 90 = readlink */ - { AS(getgroups_args), (sy_call_t *)getgroups }, /* 91 = getgroups */ - { AS(setgroups_args), (sy_call_t *)setgroups }, /* 92 = setgroups */ + { SYF_MPSAFE | AS(getgroups_args), (sy_call_t *)getgroups }, /* 91 = getgroups */ + { SYF_MPSAFE | AS(setgroups_args), (sy_call_t *)setgroups }, /* 92 = setgroups */ { AS(fchmod_args), (sy_call_t *)fchmod }, /* 93 = fchmod */ { AS(fchown_args), (sy_call_t *)fchown }, /* 94 = fchown */ - { AS(svr4_sys_sigprocmask_args), (sy_call_t *)svr4_sys_sigprocmask }, /* 95 = svr4_sys_sigprocmask */ - { AS(svr4_sys_sigsuspend_args), (sy_call_t *)svr4_sys_sigsuspend }, /* 96 = svr4_sys_sigsuspend */ - { AS(svr4_sys_sigaltstack_args), (sy_call_t *)svr4_sys_sigaltstack }, /* 97 = svr4_sys_sigaltstack */ - { AS(svr4_sys_sigaction_args), (sy_call_t *)svr4_sys_sigaction }, /* 98 = svr4_sys_sigaction */ - { AS(svr4_sys_sigpending_args), (sy_call_t *)svr4_sys_sigpending }, /* 99 = svr4_sys_sigpending */ + { SYF_MPSAFE | AS(svr4_sys_sigprocmask_args), (sy_call_t *)svr4_sys_sigprocmask }, /* 95 = svr4_sys_sigprocmask */ + { SYF_MPSAFE | AS(svr4_sys_sigsuspend_args), (sy_call_t *)svr4_sys_sigsuspend }, /* 96 = svr4_sys_sigsuspend */ + { SYF_MPSAFE | AS(svr4_sys_sigaltstack_args), (sy_call_t *)svr4_sys_sigaltstack }, /* 97 = svr4_sys_sigaltstack */ + { SYF_MPSAFE | AS(svr4_sys_sigaction_args), (sy_call_t *)svr4_sys_sigaction }, /* 98 = svr4_sys_sigaction */ + { SYF_MPSAFE | AS(svr4_sys_sigpending_args), (sy_call_t *)svr4_sys_sigpending }, /* 99 = svr4_sys_sigpending */ { AS(svr4_sys_context_args), (sy_call_t *)svr4_sys_context }, /* 100 = svr4_sys_context */ { 0, (sy_call_t *)nosys }, /* 101 = evsys */ { 0, (sy_call_t *)nosys }, /* 102 = evtrapret */ @@ -139,8 +139,8 @@ { AS(svr4_sys_pathconf_args), (sy_call_t *)svr4_sys_pathconf }, /* 113 = svr4_sys_pathconf */ { 0, (sy_call_t *)nosys }, /* 114 = mincore */ { AS(svr4_sys_mmap_args), (sy_call_t *)svr4_sys_mmap }, /* 115 = svr4_sys_mmap */ - { AS(mprotect_args), (sy_call_t *)mprotect }, /* 116 = mprotect */ - { AS(munmap_args), (sy_call_t *)munmap }, /* 117 = munmap */ + { SYF_MPSAFE | AS(mprotect_args), (sy_call_t *)mprotect }, /* 116 = mprotect */ + { SYF_MPSAFE | AS(munmap_args), (sy_call_t *)munmap }, /* 117 = munmap */ { AS(svr4_sys_fpathconf_args), (sy_call_t *)svr4_sys_fpathconf }, /* 118 = svr4_sys_fpathconf */ { SYF_MPSAFE | 0, (sy_call_t *)vfork }, /* 119 = vfork */ { AS(fchdir_args), (sy_call_t *)fchdir }, /* 120 = fchdir */ @@ -159,12 +159,12 @@ { 0, (sy_call_t *)nosys }, /* 133 = putpmsg */ { AS(rename_args), (sy_call_t *)rename }, /* 134 = rename */ { AS(svr4_sys_uname_args), (sy_call_t *)svr4_sys_uname }, /* 135 = svr4_sys_uname */ - { AS(setegid_args), (sy_call_t *)setegid }, /* 136 = setegid */ + { SYF_MPSAFE | AS(setegid_args), (sy_call_t *)setegid }, /* 136 = setegid */ { AS(svr4_sys_sysconfig_args), (sy_call_t *)svr4_sys_sysconfig }, /* 137 = svr4_sys_sysconfig */ { SYF_MPSAFE | AS(adjtime_args), (sy_call_t *)adjtime }, /* 138 = adjtime */ { AS(svr4_sys_systeminfo_args), (sy_call_t *)svr4_sys_systeminfo }, /* 139 = svr4_sys_systeminfo */ { 0, (sy_call_t *)nosys }, /* 140 = notused */ - { AS(seteuid_args), (sy_call_t *)seteuid }, /* 141 = seteuid */ + { SYF_MPSAFE | AS(seteuid_args), (sy_call_t *)seteuid }, /* 141 = seteuid */ { 0, (sy_call_t *)nosys }, /* 142 = vtrace */ { 0, (sy_call_t *)nosys }, /* 143 = { */ { 0, (sy_call_t *)nosys }, /* 144 = sigtimedwait */ @@ -225,8 +225,8 @@ { SYF_MPSAFE | AS(nanosleep_args), (sy_call_t *)nanosleep }, /* 199 = nanosleep */ { AS(svr4_sys_facl_args), (sy_call_t *)svr4_sys_facl }, /* 200 = svr4_sys_facl */ { 0, (sy_call_t *)nosys }, /* 201 = door */ - { AS(setreuid_args), (sy_call_t *)setreuid }, /* 202 = setreuid */ - { AS(setregid_args), (sy_call_t *)setregid }, /* 203 = setregid */ + { SYF_MPSAFE | AS(setreuid_args), (sy_call_t *)setreuid }, /* 202 = setreuid */ + { SYF_MPSAFE | AS(setregid_args), (sy_call_t *)setregid }, /* 203 = setregid */ { 0, (sy_call_t *)nosys }, /* 204 = install_utrap */ { 0, (sy_call_t *)nosys }, /* 205 = signotify */ { 0, (sy_call_t *)nosys }, /* 206 = schedctl */ ==== //depot/projects/smpng/sys/compat/svr4/syscalls.master#5 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.14 2004/02/04 21:57:00 jhb Exp $ + $FreeBSD: src/sys/compat/svr4/syscalls.master,v 1.15 2004/02/06 20:07:33 jhb Exp $ ; from: @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; ; System call name/number master file (or rather, slave, from SVR4). @@ -36,10 +36,10 @@ 0 UNIMPL unused 1 NOPROTO { void sys_exit(int rval); } exit sys_exit_args void 2 MNOPROTO { int fork(void); } -3 NOPROTO { int read(int fd, char *buf, u_int nbyte); } -4 NOPROTO { int write(int fd, char *buf, u_int nbyte); } +3 MNOPROTO { int read(int fd, char *buf, u_int nbyte); } +4 MNOPROTO { int write(int fd, char *buf, u_int nbyte); } 5 STD { int svr4_sys_open(char *path, int flags, int mode); } -6 NOPROTO { int close(int fd); } +6 MNOPROTO { int close(int fd); } 7 STD { int svr4_sys_wait(int *status); } 8 STD { int svr4_sys_creat(char *path, int mode); } 9 NOPROTO { int link(char *path, char *link); } @@ -53,35 +53,35 @@ 17 STD { int svr4_sys_break(caddr_t nsize); } 18 STD { int svr4_sys_stat(char* path, struct svr4_stat* ub); } 19 NOPROTO { int lseek(int filedes, off_t *offset, int whence); } -20 NOPROTO { pid_t getpid(void); } +20 MNOPROTO { pid_t getpid(void); } 21 UNIMPL old_mount 22 UNIMPL sysv_umount -23 NOPROTO { int setuid(uid_t uid); } -24 NOPROTO { uid_t getuid(void); } +23 MNOPROTO { int setuid(uid_t uid); } +24 MNOPROTO { uid_t getuid(void); } 25 UNIMPL stime 26 UNIMPL ptrace 27 STD { int svr4_sys_alarm(unsigned sec); } 28 STD { int svr4_sys_fstat(int fd, struct svr4_stat *sb); } -29 STD { int svr4_sys_pause(void); } +29 MSTD { int svr4_sys_pause(void); } 30 STD { int svr4_sys_utime(char *path, struct svr4_utimbuf *ubuf); } 31 UNIMPL stty 32 UNIMPL gtty 33 STD { int svr4_sys_access(char *path, int flags); } -34 STD { int svr4_sys_nice(int prio); } +34 MSTD { int svr4_sys_nice(int prio); } 35 UNIMPL statfs 36 NOPROTO { int sync(void); } -37 STD { int svr4_sys_kill(int pid, int signum); } +37 MSTD { int svr4_sys_kill(int pid, int signum); } 38 UNIMPL fstatfs -39 STD { int svr4_sys_pgrpsys(int cmd, int pid, int pgid); } +39 MSTD { int svr4_sys_pgrpsys(int cmd, int pid, int pgid); } 40 UNIMPL xenix -41 NOPROTO { int dup(u_int fd); } -42 NOPROTO { int pipe(void); } +41 MNOPROTO { int dup(u_int fd); } +42 MNOPROTO { int pipe(void); } 43 STD { int svr4_sys_times(struct tms *tp); } 44 UNIMPL profil 45 UNIMPL plock -46 NOPROTO { int setgid(gid_t gid); } -47 NOPROTO { gid_t getgid(void); } -48 STD { int svr4_sys_signal(int signum, svr4_sig_t handler); } +46 MNOPROTO { int setgid(gid_t gid); } +47 MNOPROTO { gid_t getgid(void); } +48 MSTD { int svr4_sys_signal(int signum, svr4_sig_t handler); } #if defined(NOTYET) 49 STD { int svr4_sys_msgsys(int what, int a2, int a3, int a4, \ int a5); } @@ -98,7 +98,7 @@ 57 STD { int svr4_sys_utssys(void *a1, void *a2, int sel, void *a3); } 58 NOPROTO { int fsync(int fd); } 59 STD { int svr4_sys_execve(char *path, char **argp, char **envp); } -60 NOPROTO { int umask(int newmask); } +60 MNOPROTO { int umask(int newmask); } 61 NOPROTO { int chroot(char *path); } 62 STD { int svr4_sys_fcntl(int fd, int cmd, char *arg); } 63 MSTD { int svr4_sys_ulimit(int cmd, long newlimit); } @@ -132,18 +132,18 @@ 88 STD { int svr4_sys_lstat(char *path, struct svr4_stat *ub); } 89 NOPROTO { int symlink(char *path, char *link); } 90 NOPROTO { int readlink(char *path, char *buf, int count); } -91 NOPROTO { int getgroups(u_int gidsetsize, gid_t *gidset); } -92 NOPROTO { int setgroups(u_int gidsetsize, gid_t *gidset); } +91 MNOPROTO { int getgroups(u_int gidsetsize, gid_t *gidset); } +92 MNOPROTO { int setgroups(u_int gidsetsize, gid_t *gidset); } 93 NOPROTO { int fchmod(int fd, int mode); } 94 NOPROTO { int fchown(int fd, int uid, int gid); } -95 STD { int svr4_sys_sigprocmask(int how, svr4_sigset_t *set, \ +95 MSTD { int svr4_sys_sigprocmask(int how, svr4_sigset_t *set, \ svr4_sigset_t *oset); } -96 STD { int svr4_sys_sigsuspend(svr4_sigset_t *ss); } -97 STD { int svr4_sys_sigaltstack(struct svr4_sigaltstack *nss, \ +96 MSTD { int svr4_sys_sigsuspend(svr4_sigset_t *ss); } +97 MSTD { int svr4_sys_sigaltstack(struct svr4_sigaltstack *nss, \ struct svr4_sigaltstack *oss); } -98 STD { int svr4_sys_sigaction(int signum, \ +98 MSTD { int svr4_sys_sigaction(int signum, \ struct svr4_sigaction *nsa, struct svr4_sigaction *osa); } -99 STD { int svr4_sys_sigpending(int what, svr4_sigset_t *mask); } +99 MSTD { int svr4_sys_sigpending(int what, svr4_sigset_t *mask); } 100 STD { int svr4_sys_context(int func, struct svr4_ucontext *uc); } 101 UNIMPL evsys 102 UNIMPL evtrapret @@ -163,8 +163,8 @@ 114 UNIMPL mincore 115 STD { caddr_t svr4_sys_mmap( caddr_t addr, svr4_size_t len, \ int prot, int flags, int fd, svr4_off_t pos); } -116 NOPROTO { int mprotect(void *addr, int len, int prot); } -117 NOPROTO { int munmap(void *addr, int len); } +116 MNOPROTO { int mprotect(void *addr, int len, int prot); } +117 MNOPROTO { int munmap(void *addr, int len); } 118 STD { int svr4_sys_fpathconf(int fd, int name); } 119 MNOPROTO { int vfork(void); } 120 NOPROTO { int fchdir(int fd); } @@ -189,13 +189,13 @@ 133 UNIMPL putpmsg 134 NOPROTO { int rename(char *from, char *to); } 135 STD { int svr4_sys_uname(struct svr4_utsname* name, int dummy); } -136 NOPROTO { int setegid(gid_t egid); } +136 MNOPROTO { int setegid(gid_t egid); } 137 STD { int svr4_sys_sysconfig(int name); } 138 MNOPROTO { int adjtime(struct timeval *delta, \ struct timeval *olddelta); } 139 STD { long svr4_sys_systeminfo(int what, char *buf, long len); } 140 UNIMPL notused -141 NOPROTO { int seteuid(uid_t euid); } +141 MNOPROTO { int seteuid(uid_t euid); } 142 UNIMPL vtrace ; fork1 143 MUNIMPL { int fork(void); } @@ -265,8 +265,8 @@ 200 STD { int svr4_sys_facl(int fd, int cmd, int num, \ struct svr4_aclent *buf); } 201 UNIMPL door -202 NOPROTO { int setreuid(int ruid, int euid); } -203 NOPROTO { int setregid(int rgid, int egid); } +202 MNOPROTO { int setreuid(int ruid, int euid); } +203 MNOPROTO { int setregid(int rgid, int egid); } 204 UNIMPL install_utrap 205 UNIMPL signotify 206 UNIMPL schedctl ==== //depot/projects/smpng/sys/dev/acpica/acpivar.h#36 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.51 2004/01/26 19:29:04 jhb Exp $ + * $FreeBSD: src/sys/dev/acpica/acpivar.h,v 1.52 2004/02/06 19:38:05 philip Exp $ */ #include "bus_if.h" @@ -120,12 +120,12 @@ #define ACPI_POWER 0x00040000 #define ACPI_EC 0x00080000 #define ACPI_AC_ADAPTER 0x00100000 -#define ACPI_BATTERY 0x00110000 -#define ACPI_BUTTON 0x00120000 -#define ACPI_PROCESSOR 0x00140000 -#define ACPI_THERMAL 0x00180000 -#define ACPI_FAN 0x00200000 -#define ACPI_TOSHIBA 0x00400000 +#define ACPI_BATTERY 0x00200000 +#define ACPI_BUTTON 0x00400000 +#define ACPI_PROCESSOR 0x00800000 +#define ACPI_THERMAL 0x01000000 +#define ACPI_FAN 0x02000000 +#define ACPI_TOSHIBA 0x04000000 /* * Constants for different interrupt models used with acpi_SetIntrModel(). ==== //depot/projects/smpng/sys/i386/ibcs2/ibcs2_proto.h#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call prototypes. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/ibcs2/ibcs2_proto.h,v 1.17 2004/02/04 22:00:42 jhb Exp $ - * created from FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.16 2004/02/04 21:57:00 jhb Exp + * $FreeBSD: src/sys/i386/ibcs2/ibcs2_proto.h,v 1.18 2004/02/06 20:21:18 jhb Exp $ + * created from FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.17 2004/02/06 20:20:07 jhb Exp */ #ifndef _IBCS2_SYSPROTO_H_ ==== //depot/projects/smpng/sys/i386/ibcs2/ibcs2_syscall.h#5 (text+ko) ==== @@ -2,8 +2,8 @@ * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/ibcs2/ibcs2_syscall.h,v 1.14 2004/02/04 22:00:42 jhb Exp $ - * created from FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.16 2004/02/04 21:57:00 jhb Exp + * $FreeBSD: src/sys/i386/ibcs2/ibcs2_syscall.h,v 1.15 2004/02/06 20:21:18 jhb Exp $ + * created from FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.17 2004/02/06 20:20:07 jhb Exp */ #define IBCS2_SYS_syscall 0 ==== //depot/projects/smpng/sys/i386/ibcs2/ibcs2_sysent.c#6 (text+ko) ==== @@ -2,8 +2,8 @@ * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD: src/sys/i386/ibcs2/ibcs2_sysent.c,v 1.18 2004/02/04 22:00:42 jhb Exp $ - * created from FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.16 2004/02/04 21:57:00 jhb Exp + * $FreeBSD: src/sys/i386/ibcs2/ibcs2_sysent.c,v 1.19 2004/02/06 20:21:18 jhb Exp $ + * created from FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.17 2004/02/06 20:20:07 jhb Exp */ #include @@ -21,9 +21,9 @@ { SYF_MPSAFE | AS(sys_exit_args), (sy_call_t *)sys_exit }, /* 1 = exit */ { SYF_MPSAFE | 0, (sy_call_t *)fork }, /* 2 = fork */ { AS(ibcs2_read_args), (sy_call_t *)ibcs2_read }, /* 3 = ibcs2_read */ - { AS(write_args), (sy_call_t *)write }, /* 4 = write */ + { SYF_MPSAFE | AS(write_args), (sy_call_t *)write }, /* 4 = write */ { AS(ibcs2_open_args), (sy_call_t *)ibcs2_open }, /* 5 = ibcs2_open */ - { AS(close_args), (sy_call_t *)close }, /* 6 = close */ + { SYF_MPSAFE | AS(close_args), (sy_call_t *)close }, /* 6 = close */ { AS(ibcs2_wait_args), (sy_call_t *)ibcs2_wait }, /* 7 = ibcs2_wait */ { AS(ibcs2_creat_args), (sy_call_t *)ibcs2_creat }, /* 8 = ibcs2_creat */ { AS(link_args), (sy_call_t *)link }, /* 9 = link */ @@ -37,34 +37,34 @@ { AS(obreak_args), (sy_call_t *)obreak }, /* 17 = obreak */ { AS(ibcs2_stat_args), (sy_call_t *)ibcs2_stat }, /* 18 = ibcs2_stat */ { AS(ibcs2_lseek_args), (sy_call_t *)ibcs2_lseek }, /* 19 = ibcs2_lseek */ - { 0, (sy_call_t *)getpid }, /* 20 = getpid */ + { SYF_MPSAFE | 0, (sy_call_t *)getpid }, /* 20 = getpid */ { AS(ibcs2_mount_args), (sy_call_t *)ibcs2_mount }, /* 21 = ibcs2_mount */ { AS(ibcs2_umount_args), (sy_call_t *)ibcs2_umount }, /* 22 = ibcs2_umount */ - { AS(ibcs2_setuid_args), (sy_call_t *)ibcs2_setuid }, /* 23 = ibcs2_setuid */ - { 0, (sy_call_t *)getuid }, /* 24 = getuid */ + { SYF_MPSAFE | AS(ibcs2_setuid_args), (sy_call_t *)ibcs2_setuid }, /* 23 = ibcs2_setuid */ + { SYF_MPSAFE | 0, (sy_call_t *)getuid }, /* 24 = getuid */ { AS(ibcs2_stime_args), (sy_call_t *)ibcs2_stime }, /* 25 = ibcs2_stime */ - { AS(ptrace_args), (sy_call_t *)ptrace }, /* 26 = ptrace */ + { SYF_MPSAFE | AS(ptrace_args), (sy_call_t *)ptrace }, /* 26 = ptrace */ { AS(ibcs2_alarm_args), (sy_call_t *)ibcs2_alarm }, /* 27 = ibcs2_alarm */ { AS(ibcs2_fstat_args), (sy_call_t *)ibcs2_fstat }, /* 28 = ibcs2_fstat */ - { 0, (sy_call_t *)ibcs2_pause }, /* 29 = ibcs2_pause */ + { SYF_MPSAFE | 0, (sy_call_t *)ibcs2_pause }, /* 29 = ibcs2_pause */ { AS(ibcs2_utime_args), (sy_call_t *)ibcs2_utime }, /* 30 = ibcs2_utime */ { AS(ibcs2_stty_args), (sy_call_t *)ibcs2_stty }, /* 31 = ibcs2_stty */ { AS(ibcs2_gtty_args), (sy_call_t *)ibcs2_gtty }, /* 32 = ibcs2_gtty */ { AS(ibcs2_access_args), (sy_call_t *)ibcs2_access }, /* 33 = ibcs2_access */ - { AS(ibcs2_nice_args), (sy_call_t *)ibcs2_nice }, /* 34 = ibcs2_nice */ + { SYF_MPSAFE | AS(ibcs2_nice_args), (sy_call_t *)ibcs2_nice }, /* 34 = ibcs2_nice */ { AS(ibcs2_statfs_args), (sy_call_t *)ibcs2_statfs }, /* 35 = ibcs2_statfs */ { 0, (sy_call_t *)sync }, /* 36 = sync */ - { AS(ibcs2_kill_args), (sy_call_t *)ibcs2_kill }, /* 37 = ibcs2_kill */ + { SYF_MPSAFE | AS(ibcs2_kill_args), (sy_call_t *)ibcs2_kill }, /* 37 = ibcs2_kill */ { AS(ibcs2_fstatfs_args), (sy_call_t *)ibcs2_fstatfs }, /* 38 = ibcs2_fstatfs */ - { AS(ibcs2_pgrpsys_args), (sy_call_t *)ibcs2_pgrpsys }, /* 39 = ibcs2_pgrpsys */ + { SYF_MPSAFE | AS(ibcs2_pgrpsys_args), (sy_call_t *)ibcs2_pgrpsys }, /* 39 = ibcs2_pgrpsys */ { AS(ibcs2_xenix_args), (sy_call_t *)ibcs2_xenix }, /* 40 = ibcs2_xenix */ - { AS(dup_args), (sy_call_t *)dup }, /* 41 = dup */ - { 0, (sy_call_t *)pipe }, /* 42 = pipe */ + { SYF_MPSAFE | AS(dup_args), (sy_call_t *)dup }, /* 41 = dup */ + { SYF_MPSAFE | 0, (sy_call_t *)pipe }, /* 42 = pipe */ { AS(ibcs2_times_args), (sy_call_t *)ibcs2_times }, /* 43 = ibcs2_times */ { SYF_MPSAFE | AS(profil_args), (sy_call_t *)profil }, /* 44 = profil */ { AS(ibcs2_plock_args), (sy_call_t *)ibcs2_plock }, /* 45 = ibcs2_plock */ - { AS(ibcs2_setgid_args), (sy_call_t *)ibcs2_setgid }, /* 46 = ibcs2_setgid */ - { 0, (sy_call_t *)getgid }, /* 47 = getgid */ + { SYF_MPSAFE | AS(ibcs2_setgid_args), (sy_call_t *)ibcs2_setgid }, /* 46 = ibcs2_setgid */ + { SYF_MPSAFE | 0, (sy_call_t *)getgid }, /* 47 = getgid */ { AS(ibcs2_sigsys_args), (sy_call_t *)ibcs2_sigsys }, /* 48 = ibcs2_sigsys */ { AS(ibcs2_msgsys_args), (sy_call_t *)ibcs2_msgsys }, /* 49 = ibcs2_msgsys */ { AS(ibcs2_sysi86_args), (sy_call_t *)ibcs2_sysi86 }, /* 50 = ibcs2_sysi86 */ @@ -77,7 +77,7 @@ { AS(ibcs2_utssys_args), (sy_call_t *)ibcs2_utssys }, /* 57 = ibcs2_utssys */ { AS(fsync_args), (sy_call_t *)fsync }, /* 58 = fsync */ { AS(ibcs2_execve_args), (sy_call_t *)ibcs2_execve }, /* 59 = ibcs2_execve */ - { AS(umask_args), (sy_call_t *)umask }, /* 60 = umask */ + { SYF_MPSAFE | AS(umask_args), (sy_call_t *)umask }, /* 60 = umask */ { AS(chroot_args), (sy_call_t *)chroot }, /* 61 = chroot */ { AS(ibcs2_fcntl_args), (sy_call_t *)ibcs2_fcntl }, /* 62 = ibcs2_fcntl */ { SYF_MPSAFE | AS(ibcs2_ulimit_args), (sy_call_t *)ibcs2_ulimit }, /* 63 = ibcs2_ulimit */ @@ -120,7 +120,7 @@ { 0, (sy_call_t *)nosys }, /* 100 = nosys */ { 0, (sy_call_t *)nosys }, /* 101 = nosys */ { 0, (sy_call_t *)nosys }, /* 102 = nosys */ - { AS(sigreturn_args), (sy_call_t *)sigreturn }, /* 103 = sigreturn */ + { SYF_MPSAFE | AS(sigreturn_args), (sy_call_t *)sigreturn }, /* 103 = sigreturn */ { 0, (sy_call_t *)nosys }, /* 104 = nosys */ { 0, (sy_call_t *)ibcs2_isc }, /* 105 = ibcs2_isc */ { 0, (sy_call_t *)nosys }, /* 106 = nosys */ ==== //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#5 (text+ko) ==== @@ -1,4 +1,4 @@ - $FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.16 2004/02/04 21:57:00 jhb Exp $ + $FreeBSD: src/sys/i386/ibcs2/syscalls.master,v 1.17 2004/02/06 20:20:07 jhb Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 ; System call name/number master file (or rather, slave, from IBCS2). @@ -34,9 +34,9 @@ 1 MNOPROTO { void sys_exit(int rval); } exit sys_exit_args void 2 MNOPROTO { int fork(void); } 3 STD { int ibcs2_read(int fd, char *buf, u_int nbytes); } -4 NOPROTO { int write(int fd, char *buf, u_int nbytes); } +4 MNOPROTO { int write(int fd, char *buf, u_int nbytes); } 5 STD { int ibcs2_open(char *path, int flags, int mode); } -6 NOPROTO { int close(int fd); } +6 MNOPROTO { int close(int fd); } 7 STD { int ibcs2_wait(int a1, int a2, int a3); } 8 STD { int ibcs2_creat(char *path, int mode); } 9 NOPROTO { int link(char *path, char *link); } @@ -50,39 +50,39 @@ 17 NOPROTO { int obreak(caddr_t nsize); } 18 STD { int ibcs2_stat(char* path, struct ibcs2_stat *st); } 19 STD { long ibcs2_lseek(int fd, long offset, int whence); } -20 NOPROTO { pid_t getpid(void); } +20 MNOPROTO { pid_t getpid(void); } 21 STD { int ibcs2_mount(char *special, char *dir, int flags, \ int fstype, char *data, int len); } 22 STD { int ibcs2_umount(char *name); } -23 STD { int ibcs2_setuid(int uid); } -24 NOPROTO { uid_t getuid(void); } +23 MSTD { int ibcs2_setuid(int uid); } +24 MNOPROTO { uid_t getuid(void); } 25 STD { int ibcs2_stime(long *timep); } -26 NOPROTO { int ptrace(int req, pid_t pid, caddr_t addr, int data); } +26 MNOPROTO { int ptrace(int req, pid_t pid, caddr_t addr, int data); } 27 STD { int ibcs2_alarm(unsigned sec); } 28 STD { int ibcs2_fstat(int fd, struct ibcs2_stat *st); } -29 STD { int ibcs2_pause(void); } +29 MSTD { int ibcs2_pause(void); } 30 STD { int ibcs2_utime(char *path, struct ibcs2_utimbuf *buf); } 31 STD { int ibcs2_stty(int fd, struct sgttyb *buf); } 32 STD { int ibcs2_gtty(int fd, struct sgttyb *buf); } 33 STD { int ibcs2_access(char *path, int flags); } -34 STD { int ibcs2_nice(int incr); } +34 MSTD { int ibcs2_nice(int incr); } 35 STD { int ibcs2_statfs(char *path, struct ibcs2_statfs *buf, \ int len, int fstype); } 36 NOPROTO { int sync(void); } -37 STD { int ibcs2_kill(int pid, int signo); } +37 MSTD { int ibcs2_kill(int pid, int signo); } 38 STD { int ibcs2_fstatfs(int fd, struct ibcs2_statfs *buf, \ int len, int fstype); } -39 STD { int ibcs2_pgrpsys(int type, caddr_t dummy, int pid, \ +39 MSTD { int ibcs2_pgrpsys(int type, caddr_t dummy, int pid, \ int pgid); } 40 STD { int ibcs2_xenix(int a1, int a2, int a3, int a4, int a5); } -41 NOPROTO { int dup(u_int fd); } -42 NOPROTO { int pipe(void); } +41 MNOPROTO { int dup(u_int fd); } +42 MNOPROTO { int pipe(void); } 43 STD { int ibcs2_times(struct tms *tp); } 44 MNOPROTO { int profil(caddr_t samples, u_int size, u_int offset, \ u_int scale); } 45 STD { int ibcs2_plock(int cmd); } -46 STD { int ibcs2_setgid(int gid); } -47 NOPROTO { gid_t getgid(void); } +46 MSTD { int ibcs2_setgid(int gid); } +47 MNOPROTO { gid_t getgid(void); } 48 STD { int ibcs2_sigsys(int sig, ibcs2_sig_t fp); } 49 STD { int ibcs2_msgsys(int which, int a2, int a3, int a4, int a5, \ int a6); } @@ -96,7 +96,7 @@ 57 STD { int ibcs2_utssys(int a1, int a2, int flag); } 58 NOPROTO { int fsync(int fd); } 59 STD { int ibcs2_execve(char *path, char **argp, char **envp); } -60 NOPROTO { int umask(int newmask); } +60 MNOPROTO { int umask(int newmask); } 61 NOPROTO { int chroot(char *path); } 62 STD { int ibcs2_fcntl(int fd, int cmd, char *arg); } 63 MSTD { long ibcs2_ulimit(int cmd, int newlimit); } @@ -143,7 +143,7 @@ 100 UNIMPL nosys 101 UNIMPL nosys 102 UNIMPL nosys -103 NOPROTO { int sigreturn(struct sigcontext *sigcntxp); } +103 MNOPROTO { int sigreturn(struct sigcontext *sigcntxp); } 104 UNIMPL nosys 105 STD { int ibcs2_isc(void); } 106 UNIMPL nosys ==== //depot/projects/smpng/sys/kern/kern_resource.c#43 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.132 2004/02/06 19:30:12 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.133 2004/02/06 19:35:14 jhb Exp $"); #include "opt_compat.h" @@ -837,9 +837,9 @@ struct plimit *limp; limp = (struct plimit *)malloc(sizeof(struct plimit), M_PLIMIT, - M_WAITOK | M_ZERO); + M_WAITOK); limp->pl_refcnt = 1; - mtx_init(&limp->pl_mtx, "plimit lock", NULL, MTX_DEF); + limp->pl_mtx = mtx_pool_alloc(mtxpool_sleep); return (limp); } @@ -862,7 +862,7 @@ LIM_LOCK(limp); KASSERT(limp->pl_refcnt > 0, ("plimit refcnt underflow")); if (--limp->pl_refcnt == 0) { - mtx_destroy(&limp->pl_mtx); + LIM_UNLOCK(limp); free((void *)limp, M_PLIMIT); return; } ==== //depot/projects/smpng/sys/sys/resourcevar.h#17 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)resourcevar.h 8.4 (Berkeley) 1/9/95 - * $FreeBSD: src/sys/sys/resourcevar.h,v 1.39 2004/02/06 19:25:34 jhb Exp $ + * $FreeBSD: src/sys/sys/resourcevar.h,v 1.40 2004/02/06 19:35:14 jhb Exp $ */ #ifndef _SYS_RESOURCEVAR_H_ @@ -68,6 +68,8 @@ struct timeval p_start; /* starting time */ }; +#ifdef _KERNEL + /* * Kernel shareable process resource limits. Because this structure * is moderately large but changes infrequently, it is normally @@ -76,20 +78,12 @@ struct plimit { struct rlimit pl_rlimit[RLIM_NLIMITS]; int pl_refcnt; /* number of references */ - struct mtx pl_mtx; + struct mtx *pl_mtx; }; -#ifdef _KERNEL - -/* - * Lock order for operations involving the plimit lock: - * filedesc - * proc - * plimit - */ -#define LIM_LOCK(lim) mtx_lock(&(lim)->pl_mtx) -#define LIM_UNLOCK(lim) mtx_unlock(&(lim)->pl_mtx) -#define LIM_LOCK_ASSERT(lim, f) mtx_assert(&(lim)->pl_mtx, (f)) +#define LIM_LOCK(lim) mtx_lock((lim)->pl_mtx) +#define LIM_UNLOCK(lim) mtx_unlock((lim)->pl_mtx) +#define LIM_LOCK_ASSERT(lim, f) mtx_assert((lim)->pl_mtx, (f)) /* * Per uid resource consumption From owner-p4-projects@FreeBSD.ORG Fri Feb 6 22:32:52 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 159DE16A4D0; Fri, 6 Feb 2004 22:32:52 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C557C16A4CE for ; Fri, 6 Feb 2004 22:32:51 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 102C043D1F for ; Fri, 6 Feb 2004 22:32:09 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i176W80B080655 for ; Fri, 6 Feb 2004 22:32:08 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i176W8sd080649 for perforce@freebsd.org; Fri, 6 Feb 2004 22:32:08 -0800 (PST) (envelope-from marcel@freebsd.org) Date: Fri, 6 Feb 2004 22:32:08 -0800 (PST) Message-Id: <200402070632.i176W8sd080649@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 46637 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2004 06:32:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=46637 Change 46637 by marcel@marcel_nfs on 2004/02/06 22:31:58 Checkpoint: make depend works. We cannot build gdb(1) due to the fact that binutils is too old. There's bfd mismatch. Affected files ... .. //depot/projects/gdb/contrib/gdb/include/gdb/ChangeLog#2 edit .. //depot/projects/gdb/contrib/gdb/include/gdb/callback.h#1 add .. //depot/projects/gdb/contrib/gdb/include/gdb/fileio.h#1 add .. //depot/projects/gdb/contrib/gdb/include/gdb/signals.h#2 edit .. //depot/projects/gdb/gnu/usr.bin/gdb/Makefile.inc0#2 edit .. //depot/projects/gdb/gnu/usr.bin/gdb/gdb/Makefile#2 edit .. //depot/projects/gdb/gnu/usr.bin/gdb/gdb/config.h#2 edit Differences ... ==== //depot/projects/gdb/contrib/gdb/include/gdb/ChangeLog#2 (text+ko) ==== @@ -1,7 +1,104 @@ -2002-03-29 Daniel Jacobowitz +2003-10-31 Kevin Buettner + + * sim-frv.h: New file. + +2003-10-15 J"orn Rennecke + + * callback.h (struct host_callback_struct): New members ftruncate + and truncate. + +2003-06-10 Corinna Vinschen + + * gdb/fileio.h: New file. + +2003-05-07 Andrew Cagney + + * sim-d10v.h (sim_d10v_translate_addr): Add regcache parameter. + (sim_d10v_translate_imap_addr): Add regcache parameter. + (sim_d10v_translate_dmap_addr): Ditto. + +2003-03-27 Nick Clifton + + * sim-arm.h (sim_arm_regs): Add iWMMXt registers. + +2003-03-20 Nick Clifton + + * sim-arm.h (sim_arm_regs): Add Maverick co-processor + registers. + +2003-02-27 Andrew Cagney + + * remote-sim.h (sim_open, sim_load, sim_create_inferior): Rename + _bfd to bfd. + +2003-02-20 Andrew Cagney + + * remote-sim.h (SIM_RC): Delete unused SIM_RC_UNKNOWN_BREAKPOINT, + SIM_RC_INSUFFICIENT_RESOURCES and SIM_RC_DUPLICATE_BREAKPOINT. + (sim_set_breakpoint, sim_clear_breakpoint): Delete declarations. + (sim_clear_all_breakpoints, sim_enable_breakpoint): Ditto. + (sim_enable_all_breakpoints, sim_disable_breakpoint): Ditto. + (sim_disable_all_breakpoints): Ditto. + +2002-12-26 Kazu Hirata + + * sim-h8300.h: Remove ^M. + +2002-07-29 Andrey Volkov + + * sim-h8300.h: Rename all enums from H8300_ to SIM_H8300_ + prefix. + +2002-07-23 Andrey Volkov + + * sim-h8300.h: New file. + +2002-07-17 Andrew Cagney + + * remote-sim.h: Update copyright. + (sim_set_callbacks, sim_size, sim_trace) + (sim_set_trace, sim_set_profile_size, sim_kill): Delete. Moved to + "sim/common/run-sim.h". + +Wed Jul 17 19:36:38 2002 J"orn Rennecke + + * sim-sh.h: Add enum constants for sh[1-4], sh3e, sh3?-dsp, + renumbering the sh-dsp registers to use distinct numbers. + +2002-06-15 Andrew Cagney + + * sim-arm.h (enum sim_arm_regs): Rename sim_arm_regnum. + +2002-06-12 Andrew Cagney + + * sim-arm.h: New file. + +2002-06-08 Andrew Cagney + + * callback.h: Copy to here from directory above. + * remote-sim.h: Copy to here from directory above. + +2002-06-01 Andrew Cagney + + * sim-d10v.h (sim_d10v_regs): Expand to include all registers. + Update copyright. + +2002-05-23 Andrew Cagney + + * sim-d10v.h: New file. Moved from include/sim-d10v.h. + +2002-05-10 Elena Zannoni + + * sim-sh.h: New file, for sh gdb<->sim interface. + +2002-05-09 Daniel Jacobowitz + + * signals.h: Update comments. + (enum target_signal): Remove conditional compilation around + Mach-specific signals. Move them to after TARGET_SIGNAL_DEFAULT. + +2002-03-10 Daniel Jacobowitz - Merge from trunk: - 2002-03-10 Daniel Jacobowitz * signals.h: New file, from gdb/defs.h. ==== //depot/projects/gdb/contrib/gdb/include/gdb/signals.h#2 (text+ko) ==== @@ -32,7 +32,8 @@ Since these numbers have actually made it out into other software (stubs, etc.), you mustn't disturb the assigned numbering. If you need to add new signals here, add them to the end of the explicitly - numbered signals. + numbered signals, at the comment marker. Add them unconditionally, + not within any #if or #ifdef. This is based strongly on Unix/POSIX signals for several reasons: (1) This set of signals represents a widely-accepted attempt to @@ -208,15 +209,6 @@ TARGET_SIGNAL_REALTIME_126, TARGET_SIGNAL_REALTIME_127, -#if defined(MACH) || defined(__MACH__) - /* Mach exceptions */ - TARGET_EXC_BAD_ACCESS, - TARGET_EXC_BAD_INSTRUCTION, - TARGET_EXC_ARITHMETIC, - TARGET_EXC_EMULATION, - TARGET_EXC_SOFTWARE, - TARGET_EXC_BREAKPOINT, -#endif TARGET_SIGNAL_INFO, /* Some signal we don't know about. */ @@ -226,6 +218,18 @@ (for passing to proceed and so on). */ TARGET_SIGNAL_DEFAULT, + /* Mach exceptions. In versions of GDB before 5.2, these were just before + TARGET_SIGNAL_INFO if you were compiling on a Mach host (and missing + otherwise). */ + TARGET_EXC_BAD_ACCESS, + TARGET_EXC_BAD_INSTRUCTION, + TARGET_EXC_ARITHMETIC, + TARGET_EXC_EMULATION, + TARGET_EXC_SOFTWARE, + TARGET_EXC_BREAKPOINT, + + /* If you are adding a new signal, add it just above this comment. */ + /* Last and unused enum value, for sizing arrays, etc. */ TARGET_SIGNAL_LAST }; ==== //depot/projects/gdb/gnu/usr.bin/gdb/Makefile.inc0#2 (text+ko) ==== @@ -8,6 +8,9 @@ TARGET_ARCH?= ${MACHINE_ARCH} -CONTRIBDIR= ${.CURDIR}/../../../../contrib -BINUTILSDIR= ${CONTRIBDIR}/binutils -GDBDIR= ${CONTRIBDIR}/gdb/gdb +CNTRB_ROOT= ${.CURDIR}/../../../../contrib +CNTRB_BINUTILS= ${CNTRB_ROOT}/binutils +CNTRB_GDB= ${CNTRB_ROOT}/gdb + +GNUBIN_ROOT= ${.CURDIR}/../.. +GNUBIN_BINUTILS= ${GNUBIN_ROOT}/binutils ==== //depot/projects/gdb/gnu/usr.bin/gdb/gdb/Makefile#2 (text+ko) ==== @@ -2,9 +2,11 @@ .include "../Makefile.inc0" -.PATH: ${GDBDIR} ${GDBDIR}/cli ${GDBDIR}/mi ${GDBDIR}/signals +.PATH: ${CNTRB_GDB}/gdb ${CNTRB_GDB}/gdb/cli ${CNTRB_GDB}/gdb/mi \ + ${CNTRB_GDB}/gdb/signals PROG= gdb +GENSRCS=version.c nm.h tm.h xm.h SRCS= annotate.c arch-utils.c ax-gdb.c ax-general.c bcache.c \ bfd-target.c block.c blockframe.c breakpoint.c buildsym.c \ c-exp.y c-lang.c c-typeprint.c c-valprint.c charset.c \ @@ -36,14 +38,22 @@ solib-svr4.c source.c stabsread.c stack.c std-regs.c symfile.c \ symmisc.c symtab.c target.c thread.c top.c tracepoint.c \ trad-frame.c typeprint.c ui-file.c ui-out.c utils.c valarith.c \ - valops.c valprint.c values.c varobj.c version.c wrapper.c + valops.c valprint.c values.c varobj.c wrapper.c ${GENSRCS} + +CLEANFILES+= ${GENSRCS} .if ${TARGET_ARCH} != ${MACHINE_ARCH} CFLAGS+= -DCROSS_COMPILE=1 .endif -CFLAGS+= -I. -I${.CURDIR} -CFLAGS+= -I${BINUTILSDIR}/include +CFLAGS+= -I. +CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${CNTRB_BINUTILS}/bfd +CFLAGS+= -I${CNTRB_BINUTILS}/include +CFLAGS+= -I${CNTRB_GDB}/gdb +CFLAGS+= -I${CNTRB_GDB}/gdb/config +CFLAGS+= -I${CNTRB_GDB}/include +CFLAGS+= -I${GNUBIN_BINUTILS}/libbfd/${TARGET_ARCH} nm.h: echo '#include "${TARGET_ARCH}/nm-fbsd.h"' > ${.TARGET} @@ -55,11 +65,11 @@ echo '#include "${TARGET_ARCH}/xm-${TARGET_ARCH}.h"' > ${.TARGET} version.c: - @echo '#include "version.h"' > ${.TARGET} - @echo 'const char version[] = "${VERSION}"' >> ${.TARGET} - @echo 'const char host_name[] = "${MACHINE_ARCH}-intree-freebsd";' \ + echo '#include "version.h"' > ${.TARGET} + echo 'const char version[] = "${VERSION}"' >> ${.TARGET} + echo 'const char host_name[] = "${MACHINE_ARCH}-intree-freebsd";' \ + >> ${.TARGET} + echo 'const char target_name[] = "${TARGET_ARCH}-intree-freebsd";' \ >> ${.TARGET} - @echo 'const char target_name[] = "${TARGET_ARCH}-intree-freebsd";' \ - >>${.TARGET} .include ==== //depot/projects/gdb/gnu/usr.bin/gdb/gdb/config.h#2 (text+ko) ==== @@ -400,7 +400,7 @@ #define HAVE_TERMIOS_H 1 /* Define if you have the header file. */ -/* #undef HAVE_THREAD_DB_H */ +#define HAVE_THREAD_DB_H 1 /* Define if you have the header file. */ #define HAVE_TIME_H 1 @@ -430,7 +430,7 @@ #define HAVE_LC_MESSAGES 1 /* Define to 1 if NLS is requested */ -#define ENABLE_NLS 1 +/* #undef ENABLE_NLS */ /* Define as 1 if you have gettext and don't want to use GNU gettext. */ /* #undef HAVE_GETTEXT */