From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 06:39:37 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70CEF106564A; Sun, 5 Jul 2009 06:39:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED948FC15; Sun, 5 Jul 2009 06:39:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n656dbBX039567; Sun, 5 Jul 2009 06:39:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n656dblg039562; Sun, 5 Jul 2009 06:39:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050639.n656dblg039562@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 06:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195350 - in projects/mips/sys/mips: include mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 06:39:37 -0000 Author: imp Date: Sun Jul 5 06:39:37 2009 New Revision: 195350 URL: http://svn.freebsd.org/changeset/base/195350 Log: Switch to ABI agnostic ta0-ta3. Provide defs for this in the right places. Provide n32/n64 register name defintions. This should have no effect for the O32 builds that everybody else uses, but should help make N64 builds possible (lots of other changes are needed for that). Obtained from: NetBSD (for the regdef.h changes) Modified: projects/mips/sys/mips/include/regdef.h projects/mips/sys/mips/include/regnum.h projects/mips/sys/mips/mips/exception.S projects/mips/sys/mips/mips/swtch.S Modified: projects/mips/sys/mips/include/regdef.h ============================================================================== --- projects/mips/sys/mips/include/regdef.h Sun Jul 5 06:32:10 2009 (r195349) +++ projects/mips/sys/mips/include/regdef.h Sun Jul 5 06:39:37 2009 (r195350) @@ -12,6 +12,8 @@ #ifndef _MACHINE_REGDEF_H_ #define _MACHINE_REGDEF_H_ +#include /* For API selection */ + #if defined(__ASSEMBLER__) /* General purpose CPU register names */ #define zero $0 /* wired zero */ @@ -22,6 +24,16 @@ #define a1 $5 #define a2 $6 #define a3 $7 +#if defined(__mips_n32) || defined(__mips_n64) +#define a4 $8 +#define a5 $9 +#define a6 $10 +#define a7 $11 +#define t0 $12 /* Temp regs, not saved accross subroutine calls */ +#define t1 $13 +#define t2 $14 +#define t3 $15 +#else #define t0 $8 /* caller saved */ #define t1 $9 #define t2 $10 @@ -30,6 +42,7 @@ #define t5 $13 #define t6 $14 #define t7 $15 +#endif #define s0 $16 /* callee saved */ #define s1 $17 #define s2 $18 @@ -48,6 +61,26 @@ #define s8 $30 /* callee saved */ #define ra $31 /* return address */ +/* + * These are temp registers whose names can be used in either the old + * or new ABI, although they map to different physical registers. In + * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. + * + * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 + * should be used only when we need more than t0-t3. + */ +#if defined(__mips_n32) || defined(__mips_n64) +#define ta0 $8 +#define ta1 $9 +#define ta2 $10 +#define ta3 $11 +#else +#define ta0 $12 +#define ta1 $13 +#define ta2 $14 +#define ta3 $15 +#endif /* __mips_n32 || __mips_n64 */ + #endif /* __ASSEMBLER__ */ #endif /* !_MACHINE_REGDEF_H_ */ Modified: projects/mips/sys/mips/include/regnum.h ============================================================================== --- projects/mips/sys/mips/include/regnum.h Sun Jul 5 06:32:10 2009 (r195349) +++ projects/mips/sys/mips/include/regnum.h Sun Jul 5 06:39:37 2009 (r195350) @@ -82,10 +82,10 @@ #define T1 9 #define T2 10 #define T3 11 -#define T4 12 -#define T5 13 -#define T6 14 -#define T7 15 +#define TA0 12 +#define TA1 13 +#define TA2 14 +#define TA3 15 #define S0 16 #define S1 17 #define S2 18 Modified: projects/mips/sys/mips/mips/exception.S ============================================================================== --- projects/mips/sys/mips/mips/exception.S Sun Jul 5 06:32:10 2009 (r195349) +++ projects/mips/sys/mips/mips/exception.S Sun Jul 5 06:39:37 2009 (r195350) @@ -272,7 +272,7 @@ SlowFault: and a0, a0, a2 ; \ mtc0 a0, COP_0_STATUS_REG #endif - + #define SAVE_CPU \ SAVE_REG(AT, AST, sp) ;\ .set at ; \ @@ -286,10 +286,10 @@ SlowFault: SAVE_REG(t1, T1, sp) ;\ SAVE_REG(t2, T2, sp) ;\ SAVE_REG(t3, T3, sp) ;\ - SAVE_REG(t4, T4, sp) ;\ - SAVE_REG(t5, T5, sp) ;\ - SAVE_REG(t6, T6, sp) ;\ - SAVE_REG(t7, T7, sp) ;\ + SAVE_REG(ta0, TA0, sp) ;\ + SAVE_REG(ta1, TA1, sp) ;\ + SAVE_REG(ta2, TA2, sp) ;\ + SAVE_REG(ta3, TA3, sp) ;\ SAVE_REG(t8, T8, sp) ;\ SAVE_REG(t9, T9, sp) ;\ SAVE_REG(gp, GP, sp) ;\ @@ -332,7 +332,7 @@ SlowFault: mtlo t0 ;\ mthi t1 ;\ _MTC0 v0, COP_0_EXC_PC ;\ - .set noat ; \ + .set noat ;\ RESTORE_REG(AT, AST, sp) ;\ RESTORE_REG(v0, V0, sp) ;\ RESTORE_REG(v1, V1, sp) ;\ @@ -344,10 +344,10 @@ SlowFault: RESTORE_REG(t1, T1, sp) ;\ RESTORE_REG(t2, T2, sp) ;\ RESTORE_REG(t3, T3, sp) ;\ - RESTORE_REG(t4, T4, sp) ;\ - RESTORE_REG(t5, T5, sp) ;\ - RESTORE_REG(t6, T6, sp) ;\ - RESTORE_REG(t7, T7, sp) ;\ + RESTORE_REG(ta0, TA0, sp) ;\ + RESTORE_REG(ta1, TA1, sp) ;\ + RESTORE_REG(ta2, TA2, sp) ;\ + RESTORE_REG(ta3, TA3, sp) ;\ RESTORE_REG(t8, T8, sp) ;\ RESTORE_REG(t9, T9, sp) ;\ RESTORE_REG(s0, S0, sp) ;\ @@ -451,11 +451,11 @@ NNON_LEAF(MipsUserGenException, STAND_FR SAVE_U_PCB_REG(t1, T1, k1) SAVE_U_PCB_REG(t2, T2, k1) SAVE_U_PCB_REG(t3, T3, k1) - SAVE_U_PCB_REG(t4, T4, k1) + SAVE_U_PCB_REG(ta0, TA0, k1) mfc0 a0, COP_0_STATUS_REG # First arg is the status reg. - SAVE_U_PCB_REG(t5, T5, k1) - SAVE_U_PCB_REG(t6, T6, k1) - SAVE_U_PCB_REG(t7, T7, k1) + SAVE_U_PCB_REG(ta1, TA1, k1) + SAVE_U_PCB_REG(ta2, TA2, k1) + SAVE_U_PCB_REG(ta3, TA3, k1) SAVE_U_PCB_REG(s0, S0, k1) mfc0 a1, COP_0_CAUSE_REG # Second arg is the cause reg. SAVE_U_PCB_REG(s1, S1, k1) @@ -548,10 +548,10 @@ NNON_LEAF(MipsUserGenException, STAND_FR RESTORE_U_PCB_REG(t1, T1, k1) RESTORE_U_PCB_REG(t2, T2, k1) RESTORE_U_PCB_REG(t3, T3, k1) - RESTORE_U_PCB_REG(t4, T4, k1) - RESTORE_U_PCB_REG(t5, T5, k1) - RESTORE_U_PCB_REG(t6, T6, k1) - RESTORE_U_PCB_REG(t7, T7, k1) + RESTORE_U_PCB_REG(ta0, TA0, k1) + RESTORE_U_PCB_REG(ta1, TA1, k1) + RESTORE_U_PCB_REG(ta2, TA2, k1) + RESTORE_U_PCB_REG(ta3, TA3, k1) RESTORE_U_PCB_REG(s0, S0, k1) RESTORE_U_PCB_REG(s1, S1, k1) RESTORE_U_PCB_REG(s2, S2, k1) @@ -684,10 +684,10 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE SAVE_U_PCB_REG(t1, T1, k1) SAVE_U_PCB_REG(t2, T2, k1) SAVE_U_PCB_REG(t3, T3, k1) - SAVE_U_PCB_REG(t4, T4, k1) - SAVE_U_PCB_REG(t5, T5, k1) - SAVE_U_PCB_REG(t6, T6, k1) - SAVE_U_PCB_REG(t7, T7, k1) + SAVE_U_PCB_REG(ta0, TA0, k1) + SAVE_U_PCB_REG(ta1, TA1, k1) + SAVE_U_PCB_REG(ta2, TA2, k1) + SAVE_U_PCB_REG(ta3, TA3, k1) SAVE_U_PCB_REG(t8, T8, k1) SAVE_U_PCB_REG(t9, T9, k1) SAVE_U_PCB_REG(gp, GP, k1) @@ -790,10 +790,10 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE RESTORE_U_PCB_REG(t1, T1, k1) RESTORE_U_PCB_REG(t2, T2, k1) RESTORE_U_PCB_REG(t3, T3, k1) - RESTORE_U_PCB_REG(t4, T4, k1) - RESTORE_U_PCB_REG(t5, T5, k1) - RESTORE_U_PCB_REG(t6, T6, k1) - RESTORE_U_PCB_REG(t7, T7, k1) + RESTORE_U_PCB_REG(ta0, TA0, k1) + RESTORE_U_PCB_REG(ta1, TA1, k1) + RESTORE_U_PCB_REG(ta2, TA2, k1) + RESTORE_U_PCB_REG(ta3, TA3, k1) RESTORE_U_PCB_REG(t8, T8, k1) RESTORE_U_PCB_REG(t9, T9, k1) RESTORE_U_PCB_REG(gp, GP, k1) Modified: projects/mips/sys/mips/mips/swtch.S ============================================================================== --- projects/mips/sys/mips/mips/swtch.S Sun Jul 5 06:32:10 2009 (r195349) +++ projects/mips/sys/mips/mips/swtch.S Sun Jul 5 06:39:37 2009 (r195350) @@ -203,10 +203,10 @@ LEAF(fork_trampoline) RESTORE_U_PCB_REG(t1, T1, k1) RESTORE_U_PCB_REG(t2, T2, k1) RESTORE_U_PCB_REG(t3, T3, k1) - RESTORE_U_PCB_REG(t4, T4, k1) - RESTORE_U_PCB_REG(t5, T5, k1) - RESTORE_U_PCB_REG(t6, T6, k1) - RESTORE_U_PCB_REG(t7, T7, k1) + RESTORE_U_PCB_REG(ta0, TA0, k1) + RESTORE_U_PCB_REG(ta1, TA1, k1) + RESTORE_U_PCB_REG(ta2, TA2, k1) + RESTORE_U_PCB_REG(ta3, TA3, k1) RESTORE_U_PCB_REG(s0, S0, k1) RESTORE_U_PCB_REG(s1, S1, k1) RESTORE_U_PCB_REG(s2, S2, k1) From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 06:43:01 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C52C01065676; Sun, 5 Jul 2009 06:43:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B46908FC08; Sun, 5 Jul 2009 06:43:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n656h1SQ039665; Sun, 5 Jul 2009 06:43:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n656h1qe039663; Sun, 5 Jul 2009 06:43:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050643.n656h1qe039663@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 06:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195351 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 06:43:02 -0000 Author: imp Date: Sun Jul 5 06:43:01 2009 New Revision: 195351 URL: http://svn.freebsd.org/changeset/base/195351 Log: Define COP0_SYNC for SB1 CPU. Submitted by: Neelkanth Natu Modified: projects/mips/sys/mips/include/cpuregs.h Modified: projects/mips/sys/mips/include/cpuregs.h ============================================================================== --- projects/mips/sys/mips/include/cpuregs.h Sun Jul 5 06:39:37 2009 (r195350) +++ projects/mips/sys/mips/include/cpuregs.h Sun Jul 5 06:43:01 2009 (r195351) @@ -103,6 +103,8 @@ /* CPU dependent mtc0 hazard hook */ #ifdef TARGET_OCTEON #define COP0_SYNC nop; nop; nop; nop; nop; +#elif defined(CPU_SB1) +#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop #else #define COP0_SYNC /* nothing */ #endif From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 06:44:37 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4BB106566C; Sun, 5 Jul 2009 06:44:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB9D48FC1F; Sun, 5 Jul 2009 06:44:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n656ibeN039742; Sun, 5 Jul 2009 06:44:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n656ibck039740; Sun, 5 Jul 2009 06:44:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050644.n656ibck039740@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 06:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195352 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 06:44:38 -0000 Author: imp Date: Sun Jul 5 06:44:37 2009 New Revision: 195352 URL: http://svn.freebsd.org/changeset/base/195352 Log: db_expr_t should be a intptr_t, not an int. These expressions can be addresses or numbers, and that's a intptr_t if I ever saw one. Modified: projects/mips/sys/mips/include/db_machdep.h Modified: projects/mips/sys/mips/include/db_machdep.h ============================================================================== --- projects/mips/sys/mips/include/db_machdep.h Sun Jul 5 06:43:01 2009 (r195351) +++ projects/mips/sys/mips/include/db_machdep.h Sun Jul 5 06:44:37 2009 (r195352) @@ -46,7 +46,7 @@ typedef struct trapframe db_regs_t; extern db_regs_t ddb_regs; /* register state */ typedef vm_offset_t db_addr_t; /* address - unsigned */ -typedef int db_expr_t; /* expression - signed */ +typedef intptr_t db_expr_t; /* expression - signed */ #if BYTE_ORDER == _BIG_ENDIAN #define BYTE_MSF (1) From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 06:46:55 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25968106566C; Sun, 5 Jul 2009 06:46:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 152F88FC0C; Sun, 5 Jul 2009 06:46:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n656ksRq039822; Sun, 5 Jul 2009 06:46:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n656ks7N039820; Sun, 5 Jul 2009 06:46:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050646.n656ks7N039820@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 06:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195353 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 06:46:55 -0000 Author: imp Date: Sun Jul 5 06:46:54 2009 New Revision: 195353 URL: http://svn.freebsd.org/changeset/base/195353 Log: Publish PAGE_SHIFT to assembler # we should likely phase out PGSHIFT Submitted by: Neelkanth Natu Modified: projects/mips/sys/mips/mips/genassym.c Modified: projects/mips/sys/mips/mips/genassym.c ============================================================================== --- projects/mips/sys/mips/mips/genassym.c Sun Jul 5 06:44:37 2009 (r195352) +++ projects/mips/sys/mips/mips/genassym.c Sun Jul 5 06:46:54 2009 (r195353) @@ -91,6 +91,7 @@ ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADD ASSYM(VM_KERNEL_ALLOC_OFFSET, VM_KERNEL_ALLOC_OFFSET); ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(SIGFPE, SIGFPE); +ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PGSHIFT, PGSHIFT); ASSYM(NBPG, NBPG); ASSYM(SEGSHIFT, SEGSHIFT); From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 06:49:56 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80B4E1065673; Sun, 5 Jul 2009 06:49:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 705238FC19; Sun, 5 Jul 2009 06:49:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n656nuSX039904; Sun, 5 Jul 2009 06:49:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n656numQ039902; Sun, 5 Jul 2009 06:49:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050649.n656numQ039902@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 06:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195354 - projects/mips/sys/mips/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 06:49:56 -0000 Author: imp Date: Sun Jul 5 06:49:56 2009 New Revision: 195354 URL: http://svn.freebsd.org/changeset/base/195354 Log: Go for broke: configure this to build mips64 N64 binary. Modified: projects/mips/sys/mips/conf/OCTEON1 Modified: projects/mips/sys/mips/conf/OCTEON1 ============================================================================== --- projects/mips/sys/mips/conf/OCTEON1 Sun Jul 5 06:46:54 2009 (r195353) +++ projects/mips/sys/mips/conf/OCTEON1 Sun Jul 5 06:49:56 2009 (r195354) @@ -21,7 +21,7 @@ machine mips cpu CPU_MIPS4KC ident OCTEON1 -#makeoptions ARCH_FLAGS=-march=mips32 +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" @@ -35,7 +35,7 @@ hints "OCTEON1.hints" #Default places makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols #XXXimp: Need to make work with 64-bit too -options ISA_MIPS32 +options ISA_MIPS64 options DDB options KDB From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 06:56:52 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67760106564A; Sun, 5 Jul 2009 06:56:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7DC8FC19; Sun, 5 Jul 2009 06:56:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n656upCB040083; Sun, 5 Jul 2009 06:56:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n656upBB040081; Sun, 5 Jul 2009 06:56:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050656.n656upBB040081@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 06:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195355 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 06:56:52 -0000 Author: imp Date: Sun Jul 5 06:56:51 2009 New Revision: 195355 URL: http://svn.freebsd.org/changeset/base/195355 Log: (1) Use uintptr_t in preference to unsigned. The latter isn't right for 64-bit case, while the former is. (2) include a SB1 specific coherency mapping Submitted by: Neelkanth Nath (2) Modified: projects/mips/sys/mips/include/cpu.h Modified: projects/mips/sys/mips/include/cpu.h ============================================================================== --- projects/mips/sys/mips/include/cpu.h Sun Jul 5 06:49:56 2009 (r195354) +++ projects/mips/sys/mips/include/cpu.h Sun Jul 5 06:56:51 2009 (r195355) @@ -56,21 +56,21 @@ #define MIPS_RESERVED_ADDR 0xbfc80000 #define MIPS_KSEG0_LARGEST_PHYS 0x20000000 -#define MIPS_CACHED_TO_PHYS(x) ((unsigned)(x) & 0x1fffffff) -#define MIPS_PHYS_TO_CACHED(x) ((unsigned)(x) | MIPS_CACHED_MEMORY_ADDR) -#define MIPS_UNCACHED_TO_PHYS(x) ((unsigned)(x) & 0x1fffffff) -#define MIPS_PHYS_TO_UNCACHED(x) ((unsigned)(x) | MIPS_UNCACHED_MEMORY_ADDR) +#define MIPS_CACHED_TO_PHYS(x) ((uintptr_t)(x) & 0x1fffffff) +#define MIPS_PHYS_TO_CACHED(x) ((uintptr_t)(x) | MIPS_CACHED_MEMORY_ADDR) +#define MIPS_UNCACHED_TO_PHYS(x) ((uintptr_t)(x) & 0x1fffffff) +#define MIPS_PHYS_TO_UNCACHED(x) ((uintptr_t)(x) | MIPS_UNCACHED_MEMORY_ADDR) #define MIPS_PHYS_MASK (0x1fffffff) #define MIPS_PA_2_K1VA(x) (MIPS_KSEG1_START | ((x) & MIPS_PHYS_MASK)) -#define MIPS_VA_TO_CINDEX(x) ((unsigned)(x) & 0xffffff | MIPS_CACHED_MEMORY_ADDR) +#define MIPS_VA_TO_CINDEX(x) ((uintptr_t)(x) & 0xffffff | MIPS_CACHED_MEMORY_ADDR) #define MIPS_CACHED_TO_UNCACHED(x) (MIPS_PHYS_TO_UNCACHED(MIPS_CACHED_TO_PHYS(x))) -#define MIPS_PHYS_TO_KSEG0(x) ((unsigned)(x) | MIPS_KSEG0_START) -#define MIPS_PHYS_TO_KSEG1(x) ((unsigned)(x) | MIPS_KSEG1_START) -#define MIPS_KSEG0_TO_PHYS(x) ((unsigned)(x) & MIPS_PHYS_MASK) -#define MIPS_KSEG1_TO_PHYS(x) ((unsigned)(x) & MIPS_PHYS_MASK) +#define MIPS_PHYS_TO_KSEG0(x) ((uintptr_t)(x) | MIPS_KSEG0_START) +#define MIPS_PHYS_TO_KSEG1(x) ((uintptr_t)(x) | MIPS_KSEG1_START) +#define MIPS_KSEG0_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK) +#define MIPS_KSEG1_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK) #define MIPS_IS_KSEG0_ADDR(x) \ (((vm_offset_t)(x) >= MIPS_KSEG0_START) && \ @@ -163,7 +163,11 @@ * The bits in the CONFIG register */ #define CFG_K0_UNCACHED 2 +#if defined(CPU_SB1) +#define CFG_K0_COHERENT 5 /* cacheable coherent */ +#else #define CFG_K0_CACHED 3 +#endif /* * The bits in the context register. From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 07:00:51 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF3CE106564A; Sun, 5 Jul 2009 07:00:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9A18FC13; Sun, 5 Jul 2009 07:00:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6570p69040213; Sun, 5 Jul 2009 07:00:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6570pAp040211; Sun, 5 Jul 2009 07:00:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050700.n6570pAp040211@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 07:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195356 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 07:00:52 -0000 Author: imp Date: Sun Jul 5 07:00:51 2009 New Revision: 195356 URL: http://svn.freebsd.org/changeset/base/195356 Log: Define __ELF_WORD_SIZE appropriately for n64. Note for N32 I believe this is correct. While registers are 64-bit, n32 is a 32-bit ABI and lives in a 32-bit world (with explicit 64-bit registers, however). Change an 8, which was 4 + 4 or sizeof(int) + SZREG to be a simple '4 + SZREG' to reflect the actual offset of the structure in question. Modified: projects/mips/sys/mips/include/elf.h Modified: projects/mips/sys/mips/include/elf.h ============================================================================== --- projects/mips/sys/mips/include/elf.h Sun Jul 5 06:56:51 2009 (r195355) +++ projects/mips/sys/mips/include/elf.h Sun Jul 5 07:00:51 2009 (r195356) @@ -41,8 +41,12 @@ /* Information taken from MIPS ABI supplemental */ #ifndef __ELF_WORD_SIZE +#if defined(__mips_n64) +#define __ELF_WORD_SIZE 64 /* Used by */ +#else #define __ELF_WORD_SIZE 32 /* Used by */ #endif +#endif #include /* Definitions common to all 32 bit architectures. */ #include /* Definitions common to all 64 bit architectures. */ #include From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 07:01:34 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62D0D1065670; Sun, 5 Jul 2009 07:01:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5288F8FC16; Sun, 5 Jul 2009 07:01:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6571Y18040264; Sun, 5 Jul 2009 07:01:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6571YBc040262; Sun, 5 Jul 2009 07:01:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050701.n6571YBc040262@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 07:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195357 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 07:01:34 -0000 Author: imp Date: Sun Jul 5 07:01:34 2009 New Revision: 195357 URL: http://svn.freebsd.org/changeset/base/195357 Log: Use uintptr_t rather than unsigned here for 64-bit correctness. Modified: projects/mips/sys/mips/include/param.h Modified: projects/mips/sys/mips/include/param.h ============================================================================== --- projects/mips/sys/mips/include/param.h Sun Jul 5 07:00:51 2009 (r195356) +++ projects/mips/sys/mips/include/param.h Sun Jul 5 07:01:34 2009 (r195357) @@ -146,12 +146,13 @@ /* * Conversion macros */ -#define mips_round_page(x) ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1)) -#define mips_trunc_page(x) ((unsigned)(x) & ~(NBPG-1)) -#define mips_btop(x) ((unsigned)(x) >> PGSHIFT) -#define mips_ptob(x) ((unsigned)(x) << PGSHIFT) +#define mips_round_page(x) ((((uintptr_t)(x)) + NBPG - 1) & ~(NBPG-1)) +#define mips_trunc_page(x) ((uintptr_t)(x) & ~(NBPG-1)) +#define mips_btop(x) ((uintptr_t)(x) >> PGSHIFT) +#define mips_ptob(x) ((uintptr_t)(x) << PGSHIFT) #define round_page mips_round_page #define trunc_page mips_trunc_page +/* XXXimp: Is unsigned long the right cast type here? PA can be > 32bits */ #define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 08:13:20 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 629D5106564A; Sun, 5 Jul 2009 08:13:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3728A8FC17; Sun, 5 Jul 2009 08:13:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n658DKV2041632; Sun, 5 Jul 2009 08:13:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n658DKNw041630; Sun, 5 Jul 2009 08:13:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050813.n658DKNw041630@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 08:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195358 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 08:13:20 -0000 Author: imp Date: Sun Jul 5 08:13:19 2009 New Revision: 195358 URL: http://svn.freebsd.org/changeset/base/195358 Log: Pull in machine/cdefs.h for the ABI definitions. Provide a PTR_LA, ala sgi, and use it in preference to a bare 'la' so that it gets translated to a 'dla' for the 64-bit pointer ABIs. Modified: projects/mips/sys/mips/include/asm.h Modified: projects/mips/sys/mips/include/asm.h ============================================================================== --- projects/mips/sys/mips/include/asm.h Sun Jul 5 07:01:34 2009 (r195357) +++ projects/mips/sys/mips/include/asm.h Sun Jul 5 08:13:19 2009 (r195358) @@ -60,6 +60,7 @@ #include #endif #include +#include #undef __FBSDID #if !defined(lint) && !defined(STRIP_FBSDID) @@ -281,7 +282,7 @@ _C_LABEL(x): * Macros to panic and printf from assembly language. */ #define PANIC(msg) \ - la a0, 9f; \ + PTR_LA a0, 9f; \ jal _C_LABEL(panic); \ nop; \ MSG(msg) @@ -289,7 +290,7 @@ _C_LABEL(x): #define PANIC_KSEG0(msg, reg) PANIC(msg) #define PRINTF(msg) \ - la a0, 9f; \ + PTR_LA a0, 9f; \ jal _C_LABEL(printf); \ nop; \ MSG(msg) @@ -308,7 +309,7 @@ _C_LABEL(x): */ #define DO_AST \ 44: \ - la s0, _C_LABEL(disableintr) ;\ + PTR_LA s0, _C_LABEL(disableintr) ;\ jalr s0 ;\ nop ;\ move a0, v0 ;\ @@ -318,12 +319,12 @@ _C_LABEL(x): lw s2, TD_FLAGS(s1) ;\ li s0, TDF_ASTPENDING | TDF_NEEDRESCHED;\ and s2, s0 ;\ - la s0, _C_LABEL(restoreintr) ;\ + PTR_LA s0, _C_LABEL(restoreintr) ;\ jalr s0 ;\ nop ;\ beq s2, zero, 4f ;\ nop ;\ - la s0, _C_LABEL(ast) ;\ + PTR_LA s0, _C_LABEL(ast) ;\ jalr s0 ;\ addu a0, s3, U_PCB_REGS ;\ j 44b ;\ @@ -362,12 +363,14 @@ _C_LABEL(x): */ #if !defined(_MIPS_BSD_API) || _MIPS_BSD_API == _MIPS_BSD_API_LP32 +/* #if !defined(__mips_n64) */ #define REG_L lw #define REG_S sw #define REG_LI li #define REG_PROLOGUE .set push #define REG_EPILOGUE .set pop #define SZREG 4 +#define PTR_LA la #else #define REG_L ld #define REG_S sd @@ -375,6 +378,7 @@ _C_LABEL(x): #define REG_PROLOGUE .set push ; .set mips3 #define REG_EPILOGUE .set pop #define SZREG 8 +#define PTR_LA dla #endif /* _MIPS_BSD_API */ #define mfc0_macro(data, spr) \ From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 08:14:00 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B141065670; Sun, 5 Jul 2009 08:14:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 755F48FC08; Sun, 5 Jul 2009 08:14:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n658E0nU041679; Sun, 5 Jul 2009 08:14:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n658E0Bi041677; Sun, 5 Jul 2009 08:14:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050814.n658E0Bi041677@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 08:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195359 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 08:14:00 -0000 Author: imp Date: Sun Jul 5 08:14:00 2009 New Revision: 195359 URL: http://svn.freebsd.org/changeset/base/195359 Log: Bring in cdefs.h from NetBSD to define ABI goo. Obtained from: NetBSD Added: projects/mips/sys/mips/include/cdefs.h (contents, props changed) Added: projects/mips/sys/mips/include/cdefs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/mips/sys/mips/include/cdefs.h Sun Jul 5 08:14:00 2009 (r195359) @@ -0,0 +1,54 @@ +/* $NetBSD: cdefs.h,v 1.12 2006/08/27 19:04:30 matt Exp $ */ + +/* + * Copyright (c) 1995 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#ifndef _MIPS_CDEFS_H_ +#define _MIPS_CDEFS_H_ + +/* MIPS Subprogram Interface Model */ +#define _MIPS_SIM_ABIX32 4 /* 64 bit safe, ILP32 o32 model */ +#define _MIPS_SIM_ABI64 3 +#define _MIPS_SIM_NABI32 2 /* 64bit safe, ILP32 n32 model */ +#define _MIPS_SIM_ABI32 1 + +#define _MIPS_BSD_API_LP32 _MIPS_SIM_ABI32 +#define _MIPS_BSD_API_LP32_64CLEAN _MIPS_SIM_ABIX32 +#define _MIPS_BSD_API_N32 _MIPS_SIM_NABI32 +#define _MIPS_BSD_API_LP64 _MIPS_SIM_ABI64 + +#if defined(__mips_n64) +#define _MIPS_BSD_API _MIPS_BSD_API_LP64 +#elif defined(__mips_n32) +#define _MIPS_BSD_API _MIPS_BSD_API_N32 +#elif defined(__mips_o64) +#define _MIPS_BSD_API _MIPS_BSD_API_LP32_64CLEAN +#else +#define _MIPS_BSD_API _MIPS_BSD_API_LP32 +#endif + +#endif /* !_MIPS_CDEFS_H_ */ From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 08:40:27 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CDC8106568B; Sun, 5 Jul 2009 08:40:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FACF8FC40; Sun, 5 Jul 2009 08:40:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n658eR8U042182; Sun, 5 Jul 2009 08:40:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n658eRlr042179; Sun, 5 Jul 2009 08:40:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907050840.n658eRlr042179@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 08:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195360 - projects/mips/sys/mips/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 08:40:31 -0000 Author: imp Date: Sun Jul 5 08:40:26 2009 New Revision: 195360 URL: http://svn.freebsd.org/changeset/base/195360 Log: Add config file for SWARM board, a sybyte SB-1-based board by Broadcom. BCM-91250. Submitted by: Neelkanth Natu Added: projects/mips/sys/mips/conf/SWARM projects/mips/sys/mips/conf/SWARM.hints Added: projects/mips/sys/mips/conf/SWARM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/mips/sys/mips/conf/SWARM Sun Jul 5 08:40:26 2009 (r195360) @@ -0,0 +1,82 @@ +# +# $Id: //depot/user/neelnatu/freebsd_sibyte/src/sys/mips/conf/SWARM#7 $ +# + +ident SWARM +options CPU_NOFPU +options CPU_SB1 + +files "../sibyte/files.sibyte" +hints "SWARM.hints" + +options PCI_IOSPACE_ADDR=0xFC000000 +options PCI_IOSPACE_SIZE=0x02000000 + +# +# 32-bit kernel cannot deal with physical memory beyond 4GB +# +options MAXMEM=4096*1024 + +options CFE +options CFE_CONSOLE +options CFE_ENV +options ALT_BREAK_TO_DEBUGGER + +# cfe loader expects kernel at 0x80001000 for mips32 w/o backwards +# offsets in the linked elf image (see ldscript hack) +# XXX can we conditionalize the linker stuff on options CFE? +options KERNVIRTADDR=0x80001000 + +makeoptions LDSCRIPT_NAME= ldscript.mips.cfe + +#cpu CPU_MIPS64 +#options ISA_MIPS64 +#makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64" +cpu CPU_MIPS32 +options ISA_MIPS32 +makeoptions ARCH_FLAGS="-march=mips32" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Debugging for use in -current +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS + +options MD_ROOT +options MD_ROOT_SIZE=4096 +options FFS #Fast filesystem + +device pci +device miibus +device bge +device loop +device ether +device md + +options USB_DEBUG +device usb +device ohci +device uhci +device ehci + +device umass + +device scbus +device da + +device ata +device atadisk +device atapicd +options ATA_STATIC_ID Added: projects/mips/sys/mips/conf/SWARM.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/mips/sys/mips/conf/SWARM.hints Sun Jul 5 08:40:26 2009 (r195360) @@ -0,0 +1,17 @@ +# $FreeBSD$ +hint.zbbus.0.at="nexus0" +hint.zbpci.0.at="zbbus0" +hint.scd.0.at="zbbus0" + +# +# SWARM IDE interface is on the generic bus at chip select 4. +# The CS4 region is 64KB in size and starts at 0x100B0000. +# The IDE interrupt is wired to GPIO4 (intsrc 36 to the interrupt mapper) +# +hint.ata.0.at="zbbus0" +hint.ata.0.maddr=0x100B0000 +hint.ata.0.msize=0x10000 +hint.ata.0.irq=36 +#hint.ata.0.disabled=0 +#hint.ata.0.regoffset=0x1F0 +#hint.ata.0.regshift=5 From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:10:08 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2592A1065672; Sun, 5 Jul 2009 15:10:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12E938FC0C; Sun, 5 Jul 2009 15:10:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FA7N7052476; Sun, 5 Jul 2009 15:10:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FA7CH052474; Sun, 5 Jul 2009 15:10:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051510.n65FA7CH052474@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195364 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:10:08 -0000 Author: imp Date: Sun Jul 5 15:10:07 2009 New Revision: 195364 URL: http://svn.freebsd.org/changeset/base/195364 Log: use %p in preference to 0x%08x for printing register_t values. Cast them to void * first. This neatly solves the "how do I print a register_t" problem because sizeof(void *) is always the same as sizeof(register_t), afaik. Modified: projects/mips/sys/mips/mips/trap.c Modified: projects/mips/sys/mips/mips/trap.c ============================================================================== --- projects/mips/sys/mips/mips/trap.c Sun Jul 5 14:50:45 2009 (r195363) +++ projects/mips/sys/mips/mips/trap.c Sun Jul 5 15:10:07 2009 (r195364) @@ -364,7 +364,7 @@ trap(trapframe) printf("cpuid = %d\n", PCPU_GET(cpuid)); #endif MachTLBGetPID(pid); - printf("badaddr = %p, pc = %p, ra = %p, sp = %p, sr = 0x%x, pid = %d, ASID = 0x%x\n", + printf("badaddr = 0x%0x, pc = 0x%0x, ra = 0x%0x, sp = 0x%0x, sr = 0x%x, pid = %d, ASID = 0x%x\n", trapframe->badvaddr, trapframe->pc, trapframe->ra, trapframe->sp, trapframe->sr, (curproc ? curproc->p_pid : -1), pid); @@ -388,7 +388,7 @@ trap(trapframe) ((type & ~T_USER) != T_SYSCALL)) { if (++count == 3) { trap_frame_dump(trapframe); - panic("too many faults at %p\n", last_badvaddr); + panic("too many faults at %x\n", last_badvaddr); } } else { last_badvaddr = this_badvaddr; @@ -569,7 +569,7 @@ dofault: --p->p_lock; PROC_UNLOCK(p); #ifdef VMFAULT_TRACE - printf("vm_fault(%x (pmap %x), %x (%x), %x, %d) -> %x at pc %x\n", + printf("vm_fault(%p (pmap %p), %x (%x), %x, %d) -> %x at pc %x\n", map, &vm->vm_pmap, va, trapframe->badvaddr, ftype, flag, rv, trapframe->pc); #endif @@ -1538,39 +1538,39 @@ static void log_frame_dump(struct trapframe *frame) { log(LOG_ERR, "Trapframe Register Dump:\n"); - log(LOG_ERR, "\tzero: %08x\tat: %08x\tv0: %08x\tv1: %08x\n", - 0, frame->ast, frame->v0, frame->v1); + log(LOG_ERR, "\tzero: %p\tat: %p\tv0: %p\tv1: %p\n", + (void *)0, (void *)frame->ast, (void *)frame->v0, (void *)frame->v1); - log(LOG_ERR, "\ta0: %08x\ta1: %08x\ta2: %08x\ta3: %08x\n", - frame->a0, frame->a1, frame->a2, frame->a3); + log(LOG_ERR, "\ta0: %p\ta1: %p\ta2: %p\ta3: %p\n", + (void *)frame->a0, (void *)frame->a1, (void *)frame->a2, (void *)frame->a3); - log(LOG_ERR, "\tt0: %08x\tt1: %08x\tt2: %08x\tt3: %08x\n", - frame->t0, frame->t1, frame->t2, frame->t3); + log(LOG_ERR, "\tt0: %p\tt1: %p\tt2: %p\tt3: %p\n", + (void *)frame->t0, (void *)frame->t1, (void *)frame->t2, (void *)frame->t3); - log(LOG_ERR, "\tt4: %08x\tt5: %08x\tt6: %08x\tt7: %08x\n", - frame->t4, frame->t5, frame->t6, frame->t7); + log(LOG_ERR, "\tt4: %p\tt5: %p\tt6: %p\tt7: %p\n", + (void *)frame->t4, (void *)frame->t5, (void *)frame->t6, (void *)frame->t7); - log(LOG_ERR, "\tt8: %08x\tt9: %08x\ts0: %08x\ts1: %08x\n", - frame->t8, frame->t9, frame->s0, frame->s1); + log(LOG_ERR, "\tt8: %p\tt9: %p\ts0: %p\ts1: %p\n", + (void *)frame->t8, (void *)frame->t9, (void *)frame->s0, (void *)frame->s1); - log(LOG_ERR, "\ts2: %08x\ts3: %08x\ts4: %08x\ts5: %08x\n", - frame->s2, frame->s3, frame->s4, frame->s5); + log(LOG_ERR, "\ts2: %p\ts3: %p\ts4: %p\ts5: %p\n", + (void *)frame->s2, (void *)frame->s3, (void *)frame->s4, (void *)frame->s5); - log(LOG_ERR, "\ts6: %08x\ts7: %08x\tk0: %08x\tk1: %08x\n", - frame->s6, frame->s7, frame->k0, frame->k1); + log(LOG_ERR, "\ts6: %p\ts7: %p\tk0: %p\tk1: %p\n", + (void *)frame->s6, (void *)frame->s7, (void *)frame->k0, (void *)frame->k1); - log(LOG_ERR, "\tgp: %08x\tsp: %08x\ts8: %08x\tra: %08x\n", - frame->gp, frame->sp, frame->s8, frame->ra); + log(LOG_ERR, "\tgp: %p\tsp: %p\ts8: %p\tra: %p\n", + (void *)frame->gp, (void *)frame->sp, (void *)frame->s8, (void *)frame->ra); - log(LOG_ERR, "\tsr: %08x\tmullo: %08x\tmulhi: %08x\tbadvaddr: %08x\n", - frame->sr, frame->mullo, frame->mulhi, frame->badvaddr); + log(LOG_ERR, "\tsr: %p\tmullo: %p\tmulhi: %p\tbadvaddr: %p\n", + (void *)frame->sr, (void *)frame->mullo, (void *)frame->mulhi, (void *)frame->badvaddr); #ifdef IC_REG - log(LOG_ERR, "\tcause: %08x\tpc: %08x\tic: %08x\n", - frame->cause, frame->pc, frame->ic); + log(LOG_ERR, "\tcause: %p\tpc: %p\tic: %p\n", + (void *)frame->cause, (void *)frame->pc, (void *)frame->ic); #else - log(LOG_ERR, "\tcause: %08x\tpc: %08x\n", - frame->cause, frame->pc); + log(LOG_ERR, "\tcause: %p\tpc: %p\n", + (void *)frame->cause, (void *)frame->pc); #endif } @@ -1579,39 +1579,39 @@ static void trap_frame_dump(struct trapframe *frame) { printf("Trapframe Register Dump:\n"); - printf("\tzero: %08x\tat: %08x\tv0: %08x\tv1: %08x\n", - 0, frame->ast, frame->v0, frame->v1); + printf("\tzero: %p\tat: %p\tv0: %p\tv1: %p\n", + (void *)0, (void *)frame->ast, (void *)frame->v0, (void *)frame->v1); - printf("\ta0: %08x\ta1: %08x\ta2: %08x\ta3: %08x\n", - frame->a0, frame->a1, frame->a2, frame->a3); + printf("\ta0: %p\ta1: %p\ta2: %p\ta3: %p\n", + (void *)frame->a0, (void *)frame->a1, (void *)frame->a2, (void *)frame->a3); - printf("\tt0: %08x\tt1: %08x\tt2: %08x\tt3: %08x\n", - frame->t0, frame->t1, frame->t2, frame->t3); + printf("\tt0: %p\tt1: %p\tt2: %p\tt3: %p\n", + (void *)frame->t0, (void *)frame->t1, (void *)frame->t2, (void *)frame->t3); - printf("\tt4: %08x\tt5: %08x\tt6: %08x\tt7: %08x\n", - frame->t4, frame->t5, frame->t6, frame->t7); + printf("\tt4: %p\tt5: %p\tt6: %p\tt7: %p\n", + (void *)frame->t4, (void *)frame->t5, (void *)frame->t6, (void *)frame->t7); - printf("\tt8: %08x\tt9: %08x\ts0: %08x\ts1: %08x\n", - frame->t8, frame->t9, frame->s0, frame->s1); + printf("\tt8: %p\tt9: %p\ts0: %p\ts1: %p\n", + (void *)frame->t8, (void *)frame->t9, (void *)frame->s0, (void *)frame->s1); - printf("\ts2: %08x\ts3: %08x\ts4: %08x\ts5: %08x\n", - frame->s2, frame->s3, frame->s4, frame->s5); + printf("\ts2: %p\ts3: %p\ts4: %p\ts5: %p\n", + (void *)frame->s2, (void *)frame->s3, (void *)frame->s4, (void *)frame->s5); - printf("\ts6: %08x\ts7: %08x\tk0: %08x\tk1: %08x\n", - frame->s6, frame->s7, frame->k0, frame->k1); + printf("\ts6: %p\ts7: %p\tk0: %p\tk1: %p\n", + (void *)frame->s6, (void *)frame->s7, (void *)frame->k0, (void *)frame->k1); - printf("\tgp: %08x\tsp: %08x\ts8: %08x\tra: %08x\n", - frame->gp, frame->sp, frame->s8, frame->ra); + printf("\tgp: %p\tsp: %p\ts8: %p\tra: %p\n", + (void *)frame->gp, (void *)frame->sp, (void *)frame->s8, (void *)frame->ra); - printf("\tsr: %08x\tmullo: %08x\tmulhi: %08x\tbadvaddr: %08x\n", - frame->sr, frame->mullo, frame->mulhi, frame->badvaddr); + printf("\tsr: %p\tmullo: %p\tmulhi: %p\tbadvaddr: %p\n", + (void *)frame->sr, (void *)frame->mullo, (void *)frame->mulhi, (void *)frame->badvaddr); #ifdef IC_REG - printf("\tcause: %08x\tpc: %08x\tic: %08x\n", - frame->cause, frame->pc, frame->ic); + printf("\tcause: %p\tpc: %p\tic: %p\n", + (void *)frame->cause, (void *)frame->pc, (void *)frame->ic); #else - printf("\tcause: %08x\tpc: %08x\n", - frame->cause, frame->pc); + printf("\tcause: %p\tpc: %p\n", + (void *)frame->cause, (void *)frame->pc); #endif } @@ -1666,12 +1666,12 @@ log_bad_page_fault(char *msg, struct tra } pc = frame->pc + (DELAYBRANCH(frame->cause) ? 4 : 0); - log(LOG_ERR, "%s: pid %d (%s), uid %d: pc 0x%x got a %s fault at 0x%x\n", + log(LOG_ERR, "%s: pid %d (%s), uid %d: pc %p got a %s fault at %p\n", msg, p->p_pid, p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, - pc, + (void *)pc, read_or_write, - frame->badvaddr); + (void *)frame->badvaddr); /* log registers in trap frame */ log_frame_dump(frame); @@ -1686,8 +1686,8 @@ log_bad_page_fault(char *msg, struct tra (trap_type != T_BUS_ERR_IFETCH) && useracc((caddr_t)pc, sizeof(int) * 4, VM_PROT_READ)) { /* dump page table entry for faulting instruction */ - log(LOG_ERR, "Page table info for pc address 0x%x: pde = %p, pte = 0x%lx\n", - pc, *pdep, ptep ? *ptep : 0); + log(LOG_ERR, "Page table info for pc address %p: pde = %p, pte = 0x%lx\n", + (void *)pc, *pdep, ptep ? *ptep : 0); addr = (unsigned int *)pc; log(LOG_ERR, "Dumping 4 words starting at pc address %p: \n", @@ -1695,8 +1695,8 @@ log_bad_page_fault(char *msg, struct tra log(LOG_ERR, "%08x %08x %08x %08x\n", addr[0], addr[1], addr[2], addr[3]); } else { - log(LOG_ERR, "pc address 0x%x is inaccessible, pde = 0x%p, pte = 0x%lx\n", - pc, *pdep, ptep ? *ptep : 0); + log(LOG_ERR, "pc address %p is inaccessible, pde = 0x%p, pte = 0x%lx\n", + (void *)pc, *pdep, ptep ? *ptep : 0); } /* panic("Bad trap");*/ } @@ -1805,8 +1805,9 @@ emulate_unaligned_access(struct trapfram else frame->pc += 4; - log(LOG_INFO, "Unaligned %s: pc=0x%x, badvaddr=0x%x\n", - access_name[access_type - 1], pc, frame->badvaddr); + log(LOG_INFO, "Unaligned %s: pc=%p, badvaddr=%p\n", + access_name[access_type - 1], (void *)pc, + (void *)frame->badvaddr); } } return access_type; From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:13:25 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D49A106564A; Sun, 5 Jul 2009 15:13:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF3538FC08; Sun, 5 Jul 2009 15:13:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FDOq9052578; Sun, 5 Jul 2009 15:13:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FDO23052576; Sun, 5 Jul 2009 15:13:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051513.n65FDO23052576@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195365 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:13:25 -0000 Author: imp Date: Sun Jul 5 15:13:24 2009 New Revision: 195365 URL: http://svn.freebsd.org/changeset/base/195365 Log: First cut at atomics for 64-bit machines and SMP machines. # Note: Cavium provided a port that has atomics similar to these, but # that does a syncw; sync; atomic; sync; syncw where we just do the classic # mips 'atomic' operation (eg ll; frob; sc). It is unclear to me why # the extra is needed. Since my initial target is one core, I'll defer # investigation until I bring up multiple cores. syncw is an octeon specific # instruction. Modified: projects/mips/sys/mips/include/atomic.h Modified: projects/mips/sys/mips/include/atomic.h ============================================================================== --- projects/mips/sys/mips/include/atomic.h Sun Jul 5 15:10:07 2009 (r195364) +++ projects/mips/sys/mips/include/atomic.h Sun Jul 5 15:13:24 2009 (r195365) @@ -34,6 +34,17 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +/* + * Note: All the 64-bit atomic operations are only atomic when running + * in 64-bit mode. It is assumed that code compiled for n32 and n64 + * fits into this definition and no further safeties are needed. + * + * It is also assumed that the add, subtract and other arithmetic is + * done on numbers not pointers. The special rules for n32 pointers + * do not have atomic operations defined for them, but generally shouldn't + * need atomic operations. + */ + static __inline void mips_sync(void) { @@ -166,6 +177,110 @@ atomic_readandset_32(__volatile uint32_t return result; } +#if defined(__mips_n64) || defined(__mips_n32) +static __inline void +atomic_set_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "or %0, %2, %0\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); + +} + +static __inline void +atomic_clear_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + v = ~v; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "and %0, %2, %0\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); +} + +static __inline void +atomic_add_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "addu %0, %2, %0\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); +} + +static __inline void +atomic_subtract_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "subu %0, %2\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); +} + +static __inline uint64_t +atomic_readandclear_64(__volatile uint64_t *addr) +{ + uint64_t result,temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "li %1, 0\n\t" /* value to store */ + "scd %1, %2\n\t" /* attempt to store */ + "beqz %1, 1b\n\t" /* if the store failed, spin */ + : "=&r"(result), "=&r"(temp), "=m" (*addr) + : "m" (*addr) + : "memory"); + + return result; +} + +static __inline uint64_t +atomic_readandset_64(__volatile uint64_t *addr, uint64_t value) +{ + uint64_t result,temp; + + __asm __volatile ( + "1:\n\t" + "lld %0,%3\n\t" /* Load old value*/ + "or %1,$0,%4\n\t" + "scd %1,%2\n\t" /* attempt to store */ + "beqz %1, 1b\n\t" /* if the store failed, spin */ + : "=&r"(result), "=&r"(temp), "=m" (*addr) + : "m" (*addr), "r" (value) + : "memory"); + + return result; +} +#endif + #define ATOMIC_ACQ_REL(NAME, WIDTH) \ static __inline void \ atomic_##NAME##_acq_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\ @@ -194,7 +309,7 @@ ATOMIC_ACQ_REL(set, 32) ATOMIC_ACQ_REL(clear, 32) ATOMIC_ACQ_REL(add, 32) ATOMIC_ACQ_REL(subtract, 32) -#if 0 +#if defined(__mips_n64) || defined(__mips_n32) ATOMIC_ACQ_REL(set, 64) ATOMIC_ACQ_REL(clear, 64) ATOMIC_ACQ_REL(add, 64) @@ -226,8 +341,23 @@ atomic_store_rel_##WIDTH(__volatile uint ATOMIC_STORE_LOAD(32) ATOMIC_STORE_LOAD(64) -void atomic_store_64 (__volatile uint64_t *, uint64_t *); -void atomic_load_64 (__volatile uint64_t *, uint64_t *); +#if !defined(__mips_n64) && !defined(__mips_n32) +void atomic_store_64(__volatile uint64_t *, uint64_t *); +void atomic_load_64(__volatile uint64_t *, uint64_t *); +#else +static __inline void +atomic_store_64(__volatile uint64_t *p, uint64_t v) +{ + + *p = v; +} + +static __inline void +atomic_load_64(__volatile uint64_t *p, uint64_t *v) +{ + *v = *p; +} +#endif #undef ATOMIC_STORE_LOAD @@ -299,6 +429,78 @@ atomic_fetchadd_32(__volatile uint32_t * return (value); } +#if defined(__mips_n64) || defined(__mips_n32) +/* + * Atomically compare the value stored at *p with cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed, nonzero otherwise. + */ +static __inline uint64_t +atomic_cmpset_64(__volatile uint64_t* p, uint64_t cmpval, uint64_t newval) +{ + uint64_t ret; + + __asm __volatile ( + "1:\n\t" + "lld %0, %4\n\t" /* load old value */ + "bne %0, %2, 2f\n\t" /* compare */ + "move %0, %3\n\t" /* value to store */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* if it failed, spin */ + "j 3f\n\t" + "2:\n\t" + "li %0, 0\n\t" + "3:\n" + : "=&r" (ret), "=m" (*p) + : "r" (cmpval), "r" (newval), "m" (*p) + : "memory"); + + return ret; +} + +/* + * Atomically compare the value stored at *p with cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed, nonzero otherwise. + */ +static __inline uint64_t +atomic_cmpset_acq_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +{ + int retval; + + retval = atomic_cmpset_64(p, cmpval, newval); + mips_sync(); + return (retval); +} + +static __inline uint64_t +atomic_cmpset_rel_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +{ + mips_sync(); + return (atomic_cmpset_64(p, cmpval, newval)); +} + +/* + * Atomically add the value of v to the integer pointed to by p and return + * the previous value of *p. + */ +static __inline uint64_t +atomic_fetchadd_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t value, temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %1\n\t" /* load old value */ + "addu %2, %3, %0\n\t" /* calculate new value */ + "scd %2, %1\n\t" /* attempt to store */ + "beqz %2, 1b\n\t" /* spin if failed */ + : "=&r" (value), "=m" (*p), "=&r" (temp) + : "r" (v), "m" (*p)); + return (value); +} +#endif + /* Operations on chars. */ #define atomic_set_char atomic_set_8 #define atomic_set_acq_char atomic_set_acq_8 @@ -349,7 +551,13 @@ atomic_fetchadd_32(__volatile uint32_t * #define atomic_readandset_int atomic_readandset_32 #define atomic_fetchadd_int atomic_fetchadd_32 -#ifdef __mips64 +/* + * I think the following is right, even for n32. For n32 the pointers + * are still 32-bits, so we need to operate on them as 32-bit quantities, + * even though they are sign extended in operation. For longs, there's + * no question because they are always 32-bits. + */ +#ifdef __mips_n64 /* Operations on longs. */ #define atomic_set_long atomic_set_64 #define atomic_set_acq_long atomic_set_acq_64 @@ -371,27 +579,7 @@ atomic_fetchadd_32(__volatile uint32_t * #define atomic_fetchadd_long atomic_fetchadd_64 #define atomic_readandclear_long atomic_readandclear_64 -/* Operations on pointers. */ -#define atomic_set_ptr atomic_set_64 -#define atomic_set_acq_ptr atomic_set_acq_64 -#define atomic_set_rel_ptr atomic_set_rel_64 -#define atomic_clear_ptr atomic_clear_64 -#define atomic_clear_acq_ptr atomic_clear_acq_64 -#define atomic_clear_rel_ptr atomic_clear_rel_64 -#define atomic_add_ptr atomic_add_64 -#define atomic_add_acq_ptr atomic_add_acq_64 -#define atomic_add_rel_ptr atomic_add_rel_64 -#define atomic_subtract_ptr atomic_subtract_64 -#define atomic_subtract_acq_ptr atomic_subtract_acq_64 -#define atomic_subtract_rel_ptr atomic_subtract_rel_64 -#define atomic_cmpset_ptr atomic_cmpset_64 -#define atomic_cmpset_acq_ptr atomic_cmpset_acq_64 -#define atomic_cmpset_rel_ptr atomic_cmpset_rel_64 -#define atomic_load_acq_ptr atomic_load_acq_64 -#define atomic_store_rel_ptr atomic_store_rel_64 -#define atomic_readandclear_ptr atomic_readandclear_64 - -#else /* __mips64 */ +#else /* !__mips_n64 */ /* Operations on longs. */ #define atomic_set_long atomic_set_32 @@ -421,27 +609,26 @@ atomic_fetchadd_32(__volatile uint32_t * atomic_fetchadd_32((volatile u_int *)(p), (u_int)(v)) #define atomic_readandclear_long atomic_readandclear_32 +#endif /* __mips_n64 */ + /* Operations on pointers. */ -#define atomic_set_ptr atomic_set_32 -#define atomic_set_acq_ptr atomic_set_acq_32 -#define atomic_set_rel_ptr atomic_set_rel_32 -#define atomic_clear_ptr atomic_clear_32 -#define atomic_clear_acq_ptr atomic_clear_acq_32 -#define atomic_clear_rel_ptr atomic_clear_rel_32 -#define atomic_add_ptr atomic_add_32 -#define atomic_add_acq_ptr atomic_add_acq_32 -#define atomic_add_rel_ptr atomic_add_rel_32 -#define atomic_subtract_ptr atomic_subtract_32 -#define atomic_subtract_acq_ptr atomic_subtract_acq_32 -#define atomic_subtract_rel_ptr atomic_subtract_rel_32 -#define atomic_cmpset_ptr atomic_cmpset_32 -#define atomic_cmpset_acq_ptr(dst, old, new) \ - atomic_cmpset_acq_32((volatile u_int *)(dst), \ - (u_int)(old), (u_int)(new)) -#define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 -#define atomic_load_acq_ptr atomic_load_acq_32 -#define atomic_store_rel_ptr atomic_store_rel_32 -#define atomic_readandclear_ptr atomic_readandclear_32 -#endif /* __mips64 */ +#define atomic_set_ptr atomic_set_long +#define atomic_set_acq_ptr atomic_set_acq_long +#define atomic_set_rel_ptr atomic_set_rel_long +#define atomic_clear_ptr atomic_clear_long +#define atomic_clear_acq_ptr atomic_clear_acq_long +#define atomic_clear_rel_ptr atomic_clear_rel_long +#define atomic_add_ptr atomic_add_long +#define atomic_add_acq_ptr atomic_add_acq_long +#define atomic_add_rel_ptr atomic_add_rel_long +#define atomic_subtract_ptr atomic_subtract_long +#define atomic_subtract_acq_ptr atomic_subtract_acq_long +#define atomic_subtract_rel_ptr atomic_subtract_rel_long +#define atomic_cmpset_ptr atomic_cmpset_long +#define atomic_cmpset_acq_ptr atomic_cmpset_acq_long +#define atomic_cmpset_rel_ptr atomic_cmpset_rel_long +#define atomic_load_acq_ptr atomic_load_acq_long +#define atomic_store_rel_ptr atomic_store_rel_long +#define atomic_readandclear_ptr atomic_readandclear_long #endif /* ! _MACHINE_ATOMIC_H_ */ From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:16:28 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3448E1065689; Sun, 5 Jul 2009 15:16:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 231D58FC1B; Sun, 5 Jul 2009 15:16:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FGSU5052668; Sun, 5 Jul 2009 15:16:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FGSKq052666; Sun, 5 Jul 2009 15:16:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051516.n65FGSKq052666@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195366 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:16:28 -0000 Author: imp Date: Sun Jul 5 15:16:27 2009 New Revision: 195366 URL: http://svn.freebsd.org/changeset/base/195366 Log: Trim unreferenced goo. SDRAM likely should be next, but it is still referenced. Modified: projects/mips/sys/mips/include/pltfm.h Modified: projects/mips/sys/mips/include/pltfm.h ============================================================================== --- projects/mips/sys/mips/include/pltfm.h Sun Jul 5 15:13:24 2009 (r195365) +++ projects/mips/sys/mips/include/pltfm.h Sun Jul 5 15:16:27 2009 (r195366) @@ -13,17 +13,4 @@ #define SDRAM_ADDR_END (SDRAM_ADDR_START + (1024*0x100000)) #define SDRAM_MEM_SIZE (SDRAM_ADDR_END - SDRAM_ADDR_START) -#define UART_ADDR_START 0x1ef14000 /* UART */ -#define UART_ADDR_END 0x1ef14fff -#define UART_MEM_SIZE (UART_ADDR_END-UART_ADDR_START) - -/* - * NS16550 UART address - */ -#ifdef ADDR_NS16550_UART1 -#undef ADDR_NS16550_UART1 -#endif -#define ADDR_NS16550_UART1 0x1ef14000 /* UART */ -#define VADDR_NS16550_UART1 0xbef14000 /* UART */ - #endif /* !_MACHINE_PLTFM_H_ */ From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:17:11 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAA211065672; Sun, 5 Jul 2009 15:17:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F4BD8FC18; Sun, 5 Jul 2009 15:17:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FHBI1052724; Sun, 5 Jul 2009 15:17:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FHBb1052722; Sun, 5 Jul 2009 15:17:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051517.n65FHBb1052722@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195367 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:17:12 -0000 Author: imp Date: Sun Jul 5 15:17:11 2009 New Revision: 195367 URL: http://svn.freebsd.org/changeset/base/195367 Log: First cut at 64-bit types. not 100% sure these are all correct for N32 ABI. Modified: projects/mips/sys/mips/include/_types.h Modified: projects/mips/sys/mips/include/_types.h ============================================================================== --- projects/mips/sys/mips/include/_types.h Sun Jul 5 15:16:27 2009 (r195366) +++ projects/mips/sys/mips/include/_types.h Sun Jul 5 15:17:11 2009 (r195367) @@ -54,7 +54,7 @@ typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; -#ifdef __mips64 +#ifdef __mips_n64 typedef long __int64_t; typedef unsigned long __uint64_t; #else @@ -79,14 +79,14 @@ typedef unsigned long long __uint64_t; */ typedef __int32_t __clock_t; /* clock()... */ typedef unsigned int __cpumask_t; -#ifdef __mips64 +#ifdef __mips_n64 typedef __int64_t __critical_t; #else typedef __int32_t __critical_t; #endif typedef double __double_t; typedef double __float_t; -#ifdef __mips64 +#ifdef __mips_n64 typedef __int64_t __intfptr_t; typedef __int64_t __intptr_t; #else @@ -102,14 +102,14 @@ typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; -#if defined(__mips64) || defined(ISA_MIPS64) +#if defined(__mips_n64) || defined(ISA_MIPS64) typedef __int64_t __register_t; typedef __int64_t f_register_t; #else typedef __int32_t __register_t; typedef __int32_t f_register_t; #endif -#ifdef __mips64 +#ifdef __mips_n64 typedef __int64_t __ptrdiff_t; typedef __int64_t __segsz_t; typedef __uint64_t __size_t; @@ -134,7 +134,7 @@ typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; -#if defined(__mips64) || defined(ISA_MIPS64) +#if defined(__mips_n64) || defined(ISA_MIPS64) typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; typedef __uint64_t __vm_paddr_t; From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:18:06 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D49B1065674; Sun, 5 Jul 2009 15:18:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8168FC08; Sun, 5 Jul 2009 15:18:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FI6TW052776; Sun, 5 Jul 2009 15:18:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FI6bH052774; Sun, 5 Jul 2009 15:18:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051518.n65FI6bH052774@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195368 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:18:06 -0000 Author: imp Date: Sun Jul 5 15:18:06 2009 New Revision: 195368 URL: http://svn.freebsd.org/changeset/base/195368 Log: compute the areas to save registers in for 64-bit access correctly. Modified: projects/mips/sys/mips/include/ucontext.h Modified: projects/mips/sys/mips/include/ucontext.h ============================================================================== --- projects/mips/sys/mips/include/ucontext.h Sun Jul 5 15:17:11 2009 (r195367) +++ projects/mips/sys/mips/include/ucontext.h Sun Jul 5 15:18:06 2009 (r195368) @@ -58,10 +58,14 @@ typedef struct __mcontext { } mcontext_t; #endif +#if defined(__mips_n64) || defined(__mips_n32) +#define SZREG 8 +#else #define SZREG 4 +#endif /* offsets into mcontext_t */ -#define UCTX_REG(x) (8 + (x)*SZREG) +#define UCTX_REG(x) (4 + SZREG + (x)*SZREG) #define UCR_ZERO UCTX_REG(0) #define UCR_AT UCTX_REG(1) From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:19:28 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF38A106564A; Sun, 5 Jul 2009 15:19:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE9448FC16; Sun, 5 Jul 2009 15:19:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FJSj2052835; Sun, 5 Jul 2009 15:19:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FJSVU052833; Sun, 5 Jul 2009 15:19:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051519.n65FJSVU052833@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195369 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:19:29 -0000 Author: imp Date: Sun Jul 5 15:19:28 2009 New Revision: 195369 URL: http://svn.freebsd.org/changeset/base/195369 Log: The SB1 needs a special value for the cache field of the pte. Submitted by: Neelkanth Natu Modified: projects/mips/sys/mips/include/pte.h Modified: projects/mips/sys/mips/include/pte.h ============================================================================== --- projects/mips/sys/mips/include/pte.h Sun Jul 5 15:18:06 2009 (r195368) +++ projects/mips/sys/mips/include/pte.h Sun Jul 5 15:19:28 2009 (r195369) @@ -105,7 +105,11 @@ typedef pt_entry_t *pd_entry_t; #define PTE_ODDPG 0x00001000 /*#define PG_ATTR 0x0000003f Not Used */ #define PTE_UNCACHED 0x00000010 +#ifdef CPU_SB1 +#define PTE_CACHE 0x00000028 /* cacheable coherent */ +#else #define PTE_CACHE 0x00000018 +#endif /*#define PG_CACHEMODE 0x00000038 Not Used*/ #define PTE_ROPAGE (PTE_V | PTE_RO | PTE_CACHE) /* Write protected */ #define PTE_RWPAGE (PTE_V | PTE_M | PTE_CACHE) /* Not wr-prot not clean */ From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:20:16 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B221065672; Sun, 5 Jul 2009 15:20:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86C0B8FC19; Sun, 5 Jul 2009 15:20:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FKGBJ052891; Sun, 5 Jul 2009 15:20:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FKGEf052889; Sun, 5 Jul 2009 15:20:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051520.n65FKGEf052889@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195370 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:20:17 -0000 Author: imp Date: Sun Jul 5 15:20:16 2009 New Revision: 195370 URL: http://svn.freebsd.org/changeset/base/195370 Log: The SB1 has cohernet memory, so add it. Also, Maxmem is better as a long. Submitted by: Neelkanth Natu Modified: projects/mips/sys/mips/include/md_var.h Modified: projects/mips/sys/mips/include/md_var.h ============================================================================== --- projects/mips/sys/mips/include/md_var.h Sun Jul 5 15:19:28 2009 (r195369) +++ projects/mips/sys/mips/include/md_var.h Sun Jul 5 15:20:16 2009 (r195370) @@ -39,7 +39,7 @@ /* * Miscellaneous machine-dependent declarations. */ -extern int Maxmem; +extern long Maxmem; extern char sigcode[]; extern int szsigcode, szosigcode; @@ -52,6 +52,7 @@ u_int MipsEmulateBranch(struct trapframe u_long kvtop(void *addr); int is_physical_memory(vm_offset_t addr); int is_cacheable_mem(vm_offset_t pa); +int is_coherent_mem(vm_offset_t pa); #define MIPS_DEBUG 0 From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:21:35 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65CF71065680; Sun, 5 Jul 2009 15:21:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5403B8FC20; Sun, 5 Jul 2009 15:21:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FLZlr052954; Sun, 5 Jul 2009 15:21:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FLZDX052952; Sun, 5 Jul 2009 15:21:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051521.n65FLZDX052952@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195371 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:21:35 -0000 Author: imp Date: Sun Jul 5 15:21:35 2009 New Revision: 195371 URL: http://svn.freebsd.org/changeset/base/195371 Log: Now that we define atomic_{load,store}_64 inline in atomic.h, we don't need to define them here for the !N64 case. We now define atomic_readandclear_64 in atomic.h, so no need to repeat it here. Modified: projects/mips/sys/mips/mips/support.S Modified: projects/mips/sys/mips/mips/support.S ============================================================================== --- projects/mips/sys/mips/mips/support.S Sun Jul 5 15:20:16 2009 (r195370) +++ projects/mips/sys/mips/mips/support.S Sun Jul 5 15:21:35 2009 (r195371) @@ -1316,17 +1316,11 @@ END(atomic_subtract_8) .set mips3 #endif -LEAF(atomic_readandclear_64) -1: - lld v0, 0(a0) - li t0, 0 - scd t0, 0(a0) - beqz t0, 1b - nop - j ra - nop -END(atomic_readandclear_64) - +#if !defined(__mips_n64) && !defined(__mips_n32) + /* + * I don't know if these routines have the right number of + * NOPs in it for all processors. XXX + */ LEAF(atomic_store_64) mfc0 t1, COP_0_STATUS_REG and t2, t1, ~SR_INT_ENAB @@ -1372,6 +1366,7 @@ LEAF(atomic_load_64) j ra nop END(atomic_load_64) +#endif #if defined(DDB) || defined(DEBUG) From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:22:22 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E021B1065672; Sun, 5 Jul 2009 15:22:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8A78FC16; Sun, 5 Jul 2009 15:22:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FMMoP053019; Sun, 5 Jul 2009 15:22:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FMMCD053017; Sun, 5 Jul 2009 15:22:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051522.n65FMMCD053017@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195372 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:22:23 -0000 Author: imp Date: Sun Jul 5 15:22:22 2009 New Revision: 195372 URL: http://svn.freebsd.org/changeset/base/195372 Log: use "PTR_LA" in preference to a bare la so it translates to dla on 64-bit ABIs. Modified: projects/mips/sys/mips/mips/swtch.S Modified: projects/mips/sys/mips/mips/swtch.S ============================================================================== --- projects/mips/sys/mips/mips/swtch.S Sun Jul 5 15:21:35 2009 (r195371) +++ projects/mips/sys/mips/mips/swtch.S Sun Jul 5 15:22:22 2009 (r195372) @@ -323,7 +323,7 @@ NON_LEAF(cpu_switch, STAND_FRAME_SIZE, r mips_sw1: #if defined(SMP) && defined(SCHED_ULE) - la t0, _C_LABEL(blocked_lock) + PTR_LA t0, _C_LABEL(blocked_lock) blocked_loop: lw t1, TD_LOCK(a1) beq t0, t1, blocked_loop @@ -388,7 +388,7 @@ entry0set: * Now running on new u struct. */ sw2: - la t1, _C_LABEL(pmap_activate) # s7 = new proc pointer + PTR_LA t1, _C_LABEL(pmap_activate) # s7 = new proc pointer jalr t1 # s7 = new proc pointer move a0, s7 # BDSLOT /* From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 15:23:54 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83CBB1065670; Sun, 5 Jul 2009 15:23:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72C338FC18; Sun, 5 Jul 2009 15:23:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65FNsNm053079; Sun, 5 Jul 2009 15:23:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65FNsQ8053077; Sun, 5 Jul 2009 15:23:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907051523.n65FNsQ8053077@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 15:23:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195373 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 15:23:54 -0000 Author: imp Date: Sun Jul 5 15:23:54 2009 New Revision: 195373 URL: http://svn.freebsd.org/changeset/base/195373 Log: (1) Use PTR_LA rather than bare la for N64 goodness (it is dla there) (2) SB1 needs COHERENT policy, not cached for the config register Submitted by: (2) Neelkanth Natu Modified: projects/mips/sys/mips/mips/locore.S Modified: projects/mips/sys/mips/mips/locore.S ============================================================================== --- projects/mips/sys/mips/mips/locore.S Sun Jul 5 15:22:22 2009 (r195372) +++ projects/mips/sys/mips/mips/locore.S Sun Jul 5 15:23:54 2009 (r195373) @@ -138,7 +138,11 @@ VECTOR(_locore, unknown) mtc0 t2, COP_0_STATUS_REG COP0_SYNC /* Make sure KSEG0 is cached */ +#ifdef CPU_SB1 + li t0, CFG_K0_COHERENT +#else li t0, CFG_K0_CACHED +#endif mtc0 t0, MIPS_COP_0_CONFIG COP0_SYNC @@ -164,8 +168,8 @@ VECTOR(_locore, unknown) /* * Initialize stack and call machine startup. */ - la sp, _C_LABEL(topstack) - START_FRAME - la gp, _C_LABEL(_gp) + PTR_LA sp, _C_LABEL(topstack) - START_FRAME + PTR_LA gp, _C_LABEL(_gp) sw zero, START_FRAME - 4(sp) # Zero out old ra for debugger /*xxximp @@ -187,7 +191,7 @@ VECTOR(_locore, unknown) no_cfe: #endif #if defined(TARGET_OCTEON) - la a0, app_descriptor_addr + PTR_LA a0, app_descriptor_addr sw a3, 0(a0) /* Store app descriptor ptr */ #endif @@ -232,7 +236,7 @@ no_cfe: nop #ifdef SMP - la t0, _C_LABEL(__pcpu) + PTR_LA t0, _C_LABEL(__pcpu) SET_CPU_PCPU(t0) /* If not master cpu, jump... */ /*XXX this assumes the above #if 0'd code runs */ @@ -244,7 +248,7 @@ no_cfe: jal _C_LABEL(platform_start) sw zero, START_FRAME - 8(sp) # Zero out old fp for debugger - la sp, _C_LABEL(thread0) + PTR_LA sp, _C_LABEL(thread0) lw a0, TD_PCB(sp) li t0, ~7 and a0, a0, t0 From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 21:16:26 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB751065670; Sun, 5 Jul 2009 21:16:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAC3E8FC16; Sun, 5 Jul 2009 21:16:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65LGQjO059894; Sun, 5 Jul 2009 21:16:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65LGQfO059892; Sun, 5 Jul 2009 21:16:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907052116.n65LGQfO059892@svn.freebsd.org> From: Warner Losh Date: Sun, 5 Jul 2009 21:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195382 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 21:16:27 -0000 Author: imp Date: Sun Jul 5 21:16:26 2009 New Revision: 195382 URL: http://svn.freebsd.org/changeset/base/195382 Log: addu and subu are special. We need to use daddu and dsubu here to get proper behavior. Submitted by: jmallet@ Modified: projects/mips/sys/mips/include/atomic.h Modified: projects/mips/sys/mips/include/atomic.h ============================================================================== --- projects/mips/sys/mips/include/atomic.h Sun Jul 5 20:44:50 2009 (r195381) +++ projects/mips/sys/mips/include/atomic.h Sun Jul 5 21:16:26 2009 (r195382) @@ -220,7 +220,7 @@ atomic_add_64(__volatile uint64_t *p, ui __asm __volatile ( "1:\n\t" "lld %0, %3\n\t" /* load old value */ - "addu %0, %2, %0\n\t" /* calculate new value */ + "daddu %0, %2, %0\n\t" /* calculate new value */ "scd %0, %1\n\t" /* attempt to store */ "beqz %0, 1b\n\t" /* spin if failed */ : "=&r" (temp), "=m" (*p) @@ -236,7 +236,7 @@ atomic_subtract_64(__volatile uint64_t * __asm __volatile ( "1:\n\t" "lld %0, %3\n\t" /* load old value */ - "subu %0, %2\n\t" /* calculate new value */ + "dsubu %0, %2\n\t" /* calculate new value */ "scd %0, %1\n\t" /* attempt to store */ "beqz %0, 1b\n\t" /* spin if failed */ : "=&r" (temp), "=m" (*p) From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 21:35:05 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA22D1065670; Sun, 5 Jul 2009 21:35:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A83C68FC0A; Sun, 5 Jul 2009 21:35:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65LZ5WG060321; Sun, 5 Jul 2009 21:35:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65LZ5JJ060318; Sun, 5 Jul 2009 21:35:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907052135.n65LZ5JJ060318@svn.freebsd.org> From: Sam Leffler Date: Sun, 5 Jul 2009 21:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195384 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 21:35:06 -0000 Author: sam Date: Sun Jul 5 21:35:05 2009 New Revision: 195384 URL: http://svn.freebsd.org/changeset/base/195384 Log: o clear vap pointers to private state to catch use-after-free instances o fix use-after-free problem on mesh detach; the last reference to the bss node is reclaimed after mesh (and hwmp) state has been reclaimed so must not touch anything outside the node (or that we know is still accessible) Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Sun Jul 5 21:19:10 2009 (r195383) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Sun Jul 5 21:35:05 2009 (r195384) @@ -302,6 +302,7 @@ ieee80211_hwmp_vdetach(struct ieee80211v callout_drain(&hs->hs_roottimer); mtx_destroy(&hs->hs_lock); free(vap->iv_hwmp, M_80211_HWMP); + vap->iv_hwmp = NULL; } int Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Sun Jul 5 21:19:10 2009 (r195383) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Sun Jul 5 21:35:05 2009 (r195384) @@ -177,6 +177,7 @@ mesh_vdetach(struct ieee80211vap *vap) NULL); ieee80211_hwmp_vdetach(vap); free(vap->iv_mesh, M_80211_VAP); + vap->iv_mesh = NULL; } static void @@ -2099,8 +2100,12 @@ ieee80211_mesh_node_init(struct ieee8021 void ieee80211_mesh_node_cleanup(struct ieee80211_node *ni) { + struct ieee80211vap *vap = ni->ni_vap; + callout_drain(&ni->ni_mltimer); - ieee80211_hwmp_peerdown(ni); + /* NB: short-circuit callbacks after mesh_vdetach */ + if (vap->iv_mesh != NULL) + ieee80211_hwmp_peerdown(ni); } void From owner-svn-src-projects@FreeBSD.ORG Sun Jul 5 21:47:43 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB4E10656D4; Sun, 5 Jul 2009 21:47:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BD158FC0A; Sun, 5 Jul 2009 21:47:41 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65LleaU060626; Sun, 5 Jul 2009 21:47:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65Lle4k060624; Sun, 5 Jul 2009 21:47:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907052147.n65Lle4k060624@svn.freebsd.org> From: Rui Paulo Date: Sun, 5 Jul 2009 21:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195386 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 21:47:44 -0000 Author: rpaulo Date: Sun Jul 5 21:47:39 2009 New Revision: 195386 URL: http://svn.freebsd.org/changeset/base/195386 Log: Fix RANN IE processing. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Sun Jul 5 21:40:21 2009 (r195385) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Sun Jul 5 21:47:39 2009 (r195386) @@ -429,6 +429,7 @@ hwmp_recv_action_meshpath_rann(struct ie if (*iefrm == IEEE80211_ELEMID_MESHRANN) { const struct ieee80211_meshrann_ie *mrann = (const struct ieee80211_meshrann_ie *) iefrm; + memcpy(&rann, mrann, sizeof(rann)); rann.rann_seq = LE_READ_4(&mrann->rann_seq); rann.rann_metric = LE_READ_4(&mrann->rann_metric); hwmp_recv_rann(vap, ni, wh, &rann); From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 02:22:06 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D9E2106564A; Mon, 6 Jul 2009 02:22:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDE08FC17; Mon, 6 Jul 2009 02:22:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n662M6lo065996; Mon, 6 Jul 2009 02:22:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n662M6jN065994; Mon, 6 Jul 2009 02:22:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060222.n662M6jN065994@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 02:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195390 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 02:22:06 -0000 Author: imp Date: Mon Jul 6 02:22:06 2009 New Revision: 195390 URL: http://svn.freebsd.org/changeset/base/195390 Log: Change the addu here to daddu. addu paranoina prodded by: jmallet@ Modified: projects/mips/sys/mips/include/atomic.h Modified: projects/mips/sys/mips/include/atomic.h ============================================================================== --- projects/mips/sys/mips/include/atomic.h Mon Jul 6 02:02:45 2009 (r195389) +++ projects/mips/sys/mips/include/atomic.h Mon Jul 6 02:22:06 2009 (r195390) @@ -137,7 +137,7 @@ atomic_subtract_32(__volatile uint32_t * "1:\tll %0, %3\n\t" /* load old value */ "subu %0, %2\n\t" /* calculate new value */ "sc %0, %1\n\t" /* attempt to store */ - "beqz %0, 1b\n\t" /* spin if failed */ + "beqz %0, 1b\n\t" /* spin if failed */ : "=&r" (temp), "=m" (*p) : "r" (v), "m" (*p) : "memory"); @@ -492,7 +492,7 @@ atomic_fetchadd_64(__volatile uint64_t * __asm __volatile ( "1:\n\t" "lld %0, %1\n\t" /* load old value */ - "addu %2, %3, %0\n\t" /* calculate new value */ + "daddu %2, %3, %0\n\t" /* calculate new value */ "scd %2, %1\n\t" /* attempt to store */ "beqz %2, 1b\n\t" /* spin if failed */ : "=&r" (value), "=m" (*p), "=&r" (temp) From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 02:22:51 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B0D1065677; Mon, 6 Jul 2009 02:22:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 854E68FC12; Mon, 6 Jul 2009 02:22:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n662MpZF066041; Mon, 6 Jul 2009 02:22:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n662Mpcu066039; Mon, 6 Jul 2009 02:22:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060222.n662Mpcu066039@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 02:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195391 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 02:22:52 -0000 Author: imp Date: Mon Jul 6 02:22:51 2009 New Revision: 195391 URL: http://svn.freebsd.org/changeset/base/195391 Log: Provide a macro for PTR_ADDU as well. We may need to implement this differently for N32... Use PTR_ADDU in DO_AST macro. Modified: projects/mips/sys/mips/include/asm.h Modified: projects/mips/sys/mips/include/asm.h ============================================================================== --- projects/mips/sys/mips/include/asm.h Mon Jul 6 02:22:06 2009 (r195390) +++ projects/mips/sys/mips/include/asm.h Mon Jul 6 02:22:51 2009 (r195391) @@ -326,7 +326,7 @@ _C_LABEL(x): nop ;\ PTR_LA s0, _C_LABEL(ast) ;\ jalr s0 ;\ - addu a0, s3, U_PCB_REGS ;\ + PTR_ADDU a0, s3, U_PCB_REGS ;\ j 44b ;\ nop ;\ 4: @@ -371,6 +371,7 @@ _C_LABEL(x): #define REG_EPILOGUE .set pop #define SZREG 4 #define PTR_LA la +#define PTR_ADDU addu #else #define REG_L ld #define REG_S sd @@ -379,6 +380,7 @@ _C_LABEL(x): #define REG_EPILOGUE .set pop #define SZREG 8 #define PTR_LA dla +#define PTR_ADDU daddu #endif /* _MIPS_BSD_API */ #define mfc0_macro(data, spr) \ From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 02:27:03 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C65E1065670; Mon, 6 Jul 2009 02:27:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC508FC13; Mon, 6 Jul 2009 02:27:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n662R3nh066156; Mon, 6 Jul 2009 02:27:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n662R3Fs066154; Mon, 6 Jul 2009 02:27:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060227.n662R3Fs066154@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 02:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195392 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 02:27:03 -0000 Author: imp Date: Mon Jul 6 02:27:03 2009 New Revision: 195392 URL: http://svn.freebsd.org/changeset/base/195392 Log: The MCOUNT macro isn't going to work in 64-bit mode. Add a note to this effect. Modified: projects/mips/sys/mips/include/profile.h Modified: projects/mips/sys/mips/include/profile.h ============================================================================== --- projects/mips/sys/mips/include/profile.h Mon Jul 6 02:22:51 2009 (r195391) +++ projects/mips/sys/mips/include/profile.h Mon Jul 6 02:27:03 2009 (r195392) @@ -41,6 +41,8 @@ /*XXX The cprestore instruction is a "dummy" to shut up as(1). */ +/*XXX This is not MIPS64 safe. */ + #define MCOUNT \ __asm(".globl _mcount;" \ ".type _mcount,@function;" \ From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 07:42:54 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5576106564A; Mon, 6 Jul 2009 07:42:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4BA68FC19; Mon, 6 Jul 2009 07:42:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n667gsfr072069; Mon, 6 Jul 2009 07:42:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n667gsvS072067; Mon, 6 Jul 2009 07:42:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060742.n667gsvS072067@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 07:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195393 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 07:42:55 -0000 Author: imp Date: Mon Jul 6 07:42:54 2009 New Revision: 195393 URL: http://svn.freebsd.org/changeset/base/195393 Log: (1) Improvements for SB1. only allow real memory to be accessed. (2) make compile n64 by using more-proper casts. Submitted by: Neelkanth Natu (1) Modified: projects/mips/sys/mips/mips/mem.c Modified: projects/mips/sys/mips/mips/mem.c ============================================================================== --- projects/mips/sys/mips/mips/mem.c Mon Jul 6 02:27:03 2009 (r195392) +++ projects/mips/sys/mips/mips/mem.c Mon Jul 6 07:42:54 2009 (r195393) @@ -101,8 +101,15 @@ memrw(dev, uio, flags) vm_paddr_t pa; register int o; +#ifdef CPU_SB1 + if (!is_physical_memory(v) || + !is_physical_memory(roundup2(v, PAGE_SIZE) - 1)) { + return (EFAULT); + } +#else if (v + c > (SDRAM_ADDR_START + ctob(physmem))) return (EFAULT); +#endif if (is_cacheable_mem(v) && is_cacheable_mem(v + c)) { struct fpage *fp; @@ -117,7 +124,7 @@ memrw(dev, uio, flags) va = pmap_map_fpage(pa, fp, FALSE); o = (int)uio->uio_offset & PAGE_MASK; c = (u_int)(PAGE_SIZE - - ((int)iov->iov_base & PAGE_MASK)); + ((uintptr_t)iov->iov_base & PAGE_MASK)); c = min(c, (u_int)(PAGE_SIZE - o)); c = min(c, (u_int)iov->iov_len); error = uiomove((caddr_t)(va + o), (int)c, uio); @@ -158,7 +165,7 @@ memrw(dev, uio, flags) return EFAULT; if (!kernacc( - (caddr_t)(int)uio->uio_offset, c, + (caddr_t)(uintptr_t)uio->uio_offset, c, uio->uio_rw == UIO_READ ? VM_PROT_READ : VM_PROT_WRITE)) return (EFAULT); From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 07:43:50 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E8E10656CD; Mon, 6 Jul 2009 07:43:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ADE78FC23; Mon, 6 Jul 2009 07:43:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n667hoTH072121; Mon, 6 Jul 2009 07:43:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n667hok8072119; Mon, 6 Jul 2009 07:43:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060743.n667hok8072119@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 07:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195394 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 07:43:51 -0000 Author: imp Date: Mon Jul 6 07:43:50 2009 New Revision: 195394 URL: http://svn.freebsd.org/changeset/base/195394 Log: Use better casts for passing the small integer as a pointer here. Basically, replace int with uintptr_t. Modified: projects/mips/sys/mips/mips/intr_machdep.c Modified: projects/mips/sys/mips/mips/intr_machdep.c ============================================================================== --- projects/mips/sys/mips/mips/intr_machdep.c Mon Jul 6 07:42:54 2009 (r195393) +++ projects/mips/sys/mips/mips/intr_machdep.c Mon Jul 6 07:43:50 2009 (r195394) @@ -56,7 +56,7 @@ static int last_printed = 0; static void mips_mask_hard_irq(void *source) { - int irq = (int)source; + uintptr_t irq = (uintptr_t)source; mips_wr_status(mips_rd_status() & ~(((1 << irq) << 8) << 2)); } @@ -64,7 +64,7 @@ mips_mask_hard_irq(void *source) static void mips_unmask_hard_irq(void *source) { - int irq = (int)source; + uintptr_t irq = (uintptr_t)source; mips_wr_status(mips_rd_status() | (((1 << irq) << 8) << 2)); } @@ -72,7 +72,7 @@ mips_unmask_hard_irq(void *source) static void mips_mask_soft_irq(void *source) { - int irq = (int)source; + uintptr_t irq = (uintptr_t)source; mips_wr_status(mips_rd_status() & ~((1 << irq) << 8)); } @@ -80,7 +80,7 @@ mips_mask_soft_irq(void *source) static void mips_unmask_soft_irq(void *source) { - int irq = (int)source; + uintptr_t irq = (uintptr_t)source; mips_wr_status(mips_rd_status() | ((1 << irq) << 8)); } @@ -105,8 +105,8 @@ cpu_establish_hardintr(const char *name, event = hardintr_events[irq]; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, irq, - mips_mask_hard_irq, mips_unmask_hard_irq, + error = intr_event_create(&event, (void *)(uintptr_t)irq, 0, + irq, mips_mask_hard_irq, mips_unmask_hard_irq, NULL, NULL, "hard intr%d:", irq); if (error) return; @@ -124,7 +124,7 @@ cpu_establish_hardintr(const char *name, intr_event_add_handler(event, name, filt, handler, arg, intr_priority(flags), flags, cookiep); - mips_unmask_hard_irq((void*)irq); + mips_unmask_hard_irq((void*)(uintptr_t)irq); } void @@ -144,8 +144,8 @@ cpu_establish_softintr(const char *name, event = softintr_events[irq]; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, irq, - mips_mask_soft_irq, mips_unmask_soft_irq, + error = intr_event_create(&event, (void *)(uintptr_t)irq, 0, + irq, mips_mask_soft_irq, mips_unmask_soft_irq, NULL, NULL, "intr%d:", irq); if (error) return; @@ -155,7 +155,7 @@ cpu_establish_softintr(const char *name, intr_event_add_handler(event, name, filt, handler, arg, intr_priority(flags), flags, cookiep); - mips_unmask_soft_irq((void*)irq); + mips_unmask_soft_irq((void*)(uintptr_t)irq); } void From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 07:45:02 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAEBD10656C1; Mon, 6 Jul 2009 07:45:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7488FC1A; Mon, 6 Jul 2009 07:45:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n667j2m8072198; Mon, 6 Jul 2009 07:45:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n667j249072196; Mon, 6 Jul 2009 07:45:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060745.n667j249072196@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 07:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195395 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 07:45:03 -0000 Author: imp Date: Mon Jul 6 07:45:02 2009 New Revision: 195395 URL: http://svn.freebsd.org/changeset/base/195395 Log: Use ta0 instead of t4 and ta1 instead of t5. These map to the same registers on O32 builds, but t4 and t5 don't exist on N32 or N64. Modified: projects/mips/sys/mips/mips/tlb.S Modified: projects/mips/sys/mips/mips/tlb.S ============================================================================== --- projects/mips/sys/mips/mips/tlb.S Mon Jul 6 07:43:50 2009 (r195394) +++ projects/mips/sys/mips/mips/tlb.S Mon Jul 6 07:45:02 2009 (r195395) @@ -432,17 +432,17 @@ LEAF(Mips_TLBRead) MIPS_CPU_NOP_DELAY mfc0 t2, COP_0_TLB_PG_MASK # fetch the hi entry _MFC0 t3, COP_0_TLB_HI # fetch the hi entry - _MFC0 t4, COP_0_TLB_LO0 # See what we got - _MFC0 t5, COP_0_TLB_LO1 # See what we got + _MFC0 ta0, COP_0_TLB_LO0 # See what we got + _MFC0 ta1, COP_0_TLB_LO1 # See what we got _MTC0 t0, COP_0_TLB_HI # restore PID MIPS_CPU_NOP_DELAY mtc0 v1, COP_0_STATUS_REG # Restore the status register ITLBNOPFIX sw t2, 0(a1) sw t3, 4(a1) - sw t4, 8(a1) + sw ta0, 8(a1) j ra - sw t5, 12(a1) + sw ta1, 12(a1) END(Mips_TLBRead) /*-------------------------------------------------------------------------- @@ -478,7 +478,7 @@ LEAF(mips_TBIAP) mfc0 v1, COP_0_STATUS_REG # save status register mtc0 zero, COP_0_STATUS_REG # disable interrupts - _MFC0 t4, COP_0_TLB_HI # Get current PID + _MFC0 ta0, COP_0_TLB_HI # Get current PID move t2, a0 mfc0 t1, COP_0_TLB_WIRED li v0, MIPS_KSEG0_START # invalid address @@ -517,7 +517,7 @@ LEAF(mips_TBIAP) bne t1, t2, 1b nop - _MTC0 t4, COP_0_TLB_HI # restore PID + _MTC0 ta0, COP_0_TLB_HI # restore PID mtc0 t3, COP_0_TLB_PG_MASK # restore pgMask MIPS_CPU_NOP_DELAY mtc0 v1, COP_0_STATUS_REG # restore status register From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 07:46:13 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 588201065672; Mon, 6 Jul 2009 07:46:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4833E8FC15; Mon, 6 Jul 2009 07:46:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n667kDvH072256; Mon, 6 Jul 2009 07:46:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n667kDjQ072254; Mon, 6 Jul 2009 07:46:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060746.n667kDjQ072254@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 07:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195396 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 07:46:13 -0000 Author: imp Date: Mon Jul 6 07:46:13 2009 New Revision: 195396 URL: http://svn.freebsd.org/changeset/base/195396 Log: Pass in the uint64 value, rather than a pointer to it. that's what the function expects... Modified: projects/mips/sys/mips/mips/db_interface.c Modified: projects/mips/sys/mips/mips/db_interface.c ============================================================================== --- projects/mips/sys/mips/mips/db_interface.c Mon Jul 6 07:45:02 2009 (r195395) +++ projects/mips/sys/mips/mips/db_interface.c Mon Jul 6 07:46:13 2009 (r195396) @@ -197,7 +197,7 @@ db_write_bytes(vm_offset_t addr, size_t break; case 8: atomic_store_64((volatile u_int64_t *)addr, - (u_int64_t *)data); + *(u_int64_t *)data); break; } } else { From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 07:47:39 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE0BC1065673; Mon, 6 Jul 2009 07:47:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 938F48FC14; Mon, 6 Jul 2009 07:47:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n667ld0C072313; Mon, 6 Jul 2009 07:47:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n667ldLu072311; Mon, 6 Jul 2009 07:47:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060747.n667ldLu072311@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 07:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195397 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 07:47:40 -0000 Author: imp Date: Mon Jul 6 07:47:39 2009 New Revision: 195397 URL: http://svn.freebsd.org/changeset/base/195397 Log: No need to force mips32 here. Modified: projects/mips/sys/mips/mips/cache_mipsNN.c Modified: projects/mips/sys/mips/mips/cache_mipsNN.c ============================================================================== --- projects/mips/sys/mips/mips/cache_mipsNN.c Mon Jul 6 07:46:13 2009 (r195396) +++ projects/mips/sys/mips/mips/cache_mipsNN.c Mon Jul 6 07:47:39 2009 (r195397) @@ -66,8 +66,6 @@ __FBSDID("$FreeBSD$"); #endif -__asm(".set mips32"); - static int picache_size; static int picache_stride; static int picache_loopcount; From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 07:48:31 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C626F106564A; Mon, 6 Jul 2009 07:48:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5A1A8FC08; Mon, 6 Jul 2009 07:48:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n667mVjK072367; Mon, 6 Jul 2009 07:48:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n667mVvQ072365; Mon, 6 Jul 2009 07:48:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060748.n667mVvQ072365@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 07:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195398 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 07:48:32 -0000 Author: imp Date: Mon Jul 6 07:48:31 2009 New Revision: 195398 URL: http://svn.freebsd.org/changeset/base/195398 Log: Better types for 64-bit compatibility. Use %p and cast to void * and prefer uintptr_t to other int-type casts. Modified: projects/mips/sys/mips/mips/pm_machdep.c Modified: projects/mips/sys/mips/mips/pm_machdep.c ============================================================================== --- projects/mips/sys/mips/mips/pm_machdep.c Mon Jul 6 07:47:39 2009 (r195397) +++ projects/mips/sys/mips/mips/pm_machdep.c Mon Jul 6 07:48:31 2009 (r195398) @@ -230,13 +230,13 @@ sigreturn(struct thread *td, struct sigr /* #ifdef DEBUG */ if (ucp->uc_mcontext.mc_regs[ZERO] != UCONTEXT_MAGIC) { printf("sigreturn: pid %d, ucp %p\n", p->p_pid, ucp); - printf(" old sp %x ra %x pc %x\n", - regs->sp, regs->ra, regs->pc); - printf(" new sp %x ra %x pc %x z %x\n", - ucp->uc_mcontext.mc_regs[SP], - ucp->uc_mcontext.mc_regs[RA], - ucp->uc_mcontext.mc_regs[PC], - ucp->uc_mcontext.mc_regs[ZERO]); + printf(" old sp %p ra %p pc %p\n", + (void *)regs->sp, (void *)regs->ra, (void *)regs->pc); + printf(" new sp %p ra %p pc %p z %p\n", + (void *)ucp->uc_mcontext.mc_regs[SP], + (void *)ucp->uc_mcontext.mc_regs[RA], + (void *)ucp->uc_mcontext.mc_regs[PC], + (void *)ucp->uc_mcontext.mc_regs[ZERO]); return EINVAL; } /* #endif */ @@ -327,7 +327,7 @@ ptrace_single_step(struct thread *td) /* compute next address after current location */ if(curinstr != 0) { va = MipsEmulateBranch(locr0, locr0->pc, locr0->fsr, - (u_int)&curinstr); + (uintptr_t)&curinstr); } else { va = locr0->pc + 4; } From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 07:49:25 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A79601065693; Mon, 6 Jul 2009 07:49:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02A988FC20; Mon, 6 Jul 2009 07:49:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n667nOjA072420; Mon, 6 Jul 2009 07:49:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n667nOB3072418; Mon, 6 Jul 2009 07:49:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060749.n667nOB3072418@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 07:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195399 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 07:49:31 -0000 Author: imp Date: Mon Jul 6 07:49:24 2009 New Revision: 195399 URL: http://svn.freebsd.org/changeset/base/195399 Log: Prefer uintptr_t to int cast here. Modified: projects/mips/sys/mips/mips/in_cksum.c Modified: projects/mips/sys/mips/mips/in_cksum.c ============================================================================== --- projects/mips/sys/mips/mips/in_cksum.c Mon Jul 6 07:48:31 2009 (r195398) +++ projects/mips/sys/mips/mips/in_cksum.c Mon Jul 6 07:49:24 2009 (r195399) @@ -226,7 +226,7 @@ skip_start: if (len < mlen) mlen = len; - if ((clen ^ (int) addr) & 1) + if ((clen ^ (uintptr_t) addr) & 1) sum += in_cksumdata(addr, mlen) << 8; else sum += in_cksumdata(addr, mlen); From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 08:00:26 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB7C1065670; Mon, 6 Jul 2009 08:00:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0868FC1D; Mon, 6 Jul 2009 08:00:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6680Qob072669; Mon, 6 Jul 2009 08:00:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6680QMn072666; Mon, 6 Jul 2009 08:00:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060800.n6680QMn072666@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 08:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195400 - projects/mips/sys/libkern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 08:00:27 -0000 Author: imp Date: Mon Jul 6 08:00:26 2009 New Revision: 195400 URL: http://svn.freebsd.org/changeset/base/195400 Log: Be more pedantic here. If we're going to shift something sizeof(long)*8 / 2 bits, then we better make sure we're shifting a long that much, not an int. # I'm surprised this is code would have a bug this basic. Modified: projects/mips/sys/libkern/qdivrem.c projects/mips/sys/libkern/quad.h Modified: projects/mips/sys/libkern/qdivrem.c ============================================================================== --- projects/mips/sys/libkern/qdivrem.c Mon Jul 6 07:49:24 2009 (r195399) +++ projects/mips/sys/libkern/qdivrem.c Mon Jul 6 08:00:26 2009 (r195400) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include -#define B (1 << HALF_BITS) /* digit base */ +#define B (1UL << HALF_BITS) /* digit base */ /* Combine two `digits' to make a single two-digit number. */ #define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b)) Modified: projects/mips/sys/libkern/quad.h ============================================================================== --- projects/mips/sys/libkern/quad.h Mon Jul 6 07:49:24 2009 (r195399) +++ projects/mips/sys/libkern/quad.h Mon Jul 6 08:00:26 2009 (r195400) @@ -94,7 +94,7 @@ union uu { * (sizeof(long)*CHAR_BIT/2). */ #define HHALF(x) ((x) >> HALF_BITS) -#define LHALF(x) ((x) & ((1 << HALF_BITS) - 1)) +#define LHALF(x) ((x) & ((1UL << HALF_BITS) - 1)) #define LHUP(x) ((x) << HALF_BITS) typedef unsigned int qshift_t; From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 08:16:25 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89534106564A; Mon, 6 Jul 2009 08:16:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78B1E8FC1F; Mon, 6 Jul 2009 08:16:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n668GPt0072969; Mon, 6 Jul 2009 08:16:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n668GPkw072967; Mon, 6 Jul 2009 08:16:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907060816.n668GPkw072967@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 08:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195401 - projects/mips/sys/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 08:16:25 -0000 Author: imp Date: Mon Jul 6 08:16:25 2009 New Revision: 195401 URL: http://svn.freebsd.org/changeset/base/195401 Log: Only build qdivrem on 32-bit ISA... # not sure this is the right selector... Modified: projects/mips/sys/conf/files.mips Modified: projects/mips/sys/conf/files.mips ============================================================================== --- projects/mips/sys/conf/files.mips Mon Jul 6 08:00:26 2009 (r195400) +++ projects/mips/sys/conf/files.mips Mon Jul 6 08:16:25 2009 (r195401) @@ -49,7 +49,7 @@ mips/mips/tick.c standard # ---------------------------------------------------------------------- # Phase 5 # ---------------------------------------------------------------------- -mips/mips/fp.S standard +mips/mips/fp.S optional hardfp mips/mips/pm_machdep.c standard mips/mips/swtch.S standard mips/mips/tlb.S standard @@ -86,7 +86,7 @@ libkern/flsl.c standard libkern/lshrdi3.c standard libkern/memmove.c standard libkern/moddi3.c standard -libkern/qdivrem.c standard +libkern/qdivrem.c optional isa_mips32 libkern/udivdi3.c standard libkern/umoddi3.c standard From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 10:40:46 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD181106564A; Mon, 6 Jul 2009 10:40:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9C748FC0C; Mon, 6 Jul 2009 10:40:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66Aek2s079734; Mon, 6 Jul 2009 10:40:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66AekpV079729; Mon, 6 Jul 2009 10:40:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907061040.n66AekpV079729@svn.freebsd.org> From: Rui Paulo Date: Mon, 6 Jul 2009 10:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195404 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 10:40:47 -0000 Author: rpaulo Date: Mon Jul 6 10:40:46 2009 New Revision: 195404 URL: http://svn.freebsd.org/changeset/base/195404 Log: Overhaul the routing structures used and move them to common mesh code so that they can be used by future routing protocols. XXX not finished Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_hwmp.h projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 09:31:04 2009 (r195403) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 10:40:46 2009 (r195404) @@ -64,15 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -static struct ieee80211_hwmp_route * - hwmp_rt_find(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN]); -static struct ieee80211_hwmp_route * - hwmp_rt_add(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN]); -static void hwmp_rt_del(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN]); -static void hwmp_rt_flush(struct ieee80211vap *); static int ieee80211_hwmp_send_action(struct ieee80211_node *, const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN], @@ -137,9 +128,6 @@ static const struct timeval ieee80211_hw #define HWMP_ROOTMODEINT msecs_to_ticks(timeval2msecs(ieee80211_hwmp_rootint)) #define HWMP_RANNMODEINT msecs_to_ticks(timeval2msecs(ieee80211_hwmp_rannint)) -#define HWMP_LOCK(hs) mtx_lock(&(hs)->hs_lock) -#define HWMP_UNLOCK(hs) mtx_unlock(&(hs)->hs_lock) - /* unalligned little endian access */ #define LE_WRITE_2(p, v) do { \ ((uint8_t *)(p))[0] = (v) & 0xff; \ @@ -166,8 +154,6 @@ SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, tar SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, replyforward, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_hwmp_replyforward, 0, "Set RF bit on generated PREQs"); -MALLOC_DEFINE(M_80211_HWMP, "80211hwmp", "802.11 HWMP routing table"); - #define IEEE80211_HWMP_DEFAULT_MAXHOPS 31 #define IEEE80211_HWMP_DEFAULT_TTL 31 @@ -193,83 +179,6 @@ ieee80211_hwmp_init(void) } SYSINIT(wlan_hwmp, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_hwmp_init, NULL); -/* - * Helper functions to manipulate the HWMP routing table. - */ -static struct ieee80211_hwmp_route * -hwmp_rt_find(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) -{ - struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt; - - HWMP_LOCK(hs); - TAILQ_FOREACH(rt, &hs->hs_routes, rt_next) { - if (IEEE80211_ADDR_EQ(dest, rt->rt_dest)) { - HWMP_UNLOCK(hs); - return rt; - } - } - HWMP_UNLOCK(hs); - return NULL; -} - -static struct ieee80211_hwmp_route * -hwmp_rt_add(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) -{ - struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt; - - KASSERT(hwmp_rt_find(vap, dest) == NULL, - ("%s: duplicate entry in the routing table", __func__)); - KASSERT(!IEEE80211_ADDR_EQ(vap->iv_myaddr, dest), - ("%s: adding self to the routing table", __func__)); - KASSERT(!IEEE80211_ADDR_EQ(broadcastaddr, dest), - ("%s: adding broadcast to the routing table", __func__)); - - rt = malloc(sizeof(struct ieee80211_hwmp_route), M_80211_HWMP, - M_NOWAIT | M_ZERO); - IEEE80211_ADDR_COPY(rt->rt_dest, dest); - HWMP_LOCK(hs); - TAILQ_INSERT_TAIL(&hs->hs_routes, rt, rt_next); - HWMP_UNLOCK(hs); - return rt; -} - -static void -hwmp_rt_del(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) -{ - struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt, *next; - - KASSERT(hs != NULL, ("no HWMP state")); - HWMP_LOCK(hs); - TAILQ_FOREACH_SAFE(rt, &hs->hs_routes, rt_next, next) { - if (IEEE80211_ADDR_EQ(rt->rt_dest, dest)) { - TAILQ_REMOVE(&hs->hs_routes, rt, rt_next); - free(rt, M_80211_HWMP); - HWMP_UNLOCK(hs); - return; - } - } - HWMP_UNLOCK(hs); -} - -static void -hwmp_rt_flush(struct ieee80211vap *vap) -{ - struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt, *next; - - if (hs == NULL) - return; - HWMP_LOCK(hs); - TAILQ_FOREACH_SAFE(rt, &hs->hs_routes, rt_next, next) { - TAILQ_REMOVE(&hs->hs_routes, rt, rt_next); - free(rt, M_80211_HWMP); - } - HWMP_UNLOCK(hs); -} - void ieee80211_hwmp_vattach(struct ieee80211vap *vap) { @@ -278,14 +187,12 @@ ieee80211_hwmp_vattach(struct ieee80211v KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a mesh vap, opmode %d", vap->iv_opmode)); - hs = malloc(sizeof(struct ieee80211_hwmp_state), M_80211_HWMP, + hs = malloc(sizeof(struct ieee80211_hwmp_state), M_80211_VAP, M_NOWAIT | M_ZERO); if (hs == NULL) { printf("%s: couldn't alloc HWMP state\n", __func__); return; } - TAILQ_INIT(&hs->hs_routes); - mtx_init(&hs->hs_lock, "HWMP", "802.11s HWMP", MTX_DEF); hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS; hs->hs_ttl = IEEE80211_HWMP_DEFAULT_TTL; callout_init(&hs->hs_roottimer, CALLOUT_MPSAFE); @@ -297,11 +204,9 @@ ieee80211_hwmp_vdetach(struct ieee80211v { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - hwmp_rt_flush(vap); if (callout_active(&hs->hs_roottimer)) callout_drain(&hs->hs_roottimer); - mtx_destroy(&hs->hs_lock); - free(vap->iv_hwmp, M_80211_HWMP); + free(vap->iv_hwmp, M_80211_VAP); vap->iv_hwmp = NULL; } @@ -316,10 +221,8 @@ ieee80211_hwmp_newstate(struct ieee80211 ieee80211_state_name[nstate], arg); /* Flush the table on !INIT -> INIT, e.g. interface down & up */ - if (nstate != IEEE80211_S_INIT && ostate == IEEE80211_S_INIT) { - hwmp_rt_flush(vap); + if (nstate != IEEE80211_S_INIT && ostate == IEEE80211_S_INIT) callout_drain(&hs->hs_roottimer); - } return 0; } @@ -724,8 +627,9 @@ hwmp_recv_preq(struct ieee80211vap *vap, const struct ieee80211_frame *wh, const struct ieee80211_meshpreq_ie *preq) { struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt = NULL; + struct ieee80211_hwmp_route *hr; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt = NULL; struct ieee80211_meshprep_ie prep; if (ni == vap->iv_bss || @@ -774,7 +678,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, /* * Build the reverse path, if we don't have it already. */ - rt = hwmp_rt_find(vap, preq->preq_origaddr); + rt = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); if (rt == NULL) ieee80211_hwmp_discover(vap, preq->preq_origaddr, NULL); else if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) @@ -795,9 +699,10 @@ hwmp_recv_preq(struct ieee80211vap *vap, "root mesh station @ %s", ether_sprintf(preq->preq_origaddr)); IEEE80211_ADDR_COPY(rootmac, preq->preq_origaddr); - rt = hwmp_rt_find(vap, rootmac); + rt = ieee80211_mesh_rt_find(vap, rootmac); if (rt == NULL) - rt = hwmp_rt_add(vap, rootmac); + rt = ieee80211_mesh_rt_add(vap, rootmac, + sizeof(struct ieee80211_hwmp_route)); /* * Reply with a PREP if we don't have a path to the root * or if the root sent us a proactive PREQ. @@ -822,7 +727,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, ieee80211_hwmp_discover(vap, rootmac, NULL); return; } - rt = hwmp_rt_find(vap, PREQ_TADDR(0)); + rt = ieee80211_mesh_rt_find(vap, PREQ_TADDR(0)); /* XXX missing. Check for AE bit and update proxy information */ @@ -838,10 +743,12 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ if (rt != NULL && !IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) { - rt->rt_preqid = preq->preq_id; - rt->rt_seq = preq->preq_origseq; - if (preq->preq_ttl > 1) { + hr = IEEE80211_MESH_ROUTE_PRIV(rt, + struct ieee80211_hwmp_route); + hr->hr_preqid = preq->preq_id; + hr->hr_seq = preq->preq_origseq; + if (preq->preq_ttl > 1) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "forwarding PREQ from %s", ether_sprintf(preq->preq_origaddr)); @@ -877,7 +784,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_ttl = hs->hs_ttl; IEEE80211_ADDR_COPY(&prep.prep_targetaddr, preq->preq_origaddr); - prep.prep_targetseq = rt->rt_seq; + prep.prep_targetseq = hr->hr_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = rt->rt_metric + ieee80211_airtime_calc(ni); @@ -893,11 +800,14 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ } else if (preq->preq_ttl > 1) { if (rt == NULL) - rt = hwmp_rt_add(vap, PREQ_TADDR(0)); + rt = ieee80211_mesh_rt_add(vap, PREQ_TADDR(0), + sizeof(struct ieee80211_hwmp_route)); + hr = IEEE80211_MESH_ROUTE_PRIV(rt, + struct ieee80211_hwmp_route); rt->rt_metric = preq->preq_metric; rt->rt_lifetime = preq->preq_lifetime; - rt->rt_seq = preq->preq_origseq; - rt->rt_preqid = preq->preq_id; + hr->hr_seq = preq->preq_origseq; + hr->hr_preqid = preq->preq_id; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "forwarding PREQ from %s", @@ -950,7 +860,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, { struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt = NULL; + struct ieee80211_mesh_route *rt = NULL; + struct ieee80211_hwmp_route *hr; struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = vap->iv_ifp; struct mbuf *m, *next; @@ -989,14 +900,14 @@ hwmp_recv_prep(struct ieee80211vap *vap, hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &pprep); } - rt = hwmp_rt_find(vap, prep->prep_origaddr); + rt = ieee80211_mesh_rt_find(vap, prep->prep_origaddr); if (rt == NULL) { /* * If we have no entry this could be a reply to a root PREQ. */ if (hs->hs_rootmode != IEEE80211_HWMP_ROOTMODE_DISABLED) { - printf("1\n"); - rt = hwmp_rt_add(vap, prep->prep_origaddr); + rt = ieee80211_mesh_rt_add(vap, prep->prep_origaddr, + sizeof(struct ieee80211_hwmp_route)); IEEE80211_ADDR_COPY(rt->rt_nexthop, wh->i_addr2); rt->rt_nhops = prep->prep_hopcount; rt->rt_lifetime = prep->prep_lifetime; @@ -1005,7 +916,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, } return; } - if (prep->prep_targetseq == rt->rt_seq) { + hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); + if (prep->prep_targetseq == hr->hr_seq) { int useprep = 0; /* * Check if we already have a path to this node. @@ -1093,18 +1005,20 @@ ieee80211_hwmp_peerdown(struct ieee80211 { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_meshperr_ie perr; - struct ieee80211_hwmp_route *rt; + struct ieee80211_mesh_route *rt; + struct ieee80211_hwmp_route *hr; - rt = hwmp_rt_find(vap, ni->ni_macaddr); + rt = ieee80211_mesh_rt_find(vap, ni->ni_macaddr); if (rt == NULL) return; + hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "%s", "deleting route entry"); perr.perr_mode = 0; perr.perr_ndests = 1; IEEE80211_ADDR_COPY(PERR_DADDR(0), rt->rt_dest); - PERR_DSEQ(0) = rt->rt_seq; - hwmp_rt_del(vap, ni->ni_macaddr); + PERR_DSEQ(0) = hr->hr_seq; + ieee80211_mesh_rt_del(vap, ni->ni_macaddr); hwmp_send_perr(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &perr); } #undef PERR_DADDR @@ -1118,7 +1032,8 @@ hwmp_recv_perr(struct ieee80211vap *vap, const struct ieee80211_frame *wh, const struct ieee80211_meshperr_ie *perr) { struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ieee80211_hwmp_route *rt = NULL; + struct ieee80211_mesh_route *rt = NULL; + struct ieee80211_hwmp_route *hr; struct ieee80211_meshperr_ie pperr; int i, forward = 0; @@ -1134,11 +1049,13 @@ hwmp_recv_perr(struct ieee80211vap *vap, * Find all routing entries that match and delete them. */ for (i = 0; i < perr->perr_ndests; i++) { - rt = hwmp_rt_find(vap, PERR_DADDR(i)); + rt = ieee80211_mesh_rt_find(vap, PERR_DADDR(i)); if (rt == NULL) continue; - if (PERR_DSEQ(i) >= rt->rt_seq) { - hwmp_rt_del(vap, rt->rt_dest); + hr = IEEE80211_MESH_ROUTE_PRIV(rt, + struct ieee80211_hwmp_route); + if (PERR_DSEQ(i) >= hr->hr_seq) { + ieee80211_mesh_rt_del(vap, rt->rt_dest); rt = NULL; forward = 1; } @@ -1191,21 +1108,25 @@ hwmp_recv_rann(struct ieee80211vap *vap, const struct ieee80211_frame *wh, const struct ieee80211_meshrann_ie *rann) { struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ieee80211_hwmp_route *rt = NULL; + struct ieee80211_mesh_route *rt = NULL; + struct ieee80211_hwmp_route *hr; struct ieee80211_meshrann_ie prann; if (ni == vap->iv_bss || ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) return; - rt = hwmp_rt_find(vap, rann->rann_addr); + rt = ieee80211_mesh_rt_find(vap, rann->rann_addr); /* * Discover the path to the root mesh STA. * If we already know it, propagate the RANN element. */ - if (rt == NULL) + if (rt == NULL) { ieee80211_hwmp_discover(vap, rann->rann_addr, NULL); - else if (rann->rann_seq > rt->rt_seq && rann->rann_ttl > 1 && + return; + } + hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); + if (rann->rann_seq > hr->hr_seq && rann->rann_ttl > 1 && (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) { memcpy(&prann, rann, sizeof(prann)); prann.rann_hopcount += 1; @@ -1244,10 +1165,11 @@ ieee80211_hwmp_discover(struct ieee80211 const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt = NULL; + struct ieee80211_mesh_route *rt = NULL; + struct ieee80211_hwmp_route *hr; struct ieee80211_meshpreq_ie preq; struct ieee80211_node *ni; - int sendpreq = 0, unknowndst = 0; + int sendpreq = 0; KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a mesh vap, opmode %d", vap->iv_opmode)); @@ -1257,25 +1179,25 @@ ieee80211_hwmp_discover(struct ieee80211 ni = NULL; if (!IEEE80211_IS_MULTICAST(dest)) { - rt = hwmp_rt_find(vap, dest); + rt = ieee80211_mesh_rt_find(vap, dest); if (rt == NULL) { - rt = hwmp_rt_add(vap, dest); + rt = ieee80211_mesh_rt_add(vap, dest, + sizeof(struct ieee80211_hwmp_route)); if (rt == NULL) { /* XXX stat+msg */ goto done; } } + hr = IEEE80211_MESH_ROUTE_PRIV(rt, + struct ieee80211_hwmp_route); if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) { - rt->rt_seq = ++hs->hs_seq; - rt->rt_preqid = ++hs->hs_preqid; + hr->hr_seq = ++hs->hs_seq; + hr->hr_preqid = ++hs->hs_preqid; rt->rt_metric = IEEE80211_MESHLMETRIC_INITIALVAL; rt->rt_lifetime = timeval2msecs(ieee80211_hwmp_pathtimeout); /* XXX check preq retries */ sendpreq = 1; - unknowndst = 1; - } - if (sendpreq) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP, dest, "%s", "initiating path discovery"); /* @@ -1284,9 +1206,9 @@ ieee80211_hwmp_discover(struct ieee80211 preq.preq_flags = 0; preq.preq_hopcount = 0; preq.preq_ttl = hs->hs_ttl; - preq.preq_id = rt->rt_preqid; + preq.preq_id = hr->hr_preqid; IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); - preq.preq_origseq = rt->rt_seq; + preq.preq_origseq = hr->hr_seq; preq.preq_lifetime = rt->rt_lifetime; preq.preq_metric = rt->rt_metric; preq.preq_tcount = 1; @@ -1296,11 +1218,8 @@ ieee80211_hwmp_discover(struct ieee80211 PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_TO; if (ieee80211_hwmp_replyforward) PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_RF; - if (unknowndst) { - PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_USN; - PREQ_TSEQ(0) = 0; - } else - PREQ_TSEQ(0) = rt->rt_seq; + PREQ_TFLAGS(0) |= IEEE80211_MESHPREQ_TFLAGS_USN; + PREQ_TSEQ(0) = 0; /* XXX check return value */ hwmp_send_preq(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &preq); @@ -1336,55 +1255,22 @@ done: #undef PREQ_TADDR #undef PREQ_TSEQ -/* - * Iterate the forwarding information table and locate the - * next hop. - */ -struct ieee80211_node * -ieee80211_hwmp_find_txnode(struct ieee80211vap *vap, - const uint8_t dest[IEEE80211_ADDR_LEN]) -{ - struct ieee80211_hwmp_route *rt; - - rt = hwmp_rt_find(vap, dest); - if (rt == NULL) - return NULL; - return ieee80211_find_txnode(vap, rt->rt_nexthop); -} - -int -ieee80211_hwmp_checkpseq(struct ieee80211vap *vap, - const uint8_t source[IEEE80211_ADDR_LEN], uint32_t seq) -{ - struct ieee80211_hwmp_route *rt; - - rt = hwmp_rt_find(vap, source); - if (rt == NULL) { - rt = hwmp_rt_add(vap, source); - rt->rt_lastpseq = seq; - return 0; - } - if (IEEE80211_MESH_SEQ_GEQ(rt->rt_lastpseq, seq)) { - return 1; - } else { - rt->rt_lastpseq = seq; - return 0; - } -} - static int hwmp_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - struct ieee80211_hwmp_route *rt; +#if 0 + struct ieee80211_mesh_route *rt; size_t len, off; uint8_t *p; +#endif int error; if (vap->iv_opmode != IEEE80211_M_MBSS) return ENOSYS; error = 0; switch (ireq->i_type) { +#if 0 case IEEE80211_IOC_HWMP_CMD: switch (ireq->i_val) { case IEEE80211_HWMP_CMD_LIST: @@ -1421,6 +1307,7 @@ hwmp_ioctl_get80211(struct ieee80211vap return ENOSYS; } break; +#endif case IEEE80211_IOC_HWMP_ROOTMODE: ireq->i_val = hs->hs_rootmode; break; @@ -1447,6 +1334,7 @@ hwmp_ioctl_set80211(struct ieee80211vap return ENOSYS; error = 0; switch (ireq->i_type) { +#if 0 case IEEE80211_IOC_HWMP_CMD: switch (ireq->i_val) { case IEEE80211_HWMP_CMD_LIST: @@ -1464,6 +1352,7 @@ hwmp_ioctl_set80211(struct ieee80211vap return ENOSYS; } break; +#endif case IEEE80211_IOC_HWMP_ROOTMODE: if (ireq->i_val < 0 || ireq->i_val > 3) return EINVAL; Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.h Mon Jul 6 09:31:04 2009 (r195403) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.h Mon Jul 6 10:40:46 2009 (r195404) @@ -31,38 +31,25 @@ #ifndef _NET80211_IEEE80211_HWMP_H_ #define _NET80211_IEEE80211_HWMP_H_ +#ifdef _KERNEL /* HWMP sequence numbers are 32 bit, so we can't use ieee80211_seq */ typedef uint32_t ieee80211_hwmp_seq; - +#define IEEE80211_HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) +#define IEEE80211_HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) /* - * HWMP Forwarding Information table, part of each VAP. + * Private extension of ieee80211_mesh_route. */ struct ieee80211_hwmp_route { - TAILQ_ENTRY(ieee80211_hwmp_route) rt_next; - uint8_t rt_dest[IEEE80211_ADDR_LEN]; - ieee80211_hwmp_seq rt_seq; /* HWMP sequence number */ - ieee80211_hwmp_seq rt_preqid; /* Last PREQ ID seen */ - uint8_t rt_nexthop[IEEE80211_ADDR_LEN]; - uint32_t rt_metric; /* Path Metric */ - uint32_t rt_nhops; /* Number of Hops */ - uint32_t rt_lifetime; - int rt_preqretries; - uint32_t rt_lastpseq; /* last mesh seq number - from this node */ + ieee80211_hwmp_seq hr_seq; /* HWMP sequence number */ + ieee80211_hwmp_seq hr_preqid; /* Last PREQ ID seen */ + int hr_preqretries; }; - -#ifdef _KERNEL - -MALLOC_DECLARE(M_80211_HWMP); - struct ieee80211_hwmp_state { - TAILQ_HEAD(, ieee80211_hwmp_route) hs_routes; ieee80211_hwmp_seq hs_seq; /* next seq to be used */ ieee80211_hwmp_seq hs_preqid; /* next PREQ ID to be used */ struct timeval hs_lastpreq; /* last time we sent a PREQ */ struct timeval hs_lastprep; /* last time we sent a PREP */ struct timeval hs_lastperr; /* last time we sent a PERR */ - struct mtx hs_lock; /* lock for the fi table */ int hs_rootmode; /* proactive HWMP */ struct callout hs_roottimer; uint8_t hs_maxhops; /* max hop count */ @@ -78,11 +65,6 @@ void ieee80211_hwmp_recv_action(struct struct ieee80211_node * ieee80211_hwmp_discover(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); -struct ieee80211_node * - ieee80211_hwmp_find_txnode(struct ieee80211vap *vap, - const uint8_t dest[IEEE80211_ADDR_LEN]); -int ieee80211_hwmp_checkpseq(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN], uint32_t); void ieee80211_hwmp_peerdown(struct ieee80211_node *); #endif /* _KERNEL */ Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 09:31:04 2009 (r195403) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 10:40:46 2009 (r195404) @@ -64,11 +64,19 @@ __FBSDID("$FreeBSD$"); static void mesh_vattach(struct ieee80211vap *); static int mesh_newstate(struct ieee80211vap *, enum ieee80211_state, int); static inline void mesh_linkchange(struct ieee80211_node *, - enum ieee80211_mesh_mlstate); + enum ieee80211_mesh_mlstate); +static void mesh_checkid(void *, struct ieee80211_node *); static uint32_t mesh_generateid(struct ieee80211vap *); +static int mesh_checkpseq(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN], uint32_t); +static struct ieee80211_node * + mesh_find_txnode(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); +static void mesh_forward(struct ieee80211vap *, struct mbuf *, + const struct ieee80211_meshcntl *); static int mesh_input(struct ieee80211_node *, struct mbuf *, int, int); static void mesh_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, - int, int); + int, int); static inline void mesh_peer_timeout_setup(struct ieee80211_node *); static void mesh_peer_timeout_backoff(struct ieee80211_node *); static void mesh_peer_timeout_cb(void *); @@ -86,9 +94,6 @@ static const int ieee80211_mesh_confirmt #define CONFIRM_TIMEOUT msecs_to_ticks(ieee80211_mesh_confirmtimeout) static const int ieee80211_mesh_maxretries = 2; -SYSCTL_NODE(_net_wlan, OID_AUTO, mesh, CTLFLAG_RD, 0, - "IEEE 802.11s parameters"); - #define IEEE80211_MESH_DEFAULT_TTL 31 static ieee80211_recv_action_func mesh_recv_action_meshpeering_open; @@ -103,6 +108,97 @@ static ieee80211_send_action_func mesh_s static ieee80211_send_action_func mesh_send_action_meshlink_request; static ieee80211_send_action_func mesh_send_action_meshlink_reply; +#define MESH_RT_LOCK(ms) mtx_lock(&(ms)->ms_rt_lock) +#define MESH_RT_UNLOCK(ms) mtx_unlock(&(ms)->ms_rt_lock) + +MALLOC_DEFINE(M_80211_MESH_RT, "80211mesh", "802.11s routing table"); + +/* + * Helper functions to manipulate the Mesh routing table. + */ +struct ieee80211_mesh_route * +ieee80211_mesh_rt_find(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt; + + MESH_RT_LOCK(ms); + TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { + if (IEEE80211_ADDR_EQ(dest, rt->rt_dest)) { + MESH_RT_UNLOCK(ms); + return rt; + } + } + MESH_RT_UNLOCK(ms); + return NULL; +} + +struct ieee80211_mesh_route * +ieee80211_mesh_rt_add(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN], size_t privlen) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt; + static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + + KASSERT(ieee80211_mesh_rt_find(vap, dest) == NULL, + ("%s: duplicate entry in the routing table", __func__)); + KASSERT(!IEEE80211_ADDR_EQ(vap->iv_myaddr, dest), + ("%s: adding self to the routing table", __func__)); + KASSERT(!IEEE80211_ADDR_EQ(broadcastaddr, dest), + ("%s: adding broadcast to the routing table", __func__)); + + rt = malloc(sizeof(struct ieee80211_mesh_route), M_80211_MESH_RT, + M_NOWAIT | M_ZERO); + IEEE80211_ADDR_COPY(rt->rt_dest, dest); + rt->rt_priv = malloc(privlen, M_80211_MESH_RT, M_NOWAIT | M_ZERO); + MESH_RT_LOCK(ms); + TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); + MESH_RT_UNLOCK(ms); + return rt; +} + +void +ieee80211_mesh_rt_del(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt, *next; + + KASSERT(ms != NULL, ("no HWMP state")); + MESH_RT_LOCK(ms); + TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) { + if (IEEE80211_ADDR_EQ(rt->rt_dest, dest)) { + TAILQ_REMOVE(&ms->ms_routes, rt, rt_next); + free(rt->rt_priv, M_80211_MESH_RT); + free(rt, M_80211_MESH_RT); + MESH_RT_UNLOCK(ms); + return; + } + } + MESH_RT_UNLOCK(ms); +} + +void +ieee80211_mesh_rt_flush(struct ieee80211vap *vap) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt, *next; + + if (ms == NULL) + return; + MESH_RT_LOCK(ms); + TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) { + TAILQ_REMOVE(&ms->ms_routes, rt, rt_next); + free(rt->rt_priv, M_80211_MESH_RT); + free(rt, M_80211_MESH_RT); + } + MESH_RT_UNLOCK(ms); +} + + static void ieee80211_mesh_init(void) { @@ -173,8 +269,12 @@ mesh_vdetach_peers(void *arg, struct iee static void mesh_vdetach(struct ieee80211vap *vap) { + struct ieee80211_mesh_state *ms = vap->iv_mesh; + ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, mesh_vdetach_peers, NULL); + ieee80211_mesh_rt_flush(vap); + mtx_destroy(&ms->ms_rt_lock); ieee80211_hwmp_vdetach(vap); free(vap->iv_mesh, M_80211_VAP); vap->iv_mesh = NULL; @@ -199,6 +299,8 @@ mesh_vattach(struct ieee80211vap *vap) ms->ms_seq = 0; ms->ms_flags = (IEEE80211_MESHFLAGS_AP | IEEE80211_MESHFLAGS_FWD); ms->ms_ttl = IEEE80211_MESH_DEFAULT_TTL; + TAILQ_INIT(&ms->ms_routes); + mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF); ieee80211_hwmp_vattach(vap); } @@ -223,6 +325,9 @@ mesh_newstate(struct ieee80211vap *vap, if (ostate != IEEE80211_S_SCAN) ieee80211_cancel_scan(vap); /* background scan */ ni = vap->iv_bss; /* NB: no reference held */ + /* Flush the routing table */ + if (nstate != INIT && ostate == INIT) + ieee80211_mesh_rt_flush(vap); switch (nstate) { case IEEE80211_S_INIT: switch (ostate) { @@ -426,6 +531,45 @@ mesh_generateid(struct ieee80211vap *vap } /* + * Verifies if we already received this packet by checking its + * sequence number. + */ +static int +mesh_checkpseq(struct ieee80211vap *vap, + const uint8_t source[IEEE80211_ADDR_LEN], uint32_t seq) +{ + struct ieee80211_mesh_route *rt; + + rt = ieee80211_mesh_rt_find(vap, source); + if (rt == NULL) { + rt = ieee80211_mesh_rt_add(vap, source, 12); + rt->rt_lastmseq = seq; + return 0; + } + if (IEEE80211_MESH_SEQ_GEQ(rt->rt_lastmseq, seq)) { + return 1; + } else { + rt->rt_lastmseq = seq; + return 0; + } +} + +/* + * Iterate the routing table and locate the next hop. + */ +static struct ieee80211_node * +mesh_find_txnode(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_mesh_route *rt; + + rt = ieee80211_mesh_rt_find(vap, dest); + if (rt == NULL) + return NULL; + return ieee80211_find_txnode(vap, rt->rt_nexthop); +} + +/* * Forward the specified frame. * Decrement the TTL and set TA to our MAC address. */ @@ -491,7 +635,7 @@ mesh_forward(struct ieee80211vap *vap, s params.ibp_try0 = 1; mcopy->m_flags |= M_MCAST; } else { - ni = ieee80211_hwmp_find_txnode(vap, whcopy->i_addr3); + ni = mesh_find_txnode(vap, whcopy->i_addr3); if (ni == NULL) { IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, "%s", "frame not fwd'd, no path"); @@ -679,7 +823,7 @@ mesh_input(struct ieee80211_node *ni, st vap->iv_stats.is_rx_wrongbss++; /* XXX kinda */ goto out; } - if (ieee80211_hwmp_checkpseq(vap, addr, seq) != 0) { + if (mesh_checkpseq(vap, addr, seq) != 0) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_MESH, addr, "data", "duplicate mesh seqno %u ttl %u", seq, mc->mc_ttl); Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 09:31:04 2009 (r195403) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 10:40:46 2009 (r195404) @@ -371,7 +371,24 @@ struct ieee80211_meshcntl_ae11 { uint8_t mc_addr6[IEEE80211_ADDR_LEN]; } __packed; +struct ieee80211req_mesh_routes { +/* XXX TBD */ +}; + #ifdef _KERNEL +MALLOC_DECLARE(M_80211_MESH_RT); +struct ieee80211_mesh_route { + TAILQ_ENTRY(ieee80211_mesh_route) rt_next; + uint8_t rt_dest[IEEE80211_ADDR_LEN]; + uint8_t rt_nexthop[IEEE80211_ADDR_LEN]; + uint32_t rt_metric; /* path metric */ + uint16_t rt_nhops; /* number of hops */ + uint32_t rt_lifetime; + uint32_t rt_lastmseq;/* last seq# seen from this dest */ + void *rt_priv; /* pointer to private data */ +}; +#define IEEE80211_MESH_ROUTE_PRIV(rt, cast) (cast *)rt->rt_priv + struct ieee80211_mesh_proto { /* Action frame categories to intercept */ uint8_t mpr_actpath; @@ -405,11 +422,23 @@ struct ieee80211_mesh_state { #define IEEE80211_MESHFLAGS_PORTAL 0x02 /* mesh portal role */ #define IEEE80211_MESHFLAGS_FWD 0x04 /* forward packets */ uint8_t ms_flags; + struct mtx ms_rt_lock; + TAILQ_HEAD(, ieee80211_mesh_route) ms_routes; struct ieee80211_mesh_proto *ms_proto; }; void ieee80211_mesh_attach(struct ieee80211com *); void ieee80211_mesh_detach(struct ieee80211com *); +struct ieee80211_mesh_route * + ieee80211_mesh_rt_find(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); +struct ieee80211_mesh_route * + ieee80211_mesh_rt_add(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN], size_t); +void ieee80211_mesh_rt_del(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); +void ieee80211_mesh_rt_flush(struct ieee80211vap *); + uint8_t * ieee80211_add_meshpeerver(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshid(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *); From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 12:20:00 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39C2E106566C; Mon, 6 Jul 2009 12:20:00 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26BEE8FC0A; Mon, 6 Jul 2009 12:20:00 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66CK05n081810; Mon, 6 Jul 2009 12:20:00 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66CK0aJ081806; Mon, 6 Jul 2009 12:20:00 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907061220.n66CK0aJ081806@svn.freebsd.org> From: Rui Paulo Date: Mon, 6 Jul 2009 12:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195406 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 12:20:00 -0000 Author: rpaulo Date: Mon Jul 6 12:19:59 2009 New Revision: 195406 URL: http://svn.freebsd.org/changeset/base/195406 Log: Modularize path metric code. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 11:46:18 2009 (r195405) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 12:19:59 2009 (r195406) @@ -757,7 +757,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ ppreq.preq_hopcount += 1; ppreq.preq_ttl -= 1; - ppreq.preq_metric += ieee80211_airtime_calc(ni); + ppreq.preq_metric += + ms->ms_pmetric->mpm_metric(ni); /* * Set TO and unset RF bits because we are going * to send a PREP next. @@ -787,7 +788,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_targetseq = hr->hr_seq; prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = rt->rt_metric + - ieee80211_airtime_calc(ni); + ms->ms_pmetric->mpm_metric(ni); IEEE80211_ADDR_COPY(&prep.prep_origaddr, PREQ_TADDR(0)); prep.prep_origseq = hs->hs_seq++; @@ -814,7 +815,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, ether_sprintf(preq->preq_origaddr)); ppreq.preq_hopcount += 1; ppreq.preq_ttl -= 1; - ppreq.preq_metric += ieee80211_airtime_calc(ni); + ppreq.preq_metric += ms->ms_pmetric->mpm_metric(ni); hwmp_send_preq(ni, vap->iv_myaddr, broadcastaddr, &ppreq); } @@ -895,7 +896,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, memcpy(&pprep, prep, sizeof(pprep)); pprep.prep_hopcount += 1; pprep.prep_ttl -= 1; - pprep.prep_metric += ieee80211_airtime_calc(ni); + pprep.prep_metric += ms->ms_pmetric->mpm_metric(ni); IEEE80211_ADDR_COPY(pprep.prep_origaddr, vap->iv_myaddr); hwmp_send_prep(ni, vap->iv_myaddr, broadcastaddr, &pprep); } @@ -1131,7 +1132,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, memcpy(&prann, rann, sizeof(prann)); prann.rann_hopcount += 1; prann.rann_ttl -= 1; - prann.rann_metric += ieee80211_airtime_calc(ni); + prann.rann_metric += ms->ms_pmetric->mpm_metric(ni); hwmp_send_rann(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &prann); } Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 11:46:18 2009 (r195405) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 12:19:59 2009 (r195406) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include +static int mesh_select_proto_metric(struct ieee80211vap *, const char *); static void mesh_vattach(struct ieee80211vap *); static int mesh_newstate(struct ieee80211vap *, enum ieee80211_state, int); static inline void mesh_linkchange(struct ieee80211_node *, @@ -84,6 +85,7 @@ static inline void mesh_peer_timeout_sto static int mesh_verify_meshpeerver(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshid(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshconf(struct ieee80211vap *, const uint8_t *); +uint32_t mesh_airtime_calc(struct ieee80211_node *); /* timeout values in miliseconds */ static const int ieee80211_mesh_retrytimeout = 40; @@ -108,6 +110,15 @@ static ieee80211_send_action_func mesh_s static ieee80211_send_action_func mesh_send_action_meshlink_request; static ieee80211_send_action_func mesh_send_action_meshlink_reply; +static const struct ieee80211_mesh_proto_metric mesh_metric_airtime = { + .mpm_descr = "AIRTIME", + .mpm_ie = IEEE80211_MESHCONF_AIRTIME, + .mpm_metric = mesh_airtime_calc, +}; + +static struct ieee80211_mesh_proto_path mesh_proto_paths[4]; +static struct ieee80211_mesh_proto_metric mesh_proto_metrics[4]; + #define MESH_RT_LOCK(ms) mtx_lock(&(ms)->ms_rt_lock) #define MESH_RT_UNLOCK(ms) mtx_unlock(&(ms)->ms_rt_lock) @@ -198,10 +209,71 @@ ieee80211_mesh_rt_flush(struct ieee80211 MESH_RT_UNLOCK(ms); } +#define N(a) (sizeof(a) / sizeof(a[0])) +int +ieee80211_mesh_register_proto_path(const struct ieee80211_mesh_proto_path *mpp) +{ + int i, firstempty = -1; + static const uint8_t emptyie[4] = { 0, 0, 0, 0 }; + + for (i = 0; i < N(mesh_proto_paths); i++) { + if (memcmp(mpp->mpp_ie, mesh_proto_paths[i].mpp_ie, 4) == 0) + return EEXIST; + if (memcmp(mesh_proto_paths[i].mpp_ie, emptyie, 4) == 0 && + firstempty == -1) + firstempty = i; + } + if (firstempty < 0) + return ENOSPC; + memcpy(&mesh_proto_paths[firstempty], mpp, sizeof(*mpp)); + return 0; +} + +int +ieee80211_mesh_register_proto_metric(const struct + ieee80211_mesh_proto_metric *mpm) +{ + int i, firstempty = -1; + static const uint8_t emptyie[4] = { 0, 0, 0, 0 }; + + for (i = 0; i < N(mesh_proto_metrics); i++) { + if (memcmp(mpm->mpm_ie, mesh_proto_metrics[i].mpm_ie, 4) == 0) + return EEXIST; + if (memcmp(mesh_proto_metrics[i].mpm_ie, emptyie, 4) == 0 && + firstempty == -1) + firstempty = i; + } + if (firstempty < 0) + return ENOSPC; + memcpy(&mesh_proto_metrics[firstempty], mpm, sizeof(*mpm)); + return 0; +} + +static int +mesh_select_proto_metric(struct ieee80211vap *vap, const char *name) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + int i; + + for (i = 0; i < N(mesh_proto_metrics); i++) { + if (strcmp(mesh_proto_metrics[i].mpm_descr, name) == 0) { + ms->ms_pmetric = &mesh_proto_metrics[i]; + if (vap->iv_state == IEEE80211_S_RUN) + vap->iv_newstate(vap, IEEE80211_S_INIT, 0); + return 0; + } + } + return ENOENT; +} + +#undef N static void ieee80211_mesh_init(void) { + memset(mesh_proto_paths, 0, sizeof(mesh_proto_paths)); + memset(mesh_proto_metrics, 0, sizeof(mesh_proto_metrics)); + /* * Register action frame handlers. */ @@ -234,6 +306,12 @@ ieee80211_mesh_init(void) ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, IEEE80211_ACTION_MESHLMETRIC_REP, mesh_send_action_meshlink_reply); + + /* + * Register Airtime Link Metric. + */ + ieee80211_mesh_register_proto_metric(&mesh_metric_airtime); + } SYSINIT(wlan_mesh, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_mesh_init, NULL); @@ -284,7 +362,6 @@ static void mesh_vattach(struct ieee80211vap *vap) { struct ieee80211_mesh_state *ms; - vap->iv_newstate = mesh_newstate; vap->iv_input = mesh_input; vap->iv_opdetach = mesh_vdetach; @@ -301,6 +378,7 @@ mesh_vattach(struct ieee80211vap *vap) ms->ms_ttl = IEEE80211_MESH_DEFAULT_TTL; TAILQ_INIT(&ms->ms_routes); mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF); + mesh_select_proto_metric(vap, "AIRTIME"); ieee80211_hwmp_vattach(vap); } @@ -326,7 +404,7 @@ mesh_newstate(struct ieee80211vap *vap, ieee80211_cancel_scan(vap); /* background scan */ ni = vap->iv_bss; /* NB: no reference held */ /* Flush the routing table */ - if (nstate != INIT && ostate == INIT) + if (nstate != IEEE80211_S_INIT && ostate == IEEE80211_S_INIT) ieee80211_mesh_rt_flush(vap); switch (nstate) { case IEEE80211_S_INIT: @@ -1541,8 +1619,7 @@ mesh_recv_action_meshlmetric_req(struct { uint32_t metric; - /* XXX: check if we are using airtime or aother algorithm */ - metric = ieee80211_airtime_calc(ni); + metric = mesh_airtime_calc(ni); ieee80211_send_action(ni, IEEE80211_ACTION_CAT_MESHLMETRIC, IEEE80211_ACTION_MESHLMETRIC_REP, @@ -2188,7 +2265,7 @@ ieee80211_add_meshpeer(uint8_t *frm, uin + IEEE80211_WEP_MICLEN \ + IEEE80211_CRC_LEN) uint32_t -ieee80211_airtime_calc(struct ieee80211_node *ni) +mesh_airtime_calc(struct ieee80211_node *ni) { #define M_BITS 8 #define S_FACTOR (2 * M_BITS) Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 11:46:18 2009 (r195405) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 12:19:59 2009 (r195406) @@ -389,25 +389,42 @@ struct ieee80211_mesh_route { }; #define IEEE80211_MESH_ROUTE_PRIV(rt, cast) (cast *)rt->rt_priv -struct ieee80211_mesh_proto { - /* Action frame categories to intercept */ - uint8_t mpr_actpath; - uint8_t mpr_actlinkmetric; - /* Values to be sent in the Mesh Configuration IE */ - uint8_t mpr_pathid[4]; - uint8_t mpr_metricid[4]; - uint8_t mpr_congid[4]; - uint8_t mpr_syncid[4]; - uint8_t mpr_authid[4]; - void (*mpr_recv_action)(struct ieee80211vap *, - struct ieee80211_node *, struct mbuf *); - struct ieee80211_node * (*mpr_discover)(struct ieee80211vap *, - uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); - struct ieee80211_node * (*mpr_find_txnode)(struct ieee80211vap *vap, - uint8_t dest[IEEE80211_ADDR_LEN]); - uint32_t (*mpr_linkmetric)(struct ieee80211_node *); - /* XXX needs more methods */ +/* + * Mesh Path Selection Protocol. + */ +struct ieee80211_mesh_proto_path { + char mpp_descr[12]; + uint8_t mpp_ie[4]; + struct ieee80211_node * + (*mpr_discover)(struct ieee80211vap *, + uint8_t [IEEE80211_ADDR_LEN], + struct mbuf *); + size_t mpp_privlen; /* size required in the routing table + for private data */ }; +/* + * Mesh Link Metric Report Protocol. + */ +struct ieee80211_mesh_proto_metric { + char mpm_descr[12]; + uint8_t mpm_ie[4]; + uint32_t (*mpm_metric)(struct ieee80211_node *); +}; + +#ifdef notyet +/* + * Mesh Authentication Protocol. + */ +struct ieee80211_mesh_proto_auth { + uint8_t mpa_ie[4]; +}; + +struct ieee80211_mesh_proto_congestion { +}; + +struct ieee80211_mesh_proto_sync { +}; +#endif typedef uint32_t ieee80211_mesh_seq; #define IEEE80211_MESH_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) @@ -423,8 +440,10 @@ struct ieee80211_mesh_state { #define IEEE80211_MESHFLAGS_FWD 0x04 /* forward packets */ uint8_t ms_flags; struct mtx ms_rt_lock; - TAILQ_HEAD(, ieee80211_mesh_route) ms_routes; - struct ieee80211_mesh_proto *ms_proto; + TAILQ_HEAD(, ieee80211_mesh_route) + ms_routes; + struct ieee80211_mesh_proto_metric + *ms_pmetric; }; void ieee80211_mesh_attach(struct ieee80211com *); void ieee80211_mesh_detach(struct ieee80211com *); @@ -439,12 +458,16 @@ void ieee80211_mesh_rt_del(struct ieee8 const uint8_t [IEEE80211_ADDR_LEN]); void ieee80211_mesh_rt_flush(struct ieee80211vap *); +int ieee80211_mesh_register_proto_path(const + struct ieee80211_mesh_proto_path *); +int ieee80211_mesh_register_proto_metric(const + struct ieee80211_mesh_proto_metric *); + uint8_t * ieee80211_add_meshpeerver(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshid(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshconf(uint8_t *, struct ieee80211vap *); uint8_t * ieee80211_add_meshpeer(uint8_t *, uint8_t, uint16_t, uint16_t, uint16_t); -uint32_t ieee80211_airtime_calc(struct ieee80211_node *); uint8_t * ieee80211_add_meshlmetric(uint8_t *, uint32_t); void ieee80211_mesh_node_init(struct ieee80211vap *, From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 14:02:27 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87AFB106564A; Mon, 6 Jul 2009 14:02:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7530E8FC14; Mon, 6 Jul 2009 14:02:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66E2RKQ083799; Mon, 6 Jul 2009 14:02:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66E2Rgl083793; Mon, 6 Jul 2009 14:02:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907061402.n66E2Rgl083793@svn.freebsd.org> From: Rui Paulo Date: Mon, 6 Jul 2009 14:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195407 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 14:02:27 -0000 Author: rpaulo Date: Mon Jul 6 14:02:27 2009 New Revision: 195407 URL: http://svn.freebsd.org/changeset/base/195407 Log: Implement modularized path selection. This makes the HWMP code self contained (everything is static). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_hwmp.h projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 12:19:59 2009 (r195406) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 14:02:27 2009 (r195407) @@ -64,7 +64,11 @@ __FBSDID("$FreeBSD$"); #include #include -static int ieee80211_hwmp_send_action(struct ieee80211_node *, +static void hwmp_vattach(struct ieee80211vap *); +static void hwmp_vdetach(struct ieee80211vap *); +static int hwmp_newstate(struct ieee80211vap *, + enum ieee80211_state, int); +static int hwmp_send_action(struct ieee80211_node *, const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN], uint8_t *, size_t); @@ -107,6 +111,10 @@ static inline int hwmp_send_rann(struct const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshrann_ie *); +static struct ieee80211_node * + hwmp_discover(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); +static void hwmp_peerdown(struct ieee80211_node *); static int ieee80211_hwmp_targetonly = 0; static int ieee80211_hwmp_replyforward = 1; @@ -162,6 +170,18 @@ static ieee80211_recv_action_func hwmp_r static ieee80211_recv_action_func hwmp_recv_action_meshpath_perr; static ieee80211_recv_action_func hwmp_recv_action_meshpath_rann; +static const struct ieee80211_mesh_proto_path mesh_proto_hwmp = { + .mpp_descr = "HWMP", + .mpp_ie = IEEE80211_MESHCONF_HWMP, + .mpp_discover = hwmp_discover, + .mpp_peerdown = hwmp_peerdown, + .mpp_vattach = hwmp_vattach, + .mpp_vdetach = hwmp_vdetach, + .mpp_newstate = hwmp_newstate, + .mpp_privlen = sizeof(struct ieee80211_hwmp_route), +}; + + static void ieee80211_hwmp_init(void) { @@ -176,11 +196,16 @@ ieee80211_hwmp_init(void) IEEE80211_ACTION_MESHPATH_ERR, hwmp_recv_action_meshpath_perr); ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH, IEEE80211_ACTION_MESHPATH_RANN, hwmp_recv_action_meshpath_rann); + + /* + * Register HWMP. + */ + ieee80211_mesh_register_proto_path(&mesh_proto_hwmp); } SYSINIT(wlan_hwmp, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_hwmp_init, NULL); void -ieee80211_hwmp_vattach(struct ieee80211vap *vap) +hwmp_vattach(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs; @@ -195,12 +220,12 @@ ieee80211_hwmp_vattach(struct ieee80211v } hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS; hs->hs_ttl = IEEE80211_HWMP_DEFAULT_TTL; - callout_init(&hs->hs_roottimer, CALLOUT_MPSAFE); + callout_init(&hs->hs_roottimer, CALLOUT_MPSAFE); vap->iv_hwmp = hs; } void -ieee80211_hwmp_vdetach(struct ieee80211vap *vap) +hwmp_vdetach(struct ieee80211vap *vap) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; @@ -211,7 +236,7 @@ ieee80211_hwmp_vdetach(struct ieee80211v } int -ieee80211_hwmp_newstate(struct ieee80211vap *vap, enum ieee80211_state ostate, int arg) +hwmp_newstate(struct ieee80211vap *vap, enum ieee80211_state ostate, int arg) { enum ieee80211_state nstate = vap->iv_state; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; @@ -347,7 +372,7 @@ hwmp_recv_action_meshpath_rann(struct ie } static int -ieee80211_hwmp_send_action(struct ieee80211_node *ni, +hwmp_send_action(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], uint8_t *ie, size_t len) @@ -680,9 +705,9 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ rt = ieee80211_mesh_rt_find(vap, preq->preq_origaddr); if (rt == NULL) - ieee80211_hwmp_discover(vap, preq->preq_origaddr, NULL); + hwmp_discover(vap, preq->preq_origaddr, NULL); else if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) - ieee80211_hwmp_discover(vap, rt->rt_dest, NULL); + hwmp_discover(vap, rt->rt_dest, NULL); return; } /* @@ -701,8 +726,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, IEEE80211_ADDR_COPY(rootmac, preq->preq_origaddr); rt = ieee80211_mesh_rt_find(vap, rootmac); if (rt == NULL) - rt = ieee80211_mesh_rt_add(vap, rootmac, - sizeof(struct ieee80211_hwmp_route)); + rt = ieee80211_mesh_rt_add(vap, rootmac); /* * Reply with a PREP if we don't have a path to the root * or if the root sent us a proactive PREQ. @@ -724,7 +748,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, hwmp_send_prep(vap->iv_bss, vap->iv_myaddr, broadcastaddr, &prep); } - ieee80211_hwmp_discover(vap, rootmac, NULL); + hwmp_discover(vap, rootmac, NULL); return; } rt = ieee80211_mesh_rt_find(vap, PREQ_TADDR(0)); @@ -801,8 +825,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ } else if (preq->preq_ttl > 1) { if (rt == NULL) - rt = ieee80211_mesh_rt_add(vap, PREQ_TADDR(0), - sizeof(struct ieee80211_hwmp_route)); + rt = ieee80211_mesh_rt_add(vap, PREQ_TADDR(0)); hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); rt->rt_metric = preq->preq_metric; @@ -851,7 +874,7 @@ hwmp_send_preq(struct ieee80211_node *ni * [tlv] mesh path request */ preq->preq_ie = IEEE80211_ELEMID_MESHPREQ; - return ieee80211_hwmp_send_action(ni, sa, da, (uint8_t *)preq, + return hwmp_send_action(ni, sa, da, (uint8_t *)preq, sizeof(struct ieee80211_meshpreq_ie)); } @@ -907,8 +930,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, * If we have no entry this could be a reply to a root PREQ. */ if (hs->hs_rootmode != IEEE80211_HWMP_ROOTMODE_DISABLED) { - rt = ieee80211_mesh_rt_add(vap, prep->prep_origaddr, - sizeof(struct ieee80211_hwmp_route)); + rt = ieee80211_mesh_rt_add(vap, prep->prep_origaddr); IEEE80211_ADDR_COPY(rt->rt_nexthop, wh->i_addr2); rt->rt_nhops = prep->prep_hopcount; rt->rt_lifetime = prep->prep_lifetime; @@ -995,14 +1017,14 @@ hwmp_send_prep(struct ieee80211_node *ni * [tlv] mesh path reply */ prep->prep_ie = IEEE80211_ELEMID_MESHPREP; - return ieee80211_hwmp_send_action(ni, sa, da, (uint8_t *)prep, + return hwmp_send_action(ni, sa, da, (uint8_t *)prep, sizeof(struct ieee80211_meshprep_ie)); } #define PERR_DADDR(n) perr.perr_dests[n].dest_addr #define PERR_DSEQ(n) perr.perr_dests[n].dest_seq -void -ieee80211_hwmp_peerdown(struct ieee80211_node *ni) +static void +hwmp_peerdown(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_meshperr_ie perr; @@ -1100,7 +1122,7 @@ hwmp_send_perr(struct ieee80211_node *ni * [tlv] mesh path error */ perr->perr_ie = IEEE80211_ELEMID_MESHPERR; - return ieee80211_hwmp_send_action(ni, sa, da, (uint8_t *)perr, + return hwmp_send_action(ni, sa, da, (uint8_t *)perr, sizeof(struct ieee80211_meshperr_ie)); } @@ -1123,7 +1145,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, * If we already know it, propagate the RANN element. */ if (rt == NULL) { - ieee80211_hwmp_discover(vap, rann->rann_addr, NULL); + hwmp_discover(vap, rann->rann_addr, NULL); return; } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); @@ -1154,15 +1176,15 @@ hwmp_send_rann(struct ieee80211_node *ni * [tlv] root annoucement */ rann->rann_ie = IEEE80211_ELEMID_MESHRANN; - return ieee80211_hwmp_send_action(ni, sa, da, (uint8_t *)rann, + return hwmp_send_action(ni, sa, da, (uint8_t *)rann, sizeof(struct ieee80211_meshrann_ie)); } #define PREQ_TFLAGS(n) preq.preq_targets[n].target_flags #define PREQ_TADDR(n) preq.preq_targets[n].target_addr #define PREQ_TSEQ(n) preq.preq_targets[n].target_seq -struct ieee80211_node * -ieee80211_hwmp_discover(struct ieee80211vap *vap, +static struct ieee80211_node * +hwmp_discover(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; @@ -1182,8 +1204,7 @@ ieee80211_hwmp_discover(struct ieee80211 if (!IEEE80211_IS_MULTICAST(dest)) { rt = ieee80211_mesh_rt_find(vap, dest); if (rt == NULL) { - rt = ieee80211_mesh_rt_add(vap, dest, - sizeof(struct ieee80211_hwmp_route)); + rt = ieee80211_mesh_rt_add(vap, dest); if (rt == NULL) { /* XXX stat+msg */ goto done; Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.h Mon Jul 6 12:19:59 2009 (r195406) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.h Mon Jul 6 14:02:27 2009 (r195407) @@ -55,17 +55,6 @@ struct ieee80211_hwmp_state { uint8_t hs_maxhops; /* max hop count */ uint8_t hs_ttl; /* HWMP ttl */ }; - -void ieee80211_hwmp_vattach(struct ieee80211vap *); -void ieee80211_hwmp_vdetach(struct ieee80211vap *); -int ieee80211_hwmp_newstate(struct ieee80211vap *, - enum ieee80211_state, int); -void ieee80211_hwmp_recv_action(struct ieee80211vap *, - struct ieee80211_node *, struct mbuf *); -struct ieee80211_node * - ieee80211_hwmp_discover(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); -void ieee80211_hwmp_peerdown(struct ieee80211_node *); #endif /* _KERNEL */ #endif /* _NET80211_IEEE80211_HWMP_H_ */ Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 12:19:59 2009 (r195406) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 14:02:27 2009 (r195407) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include +static int mesh_select_proto_path(struct ieee80211vap *, const char *); static int mesh_select_proto_metric(struct ieee80211vap *, const char *); static void mesh_vattach(struct ieee80211vap *); static int mesh_newstate(struct ieee80211vap *, enum ieee80211_state, int); @@ -147,7 +148,7 @@ ieee80211_mesh_rt_find(struct ieee80211v struct ieee80211_mesh_route * ieee80211_mesh_rt_add(struct ieee80211vap *vap, - const uint8_t dest[IEEE80211_ADDR_LEN], size_t privlen) + const uint8_t dest[IEEE80211_ADDR_LEN]) { struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; @@ -164,7 +165,8 @@ ieee80211_mesh_rt_add(struct ieee80211va rt = malloc(sizeof(struct ieee80211_mesh_route), M_80211_MESH_RT, M_NOWAIT | M_ZERO); IEEE80211_ADDR_COPY(rt->rt_dest, dest); - rt->rt_priv = malloc(privlen, M_80211_MESH_RT, M_NOWAIT | M_ZERO); + rt->rt_priv = malloc(ms->ms_ppath->mpp_privlen, M_80211_MESH_RT, + M_NOWAIT | M_ZERO); MESH_RT_LOCK(ms); TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); MESH_RT_UNLOCK(ms); @@ -178,7 +180,6 @@ ieee80211_mesh_rt_del(struct ieee80211va struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt, *next; - KASSERT(ms != NULL, ("no HWMP state")); MESH_RT_LOCK(ms); TAILQ_FOREACH_SAFE(rt, &ms->ms_routes, rt_next, next) { if (IEEE80211_ADDR_EQ(rt->rt_dest, dest)) { @@ -250,6 +251,23 @@ ieee80211_mesh_register_proto_metric(con } static int +mesh_select_proto_path(struct ieee80211vap *vap, const char *name) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + int i; + + for (i = 0; i < N(mesh_proto_paths); i++) { + if (strcmp(mesh_proto_paths[i].mpp_descr, name) == 0) { + ms->ms_ppath = &mesh_proto_paths[i]; + if (vap->iv_state == IEEE80211_S_RUN) + vap->iv_newstate(vap, IEEE80211_S_INIT, 0); + return 0; + } + } + return ENOENT; +} + +static int mesh_select_proto_metric(struct ieee80211vap *vap, const char *name) { struct ieee80211_mesh_state *ms = vap->iv_mesh; @@ -266,6 +284,7 @@ mesh_select_proto_metric(struct ieee8021 return ENOENT; } + #undef N static void @@ -353,7 +372,7 @@ mesh_vdetach(struct ieee80211vap *vap) NULL); ieee80211_mesh_rt_flush(vap); mtx_destroy(&ms->ms_rt_lock); - ieee80211_hwmp_vdetach(vap); + ms->ms_ppath->mpp_vdetach(vap); free(vap->iv_mesh, M_80211_VAP); vap->iv_mesh = NULL; } @@ -379,7 +398,10 @@ mesh_vattach(struct ieee80211vap *vap) TAILQ_INIT(&ms->ms_routes); mtx_init(&ms->ms_rt_lock, "MBSS", "802.11s routing table", MTX_DEF); mesh_select_proto_metric(vap, "AIRTIME"); - ieee80211_hwmp_vattach(vap); + KASSERT(ms->ms_pmetric, ("ms_pmetric == NULL")); + mesh_select_proto_path(vap, "HWMP"); + KASSERT(ms->ms_ppath, ("ms_ppath == NULL")); + ms->ms_ppath->mpp_vattach(vap); } /* @@ -533,7 +555,7 @@ mesh_newstate(struct ieee80211vap *vap, } /* NB: ostate not nstate */ - ieee80211_hwmp_newstate(vap, ostate, arg); + ms->ms_ppath->mpp_newstate(vap, ostate, arg); return 0; } @@ -563,6 +585,7 @@ static inline void mesh_linkchange(struct ieee80211_node *ni, enum ieee80211_mesh_mlstate state) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_mesh_state *ms = vap->iv_mesh; #ifdef IEEE80211_DEBUG static const char *meshlinkstates[] = { [IEEE80211_NODE_MESH_IDLE] = "IDLE", @@ -578,7 +601,7 @@ mesh_linkchange(struct ieee80211_node *n ni, "peer link: switching to state %s", meshlinkstates[ni->ni_mlstate]); if (state == IEEE80211_NODE_MESH_HOLDING) - ieee80211_hwmp_peerdown(ni); + ms->ms_ppath->mpp_peerdown(ni); } /* @@ -620,7 +643,7 @@ mesh_checkpseq(struct ieee80211vap *vap, rt = ieee80211_mesh_rt_find(vap, source); if (rt == NULL) { - rt = ieee80211_mesh_rt_add(vap, source, 12); + rt = ieee80211_mesh_rt_add(vap, source); rt->rt_lastmseq = seq; return 0; } @@ -2322,11 +2345,12 @@ void ieee80211_mesh_node_cleanup(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211_mesh_state *ms = vap->iv_mesh; callout_drain(&ni->ni_mltimer); /* NB: short-circuit callbacks after mesh_vdetach */ if (vap->iv_mesh != NULL) - ieee80211_hwmp_peerdown(ni); + ms->ms_ppath->mpp_peerdown(ni); } void Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 12:19:59 2009 (r195406) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 14:02:27 2009 (r195407) @@ -31,6 +31,8 @@ #ifndef _NET80211_IEEE80211_MESH_H_ #define _NET80211_IEEE80211_MESH_H_ +#include /* for ieee80211_state */ + /* * 802.11s Information Elements. */ @@ -396,9 +398,14 @@ struct ieee80211_mesh_proto_path { char mpp_descr[12]; uint8_t mpp_ie[4]; struct ieee80211_node * - (*mpr_discover)(struct ieee80211vap *, - uint8_t [IEEE80211_ADDR_LEN], + (*mpp_discover)(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); + void (*mpp_peerdown)(struct ieee80211_node *); + void (*mpp_vattach)(struct ieee80211vap *); + void (*mpp_vdetach)(struct ieee80211vap *); + int (*mpp_newstate)(struct ieee80211vap *, + enum ieee80211_state, int); size_t mpp_privlen; /* size required in the routing table for private data */ }; @@ -444,6 +451,8 @@ struct ieee80211_mesh_state { ms_routes; struct ieee80211_mesh_proto_metric *ms_pmetric; + struct ieee80211_mesh_proto_path + *ms_ppath; }; void ieee80211_mesh_attach(struct ieee80211com *); void ieee80211_mesh_detach(struct ieee80211com *); @@ -453,7 +462,7 @@ struct ieee80211_mesh_route * const uint8_t [IEEE80211_ADDR_LEN]); struct ieee80211_mesh_route * ieee80211_mesh_rt_add(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN], size_t); + const uint8_t [IEEE80211_ADDR_LEN]); void ieee80211_mesh_rt_del(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN]); void ieee80211_mesh_rt_flush(struct ieee80211vap *); Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Mon Jul 6 12:19:59 2009 (r195406) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Mon Jul 6 14:02:27 2009 (r195407) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#include #ifdef INET #include @@ -240,11 +239,13 @@ ieee80211_start(struct ifnet *ifp) continue; } } else { - ni = ieee80211_hwmp_discover(vap, eh->ether_dhost, m); + struct ieee80211_mesh_state *ms = vap->iv_mesh; + + ni = ms->ms_ppath->mpp_discover(vap, eh->ether_dhost, m); if (ni == NULL) { /* - * NB: ieee80211_hwmp_discover holds/disposes - * frame (e.g. queueing on path discovery. + * NB: discover function holds/disposes + * frame (e.g. queueing on path discovery). */ ifp->if_oerrors++; continue; From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 14:15:13 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 693AB1065A7B; Mon, 6 Jul 2009 14:15:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0BC8FC26; Mon, 6 Jul 2009 14:15:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66EFD6M084060; Mon, 6 Jul 2009 14:15:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66EFDia084058; Mon, 6 Jul 2009 14:15:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907061415.n66EFDia084058@svn.freebsd.org> From: Rui Paulo Date: Mon, 6 Jul 2009 14:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195408 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 14:15:17 -0000 Author: rpaulo Date: Mon Jul 6 14:15:12 2009 New Revision: 195408 URL: http://svn.freebsd.org/changeset/base/195408 Log: Make sure we run the init function after the init function for mesh. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 14:02:27 2009 (r195407) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Mon Jul 6 14:15:12 2009 (r195408) @@ -202,7 +202,7 @@ ieee80211_hwmp_init(void) */ ieee80211_mesh_register_proto_path(&mesh_proto_hwmp); } -SYSINIT(wlan_hwmp, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_hwmp_init, NULL); +SYSINIT(wlan_hwmp, SI_SUB_DRIVERS, SI_ORDER_SECOND, ieee80211_hwmp_init, NULL); void hwmp_vattach(struct ieee80211vap *vap) From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 18:12:50 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E50D1065676; Mon, 6 Jul 2009 18:12:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0323F8FC1E; Mon, 6 Jul 2009 18:12:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66ICntq088745; Mon, 6 Jul 2009 18:12:49 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66ICnso088743; Mon, 6 Jul 2009 18:12:49 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907061812.n66ICnso088743@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 18:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195411 - projects/mips/sys/mips/octeon1/dev/rgmii X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 18:12:50 -0000 Author: imp Date: Mon Jul 6 18:12:49 2009 New Revision: 195411 URL: http://svn.freebsd.org/changeset/base/195411 Log: Minor fixes to printf formats. Modified: projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.c Modified: projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.c ============================================================================== --- projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.c Mon Jul 6 18:10:27 2009 (r195410) +++ projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.c Mon Jul 6 18:12:49 2009 (r195411) @@ -36,7 +36,7 @@ void octeon_dump_fpa (void) return; } printf(" FPA Ctrl-Status-reg 0x%llX := 0x%llX EN %X M1_E %X M0_E %X\n", - OCTEON_FPA_CTL_STATUS, status.word64, + OCTEON_FPA_CTL_STATUS, (unsigned long long)status.word64, status.bits.enb, status.bits.mem1_err, status.bits.mem0_err); for (i = 0; i < OCTEON_FPA_QUEUES; i++) { printf(" Pool: %d\n", i); @@ -61,7 +61,7 @@ void octeon_dump_fpa_pool (u_int pool) return; } printf(" FPA Ctrl-Status-reg 0x%llX := 0x%llX EN %X M1_E %X M0_E %X\n", - OCTEON_FPA_CTL_STATUS, status.word64, + OCTEON_FPA_CTL_STATUS, (unsigned long long)status.word64, status.bits.enb, status.bits.mem1_err, status.bits.mem0_err); q_avail.word64 = oct_read64((OCTEON_FPA_QUEUE_AVAILABLE + (pool)*8ull)); printf(" FPA Pool: %u Avail-reg 0x%llX := Size: 0x%X\n", pool, @@ -168,8 +168,8 @@ void octeon_fpa_fill_pool_mem (u_int poo memory = (void *) OCTEON_ALIGN(memory); #ifdef FPA_DEBUG_TERSE - printf("FPA fill: %u Count: %u SizeBytes: %u SizeBytesAligned: %u 1st: 0x%X = 0x%X\n", - pool, elem_num, elem_size_bytes, block_size, memory, OCTEON_PTR2PHYS(memory)); + printf("FPA fill: %u Count: %u SizeBytes: %u SizeBytesAligned: %u 1st: 0x%X = %p\n", + pool, elem_num, elem_size_bytes, block_size, memory, (void *)OCTEON_PTR2PHYS(memory)); #endif // memory = (void *) ((((u_int) memory / OCTEON_FPA_POOL_ALIGNMENT) + 1) * OCTEON_FPA_POOL_ALIGNMENT); From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 18:15:58 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BDB2106564A; Mon, 6 Jul 2009 18:15:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09F9D8FC08; Mon, 6 Jul 2009 18:15:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66IFvi3088842; Mon, 6 Jul 2009 18:15:57 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66IFvdT088837; Mon, 6 Jul 2009 18:15:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907061815.n66IFvdT088837@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 18:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195412 - projects/mips/sys/mips/octeon1/dev/rgmii X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 18:15:58 -0000 Author: imp Date: Mon Jul 6 18:15:57 2009 New Revision: 195412 URL: http://svn.freebsd.org/changeset/base/195412 Log: 64-bit fixes: (1) fix printf formats. (2) Prefer FreeBSD's MIPS_PHYS_TO_KSEG0 to hand-rolled one from Cavium. (3) Mark a few 64-bit cleanliness issues (possible). (4) Minor formatting fixes. Modified: projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.h projects/mips/sys/mips/octeon1/dev/rgmii/octeon_pko.c projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.c projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.h Modified: projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.h ============================================================================== --- projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.h Mon Jul 6 18:12:49 2009 (r195411) +++ projects/mips/sys/mips/octeon1/dev/rgmii/octeon_fpa.h Mon Jul 6 18:15:57 2009 (r195412) @@ -168,7 +168,7 @@ static inline void octeon_fpa_free (void { octeon_addr_t free_ptr; - free_ptr.word64 = (uint64_t) OCTEON_PTR2PHYS(ptr); + free_ptr.word64 = (uint64_t)OCTEON_PTR2PHYS(ptr); free_ptr.sfilldidspace.didspace = OCTEON_ADDR_DIDSPACE( OCTEON_ADDR_FULL_DID(OCTEON_DID_FPA, pool)); @@ -200,16 +200,15 @@ static inline void *octeon_fpa_alloc (u_ /* * 32 bit FPA pointers only */ - /* * We only use 32 bit pointers at this time */ - return ((void *) OCTEON_PHYS2PTR(address & 0xffffffff)); +/*XXX mips64 issue */ + return ((void *) MIPS_PHYS_TO_KSEG0(address & 0xffffffff)); } return (NULL); } - static inline uint64_t octeon_fpa_alloc_phys (u_int pool) { @@ -217,30 +216,4 @@ static inline uint64_t octeon_fpa_alloc_ pool)))); } - -#if 0 - -/* - * octeon_fpa_alloc - * - * Allocate a new block from the FPA - * - * Buffer passes away from FPA management to SW control - */ -static inline void *octeon_fpa_alloc (u_int pool) -{ - uint64_t address; - - address = oct_read64(OCTEON_ADDR_DID(OCTEON_ADDR_FULL_DID(OCTEON_DID_FPA, - pool))); - if (address) { - return ((void *) (oct_ptr_size) OCTEON_PHYS2PTR(address)); - } - return (NULL); -} - -#endif - - - #endif /* ___OCTEON_FPA__H___ */ Modified: projects/mips/sys/mips/octeon1/dev/rgmii/octeon_pko.c ============================================================================== --- projects/mips/sys/mips/octeon1/dev/rgmii/octeon_pko.c Mon Jul 6 18:12:49 2009 (r195411) +++ projects/mips/sys/mips/octeon1/dev/rgmii/octeon_pko.c Mon Jul 6 18:15:57 2009 (r195412) @@ -174,7 +174,9 @@ static void octeon_pko_doorbell_data_dum octeon_pko_get_port_status(port, 0, &status); printf("\n Port #%lld Pkts %ld Bytes %lld DoorBell %lld", - port, status.packets, status.octets, status.doorbell); + (unsigned long long)port, status.packets, + (unsigned long long)status.octets, + (unsigned long long)status.doorbell); } /* @@ -229,7 +231,7 @@ void octeon_pko_show (u_int start_port, printf("\n Port # %d Queue %3d [%d] BufPtr: 0x%llX Mask: %X%s", octeon_pko_queue_cfg.bits.port, octeon_pko_queue_cfg.bits.queue, octeon_pko_queue_cfg.bits.index, - (uint64_t)octeon_pko_queue_cfg.bits.buf_ptr, + (unsigned long long)octeon_pko_queue_cfg.bits.buf_ptr, octeon_pko_queue_cfg.bits.qos_mask, (octeon_pko_queue_cfg.bits.tail)? " Last":""); } @@ -238,8 +240,6 @@ void octeon_pko_show (u_int start_port, for (port = start_port; port < (end_port + 1); port++) { octeon_pko_get_port_status(port, 0, &status); - printf("\n Port #%d Packets %ld Bytes %lld DoorBell %lld", - port, status.packets, status.octets, status.doorbell); octeon_pko_doorbell_data_dump(port); } Modified: projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.c ============================================================================== --- projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.c Mon Jul 6 18:12:49 2009 (r195411) +++ projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.c Mon Jul 6 18:15:57 2009 (r195412) @@ -696,7 +696,7 @@ static struct mbuf *octeon_rgmx_build_ne } if (m == m0) { - newdata = (caddr_t) ALIGN(m->m_data + ETHER_HDR_LEN) - ETHER_HDR_LEN; + newdata = (caddr_t)ALIGN(m->m_data + ETHER_HDR_LEN) - ETHER_HDR_LEN; len -= newdata - m->m_data; m->m_data = newdata; } @@ -969,7 +969,7 @@ static u_int octeon_rgmx_pko_xmit_packet #ifdef DEBUG_TX printf(" temp: 0x%X ", temp); #endif - xmit_cmd_ptr = (uint64_t *) OCTEON_PHYS2PTR(temp); + xmit_cmd_ptr = (uint64_t *) MIPS_PHYS_TO_KSEG0(temp); xmit_cmd_index = xmit_cmd_state & OCTEON_PKO_INDEX_MASK; xmit_cmd_ptr += xmit_cmd_index; Modified: projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.h ============================================================================== --- projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.h Mon Jul 6 18:12:49 2009 (r195411) +++ projects/mips/sys/mips/octeon1/dev/rgmii/octeon_rgmx.h Mon Jul 6 18:15:57 2009 (r195412) @@ -423,7 +423,7 @@ static inline octeon_wqe_t *octeon_pow_w if (result.s_work.no_work || !result.s_work.addr) { return NULL; } - return (octeon_wqe_t *) OCTEON_PHYS2PTR(result.s_work.addr); + return (octeon_wqe_t *) MIPS_PHYS_TO_KSEG0(result.s_work.addr); } static inline octeon_wqe_t *octeon_pow_work_request_sync_nocheck_debug (octeon_pow_wait_t wait) @@ -440,13 +440,14 @@ static inline octeon_wqe_t *octeon_pow_w result.word64 = oct_read64(ptr.word64); printf("WQE Result: 0x%llX No-work %X Addr %llX Ptr: %p\n", - result.word64, result.s_work.no_work, (uint64_t)result.s_work.addr, - OCTEON_PHYS2PTR(result.s_work.addr)); + (unsigned long long)result.word64, result.s_work.no_work, + (unsigned long long)result.s_work.addr, + (void *)MIPS_PHYS_TO_KSEG0(result.s_work.addr)); if (result.s_work.no_work || !result.s_work.addr) { return NULL; } - return (octeon_wqe_t *) OCTEON_PHYS2PTR(result.s_work.addr); + return (octeon_wqe_t *) MIPS_PHYS_TO_KSEG0(result.s_work.addr); } static inline octeon_wqe_t *octeon_pow_work_request_sync (octeon_pow_wait_t wait) @@ -482,7 +483,7 @@ static inline octeon_wqe_t *octeon_pow_w if (result.s_work.no_work) { return NULL; } - return (octeon_wqe_t*) OCTEON_PHYS2PTR(result.s_work.addr); + return (octeon_wqe_t*) MIPS_PHYS_TO_KSEG0(result.s_work.addr); } @@ -493,18 +494,14 @@ static inline octeon_wqe_t *octeon_pow_w */ static inline void *octeon_pow_pktptr_to_kbuffer (octeon_buf_ptr_t pkt_ptr) { - return (OCTEON_PHYS2PTR(((pkt_ptr.bits.addr >> 7) - pkt_ptr.bits.back) << 7)); + return ((void *)MIPS_PHYS_TO_KSEG0( + ((pkt_ptr.bits.addr >> 7) - pkt_ptr.bits.back) << 7)); } - - - #define INTERFACE(port) (port >> 4) /* Ports 0-15 are interface 0, 16-31 are interface 1 */ #define INDEX(port) (port & 0xf) - - #define OCTEON_RGMX_PRTX_CFG(index,interface) (0x8001180008000010ull+((index)*2048)+((interface)*0x8000000ull)) #define OCTEON_RGMX_SMACX(offset,block_id) (0x8001180008000230ull+((offset)*2048)+((block_id)*0x8000000ull)) #define OCTEON_RGMX_RXX_ADR_CAM0(offset,block_id) (0x8001180008000180ull+((offset)*2048)+((block_id)*0x8000000ull)) From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 18:17:48 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8181106566C; Mon, 6 Jul 2009 18:17:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3538FC12; Mon, 6 Jul 2009 18:17:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66IHmhF088907; Mon, 6 Jul 2009 18:17:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66IHmYu088905; Mon, 6 Jul 2009 18:17:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907061817.n66IHmYu088905@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 18:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195413 - projects/mips/sys/mips/octeon1 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 18:17:49 -0000 Author: imp Date: Mon Jul 6 18:17:48 2009 New Revision: 195413 URL: http://svn.freebsd.org/changeset/base/195413 Log: GC some now-unused items. Fix for 64-bit build. Note: this breaks the 32-bit build (which we're not computing correctly anyway). Modified: projects/mips/sys/mips/octeon1/octeon_pcmap_regs.h Modified: projects/mips/sys/mips/octeon1/octeon_pcmap_regs.h ============================================================================== --- projects/mips/sys/mips/octeon1/octeon_pcmap_regs.h Mon Jul 6 18:15:57 2009 (r195412) +++ projects/mips/sys/mips/octeon1/octeon_pcmap_regs.h Mon Jul 6 18:17:48 2009 (r195413) @@ -538,17 +538,6 @@ typedef enum { * We limit the allocated device physical blocks to low mem. So use Kseg0 */ -#ifndef AVOID_CODE_NOT_64_BIT /* #ifdef PTR_SIZE == sizeof(u_int32) */ -//#define OCTEON_PHYS2PTR(addr) ((void *) (((uint32_t) addr) | 0x80000000)) -#define OCTEON_PHYS2PTR(addr) ((void *) (((vm_offset_t) addr) | MIPS_KSEG0_START)) -#endif - -#ifdef IN_FUTURE_64_BIT -#ifdef PTR_SIZE == sizeof(u_int64) -#define OCTEON_PHYS2PTR(addr) ((void *) (((uint64_t) addr) | (1ul << 63)) -#endif -#endif - /* * Need to go back to kernel to find v->p mappings & vice-versa * We are getting non 1-1 mappings. @@ -560,17 +549,14 @@ typedef enum { /* PTR_SIZE == sizeof(uint32_t) */ +#if 0 #define mipsx_addr_size uint32_t // u_int64 #define MIPSX_ADDR_SIZE_KSEGX_BIT_SHIFT 30 // 62 #define MIPSX_ADDR_SIZE_KSEGX_MASK_REMOVED 0x1fffffff // 0x1fffffff - - -#ifdef CODE_FOR_64_BIT_NEEDED -#ifdef PTR_SIZE == sizeof(uint64_t) +#else #define mipsx_addr_size uint64_t #define MIPSX_ADDR_SIZE_KSEGX_BIT_SHIFT 62 -#define MIPSX_ADDR_SIZE_KSEGX_MASK_REMOVED 0x1fffffff ffff ffff -#endif +#define MIPSX_ADDR_SIZE_KSEGX_MASK_REMOVED 0x1fffffffffffffff #endif @@ -1071,11 +1057,6 @@ typedef union { #define OCTEON_GENTIMER_LEN_1MS (0x7a120ull) /* Back of envelope. 500Mhz Octeon */ // FIXME IF WRONG #define OCTEON_GENTIMER_LEN_1SEC ((OCTEON_GENTIMER_LEN_1MS) * 1000) - - - - - /* * Physical Memory Banks */ @@ -1095,18 +1076,4 @@ typedef union { #define OCTEON_DRAM_ABOVE_512_END (0x0000000300000000ull - 1ull) /* To be calculated as remaining */ #define OCTEON_DRAM_THIRD_BANK_SIZE (OCTEON_DRAM_ABOVE_512_END - OCTEON_DRAM_ABOVE_512_START + 1ull) - -/* - * Mips Address Range conversions - */ -#define PHY_TO_KSEG1(x) ((x)+0xA0000000) -#define PHY_TO_KSEG0(x) ((x)+0x80000000) -#define PHY_ADDR(x) ((x)&0x1FFFFFFF) -#define ROM_OFFSET(x) ((x)&0x000FFFFF) -#define KSEG1_TO_KSEG0(x) ((x)-0x20000000) - - - - #endif /* !OCTEON_PCMAP_REGS_H__ */ - From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 18:18:27 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B07101065672; Mon, 6 Jul 2009 18:18:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FC668FC1F; Mon, 6 Jul 2009 18:18:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66IIRIE088957; Mon, 6 Jul 2009 18:18:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66IIRpf088954; Mon, 6 Jul 2009 18:18:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907061818.n66IIRpf088954@svn.freebsd.org> From: Warner Losh Date: Mon, 6 Jul 2009 18:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195414 - projects/mips/sys/mips/octeon1 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 18:18:27 -0000 Author: imp Date: Mon Jul 6 18:18:27 2009 New Revision: 195414 URL: http://svn.freebsd.org/changeset/base/195414 Log: 64-bit fixes: fix printf formats and prefer MIPS_PHYS_TO_KSEG0. Modified: projects/mips/sys/mips/octeon1/octeon_ebt3000_cf.c projects/mips/sys/mips/octeon1/octeon_machdep.c Modified: projects/mips/sys/mips/octeon1/octeon_ebt3000_cf.c ============================================================================== --- projects/mips/sys/mips/octeon1/octeon_ebt3000_cf.c Mon Jul 6 18:17:48 2009 (r195413) +++ projects/mips/sys/mips/octeon1/octeon_ebt3000_cf.c Mon Jul 6 18:18:27 2009 (r195414) @@ -509,7 +509,7 @@ static void cf_identify (driver_t *drv, if (!octeon_board_real()) return; - base_addr = (void *) OCTEON_PHYS2PTR(OCTEON_CF_COMMON_BASE_ADDR); + base_addr = (void *) MIPS_PHYS_TO_KSEG0(OCTEON_CF_COMMON_BASE_ADDR); for (bus_region = 0; bus_region < 8; bus_region++) { Modified: projects/mips/sys/mips/octeon1/octeon_machdep.c ============================================================================== --- projects/mips/sys/mips/octeon1/octeon_machdep.c Mon Jul 6 18:17:48 2009 (r195413) +++ projects/mips/sys/mips/octeon1/octeon_machdep.c Mon Jul 6 18:18:27 2009 (r195414) @@ -563,8 +563,9 @@ void ciu_dump_interrutps_enabled (int co } ciu_intr_bits = oct_read64(ciu_intr_reg_addr); - printf(" CIU core %d int: %d en: %d ip: %d Add: 0x%llX enabled: 0x%llX SR: %X\n", - core_num, intx, enx, ciu_ip, ciu_intr_reg_addr, ciu_intr_bits, mips_rd_status()); + printf(" CIU core %d int: %d en: %d ip: %d Add: %p enabled: 0x%llX SR: %x\n", + core_num, intx, enx, ciu_ip, (void *)ciu_intr_reg_addr, + (unsigned long long)ciu_intr_bits, mips_rd_status()); } From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 21:23:43 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5DCD106564A; Mon, 6 Jul 2009 21:23:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4BEF8FC12; Mon, 6 Jul 2009 21:23:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66LNhVI092786; Mon, 6 Jul 2009 21:23:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66LNhTS092782; Mon, 6 Jul 2009 21:23:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907062123.n66LNhTS092782@svn.freebsd.org> From: Rui Paulo Date: Mon, 6 Jul 2009 21:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195419 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 21:23:44 -0000 Author: rpaulo Date: Mon Jul 6 21:23:43 2009 New Revision: 195419 URL: http://svn.freebsd.org/changeset/base/195419 Log: Hide mesh details from output.c by adding mesh_discover(). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 20:51:54 2009 (r195418) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Mon Jul 6 21:23:43 2009 (r195419) @@ -2269,6 +2269,13 @@ ieee80211_add_meshpeer(uint8_t *frm, uin return frm; } +struct ieee80211_node * +ieee80211_mesh_discover(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + return ms->ms_ppath->mpp_discover(vap, dest, m); +} /* * Compute an Airtime Link Metric for the link with this node. * Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 20:51:54 2009 (r195418) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Mon Jul 6 21:23:43 2009 (r195419) @@ -31,8 +31,6 @@ #ifndef _NET80211_IEEE80211_MESH_H_ #define _NET80211_IEEE80211_MESH_H_ -#include /* for ieee80211_state */ - /* * 802.11s Information Elements. */ @@ -394,6 +392,7 @@ struct ieee80211_mesh_route { /* * Mesh Path Selection Protocol. */ +enum ieee80211_state; struct ieee80211_mesh_proto_path { char mpp_descr[12]; uint8_t mpp_ie[4]; @@ -488,5 +487,8 @@ struct ieee80211_scanparams; void ieee80211_mesh_init_neighbor(struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_scanparams *); +struct ieee80211_node * + ieee80211_mesh_discover(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); #endif /* _KERNEL */ #endif /* !_NET80211_IEEE80211_MESH_H_ */ Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Mon Jul 6 20:51:54 2009 (r195418) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Mon Jul 6 21:23:43 2009 (r195419) @@ -239,13 +239,12 @@ ieee80211_start(struct ifnet *ifp) continue; } } else { - struct ieee80211_mesh_state *ms = vap->iv_mesh; - - ni = ms->ms_ppath->mpp_discover(vap, eh->ether_dhost, m); + ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m); if (ni == NULL) { /* - * NB: discover function holds/disposes - * frame (e.g. queueing on path discovery). + * NB: ieee80211_mesh_discover function + * holds/disposes frame + * (e.g. queueing on path discovery). */ ifp->if_oerrors++; continue; From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 21:42:56 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC8B1065674; Mon, 6 Jul 2009 21:42:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE0AF8FC19; Mon, 6 Jul 2009 21:42:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66Lguco093322; Mon, 6 Jul 2009 21:42:56 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66LguN5093319; Mon, 6 Jul 2009 21:42:56 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907062142.n66LguN5093319@svn.freebsd.org> From: Sam Leffler Date: Mon, 6 Jul 2009 21:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195420 - projects/mesh11s/sys/dev/mwl X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 21:42:57 -0000 Author: sam Date: Mon Jul 6 21:42:56 2009 New Revision: 195420 URL: http://svn.freebsd.org/changeset/base/195420 Log: add mesh support Modified: projects/mesh11s/sys/dev/mwl/if_mwl.c Modified: projects/mesh11s/sys/dev/mwl/if_mwl.c ============================================================================== --- projects/mesh11s/sys/dev/mwl/if_mwl.c Mon Jul 6 21:23:43 2009 (r195419) +++ projects/mesh11s/sys/dev/mwl/if_mwl.c Mon Jul 6 21:42:56 2009 (r195420) @@ -420,6 +420,7 @@ mwl_attach(uint16_t devid, struct mwl_so | IEEE80211_C_IBSS /* ibss, nee adhoc, mode */ | IEEE80211_C_AHDEMO /* adhoc demo mode */ #endif + | IEEE80211_C_MBSS /* mesh point link mode */ | IEEE80211_C_WDS /* WDS supported */ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_SHSLOT /* short slot time supported */ @@ -615,6 +616,7 @@ mwl_vap_create(struct ieee80211com *ic, IEEE80211_ADDR_COPY(mac, mac0); switch (opmode) { case IEEE80211_M_HOSTAP: + case IEEE80211_M_MBSS: if ((flags & IEEE80211_CLONE_MACADDR) == 0) assign_address(sc, mac, flags & IEEE80211_CLONE_BSSID); hvap = mwl_hal_newvap(mh, MWL_HAL_AP, mac); @@ -686,7 +688,7 @@ mwl_vap_create(struct ieee80211com *ic, vap->iv_key_delete = mwl_key_delete; vap->iv_key_set = mwl_key_set; #ifdef MWL_HOST_PS_SUPPORT - if (opmode == IEEE80211_M_HOSTAP) { + if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS) { vap->iv_update_ps = mwl_update_ps; mvp->mv_set_tim = vap->iv_set_tim; vap->iv_set_tim = mwl_set_tim; @@ -706,12 +708,14 @@ mwl_vap_create(struct ieee80211com *ic, switch (vap->iv_opmode) { case IEEE80211_M_HOSTAP: + case IEEE80211_M_MBSS: case IEEE80211_M_STA: /* * Setup sta db entry for local address. */ mwl_localstadb(vap); - if (vap->iv_opmode == IEEE80211_M_HOSTAP) + if (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_MBSS) sc->sc_napvaps++; else sc->sc_nstavaps++; @@ -753,11 +757,12 @@ mwl_vap_delete(struct ieee80211vap *vap) ieee80211_vap_detach(vap); switch (opmode) { case IEEE80211_M_HOSTAP: + case IEEE80211_M_MBSS: case IEEE80211_M_STA: KASSERT(hvap != NULL, ("no hal vap handle")); (void) mwl_hal_delstation(hvap, vap->iv_myaddr); mwl_hal_delvap(hvap); - if (opmode == IEEE80211_M_HOSTAP) + if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS) sc->sc_napvaps--; else sc->sc_nstavaps--; @@ -1281,6 +1286,7 @@ mwl_reset_vap(struct ieee80211vap *vap, /* re-setup beacons */ if (state == IEEE80211_S_RUN && (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_MBSS || vap->iv_opmode == IEEE80211_M_IBSS)) { mwl_setapmode(vap, vap->iv_bss->ni_chan); mwl_hal_setnprotmode(hvap, @@ -4184,6 +4190,7 @@ mwl_localstadb(struct ieee80211vap *vap) mwl_setglobalkeys(vap); break; case IEEE80211_M_HOSTAP: + case IEEE80211_M_MBSS: error = mwl_hal_newstation(hvap, vap->iv_myaddr, 0, 0, NULL, vap->iv_flags & IEEE80211_F_WME, 0); if (error == 0) @@ -4248,7 +4255,8 @@ mwl_newstate(struct ieee80211vap *vap, e (void) mwl_peerstadb(ni, 0, 0, NULL); } else if (nstate == IEEE80211_S_CSA) { /* XXX move to below? */ - if (vap->iv_opmode == IEEE80211_M_HOSTAP) + if (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_MBSS) mwl_startcsa(vap); } else if (nstate == IEEE80211_S_CAC) { /* XXX move to below? */ @@ -4282,6 +4290,7 @@ mwl_newstate(struct ieee80211vap *vap, e mwl_localstadb(vap); switch (vap->iv_opmode) { case IEEE80211_M_HOSTAP: + case IEEE80211_M_MBSS: if (ostate == IEEE80211_S_CAC) { /* enable in-service radar detection */ mwl_hal_setradardetection(mh, From owner-svn-src-projects@FreeBSD.ORG Mon Jul 6 23:34:03 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22B741065674; Mon, 6 Jul 2009 23:34:03 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10C7C8FC15; Mon, 6 Jul 2009 23:34:03 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n66NY269095563; Mon, 6 Jul 2009 23:34:02 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n66NY2Qe095561; Mon, 6 Jul 2009 23:34:02 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200907062334.n66NY2Qe095561@svn.freebsd.org> From: Craig Rodrigues Date: Mon, 6 Jul 2009 23:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195421 - projects/jbuild/usr.bin/jbuild/port X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2009 23:34:03 -0000 Author: rodrigc Date: Mon Jul 6 23:34:02 2009 New Revision: 195421 URL: http://svn.freebsd.org/changeset/base/195421 Log: Add jbuild.1 man page to port (right now, this is just the renamed make.1 man page). Modified: projects/jbuild/usr.bin/jbuild/port/Makefile Modified: projects/jbuild/usr.bin/jbuild/port/Makefile ============================================================================== --- projects/jbuild/usr.bin/jbuild/port/Makefile Mon Jul 6 21:42:56 2009 (r195420) +++ projects/jbuild/usr.bin/jbuild/port/Makefile Mon Jul 6 23:34:02 2009 (r195421) @@ -12,12 +12,15 @@ COMMENT= Utility for building soft BUILD_DEPENDS += ${LOCALBASE}/lib/mysql/libmysqlclient.a:${PORTSDIR}/databases/mysql60-client +MAN1= jbuild.1 + do-fetch: ${DO_NADA} do-extract: mkdir -p ${WRKSRC} ( cd ${WRKSRC} ; ln -s ../../../filemon . ; ln -s ../../../../jbuild .; ln -s ../../../../jdirdep .; ln -s ../../../../make .) + ( cd ${WRKSRC}; cp ../../../../make/make.1 jbuild.1 ) cp Makefile.port ${WRKSRC}/Makefile do-install: @@ -26,6 +29,7 @@ do-install: ( cd ${WRKSRC}/jdirdep; ${MAKE} install BINDIR=${PREFIX}/bin ) cp ${WRKSRC}/jdirdep/jcommit ${PREFIX}/bin cp ${WRKSRC}/jdirdep/jgetsrc ${PREFIX}/bin + ${INSTALL_MAN} ${WRKSRC}/jbuild.1 ${MANPREFIX}/man/man1 do-clean: ( cd ${WRKSRC}/filemon; ${MAKE} clean ) From owner-svn-src-projects@FreeBSD.ORG Tue Jul 7 16:10:54 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4984B1065676; Tue, 7 Jul 2009 16:10:54 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37BE38FC2A; Tue, 7 Jul 2009 16:10:54 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n67GAsYs023079; Tue, 7 Jul 2009 16:10:54 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n67GAs8f023076; Tue, 7 Jul 2009 16:10:54 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200907071610.n67GAs8f023076@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 7 Jul 2009 16:10:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195425 - projects/tcp_cc_8.x/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2009 16:10:54 -0000 Author: lstewart Date: Tue Jul 7 16:10:53 2009 New Revision: 195425 URL: http://svn.freebsd.org/changeset/base/195425 Log: - Don't manually add newreno to the cc_list in tcp_init, as the DECLARE_CC_MODULE macro in the new world order takes care of registering the module for us. Add a KASSERT when initing a tcpcb to check that the list is not empty. - sysctl_handle_string is not required in the case where we are setting a new default algorithm. This change fixes a panic that would occur when trying to set the default algorithm. Modified: projects/tcp_cc_8.x/sys/netinet/cc.c projects/tcp_cc_8.x/sys/netinet/tcp_subr.c Modified: projects/tcp_cc_8.x/sys/netinet/cc.c ============================================================================== --- projects/tcp_cc_8.x/sys/netinet/cc.c Tue Jul 7 13:58:47 2009 (r195424) +++ projects/tcp_cc_8.x/sys/netinet/cc.c Tue Jul 7 16:10:53 2009 (r195425) @@ -114,8 +114,6 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) if (!found) return (ESRCH); - - error = sysctl_handle_string(oidp, arg1, arg2, req); } return (error); @@ -160,8 +158,6 @@ cc_init() { CC_LIST_LOCK_INIT(); STAILQ_INIT(&cc_list); - /* Newreno must always be available as an algorithm. */ - cc_register_algo(&newreno_cc_algo); } /* Modified: projects/tcp_cc_8.x/sys/netinet/tcp_subr.c ============================================================================== --- projects/tcp_cc_8.x/sys/netinet/tcp_subr.c Tue Jul 7 13:58:47 2009 (r195424) +++ projects/tcp_cc_8.x/sys/netinet/tcp_subr.c Tue Jul 7 16:10:53 2009 (r195425) @@ -734,6 +734,7 @@ tcp_newtcpcb(struct inpcb *inp) * Use the current system default CC algorithm. */ CC_LIST_RLOCK(); + KASSERT(!STAILQ_EMPTY(&cc_list), ("cc_list is empty!")); CC_ALGO(tp) = CC_DEFAULT(); CC_LIST_RUNLOCK(); From owner-svn-src-projects@FreeBSD.ORG Tue Jul 7 19:29:55 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC84910656D3; Tue, 7 Jul 2009 19:29:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 905CD8FC16; Tue, 7 Jul 2009 19:29:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n67JTtw0027107; Tue, 7 Jul 2009 19:29:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n67JTt9s027104; Tue, 7 Jul 2009 19:29:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907071929.n67JTt9s027104@svn.freebsd.org> From: Rui Paulo Date: Tue, 7 Jul 2009 19:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195427 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2009 19:29:56 -0000 Author: rpaulo Date: Tue Jul 7 19:29:55 2009 New Revision: 195427 URL: http://svn.freebsd.org/changeset/base/195427 Log: Remove ieee80211_hwmp.h since its code only relates to ieee80211_hwmp.c. Sponsored by: The FreeBSD Foundation Deleted: projects/mesh11s/sys/net80211/ieee80211_hwmp.h Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jul 7 18:11:05 2009 (r195426) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jul 7 19:29:55 2009 (r195427) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include static void hwmp_vattach(struct ieee80211vap *); @@ -155,6 +154,30 @@ static const uint8_t broadcastaddr[IEEE8 static const uint8_t invalidaddr[IEEE80211_ADDR_LEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +typedef uint32_t ieee80211_hwmp_seq; +#define IEEE80211_HWMP_SEQ_LEQ(a, b) ((int32_t)((a)-(b)) <= 0) +#define IEEE80211_HWMP_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) + +/* + * Private extension of ieee80211_mesh_route. + */ +struct ieee80211_hwmp_route { + ieee80211_hwmp_seq hr_seq; /* HWMP sequence number */ + ieee80211_hwmp_seq hr_preqid; /* Last PREQ ID seen */ + int hr_preqretries; +}; +struct ieee80211_hwmp_state { + ieee80211_hwmp_seq hs_seq; /* next seq to be used */ + ieee80211_hwmp_seq hs_preqid; /* next PREQ ID to be used */ + struct timeval hs_lastpreq; /* last time we sent a PREQ */ + struct timeval hs_lastprep; /* last time we sent a PREP */ + struct timeval hs_lastperr; /* last time we sent a PERR */ + int hs_rootmode; /* proactive HWMP */ + struct callout hs_roottimer; + uint8_t hs_maxhops; /* max hop count */ + uint8_t hs_ttl; /* HWMP ttl */ +}; + SYSCTL_NODE(_net_wlan, OID_AUTO, hwmp, CTLFLAG_RD, 0, "IEEE 802.11s HWMP parameters"); SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, targetonly, CTLTYPE_INT | CTLFLAG_RW, Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Jul 7 18:11:05 2009 (r195426) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Jul 7 19:29:55 2009 (r195427) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-projects@FreeBSD.ORG Tue Jul 7 19:48:31 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AABC1065675; Tue, 7 Jul 2009 19:48:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED3AC8FC1F; Tue, 7 Jul 2009 19:48:30 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n67JmUTs027519; Tue, 7 Jul 2009 19:48:30 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n67JmUSs027515; Tue, 7 Jul 2009 19:48:30 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907071948.n67JmUSs027515@svn.freebsd.org> From: Rui Paulo Date: Tue, 7 Jul 2009 19:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195428 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2009 19:48:31 -0000 Author: rpaulo Date: Tue Jul 7 19:48:30 2009 New Revision: 195428 URL: http://svn.freebsd.org/changeset/base/195428 Log: * reserve some ioctl numbers * move hwmp route ioctl code to mesh Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_ioctl.h projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jul 7 19:29:55 2009 (r195427) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Tue Jul 7 19:48:30 2009 (r195428) @@ -1304,55 +1304,12 @@ static int hwmp_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; -#if 0 - struct ieee80211_mesh_route *rt; - size_t len, off; - uint8_t *p; -#endif int error; if (vap->iv_opmode != IEEE80211_M_MBSS) return ENOSYS; error = 0; switch (ireq->i_type) { -#if 0 - case IEEE80211_IOC_HWMP_CMD: - switch (ireq->i_val) { - case IEEE80211_HWMP_CMD_LIST: - len = 0; - HWMP_LOCK(hs); - TAILQ_FOREACH(rt, &hs->hs_routes, rt_next) { - len += sizeof(*rt); - } - HWMP_UNLOCK(hs); - if (len > ireq->i_len || ireq->i_len < sizeof(*rt)) - return ENOMEM; - ireq->i_len = len; - p = malloc(len, M_TEMP, M_NOWAIT | M_ZERO); - if (p == NULL) - return ENOMEM; - off = 0; - HWMP_LOCK(hs); - TAILQ_FOREACH(rt, &hs->hs_routes, rt_next) { - if (off >= len) - break; - memcpy(p + off, rt, sizeof(*rt)); - off += sizeof(*rt); - } - HWMP_UNLOCK(hs); - error = copyout(p, (uint8_t *)ireq->i_data, - ireq->i_len); - free(p, M_TEMP); - break; - case IEEE80211_HWMP_CMD_FLUSH: - case IEEE80211_HWMP_CMD_ADD: - case IEEE80211_HWMP_CMD_DELETE: - return EINVAL; - default: - return ENOSYS; - } - break; -#endif case IEEE80211_IOC_HWMP_ROOTMODE: ireq->i_val = hs->hs_rootmode; break; @@ -1379,25 +1336,6 @@ hwmp_ioctl_set80211(struct ieee80211vap return ENOSYS; error = 0; switch (ireq->i_type) { -#if 0 - case IEEE80211_IOC_HWMP_CMD: - switch (ireq->i_val) { - case IEEE80211_HWMP_CMD_LIST: - return EINVAL; - case IEEE80211_HWMP_CMD_FLUSH: - hwmp_rt_flush(vap); - break; - case IEEE80211_HWMP_CMD_ADD: - hwmp_rt_add(vap, ireq->i_data); - break; - case IEEE80211_HWMP_CMD_DELETE: - hwmp_rt_del(vap, ireq->i_data); - break; - default: - return ENOSYS; - } - break; -#endif case IEEE80211_IOC_HWMP_ROOTMODE: if (ireq->i_val < 0 || ireq->i_val > 3) return EINVAL; Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.h Tue Jul 7 19:29:55 2009 (r195427) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.h Tue Jul 7 19:48:30 2009 (r195428) @@ -318,13 +318,13 @@ struct ieee80211req_maclist { }; /* - * HWMP table operations. + * Mesh Routing Table Operations. */ enum { - IEEE80211_HWMP_CMD_LIST = 0, /* list HWMP routing table */ - IEEE80211_HWMP_CMD_FLUSH = 1, /* flush HWMP routing table */ - IEEE80211_HWMP_CMD_ADD = 2, /* add entry to the table */ - IEEE80211_HWMP_CMD_DELETE = 3, /* delete an entry from the table */ + IEEE80211_MESH_RTCMD_LIST = 0, /* list HWMP routing table */ + IEEE80211_MESH_RTCMD_FLUSH = 1, /* flush HWMP routing table */ + IEEE80211_MESH_RTCMD_ADD = 2, /* add entry to the table */ + IEEE80211_MESH_RTCMD_DELETE = 3, /* delete an entry from the table */ }; /* * HWMP root modes @@ -674,15 +674,21 @@ struct ieee80211req { #define IEEE80211_IOC_GREENFIELD 112 /* Greenfield (on, off) */ #define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) */ -#define IEEE80211_IOC_MESH_ID 190 /* mesh identifier */ -#define IEEE80211_IOC_MESH_AP 191 /* accepting peerings */ -#define IEEE80211_IOC_MESH_FWRD 192 /* forward frames */ -#define IEEE80211_IOC_MESH_PROTO 193 /* mesh protocols */ -#define IEEE80211_IOC_MESH_TTL 194 /* mesh TTL */ -#define IEEE80211_IOC_HWMP_CMD 195 /* HWMP table commands */ -#define IEEE80211_IOC_HWMP_ROOTMODE 196 /* HWMP root mode */ -#define IEEE80211_IOC_HWMP_MAXHOPS 197 /* number of hops before drop */ -#define IEEE80211_IOC_HWMP_TTL 198 /* HWMP TTL */ +#define IEEE80211_IOC_MESH_ID 170 /* mesh identifier */ +#define IEEE80211_IOC_MESH_AP 171 /* accepting peerings */ +#define IEEE80211_IOC_MESH_FWRD 172 /* forward frames */ +#define IEEE80211_IOC_MESH_PROTO 173 /* mesh protocols */ +#define IEEE80211_IOC_MESH_TTL 174 /* mesh TTL */ +#define IEEE80211_IOC_MESH_RTCMD 175 /* mesh routing table commands*/ +#define IEEE80211_IOC_MESH_PR_METRIC 176 /* mesh metric protocol */ +#define IEEE80211_IOC_MESH_PR_PATH 177 /* mesh path protocol */ +#define IEEE80211_IOC_MESH_PR_SIG 178 /* mesh sig protocol */ +#define IEEE80211_IOC_MESH_PR_CC 179 /* mesh congestion protocol */ +#define IEEE80211_IOC_MESH_PR_AUTH 180 /* mesh auth protocol */ + +#define IEEE80211_IOC_HWMP_ROOTMODE 190 /* HWMP root mode */ +#define IEEE80211_IOC_HWMP_MAXHOPS 191 /* number of hops before drop */ +#define IEEE80211_IOC_HWMP_TTL 192 /* HWMP TTL */ #define IEEE80211_IOC_TDMA_SLOT 201 /* TDMA: assigned slot */ #define IEEE80211_IOC_TDMA_SLOTCNT 202 /* TDMA: slots in bss */ Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Jul 7 19:29:55 2009 (r195427) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Tue Jul 7 19:48:30 2009 (r195428) @@ -2381,8 +2381,11 @@ static int mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_mesh_state *ms = vap->iv_mesh; - int error; uint8_t tmpmeshid[IEEE80211_NWID_LEN]; + struct ieee80211_mesh_route *rt; + size_t len, off; + uint8_t *p; + int error; if (vap->iv_opmode != IEEE80211_M_MBSS) return ENOSYS; @@ -2403,6 +2406,44 @@ mesh_ioctl_get80211(struct ieee80211vap case IEEE80211_IOC_MESH_TTL: ireq->i_val = ms->ms_ttl; break; + case IEEE80211_IOC_MESH_RTCMD: + switch (ireq->i_val) { + case IEEE80211_MESH_RTCMD_LIST: + len = 0; + MESH_RT_LOCK(ms); + TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { + len += sizeof(*rt); + } + MESH_RT_UNLOCK(ms); + if (len > ireq->i_len || ireq->i_len < sizeof(*rt)) { + ireq->i_len = len; + return ENOMEM; + } + ireq->i_len = len; + p = malloc(len, M_TEMP, M_NOWAIT | M_ZERO); + if (p == NULL) + return ENOMEM; + off = 0; + MESH_RT_LOCK(ms); + TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { + if (off >= len) + break; + memcpy(p + off, rt, sizeof(*rt)); + off += sizeof(*rt); + } + MESH_RT_UNLOCK(ms); + error = copyout(p, (uint8_t *)ireq->i_data, + ireq->i_len); + free(p, M_TEMP); + break; + case IEEE80211_MESH_RTCMD_FLUSH: + case IEEE80211_MESH_RTCMD_ADD: + case IEEE80211_MESH_RTCMD_DELETE: + return EINVAL; + default: + return ENOSYS; + } + break; default: return ENOSYS; } @@ -2448,10 +2489,28 @@ mesh_ioctl_set80211(struct ieee80211vap case IEEE80211_IOC_MESH_TTL: ms->ms_ttl = (uint8_t) ireq->i_val; break; + case IEEE80211_IOC_MESH_RTCMD: + switch (ireq->i_val) { + case IEEE80211_MESH_RTCMD_LIST: + return EINVAL; + case IEEE80211_MESH_RTCMD_FLUSH: + ieee80211_mesh_rt_flush(vap); + break; + case IEEE80211_MESH_RTCMD_ADD: + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ireq->i_data)) + return EINVAL; + ieee80211_mesh_rt_add(vap, ireq->i_data); + break; + case IEEE80211_MESH_RTCMD_DELETE: + ieee80211_mesh_rt_del(vap, ireq->i_data); + break; + default: + return ENOSYS; + } + break; default: return ENOSYS; } - return error; } IEEE80211_IOCTL_SET(mesh, mesh_ioctl_set80211); From owner-svn-src-projects@FreeBSD.ORG Tue Jul 7 19:55:10 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25B8D1065670; Tue, 7 Jul 2009 19:55:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 146218FC0A; Tue, 7 Jul 2009 19:55:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n67Jt9Hh027681; Tue, 7 Jul 2009 19:55:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n67Jt9Da027678; Tue, 7 Jul 2009 19:55:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200907071955.n67Jt9Da027678@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 7 Jul 2009 19:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195429 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2009 19:55:10 -0000 Author: gonzo Date: Tue Jul 7 19:55:09 2009 New Revision: 195429 URL: http://svn.freebsd.org/changeset/base/195429 Log: - Move dpcpu initialization to mips_proc0_init. It's more appropriate place for it. Besides dpcpu_init requires pmap module to be initialized and calling it int pmap.c hangs the system Modified: projects/mips/sys/mips/mips/machdep.c projects/mips/sys/mips/mips/pmap.c Modified: projects/mips/sys/mips/mips/machdep.c ============================================================================== --- projects/mips/sys/mips/mips/machdep.c Tue Jul 7 19:48:30 2009 (r195428) +++ projects/mips/sys/mips/mips/machdep.c Tue Jul 7 19:55:09 2009 (r195429) @@ -274,6 +274,9 @@ mips_proc0_init(void) (thread0.td_kstack_pages - 1) * PAGE_SIZE) - 1; thread0.td_frame = &thread0.td_pcb->pcb_regs; + /* Steal memory for the dynamic per-cpu area. */ + dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0); + /* * There is no need to initialize md_upte array for thread0 as it's * located in .bss section and should be explicitly zeroed during Modified: projects/mips/sys/mips/mips/pmap.c ============================================================================== --- projects/mips/sys/mips/mips/pmap.c Tue Jul 7 19:48:30 2009 (r195428) +++ projects/mips/sys/mips/mips/pmap.c Tue Jul 7 19:55:09 2009 (r195429) @@ -332,9 +332,6 @@ again: msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); msgbufinit(msgbufp, MSGBUF_SIZE); - /* Steal memory for the dynamic per-cpu area. */ - dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0); - /* * Steal thread0 kstack. */ From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 02:12:47 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6130106566C; Wed, 8 Jul 2009 02:12:47 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA14A8FC1F; Wed, 8 Jul 2009 02:12:47 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n682ClaJ035286; Wed, 8 Jul 2009 02:12:47 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n682ClwG035283; Wed, 8 Jul 2009 02:12:47 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200907080212.n682ClwG035283@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 8 Jul 2009 02:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195433 - projects/jbuild/usr.bin/jbuild/filemon X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 02:12:48 -0000 Author: rodrigc Date: Wed Jul 8 02:12:47 2009 New Revision: 195433 URL: http://svn.freebsd.org/changeset/base/195433 Log: Provide support for using a 32-bit jbuild binary on a 64-bit host. Submitted by: Artem Belevich (@ Juniper Networks) Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon.c projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon.c ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/filemon.c Wed Jul 8 01:43:47 2009 (r195432) +++ projects/jbuild/usr.bin/jbuild/filemon/filemon.c Wed Jul 8 02:12:47 2009 (r195433) @@ -22,7 +22,16 @@ #include #include "filemon.h" +#ifdef COMPAT_IA32 +#include +#include + +extern struct sysentvec ia32_freebsd_sysvec; + +#endif + extern struct sysentvec elf32_freebsd_sysvec; +extern struct sysentvec elf64_freebsd_sysvec; static d_close_t filemon_close; static d_ioctl_t filemon_ioctl; Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Wed Jul 8 01:43:47 2009 (r195432) +++ projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Wed Jul 8 02:12:47 2009 (r195433) @@ -132,6 +132,43 @@ filemon_wrapper_execve(struct thread *td return(ret); } +#ifdef COMPAT_IA32 +static int +filemon_wrapper_freebsd32_execve(struct thread *td, struct freebsd32_execve_args *uap) +{ + char fname[MAXPATHLEN]; + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + copyinstr(uap->fname, fname, sizeof(fname), &done); + + if ((ret = freebsd32_execve(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", + curproc->p_pid, fname); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return(ret); +} +#endif + static int filemon_wrapper_fork(struct thread *td, struct fork_args *uap) { @@ -147,8 +184,8 @@ filemon_wrapper_fork(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %d\n", - curproc->p_pid, curthread->td_retval[0]); + len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %ld\n", + curproc->p_pid, (long)curthread->td_retval[0]); filemon_output(filemon, filemon->msgbufr, len); @@ -266,6 +303,42 @@ filemon_wrapper_stat(struct thread *td, return(ret); } +#ifdef COMPAT_IA32 +static int +filemon_wrapper_freebsd32_stat(struct thread *td, struct freebsd32_stat_args *uap) +{ + int ret; + size_t done; + size_t len; + struct filemon *filemon; + + if ((ret = freebsd32_stat(td, uap)) == 0) { + /* Grab a read lock on the filemon inuse list. */ + filemon_lock_read(); + + if ((filemon = filemon_pid_check(curproc)) != NULL) { + /* Lock the found filemon structure. */ + filemon_filemon_lock(filemon); + + copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); + + len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "S %d %s\n", + curproc->p_pid, filemon->fname1); + + filemon_output(filemon, filemon->msgbufr, len); + + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); + } + + /* Release the read lock. */ + filemon_unlock_read(); + } + + return(ret); +} +#endif + static void filemon_wrapper_sys_exit(struct thread *td, struct sys_exit_args *uap) { @@ -349,8 +422,8 @@ filemon_wrapper_vfork(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %d\n", - curproc->p_pid, curthread->td_retval[0]); + len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %ld\n", + curproc->p_pid, (long)curthread->td_retval[0]); filemon_output(filemon, filemon->msgbufr, len); @@ -385,6 +458,22 @@ filemon_wrapper_install(void) sv_table[SYS_stat].sy_call = (sy_call_t *) filemon_wrapper_stat; sv_table[SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; sv_table[SYS_vfork].sy_call = (sy_call_t *) filemon_wrapper_vfork; + +#ifdef COMPAT_IA32 + sv_table = ia32_freebsd_sysvec.sv_table; + + sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; + sv_table[FREEBSD32_SYS_exit].sy_call = (sy_call_t *) filemon_wrapper_sys_exit; + sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_execve; + sv_table[FREEBSD32_SYS_fork].sy_call = (sy_call_t *) filemon_wrapper_fork; + sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; + sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; + sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_stat; + sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) filemon_wrapper_unlink; + sv_table[FREEBSD32_SYS_vfork].sy_call = (sy_call_t *) filemon_wrapper_vfork; +#endif + + } static void @@ -407,4 +496,19 @@ filemon_wrapper_deinstall(void) sv_table[SYS_stat].sy_call = (sy_call_t *) stat; sv_table[SYS_unlink].sy_call = (sy_call_t *) unlink; sv_table[SYS_vfork].sy_call = (sy_call_t *) vfork; + +#ifdef COMPAT_IA32 + sv_table = ia32_freebsd_sysvec.sv_table; + + sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) chdir; + sv_table[FREEBSD32_SYS_exit].sy_call = (sy_call_t *) sys_exit; + sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *)freebsd32_execve; + sv_table[FREEBSD32_SYS_fork].sy_call = (sy_call_t *) fork; + sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) open; + sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) rename; + sv_table[FREEBSD32_SYS_freebsd32_stat].sy_call = (sy_call_t *) freebsd32_stat; + sv_table[FREEBSD32_SYS_unlink].sy_call = (sy_call_t *) unlink; + sv_table[FREEBSD32_SYS_vfork].sy_call = (sy_call_t *) vfork; +#endif + } From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 02:21:08 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CA0E106567B; Wed, 8 Jul 2009 02:21:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 609818FC20; Wed, 8 Jul 2009 02:21:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n682L81p035471; Wed, 8 Jul 2009 02:21:08 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n682L8u9035469; Wed, 8 Jul 2009 02:21:08 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200907080221.n682L8u9035469@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 8 Jul 2009 02:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195434 - projects/mips/sys/mips/atheros X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 02:21:08 -0000 Author: gonzo Date: Wed Jul 8 02:21:08 2009 New Revision: 195434 URL: http://svn.freebsd.org/changeset/base/195434 Log: - Fix off-by-one bug in arge_fixup_rx. If mbuf is located by the end of the page and even number of bytes long, that may cause TLBMiss exception for unallocated address. - Fix mess with DMA sync opeartions Modified: projects/mips/sys/mips/atheros/if_arge.c Modified: projects/mips/sys/mips/atheros/if_arge.c ============================================================================== --- projects/mips/sys/mips/atheros/if_arge.c Wed Jul 8 02:12:47 2009 (r195433) +++ projects/mips/sys/mips/atheros/if_arge.c Wed Jul 8 02:21:08 2009 (r195434) @@ -162,7 +162,6 @@ DRIVER_MODULE(miibus, arge, miibus_drive */ extern uint32_t ar711_base_mac[ETHER_ADDR_LEN]; - /* * Flushes all */ @@ -1323,7 +1322,7 @@ arge_rx_ring_init(struct arge_softc *sc) bus_dmamap_sync(sc->arge_cdata.arge_rx_ring_tag, sc->arge_cdata.arge_rx_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREWRITE); return (0); } @@ -1356,8 +1355,6 @@ arge_newbuf(struct arge_softc *sc, int i rxd = &sc->arge_cdata.arge_rxdesc[idx]; if (rxd->rx_m != NULL) { - bus_dmamap_sync(sc->arge_cdata.arge_rx_tag, rxd->rx_dmamap, - BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->arge_cdata.arge_rx_tag, rxd->rx_dmamap); } map = rxd->rx_dmamap; @@ -1370,6 +1367,10 @@ arge_newbuf(struct arge_softc *sc, int i desc->packet_addr = segs[0].ds_addr; desc->packet_ctrl = ARGE_DESC_EMPTY | ARGE_DMASIZE(segs[0].ds_len); + bus_dmamap_sync(sc->arge_cdata.arge_rx_ring_tag, + sc->arge_cdata.arge_rx_ring_map, + BUS_DMASYNC_PREWRITE); + return (0); } @@ -1382,8 +1383,12 @@ arge_fixup_rx(struct mbuf *m) src = mtod(m, uint16_t *); dst = src - 1; - for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++) + for (i = 0; i < m->m_len / sizeof(uint16_t); i++) { *dst++ = *src++; + } + + if (m->m_len % sizeof(uint16_t)) + *(uint8_t *)dst = *(uint8_t *)src; m->m_data -= ETHER_ALIGN; } @@ -1497,7 +1502,7 @@ arge_rx_locked(struct arge_softc *sc) packet_len = ARGE_DMASIZE(cur_rx->packet_ctrl); bus_dmamap_sync(sc->arge_cdata.arge_rx_tag, rxd->rx_dmamap, - BUS_DMASYNC_PREREAD); + BUS_DMASYNC_POSTREAD); m = rxd->rx_m; arge_fixup_rx(m); @@ -1526,14 +1531,9 @@ arge_rx_locked(struct arge_softc *sc) bus_dmamap_sync(sc->arge_cdata.arge_rx_ring_tag, sc->arge_cdata.arge_rx_ring_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - + BUS_DMASYNC_PREWRITE); sc->arge_cdata.arge_rx_cons = cons; - - bus_dmamap_sync(sc->arge_cdata.arge_rx_ring_tag, - sc->arge_cdata.arge_rx_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } } From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 02:31:36 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31EAF1065670; Wed, 8 Jul 2009 02:31:36 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 206F88FC0A; Wed, 8 Jul 2009 02:31:36 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n682VaQt035757; Wed, 8 Jul 2009 02:31:36 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n682Vaig035755; Wed, 8 Jul 2009 02:31:36 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200907080231.n682Vaig035755@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 8 Jul 2009 02:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195435 - projects/jbuild/usr.bin/jbuild/port X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 02:31:36 -0000 Author: rodrigc Date: Wed Jul 8 02:31:35 2009 New Revision: 195435 URL: http://svn.freebsd.org/changeset/base/195435 Log: Set PORTDIRNAME to PORTNAME to avoid "devel/port" being written to the pkg origin. Noticed by: obrien Modified: projects/jbuild/usr.bin/jbuild/port/Makefile Modified: projects/jbuild/usr.bin/jbuild/port/Makefile ============================================================================== --- projects/jbuild/usr.bin/jbuild/port/Makefile Wed Jul 8 02:21:08 2009 (r195434) +++ projects/jbuild/usr.bin/jbuild/port/Makefile Wed Jul 8 02:31:35 2009 (r195435) @@ -4,6 +4,7 @@ # PORTNAME= jbuild +PORTDIRNAME= ${PORTNAME} PORTVERSION= 12 CATEGORIES= devel From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 05:57:59 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41530106564A; Wed, 8 Jul 2009 05:57:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 301618FC15; Wed, 8 Jul 2009 05:57:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n685vxOP040115; Wed, 8 Jul 2009 05:57:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n685vx4W040113; Wed, 8 Jul 2009 05:57:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907080557.n685vx4W040113@svn.freebsd.org> From: Warner Losh Date: Wed, 8 Jul 2009 05:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195437 - projects/mips/sys/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 05:57:59 -0000 Author: imp Date: Wed Jul 8 05:57:58 2009 New Revision: 195437 URL: http://svn.freebsd.org/changeset/base/195437 Log: The kernel isn't quite ready for this to be optional... Modified: projects/mips/sys/conf/files.mips Modified: projects/mips/sys/conf/files.mips ============================================================================== --- projects/mips/sys/conf/files.mips Wed Jul 8 05:56:14 2009 (r195436) +++ projects/mips/sys/conf/files.mips Wed Jul 8 05:57:58 2009 (r195437) @@ -49,7 +49,7 @@ mips/mips/tick.c standard # ---------------------------------------------------------------------- # Phase 5 # ---------------------------------------------------------------------- -mips/mips/fp.S optional hardfp +mips/mips/fp.S standard mips/mips/pm_machdep.c standard mips/mips/swtch.S standard mips/mips/tlb.S standard From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 06:00:19 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 086811065672; Wed, 8 Jul 2009 06:00:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB67E8FC16; Wed, 8 Jul 2009 06:00:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6860Ivf040227; Wed, 8 Jul 2009 06:00:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6860ILV040225; Wed, 8 Jul 2009 06:00:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907080600.n6860ILV040225@svn.freebsd.org> From: Warner Losh Date: Wed, 8 Jul 2009 06:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195438 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 06:00:19 -0000 Author: imp Date: Wed Jul 8 06:00:18 2009 New Revision: 195438 URL: http://svn.freebsd.org/changeset/base/195438 Log: Turns out this code was right, revert last change. Modified: projects/mips/sys/mips/mips/db_interface.c Modified: projects/mips/sys/mips/mips/db_interface.c ============================================================================== --- projects/mips/sys/mips/mips/db_interface.c Wed Jul 8 05:57:58 2009 (r195437) +++ projects/mips/sys/mips/mips/db_interface.c Wed Jul 8 06:00:18 2009 (r195438) @@ -197,7 +197,7 @@ db_write_bytes(vm_offset_t addr, size_t break; case 8: atomic_store_64((volatile u_int64_t *)addr, - *(u_int64_t *)data); + (u_int64_t *)data); break; } } else { From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 06:01:37 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0466106568F; Wed, 8 Jul 2009 06:01:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC738FC1B; Wed, 8 Jul 2009 06:01:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6861bSV040324; Wed, 8 Jul 2009 06:01:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6861b5q040322; Wed, 8 Jul 2009 06:01:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907080601.n6861b5q040322@svn.freebsd.org> From: Warner Losh Date: Wed, 8 Jul 2009 06:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195440 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 06:01:38 -0000 Author: imp Date: Wed Jul 8 06:01:37 2009 New Revision: 195440 URL: http://svn.freebsd.org/changeset/base/195440 Log: Fix atomic_store_64 prototype for 64-bit systems. Modified: projects/mips/sys/mips/include/atomic.h Modified: projects/mips/sys/mips/include/atomic.h ============================================================================== --- projects/mips/sys/mips/include/atomic.h Wed Jul 8 06:00:21 2009 (r195439) +++ projects/mips/sys/mips/include/atomic.h Wed Jul 8 06:01:37 2009 (r195440) @@ -346,10 +346,9 @@ void atomic_store_64(__volatile uint64_t void atomic_load_64(__volatile uint64_t *, uint64_t *); #else static __inline void -atomic_store_64(__volatile uint64_t *p, uint64_t v) +atomic_store_64(__volatile uint64_t *p, uint64_t *v) { - - *p = v; + *p = *v; } static __inline void From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 11:21:09 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D59831065678; Wed, 8 Jul 2009 11:21:09 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F26A8FC1E; Wed, 8 Jul 2009 11:21:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68BL7gL049360; Wed, 8 Jul 2009 11:21:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68BL74G049358; Wed, 8 Jul 2009 11:21:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081121.n68BL74G049358@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 11:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195445 - projects/mesh11s/sbin/ifconfig X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 11:21:10 -0000 Author: rpaulo Date: Wed Jul 8 11:21:07 2009 New Revision: 195445 URL: http://svn.freebsd.org/changeset/base/195445 Log: Try to fix build errors. Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 10:21:52 2009 (r195444) +++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 11:21:07 2009 (r195445) @@ -84,7 +84,6 @@ #include #include #include -#include #include #include @@ -1280,7 +1279,7 @@ DECL_CMD_FUNC(set80211maccmd, val, d) } static void -set80211hwmpmac(int s, int req, const char *val) +set80211meshrtmac(int s, int req, const char *val) { char *temp; struct sockaddr_dl sdl; @@ -1295,26 +1294,26 @@ set80211hwmpmac(int s, int req, const ch free(temp); if (sdl.sdl_alen != IEEE80211_ADDR_LEN) errx(1, "malformed link-level address"); - set80211(s, IEEE80211_IOC_HWMP_CMD, req, + set80211(s, IEEE80211_IOC_MESH_RTCMD, req, IEEE80211_ADDR_LEN, LLADDR(&sdl)); } static -DECL_CMD_FUNC(set80211addhwmp, val, d) +DECL_CMD_FUNC(set80211addmeshrt, val, d) { - set80211hwmpmac(s, IEEE80211_HWMP_CMD_ADD, val); + set80211meshrtmac(s, IEEE80211_MESH_RTCMD_ADD, val); } static -DECL_CMD_FUNC(set80211delhwmp, val, d) +DECL_CMD_FUNC(set80211delmeshrt, val, d) { - set80211hwmpmac(s, IEEE80211_HWMP_CMD_DELETE, val); + set80211meshrtmac(s, IEEE80211_MESH_RTCMD_DELETE, val); } static -DECL_CMD_FUNC(set80211hwmpcmd, val, d) +DECL_CMD_FUNC(set80211meshrtcmd, val, d) { - set80211(s, IEEE80211_IOC_HWMP_CMD, d, 0, NULL); + set80211(s, IEEE80211_IOC_MESH_RTCMD, d, 0, NULL); } static @@ -3368,7 +3367,7 @@ mesh_linkstate_string(uint8_t state) } static void -list_mesh(int s) +list_peers(int s) { union { struct ieee80211req_sta_req req; @@ -3966,39 +3965,44 @@ list_regdomain(int s, int channelsalso) } static void -list_hwmp(int s) +list_mesh(int s) { int i; struct ieee80211req ireq; - struct ieee80211_hwmp_route routes[100]; + struct ieee80211req_mesh_route routes[128]; (void) memset(&ireq, 0, sizeof(ireq)); (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); - ireq.i_type = IEEE80211_IOC_HWMP_CMD; - ireq.i_val = IEEE80211_HWMP_CMD_LIST; + ireq.i_type = IEEE80211_IOC_MESH_RTCMD; + ireq.i_val = IEEE80211_MESH_RTCMD_LIST; ireq.i_data = &routes; ireq.i_len = sizeof(routes); if (ioctl(s, SIOCG80211, &ireq) < 0) - err(1, "unable to get HWMP routing table"); + err(1, "unable to get the Mesh routing table"); - printf("%-17.17s %-17.17s %4s %4s %4s %4s %4s\n" + printf("%-17.17s %-17.17s %4s %4s %4s\n" , "DEST" , "NEXT HOP" , "HOPS" , "METRIC" - , "LIFETIME" + , "LIFETIME"); +#if 0 , "SEQ" , "PREQID"); +#endif for (i = 0; i < ireq.i_len / sizeof(*routes); i++) { - printf("%s ", ether_ntoa((const struct ether_addr *) - routes[i].rt_dest)); - printf("%s %4u %4d %6d %4d %6d\n", + printf("%s ", + ether_ntoa((const struct ether_addr *)routes[i].imr_dest)); + printf("%s %4u %4d %6dn", ether_ntoa((const struct ether_addr *) - routes[i].rt_nexthop), - routes[i].rt_nhops, routes[i].rt_metric, - routes[i].rt_lifetime, routes[i].rt_seq, + routes[i].imr_nexthop), + routes[i].imr_nhops, routes[i].imr_metric, + routes[i].imr_lifetime); +#if 0 + , routes[i].rt_seq, routes[i].rt_preqid); +#endif } } @@ -4035,10 +4039,10 @@ DECL_CMD_FUNC(set80211list, arg, d) list_regdomain(s, 1); else if (iseq(arg, "countries")) list_countries(); + else if (iseq(arg, "peers")) + list_peers(s); else if (iseq(arg, "mesh")) list_mesh(s); - else if (iseq(arg, "hwmp")) - list_hwmp(s); else errx(1, "Don't know how to list %s for %s", arg, name); LINE_BREAK(); @@ -5245,9 +5249,9 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-meshforward", 0, set80211meshforward), DEF_CMD("meshpeering", 1, set80211meshpeering), DEF_CMD("-meshpeering", 0, set80211meshpeering), - DEF_CMD("hwmp:flush", IEEE80211_HWMP_CMD_FLUSH, set80211hwmpcmd), - DEF_CMD_ARG("hwmp:add", set80211addhwmp), - DEF_CMD_ARG("hwmp:del", set80211delhwmp), + DEF_CMD("meshrt:flush", IEEE80211_MESH_RTCMD_FLUSH, set80211meshrtcmd), + DEF_CMD_ARG("meshrt:add", set80211addmeshrt), + DEF_CMD_ARG("meshrt:del", set80211delmeshrt), DEF_CMD_ARG("hwmprootmode", set80211hwmprootmode), DEF_CMD_ARG("hwmpmaxhops", set80211hwmpmaxhops), DEF_CMD_ARG("hwmptll", set80211hwmpttl), From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 11:22:06 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B950B106564A; Wed, 8 Jul 2009 11:22:04 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A869B8FC17; Wed, 8 Jul 2009 11:22:04 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68BM4Tq049431; Wed, 8 Jul 2009 11:22:04 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68BM4D5049428; Wed, 8 Jul 2009 11:22:04 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081122.n68BM4D5049428@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 11:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195446 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 11:22:06 -0000 Author: rpaulo Date: Wed Jul 8 11:22:04 2009 New Revision: 195446 URL: http://svn.freebsd.org/changeset/base/195446 Log: First try at stablizing mesh api/abi. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 11:21:07 2009 (r195445) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 11:22:04 2009 (r195446) @@ -2383,6 +2383,7 @@ mesh_ioctl_get80211(struct ieee80211vap struct ieee80211_mesh_state *ms = vap->iv_mesh; uint8_t tmpmeshid[IEEE80211_NWID_LEN]; struct ieee80211_mesh_route *rt; + struct ieee80211ireq_mesh_route *imr; size_t len, off; uint8_t *p; int error; @@ -2412,10 +2413,10 @@ mesh_ioctl_get80211(struct ieee80211vap len = 0; MESH_RT_LOCK(ms); TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { - len += sizeof(*rt); + len += sizeof(*imr); } MESH_RT_UNLOCK(ms); - if (len > ireq->i_len || ireq->i_len < sizeof(*rt)) { + if (len > ireq->i_len || ireq->i_len < sizeof(*imr)) { ireq->i_len = len; return ENOMEM; } @@ -2428,8 +2429,15 @@ mesh_ioctl_get80211(struct ieee80211vap TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { if (off >= len) break; - memcpy(p + off, rt, sizeof(*rt)); - off += sizeof(*rt); + irt = (struct ieee80211req_mesh_route *)(p + off); + IEEE80211_ADDR_COPY(imr->imr_dest, + rt->rt_dest); + IEEE80211_ADDR_COPY(imr->imr_nexthop, + rt->rt_nexthop); + imr->imr_metric = rt->rt_metric; + imr->imr_nhops = rt->rt_nhops; + imr->imr_lifetime = rt->rt_lifetime; + off += sizeof(*imr); } MESH_RT_UNLOCK(ms); error = copyout(p, (uint8_t *)ireq->i_data, Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 11:21:07 2009 (r195445) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 11:22:04 2009 (r195446) @@ -372,7 +372,11 @@ struct ieee80211_meshcntl_ae11 { } __packed; struct ieee80211req_mesh_routes { -/* XXX TBD */ + uint8_t imr_dest[IEEE80211_ADDR_LEN]; + uint8_t imr_nexthop[IEEE80211_ADDR_LEN]; + uint32_t imr_metric; + uint16_t imr_nhops; + uint32_t imr_lifetime; }; #ifdef _KERNEL From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 11:39:51 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E9B41065686; Wed, 8 Jul 2009 11:39:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87EEE8FC1A; Wed, 8 Jul 2009 11:39:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68Bdp2O049831; Wed, 8 Jul 2009 11:39:51 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68BdpS5049809; Wed, 8 Jul 2009 11:39:51 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081139.n68BdpS5049809@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 11:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195447 - in projects/mesh11s: . cddl/contrib/opensolaris contrib/bind9 contrib/cpio contrib/csup contrib/ee contrib/file contrib/gdb contrib/gdtoa contrib/less contrib/libpcap contrib/... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 11:39:52 -0000 Author: rpaulo Date: Wed Jul 8 11:39:50 2009 New Revision: 195447 URL: http://svn.freebsd.org/changeset/base/195447 Log: MFC 195323:195446 Added: projects/mesh11s/tools/regression/usr.bin/jot/regress.dddd.out - copied unchanged from r195446, head/tools/regression/usr.bin/jot/regress.dddd.out Modified: projects/mesh11s/ (props changed) projects/mesh11s/MAINTAINERS projects/mesh11s/cddl/contrib/opensolaris/ (props changed) projects/mesh11s/contrib/bind9/ (props changed) projects/mesh11s/contrib/cpio/ (props changed) projects/mesh11s/contrib/csup/ (props changed) projects/mesh11s/contrib/ee/ (props changed) projects/mesh11s/contrib/file/ (props changed) projects/mesh11s/contrib/gdb/ (props changed) projects/mesh11s/contrib/gdtoa/ (props changed) projects/mesh11s/contrib/less/ (props changed) projects/mesh11s/contrib/libpcap/ (props changed) projects/mesh11s/contrib/ncurses/ (props changed) projects/mesh11s/contrib/netcat/ (props changed) projects/mesh11s/contrib/ntp/ (props changed) projects/mesh11s/contrib/openbsm/ (props changed) projects/mesh11s/contrib/openpam/ (props changed) projects/mesh11s/contrib/pf/ (props changed) projects/mesh11s/contrib/sendmail/ (props changed) projects/mesh11s/contrib/tcpdump/ (props changed) projects/mesh11s/contrib/top/ (props changed) projects/mesh11s/contrib/top/install-sh (props changed) projects/mesh11s/contrib/wpa/ (props changed) projects/mesh11s/crypto/openssh/ (props changed) projects/mesh11s/crypto/openssl/ (props changed) projects/mesh11s/lib/libc/ (props changed) projects/mesh11s/lib/libc/stdio/asprintf.c (props changed) projects/mesh11s/lib/libc/stdtime/ (props changed) projects/mesh11s/lib/libc/string/ffsll.c (props changed) projects/mesh11s/lib/libc/string/flsll.c (props changed) projects/mesh11s/lib/libc/string/wcpcpy.c (props changed) projects/mesh11s/lib/libc/string/wcpncpy.c (props changed) projects/mesh11s/lib/libc/sys/execve.2 projects/mesh11s/lib/libthr/thread/thr_rtld.c projects/mesh11s/lib/libthr/thread/thr_rwlock.c projects/mesh11s/lib/libusb/ (props changed) projects/mesh11s/lib/libusb/libusb20.3 (props changed) projects/mesh11s/lib/libusb/usb.h (props changed) projects/mesh11s/lib/libutil/ (props changed) projects/mesh11s/sbin/ (props changed) projects/mesh11s/sbin/ipfw/ (props changed) projects/mesh11s/share/man/man4/acpi_hp.4 projects/mesh11s/share/man/man4/acpi_wmi.4 projects/mesh11s/share/man/man4/pcm.4 projects/mesh11s/share/zoneinfo/ (props changed) projects/mesh11s/sys/ (props changed) projects/mesh11s/sys/amd64/amd64/io_apic.c projects/mesh11s/sys/amd64/amd64/machdep.c projects/mesh11s/sys/amd64/amd64/msi.c projects/mesh11s/sys/amd64/amd64/pmap.c projects/mesh11s/sys/amd64/include/param.h projects/mesh11s/sys/amd64/include/xen/ (props changed) projects/mesh11s/sys/arm/include/param.h projects/mesh11s/sys/cddl/contrib/opensolaris/ (props changed) projects/mesh11s/sys/conf/files projects/mesh11s/sys/conf/newvers.sh projects/mesh11s/sys/contrib/dev/acpica/ (props changed) projects/mesh11s/sys/contrib/pf/ (props changed) projects/mesh11s/sys/dev/acpi_support/acpi_hp.c projects/mesh11s/sys/dev/ata/ (props changed) projects/mesh11s/sys/dev/ata/ata-usb.c (props changed) projects/mesh11s/sys/dev/ata/atapi-cd.c projects/mesh11s/sys/dev/ata/chipsets/ata-ahci.c projects/mesh11s/sys/dev/ata/chipsets/ata-nvidia.c projects/mesh11s/sys/dev/ath/ah_osdep.c projects/mesh11s/sys/dev/ath/ah_osdep.h projects/mesh11s/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/mesh11s/sys/dev/cxgb/ (props changed) projects/mesh11s/sys/dev/e1000/e1000_82542.c projects/mesh11s/sys/dev/sound/pcm/feeder_rate.c projects/mesh11s/sys/dev/sound/usb/uaudio.c (props changed) projects/mesh11s/sys/dev/sound/usb/uaudio.h (props changed) projects/mesh11s/sys/dev/sound/usb/uaudio_pcm.c (props changed) projects/mesh11s/sys/dev/sound/usb/uaudioreg.h (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci.c (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci.h (props changed) projects/mesh11s/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci.c (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci.h (props changed) projects/mesh11s/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci.h (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_mbus.c (props changed) projects/mesh11s/sys/dev/usb/controller/ehci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg.c (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg.h (props changed) projects/mesh11s/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci.h (props changed) projects/mesh11s/sys/dev/usb/controller/ohci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/controller/ohci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uhci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uhci.h (props changed) projects/mesh11s/sys/dev/usb/controller/uhci_pci.c (props changed) projects/mesh11s/sys/dev/usb/controller/usb_controller.c (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci.c (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci.h (props changed) projects/mesh11s/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) projects/mesh11s/sys/dev/usb/input/uhid.c (props changed) projects/mesh11s/sys/dev/usb/input/ukbd.c (props changed) projects/mesh11s/sys/dev/usb/input/ums.c (props changed) projects/mesh11s/sys/dev/usb/input/usb_rdesc.h (props changed) projects/mesh11s/sys/dev/usb/misc/udbp.c (props changed) projects/mesh11s/sys/dev/usb/misc/udbp.h (props changed) projects/mesh11s/sys/dev/usb/misc/ufm.c (props changed) projects/mesh11s/sys/dev/usb/net/if_aue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_auereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_axe.c (props changed) projects/mesh11s/sys/dev/usb/net/if_axereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_cdce.c (props changed) projects/mesh11s/sys/dev/usb/net/if_cdcereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_cue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_cuereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_kue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_kuefw.h (props changed) projects/mesh11s/sys/dev/usb/net/if_kuereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_rue.c (props changed) projects/mesh11s/sys/dev/usb/net/if_ruereg.h (props changed) projects/mesh11s/sys/dev/usb/net/if_udav.c (props changed) projects/mesh11s/sys/dev/usb/net/if_udavreg.h (props changed) projects/mesh11s/sys/dev/usb/net/usb_ethernet.c (props changed) projects/mesh11s/sys/dev/usb/net/usb_ethernet.h (props changed) projects/mesh11s/sys/dev/usb/quirk/usb_quirk.c (props changed) projects/mesh11s/sys/dev/usb/quirk/usb_quirk.h (props changed) projects/mesh11s/sys/dev/usb/serial/u3g.c (props changed) projects/mesh11s/sys/dev/usb/serial/uark.c (props changed) projects/mesh11s/sys/dev/usb/serial/ubsa.c (props changed) projects/mesh11s/sys/dev/usb/serial/ubser.c (props changed) projects/mesh11s/sys/dev/usb/serial/uchcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/ucycom.c (props changed) projects/mesh11s/sys/dev/usb/serial/ufoma.c (props changed) projects/mesh11s/sys/dev/usb/serial/uftdi.c (props changed) projects/mesh11s/sys/dev/usb/serial/uftdi_reg.h (props changed) projects/mesh11s/sys/dev/usb/serial/ugensa.c (props changed) projects/mesh11s/sys/dev/usb/serial/uipaq.c (props changed) projects/mesh11s/sys/dev/usb/serial/ulpt.c (props changed) projects/mesh11s/sys/dev/usb/serial/umct.c (props changed) projects/mesh11s/sys/dev/usb/serial/umodem.c (props changed) projects/mesh11s/sys/dev/usb/serial/umoscom.c (props changed) projects/mesh11s/sys/dev/usb/serial/uplcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/usb_serial.c (props changed) projects/mesh11s/sys/dev/usb/serial/usb_serial.h (props changed) projects/mesh11s/sys/dev/usb/serial/uslcom.c (props changed) projects/mesh11s/sys/dev/usb/serial/uvisor.c (props changed) projects/mesh11s/sys/dev/usb/serial/uvscom.c (props changed) projects/mesh11s/sys/dev/usb/storage/rio500_usb.h (props changed) projects/mesh11s/sys/dev/usb/storage/umass.c (props changed) projects/mesh11s/sys/dev/usb/storage/urio.c (props changed) projects/mesh11s/sys/dev/usb/storage/ustorage_fs.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template.h (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_cdce.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_msc.c (props changed) projects/mesh11s/sys/dev/usb/template/usb_template_mtp.c (props changed) projects/mesh11s/sys/dev/usb/ufm_ioctl.h (props changed) projects/mesh11s/sys/dev/usb/usb.h (props changed) projects/mesh11s/sys/dev/usb/usb_bus.h (props changed) projects/mesh11s/sys/dev/usb/usb_busdma.c (props changed) projects/mesh11s/sys/dev/usb/usb_busdma.h (props changed) projects/mesh11s/sys/dev/usb/usb_cdc.h (props changed) projects/mesh11s/sys/dev/usb/usb_compat_linux.c (props changed) projects/mesh11s/sys/dev/usb/usb_compat_linux.h (props changed) projects/mesh11s/sys/dev/usb/usb_controller.h (props changed) projects/mesh11s/sys/dev/usb/usb_core.c (props changed) projects/mesh11s/sys/dev/usb/usb_core.h (props changed) projects/mesh11s/sys/dev/usb/usb_debug.c (props changed) projects/mesh11s/sys/dev/usb/usb_debug.h (props changed) projects/mesh11s/sys/dev/usb/usb_dev.c (props changed) projects/mesh11s/sys/dev/usb/usb_dev.h (props changed) projects/mesh11s/sys/dev/usb/usb_device.c (props changed) projects/mesh11s/sys/dev/usb/usb_device.h (props changed) projects/mesh11s/sys/dev/usb/usb_dynamic.c (props changed) projects/mesh11s/sys/dev/usb/usb_dynamic.h (props changed) projects/mesh11s/sys/dev/usb/usb_endian.h (props changed) projects/mesh11s/sys/dev/usb/usb_error.c (props changed) projects/mesh11s/sys/dev/usb/usb_generic.c (props changed) projects/mesh11s/sys/dev/usb/usb_generic.h (props changed) projects/mesh11s/sys/dev/usb/usb_handle_request.c (props changed) projects/mesh11s/sys/dev/usb/usb_hid.c (props changed) projects/mesh11s/sys/dev/usb/usb_hub.c (props changed) projects/mesh11s/sys/dev/usb/usb_hub.h (props changed) projects/mesh11s/sys/dev/usb/usb_if.m (props changed) projects/mesh11s/sys/dev/usb/usb_ioctl.h (props changed) projects/mesh11s/sys/dev/usb/usb_lookup.c (props changed) projects/mesh11s/sys/dev/usb/usb_mbuf.c (props changed) projects/mesh11s/sys/dev/usb/usb_mbuf.h (props changed) projects/mesh11s/sys/dev/usb/usb_msctest.c (props changed) projects/mesh11s/sys/dev/usb/usb_msctest.h (props changed) projects/mesh11s/sys/dev/usb/usb_parse.c (props changed) projects/mesh11s/sys/dev/usb/usb_pci.h (props changed) projects/mesh11s/sys/dev/usb/usb_process.c (props changed) projects/mesh11s/sys/dev/usb/usb_process.h (props changed) projects/mesh11s/sys/dev/usb/usb_request.c (props changed) projects/mesh11s/sys/dev/usb/usb_request.h (props changed) projects/mesh11s/sys/dev/usb/usb_transfer.c (props changed) projects/mesh11s/sys/dev/usb/usb_transfer.h (props changed) projects/mesh11s/sys/dev/usb/usb_util.c (props changed) projects/mesh11s/sys/dev/usb/usb_util.h (props changed) projects/mesh11s/sys/dev/usb/usbdevs (props changed) projects/mesh11s/sys/dev/usb/usbhid.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rum.c (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumfw.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumreg.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_rumvar.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_ural.c (props changed) projects/mesh11s/sys/dev/usb/wlan/if_uralreg.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_uralvar.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_zyd.c (props changed) projects/mesh11s/sys/dev/usb/wlan/if_zydfw.h (props changed) projects/mesh11s/sys/dev/usb/wlan/if_zydreg.h (props changed) projects/mesh11s/sys/dev/xen/netfront/ (props changed) projects/mesh11s/sys/dev/xen/xenpci/ (props changed) projects/mesh11s/sys/fs/fifofs/fifo_vnops.c projects/mesh11s/sys/geom/geom_dev.c projects/mesh11s/sys/geom/part/g_part.c projects/mesh11s/sys/geom/part/g_part_if.m projects/mesh11s/sys/i386/i386/io_apic.c projects/mesh11s/sys/i386/i386/msi.c projects/mesh11s/sys/i386/i386/pmap.c projects/mesh11s/sys/i386/include/param.h projects/mesh11s/sys/i386/xen/pmap.c projects/mesh11s/sys/ia64/include/param.h projects/mesh11s/sys/kern/subr_param.c projects/mesh11s/sys/kern/sys_pipe.c projects/mesh11s/sys/kern/tty.c projects/mesh11s/sys/kern/tty_pts.c projects/mesh11s/sys/kern/uipc_socket.c projects/mesh11s/sys/mips/include/param.h projects/mesh11s/sys/modules/Makefile projects/mesh11s/sys/modules/dtrace/dtnfsclient/ (props changed) projects/mesh11s/sys/modules/geom/geom_label/Makefile projects/mesh11s/sys/modules/ip6_mroute_mod/ (props changed) projects/mesh11s/sys/modules/ipmi/ipmi_linux/ (props changed) projects/mesh11s/sys/modules/wlan/Makefile projects/mesh11s/sys/net80211/ieee80211_freebsd.h projects/mesh11s/sys/net80211/ieee80211_node.c projects/mesh11s/sys/net80211/ieee80211_var.h projects/mesh11s/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (props changed) projects/mesh11s/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h (props changed) projects/mesh11s/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c (props changed) projects/mesh11s/sys/netinet/ipfw/ip_dummynet.c (props changed) projects/mesh11s/sys/netinet/ipfw/ip_fw2.c (props changed) projects/mesh11s/sys/netinet/ipfw/ip_fw_nat.c (props changed) projects/mesh11s/sys/netinet/ipfw/ip_fw_pfil.c (props changed) projects/mesh11s/sys/netipx/spx_reass.c (props changed) projects/mesh11s/sys/powerpc/include/param.h projects/mesh11s/sys/sparc64/include/param.h projects/mesh11s/sys/sun4v/include/param.h projects/mesh11s/sys/sys/disk.h projects/mesh11s/sys/sys/socketvar.h projects/mesh11s/sys/tools/sound/feeder_rate_mkfilter.awk projects/mesh11s/sys/vm/vm_extern.h projects/mesh11s/sys/vm/vm_fault.c projects/mesh11s/sys/vm/vm_map.c projects/mesh11s/sys/xen/evtchn.h (props changed) projects/mesh11s/sys/xen/hypervisor.h (props changed) projects/mesh11s/sys/xen/xen_intr.h (props changed) projects/mesh11s/tools/regression/lib/msun/test-conj.t (props changed) projects/mesh11s/tools/regression/usr.bin/jot/regress.sh projects/mesh11s/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) projects/mesh11s/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs.h (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5210.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5211.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5212.c (props changed) projects/mesh11s/tools/tools/ath/common/dumpregs_5416.c (props changed) projects/mesh11s/tools/tools/nanobsd/nanobsd.sh projects/mesh11s/tools/tools/termcap/termcap.pl (props changed) projects/mesh11s/usr.bin/cpio/cmdline.c projects/mesh11s/usr.bin/cpio/test/test_owner_parse.c projects/mesh11s/usr.bin/csup/ (props changed) projects/mesh11s/usr.bin/jot/jot.c projects/mesh11s/usr.bin/procstat/ (props changed) projects/mesh11s/usr.sbin/dumpcis/cardinfo.h (props changed) projects/mesh11s/usr.sbin/dumpcis/cis.h (props changed) projects/mesh11s/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/mesh11s/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/mesh11s/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/mesh11s/usr.sbin/makefs/getid.c (props changed) projects/mesh11s/usr.sbin/pkg_install/add/perform.c projects/mesh11s/usr.sbin/ppp/ppp.8.m4 projects/mesh11s/usr.sbin/sysinstall/dispatch.c projects/mesh11s/usr.sbin/sysinstall/install.c projects/mesh11s/usr.sbin/sysinstall/menus.c projects/mesh11s/usr.sbin/sysinstall/sysinstall.h projects/mesh11s/usr.sbin/tzsetup/tzsetup.8 projects/mesh11s/usr.sbin/tzsetup/tzsetup.c projects/mesh11s/usr.sbin/zic/ (props changed) Modified: projects/mesh11s/MAINTAINERS ============================================================================== --- projects/mesh11s/MAINTAINERS Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/MAINTAINERS Wed Jul 8 11:39:50 2009 (r195447) @@ -111,7 +111,7 @@ truss alfred Will be happy to review co rpc alfred Pre-commit review requested. xfs kan@FreeBSD.org,rodrigc@FreeBSD.org,cattelan@xfs.org Pre-commit review preferred. -pkg_install krion Pre-commit review or approval from portmgr@ requested. +pkg_install portmgr Pre-commit review or approval from portmgr@ requested. linux emul emulation Please discuss changes here. bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. @@ -123,7 +123,6 @@ lib/libsdp emax Pre-commit review prefe usr.bin/bluetooth emax Pre-commit review preferred. usr.sbin/bluetooth emax Pre-commit review preferred. gnu/usr.bin/send-pr bugmaster Pre-commit review requested. -BSD.{local,x11*}.dist portmgr Pre-commit review requested, since these files interface with ports. ncurses rafan Heads-up appreciated, try not to break it. Following are the entries from the Makefiles, and a few other sources. Modified: projects/mesh11s/lib/libc/sys/execve.2 ============================================================================== --- projects/mesh11s/lib/libc/sys/execve.2 Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/lib/libc/sys/execve.2 Wed Jul 8 11:39:50 2009 (r195447) @@ -220,13 +220,11 @@ Since execute permission is checked by .Fn fexecve , the file descriptor .Fa fd -need not have been -opened with the +need not have been opened with the .Dv O_EXEC flag. -However, if the file to be executed denies read and write -permission for the process preparing to do the exec, the only way to -provide the +However, if the file to be executed denies read permission for the process +preparing to do the exec, the only way to provide the .Fa fd to .Fn fexecve @@ -234,6 +232,7 @@ is to use the .Dv O_EXEC flag when opening .Fa fd . +Note that the file to be executed can not be open for writing. .Sh RETURN VALUES As the .Fn execve @@ -277,7 +276,7 @@ The new process file has the appropriate permission, but has an invalid magic number in its header. .It Bq Er ETXTBSY The new process file is a pure procedure (shared text) -file that is currently open for writing or reading by some process. +file that is currently open for writing by some process. .It Bq Er ENOMEM The new process requires more virtual memory than is allowed by the imposed maximum Modified: projects/mesh11s/lib/libthr/thread/thr_rtld.c ============================================================================== --- projects/mesh11s/lib/libthr/thread/thr_rtld.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/lib/libthr/thread/thr_rtld.c Wed Jul 8 11:39:50 2009 (r195447) @@ -114,6 +114,7 @@ _thr_rtld_rlock_acquire(void *lock) THR_CRITICAL_ENTER(curthread); while (_thr_rwlock_rdlock(&l->lock, 0, NULL) != 0) ; + curthread->rdlock_count++; RESTORE_ERRNO(); } @@ -148,6 +149,7 @@ _thr_rtld_lock_release(void *lock) state = l->lock.rw_state; if (_thr_rwlock_unlock(&l->lock) == 0) { + curthread->rdlock_count--; if ((state & URWLOCK_WRITE_OWNER) == 0) { THR_CRITICAL_LEAVE(curthread); } else { Modified: projects/mesh11s/lib/libthr/thread/thr_rwlock.c ============================================================================== --- projects/mesh11s/lib/libthr/thread/thr_rwlock.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/lib/libthr/thread/thr_rwlock.c Wed Jul 8 11:39:50 2009 (r195447) @@ -177,10 +177,11 @@ rwlock_rdlock_common(pthread_rwlock_t *r /* if interrupted, try to lock it in userland again. */ if (_thr_rwlock_tryrdlock(&prwlock->lock, flags) == 0) { ret = 0; - curthread->rdlock_count++; break; } } + if (ret == 0) + curthread->rdlock_count++; return (ret); } Modified: projects/mesh11s/share/man/man4/acpi_hp.4 ============================================================================== --- projects/mesh11s/share/man/man4/acpi_hp.4 Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/share/man/man4/acpi_hp.4 Wed Jul 8 11:39:50 2009 (r195447) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2009 +.Dd June 30, 2009 .Dt ACPI_HP 4 i386 .Os .Sh NAME @@ -92,8 +92,8 @@ WWAN on air status changed to 0 (not on WWAN on air status changed to 1 (on air) .El .Ss Xr devfs 8 Ss Device -You can read /dev/hpcmi to see your current BIOS settings. The detail level -can be adjusted by setting the sysctl +You can read /dev/hpcmi to see your current BIOS settings. +The detail level can be adjusted by setting the sysctl .Va cmi_detail as described below. .Sh SYSCTL VARIABLES @@ -166,13 +166,29 @@ Show a list of valid options for the BIO .It Li 0x04 Show additional flags of BIOS setting (ReadOnly etc.) .It Li 0x08 -Query highest BIOS entry instance. This is broken on many HP models and -therefore disabled by default. +Query highest BIOS entry instance. +This is broken on many HP models and therefore disabled by default. .El +.It Va dev.acpi_hp.0.verbose +(read-only) +Set verbosity level .El .Pp Defaults for these sysctls can be set in .Xr sysctl.conf 5 . +.Sh HARDWARE +The +.Nm +driver has been reported to support the following hardware: +.Pp +.Bl -bullet -compact +.It +HP Compaq 8510p +.It +HP Compaq nx7300 +.El +.Pp +It should work on most HP laptops that feature a WMI enabled BIOS. .Sh FILES .Bl -tag -width ".Pa /dev/hpcmi" .It Pa /dev/hpcmi @@ -248,7 +264,7 @@ The driver was written by .An Michael Gmelin Aq freebsd@grem.de .Pp -It has been inspired by hp-wmi driver, which implements a subset of these +It has been inspired by hp-wmi driver, which implements a subset of these features (hotkeys) on Linux. .Pp .Bl -tag -width indent Modified: projects/mesh11s/share/man/man4/acpi_wmi.4 ============================================================================== --- projects/mesh11s/share/man/man4/acpi_wmi.4 Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/share/man/man4/acpi_wmi.4 Wed Jul 8 11:39:50 2009 (r195447) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 21, 2009 +.Dd June 30, 2009 .Dt ACPI_WMI 4 i386 .Os .Sh NAME @@ -48,7 +48,8 @@ acpi_wmi_load="YES" The .Nm driver provides an interface for vendor specific WMI implementations -(e.g. HP and Acer laptops). It creates /dev/wmistat, which can be read to get +(e.g. HP and Acer laptops). +It creates /dev/wmistat, which can be read to get information about GUIDs found in the system. .Sh FILES .Bl -tag -width /dev/wmistat -compact Modified: projects/mesh11s/share/man/man4/pcm.4 ============================================================================== --- projects/mesh11s/share/man/man4/pcm.4 Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/share/man/man4/pcm.4 Wed Jul 8 11:39:50 2009 (r195447) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2009 +.Dd July 7, 2009 .Dt SOUND 4 .Os .Sh NAME @@ -141,6 +141,15 @@ To define default values for the differe set the channel to the preferred value using hints, e.g.: .Va hint.pcm.0.line Ns = Ns Qq Li 0 . This will mute the input channel per default. +.Ss EQ +The Parametric Software Equlizer (EQ) enables the use of +.Dq tone +controls (bass and treble). +Commonly used for ear-candy or frequency compensation due to the vast +difference in hardware quality. +EQ is disabled by default, but can be enabled with the +.Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq +tunable. .Ss VCHANs Each device can optionally support more playback and recording channels than physical hardware provides by using @@ -151,15 +160,55 @@ or options can be configured via the .Xr sysctl 8 interface but can only be manipulated while the device is inactive. +.Ss VPC +FreeBSD supports independent and individual volume controls for each active +application, without touching the master +.Nm +volume. +This is sometimes referred to as Volume Per Channel (VPC). +The +.Tn VPC +feature is enabled by default. +.Ss Loader Tunables +The following loader tunables are used to set driver configuration at the +.Xr loader 8 +prompt before booting the kernel, or they can be stored in +.Pa /boot/loader.conf +in order to automatically set them before booting the kernel. +It is also possible to use +.Xr kenv 1 +to change these tunables before loading the +.Nm +driver. +The following tunables can not be changed during runtime using +.Xr sysctl 8 . +.Bl -tag -width indent +.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq +Set to 1 or 0 to explicitly enable (1) or disable (0) the equalizer. +Requires a driver reload if changed. +Enabling this will make bass and treble controls appear in mixer applications. +This tunable is undefined by default. +Equalizing is disabled by default. +.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .vpc +Set to 1 or 0 to explicitly enable (1) or disable (0) the +.Tn VPC +feature. +This tunable is undefined by default. +.Tn VPC +is however enabled by default. +.El .Ss Runtime Configuration There are a number of .Xr sysctl 8 -variables available. +variables available which can be modified during runtime. +These values can also be stored in +.Pa /etc/sysctl.conf +in order to automatically set them during the boot process. .Va hw.snd.* -tunables are global settings and +are global settings and .Va dev.pcm.* are device specific. -.Bl -tag -width ".Va hw.snd.report_soft_formats" -offset indent +.Bl -tag -width indent .It Va hw.snd.compat_linux_mmap Enable to allow PROT_EXEC page mappings. All Linux applications using sound and @@ -188,19 +237,13 @@ rates. Maximum allowable sample rate. .It Va hw.snd.feeder_rate_min Minimum allowable sample rate. -.It Va hw.snd.feeder_rate_round -Sample rate rounding threshold, to avoid large prime division at the -cost of accuracy. -All requested sample rates will be rounded to the nearest threshold value. -Possible values range between 0 (disabled) and 500. -Default is 25. -.It Va hw.snd.feeder_polyphase_max +.It Va hw.snd.feeder_rate_polyphase_max Adjust to set the maximum number of allowed polyphase entries during the process of building resampling filters. Only applicable when the SINC interpolator is used. Default value is 183040. Set to 0 to disable polyphase resampling. -.It Va hw.snd.feeder_quality +.It Va hw.snd.feeder_rate_quality Sample rate converter quality. Default value is 1, linear interpolation. Available options include: @@ -228,6 +271,12 @@ taps and 90% bandwidth as quality values Continuation of the bandlimited SINC inteprolator, with 100dB stopband, 164 taps and 97% bandwidth as quality values. .El +.It Va hw.snd.feeder_rate_round +Sample rate rounding threshold, to avoid large prime division at the +cost of accuracy. +All requested sample rates will be rounded to the nearest threshold value. +Possible values range between 0 (disabled) and 500. +Default is 25. .It Va hw.snd.latency Configure the buffering latency. Only affects applications that do not explicitly request @@ -299,7 +348,9 @@ This means that any changes to the volum Enabling this will preserve the volume, at the cost of possible confusion when applications tries to re-open the same device. .It Va hw.snd.vpc_mixer_bypass -The recommended way to use the vpc feature is to teach applications to use +The recommended way to use the +.Tn VPC +feature is to teach applications to use the correct .Fn ioctl : .Dv SNDCTL_DSP_GETPLAYVOL, SNDCTL_DSP_SETPLAYVOL, Modified: projects/mesh11s/sys/amd64/amd64/io_apic.c ============================================================================== --- projects/mesh11s/sys/amd64/amd64/io_apic.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/amd64/amd64/io_apic.c Wed Jul 8 11:39:50 2009 (r195447) @@ -327,7 +327,7 @@ ioapic_assign_cpu(struct intsrc *isrc, u { struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc; struct ioapic *io = (struct ioapic *)isrc->is_pic; - u_int old_vector; + u_int old_vector, new_vector; u_int old_id; /* @@ -348,11 +348,14 @@ ioapic_assign_cpu(struct intsrc *isrc, u * Allocate an APIC vector for this interrupt pin. Once * we have a vector we program the interrupt pin. */ - intpin->io_cpu = apic_id; - intpin->io_vector = apic_alloc_vector(apic_id, intpin->io_irq); - if (intpin->io_vector == 0) + new_vector = apic_alloc_vector(apic_id, intpin->io_irq); + if (new_vector == 0) return (ENOSPC); + intpin->io_cpu = apic_id; + intpin->io_vector = new_vector; + if (isrc->is_handlers > 0) + apic_enable_vector(intpin->io_cpu, intpin->io_vector); if (bootverbose) { printf("ioapic%u: routing intpin %u (", io->io_id, intpin->io_intpin); @@ -365,8 +368,11 @@ ioapic_assign_cpu(struct intsrc *isrc, u * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. */ - if (old_vector) + if (old_vector) { + if (isrc->is_handlers > 0) + apic_disable_vector(old_id, old_vector); apic_free_vector(old_id, old_vector, intpin->io_irq); + } return (0); } Modified: projects/mesh11s/sys/amd64/amd64/machdep.c ============================================================================== --- projects/mesh11s/sys/amd64/amd64/machdep.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/amd64/amd64/machdep.c Wed Jul 8 11:39:50 2009 (r195447) @@ -100,8 +100,9 @@ __FBSDID("$FreeBSD$"); #ifndef KDB #error KDB must be enabled in order for DDB to work! #endif -#endif #include +#include +#endif #include @@ -1083,6 +1084,30 @@ extern inthand_t IDTVEC(xmm), IDTVEC(dblfault), IDTVEC(fast_syscall), IDTVEC(fast_syscall32); +#ifdef DDB +/* + * Display the index and function name of any IDT entries that don't use + * the default 'rsvd' entry point. + */ +DB_SHOW_COMMAND(idt, db_show_idt) +{ + struct gate_descriptor *ip; + int idx; + uintptr_t func; + + ip = idt; + for (idx = 0; idx < NIDT && !db_pager_quit; idx++) { + func = ((long)ip->gd_hioffset << 16 | ip->gd_looffset); + if (func != (uintptr_t)&IDTVEC(rsvd)) { + db_printf("%3d\t", idx); + db_printsym(func, DB_STGY_PROC); + db_printf("\n"); + } + ip++; + } +} +#endif + void sdtossd(sd, ssd) struct user_segment_descriptor *sd; Modified: projects/mesh11s/sys/amd64/amd64/msi.c ============================================================================== --- projects/mesh11s/sys/amd64/amd64/msi.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/amd64/amd64/msi.c Wed Jul 8 11:39:50 2009 (r195447) @@ -230,6 +230,8 @@ msi_assign_cpu(struct intsrc *isrc, u_in msi->msi_cpu = apic_id; msi->msi_vector = vector; + if (msi->msi_intsrc.is_handlers > 0) + apic_enable_vector(msi->msi_cpu, msi->msi_vector); if (bootverbose) printf("msi: Assigning %s IRQ %d to local APIC %u vector %u\n", msi->msi_msix ? "MSI-X" : "MSI", msi->msi_irq, @@ -238,6 +240,8 @@ msi_assign_cpu(struct intsrc *isrc, u_in sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]); sib->msi_cpu = apic_id; sib->msi_vector = vector + i; + if (sib->msi_intsrc.is_handlers > 0) + apic_enable_vector(sib->msi_cpu, sib->msi_vector); if (bootverbose) printf( "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n", @@ -249,9 +253,15 @@ msi_assign_cpu(struct intsrc *isrc, u_in * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. */ + if (msi->msi_intsrc.is_handlers > 0) + apic_disable_vector(old_id, old_vector); apic_free_vector(old_id, old_vector, msi->msi_irq); - for (i = 1; i < msi->msi_count; i++) + for (i = 1; i < msi->msi_count; i++) { + sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]); + if (sib->msi_intsrc.is_handlers > 0) + apic_disable_vector(old_id, old_vector + i); apic_free_vector(old_id, old_vector + i, msi->msi_irqs[i]); + } return (0); } Modified: projects/mesh11s/sys/amd64/amd64/pmap.c ============================================================================== --- projects/mesh11s/sys/amd64/amd64/pmap.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/amd64/amd64/pmap.c Wed Jul 8 11:39:50 2009 (r195447) @@ -2218,11 +2218,19 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t /* * Invalidate the 2MB page mapping and return "failure" if the * mapping was never accessed or the allocation of the new - * page table page fails. + * page table page fails. If the 2MB page mapping belongs to + * the direct map region of the kernel's address space, then + * the page allocation request specifies the highest possible + * priority (VM_ALLOC_INTERRUPT). Otherwise, the priority is + * normal. Page table pages are preallocated for every other + * part of the kernel address space, so the direct map region + * is the only part of the kernel address space that must be + * handled here. */ if ((oldpde & PG_A) == 0 || (mpte = vm_page_alloc(NULL, - pmap_pde_pindex(va), VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | - VM_ALLOC_WIRED)) == NULL) { + pmap_pde_pindex(va), (va >= DMAP_MIN_ADDRESS && va < + DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { free = NULL; pmap_remove_pde(pmap, pde, trunc_2mpage(va), &free); pmap_invalidate_page(pmap, trunc_2mpage(va)); Modified: projects/mesh11s/sys/amd64/include/param.h ============================================================================== --- projects/mesh11s/sys/amd64/include/param.h Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/amd64/include/param.h Wed Jul 8 11:39:50 2009 (r195447) @@ -47,12 +47,6 @@ * Round p (pointer or byte index) up to a correctly-aligned value * for all data types (int, long, ...). The result is u_long and * must be cast to any desired pointer type. - * - * ALIGNED_POINTER is a boolean macro that checks whether an address - * is valid to fetch data elements of type t from on this architecture. - * This does not reflect the optimal alignment, just the possibility - * (within reasonable limits). - * */ #ifndef _ALIGNBYTES #define _ALIGNBYTES (sizeof(long) - 1) @@ -60,9 +54,6 @@ #ifndef _ALIGN #define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) #endif -#ifndef _ALIGNED_POINTER -#define _ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) -#endif #ifndef _NO_NAMESPACE_POLLUTION @@ -87,7 +78,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) -#define ALIGNED_POINTER(p,t) _ALIGNED_POINTER(p,t) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) 1 /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: projects/mesh11s/sys/arm/include/param.h ============================================================================== --- projects/mesh11s/sys/arm/include/param.h Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/arm/include/param.h Wed Jul 8 11:39:50 2009 (r195447) @@ -80,6 +80,13 @@ #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) +/* + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + */ +#define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof(t)-1)) == 0) /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an Modified: projects/mesh11s/sys/conf/files ============================================================================== --- projects/mesh11s/sys/conf/files Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/conf/files Wed Jul 8 11:39:50 2009 (r195447) @@ -498,7 +498,8 @@ dev/ata/ata-cbus.c optional ata pc98 | dev/ata/ata-isa.c optional ata isa | ataisa dev/ata/ata-pci.c optional ata pci | atapci dev/ata/chipsets/ata-ahci.c optional ata pci | ataahci | ataacerlabs | \ - ataati | ataintel | atajmicron | atavia + ataati | ataintel | atajmicron | \ + atavia | atanvidia dev/ata/chipsets/ata-acard.c optional ata pci | ataacard dev/ata/chipsets/ata-acerlabs.c optional ata pci | ataacerlabs dev/ata/chipsets/ata-adaptec.c optional ata pci | ataadaptec @@ -2231,6 +2232,7 @@ net/zlib.c optional crypto | geom_uzip net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl net80211/ieee80211_action.c optional wlan +net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_adhoc.c optional wlan net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_amrr.c optional wlan wlan_amrr Modified: projects/mesh11s/sys/conf/newvers.sh ============================================================================== --- projects/mesh11s/sys/conf/newvers.sh Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/conf/newvers.sh Wed Jul 8 11:39:50 2009 (r195447) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.0" -BRANCH="CURRENT" +BRANCH="BETA1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: projects/mesh11s/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- projects/mesh11s/sys/dev/acpi_support/acpi_hp.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/dev/acpi_support/acpi_hp.c Wed Jul 8 11:39:50 2009 (r195447) @@ -92,6 +92,7 @@ ACPI_MODULE_NAME("HP") #define ACPI_HP_METHOD_HDDTEMP 18 #define ACPI_HP_METHOD_DOCK 19 #define ACPI_HP_METHOD_CMI_DETAIL 20 +#define ACPI_HP_METHOD_VERBOSE 21 #define HP_MASK_WWAN_ON_AIR 0x1000000 #define HP_MASK_BLUETOOTH_ON_AIR 0x10000 @@ -121,6 +122,7 @@ struct acpi_hp_softc { int has_cmi; /* CMI GUID found */ int cmi_detail; /* CMI detail level (set by sysctl) */ + int verbose; /* add debug output */ int wlan_enable_if_radio_on; /* set by sysctl */ int wlan_disable_if_radio_off; /* set by sysctl */ int bluetooth_enable_if_radio_on; /* set by sysctl */ @@ -275,6 +277,12 @@ static struct { "(cat /dev/hpcmi)", .access = CTLTYPE_INT | CTLFLAG_RW }, + { + .name = "verbose", + .method = ACPI_HP_METHOD_VERBOSE, + .description = "Verbosity level", + .access = CTLTYPE_INT | CTLFLAG_RW + }, { NULL, 0, NULL, 0 } }; @@ -334,10 +342,10 @@ MODULE_DEPEND(acpi_hp, acpi, 1, 1, 1); static void acpi_hp_evaluate_auto_on_off(struct acpi_hp_softc *sc) { - int wireless; - int new_wlan_status; - int new_bluetooth_status; - int new_wwan_status; + int wireless; + int new_wlan_status; + int new_bluetooth_status; + int new_wwan_status; wireless = acpi_hp_exec_wmi_command(sc->wmi_dev, ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0); @@ -345,7 +353,8 @@ acpi_hp_evaluate_auto_on_off(struct acpi new_bluetooth_status = -1; new_wwan_status = -1; - device_printf(sc->wmi_dev, "Wireless status is %x\n", wireless); + if (sc->verbose) + device_printf(sc->wmi_dev, "Wireless status is %x\n", wireless); if (sc->wlan_disable_if_radio_off && !(wireless & HP_MASK_WLAN_RADIO) && (wireless & HP_MASK_WLAN_ENABLED)) { acpi_hp_exec_wmi_command(sc->wmi_dev, @@ -391,10 +400,11 @@ acpi_hp_evaluate_auto_on_off(struct acpi new_wlan_status = (wireless & HP_MASK_WLAN_ON_AIR); if ((new_wlan_status?1:0) != sc->was_wlan_on_air) { sc->was_wlan_on_air = sc->was_wlan_on_air?0:1; - device_printf(sc->wmi_dev, - "WLAN on air changed to %i " - "(new_wlan_status is %i)\n", - sc->was_wlan_on_air, new_wlan_status); + if (sc->verbose) + device_printf(sc->wmi_dev, + "WLAN on air changed to %i " + "(new_wlan_status is %i)\n", + sc->was_wlan_on_air, new_wlan_status); acpi_UserNotify("HP", sc->handle, 0xc0+sc->was_wlan_on_air); } @@ -404,9 +414,12 @@ acpi_hp_evaluate_auto_on_off(struct acpi if ((new_bluetooth_status?1:0) != sc->was_bluetooth_on_air) { sc->was_bluetooth_on_air = sc->was_bluetooth_on_air? 0:1; - device_printf(sc->wmi_dev, "BLUETOOTH on air changed" - " to %i (new_bluetooth_status is %i)\n", - sc->was_bluetooth_on_air, new_bluetooth_status); + if (sc->verbose) + device_printf(sc->wmi_dev, + "BLUETOOTH on air changed" + " to %i (new_bluetooth_status is %i)\n", + sc->was_bluetooth_on_air, + new_bluetooth_status); acpi_UserNotify("HP", sc->handle, 0xd0+sc->was_bluetooth_on_air); } @@ -415,9 +428,11 @@ acpi_hp_evaluate_auto_on_off(struct acpi new_wwan_status = (wireless & HP_MASK_WWAN_ON_AIR); if ((new_wwan_status?1:0) != sc->was_wwan_on_air) { sc->was_wwan_on_air = sc->was_wwan_on_air?0:1; - device_printf(sc->wmi_dev, "WWAN on air changed to %i" - " (new_wwan_status is %i)\n", - sc->was_wwan_on_air, new_wwan_status); + if (sc->verbose) + device_printf(sc->wmi_dev, + "WWAN on air changed to %i" + " (new_wwan_status is %i)\n", + sc->was_wwan_on_air, new_wwan_status); acpi_UserNotify("HP", sc->handle, 0xe0+sc->was_wwan_on_air); } @@ -440,7 +455,7 @@ acpi_hp_attach(device_t dev) struct acpi_hp_softc *sc; struct acpi_softc *acpi_sc; devclass_t wmi_devclass; - int arg; + int arg; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); @@ -460,6 +475,7 @@ acpi_hp_attach(device_t dev) sc->was_wwan_on_air = 0; sc->cmi_detail = 0; sc->cmi_order_size = -1; + sc->verbose = 0; memset(sc->cmi_order, 0, sizeof(sc->cmi_order)); acpi_sc = acpi_device_get_parent_softc(dev); @@ -553,7 +569,7 @@ acpi_hp_attach(device_t dev) static int acpi_hp_detach(device_t dev) { - int ret; + int ret; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); struct acpi_hp_softc *sc = device_get_softc(dev); @@ -580,12 +596,12 @@ acpi_hp_detach(device_t dev) static int acpi_hp_sysctl(SYSCTL_HANDLER_ARGS) { - struct acpi_hp_softc *sc; - int arg; - int oldarg; - int error = 0; - int function; - int method; + struct acpi_hp_softc *sc; + int arg; + int oldarg; + int error = 0; + int function; + int method; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -608,7 +624,7 @@ acpi_hp_sysctl(SYSCTL_HANDLER_ARGS) static int acpi_hp_sysctl_get(struct acpi_hp_softc *sc, int method) { - int val = 0; + int val = 0; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); ACPI_SERIAL_ASSERT(hp); @@ -696,6 +712,9 @@ acpi_hp_sysctl_get(struct acpi_hp_softc case ACPI_HP_METHOD_CMI_DETAIL: val = sc->cmi_detail; break; + case ACPI_HP_METHOD_VERBOSE: + val = sc->verbose; + break; } return (val); @@ -707,7 +726,8 @@ acpi_hp_sysctl_set(struct acpi_hp_softc ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); ACPI_SERIAL_ASSERT(hp); - if (method != ACPI_HP_METHOD_CMI_DETAIL) + if (method != ACPI_HP_METHOD_CMI_DETAIL && + method != ACPI_HP_METHOD_VERBOSE) arg = arg?1:0; if (arg != oldarg) { @@ -759,6 +779,9 @@ acpi_hp_sysctl_set(struct acpi_hp_softc sc->cmi_order_size = -1; } break; + case ACPI_HP_METHOD_VERBOSE: + sc->verbose = arg; + break; } } @@ -794,15 +817,15 @@ acpi_hp_notify(ACPI_HANDLE h, UINT32 not static int acpi_hp_exec_wmi_command(device_t wmi_dev, int command, int is_write, int val) { - UINT32 params[5] = { 0x55434553, - is_write?2:1, - command, - is_write?4:0, - val}; - UINT32* result; - ACPI_OBJECT *obj; - ACPI_BUFFER in = { sizeof(params), ¶ms }; - ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL }; + UINT32 params[5] = { 0x55434553, + is_write?2:1, + command, + is_write?4:0, + val}; + UINT32* result; + ACPI_OBJECT *obj; + ACPI_BUFFER in = { sizeof(params), ¶ms }; + ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL }; int retval; if (ACPI_FAILURE(ACPI_WMI_EVALUATE_CALL(wmi_dev, ACPI_HP_WMI_BIOS_GUID, @@ -827,7 +850,8 @@ acpi_hp_exec_wmi_command(device_t wmi_de static __inline char* acpi_hp_get_string_from_object(ACPI_OBJECT* obj, char* dst, size_t size) { - int length; + int length; + dst[0] = 0; if (obj->Type == ACPI_TYPE_STRING) { length = obj->String.Length+1; @@ -847,33 +871,32 @@ acpi_hp_get_string_from_object(ACPI_OBJE * The block returned is ACPI_TYPE_PACKAGE which should contain the following * elements: * Index Meaning - * 0 Setting Name [string] - * 1 Value (comma separated, asterisk marks the current value) [string] - * 2 Path within the bios hierarchy [string] - * 3 IsReadOnly [int] - * 4 DisplayInUI [int] - * 5 RequiresPhysicalPresence [int] - * 6 Sequence for ordering within the bios settings (absolute) [int] - * 7 Length of prerequisites array [int] - * 8 Prerequisite1 [string] - * 9 Prerequisite2 [string] - * 10 Prerequisite3 [string] - * 11 Current value (in case of enum) [string] / Array length [int] - * 12 Enum length [int] / Array values - * 13ff Enum value at index x [string] + * 0 Setting Name [string] + * 1 Value (comma separated, asterisk marks the current value) [string] + * 2 Path within the bios hierarchy [string] + * 3 IsReadOnly [int] + * 4 DisplayInUI [int] + * 5 RequiresPhysicalPresence [int] + * 6 Sequence for ordering within the bios settings (absolute) [int] + * 7 Length of prerequisites array [int] + * 8..8+[7] PrerequisiteN [string] + * 9+[7] Current value (in case of enum) [string] / Array length [int] + * 10+[7] Enum length [int] / Array values + * 11+[7]ff Enum value at index x [string] */ static int acpi_hp_get_cmi_block(device_t wmi_dev, const char* guid, UINT8 instance, char* outbuf, size_t outsize, UINT32* sequence, int detail) { - ACPI_OBJECT *obj; - ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL }; - int i; - int outlen; - int size = 255; - int has_enums = 0; - char string_buffer[size]; - int enumbase; + ACPI_OBJECT *obj; + ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL }; + int i; + int outlen; + int size = 255; + int has_enums = 0; + int valuebase = 0; + char string_buffer[size]; + int enumbase; outlen = 0; outbuf[0] = 0; @@ -887,8 +910,13 @@ acpi_hp_get_cmi_block(device_t wmi_dev, return (-EINVAL); } + if (obj->Package.Count >= 8 && + obj->Package.Elements[7].Type == ACPI_TYPE_INTEGER) { + valuebase = 8 + obj->Package.Elements[7].Integer.Value; + } + /* check if this matches our expectations based on limited knowledge */ - if (obj->Package.Count >= 13 && + if (valuebase > 7 && obj->Package.Count > valuebase + 1 && obj->Package.Elements[0].Type == ACPI_TYPE_STRING && obj->Package.Elements[1].Type == ACPI_TYPE_STRING && obj->Package.Elements[2].Type == ACPI_TYPE_STRING && @@ -896,20 +924,12 @@ acpi_hp_get_cmi_block(device_t wmi_dev, obj->Package.Elements[4].Type == ACPI_TYPE_INTEGER && obj->Package.Elements[5].Type == ACPI_TYPE_INTEGER && obj->Package.Elements[6].Type == ACPI_TYPE_INTEGER && - obj->Package.Elements[7].Type == ACPI_TYPE_INTEGER && - obj->Package.Elements[8].Type == ACPI_TYPE_STRING && - obj->Package.Elements[9].Type == ACPI_TYPE_STRING && - obj->Package.Elements[10].Type == ACPI_TYPE_STRING && - ((obj->Package.Elements[11].Type == ACPI_TYPE_STRING && - obj->Package.Elements[12].Type == ACPI_TYPE_INTEGER && - obj->Package.Count >= - 13+obj->Package.Elements[12].Integer.Value) || - (obj->Package.Elements[11].Type == ACPI_TYPE_INTEGER && - obj->Package.Count >= - 12+obj->Package.Elements[11].Integer.Value)) - ) { - enumbase = obj->Package.Elements[11].Type == ACPI_TYPE_STRING? - 12:11; + obj->Package.Elements[valuebase].Type == ACPI_TYPE_STRING && + obj->Package.Elements[valuebase+1].Type == ACPI_TYPE_INTEGER && + obj->Package.Count > valuebase + + obj->Package.Elements[valuebase+1].Integer.Value + ) { + enumbase = valuebase + 1; if (detail & ACPI_HP_CMI_DETAIL_PATHS) { strlcat(outbuf, acpi_hp_get_string_from_object( &obj->Package.Elements[2], string_buffer, size), @@ -924,11 +944,10 @@ acpi_hp_get_cmi_block(device_t wmi_dev, outlen += 43; while (strlen(outbuf) < outlen) strlcat(outbuf, " ", outsize); - if (enumbase == 12) - strlcat(outbuf, acpi_hp_get_string_from_object( - &obj->Package.Elements[11], - string_buffer, size), - outsize); + strlcat(outbuf, acpi_hp_get_string_from_object( + &obj->Package.Elements[valuebase], string_buffer, + size), + outsize); outlen += 21; while (strlen(outbuf) < outlen) strlcat(outbuf, " ", outsize); @@ -936,7 +955,7 @@ acpi_hp_get_cmi_block(device_t wmi_dev, if (outbuf[i] == '\\') outbuf[i] = '/'; if (detail & ACPI_HP_CMI_DETAIL_ENUMS) { - for (i = enumbase+1; i < enumbase + 1 + + for (i = enumbase + 1; i < enumbase + 1 + obj->Package.Elements[enumbase].Integer.Value; ++i) { acpi_hp_get_string_from_object( @@ -980,8 +999,8 @@ acpi_hp_get_cmi_block(device_t wmi_dev, */ static __inline int acpi_hp_hex_to_int(const UINT8 *hexin, UINT8 *byteout) { - unsigned int hi; - unsigned int lo; + unsigned int hi; + unsigned int lo; hi = hexin[0]; lo = hexin[1]; @@ -1010,10 +1029,10 @@ static __inline int acpi_hp_hex_to_int(c static void acpi_hp_hex_decode(char* buffer) { - int i; - int length = strlen(buffer); - UINT8 *uin; - UINT8 uout; + int i; + int length = strlen(buffer); + UINT8 *uin; + UINT8 uout; if (((int)length/2)*2 == length || length < 10) return; @@ -1044,8 +1063,8 @@ acpi_hp_hex_decode(char* buffer) static int acpi_hp_hpcmi_open(struct cdev* dev, int flags, int mode, struct thread *td) { - struct acpi_hp_softc *sc; - int ret; + struct acpi_hp_softc *sc; + int ret; if (dev == NULL || dev->si_drv1 == NULL) return (EBADF); @@ -1076,8 +1095,8 @@ acpi_hp_hpcmi_open(struct cdev* dev, int static int acpi_hp_hpcmi_close(struct cdev* dev, int flags, int mode, struct thread *td) { - struct acpi_hp_softc *sc; - int ret; + struct acpi_hp_softc *sc; + int ret; if (dev == NULL || dev->si_drv1 == NULL) return (EBADF); @@ -1106,13 +1125,13 @@ acpi_hp_hpcmi_close(struct cdev* dev, in static int acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, int flag) { - struct acpi_hp_softc *sc; - int pos, i, l, ret; - UINT8 instance; - UINT8 maxInstance; - UINT32 sequence; - int linesize = 1025; - char line[linesize]; + struct acpi_hp_softc *sc; + int pos, i, l, ret; + UINT8 instance; + UINT8 maxInstance; + UINT32 sequence; + int linesize = 1025; + char line[linesize]; if (dev == NULL || dev->si_drv1 == NULL) return (EBADF); Modified: projects/mesh11s/sys/dev/ata/atapi-cd.c ============================================================================== --- projects/mesh11s/sys/dev/ata/atapi-cd.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/dev/ata/atapi-cd.c Wed Jul 8 11:39:50 2009 (r195447) @@ -219,10 +219,7 @@ acd_geom_ioctl(struct g_provider *pp, u_ case CDIOCRESET: acd_test_ready(dev); break; - - case DIOCGPROVIDERALIAS: - break; - + default: acd_read_toc(dev); acd_prevent_allow(dev, 1); Modified: projects/mesh11s/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- projects/mesh11s/sys/dev/ata/chipsets/ata-ahci.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/dev/ata/chipsets/ata-ahci.c Wed Jul 8 11:39:50 2009 (r195447) @@ -914,7 +914,7 @@ ata_ahci_dmainit(device_t dev) ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_ahci_dmasetprd; - ch->dma.max_iosize = 8192 * DEV_BSIZE; + ch->dma.max_iosize = (ATA_AHCI_DMA_ENTRIES - 1) * PAGE_SIZE; if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_64BIT) ch->dma.max_address = BUS_SPACE_MAXADDR; } Modified: projects/mesh11s/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- projects/mesh11s/sys/dev/ata/chipsets/ata-nvidia.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/dev/ata/chipsets/ata-nvidia.c Wed Jul 8 11:39:50 2009 (r195447) @@ -287,3 +287,4 @@ ata_nvidia_setmode(device_t dev, int mod } ATA_DECLARE_DRIVER(ata_nvidia); +MODULE_DEPEND(ata_nvidia, ata_ahci, 1, 1, 1); Modified: projects/mesh11s/sys/dev/ath/ah_osdep.c ============================================================================== --- projects/mesh11s/sys/dev/ath/ah_osdep.c Wed Jul 8 11:22:04 2009 (r195446) +++ projects/mesh11s/sys/dev/ath/ah_osdep.c Wed Jul 8 11:39:50 2009 (r195447) @@ -254,7 +254,7 @@ ath_hal_reg_write(struct ath_hal *ah, u_ } } #if _BYTE_ORDER == _BIG_ENDIAN - if (reg >= 0x4000 && reg < 0x5000) + if (OS_REG_UNSWAPPED(reg)) bus_space_write_4(tag, h, reg, val); else #endif @@ -269,7 +269,7 @@ ath_hal_reg_read(struct ath_hal *ah, u_i u_int32_t val; #if _BYTE_ORDER == _BIG_ENDIAN - if (reg >= 0x4000 && reg < 0x5000) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 13:10:42 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74E2F1065674; Wed, 8 Jul 2009 13:10:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 630FA8FC13; Wed, 8 Jul 2009 13:10:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68DAgYm051838; Wed, 8 Jul 2009 13:10:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68DAgLf051836; Wed, 8 Jul 2009 13:10:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081310.n68DAgLf051836@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 13:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195448 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 13:10:42 -0000 Author: rpaulo Date: Wed Jul 8 13:10:42 2009 New Revision: 195448 URL: http://svn.freebsd.org/changeset/base/195448 Log: Fix typo. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 11:39:50 2009 (r195447) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 13:10:42 2009 (r195448) @@ -371,7 +371,7 @@ struct ieee80211_meshcntl_ae11 { uint8_t mc_addr6[IEEE80211_ADDR_LEN]; } __packed; -struct ieee80211req_mesh_routes { +struct ieee80211req_mesh_route { uint8_t imr_dest[IEEE80211_ADDR_LEN]; uint8_t imr_nexthop[IEEE80211_ADDR_LEN]; uint32_t imr_metric; From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 13:38:42 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E39410656B8; Wed, 8 Jul 2009 13:38:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60C808FC15; Wed, 8 Jul 2009 13:38:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68DcTpB052518; Wed, 8 Jul 2009 13:38:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68DcTiV052517; Wed, 8 Jul 2009 13:38:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081338.n68DcTiV052517@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 13:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195449 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 13:38:47 -0000 Author: rpaulo Date: Wed Jul 8 13:38:28 2009 New Revision: 195449 URL: http://svn.freebsd.org/changeset/base/195449 Log: Style changes. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 13:10:42 2009 (r195448) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 13:38:28 2009 (r195449) @@ -441,21 +441,18 @@ typedef uint32_t ieee80211_mesh_seq; #define IEEE80211_MESH_SEQ_GEQ(a, b) ((int32_t)((a)-(b)) >= 0) struct ieee80211_mesh_state { - int ms_idlen; - uint8_t ms_id[IEEE80211_MESHID_LEN]; - ieee80211_mesh_seq ms_seq; /* seq no for meshcntl */ - uint8_t ms_ttl; /* mesh ttl set in packets */ + int ms_idlen; + uint8_t ms_id[IEEE80211_MESHID_LEN]; + ieee80211_mesh_seq ms_seq; /* seq no for meshcntl */ + uint8_t ms_ttl; /* mesh ttl set in packets */ #define IEEE80211_MESHFLAGS_AP 0x01 /* accept peers */ #define IEEE80211_MESHFLAGS_PORTAL 0x02 /* mesh portal role */ #define IEEE80211_MESHFLAGS_FWD 0x04 /* forward packets */ - uint8_t ms_flags; - struct mtx ms_rt_lock; - TAILQ_HEAD(, ieee80211_mesh_route) - ms_routes; - struct ieee80211_mesh_proto_metric - *ms_pmetric; - struct ieee80211_mesh_proto_path - *ms_ppath; + uint8_t ms_flags; + struct mtx ms_rt_lock; + TAILQ_HEAD(, ieee80211_mesh_route) ms_routes; + struct ieee80211_mesh_proto_metric *ms_pmetric; + struct ieee80211_mesh_proto_path *ms_ppath; }; void ieee80211_mesh_attach(struct ieee80211com *); void ieee80211_mesh_detach(struct ieee80211com *); From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 13:38:48 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 552551065675; Wed, 8 Jul 2009 13:38:48 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EBB18FC0C; Wed, 8 Jul 2009 13:38:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68Dcgpw052557; Wed, 8 Jul 2009 13:38:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68DcgnU052555; Wed, 8 Jul 2009 13:38:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081338.n68DcgnU052555@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 13:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195450 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 13:38:50 -0000 Author: rpaulo Date: Wed Jul 8 13:38:42 2009 New Revision: 195450 URL: http://svn.freebsd.org/changeset/base/195450 Log: Fix mismerge. Modified: projects/mesh11s/sys/net80211/ieee80211_input.c Modified: projects/mesh11s/sys/net80211/ieee80211_input.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_input.c Wed Jul 8 13:38:28 2009 (r195449) +++ projects/mesh11s/sys/net80211/ieee80211_input.c Wed Jul 8 13:38:42 2009 (r195450) @@ -277,7 +277,6 @@ ieee80211_decap(struct ieee80211vap *vap IEEE80211_ADDR_COPY(eh->ether_shost, wh.i_addr4); break; } -#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) #ifdef ALIGNED_POINTER if (!ALIGNED_POINTER(mtod(m, caddr_t) + sizeof(*eh), uint32_t)) { struct mbuf *n, *n0, **np; From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 13:39:12 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4744710656C2; Wed, 8 Jul 2009 13:39:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 359E38FC0C; Wed, 8 Jul 2009 13:39:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68DdCOX052608; Wed, 8 Jul 2009 13:39:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68DdCPb052606; Wed, 8 Jul 2009 13:39:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081339.n68DdCPb052606@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 13:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195451 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 13:39:12 -0000 Author: rpaulo Date: Wed Jul 8 13:39:11 2009 New Revision: 195451 URL: http://svn.freebsd.org/changeset/base/195451 Log: Move 11s all to the same place. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_node.h Modified: projects/mesh11s/sys/net80211/ieee80211_node.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.h Wed Jul 8 13:38:42 2009 (r195450) +++ projects/mesh11s/sys/net80211/ieee80211_node.h Wed Jul 8 13:39:11 2009 (r195451) @@ -178,8 +178,6 @@ struct ieee80211_node { uint16_t ni_capinfo; /* capabilities */ uint8_t ni_esslen; uint8_t ni_essid[IEEE80211_NWID_LEN]; - uint8_t ni_meshidlen; - uint8_t ni_meshid[IEEE80211_MESHID_LEN]; struct ieee80211_rateset ni_rates; /* negotiated rate set */ struct ieee80211_channel *ni_chan; uint16_t ni_fhdwell; /* FH only */ @@ -190,6 +188,8 @@ struct ieee80211_node { uint8_t ni_dtim_count; /* DTIM count for last bcn */ /* 11s state */ + uint8_t ni_meshidlen; + uint8_t ni_meshid[IEEE80211_MESHID_LEN]; enum ieee80211_mesh_mlstate ni_mlstate; /* peering management state */ uint16_t ni_mllid; /* link local ID */ uint16_t ni_mlpid; /* link peer ID */ From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 13:40:23 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 016161065672; Wed, 8 Jul 2009 13:40:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E37678FC21; Wed, 8 Jul 2009 13:40:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68DeMCf052676; Wed, 8 Jul 2009 13:40:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68DeMnM052674; Wed, 8 Jul 2009 13:40:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081340.n68DeMnM052674@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 13:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195452 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 13:40:23 -0000 Author: rpaulo Date: Wed Jul 8 13:40:22 2009 New Revision: 195452 URL: http://svn.freebsd.org/changeset/base/195452 Log: Add 'show mesh' ddb command and print mesh node info. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ddb.c Wed Jul 8 13:39:11 2009 (r195451) +++ projects/mesh11s/sys/net80211/ieee80211_ddb.c Wed Jul 8 13:40:22 2009 (r195452) @@ -76,6 +76,7 @@ static void _db_show_roamparams(const ch static void _db_show_txparams(const char *tag, const void *arg, const struct ieee80211_txparam *tp); static void _db_show_stats(const struct ieee80211_stats *); +static void _db_show_mesh(const struct ieee80211_mesh_state *); DB_SHOW_COMMAND(sta, db_show_sta) { @@ -178,6 +179,18 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_va } } +DB_SHOW_ALL_COMMAND(mesh, db_show_mesh) +{ + const struct ieee80211_mesh_state *ms; + + if (!have_addr) { + db_printf("usage: show mesh \n"); + return; + } + ms = (const struct ieee80211_mesh_state *) addr; + _db_show_mesh(ms); +} + static void _db_show_txampdu(const char *sep, int ix, const struct ieee80211_tx_ampdu *tap) { @@ -283,6 +296,11 @@ _db_show_sta(const struct ieee80211_node db_printf("\tinact %u inact_reload %u txrate %u\n", ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); + + _db_show_ssid(" meshid ", 0, ni->ni_meshidlen, ni->ni_meshid); + db_printf("\tmlstate %d mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n", + ni->ni_mlstate, ni->ni_mllid, ni->ni_mlpid, ni->ni_mlrcnt, + ni->ni_mltval); /* XXX wdsq */ } @@ -813,4 +831,24 @@ static void _db_show_stats(const struct ieee80211_stats *is) { } + +static void +_db_show_mesh(const struct ieee80211_mesh_state *ms) +{ + struct ieee80211_mesh_route *rt; + int i; + + _db_show_ssid(" meshid ", 0, ms->ms_idlen, ms->ms_id); + db_printf("nextseq %u ttl %u flags 0x%x\n", ms->ms_seq, + ms->ms_ttl, ms->ms_flags); + db_printf("routing table:\n"); + i = 0; + TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { + db_printf("entry %d:\tdest: %6D nexthop: %6D metric: %u", i, + rt->rt_dest, ":", rt->rt_nexthop, ":", rt->rt_metric); + db_printf("\tlifetime: %u lastseq: %u priv: %p\n", + rt->rt_lifetime, rt->rt_lastmseq, rt->rt_priv); + i++; + } +} #endif /* DDB */ From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 13:42:07 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61397106564A; Wed, 8 Jul 2009 13:42:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5548FC1B; Wed, 8 Jul 2009 13:42:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68Dg7Ci052754; Wed, 8 Jul 2009 13:42:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68Dg7rY052752; Wed, 8 Jul 2009 13:42:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081342.n68Dg7rY052752@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 13:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195453 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 13:42:07 -0000 Author: rpaulo Date: Wed Jul 8 13:42:07 2009 New Revision: 195453 URL: http://svn.freebsd.org/changeset/base/195453 Log: Fix typos. Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 13:40:22 2009 (r195452) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 13:42:07 2009 (r195453) @@ -2383,7 +2383,7 @@ mesh_ioctl_get80211(struct ieee80211vap struct ieee80211_mesh_state *ms = vap->iv_mesh; uint8_t tmpmeshid[IEEE80211_NWID_LEN]; struct ieee80211_mesh_route *rt; - struct ieee80211ireq_mesh_route *imr; + struct ieee80211req_mesh_route *imr; size_t len, off; uint8_t *p; int error; @@ -2429,7 +2429,8 @@ mesh_ioctl_get80211(struct ieee80211vap TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { if (off >= len) break; - irt = (struct ieee80211req_mesh_route *)(p + off); + imr = (struct ieee80211req_mesh_route *) + (p + off); IEEE80211_ADDR_COPY(imr->imr_dest, rt->rt_dest); IEEE80211_ADDR_COPY(imr->imr_nexthop, From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 13:58:36 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED061065672; Wed, 8 Jul 2009 13:58:36 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0EB78FC14; Wed, 8 Jul 2009 13:58:35 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68DwZjK053127; Wed, 8 Jul 2009 13:58:35 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68DwZgP053125; Wed, 8 Jul 2009 13:58:35 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081358.n68DwZgP053125@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 13:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195454 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 13:58:36 -0000 Author: rpaulo Date: Wed Jul 8 13:58:35 2009 New Revision: 195454 URL: http://svn.freebsd.org/changeset/base/195454 Log: Fix mismerge Modified: projects/mesh11s/sys/net80211/ieee80211_node.c Modified: projects/mesh11s/sys/net80211/ieee80211_node.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.c Wed Jul 8 13:42:07 2009 (r195453) +++ projects/mesh11s/sys/net80211/ieee80211_node.c Wed Jul 8 13:58:35 2009 (r195454) @@ -1114,7 +1114,6 @@ ieee80211_alloc_node(struct ieee80211_no ieee80211_psq_init(&ni->ni_psq, "unknown"); if (vap->iv_opmode == IEEE80211_M_MBSS) ieee80211_mesh_node_init(vap, ni); - IEEE80211_NODE_WDSQ_INIT(ni, "unknown"); IEEE80211_NODE_LOCK(nt); TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list); From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 14:17:04 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DE8D106564A; Wed, 8 Jul 2009 14:17:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26B5F8FC13; Wed, 8 Jul 2009 14:17:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68EH4uX053641; Wed, 8 Jul 2009 14:17:04 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68EH3C1053623; Wed, 8 Jul 2009 14:17:03 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907081417.n68EH3C1053623@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 8 Jul 2009 14:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195455 - in projects/libprocstat: lib lib/libc/gen lib/libc/include lib/libc/posix1e lib/libc/rpc lib/libc/stdtime lib/libc/sys lib/libjail lib/libthr/thread lib/libusb lib/libutil sys... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 14:17:04 -0000 Author: stas Date: Wed Jul 8 14:17:03 2009 New Revision: 195455 URL: http://svn.freebsd.org/changeset/base/195455 Log: - MFC. Added: projects/libprocstat/lib/libc/include/compat.h - copied unchanged from r195447, head/lib/libc/include/compat.h projects/libprocstat/lib/libc/posix1e/acl_add_flag_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_add_flag_np.3 projects/libprocstat/lib/libc/posix1e/acl_branding.c - copied unchanged from r195447, head/lib/libc/posix1e/acl_branding.c projects/libprocstat/lib/libc/posix1e/acl_clear_flags_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_clear_flags_np.3 projects/libprocstat/lib/libc/posix1e/acl_delete_flag_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_delete_flag_np.3 projects/libprocstat/lib/libc/posix1e/acl_flag.c - copied unchanged from r195447, head/lib/libc/posix1e/acl_flag.c projects/libprocstat/lib/libc/posix1e/acl_from_text_nfs4.c - copied unchanged from r195447, head/lib/libc/posix1e/acl_from_text_nfs4.c projects/libprocstat/lib/libc/posix1e/acl_get_brand_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_get_brand_np.3 projects/libprocstat/lib/libc/posix1e/acl_get_entry_type_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_get_entry_type_np.3 projects/libprocstat/lib/libc/posix1e/acl_get_flag_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_get_flag_np.3 projects/libprocstat/lib/libc/posix1e/acl_get_flagset_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_get_flagset_np.3 projects/libprocstat/lib/libc/posix1e/acl_is_trivial_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_is_trivial_np.3 projects/libprocstat/lib/libc/posix1e/acl_set_entry_type_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_set_entry_type_np.3 projects/libprocstat/lib/libc/posix1e/acl_set_flagset_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_set_flagset_np.3 projects/libprocstat/lib/libc/posix1e/acl_strip.c - copied unchanged from r195447, head/lib/libc/posix1e/acl_strip.c projects/libprocstat/lib/libc/posix1e/acl_strip_np.3 - copied unchanged from r195447, head/lib/libc/posix1e/acl_strip_np.3 projects/libprocstat/lib/libc/posix1e/acl_support_nfs4.c - copied unchanged from r195447, head/lib/libc/posix1e/acl_support_nfs4.c projects/libprocstat/lib/libc/posix1e/acl_to_text_nfs4.c - copied unchanged from r195447, head/lib/libc/posix1e/acl_to_text_nfs4.c projects/libprocstat/lib/libjail/ - copied from r195447, head/lib/libjail/ projects/libprocstat/sys/amd64/include/vm.h - copied unchanged from r195447, head/sys/amd64/include/vm.h projects/libprocstat/sys/arm/include/vm.h - copied unchanged from r195447, head/sys/arm/include/vm.h projects/libprocstat/sys/i386/include/vm.h - copied unchanged from r195447, head/sys/i386/include/vm.h projects/libprocstat/sys/ia64/include/vm.h - copied unchanged from r195447, head/sys/ia64/include/vm.h projects/libprocstat/sys/mips/include/vm.h - copied unchanged from r195447, head/sys/mips/include/vm.h projects/libprocstat/sys/net/if_epair.c - copied unchanged from r195447, head/sys/net/if_epair.c projects/libprocstat/sys/net80211/ieee80211_action.c - copied unchanged from r195447, head/sys/net80211/ieee80211_action.c projects/libprocstat/sys/net80211/ieee80211_action.h - copied unchanged from r195447, head/sys/net80211/ieee80211_action.h projects/libprocstat/sys/net80211/ieee80211_ageq.c - copied unchanged from r195447, head/sys/net80211/ieee80211_ageq.c projects/libprocstat/sys/net80211/ieee80211_ageq.h - copied unchanged from r195447, head/sys/net80211/ieee80211_ageq.h projects/libprocstat/sys/pc98/include/vm.h - copied unchanged from r195447, head/sys/pc98/include/vm.h projects/libprocstat/sys/powerpc/include/vm.h - copied unchanged from r195447, head/sys/powerpc/include/vm.h projects/libprocstat/sys/sparc64/include/vm.h - copied unchanged from r195447, head/sys/sparc64/include/vm.h projects/libprocstat/sys/sun4v/include/vm.h - copied unchanged from r195447, head/sys/sun4v/include/vm.h Deleted: projects/libprocstat/sys/nfs/rpcv2.h projects/libprocstat/sys/nfsclient/nfs_socket.c projects/libprocstat/sys/nfsserver/nfs_srvcache.c projects/libprocstat/sys/nfsserver/nfs_srvsock.c projects/libprocstat/sys/nfsserver/nfs_syscalls.c Modified: projects/libprocstat/lib/ (props changed) projects/libprocstat/lib/Makefile projects/libprocstat/lib/libc/gen/Symbol.map projects/libprocstat/lib/libc/gen/msgctl.3 projects/libprocstat/lib/libc/gen/semctl.c projects/libprocstat/lib/libc/posix1e/Makefile.inc projects/libprocstat/lib/libc/posix1e/Symbol.map projects/libprocstat/lib/libc/posix1e/acl.3 projects/libprocstat/lib/libc/posix1e/acl_add_perm.3 projects/libprocstat/lib/libc/posix1e/acl_calc_mask.c projects/libprocstat/lib/libc/posix1e/acl_copy.c projects/libprocstat/lib/libc/posix1e/acl_create_entry.3 projects/libprocstat/lib/libc/posix1e/acl_delete_entry.3 projects/libprocstat/lib/libc/posix1e/acl_delete_entry.c projects/libprocstat/lib/libc/posix1e/acl_entry.c projects/libprocstat/lib/libc/posix1e/acl_from_text.c projects/libprocstat/lib/libc/posix1e/acl_get.3 projects/libprocstat/lib/libc/posix1e/acl_get.c projects/libprocstat/lib/libc/posix1e/acl_init.c projects/libprocstat/lib/libc/posix1e/acl_set.3 projects/libprocstat/lib/libc/posix1e/acl_set.c projects/libprocstat/lib/libc/posix1e/acl_set_tag_type.3 projects/libprocstat/lib/libc/posix1e/acl_support.c projects/libprocstat/lib/libc/posix1e/acl_support.h projects/libprocstat/lib/libc/posix1e/acl_to_text.3 projects/libprocstat/lib/libc/posix1e/acl_to_text.c projects/libprocstat/lib/libc/posix1e/acl_valid.c projects/libprocstat/lib/libc/rpc/getnetconfig.c projects/libprocstat/lib/libc/stdtime/strptime.c projects/libprocstat/lib/libc/sys/Makefile.inc projects/libprocstat/lib/libc/sys/Symbol.map projects/libprocstat/lib/libc/sys/execve.2 projects/libprocstat/lib/libc/sys/getsockopt.2 projects/libprocstat/lib/libc/sys/pathconf.2 projects/libprocstat/lib/libc/sys/semctl.2 projects/libprocstat/lib/libc/sys/shmctl.2 projects/libprocstat/lib/libthr/thread/thr_rtld.c projects/libprocstat/lib/libthr/thread/thr_rwlock.c projects/libprocstat/lib/libusb/ (props changed) projects/libprocstat/lib/libusb/libusb20.3 (props changed) projects/libprocstat/lib/libutil/kinfo_getvmmap.3 projects/libprocstat/sys/ (props changed) projects/libprocstat/sys/amd64/amd64/genassym.c projects/libprocstat/sys/amd64/amd64/identcpu.c projects/libprocstat/sys/amd64/amd64/intr_machdep.c projects/libprocstat/sys/amd64/amd64/io_apic.c projects/libprocstat/sys/amd64/amd64/local_apic.c projects/libprocstat/sys/amd64/amd64/machdep.c projects/libprocstat/sys/amd64/amd64/msi.c projects/libprocstat/sys/amd64/amd64/pmap.c projects/libprocstat/sys/amd64/amd64/sys_machdep.c projects/libprocstat/sys/amd64/conf/GENERIC projects/libprocstat/sys/amd64/include/intr_machdep.h projects/libprocstat/sys/amd64/include/param.h projects/libprocstat/sys/amd64/isa/atpic.c projects/libprocstat/sys/arm/arm/pmap.c projects/libprocstat/sys/arm/arm/vm_machdep.c projects/libprocstat/sys/arm/at91/at91_machdep.c projects/libprocstat/sys/arm/at91/if_ate.c projects/libprocstat/sys/arm/conf/CAMBRIA.hints projects/libprocstat/sys/arm/include/param.h projects/libprocstat/sys/arm/mv/discovery/discovery.c projects/libprocstat/sys/arm/mv/kirkwood/kirkwood.c projects/libprocstat/sys/arm/mv/mv_machdep.c projects/libprocstat/sys/arm/mv/mvwin.h projects/libprocstat/sys/arm/mv/orion/orion.c projects/libprocstat/sys/arm/sa11x0/assabet_machdep.c projects/libprocstat/sys/arm/xscale/ixp425/if_npe.c projects/libprocstat/sys/boot/i386/libi386/biosdisk.c projects/libprocstat/sys/cam/scsi/scsi_target.c projects/libprocstat/sys/compat/freebsd32/freebsd32_ipc.h projects/libprocstat/sys/compat/freebsd32/freebsd32_misc.c projects/libprocstat/sys/compat/freebsd32/freebsd32_proto.h projects/libprocstat/sys/compat/freebsd32/freebsd32_syscall.h projects/libprocstat/sys/compat/freebsd32/freebsd32_syscalls.c projects/libprocstat/sys/compat/freebsd32/freebsd32_sysent.c projects/libprocstat/sys/compat/freebsd32/syscalls.master projects/libprocstat/sys/compat/linux/linux_ipc.c projects/libprocstat/sys/compat/linux/linux_signal.c projects/libprocstat/sys/compat/ndis/subr_usbd.c projects/libprocstat/sys/compat/svr4/svr4_ipc.c projects/libprocstat/sys/conf/NOTES projects/libprocstat/sys/conf/files projects/libprocstat/sys/conf/newvers.sh projects/libprocstat/sys/conf/options projects/libprocstat/sys/contrib/dev/mwl/mw88W8363.fw.uu projects/libprocstat/sys/dev/acpi_support/acpi_hp.c projects/libprocstat/sys/dev/acpi_support/acpi_wmi.c projects/libprocstat/sys/dev/acpi_support/acpi_wmi_if.m projects/libprocstat/sys/dev/ae/if_ae.c projects/libprocstat/sys/dev/age/if_age.c projects/libprocstat/sys/dev/alc/if_alc.c projects/libprocstat/sys/dev/ale/if_ale.c projects/libprocstat/sys/dev/asmc/asmc.c projects/libprocstat/sys/dev/asmc/asmcvar.h projects/libprocstat/sys/dev/ata/atapi-cd.c projects/libprocstat/sys/dev/ata/chipsets/ata-acard.c projects/libprocstat/sys/dev/ata/chipsets/ata-acerlabs.c projects/libprocstat/sys/dev/ata/chipsets/ata-adaptec.c projects/libprocstat/sys/dev/ata/chipsets/ata-ahci.c projects/libprocstat/sys/dev/ata/chipsets/ata-amd.c projects/libprocstat/sys/dev/ata/chipsets/ata-ati.c projects/libprocstat/sys/dev/ata/chipsets/ata-cenatek.c projects/libprocstat/sys/dev/ata/chipsets/ata-cypress.c projects/libprocstat/sys/dev/ata/chipsets/ata-cyrix.c projects/libprocstat/sys/dev/ata/chipsets/ata-highpoint.c projects/libprocstat/sys/dev/ata/chipsets/ata-intel.c projects/libprocstat/sys/dev/ata/chipsets/ata-ite.c projects/libprocstat/sys/dev/ata/chipsets/ata-jmicron.c projects/libprocstat/sys/dev/ata/chipsets/ata-marvell.c projects/libprocstat/sys/dev/ata/chipsets/ata-micron.c projects/libprocstat/sys/dev/ata/chipsets/ata-national.c projects/libprocstat/sys/dev/ata/chipsets/ata-netcell.c projects/libprocstat/sys/dev/ata/chipsets/ata-nvidia.c projects/libprocstat/sys/dev/ata/chipsets/ata-promise.c projects/libprocstat/sys/dev/ata/chipsets/ata-serverworks.c projects/libprocstat/sys/dev/ata/chipsets/ata-siliconimage.c projects/libprocstat/sys/dev/ata/chipsets/ata-sis.c projects/libprocstat/sys/dev/ata/chipsets/ata-via.c projects/libprocstat/sys/dev/ath/ah_osdep.c projects/libprocstat/sys/dev/ath/ah_osdep.h projects/libprocstat/sys/dev/ath/ath_hal/ah.c projects/libprocstat/sys/dev/ath/ath_hal/ah.h projects/libprocstat/sys/dev/ath/ath_hal/ah_internal.h projects/libprocstat/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c projects/libprocstat/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c projects/libprocstat/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/libprocstat/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/libprocstat/sys/dev/ath/if_ath.c projects/libprocstat/sys/dev/ath/if_athvar.h projects/libprocstat/sys/dev/bce/if_bce.c projects/libprocstat/sys/dev/bfe/if_bfe.c projects/libprocstat/sys/dev/bge/if_bge.c projects/libprocstat/sys/dev/bm/if_bm.c projects/libprocstat/sys/dev/cas/if_cas.c projects/libprocstat/sys/dev/cas/if_casvar.h projects/libprocstat/sys/dev/cpuctl/cpuctl.c projects/libprocstat/sys/dev/cs/if_cs.c projects/libprocstat/sys/dev/cxgb/cxgb_adapter.h projects/libprocstat/sys/dev/cxgb/cxgb_main.c projects/libprocstat/sys/dev/cxgb/cxgb_sge.c projects/libprocstat/sys/dev/cxgb/sys/mvec.h projects/libprocstat/sys/dev/cxgb/sys/uipc_mvec.c projects/libprocstat/sys/dev/dc/if_dc.c projects/libprocstat/sys/dev/de/if_de.c projects/libprocstat/sys/dev/drm/drm_irq.c projects/libprocstat/sys/dev/drm/i915_dma.c projects/libprocstat/sys/dev/drm/i915_drv.h projects/libprocstat/sys/dev/drm/i915_irq.c projects/libprocstat/sys/dev/drm/radeon_cp.c projects/libprocstat/sys/dev/drm/radeon_irq.c projects/libprocstat/sys/dev/e1000/e1000_82542.c projects/libprocstat/sys/dev/e1000/if_em.c projects/libprocstat/sys/dev/e1000/if_igb.c projects/libprocstat/sys/dev/ed/if_ed.c projects/libprocstat/sys/dev/et/if_et.c projects/libprocstat/sys/dev/ex/if_ex.c projects/libprocstat/sys/dev/fdc/fdc.c projects/libprocstat/sys/dev/fe/if_fe.c projects/libprocstat/sys/dev/fxp/if_fxp.c projects/libprocstat/sys/dev/gem/if_gem.c projects/libprocstat/sys/dev/gem/if_gemvar.h projects/libprocstat/sys/dev/hme/if_hme.c projects/libprocstat/sys/dev/hptmv/atapi.h projects/libprocstat/sys/dev/hwpmc/hwpmc_logging.c projects/libprocstat/sys/dev/hwpmc/hwpmc_mod.c projects/libprocstat/sys/dev/ie/if_ie.c projects/libprocstat/sys/dev/if_ndis/if_ndis.c projects/libprocstat/sys/dev/iscsi/initiator/isc_soc.c projects/libprocstat/sys/dev/ixgb/if_ixgb.c projects/libprocstat/sys/dev/ixgbe/ixgbe.c projects/libprocstat/sys/dev/jme/if_jme.c projects/libprocstat/sys/dev/le/lance.c projects/libprocstat/sys/dev/lge/if_lge.c projects/libprocstat/sys/dev/malo/if_malo.c projects/libprocstat/sys/dev/mge/if_mge.c projects/libprocstat/sys/dev/mpt/mpt_cam.c projects/libprocstat/sys/dev/msk/if_msk.c projects/libprocstat/sys/dev/mwl/if_mwl.c projects/libprocstat/sys/dev/mwl/if_mwlvar.h projects/libprocstat/sys/dev/mwl/mwlhal.c projects/libprocstat/sys/dev/mwl/mwlhal.h projects/libprocstat/sys/dev/mwl/mwlreg.h projects/libprocstat/sys/dev/mxge/if_mxge.c projects/libprocstat/sys/dev/mxge/if_mxge_var.h projects/libprocstat/sys/dev/my/if_my.c projects/libprocstat/sys/dev/nfe/if_nfe.c projects/libprocstat/sys/dev/nge/if_nge.c projects/libprocstat/sys/dev/nve/if_nve.c projects/libprocstat/sys/dev/nxge/if_nxge.c projects/libprocstat/sys/dev/pcn/if_pcn.c projects/libprocstat/sys/dev/pdq/pdq_ifsubr.c projects/libprocstat/sys/dev/re/if_re.c projects/libprocstat/sys/dev/sf/if_sf.c projects/libprocstat/sys/dev/sis/if_sis.c projects/libprocstat/sys/dev/sk/if_sk.c projects/libprocstat/sys/dev/sn/if_sn.c projects/libprocstat/sys/dev/snc/dp83932.c projects/libprocstat/sys/dev/sound/midi/midi.c projects/libprocstat/sys/dev/sound/midi/sequencer.c projects/libprocstat/sys/dev/sound/pcm/feeder_rate.c projects/libprocstat/sys/dev/sound/usb/uaudio.c projects/libprocstat/sys/dev/speaker/spkr.c projects/libprocstat/sys/dev/ste/if_ste.c projects/libprocstat/sys/dev/stge/if_stge.c projects/libprocstat/sys/dev/ti/if_ti.c projects/libprocstat/sys/dev/tl/if_tl.c projects/libprocstat/sys/dev/tsec/if_tsec.c projects/libprocstat/sys/dev/tx/if_tx.c projects/libprocstat/sys/dev/txp/if_txp.c projects/libprocstat/sys/dev/usb/controller/at91dci.c projects/libprocstat/sys/dev/usb/controller/atmegadci.c projects/libprocstat/sys/dev/usb/controller/avr32dci.c projects/libprocstat/sys/dev/usb/controller/musb_otg.c projects/libprocstat/sys/dev/usb/controller/uss820dci.c projects/libprocstat/sys/dev/usb/net/if_aue.c projects/libprocstat/sys/dev/usb/net/if_axe.c projects/libprocstat/sys/dev/usb/net/if_cdce.c projects/libprocstat/sys/dev/usb/net/if_cue.c projects/libprocstat/sys/dev/usb/net/if_kue.c projects/libprocstat/sys/dev/usb/net/if_rue.c projects/libprocstat/sys/dev/usb/net/if_udav.c projects/libprocstat/sys/dev/usb/serial/usb_serial.c projects/libprocstat/sys/dev/usb/storage/umass.c projects/libprocstat/sys/dev/usb/storage/ustorage_fs.c projects/libprocstat/sys/dev/usb/usb_controller.h projects/libprocstat/sys/dev/usb/usb_device.c projects/libprocstat/sys/dev/usb/usb_handle_request.c projects/libprocstat/sys/dev/usb/usb_if.m projects/libprocstat/sys/dev/usb/usb_transfer.c projects/libprocstat/sys/dev/usb/usbdevs projects/libprocstat/sys/dev/usb/usbdi.h projects/libprocstat/sys/dev/usb/wlan/if_upgt.c projects/libprocstat/sys/dev/usb/wlan/if_urtw.c projects/libprocstat/sys/dev/usb/wlan/if_zyd.c projects/libprocstat/sys/dev/vge/if_vge.c projects/libprocstat/sys/dev/vr/if_vr.c projects/libprocstat/sys/dev/wb/if_wb.c projects/libprocstat/sys/dev/wi/if_wi.c projects/libprocstat/sys/dev/wl/if_wl.c projects/libprocstat/sys/dev/xe/if_xe.c projects/libprocstat/sys/dev/xen/netfront/ (props changed) projects/libprocstat/sys/dev/xen/xenpci/ (props changed) projects/libprocstat/sys/dev/xl/if_xl.c projects/libprocstat/sys/fs/cd9660/cd9660_lookup.c projects/libprocstat/sys/fs/coda/coda_psdev.c projects/libprocstat/sys/fs/coda/coda_vnops.c projects/libprocstat/sys/fs/fifofs/fifo_vnops.c projects/libprocstat/sys/fs/nfsclient/nfs_clvnops.c projects/libprocstat/sys/fs/pseudofs/pseudofs_vnops.c projects/libprocstat/sys/geom/geom.h projects/libprocstat/sys/geom/geom_dev.c projects/libprocstat/sys/geom/geom_io.c projects/libprocstat/sys/geom/geom_subr.c projects/libprocstat/sys/geom/geom_vfs.c projects/libprocstat/sys/geom/journal/g_journal.c projects/libprocstat/sys/geom/linux_lvm/g_linux_lvm.c projects/libprocstat/sys/geom/part/g_part.c projects/libprocstat/sys/geom/part/g_part_if.m projects/libprocstat/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c projects/libprocstat/sys/gnu/fs/xfs/FreeBSD/xfs_iops.h projects/libprocstat/sys/gnu/fs/xfs/FreeBSD/xfs_vnode.h projects/libprocstat/sys/gnu/fs/xfs/xfs_rw.h projects/libprocstat/sys/gnu/fs/xfs/xfs_vnodeops.c projects/libprocstat/sys/i386/conf/GENERIC projects/libprocstat/sys/i386/i386/genassym.c projects/libprocstat/sys/i386/i386/intr_machdep.c projects/libprocstat/sys/i386/i386/io_apic.c projects/libprocstat/sys/i386/i386/local_apic.c projects/libprocstat/sys/i386/i386/msi.c projects/libprocstat/sys/i386/i386/pmap.c projects/libprocstat/sys/i386/i386/sys_machdep.c projects/libprocstat/sys/i386/ibcs2/ibcs2_ipc.c projects/libprocstat/sys/i386/include/intr_machdep.h projects/libprocstat/sys/i386/include/param.h projects/libprocstat/sys/i386/isa/atpic.c projects/libprocstat/sys/i386/linux/linux_machdep.c projects/libprocstat/sys/i386/xen/pmap.c projects/libprocstat/sys/ia64/conf/GENERIC projects/libprocstat/sys/ia64/include/param.h projects/libprocstat/sys/kern/init_sysent.c projects/libprocstat/sys/kern/kern_descrip.c projects/libprocstat/sys/kern/kern_event.c projects/libprocstat/sys/kern/kern_exec.c projects/libprocstat/sys/kern/kern_exit.c projects/libprocstat/sys/kern/kern_fork.c projects/libprocstat/sys/kern/kern_intr.c projects/libprocstat/sys/kern/kern_jail.c projects/libprocstat/sys/kern/kern_linker.c projects/libprocstat/sys/kern/kern_lockf.c projects/libprocstat/sys/kern/kern_mbuf.c projects/libprocstat/sys/kern/kern_prot.c projects/libprocstat/sys/kern/kern_sig.c projects/libprocstat/sys/kern/kern_switch.c projects/libprocstat/sys/kern/kern_thr.c projects/libprocstat/sys/kern/subr_param.c projects/libprocstat/sys/kern/subr_pcpu.c projects/libprocstat/sys/kern/sys_generic.c projects/libprocstat/sys/kern/sys_pipe.c projects/libprocstat/sys/kern/sys_process.c projects/libprocstat/sys/kern/sys_socket.c projects/libprocstat/sys/kern/syscalls.c projects/libprocstat/sys/kern/syscalls.master projects/libprocstat/sys/kern/systrace_args.c projects/libprocstat/sys/kern/sysv_ipc.c projects/libprocstat/sys/kern/sysv_msg.c projects/libprocstat/sys/kern/sysv_sem.c projects/libprocstat/sys/kern/sysv_shm.c projects/libprocstat/sys/kern/tty.c projects/libprocstat/sys/kern/tty_pts.c projects/libprocstat/sys/kern/uipc_socket.c projects/libprocstat/sys/kern/uipc_syscalls.c projects/libprocstat/sys/kern/vfs_cluster.c projects/libprocstat/sys/kern/vfs_export.c projects/libprocstat/sys/kern/vfs_extattr.c projects/libprocstat/sys/kern/vfs_lookup.c projects/libprocstat/sys/kern/vfs_mount.c projects/libprocstat/sys/kern/vfs_subr.c projects/libprocstat/sys/kern/vfs_syscalls.c projects/libprocstat/sys/kern/vfs_vnops.c projects/libprocstat/sys/mips/adm5120/if_admsw.c projects/libprocstat/sys/mips/include/param.h projects/libprocstat/sys/mips/malta/yamon.c projects/libprocstat/sys/mips/mips/busdma_machdep.c projects/libprocstat/sys/mips/mips/dump_machdep.c projects/libprocstat/sys/mips/mips/intr_machdep.c projects/libprocstat/sys/modules/Makefile projects/libprocstat/sys/modules/dtrace/dtnfsclient/ (props changed) projects/libprocstat/sys/modules/geom/geom_label/Makefile projects/libprocstat/sys/modules/ip6_mroute_mod/ (props changed) projects/libprocstat/sys/modules/ipmi/ipmi_linux/ (props changed) projects/libprocstat/sys/modules/nfsclient/Makefile projects/libprocstat/sys/modules/nfsserver/Makefile projects/libprocstat/sys/modules/wlan/Makefile projects/libprocstat/sys/net/if.c projects/libprocstat/sys/net/if_media.h projects/libprocstat/sys/net/if_spppsubr.c projects/libprocstat/sys/net/if_stf.c projects/libprocstat/sys/net/if_tap.c projects/libprocstat/sys/net/if_tun.c projects/libprocstat/sys/net/if_var.h projects/libprocstat/sys/net/netisr.c projects/libprocstat/sys/net/vnet.h projects/libprocstat/sys/net80211/ieee80211.c projects/libprocstat/sys/net80211/ieee80211_adhoc.c projects/libprocstat/sys/net80211/ieee80211_freebsd.h projects/libprocstat/sys/net80211/ieee80211_hostap.c projects/libprocstat/sys/net80211/ieee80211_ht.c projects/libprocstat/sys/net80211/ieee80211_ht.h projects/libprocstat/sys/net80211/ieee80211_node.c projects/libprocstat/sys/net80211/ieee80211_node.h projects/libprocstat/sys/net80211/ieee80211_sta.c projects/libprocstat/sys/net80211/ieee80211_var.h projects/libprocstat/sys/net80211/ieee80211_wds.c projects/libprocstat/sys/netatalk/aarp.c projects/libprocstat/sys/netatalk/at_control.c projects/libprocstat/sys/netatalk/at_var.h projects/libprocstat/sys/netatalk/ddp_input.c projects/libprocstat/sys/netatalk/ddp_output.c projects/libprocstat/sys/netatalk/ddp_pcb.c projects/libprocstat/sys/netatalk/ddp_usrreq.c projects/libprocstat/sys/netgraph/ng_eiface.c projects/libprocstat/sys/netgraph/ng_ether.c projects/libprocstat/sys/netgraph/ng_iface.c projects/libprocstat/sys/netgraph/ng_ksocket.c projects/libprocstat/sys/netinet/if_ether.c projects/libprocstat/sys/netinet/in.c projects/libprocstat/sys/netinet/in_gif.c projects/libprocstat/sys/netinet/in_mcast.c projects/libprocstat/sys/netinet/in_pcb.c projects/libprocstat/sys/netinet/in_var.h projects/libprocstat/sys/netinet/ip_carp.c projects/libprocstat/sys/netinet/ip_divert.c projects/libprocstat/sys/netinet/ip_dummynet.h projects/libprocstat/sys/netinet/ip_icmp.c projects/libprocstat/sys/netinet/ip_input.c projects/libprocstat/sys/netinet/ipfw/ip_dummynet.c (contents, props changed) projects/libprocstat/sys/netinet/ipfw/ip_fw2.c (contents, props changed) projects/libprocstat/sys/netinet/ipfw/ip_fw_nat.c projects/libprocstat/sys/netinet/ipfw/ip_fw_pfil.c (props changed) projects/libprocstat/sys/netinet/raw_ip.c projects/libprocstat/sys/netinet6/in6.c projects/libprocstat/sys/netinet6/in6_ifattach.c projects/libprocstat/sys/netinet6/in6_pcb.c projects/libprocstat/sys/netinet6/in6_src.c projects/libprocstat/sys/netinet6/in6_var.h projects/libprocstat/sys/netinet6/ip6_input.c projects/libprocstat/sys/netinet6/nd6.c projects/libprocstat/sys/netinet6/nd6_rtr.c projects/libprocstat/sys/netinet6/vinet6.h projects/libprocstat/sys/netipsec/key.c projects/libprocstat/sys/netipx/ipx.c projects/libprocstat/sys/netipx/ipx_if.h projects/libprocstat/sys/netipx/ipx_input.c projects/libprocstat/sys/netipx/ipx_outputfl.c projects/libprocstat/sys/netipx/ipx_pcb.c projects/libprocstat/sys/nfs/nfs_common.c projects/libprocstat/sys/nfs/nfs_nfssvc.c projects/libprocstat/sys/nfsclient/bootp_subr.c projects/libprocstat/sys/nfsclient/krpc_subr.c projects/libprocstat/sys/nfsclient/nfs.h projects/libprocstat/sys/nfsclient/nfs_bio.c projects/libprocstat/sys/nfsclient/nfs_diskless.c projects/libprocstat/sys/nfsclient/nfs_krpc.c projects/libprocstat/sys/nfsclient/nfs_lock.c projects/libprocstat/sys/nfsclient/nfs_nfsiod.c projects/libprocstat/sys/nfsclient/nfs_node.c projects/libprocstat/sys/nfsclient/nfs_subs.c projects/libprocstat/sys/nfsclient/nfs_vfsops.c projects/libprocstat/sys/nfsclient/nfs_vnops.c projects/libprocstat/sys/nfsclient/nfsm_subs.h projects/libprocstat/sys/nfsclient/nfsmount.h projects/libprocstat/sys/nfsserver/nfs.h projects/libprocstat/sys/nfsserver/nfs_fha.c projects/libprocstat/sys/nfsserver/nfs_serv.c projects/libprocstat/sys/nfsserver/nfs_srvkrpc.c projects/libprocstat/sys/nfsserver/nfs_srvsubs.c projects/libprocstat/sys/nfsserver/nfsrvcache.h projects/libprocstat/sys/pc98/conf/GENERIC projects/libprocstat/sys/pci/if_rl.c projects/libprocstat/sys/powerpc/conf/GENERIC projects/libprocstat/sys/powerpc/conf/MPC85XX projects/libprocstat/sys/powerpc/include/param.h projects/libprocstat/sys/powerpc/powerpc/mp_machdep.c projects/libprocstat/sys/rpc/clnt_dg.c projects/libprocstat/sys/rpc/clnt_rc.c projects/libprocstat/sys/rpc/rpcsec_gss/rpcsec_gss.c projects/libprocstat/sys/security/audit/audit.c projects/libprocstat/sys/security/audit/audit.h projects/libprocstat/sys/security/audit/audit_arg.c projects/libprocstat/sys/security/audit/audit_bsm.c projects/libprocstat/sys/security/audit/audit_private.h projects/libprocstat/sys/security/audit/audit_syscalls.c projects/libprocstat/sys/sparc64/conf/GENERIC projects/libprocstat/sys/sparc64/include/param.h projects/libprocstat/sys/sparc64/include/pmap.h projects/libprocstat/sys/sparc64/sparc64/machdep.c projects/libprocstat/sys/sparc64/sparc64/pmap.c projects/libprocstat/sys/sun4v/conf/GENERIC projects/libprocstat/sys/sun4v/include/param.h projects/libprocstat/sys/sun4v/sun4v/pmap.c projects/libprocstat/sys/sys/acl.h projects/libprocstat/sys/sys/ata.h projects/libprocstat/sys/sys/conf.h projects/libprocstat/sys/sys/cpuctl.h projects/libprocstat/sys/sys/disk.h projects/libprocstat/sys/sys/event.h projects/libprocstat/sys/sys/filio.h projects/libprocstat/sys/sys/ipc.h projects/libprocstat/sys/sys/mount.h projects/libprocstat/sys/sys/msg.h projects/libprocstat/sys/sys/param.h projects/libprocstat/sys/sys/priv.h projects/libprocstat/sys/sys/sched.h projects/libprocstat/sys/sys/sem.h projects/libprocstat/sys/sys/shm.h projects/libprocstat/sys/sys/socketvar.h projects/libprocstat/sys/sys/syscall.h projects/libprocstat/sys/sys/syscall.mk projects/libprocstat/sys/sys/sysctl.h projects/libprocstat/sys/sys/sysproto.h projects/libprocstat/sys/sys/uio.h projects/libprocstat/sys/sys/unistd.h projects/libprocstat/sys/sys/vnode.h projects/libprocstat/sys/tools/sound/feeder_rate_mkfilter.awk projects/libprocstat/sys/ufs/ffs/ffs_softdep.c projects/libprocstat/sys/ufs/ffs/ffs_vnops.c projects/libprocstat/sys/ufs/ufs/ufs_dirhash.c projects/libprocstat/sys/ufs/ufs/ufs_vnops.c projects/libprocstat/sys/vm/vm.h projects/libprocstat/sys/vm/vm_contig.c projects/libprocstat/sys/vm/vm_extern.h projects/libprocstat/sys/vm/vm_fault.c projects/libprocstat/sys/vm/vm_map.c projects/libprocstat/sys/vm/vm_object.c projects/libprocstat/sys/vm/vm_phys.c projects/libprocstat/sys/vm/vm_phys.h projects/libprocstat/sys/vm/vnode_pager.c projects/libprocstat/usr.bin/fstat/ (props changed) projects/libprocstat/usr.bin/fstat/fstat.c Modified: projects/libprocstat/lib/Makefile ============================================================================== --- projects/libprocstat/lib/Makefile Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/Makefile Wed Jul 8 14:17:03 2009 (r195455) @@ -35,8 +35,8 @@ SUBDIR= ${_csu} libc libbsm libauditd li libcalendar libcam libcompat libdevinfo libdevstat libdisk \ libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \ ${_libgssapi} ${_librpcsec_gss} libipsec \ - ${_libipx} libkiconv libmagic libmemstat ${_libmilter} ${_libmp} \ - ${_libncp} ${_libngatm} libopie libpam libpcap \ + ${_libipx} libjail libkiconv libmagic libmemstat ${_libmilter} \ + ${_libmp} ${_libncp} ${_libngatm} libopie libpam libpcap \ ${_libpmc} libproc librt ${_libsdp} ${_libsm} ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \ Modified: projects/libprocstat/lib/libc/gen/Symbol.map ============================================================================== --- projects/libprocstat/lib/libc/gen/Symbol.map Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/gen/Symbol.map Wed Jul 8 14:17:03 2009 (r195455) @@ -247,7 +247,6 @@ FBSD_1.0 { sem_timedwait; sem_post; sem_getvalue; - semctl; setdomainname; sethostname; longjmperror; @@ -362,6 +361,7 @@ FBSD_1.1 { posix_spawnattr_setsigdefault; posix_spawnattr_setsigmask; posix_spawnp; + semctl; tcgetsid; tcsetsid; }; Modified: projects/libprocstat/lib/libc/gen/msgctl.3 ============================================================================== --- projects/libprocstat/lib/libc/gen/msgctl.3 Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/gen/msgctl.3 Wed Jul 8 14:17:03 2009 (r195455) @@ -71,12 +71,8 @@ struct msqid_ds { pid_t msg_lspid; /* pid of last msgsnd() */ pid_t msg_lrpid; /* pid of last msgrcv() */ time_t msg_stime; /* time of last msgsnd() */ - long msg_pad1; time_t msg_rtime; /* time of last msgrcv() */ - long msg_pad2; time_t msg_ctime; /* time of last msgctl() */ - long msg_pad3; - long msg_pad4[4]; }; .Ed .Pp @@ -89,11 +85,11 @@ structure is defined in and looks like this: .Bd -literal struct ipc_perm { - unsigned short cuid; /* creator user id */ - unsigned short cgid; /* creator group id */ - unsigned short uid; /* user id */ - unsigned short gid; /* group id */ - unsigned short mode; /* r/w permission */ + uid_t cuid; /* creator user id */ + gid_t cgid; /* creator group id */ + uid_t uid; /* user id */ + gid_t gid; /* group id */ + mode_t mode; /* r/w permission */ unsigned short seq; /* sequence # (to generate unique ipcid) */ key_t key; /* user specified msg/sem/shm key */ }; Modified: projects/libprocstat/lib/libc/gen/semctl.c ============================================================================== --- projects/libprocstat/lib/libc/gen/semctl.c Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/gen/semctl.c Wed Jul 8 14:17:03 2009 (r195455) @@ -29,15 +29,19 @@ #include __FBSDID("$FreeBSD$"); +#define _WANT_SEMUN_OLD + #include #include #include #include #include -extern int __semctl(int semid, int semnum, int cmd, union semun *arg); +int __semctl(int semid, int semnum, int cmd, union semun *arg); +int freebsd7___semctl(int semid, int semnum, int cmd, union semun_old *arg); -int semctl(int semid, int semnum, int cmd, ...) +int +semctl(int semid, int semnum, int cmd, ...) { va_list ap; union semun semun; @@ -55,3 +59,25 @@ int semctl(int semid, int semnum, int cm return (__semctl(semid, semnum, cmd, semun_ptr)); } + +int +freebsd7_semctl(int semid, int semnum, int cmd, ...) +{ + va_list ap; + union semun_old semun; + union semun_old *semun_ptr; + + va_start(ap, cmd); + if (cmd == IPC_SET || cmd == IPC_STAT || cmd == GETALL + || cmd == SETVAL || cmd == SETALL) { + semun = va_arg(ap, union semun_old); + semun_ptr = &semun; + } else { + semun_ptr = NULL; + } + va_end(ap); + + return (freebsd7___semctl(semid, semnum, cmd, semun_ptr)); +} + +__sym_compat(semctl, freebsd7_semctl, FBSD_1.0); Copied: projects/libprocstat/lib/libc/include/compat.h (from r195447, head/lib/libc/include/compat.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/lib/libc/include/compat.h Wed Jul 8 14:17:03 2009 (r195455, copy of r195447, head/lib/libc/include/compat.h) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2009 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * This file defines compatiblity symbol versions for old system calls. It + * is included in all generated system call files. + */ + +#ifndef __LIBC_COMPAT_H__ +#define __LIBC_COMPAT_H__ + +#define __sym_compat(sym,impl,verid) \ + .symver impl , sym @ verid + +__sym_compat(__semctl, freebsd7___semctl, FBSD_1.0); +__sym_compat(msgctl, freebsd7_msgctl, FBSD_1.0); +__sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0); + +#undef __sym_compat + +#endif /* __LIBC_COMPAT_H__ */ + Modified: projects/libprocstat/lib/libc/posix1e/Makefile.inc ============================================================================== --- projects/libprocstat/lib/libc/posix1e/Makefile.inc Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/Makefile.inc Wed Jul 8 14:17:03 2009 (r195455) @@ -4,52 +4,74 @@ CFLAGS+=-D_ACL_PRIVATE -SRCS+= acl_calc_mask.c \ +# Copy kern/subr_acl_nfs4.c to the libc object directory. +subr_acl_nfs4.c: ${.CURDIR}/../../sys/kern/subr_acl_nfs4.c + cat ${.ALLSRC} > ${.TARGET} + +SRCS+= acl_branding.c \ + acl_calc_mask.c \ acl_copy.c \ acl_compat.c \ acl_delete.c \ acl_delete_entry.c \ acl_entry.c \ + acl_flag.c \ acl_free.c \ acl_from_text.c \ + acl_from_text_nfs4.c \ acl_get.c \ acl_init.c \ acl_perm.c \ acl_set.c \ + acl_strip.c \ acl_support.c \ + acl_support_nfs4.c \ acl_to_text.c \ + acl_to_text_nfs4.c \ acl_valid.c \ extattr.c \ mac.c \ mac_exec.c \ mac_get.c \ - mac_set.c + mac_set.c \ + subr_acl_nfs4.c SYM_MAPS+=${.CURDIR}/posix1e/Symbol.map MAN+= acl.3 \ + acl_add_flag_np.3 \ acl_add_perm.3 \ acl_calc_mask.3 \ + acl_clear_flags_np.3 \ acl_clear_perms.3 \ acl_copy_entry.3 \ acl_create_entry.3 \ acl_delete.3 \ acl_delete_entry.3 \ + acl_delete_flag_np.3 \ acl_delete_perm.3 \ acl_dup.3 \ acl_free.3 \ acl_from_text.3 \ acl_get.3 \ + acl_get_brand_np.3 \ acl_get_entry.3 \ + acl_get_entry_type_np.3 \ + acl_get_flagset_np.3 \ + acl_get_flag_np.3 \ acl_get_permset.3 \ acl_get_perm_np.3 \ acl_get_qualifier.3 \ acl_get_tag_type.3 \ acl_init.3 \ + acl_is_trivial_np.3 \ acl_set.3 \ + acl_set_entry_type_np.3 \ + acl_set_flagset_np.3 \ acl_set_permset.3 \ acl_set_qualifier.3 \ acl_set_tag_type.3 \ + acl_strip_np.3 \ acl_to_text.3 \ acl_valid.3 \ extattr.3 \ @@ -63,15 +85,18 @@ MAN+= acl.3 \ mac_text.3 \ posix1e.3 -MLINKS+=acl_delete.3 acl_delete_def_file.3 \ +MLINKS+=acl_create_entry.3 acl_create_entry_np.3\ + acl_delete.3 acl_delete_def_file.3 \ acl_delete.3 acl_delete_file_np.3 \ acl_delete.3 acl_delete_fd_np.3 \ + acl_delete_entry.3 acl_delete_entry_np.3\ acl_get.3 acl_get_file.3 \ acl_get.3 acl_get_fd.3 \ acl_get.3 acl_get_fd_np.3 \ acl_set.3 acl_set_file.3 \ acl_set.3 acl_set_fd.3 \ acl_set.3 acl_set_fd_np.3 \ + acl_to_text.3 acl_to_text_np.3 \ acl_valid.3 acl_valid_file_np.3 \ acl_valid.3 acl_valid_fd_np.3 \ extattr.3 extattr_namespace_to_string.3 \ Modified: projects/libprocstat/lib/libc/posix1e/Symbol.map ============================================================================== --- projects/libprocstat/lib/libc/posix1e/Symbol.map Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/Symbol.map Wed Jul 8 14:17:03 2009 (r195455) @@ -66,7 +66,21 @@ FBSD_1.0 { }; FBSD_1.1 { + acl_add_flag_np; acl_add_perm; + acl_clear_flags_np; + acl_create_entry_np; + acl_delete_entry_np; + acl_delete_flag_np; acl_delete_perm; + acl_get_brand_np; + acl_get_entry_type_np; + acl_get_flag_np; + acl_get_flagset_np; acl_get_perm_np; + acl_is_trivial_np; + acl_set_entry_type_np; + acl_set_flagset_np; + acl_strip_np; + acl_to_text_np; }; Modified: projects/libprocstat/lib/libc/posix1e/acl.3 ============================================================================== --- projects/libprocstat/lib/libc/posix1e/acl.3 Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/acl.3 Wed Jul 8 14:17:03 2009 (r195455) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2002 +.Dd June 25, 2009 .Dt ACL 3 .Os .Sh NAME @@ -59,6 +59,10 @@ all of these support routines are implem .Pp Available functions, sorted by behavior, include: .Bl -tag -width indent +.It Fn acl_add_flag_np +This function is described in +.Xr acl_add_flag_np 3 , +and may be used to add flags to a flagset. .It Fn acl_add_perm This function is described in .Xr acl_add_perm 3 , @@ -70,6 +74,10 @@ and may be used to calculate and set the the .Dv ACL_MASK entry. +.It Fn acl_clear_flags_np +This function is described in +.Xr acl_clear_flags_np 3 , +and may be used to clear all flags from a flagset. .It Fn acl_clear_perms This function is described in .Xr acl_clear_perms 3 , @@ -78,8 +86,11 @@ and may be used to clear all permissions This function is described in .Xr acl_copy_entry 3 , and may be used to copy the contents of an ACL entry. -.It Fn acl_create_entry -This function is described in +.It Xo +.Fn acl_create_entry , +.Fn acl_create_entry_np +.Xc +These functions are described in .Xr acl_create_entry 3 , and may be used to create an empty entry in an ACL. .It Xo @@ -92,10 +103,17 @@ and may be used to create an empty entry These functions are described in .Xr acl_delete 3 , and may be used to delete ACLs from file system objects. -.It Fn acl_delete_entry -This function is described in +.It Xo +.Fn acl_delete_entry , +.Fn acl_delete_entry_np , +.Xc +This functions are described in .Xr acl_delete_entry 3 , and may be used to delete an entry from an ACL. +.It Fn acl_delete_flag_np +This function is described in +.Xr acl_delete_flag_np 3 , +and may be used to delete flags from a flagset. .It Fn acl_delete_perm This function is described in .Xr acl_delete_perm 3 , @@ -112,7 +130,7 @@ and may be used to free userland working This function is described in .Xr acl_from_text 3 , and may be used to convert a text-form ACL into working ACL state, if -the ACL has POSIX.1e semantics. +the ACL has POSIX.1e or NFSv4 semantics. .It Fn acl_get_entry This function is described in .Xr acl_get_entry 3 , @@ -126,6 +144,14 @@ and may be used to retrieve a designated These functions are described in .Xr acl_get 3 , and may be used to retrieve ACLs from file system objects. +.It Fn acl_get_entry_type_np +This function is described in +.Xr acl_get_entry_type_np 3 , +and may be used to retrieve an ACL type from an ACL entry. +.It Fn acl_get_flagset_np +This function is described in +.Xr acl_get_flagset_np 3 , +and may be used to retrieve a flagset from an ACL entry. .It Fn acl_get_permset This function is described in .Xr acl_get_permset 3 , @@ -142,6 +168,10 @@ and may be used to retrieve the tag type This function is described in .Xr acl_init 3 , and may be used to allocate a fresh (empty) ACL structure. +.It Fn acl_is_trivial_np +This function is described in +.Xr acl_is_trivial_np 3 , +and may be used to find out whether ACL is trivial. .It Xo .Fn acl_set_fd , .Fn acl_set_fd_np , @@ -151,6 +181,14 @@ and may be used to allocate a fresh (emp These functions are described in .Xr acl_set 3 , and may be used to assign an ACL to a file system object. +.It Fn acl_set_entry_type_np +This function is described in +.Xr acl_set_entry_type_np 3 , +and may be used to set the ACL type of an ACL entry. +.It Fn acl_set_flagset_np +This function is described in +.Xr acl_set_flagset_np 3 , +and may be used to set the flags of an ACL entry from a flagset. .It Fn acl_set_permset This function is described in .Xr acl_set_permset 3 , @@ -163,10 +201,17 @@ and may be used to set the qualifier of This function is described in .Xr acl_set_tag_type 3 , and may be used to set the tag type of an ACL. -.It Fn acl_to_text -This function is described in +.It Fn acl_strip_np +This function is describe din +.Xr acl-strip_np 3 , +and may be used to remove extended entries from an ACL. +.It Xo +.Fn acl_to_text , +.Fn acl_to_text_np +.Xc +These functions are described in .Xr acl_to_text 3 , -and may be used to generate a text-form of a POSIX.1e semantics ACL. +and may be used to generate a text-form of a POSIX.1e or NFSv4 semantics ACL. .It Xo .Fn acl_valid , .Fn acl_valid_fd_np , @@ -189,25 +234,34 @@ library. .Sh SEE ALSO .Xr getfacl 1 , .Xr setfacl 1 , +.Xr acl_add_flag_np 3 , .Xr acl_add_perm 3 , .Xr acl_calc_mask 3 , +.Xr acl_clear_flags_np 3 , .Xr acl_clear_perms 3 , .Xr acl_copy_entry 3 , .Xr acl_create_entry 3 , .Xr acl_delete_entry 3 , +.Xr acl_delete_flag_np 3 , .Xr acl_delete_perm 3 , .Xr acl_dup 3 , .Xr acl_free 3 , .Xr acl_from_text 3 , .Xr acl_get 3 , +.Xr acl_get_entry_type_np 3 , +.Xr acl_get_flagset_np 3 , .Xr acl_get_permset 3 , .Xr acl_get_qualifier 3 , .Xr acl_get_tag_type 3 , .Xr acl_init 3 , +.Xr acl_is_trivial_np 3 , .Xr acl_set 3 , +.Xr acl_set_entry_type_np 3 , +.Xr acl_set_flagset_np 3 , .Xr acl_set_permset 3 , .Xr acl_set_qualifier 3 , .Xr acl_set_tag_type 3 , +.Xr acl_strip_np 3 , .Xr acl_to_text 3 , .Xr acl_valid 3 , .Xr posix1e 3 , Copied: projects/libprocstat/lib/libc/posix1e/acl_add_flag_np.3 (from r195447, head/lib/libc/posix1e/acl_add_flag_np.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/lib/libc/posix1e/acl_add_flag_np.3 Wed Jul 8 14:17:03 2009 (r195455, copy of r195447, head/lib/libc/posix1e/acl_add_flag_np.3) @@ -0,0 +1,98 @@ +.\"- +.\" Copyright (c) 2008, 2009 Edward Tomasz Napierala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 25, 2009 +.Dt ACL_ADD_FLAG_NP 3 +.Os +.Sh NAME +.Nm acl_add_flag_np +.Nd add flags to a flagset +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_add_flag_np "acl_flagset_t flagset_d" "acl_flag_t flag" +.Sh DESCRIPTION +The +.Fn acl_add_flag_np +function +is a non-portable call that adds the flags contained in +.Fa flags +to the flagset +.Fa flagset_d . +.Pp +Note: it is not considered an error to attempt to add flags +that already exist in the flagset. +.Pp +Valid values are: +.Pp +.Bl -column -offset 3n "ACL_ENTRY_NO_PROPAGATE_INHERIT" +.It ACL_ENTRY_FILE_INHERIT Will be inherited by files. +.It ACL_ENTRY_DIRECTORY_INHERIT Will be inherited by directories. +.It ACL_ENTRY_NO_PROPAGATE_INHERIT Will not propagate. +.It ACL_ENTRY_INHERIT_ONLY Inherit-only. +.El +.Sh RETURN VALUES +.Rv -std acl_add_flag_np +.Sh ERRORS +The +.Fn acl_add_flag_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa flagset_d +is not a valid descriptor for a flagset within an ACL entry. +Argument +.Fa flag +does not contain a valid +.Vt acl_flag_t +value. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_clear_flags_np 3 , +.Xr acl_delete_flag_np 3 , +.Xr acl_get_flagset_np 3 , +.Xr acl_set_flagset_np 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh HISTORY +POSIX.1e support was introduced in +.Fx 4.0 . +The +.Fn acl_add_flag_np +function was added in +.Fx 8.0 . +.Sh AUTHORS +The +.Fn acl_add_flag_np +function was written by +.An Edward Tomasz Napierala Aq trasz@FreeBSD.org . Modified: projects/libprocstat/lib/libc/posix1e/acl_add_perm.3 ============================================================================== --- projects/libprocstat/lib/libc/posix1e/acl_add_perm.3 Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/acl_add_perm.3 Wed Jul 8 14:17:03 2009 (r195455) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2001 +.Dd June 25, 2009 .Dt ACL_ADD_PERM 3 .Os .Sh NAME @@ -52,11 +52,43 @@ that already exist in the permission set .Pp For POSIX.1e ACLs, valid values are: .Pp -.Bl -column -offset 3n "ACL_EXECUTE" +.Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS" .It ACL_EXECUTE Execute permission .It ACL_WRITE Write permission .It ACL_READ Read permission .El +.Pp +For NFSv4 ACLs, valid values are: +.Pp +.Bl -column -offset 3n "ACL_WRITE_NAMED_ATTRS" +.It ACL_READ_DATA Read permission +.It ACL_LIST_DIRECTORY Same as ACL_READ_DATA +.It ACL_WRITE_DATA Write permission, or permission to create files +.It ACL_ADD_FILE Same as ACL_READ_DATA +.It ACL_APPEND_DATA Permission to create directories. Ignored for files +.It ACL_ADD_SUBDIRECTORY Same as ACL_APPEND_DATA +.It ACL_READ_NAMED_ATTRS Ignored +.It ACL_WRITE_NAMED_ATTRS Ignored +.It ACL_EXECUTE Execute permission +.It ACL_DELETE_CHILD Permission to delete files and subdirectories +.It ACL_READ_ATTRIBUTES Permission to read basic attributes +.It ACL_WRITE_ATTRIBUTES Permission to change basic attributes +.It ACL_DELETE Permission to delete the object this ACL is placed on +.It ACL_READ_ACL Permission to read ACL +.It ACL_WRITE_ACL Permission to change the ACL and file mode +.It ACL_SYNCHRONIZE Ignored +.El +.Pp +Calling +.Fn acl_add_perm +with +.Fa perm +equal to ACL_WRITE or ACL_READ brands the ACL as POSIX. +Calling it with ACL_READ_DATA, ACL_LIST_DIRECTORY, ACL_WRITE_DATA, +ACL_ADD_FILE, ACL_APPEND_DATA, ACL_ADD_SUBDIRECTORY, ACL_READ_NAMED_ATTRS, +ACL_WRITE_NAMED_ATTRS, ACL_DELETE_CHILD, ACL_READ_ATTRIBUTES, +ACL_WRITE_ATTRIBUTES, ACL_DELETE, ACL_READ_ACL, ACL_WRITE_ACL +or ACL_SYNCHRONIZE brands the ACL as NFSv4. .Sh RETURN VALUES .Rv -std acl_add_perm .Sh ERRORS @@ -73,11 +105,13 @@ Argument does not contain a valid .Vt acl_perm_t value. +ACL is already branded differently. .El .Sh SEE ALSO .Xr acl 3 , .Xr acl_clear_perms 3 , .Xr acl_delete_perm 3 , +.Xr acl_get_brand_np 3 , .Xr acl_get_permset 3 , .Xr acl_set_permset 3 , .Xr posix1e 3 Copied: projects/libprocstat/lib/libc/posix1e/acl_branding.c (from r195447, head/lib/libc/posix1e/acl_branding.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/lib/libc/posix1e/acl_branding.c Wed Jul 8 14:17:03 2009 (r195455, copy of r195447, head/lib/libc/posix1e/acl_branding.c) @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2008, 2009 Edward Tomasz NapieraÅ‚a + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "acl_support.h" + +/* + * An ugly detail of the implementation - fortunately not visible + * to the API users - is the "branding": libc needs to keep track + * of what "brand" ACL is: NFSv4, POSIX.1e or unknown. It happens + * automatically - for example, during acl_get_file(3) ACL gets + * branded according to the "type" argument; during acl_set_permset + * ACL, if its brand is unknown it gets branded as NFSv4 if any of the + * NFSv4 permissions that are not valid for POSIX.1e ACL are set etc. + * Branding information is used for printing out the ACL (acl_to_text(3)), + * veryfying acl_set_whatever arguments (checking against setting + * bits that are valid only for NFSv4 in ACL branded as POSIX.1e) etc. + */ + +static acl_t +entry2acl(acl_entry_t entry) +{ + acl_t aclp; + + aclp = (acl_t)(((long)entry >> _ACL_T_ALIGNMENT_BITS) << _ACL_T_ALIGNMENT_BITS); + + return (aclp); +} + +/* + * Return brand of an ACL. + */ +int +_acl_brand(const acl_t acl) +{ + + return (acl->ats_brand); +} + +int +_entry_brand(const acl_entry_t entry) +{ + + return (_acl_brand(entry2acl(entry))); +} + +/* + * Return 1, iff branding ACL as "brand" is ok. + */ +int +_acl_brand_may_be(const acl_t acl, int brand) +{ + + if (_acl_brand(acl) == ACL_BRAND_UNKNOWN) + return (1); + + if (_acl_brand(acl) == brand) + return (1); + + return (0); +} + +int +_entry_brand_may_be(const acl_entry_t entry, int brand) +{ + + return (_acl_brand_may_be(entry2acl(entry), brand)); +} + +/* + * Brand ACL as "brand". + */ +void +_acl_brand_as(acl_t acl, int brand) +{ + + assert(_acl_brand_may_be(acl, brand)); + + acl->ats_brand = brand; +} + +void +_entry_brand_as(const acl_entry_t entry, int brand) +{ + + _acl_brand_as(entry2acl(entry), brand); +} + +int +_acl_type_not_valid_for_acl(const acl_t acl, acl_type_t type) +{ + + switch (_acl_brand(acl)) { + case ACL_BRAND_NFS4: + if (type == ACL_TYPE_NFS4) + return (0); + break; + + case ACL_BRAND_POSIX: + if (type == ACL_TYPE_ACCESS || type == ACL_TYPE_DEFAULT) + return (0); + break; + } + + return (-1); +} + +void +_acl_brand_from_type(acl_t acl, acl_type_t type) +{ + + switch (type) { + case ACL_TYPE_NFS4: + _acl_brand_as(acl, ACL_BRAND_NFS4); + break; + case ACL_TYPE_ACCESS: + case ACL_TYPE_DEFAULT: + _acl_brand_as(acl, ACL_BRAND_POSIX); + break; + default: + /* XXX: What to do here? */ + break; + } +} + +int +acl_get_brand_np(acl_t acl, int *brand_p) +{ + + if (acl == NULL || brand_p == NULL) { + errno = EINVAL; + return (-1); + } + *brand_p = _acl_brand(acl); + + return (0); +} Modified: projects/libprocstat/lib/libc/posix1e/acl_calc_mask.c ============================================================================== --- projects/libprocstat/lib/libc/posix1e/acl_calc_mask.c Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/acl_calc_mask.c Wed Jul 8 14:17:03 2009 (r195455) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "acl_support.h" + /* * acl_calc_mask() (23.4.2): calculate and set the permissions * associated with the ACL_MASK ACL entry. If the ACL already @@ -48,6 +50,12 @@ acl_calc_mask(acl_t *acl_p) acl_t acl_new; int i, mask_mode, mask_num; + if (!_acl_brand_may_be(*acl_p, ACL_BRAND_POSIX)) { + errno = EINVAL; + return (-1); + } + _acl_brand_as(*acl_p, ACL_BRAND_POSIX); + /* * (23.4.2.4) requires acl_p to point to a pointer to a valid ACL. * Since one of the primary reasons to use this function would be Copied: projects/libprocstat/lib/libc/posix1e/acl_clear_flags_np.3 (from r195447, head/lib/libc/posix1e/acl_clear_flags_np.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/lib/libc/posix1e/acl_clear_flags_np.3 Wed Jul 8 14:17:03 2009 (r195455, copy of r195447, head/lib/libc/posix1e/acl_clear_flags_np.3) @@ -0,0 +1,79 @@ +.\"- +.\" Copyright (c) 2008, 2009 Edward Tomasz Napierala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 25, 2009 +.Dt ACL_CLEAR_FLAGS_NP 3 +.Os +.Sh NAME +.Nm acl_clear_flags_np +.Nd clear flags from a flagset +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/types.h +.In sys/acl.h +.Ft int +.Fn acl_clear_flags_np "acl_flagset_t flagset_d" +.Sh DESCRIPTION +The +.Fn acl_clear_flags_np +function +is a non-portable call that clears all flags from flagset +.Fa flagset_d . +.Sh RETURN VALUES +.Rv -std acl_clear_flags_np +.Sh ERRORS +The +.Fn acl_clear_flags_np +function fails if: +.Bl -tag -width Er +.It Bq Er EINVAL +Argument +.Fa flagset_d +is not a valid descriptor for a flagset. +.El +.Sh SEE ALSO +.Xr acl 3 , +.Xr acl_add_flag_np 3 , +.Xr acl_delete_flag_np 3 , +.Xr acl_get_flagset_np 3 , +.Xr acl_set_flagset_np 3 , +.Xr posix1e 3 +.Sh STANDARDS +POSIX.1e is described in IEEE POSIX.1e draft 17. +.Sh HISTORY +POSIX.1e support was introduced in +.Fx 4.0 . +The +.Fn acl_clear_flags_np +function was added in +.Fx 5.0 . +.Sh AUTHORS +The +.Fn acl_clear_flags_np +function was written by +.An Edward Tomasz Napierala Aq trasz@FreeBSD.org . Modified: projects/libprocstat/lib/libc/posix1e/acl_copy.c ============================================================================== --- projects/libprocstat/lib/libc/posix1e/acl_copy.c Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/acl_copy.c Wed Jul 8 14:17:03 2009 (r195455) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "acl_support.h" + /* * acl_copy_entry() (23.4.4): copy the contents of ACL entry src_d to * ACL entry dest_d @@ -48,9 +50,21 @@ acl_copy_entry(acl_entry_t dest_d, acl_e return (-1); } - dest_d->ae_tag = src_d->ae_tag; - dest_d->ae_id = src_d->ae_id; + /* + * Can we brand the new entry the same as the source entry? + */ + if (!_entry_brand_may_be(dest_d, _entry_brand(src_d))) { + errno = EINVAL; + return (-1); + } + + _entry_brand_as(dest_d, _entry_brand(src_d)); + + dest_d->ae_tag = src_d->ae_tag; + dest_d->ae_id = src_d->ae_id; dest_d->ae_perm = src_d->ae_perm; + dest_d->ae_entry_type = src_d->ae_entry_type; + dest_d->ae_flags = src_d->ae_flags; return (0); } Modified: projects/libprocstat/lib/libc/posix1e/acl_create_entry.3 ============================================================================== --- projects/libprocstat/lib/libc/posix1e/acl_create_entry.3 Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/acl_create_entry.3 Wed Jul 8 14:17:03 2009 (r195455) @@ -25,11 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd March 16, 2001 +.Dd June 25, 2009 .Dt ACL_CREATE_ENTRY 3 .Os .Sh NAME .Nm acl_create_entry +.Nm acl_create_entry_np .Nd create a new ACL entry .Sh LIBRARY .Lb libc @@ -38,6 +39,8 @@ .In sys/acl.h .Ft int .Fn acl_create_entry "acl_t *acl_p" "acl_entry_t *entry_p" +.Ft int +.Fn acl_create_entry_np "acl_t *acl_p" "acl_entry_t *entry_p" "int index" .Sh DESCRIPTION The .Fn acl_create_entry @@ -45,6 +48,16 @@ function is a POSIX.1e call that creates a new ACL entry in the ACL pointed to by .Fa acl_p . +The +.Fn acl_create_entry_np +function is a non-portable version that creates the ACL entry +at position +.Fa index . +Positions are numbered starting from zero, i.e. calling +.Fn acl_create_entry_np +with +.Fa index +argument equal to zero will prepend the entry to the ACL. .Sh RETURN VALUES .Rv -std acl_create_entry .Sh ERRORS @@ -56,6 +69,9 @@ function fails if: Argument .Fa acl_p does not point to a pointer to a valid ACL. +Argument +.Fa index +is out of bounds. .It Bq Er ENOMEM The ACL working storage requires more memory than is allowed by the hardware or system-imposed memory Modified: projects/libprocstat/lib/libc/posix1e/acl_delete_entry.3 ============================================================================== --- projects/libprocstat/lib/libc/posix1e/acl_delete_entry.3 Wed Jul 8 13:58:35 2009 (r195454) +++ projects/libprocstat/lib/libc/posix1e/acl_delete_entry.3 Wed Jul 8 14:17:03 2009 (r195455) @@ -25,11 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd March 10, 2001 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 14:52:32 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7822210656B8; Wed, 8 Jul 2009 14:52:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A64878FC2A; Wed, 8 Jul 2009 14:52:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68EqVSU054361; Wed, 8 Jul 2009 14:52:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68EqV4p054359; Wed, 8 Jul 2009 14:52:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081452.n68EqV4p054359@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 14:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195456 - projects/mesh11s/sbin/ifconfig X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 14:52:38 -0000 Author: rpaulo Date: Wed Jul 8 14:52:31 2009 New Revision: 195456 URL: http://svn.freebsd.org/changeset/base/195456 Log: * print and allow setting mesh metric and mesh path protocols Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 14:17:03 2009 (r195455) +++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 14:52:31 2009 (r195456) @@ -77,8 +77,6 @@ #include #include -#include - #include #include #include @@ -1872,6 +1870,24 @@ DECL_CMD_FUNC(set80211meshpeering, val, set80211(s, IEEE80211_IOC_MESH_AP, atoi(val), 0, NULL); } +static +DECL_CMD_FUNC(set80211meshmetric, val, d) +{ + char v[12]; + + memcpy(v, val, sizeof(v)); + set80211(s, IEEE80211_IOC_MESH_PR_METRIC, 0, 0, v); +} + +static +DECL_CMD_FUNC(set80211meshpath, val, d) +{ + char v[12]; + + memcpy(v, val, sizeof(v)); + set80211(s, IEEE80211_IOC_MESH_PR_PATH, 0, 0, v); +} + static int regdomain_sort(const void *a, const void *b) { @@ -4821,6 +4837,16 @@ end: else LINE_CHECK("-meshforward"); } + if (get80211len(s, IEEE80211_IOC_MESH_PR_METRIC, data, 12, + &len) != -1) { + data[len] = '\0'; + LINE_CHECK("meshmetric %s", data); + } + if (get80211len(s, IEEE80211_IOC_MESH_PR_PATH, data, 12, + &len) != -1) { + data[len] = '\0'; + LINE_CHECK("meshpath %s", data); + } if (get80211val(s, IEEE80211_IOC_HWMP_ROOTMODE, &val) != -1) { switch (val) { case IEEE80211_HWMP_ROOTMODE_DISABLED: @@ -5249,6 +5275,8 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-meshforward", 0, set80211meshforward), DEF_CMD("meshpeering", 1, set80211meshpeering), DEF_CMD("-meshpeering", 0, set80211meshpeering), + DEF_CMD_ARG("meshmetric", set80211meshmetric), + DEF_CMD_ARG("meshpath", set80211meshpath), DEF_CMD("meshrt:flush", IEEE80211_MESH_RTCMD_FLUSH, set80211meshrtcmd), DEF_CMD_ARG("meshrt:add", set80211addmeshrt), DEF_CMD_ARG("meshrt:del", set80211delmeshrt), From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 15:02:57 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DC010656C2; Wed, 8 Jul 2009 15:02:57 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25A358FC1A; Wed, 8 Jul 2009 15:02:57 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68F2v33054615; Wed, 8 Jul 2009 15:02:57 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68F2vaq054612; Wed, 8 Jul 2009 15:02:57 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081502.n68F2vaq054612@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 15:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195457 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 15:02:57 -0000 Author: rpaulo Date: Wed Jul 8 15:02:56 2009 New Revision: 195457 URL: http://svn.freebsd.org/changeset/base/195457 Log: Implement setter/getter for protocol ioctls. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 14:52:31 2009 (r195456) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 15:02:56 2009 (r195457) @@ -98,6 +98,9 @@ static const int ieee80211_mesh_maxretri #define IEEE80211_MESH_DEFAULT_TTL 31 +static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = + { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + static ieee80211_recv_action_func mesh_recv_action_meshpeering_open; static ieee80211_recv_action_func mesh_recv_action_meshpeering_confirm; static ieee80211_recv_action_func mesh_recv_action_meshpeering_close; @@ -151,8 +154,6 @@ ieee80211_mesh_rt_add(struct ieee80211va { struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt; - static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; KASSERT(ieee80211_mesh_rt_find(vap, dest) == NULL, ("%s: duplicate entry in the routing table", __func__)); @@ -275,8 +276,6 @@ mesh_select_proto_metric(struct ieee8021 for (i = 0; i < N(mesh_proto_metrics); i++) { if (strcmp(mesh_proto_metrics[i].mpm_descr, name) == 0) { ms->ms_pmetric = &mesh_proto_metrics[i]; - if (vap->iv_state == IEEE80211_S_RUN) - vap->iv_newstate(vap, IEEE80211_S_INIT, 0); return 0; } } @@ -2453,6 +2452,22 @@ mesh_ioctl_get80211(struct ieee80211vap return ENOSYS; } break; + case IEEE80211_IOC_MESH_PR_METRIC: + len = strlen(ms->ms_pmetric->mpm_descr); + if (ireq->i_len < len) + return EINVAL; + ireq->i_len = len; + error = copyout(ms->ms_pmetric->mpm_descr, + (uint8_t *)ireq->i_data, len); + break; + case IEEE80211_IOC_MESH_PR_PATH: + len = strlen(ms->ms_ppath->mpp_descr); + if (ireq->i_len < len) + return EINVAL; + ireq->i_len = len; + error = copyout(ms->ms_ppath->mpp_descr, + (uint8_t *)ireq->i_data, len); + break; default: return ENOSYS; } @@ -2465,8 +2480,10 @@ static int mesh_ioctl_set80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211_mesh_state *ms = vap->iv_mesh; - int error; uint8_t tmpmeshid[IEEE80211_NWID_LEN]; + uint8_t tmpaddr[IEEE80211_ADDR_LEN]; + char tmpproto[IEEE80211_MESH_PROTO_DSZ]; + int error; if (vap->iv_opmode != IEEE80211_M_MBSS) return ENOSYS; @@ -2506,9 +2523,13 @@ mesh_ioctl_set80211(struct ieee80211vap ieee80211_mesh_rt_flush(vap); break; case IEEE80211_MESH_RTCMD_ADD: - if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ireq->i_data)) + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ireq->i_data) || + IEEE80211_ADDR_EQ(broadcastaddr, ireq->i_data)) return EINVAL; - ieee80211_mesh_rt_add(vap, ireq->i_data); + error = copyin(ireq->i_data, &tmpaddr, + IEEE80211_ADDR_LEN); + if (!error) + ieee80211_mesh_discover(vap, tmpaddr, NULL); break; case IEEE80211_MESH_RTCMD_DELETE: ieee80211_mesh_rt_del(vap, ireq->i_data); @@ -2517,6 +2538,16 @@ mesh_ioctl_set80211(struct ieee80211vap return ENOSYS; } break; + case IEEE80211_IOC_MESH_PR_METRIC: + error = copyin(ireq->i_data, tmpproto, sizeof(tmpproto)); + if (!error) + return mesh_select_proto_metric(vap, tmpproto); + break; + case IEEE80211_IOC_MESH_PR_PATH: + error = copyin(ireq->i_data, tmpproto, sizeof(tmpproto)); + if (!error) + return mesh_select_proto_path(vap, tmpproto); + break; default: return ENOSYS; } Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 14:52:31 2009 (r195456) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 15:02:56 2009 (r195457) @@ -393,12 +393,13 @@ struct ieee80211_mesh_route { }; #define IEEE80211_MESH_ROUTE_PRIV(rt, cast) (cast *)rt->rt_priv +#define IEEE80211_MESH_PROTO_DSZ 12 /* description size */ /* * Mesh Path Selection Protocol. */ enum ieee80211_state; struct ieee80211_mesh_proto_path { - char mpp_descr[12]; + char mpp_descr[IEEE80211_MESH_PROTO_DSZ]; uint8_t mpp_ie[4]; struct ieee80211_node * (*mpp_discover)(struct ieee80211vap *, @@ -416,7 +417,7 @@ struct ieee80211_mesh_proto_path { * Mesh Link Metric Report Protocol. */ struct ieee80211_mesh_proto_metric { - char mpm_descr[12]; + char mpm_descr[IEEE80211_MESH_PROTO_DSZ]; uint8_t mpm_ie[4]; uint32_t (*mpm_metric)(struct ieee80211_node *); }; From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 15:26:34 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5DEA106564A; Wed, 8 Jul 2009 15:26:34 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 991CA8FC1E; Wed, 8 Jul 2009 15:26:34 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68FQY9W055187; Wed, 8 Jul 2009 15:26:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68FQYDb055185; Wed, 8 Jul 2009 15:26:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081526.n68FQYDb055185@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 15:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 15:26:35 -0000 Author: rpaulo Date: Wed Jul 8 15:26:34 2009 New Revision: 195460 URL: http://svn.freebsd.org/changeset/base/195460 Log: Remove some spurious __packed attributes. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 15:25:27 2009 (r195459) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 15:26:34 2009 (r195460) @@ -46,7 +46,7 @@ struct ieee80211_meshconf_ie { uint8_t conf_authid[4]; /* Auth. Protocol ID */ uint8_t conf_form; /* Formation Information */ uint8_t conf_cap; -} __packed; +}; #define IEEE80211_MESHCONF_VERSION 1 /* Null Protocol */ @@ -93,7 +93,7 @@ struct ieee80211_meshconf_ie { struct ieee80211_meshid_ie { uint8_t id_ie; /* IEEE80211_ELEMID_MESHID */ uint8_t id_len; -} __packed; +}; #define IEEE80211_MESHID_LEN IEEE80211_NWID_LEN @@ -118,7 +118,7 @@ struct ieee80211_meshpeerver_ie { uint8_t peerver_ie; /* IEEE80211_ELEMID_MESHPEERVER */ uint8_t peerver_len; uint8_t peerver_proto[4]; -} __packed; +}; /* Mesh Peering Management Protocol */ #define IEEE80211_MESHPEERVER_PEER_OUI 0x00, 0x0f, 0xac #define IEEE80211_MESHPEERVER_PEER_VALUE 0x2a @@ -157,7 +157,7 @@ struct ieee80211_meshcsa_ie { uint8_t csa_newchan; uint8_t csa_precvalue; /* Precedence Value */ uint8_t csa_count; -} __packed; +}; /* Mesh TIM */ /* Equal to the non Mesh version */ @@ -167,7 +167,7 @@ struct ieee80211_meshawakew_ie { uint8_t awakew_ie; /* IEEE80211_ELEMID_MESHAWAKEW */ uint8_t awakew_len; uint8_t awakew_windowlen; /* in TUs */ -} __packed; +}; /* Mesh Beacon Timing */ struct ieee80211_meshbeacont_ie { @@ -190,7 +190,7 @@ struct ieee80211_meshpann_ie { uint8_t pann_ttl; uint8_t pann_addr[IEEE80211_ADDR_LEN]; uint8_t pann_seq; /* PANN Sequence Number */ -} __packed; +}; /* Root (MP) Annoucement */ struct ieee80211_meshrann_ie { @@ -274,7 +274,7 @@ struct ieee80211_meshpu_ie { uint8_t pu_addr[IEEE80211_ADDR_LEN]; uint8_t pu_naddr; /* Number of Proxied Addresses */ /* NB: proxied address follows */ -} __packed; +}; /* Mesh Proxy Update Confirmation */ struct ieee80211_meshpuc_ie { @@ -283,7 +283,7 @@ struct ieee80211_meshpuc_ie { uint8_t puc_flags; uint8_t puc_seq; /* PU Sequence Number */ uint8_t puc_daddr[IEEE80211_ADDR_LEN]; -} __packed; +}; #endif /* From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 16:04:15 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88A08106564A; Wed, 8 Jul 2009 16:04:15 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BFF98FC1A; Wed, 8 Jul 2009 16:04:15 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68G4FMK056099; Wed, 8 Jul 2009 16:04:15 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68G4F0g056097; Wed, 8 Jul 2009 16:04:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081604.n68G4F0g056097@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 16:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195463 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 16:04:15 -0000 Author: rpaulo Date: Wed Jul 8 16:04:15 2009 New Revision: 195463 URL: http://svn.freebsd.org/changeset/base/195463 Log: Revert 195460: gcc does evil things without __packed. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 15:57:22 2009 (r195462) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 16:04:15 2009 (r195463) @@ -46,7 +46,7 @@ struct ieee80211_meshconf_ie { uint8_t conf_authid[4]; /* Auth. Protocol ID */ uint8_t conf_form; /* Formation Information */ uint8_t conf_cap; -}; +} __packed; #define IEEE80211_MESHCONF_VERSION 1 /* Null Protocol */ @@ -93,7 +93,7 @@ struct ieee80211_meshconf_ie { struct ieee80211_meshid_ie { uint8_t id_ie; /* IEEE80211_ELEMID_MESHID */ uint8_t id_len; -}; +} __packed; #define IEEE80211_MESHID_LEN IEEE80211_NWID_LEN @@ -118,7 +118,7 @@ struct ieee80211_meshpeerver_ie { uint8_t peerver_ie; /* IEEE80211_ELEMID_MESHPEERVER */ uint8_t peerver_len; uint8_t peerver_proto[4]; -}; +} __packed; /* Mesh Peering Management Protocol */ #define IEEE80211_MESHPEERVER_PEER_OUI 0x00, 0x0f, 0xac #define IEEE80211_MESHPEERVER_PEER_VALUE 0x2a @@ -157,7 +157,7 @@ struct ieee80211_meshcsa_ie { uint8_t csa_newchan; uint8_t csa_precvalue; /* Precedence Value */ uint8_t csa_count; -}; +} __packed; /* Mesh TIM */ /* Equal to the non Mesh version */ @@ -167,7 +167,7 @@ struct ieee80211_meshawakew_ie { uint8_t awakew_ie; /* IEEE80211_ELEMID_MESHAWAKEW */ uint8_t awakew_len; uint8_t awakew_windowlen; /* in TUs */ -}; +} __packed; /* Mesh Beacon Timing */ struct ieee80211_meshbeacont_ie { @@ -190,7 +190,7 @@ struct ieee80211_meshpann_ie { uint8_t pann_ttl; uint8_t pann_addr[IEEE80211_ADDR_LEN]; uint8_t pann_seq; /* PANN Sequence Number */ -}; +} __packed; /* Root (MP) Annoucement */ struct ieee80211_meshrann_ie { @@ -274,7 +274,7 @@ struct ieee80211_meshpu_ie { uint8_t pu_addr[IEEE80211_ADDR_LEN]; uint8_t pu_naddr; /* Number of Proxied Addresses */ /* NB: proxied address follows */ -}; +} __packed; /* Mesh Proxy Update Confirmation */ struct ieee80211_meshpuc_ie { @@ -283,7 +283,7 @@ struct ieee80211_meshpuc_ie { uint8_t puc_flags; uint8_t puc_seq; /* PU Sequence Number */ uint8_t puc_daddr[IEEE80211_ADDR_LEN]; -}; +} __packed; #endif /* From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 16:08:45 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0967F1065670; Wed, 8 Jul 2009 16:08:45 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E09828FC23; Wed, 8 Jul 2009 16:08:44 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68G8icB056209; Wed, 8 Jul 2009 16:08:44 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68G8iSW056207; Wed, 8 Jul 2009 16:08:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081608.n68G8iSW056207@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 16:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195464 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 16:08:45 -0000 Author: rpaulo Date: Wed Jul 8 16:08:44 2009 New Revision: 195464 URL: http://svn.freebsd.org/changeset/base/195464 Log: Fix meshconf IE creation. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 16:04:15 2009 (r195463) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 16:08:44 2009 (r195464) @@ -2084,10 +2084,9 @@ static int mesh_verify_meshconf(struct ieee80211vap *vap, const uint8_t *ie) { static const uint8_t null[4] = IEEE80211_MESHCONF_NULL; - static const uint8_t hwmp[4] = IEEE80211_MESHCONF_HWMP; - static const uint8_t airtime[4] = IEEE80211_MESHCONF_AIRTIME; const struct ieee80211_meshconf_ie *meshconf = (const struct ieee80211_meshconf_ie *) ie; + const struct ieee80211_mesh_state *ms = vap->iv_mesh; if (meshconf == NULL) return 1; @@ -2096,14 +2095,14 @@ mesh_verify_meshconf(struct ieee80211vap "wrong mesh conf version: %d\n", meshconf->conf_ver); return 1; } - if (memcmp(meshconf->conf_pselid, hwmp, 4) != 0) { + if (memcmp(meshconf->conf_pselid, ms->ms_ppath->mpp_ie, 4) != 0) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, "unknown path selection algorithm: 0x%x%x%x%x\n", meshconf->conf_pselid[0], meshconf->conf_pselid[1], meshconf->conf_pselid[2], meshconf->conf_pselid[3]); return 1; } - if (memcmp(meshconf->conf_pmetid, airtime, 4) != 0) { + if (memcmp(meshconf->conf_pmetid, ms->ms_pmetric->mpm_ie, 4) != 0) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, "unknown path metric algorithm: 0x%x%x%x%x\n", meshconf->conf_pmetid[0], meshconf->conf_pmetid[1], @@ -2178,23 +2177,25 @@ uint8_t * ieee80211_add_meshconf(uint8_t *frm, struct ieee80211vap *vap) { uint8_t neighs = 0; - struct ieee80211_mesh_state *ms = vap->iv_mesh; - /* XXX needs to be changed for other protocols */ - static const struct ieee80211_meshconf_ie ie = { - .conf_ie = IEEE80211_ELEMID_MESHCONF, - .conf_len = sizeof(struct ieee80211_meshconf_ie) - 2, - .conf_ver = IEEE80211_MESHCONF_VERSION, - .conf_pselid = IEEE80211_MESHCONF_HWMP, - .conf_pmetid = IEEE80211_MESHCONF_AIRTIME, - .conf_ccid = IEEE80211_MESHCONF_NULL, - .conf_syncid = IEEE80211_MESHCONF_NULL, - .conf_authid = IEEE80211_MESHCONF_NULL, - }; + const struct ieee80211_mesh_state *ms = vap->iv_mesh; + static const uint8_t null[4] = IEEE80211_MESHCONF_NULL; KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap")); - memcpy(frm, &ie, sizeof(ie)); - frm += __offsetof(struct ieee80211_meshconf_ie, conf_form); + *frm++ = IEEE80211_ELEMID_MESHCONF; + *frm++ = sizeof(struct ieee80211_meshconf_ie) - 2; + *frm++ = IEEE80211_MESHCONF_VERSION; + memcpy(frm, ms->ms_ppath->mpp_ie, 4); /* path selection */ + frm += 4; + memcpy(frm, ms->ms_pmetric->mpm_ie, 4); /* link metric */ + frm += 4; + /* XXX null for now */ + memcpy(frm, null, 4); /* congestion control */ + frm += 4; + memcpy(frm, null, 4); /* sync */ + frm += 4; + memcpy(frm, null, 4); /* auth */ + frm += 4; ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, meshconf_neighbors, &neighs); /* NB: set the number of neighbors before the rest */ From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 16:09:39 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 930891065678; Wed, 8 Jul 2009 16:09:39 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 817138FC0A; Wed, 8 Jul 2009 16:09:39 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68G9dBj056261; Wed, 8 Jul 2009 16:09:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68G9d7x056259; Wed, 8 Jul 2009 16:09:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081609.n68G9d7x056259@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 16:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195465 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 16:09:39 -0000 Author: rpaulo Date: Wed Jul 8 16:09:39 2009 New Revision: 195465 URL: http://svn.freebsd.org/changeset/base/195465 Log: Use insensitive casing when comparing protocol names. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 16:08:44 2009 (r195464) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 16:09:39 2009 (r195465) @@ -257,7 +257,7 @@ mesh_select_proto_path(struct ieee80211v int i; for (i = 0; i < N(mesh_proto_paths); i++) { - if (strcmp(mesh_proto_paths[i].mpp_descr, name) == 0) { + if (strcasecmp(mesh_proto_paths[i].mpp_descr, name) == 0) { ms->ms_ppath = &mesh_proto_paths[i]; if (vap->iv_state == IEEE80211_S_RUN) vap->iv_newstate(vap, IEEE80211_S_INIT, 0); @@ -274,7 +274,7 @@ mesh_select_proto_metric(struct ieee8021 int i; for (i = 0; i < N(mesh_proto_metrics); i++) { - if (strcmp(mesh_proto_metrics[i].mpm_descr, name) == 0) { + if (strcasecmp(mesh_proto_metrics[i].mpm_descr, name) == 0) { ms->ms_pmetric = &mesh_proto_metrics[i]; return 0; } From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 16:10:40 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE3E1065677; Wed, 8 Jul 2009 16:10:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1408FC14; Wed, 8 Jul 2009 16:10:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68GAeev056325; Wed, 8 Jul 2009 16:10:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68GAev3056323; Wed, 8 Jul 2009 16:10:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081610.n68GAev3056323@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 16:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195466 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 16:10:41 -0000 Author: rpaulo Date: Wed Jul 8 16:10:40 2009 New Revision: 195466 URL: http://svn.freebsd.org/changeset/base/195466 Log: Change to INIT state when metric protocol changes. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 16:09:39 2009 (r195465) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Wed Jul 8 16:10:40 2009 (r195466) @@ -276,6 +276,8 @@ mesh_select_proto_metric(struct ieee8021 for (i = 0; i < N(mesh_proto_metrics); i++) { if (strcasecmp(mesh_proto_metrics[i].mpm_descr, name) == 0) { ms->ms_pmetric = &mesh_proto_metrics[i]; + if (vap->iv_state == IEEE80211_S_RUN) + vap->iv_newstate(vap, IEEE80211_S_INIT, 0); return 0; } } From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 16:25:47 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B11C61065670; Wed, 8 Jul 2009 16:25:47 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92DDD8FC15; Wed, 8 Jul 2009 16:25:47 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68GPl2a056635; Wed, 8 Jul 2009 16:25:47 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68GPlwl056633; Wed, 8 Jul 2009 16:25:47 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081625.n68GPlwl056633@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 16:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195467 - projects/mesh11s/sbin/ifconfig X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 16:25:48 -0000 Author: rpaulo Date: Wed Jul 8 16:25:47 2009 New Revision: 195467 URL: http://svn.freebsd.org/changeset/base/195467 Log: Use list sta instead of list mesh to display the neighbors. Use list mesh to display the routing table. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 16:10:40 2009 (r195466) +++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 16:25:47 2009 (r195467) @@ -163,6 +163,7 @@ static void print_channels(int, const st int allchans, int verbose); static void regdomain_makechannels(struct ieee80211_regdomain_req *, const struct ieee80211_devcaps_req *); +static const char *mesh_linkstate_string(uint8_t state); static struct ieee80211req_chaninfo *chaninfo; static struct ieee80211_regdomain regdomain; @@ -3322,18 +3323,32 @@ list_stations(int s) getchaninfo(s); - printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n" - , "ADDR" - , "AID" - , "CHAN" - , "RATE" - , "RSSI" - , "IDLE" - , "TXSEQ" - , "RXSEQ" - , "CAPS" - , "FLAG" - ); + if (opmode == IEEE80211_M_MBSS) + printf("%-17.17s %4s %5s %5s %7s %4s %4s %4s %6s %6s\n" + , "ADDR" + , "CHAN" + , "LOCAL" + , "PEER" + , "STATE" + , "RATE" + , "RSSI" + , "IDLE" + , "TXSEQ" + , "RXSEQ" + ); + else + printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n" + , "ADDR" + , "AID" + , "CHAN" + , "RATE" + , "RSSI" + , "IDLE" + , "TXSEQ" + , "RXSEQ" + , "CAPS" + , "FLAG" + ); cp = (const uint8_t *) u.req.info; do { const struct ieee80211req_sta_info *si; @@ -3341,18 +3356,36 @@ list_stations(int s) si = (const struct ieee80211req_sta_info *) cp; if (si->isi_len < sizeof(*si)) break; - printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-7.7s" - , ether_ntoa((const struct ether_addr*) si->isi_macaddr) - , IEEE80211_AID(si->isi_associd) - , ieee80211_mhz2ieee(si->isi_freq, si->isi_flags) - , si->isi_txmbps/2 - , si->isi_rssi/2. - , si->isi_inact - , gettxseq(si) - , getrxseq(si) - , getcaps(si->isi_capinfo) - , getflags(si->isi_state) - ); + if (opmode == IEEE80211_M_MBSS) + printf("%s %4d %5x %5x %7.7s %3dM %4.1f %4d %6d %6d" + , ether_ntoa((const struct ether_addr*) + si->isi_macaddr) + , ieee80211_mhz2ieee(si->isi_freq, + si->isi_flags) + , si->isi_localid + , si->isi_peerid + , mesh_linkstate_string(si->isi_peerstate) + , si->isi_txmbps/2 + , si->isi_rssi/2. + , si->isi_inact + , gettxseq(si) + , getrxseq(si) + ); + else + printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-7.7s" + , ether_ntoa((const struct ether_addr*) + si->isi_macaddr) + , IEEE80211_AID(si->isi_associd) + , ieee80211_mhz2ieee(si->isi_freq, + si->isi_flags) + , si->isi_txmbps/2 + , si->isi_rssi/2. + , si->isi_inact + , gettxseq(si) + , getrxseq(si) + , getcaps(si->isi_capinfo) + , getflags(si->isi_state) + ); printies(cp + si->isi_ie_off, si->isi_ie_len, 24); printmimo(&si->isi_mimo); printf("\n"); @@ -3382,64 +3415,6 @@ mesh_linkstate_string(uint8_t state) #undef N } -static void -list_peers(int s) -{ - union { - struct ieee80211req_sta_req req; - uint8_t buf[24*1024]; - } u; - const uint8_t *cp; - int len; - - /* broadcast address =>'s get all stations */ - (void) memset(u.req.is_u.macaddr, 0xff, IEEE80211_ADDR_LEN); - if (get80211len(s, IEEE80211_IOC_STA_INFO, &u, sizeof(u), &len) < 0) - errx(1, "unable to get station information"); - if (len < sizeof(struct ieee80211req_sta_info)) - return; - - getchaninfo(s); - - printf("%-17.17s %4s %5s %5s %7s %4s %4s %4s %6s %6s\n" - , "ADDR" - , "CHAN" - , "LOCAL" - , "PEER" - , "STATE" - , "RATE" - , "RSSI" - , "IDLE" - , "TXSEQ" - , "RXSEQ" - ); - cp = (const uint8_t *) u.req.info; - do { - const struct ieee80211req_sta_info *si; - - si = (const struct ieee80211req_sta_info *) cp; - if (si->isi_len < sizeof(*si)) - break; - printf("%s %4d %5x %5x %7.7s %3dM %4.1f %4d %6d %6d" - , ether_ntoa((const struct ether_addr*) si->isi_macaddr) - , ieee80211_mhz2ieee(si->isi_freq, si->isi_flags) - , si->isi_localid - , si->isi_peerid - , mesh_linkstate_string(si->isi_peerstate) - , si->isi_txmbps/2 - , si->isi_rssi/2. - , si->isi_inact - , gettxseq(si) - , getrxseq(si) - ); - if (verbose) - printies(cp + si->isi_ie_off, si->isi_ie_len, 24); - printmimo(&si->isi_mimo); - printf("\n"); - cp += si->isi_len, len -= si->isi_len; - } while (len >= sizeof(struct ieee80211req_sta_info)); -} - static const char * get_chaninfo(const struct ieee80211_channel *c, int precise, char buf[], size_t bsize) @@ -4002,23 +3977,15 @@ list_mesh(int s) , "HOPS" , "METRIC" , "LIFETIME"); -#if 0 - , "SEQ" - , "PREQID"); -#endif for (i = 0; i < ireq.i_len / sizeof(*routes); i++) { printf("%s ", ether_ntoa((const struct ether_addr *)routes[i].imr_dest)); - printf("%s %4u %4d %6dn", + printf("%s %4u %4d %6d\n", ether_ntoa((const struct ether_addr *) routes[i].imr_nexthop), routes[i].imr_nhops, routes[i].imr_metric, routes[i].imr_lifetime); -#if 0 - , routes[i].rt_seq, - routes[i].rt_preqid); -#endif } } @@ -4055,8 +4022,6 @@ DECL_CMD_FUNC(set80211list, arg, d) list_regdomain(s, 1); else if (iseq(arg, "countries")) list_countries(); - else if (iseq(arg, "peers")) - list_peers(s); else if (iseq(arg, "mesh")) list_mesh(s); else From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 16:53:06 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41424106566C; Wed, 8 Jul 2009 16:53:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F58F8FC13; Wed, 8 Jul 2009 16:53:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68Gr6V8057273; Wed, 8 Jul 2009 16:53:06 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68Gr6Jx057271; Wed, 8 Jul 2009 16:53:06 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081653.n68Gr6Jx057271@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 16:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195470 - projects/mesh11s/sbin/ifconfig X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 16:53:06 -0000 Author: rpaulo Date: Wed Jul 8 16:53:05 2009 New Revision: 195470 URL: http://svn.freebsd.org/changeset/base/195470 Log: Update for mesh support. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sbin/ifconfig/ifconfig.8 Modified: projects/mesh11s/sbin/ifconfig/ifconfig.8 ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifconfig.8 Wed Jul 8 16:30:34 2009 (r195469) +++ projects/mesh11s/sbin/ifconfig/ifconfig.8 Wed Jul 8 16:53:05 2009 (r195470) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 24, 2009 +.Dd July 8, 2009 .Dt IFCONFIG 8 .Os .Sh NAME @@ -623,6 +623,7 @@ is one of .Cm hostap ), .Cm wds , .Cm tdma , +.Cm mesh , and .Cm monitor . The operating mode of a cloned interface cannot be changed. @@ -1195,6 +1196,9 @@ indicates the address is denied access, .Ql * indicates the address is present but the current policy open (so the ACL is not consulted). +.It Cm list mesh +Displays the mesh routing table, used for forwarding packets on a mesh +network. .It Cm list regdomain Display the current regulatory settings including the available channels and transmit power caps. @@ -1278,6 +1282,7 @@ When operating as an access point displa currently associated. When operating in ad-hoc mode display stations identified as neighbors in the IBSS. +When operating in mesh mode display the neighbor mesh stations. When operating in station mode display the access point. Capabilities advertised by the stations are described under the @@ -1813,6 +1818,64 @@ as it handles the RADIUS processing (and marks stations as authorized). .El .Pp +The following parameters are related to a wireless interface operating in mesh +mode: +.Bl -tag -width indent +.It Cm meshid Ar meshid +Set the desired Mesh Identifier. +The Mesh ID is a string up to 32 characters in length. +.It Cm meshttl Ar ttl +Set the desired time to live for mesh forwarded packets. +.It Cm meshpeering +Enable or disable peering with neighbor mesh stations. +.It Cm meshforward +Enable or disable forwarding packets by a mesh interface. +.It Cm meshmetric Ar protocol +Set the specified +.Ar protocol +as the link metric protocol used on a mesh network. +The default protocol is called +.Ar AIRTIME . +The mesh interface will restart after changing this setting. +.It Cm meshpath Ar protocol +Set the specified +.Ar protocol +as the path selection protocol used on a mesh network. +The default protocol is called +.Ar HWMP +(Hybrid Wireless Mesh Protocol). +The mesh interface will restart after changing this setting. +.It Cm hwmprootmode Ar mode +Stations on a mesh network can operate as root nodes. +Root nodes try to find paths to all mesh nodes and advertise themselves +regularly. +When there is a root mesh node on a network, other mesh nodes can setup +paths between themselves faster because they will use the root node +to reach the destination. This path may not be the best, but on-demand +routing will eventually find the best path. +The following modes are recognized: +.Pp +.Bl -tag -width ".Cm PROACTIVE" -compact +.It Cm DISABLED +root mode disabled. +.It Cm NORMAL +sends broadcast path requests every two seconds. +Nodes on the mesh without a path to this root mesh station with try to +discover a path to us. +.It Cm PROACTIVE +sends broadcast path requests every two seconds and every node must reply with +with a path reply even if it already has a path to this root mesh station, +.It Cm RANN +sends broadcast root annoucement (RANN) frames. +Nodes on the mesh without a path to this root mesh station with try to +discover a path to us. +.El +.It Cm hwmpmaxhops Ar cnt +Use the specified +.Ar cnt +as the maximum number of hops allowed in an HWMP path. +.El +.Pp The following parameters are for compatibility with other systems: .Bl -tag -width indent .It Cm nwid Ar ssid From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 16:53:32 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 215FE106564A; Wed, 8 Jul 2009 16:53:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FF128FC08; Wed, 8 Jul 2009 16:53:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68GrVQD057315; Wed, 8 Jul 2009 16:53:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68GrVru057313; Wed, 8 Jul 2009 16:53:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081653.n68GrVru057313@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 16:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195471 - projects/mesh11s/sbin/ifconfig X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 16:53:32 -0000 Author: rpaulo Date: Wed Jul 8 16:53:31 2009 New Revision: 195471 URL: http://svn.freebsd.org/changeset/base/195471 Log: Remove hwmpttl, it's wrong. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 16:53:05 2009 (r195470) +++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 16:53:31 2009 (r195471) @@ -1337,12 +1337,6 @@ DECL_CMD_FUNC(set80211hwmpmaxhops, val, set80211(s, IEEE80211_IOC_HWMP_MAXHOPS, atoi(val), 0, NULL); } -static -DECL_CMD_FUNC(set80211hwmpttl, val, d) -{ - set80211(s, IEEE80211_IOC_HWMP_TTL, atoi(val), 0, NULL); -} - static void set80211pureg(const char *val, int d, int s, const struct afswtch *rafp) { @@ -4834,9 +4828,6 @@ end: if (get80211val(s, IEEE80211_IOC_HWMP_MAXHOPS, &val) != -1) { LINE_CHECK("hwmpmaxhops %u", val); } - if (get80211val(s, IEEE80211_IOC_HWMP_TTL, &val) != -1) { - LINE_CHECK("hwmpttl %u", val); - } } LINE_BREAK(); From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 17:01:07 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1BAE106564A; Wed, 8 Jul 2009 17:01:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FDAA8FC13; Wed, 8 Jul 2009 17:01:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68H17CU057532; Wed, 8 Jul 2009 17:01:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68H17bi057530; Wed, 8 Jul 2009 17:01:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081701.n68H17bi057530@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 17:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195472 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 17:01:08 -0000 Author: rpaulo Date: Wed Jul 8 17:01:07 2009 New Revision: 195472 URL: http://svn.freebsd.org/changeset/base/195472 Log: * use mesh ttl, not hwmp ttl * verify hopcount before fwding Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Wed Jul 8 16:53:31 2009 (r195471) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Wed Jul 8 17:01:07 2009 (r195472) @@ -175,7 +175,6 @@ struct ieee80211_hwmp_state { int hs_rootmode; /* proactive HWMP */ struct callout hs_roottimer; uint8_t hs_maxhops; /* max hop count */ - uint8_t hs_ttl; /* HWMP ttl */ }; SYSCTL_NODE(_net_wlan, OID_AUTO, hwmp, CTLFLAG_RD, 0, @@ -186,7 +185,6 @@ SYSCTL_INT(_net_wlan_hwmp, OID_AUTO, rep &ieee80211_hwmp_replyforward, 0, "Set RF bit on generated PREQs"); #define IEEE80211_HWMP_DEFAULT_MAXHOPS 31 -#define IEEE80211_HWMP_DEFAULT_TTL 31 static ieee80211_recv_action_func hwmp_recv_action_meshpath_preq; static ieee80211_recv_action_func hwmp_recv_action_meshpath_prep; @@ -242,7 +240,6 @@ hwmp_vattach(struct ieee80211vap *vap) return; } hs->hs_maxhops = IEEE80211_HWMP_DEFAULT_MAXHOPS; - hs->hs_ttl = IEEE80211_HWMP_DEFAULT_TTL; callout_init(&hs->hs_roottimer, CALLOUT_MPSAFE); vap->iv_hwmp = hs; } @@ -610,6 +607,7 @@ hwmp_rootmode_cb(void *arg) { struct ieee80211vap *vap = (struct ieee80211vap *)arg; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; + struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_meshpreq_ie preq; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss, @@ -620,7 +618,7 @@ hwmp_rootmode_cb(void *arg) if (hs->hs_rootmode == IEEE80211_HWMP_ROOTMODE_PROACTIVE) preq.preq_flags |= IEEE80211_MESHPREQ_FLAGS_PP; preq.preq_hopcount = 0; - preq.preq_ttl = hs->hs_ttl; + preq.preq_ttl = ms->ms_ttl; preq.preq_id = ++hs->hs_preqid; IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); preq.preq_origseq = ++hs->hs_seq; @@ -648,6 +646,7 @@ hwmp_rootmode_rann_cb(void *arg) { struct ieee80211vap *vap = (struct ieee80211vap *)arg; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; + struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_meshrann_ie rann; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, vap->iv_bss, @@ -656,7 +655,7 @@ hwmp_rootmode_rann_cb(void *arg) /* XXX check portal role */ rann.rann_flags = 0; rann.rann_hopcount = 0; - rann.rann_ttl = hs->hs_ttl; + rann.rann_ttl = ms->ms_ttl; IEEE80211_ADDR_COPY(rann.rann_addr, vap->iv_myaddr); rann.rann_seq = ++hs->hs_seq; rann.rann_metric = IEEE80211_MESHLMETRIC_INITIALVAL; @@ -715,7 +714,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, */ prep.prep_flags = 0; prep.prep_hopcount = 0; - prep.prep_ttl = hs->hs_ttl; + prep.prep_ttl = ms->ms_ttl; IEEE80211_ADDR_COPY(prep.prep_targetaddr, preq->preq_origaddr); prep.prep_targetseq = preq->preq_origseq; prep.prep_lifetime = preq->preq_lifetime; @@ -758,7 +757,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_PP)) { prep.prep_flags = 0; prep.prep_hopcount = 0; - prep.prep_ttl = hs->hs_ttl; + prep.prep_ttl = ms->ms_ttl; IEEE80211_ADDR_COPY(prep.prep_origaddr, vap->iv_myaddr); prep.prep_origseq = preq->preq_origseq; @@ -795,7 +794,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_hwmp_route); hr->hr_preqid = preq->preq_id; hr->hr_seq = preq->preq_origseq; - if (preq->preq_ttl > 1) { + if (preq->preq_ttl > 1 && + preq->preq_hopcount < hs->hs_maxhops) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "forwarding PREQ from %s", ether_sprintf(preq->preq_origaddr)); @@ -829,7 +829,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, ether_sprintf(preq->preq_origaddr)); prep.prep_flags = 0; prep.prep_hopcount = rt->rt_nhops + 1; - prep.prep_ttl = hs->hs_ttl; + prep.prep_ttl = ms->ms_ttl; IEEE80211_ADDR_COPY(&prep.prep_targetaddr, preq->preq_origaddr); prep.prep_targetseq = hr->hr_seq; @@ -844,9 +844,10 @@ hwmp_recv_preq(struct ieee80211vap *vap, } /* * We have no information about this path, - * propagate the PREQ based on TTL. + * propagate the PREQ. */ - } else if (preq->preq_ttl > 1) { + } else if (preq->preq_ttl > 1 && + preq->preq_hopcount < hs->hs_maxhops) { if (rt == NULL) rt = ieee80211_mesh_rt_add(vap, PREQ_TADDR(0)); hr = IEEE80211_MESH_ROUTE_PRIV(rt, @@ -928,11 +929,10 @@ hwmp_recv_prep(struct ieee80211vap *vap, "received PREP from %s", ether_sprintf(prep->prep_origaddr)); /* - * If it's NOT for us, propagate the PREP if TTL is - * greater than 1. + * If it's NOT for us, propagate the PREP. */ if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, prep->prep_targetaddr) && - prep->prep_ttl > 1) { + prep->prep_ttl > 1 && prep->prep_hopcount < hs->hs_maxhops) { struct ieee80211_meshprep_ie pprep; /* propagated PREP */ IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, @@ -1154,6 +1154,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, const struct ieee80211_frame *wh, const struct ieee80211_meshrann_ie *rann) { struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_hwmp_state *hs = vap->iv_hwmp; struct ieee80211_mesh_route *rt = NULL; struct ieee80211_hwmp_route *hr; struct ieee80211_meshrann_ie prann; @@ -1173,6 +1174,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, } hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); if (rann->rann_seq > hr->hr_seq && rann->rann_ttl > 1 && + rann->rann_hopcount < hs->hs_maxhops && (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) { memcpy(&prann, rann, sizeof(prann)); prann.rann_hopcount += 1; @@ -1211,6 +1213,7 @@ hwmp_discover(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) { struct ieee80211_hwmp_state *hs = vap->iv_hwmp; + struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ieee80211_mesh_route *rt = NULL; struct ieee80211_hwmp_route *hr; struct ieee80211_meshpreq_ie preq; @@ -1250,7 +1253,7 @@ hwmp_discover(struct ieee80211vap *vap, */ preq.preq_flags = 0; preq.preq_hopcount = 0; - preq.preq_ttl = hs->hs_ttl; + preq.preq_ttl = ms->ms_ttl; preq.preq_id = hr->hr_preqid; IEEE80211_ADDR_COPY(preq.preq_origaddr, vap->iv_myaddr); preq.preq_origseq = hr->hr_seq; @@ -1316,9 +1319,6 @@ hwmp_ioctl_get80211(struct ieee80211vap case IEEE80211_IOC_HWMP_MAXHOPS: ireq->i_val = hs->hs_maxhops; break; - case IEEE80211_IOC_HWMP_TTL: - ireq->i_val = hs->hs_ttl; - break; default: return ENOSYS; } @@ -1347,11 +1347,6 @@ hwmp_ioctl_set80211(struct ieee80211vap return EINVAL; hs->hs_maxhops = ireq->i_val; break; - case IEEE80211_IOC_HWMP_TTL: - if (ireq->i_val <= 0 || ireq->i_val > 255) - return EINVAL; - hs->hs_ttl = ireq->i_val; - break; default: return ENOSYS; } From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 17:10:16 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C971A1065672; Wed, 8 Jul 2009 17:10:16 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B64908FC08; Wed, 8 Jul 2009 17:10:16 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68HAGYc057732; Wed, 8 Jul 2009 17:10:16 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68HAGNX057723; Wed, 8 Jul 2009 17:10:16 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907081710.n68HAGNX057723@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 8 Jul 2009 17:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195473 - projects/libprocstat/usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 17:10:17 -0000 Author: stas Date: Wed Jul 8 17:10:16 2009 New Revision: 195473 URL: http://svn.freebsd.org/changeset/base/195473 Log: - Move common interest functions into separate files so they can be reused by other modules (e.g. fuser). Added: projects/libprocstat/usr.bin/fstat/common.c projects/libprocstat/usr.bin/fstat/common.h Modified: projects/libprocstat/usr.bin/fstat/Makefile projects/libprocstat/usr.bin/fstat/cd9660.c projects/libprocstat/usr.bin/fstat/fstat.c projects/libprocstat/usr.bin/fstat/fstat.h projects/libprocstat/usr.bin/fstat/msdosfs.c projects/libprocstat/usr.bin/fstat/zfs.c Modified: projects/libprocstat/usr.bin/fstat/Makefile ============================================================================== --- projects/libprocstat/usr.bin/fstat/Makefile Wed Jul 8 17:01:07 2009 (r195472) +++ projects/libprocstat/usr.bin/fstat/Makefile Wed Jul 8 17:10:16 2009 (r195473) @@ -4,7 +4,7 @@ .include PROG= fstat -SRCS= cd9660.c fstat.c msdosfs.c +SRCS= cd9660.c common.c fstat.c msdosfs.c DPADD= ${LIBKVM} LDADD= -lkvm BINGRP= kmem Modified: projects/libprocstat/usr.bin/fstat/cd9660.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/cd9660.c Wed Jul 8 17:01:07 2009 (r195472) +++ projects/libprocstat/usr.bin/fstat/cd9660.c Wed Jul 8 17:10:16 2009 (r195473) @@ -54,16 +54,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include "common.h" #include "fstat.h" int -isofs_filestat(struct vnode *vp, struct filestat *fsp) +isofs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) { struct iso_node isonode; - if (!KVM_READ(VTOI(vp), &isonode, sizeof (isonode))) { - dprintf(stderr, "can't read iso_node at %p for pid %d\n", - (void *)VTOI(vp), Pid); + if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &isonode, + sizeof(isonode))) { + dprintf(stderr, "can't read iso_node at %p\n", + (void *)VTOI(vp)); return 0; } #if 0 @@ -76,4 +78,3 @@ isofs_filestat(struct vnode *vp, struct fsp->size = (u_long)isonode.i_size; return 1; } - Added: projects/libprocstat/usr.bin/fstat/common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/usr.bin/fstat/common.c Wed Jul 8 17:10:16 2009 (r195473) @@ -0,0 +1,275 @@ +/*- + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define _WANT_FILE +#include +#include +#define _KERNEL +#include +#include +#include +#include +#include +#include +#undef _KERNEL +#include +#include +#include + + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" + +int vflg = 0; + +void +dprintf(FILE *file, const char *fmt, ...) { + va_list ap; + + if (vflg != 0) { + va_start(ap, fmt); + vfprintf(file, fmt, ap); + va_end(ap); + } +} + +int +kvm_read_all(kvm_t *kd, unsigned long addr, void *buf, size_t nbytes) +{ + ssize_t error; + + if (nbytes >= SSIZE_MAX) + return (0); + error = kvm_read(kd, addr, buf, nbytes); + return (error == (ssize_t)(nbytes)); +} + +char * +kdevtoname(kvm_t *kd, struct cdev *dev) +{ + struct cdev si; + + if (!kvm_read_all(kd, (unsigned long)dev, &si, sizeof(si))) + return (NULL); + return (strdup(si.__si_namebuf)); +} + +int +ufs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) +{ + struct inode inode; + + if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &inode, sizeof(inode))) { + dprintf(stderr, "can't read inode at %p\n", (void *)VTOI(vp)); + return 0; + } + /* + * The st_dev from stat(2) is a dev_t. These kernel structures + * contain cdev pointers. We need to convert to dev_t to make + * comparisons + */ + fsp->fsid = dev2udev(kd, inode.i_dev); + fsp->fileid = (long)inode.i_number; + fsp->mode = (mode_t)inode.i_mode; + fsp->size = (u_long)inode.i_size; +#if should_be_but_is_hard + /* XXX - need to load i_ump and i_din[12] from kernel memory */ + if (inode.i_ump->um_fstype == UFS1) + fsp->rdev = inode.i_din1->di_rdev; + else + fsp->rdev = inode.i_din2->di_rdev; +#else + fsp->rdev = 0; +#endif + + return 1; +} + +int +devfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) +{ + struct devfs_dirent devfs_dirent; + struct mount mount; + struct vnode vnode; + + if (!kvm_read_all(kd, (unsigned long)vp->v_data, &devfs_dirent, + sizeof(devfs_dirent))) { + dprintf(stderr, "can't read devfs_dirent at %p\n", + (void *)vp->v_data); + return 0; + } + if (!kvm_read_all(kd, (unsigned long)vp->v_mount, &mount, + sizeof(mount))) { + dprintf(stderr, "can't read mount at %p\n", + (void *)vp->v_mount); + return 0; + } + if (!kvm_read_all(kd, (unsigned long)devfs_dirent.de_vnode, &vnode, + sizeof(vnode))) { + dprintf(stderr, "can't read vnode at %p\n", + (void *)devfs_dirent.de_vnode); + return 0; + } + fsp->fsid = (long)mount.mnt_stat.f_fsid.val[0]; + fsp->fileid = devfs_dirent.de_inode; + fsp->mode = (devfs_dirent.de_mode & ~S_IFMT) | S_IFCHR; + fsp->size = 0; + fsp->rdev = dev2udev(kd, vnode.v_rdev); + + return 1; +} + +int +nfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) +{ + struct nfsnode nfsnode; + mode_t mode; + + if (!kvm_read_all(kd, (unsigned long)VTONFS(vp), &nfsnode, + sizeof(nfsnode))) { + dprintf(stderr, "can't read nfsnode at %p\n", + (void *)VTONFS(vp)); + return 0; + } + fsp->fsid = nfsnode.n_vattr.va_fsid; + fsp->fileid = nfsnode.n_vattr.va_fileid; + fsp->size = nfsnode.n_size; + fsp->rdev = nfsnode.n_vattr.va_rdev; + mode = (mode_t)nfsnode.n_vattr.va_mode; + switch (vp->v_type) { + case VREG: + mode |= S_IFREG; + break; + case VDIR: + mode |= S_IFDIR; + break; + case VBLK: + mode |= S_IFBLK; + break; + case VCHR: + mode |= S_IFCHR; + break; + case VLNK: + mode |= S_IFLNK; + break; + case VSOCK: + mode |= S_IFSOCK; + break; + case VFIFO: + mode |= S_IFIFO; + break; + case VNON: + case VBAD: + case VMARKER: + return 0; + }; + fsp->mode = mode; + + return 1; +} + +/* + * Read the cdev structure in the kernel in order to work out the + * associated dev_t + */ +dev_t +dev2udev(kvm_t *kd, struct cdev *dev) +{ + struct cdev_priv priv; + + if (kvm_read_all(kd, (unsigned long)cdev2priv(dev), &priv, + sizeof(priv))) { + return ((dev_t)priv.cdp_inode); + } else { + dprintf(stderr, "can't convert cdev *%p to a dev_t\n", dev); + return -1; + } +} + +#ifdef ZFS +void * +getvnodedata(struct vnode *vp) +{ + return (vp->v_data); +} + +struct mount * +getvnodemount(struct vnode *vp) +{ + return (vp->v_mount); +} +#endif Added: projects/libprocstat/usr.bin/fstat/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/usr.bin/fstat/common.h Wed Jul 8 17:10:16 2009 (r195473) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __COMMON_H__ +#define __COMMON_H__ + +struct filestat { + long fsid; + long fileid; + mode_t mode; + u_long size; + dev_t rdev; +}; + +extern int vflg; + +dev_t dev2udev(kvm_t *kd, struct cdev *dev); +void dprintf(FILE *file, const char *fmt, ...); +char *kdevtoname(kvm_t *kd, struct cdev *dev); +int kvm_read_all(kvm_t *kd, unsigned long addr, void *buf, + size_t nbytes); + +/* + * Filesystems specific access routines. + */ +int devfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp); +int isofs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp); +int msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp); +int nfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp); +int ufs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp); +#ifdef ZFS +int zfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp); +void *getvnodedata(struct vnode *vp); +struct mount *getvnodemount(struct vnode *vp); +#endif + +#endif /* __COMMON_H__ */ Modified: projects/libprocstat/usr.bin/fstat/fstat.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/fstat.c Wed Jul 8 17:01:07 2009 (r195472) +++ projects/libprocstat/usr.bin/fstat/fstat.c Wed Jul 8 17:10:16 2009 (r195473) @@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "common.h" #include "fstat.h" #define TEXT -1 @@ -124,7 +125,6 @@ int fsflg, /* show files on same filesy uflg; /* show files open by a particular (effective) user */ int checkfile; /* true if restricting to particular files or filesystems */ int nflg; /* (numerical) display f.s. and rdev as dev_t */ -int vflg; /* display errors in locating kernel data objects etc... */ int mflg; /* include memory-mapped files */ @@ -148,9 +148,6 @@ static void fstat_sysctl(int, int); void dofiles(struct kinfo_proc *kp); void dommap(struct kinfo_proc *kp); void vtrans(struct vnode *vp, int i, int flag); -int ufs_filestat(struct vnode *vp, struct filestat *fsp); -int nfs_filestat(struct vnode *vp, struct filestat *fsp); -int devfs_filestat(struct vnode *vp, struct filestat *fsp); char *getmnton(struct mount *m); void pipetrans(struct pipe *pi, int i, int flag); void socktrans(struct socket *sock, int i); @@ -158,7 +155,6 @@ void ptstrans(struct tty *tp, int i, int void getinetproto(int number); int getfname(const char *filename); void usage(void); -char *kdevtoname(struct cdev *dev); int main(int argc, char **argv) @@ -338,7 +334,8 @@ dofiles(struct kinfo_proc *kp) if (kp->ki_fd == NULL) return; - if (!KVM_READ(kp->ki_fd, &filed, sizeof (filed))) { + if (!kvm_read_all(kd, (unsigned long)kp->ki_fd, &filed, + sizeof(filed))) { dprintf(stderr, "can't read filedesc at %p for pid %d\n", (void *)kp->ki_fd, Pid); return; @@ -379,7 +376,7 @@ dofiles(struct kinfo_proc *kp) return; ALLOC_OFILES(filed.fd_lastfile+1); - if (!KVM_READ(filed.fd_ofiles, ofiles, + if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles, (filed.fd_lastfile+1) * FPSIZE)) { dprintf(stderr, "can't read file structures at %p for pid %d\n", @@ -389,7 +386,8 @@ dofiles(struct kinfo_proc *kp) for (i = 0; i <= filed.fd_lastfile; i++) { if (ofiles[i] == NULL) continue; - if (!KVM_READ(ofiles[i], &file, sizeof (struct file))) { + if (!kvm_read_all(kd, (unsigned long)ofiles[i], &file, + sizeof(struct file))) { dprintf(stderr, "can't read file %d at %p for pid %d\n", i, (void *)ofiles[i], Pid); continue; @@ -437,7 +435,8 @@ dommap(struct kinfo_proc *kp) vm_object_t objp; int prot, fflags; - if (!KVM_READ(kp->ki_vmspace, &vmspace, sizeof(vmspace))) { + if (!kvm_read_all(kd, (unsigned long)kp->ki_vmspace, &vmspace, + sizeof(vmspace))) { dprintf(stderr, "can't read vmspace at %p for pid %d\n", (void *)kp->ki_vmspace, Pid); @@ -447,7 +446,8 @@ dommap(struct kinfo_proc *kp) for (entryp = map->header.next; entryp != &kp->ki_vmspace->vm_map.header; entryp = entry.next) { - if (!KVM_READ(entryp, &entry, sizeof(entry))) { + if (!kvm_read_all(kd, (unsigned long)entryp, &entry, + sizeof(entry))) { dprintf(stderr, "can't read vm_map_entry at %p for pid %d\n", (void *)entryp, Pid); @@ -461,7 +461,8 @@ dommap(struct kinfo_proc *kp) continue; for (; objp; objp = object.backing_object) { - if (!KVM_READ(objp, &object, sizeof(object))) { + if (!kvm_read_all(kd, (unsigned long)objp, &object, + sizeof(object))) { dprintf(stderr, "can't read vm_object at %p for pid %d\n", (void *)objp, Pid); @@ -483,16 +484,6 @@ dommap(struct kinfo_proc *kp) } } -char * -kdevtoname(struct cdev *dev) -{ - struct cdev si; - - if (!KVM_READ(dev, &si, sizeof si)) - return (NULL); - return (strdup(si.__si_namebuf)); -} - void vtrans(struct vnode *vp, int i, int flag) { @@ -502,13 +493,14 @@ vtrans(struct vnode *vp, int i, int flag const char *badtype, *filename; filename = badtype = NULL; - if (!KVM_READ(vp, &vn, sizeof (struct vnode))) { + if (!kvm_read_all(kd, (unsigned long)vp, &vn, sizeof(struct vnode))) { dprintf(stderr, "can't read vnode at %p for pid %d\n", (void *)vp, Pid); return; } - if (!KVM_READ(&vp->v_tag, &tagptr, sizeof tagptr) || - !KVM_READ(tagptr, tagstr, sizeof tagstr)) { + if (!kvm_read_all(kd, (unsigned long)&vp->v_tag, &tagptr, + sizeof(tagptr)) || !kvm_read_all(kd, (unsigned long)tagptr, tagstr, + sizeof(tagstr))) { dprintf(stderr, "can't read v_tag at %p for pid %d\n", (void *)vp, Pid); return; @@ -520,23 +512,23 @@ vtrans(struct vnode *vp, int i, int flag badtype = "bad"; else { if (!strcmp("ufs", tagstr)) { - if (!ufs_filestat(&vn, &fst)) + if (!ufs_filestat(kd, &vn, &fst)) badtype = "error"; } else if (!strcmp("devfs", tagstr)) { - if (!devfs_filestat(&vn, &fst)) + if (!devfs_filestat(kd, &vn, &fst)) badtype = "error"; } else if (!strcmp("nfs", tagstr)) { - if (!nfs_filestat(&vn, &fst)) + if (!nfs_filestat(kd, &vn, &fst)) badtype = "error"; } else if (!strcmp("msdosfs", tagstr)) { - if (!msdosfs_filestat(&vn, &fst)) + if (!msdosfs_filestat(kd, &vn, &fst)) badtype = "error"; } else if (!strcmp("isofs", tagstr)) { - if (!isofs_filestat(&vn, &fst)) + if (!isofs_filestat(kd, &vn, &fst)) badtype = "error"; #ifdef ZFS } else if (!strcmp("zfs", tagstr)) { - if (!zfs_filestat(&vn, &fst)) + if (!zfs_filestat(kd, &vn, &fst)) badtype = "error"; #endif } else { @@ -581,7 +573,7 @@ vtrans(struct vnode *vp, int i, int flag case VCHR: { char *name; - name = kdevtoname(vn.v_rdev); + name = kdevtoname(kd, vn.v_rdev); if (nflg || !name) printf(" %2d,%-2d", major(fst.rdev), minor(fst.rdev)); else { @@ -604,118 +596,6 @@ vtrans(struct vnode *vp, int i, int flag putchar('\n'); } -int -ufs_filestat(struct vnode *vp, struct filestat *fsp) -{ - struct inode inode; - - if (!KVM_READ(VTOI(vp), &inode, sizeof (inode))) { - dprintf(stderr, "can't read inode at %p for pid %d\n", - (void *)VTOI(vp), Pid); - return 0; - } - /* - * The st_dev from stat(2) is a dev_t. These kernel structures - * contain cdev pointers. We need to convert to dev_t to make - * comparisons - */ - fsp->fsid = dev2udev(inode.i_dev); - fsp->fileid = (long)inode.i_number; - fsp->mode = (mode_t)inode.i_mode; - fsp->size = (u_long)inode.i_size; -#if should_be_but_is_hard - /* XXX - need to load i_ump and i_din[12] from kernel memory */ - if (inode.i_ump->um_fstype == UFS1) - fsp->rdev = inode.i_din1->di_rdev; - else - fsp->rdev = inode.i_din2->di_rdev; -#else - fsp->rdev = 0; -#endif - - return 1; -} - -int -devfs_filestat(struct vnode *vp, struct filestat *fsp) -{ - struct devfs_dirent devfs_dirent; - struct mount mount; - struct vnode vnode; - - if (!KVM_READ(vp->v_data, &devfs_dirent, sizeof (devfs_dirent))) { - dprintf(stderr, "can't read devfs_dirent at %p for pid %d\n", - (void *)vp->v_data, Pid); - return 0; - } - if (!KVM_READ(vp->v_mount, &mount, sizeof (mount))) { - dprintf(stderr, "can't read mount at %p for pid %d\n", - (void *)vp->v_mount, Pid); - return 0; - } - if (!KVM_READ(devfs_dirent.de_vnode, &vnode, sizeof (vnode))) { - dprintf(stderr, "can't read vnode at %p for pid %d\n", - (void *)devfs_dirent.de_vnode, Pid); - return 0; - } - fsp->fsid = (long)mount.mnt_stat.f_fsid.val[0]; - fsp->fileid = devfs_dirent.de_inode; - fsp->mode = (devfs_dirent.de_mode & ~S_IFMT) | S_IFCHR; - fsp->size = 0; - fsp->rdev = dev2udev(vnode.v_rdev); - - return 1; -} - -int -nfs_filestat(struct vnode *vp, struct filestat *fsp) -{ - struct nfsnode nfsnode; - mode_t mode; - - if (!KVM_READ(VTONFS(vp), &nfsnode, sizeof (nfsnode))) { - dprintf(stderr, "can't read nfsnode at %p for pid %d\n", - (void *)VTONFS(vp), Pid); - return 0; - } - fsp->fsid = nfsnode.n_vattr.va_fsid; - fsp->fileid = nfsnode.n_vattr.va_fileid; - fsp->size = nfsnode.n_size; - fsp->rdev = nfsnode.n_vattr.va_rdev; - mode = (mode_t)nfsnode.n_vattr.va_mode; - switch (vp->v_type) { - case VREG: - mode |= S_IFREG; - break; - case VDIR: - mode |= S_IFDIR; - break; - case VBLK: - mode |= S_IFBLK; - break; - case VCHR: - mode |= S_IFCHR; - break; - case VLNK: - mode |= S_IFLNK; - break; - case VSOCK: - mode |= S_IFSOCK; - break; - case VFIFO: - mode |= S_IFIFO; - break; - case VNON: - case VBAD: - case VMARKER: - return 0; - }; - fsp->mode = mode; - - return 1; -} - - char * getmnton(struct mount *m) { @@ -730,7 +610,7 @@ getmnton(struct mount *m) for (mt = mhead; mt != NULL; mt = mt->next) if (m == mt->m) return (mt->mntonname); - if (!KVM_READ(m, &mount, sizeof(struct mount))) { + if (!kvm_read_all(kd, (unsigned long)m, &mount, sizeof(struct mount))) { warnx("can't read mount table at %p", (void *)m); return (NULL); } @@ -752,7 +632,7 @@ pipetrans(struct pipe *pi, int i, int fl PREFIX(i); /* fill in socket */ - if (!KVM_READ(pi, &pip, sizeof(struct pipe))) { + if (!kvm_read_all(kd, (unsigned long)pi, &pip, sizeof(struct pipe))) { dprintf(stderr, "can't read pipe at %p\n", (void *)pi); goto bad; } @@ -795,26 +675,29 @@ socktrans(struct socket *sock, int i) PREFIX(i); /* fill in socket */ - if (!KVM_READ(sock, &so, sizeof(struct socket))) { + if (!kvm_read_all(kd, (unsigned long)sock, &so, + sizeof(struct socket))) { dprintf(stderr, "can't read sock at %p\n", (void *)sock); goto bad; } /* fill in protosw entry */ - if (!KVM_READ(so.so_proto, &proto, sizeof(struct protosw))) { + if (!kvm_read_all(kd, (unsigned long)so.so_proto, &proto, + sizeof(struct protosw))) { dprintf(stderr, "can't read protosw at %p", (void *)so.so_proto); goto bad; } /* fill in domain */ - if (!KVM_READ(proto.pr_domain, &dom, sizeof(struct domain))) { + if (!kvm_read_all(kd, (unsigned long)proto.pr_domain, &dom, + sizeof(struct domain))) { dprintf(stderr, "can't read domain at %p\n", (void *)proto.pr_domain); goto bad; } - if ((len = kvm_read(kd, (u_long)dom.dom_name, dname, + if ((len = kvm_read(kd, (unsigned long)dom.dom_name, dname, sizeof(dname) - 1)) < 0) { dprintf(stderr, "can't read domain name at %p\n", (void *)dom.dom_name); @@ -905,13 +788,13 @@ ptstrans(struct tty *tp, int i, int flag PREFIX(i); /* Obtain struct tty. */ - if (!KVM_READ(tp, &tty, sizeof(struct tty))) { + if (!kvm_read_all(kd, (unsigned long)tp, &tty, sizeof(struct tty))) { dprintf(stderr, "can't read tty at %p\n", (void *)tp); goto bad; } /* Figure out the device name. */ - name = kdevtoname(tty.t_dev); + name = kdevtoname(kd, tty.t_dev); if (name == NULL) { dprintf(stderr, "can't determine tty name at %p\n", (void *)tp); goto bad; @@ -925,7 +808,7 @@ ptstrans(struct tty *tp, int i, int flag printf("* pseudo-terminal master "); if (nflg || !name) { - rdev = dev2udev(tty.t_dev); + rdev = dev2udev(kd, tty.t_dev); printf("%10d,%-2d", major(rdev), minor(rdev)); } else { printf("%10s", name); @@ -940,23 +823,6 @@ bad: } /* - * Read the cdev structure in the kernel in order to work out the - * associated dev_t - */ -dev_t -dev2udev(struct cdev *dev) -{ - struct cdev_priv priv; - - if (KVM_READ(cdev2priv(dev), &priv, sizeof priv)) { - return ((dev_t)priv.cdp_inode); - } else { - dprintf(stderr, "can't convert cdev *%p to a dev_t\n", dev); - return -1; - } -} - -/* * getinetproto -- * print name of protocol number */ @@ -995,20 +861,6 @@ getfname(const char *filename) return(1); } -#ifdef ZFS -void * -getvnodedata(struct vnode *vp) -{ - return (vp->v_data); -} - -struct mount * -getvnodemount(struct vnode *vp) -{ - return (vp->v_mount); -} -#endif - void usage(void) { Modified: projects/libprocstat/usr.bin/fstat/fstat.h ============================================================================== --- projects/libprocstat/usr.bin/fstat/fstat.h Wed Jul 8 17:01:07 2009 (r195472) +++ projects/libprocstat/usr.bin/fstat/fstat.h Wed Jul 8 17:10:16 2009 (r195473) @@ -36,15 +36,6 @@ #ifndef __FSTAT_H__ #define __FSTAT_H__ -/* - * a kvm_read that returns true if everything is read - */ -#define KVM_READ(kaddr, paddr, len) \ - ((len) < SSIZE_MAX && \ - kvm_read(kd, (u_long)(kaddr), (char *)(paddr), (len)) == (ssize_t)(len)) - -#define dprintf if (vflg) fprintf - typedef struct devs { struct devs *next; long fsid; @@ -52,29 +43,4 @@ typedef struct devs { const char *name; } DEVS; -struct filestat { - long fsid; - long fileid; - mode_t mode; - u_long size; - dev_t rdev; -}; - -/* Ugh */ -extern kvm_t *kd; -extern int vflg; -extern int Pid; - -dev_t dev2udev(struct cdev *dev); - -/* Additional filesystem types */ -int isofs_filestat(struct vnode *vp, struct filestat *fsp); -int msdosfs_filestat(struct vnode *vp, struct filestat *fsp); - -#ifdef ZFS -int zfs_filestat(struct vnode *vp, struct filestat *fsp); -void *getvnodedata(struct vnode *vp); -struct mount *getvnodemount(struct vnode *vp); -#endif - #endif /* __FSTAT_H__ */ Modified: projects/libprocstat/usr.bin/fstat/msdosfs.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/msdosfs.c Wed Jul 8 17:01:07 2009 (r195472) +++ projects/libprocstat/usr.bin/fstat/msdosfs.c Wed Jul 8 17:10:16 2009 (r195473) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); */ #define VTODE(vp) ((struct denode *)(vp)->v_data) +#include "common.h" #include "fstat.h" struct dosmount { @@ -73,7 +74,7 @@ struct dosmount { }; int -msdosfs_filestat(struct vnode *vp, struct filestat *fsp) +msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) { struct denode denode; static struct dosmount *mounts; @@ -81,9 +82,9 @@ msdosfs_filestat(struct vnode *vp, struc u_long dirsperblk; int fileid; - if (!KVM_READ(VTODE(vp), &denode, sizeof (denode))) { - dprintf(stderr, "can't read denode at %p for pid %d\n", - (void *)VTODE(vp), Pid); + if (!kvm_read_all(kd, (unsigned long)VTODE(vp), &denode, + sizeof(denode))) { + dprintf(stderr, "can't read denode at %p\n", (void *)VTODE(vp)); return 0; } @@ -98,11 +99,12 @@ msdosfs_filestat(struct vnode *vp, struc if (!mnt) { if ((mnt = malloc(sizeof(struct dosmount))) == NULL) err(1, NULL); - if (!KVM_READ(denode.de_pmp, &mnt->data, sizeof mnt->data)) { + if (!kvm_read_all(kd, (unsigned long)denode.de_pmp, + &mnt->data, sizeof(mnt->data))) { free(mnt); dprintf(stderr, - "can't read mount info at %p for pid %d\n", - (void *)denode.de_pmp, Pid); + "can't read mount info at %p\n", + (void *)denode.de_pmp); return 0; } mnt->next = mounts; @@ -110,7 +112,7 @@ msdosfs_filestat(struct vnode *vp, struc mnt->kptr = denode.de_pmp; } - fsp->fsid = dev2udev(mnt->data.pm_dev); + fsp->fsid = dev2udev(kd, mnt->data.pm_dev); fsp->mode = 0555; fsp->mode |= denode.de_Attributes & ATTR_READONLY ? 0 : 0222; fsp->mode &= mnt->data.pm_mask; Modified: projects/libprocstat/usr.bin/fstat/zfs.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/zfs.c Wed Jul 8 17:01:07 2009 (r195472) +++ projects/libprocstat/usr.bin/fstat/zfs.c Wed Jul 8 17:10:16 2009 (r195473) @@ -51,7 +51,8 @@ #define ZFS #undef dprintf -#include +#include "common.h" +#include "fstat.h" /* * Offset calculations that are used to get data from znode without having the @@ -61,7 +62,7 @@ #define LOCATION_ZPHYS(zsize) ((zsize) - (2 * sizeof(void *) + sizeof(struct task))) int -zfs_filestat(struct vnode *vp, struct filestat *fsp) +zfs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) { znode_phys_t zphys; @@ -86,9 +87,9 @@ zfs_filestat(struct vnode *vp, struct fi /* Since we have problems including vnode.h, we'll use the wrappers. */ vnodeptr = getvnodedata(vp); - if (!KVM_READ(vnodeptr, znodeptr, (size_t)size)) { - dprintf(stderr, "can't read znode at %p for pid %d\n", - (void *)vnodeptr, Pid); + if (!kvm_read_all(kd, (unsigned long)vnodeptr, znodeptr, + (size_t)size)) { + dprintf(stderr, "can't read znode at %p\n", (void *)vnodeptr); goto bad; } @@ -103,17 +104,16 @@ zfs_filestat(struct vnode *vp, struct fi zid = (uint64_t *)(dataptr + LOCATION_ZID); zphys_addr = *(void **)(dataptr + LOCATION_ZPHYS(size)); - if (!KVM_READ(zphys_addr, &zphys, sizeof(zphys))) { - dprintf(stderr, "can't read znode_phys at %p for pid %d\n", - zphys_addr, Pid); + if (!kvm_read_all(kd, (unsigned long)zphys_addr, &zphys, + sizeof(zphys))) { + dprintf(stderr, "can't read znode_phys at %p\n", zphys_addr); goto bad; } /* Get the mount pointer, and read from the address. */ mountptr = getvnodemount(vp); - if (!KVM_READ(mountptr, &mount, sizeof(mount))) { - dprintf(stderr, "can't read mount at %p for pid %d\n", - (void *)mountptr, Pid); + if (!kvm_read_all(kd, (unsigned long)mountptr, &mount, sizeof(mount))) { + dprintf(stderr, "can't read mount at %p\n", (void *)mountptr); goto bad; } From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 17:20:53 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D83471065670; Wed, 8 Jul 2009 17:20:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C72A58FC16; Wed, 8 Jul 2009 17:20:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68HKrnv057988; Wed, 8 Jul 2009 17:20:53 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68HKrWi057985; Wed, 8 Jul 2009 17:20:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200907081720.n68HKrWi057985@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 8 Jul 2009 17:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195474 - projects/mips/sys/mips/atheros X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 17:20:54 -0000 Author: gonzo Date: Wed Jul 8 17:20:53 2009 New Revision: 195474 URL: http://svn.freebsd.org/changeset/base/195474 Log: - Fix PCI routing code Modified: projects/mips/sys/mips/atheros/ar71xx_pci.c projects/mips/sys/mips/atheros/ar71xxreg.h Modified: projects/mips/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- projects/mips/sys/mips/atheros/ar71xx_pci.c Wed Jul 8 17:10:16 2009 (r195473) +++ projects/mips/sys/mips/atheros/ar71xx_pci.c Wed Jul 8 17:20:53 2009 (r195474) @@ -513,8 +513,11 @@ ar71xx_pci_maxslots(device_t dev) static int ar71xx_pci_route_interrupt(device_t pcib, device_t device, int pin) { + if (pci_get_slot(device) < AR71XX_PCI_BASE_SLOT) + panic("%s: PCI slot %d is less then AR71XX_PCI_BASE_SLOT", + __func__, pci_get_slot(device)); - return (pin); + return (pci_get_slot(device) - AR71XX_PCI_BASE_SLOT); } static device_method_t ar71xx_pci_methods[] = { Modified: projects/mips/sys/mips/atheros/ar71xxreg.h ============================================================================== --- projects/mips/sys/mips/atheros/ar71xxreg.h Wed Jul 8 17:10:16 2009 (r195473) +++ projects/mips/sys/mips/atheros/ar71xxreg.h Wed Jul 8 17:20:53 2009 (r195474) @@ -42,6 +42,10 @@ #define AR71XX_PCI_IRQ_START 0 #define AR71XX_PCI_IRQ_END 2 #define AR71XX_PCI_NIRQS 3 +/* + * PCI devices slots are starting from this number + */ +#define AR71XX_PCI_BASE_SLOT 17 /* PCI config registers */ #define AR71XX_PCI_LCONF_CMD 0x17010000 From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 17:43:59 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E406106566C; Wed, 8 Jul 2009 17:43:59 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DA2A8FC13; Wed, 8 Jul 2009 17:43:59 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68HhwDT058481; Wed, 8 Jul 2009 17:43:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68Hhwqe058479; Wed, 8 Jul 2009 17:43:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907081743.n68Hhwqe058479@svn.freebsd.org> From: Rui Paulo Date: Wed, 8 Jul 2009 17:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195475 - projects/mesh11s/sbin/ifconfig X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 17:43:59 -0000 Author: rpaulo Date: Wed Jul 8 17:43:58 2009 New Revision: 195475 URL: http://svn.freebsd.org/changeset/base/195475 Log: Remove more hwmpttl stuff. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 17:20:53 2009 (r195474) +++ projects/mesh11s/sbin/ifconfig/ifieee80211.c Wed Jul 8 17:43:58 2009 (r195475) @@ -5238,7 +5238,6 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD_ARG("meshrt:del", set80211delmeshrt), DEF_CMD_ARG("hwmprootmode", set80211hwmprootmode), DEF_CMD_ARG("hwmpmaxhops", set80211hwmpmaxhops), - DEF_CMD_ARG("hwmptll", set80211hwmpttl), /* vap cloning support */ DEF_CLONE_CMD_ARG("wlanaddr", set80211clone_wlanaddr), From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 18:24:50 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61E801065672; Wed, 8 Jul 2009 18:24:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id D8BDA8FC13; Wed, 8 Jul 2009 18:24:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-90.carlnfd1.nsw.optusnet.com.au (c122-107-120-90.carlnfd1.nsw.optusnet.com.au [122.107.120.90]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n68IOkrW027395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 9 Jul 2009 04:24:47 +1000 Date: Thu, 9 Jul 2009 04:24:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Rui Paulo In-Reply-To: <200907081526.n68FQYDb055185@svn.freebsd.org> Message-ID: <20090709041145.G46111@delplex.bde.org> References: <200907081526.n68FQYDb055185@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 18:24:50 -0000 On Wed, 8 Jul 2009, Rui Paulo wrote: > Log: > Remove some spurious __packed attributes. Are they spurious? All uses of __packed are wrong, but they might still help work around ABI bugs. > Modified: > projects/mesh11s/sys/net80211/ieee80211_mesh.h > > Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h > ============================================================================== > --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 15:25:27 2009 (r195459) > +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 15:26:34 2009 (r195460) > @@ -46,7 +46,7 @@ struct ieee80211_meshconf_ie { > uint8_t conf_authid[4]; /* Auth. Protocol ID */ > uint8_t conf_form; /* Formation Information */ > uint8_t conf_cap; > -} __packed; > +}; Broken ABIs (e.g., arm?) may add padding at the end of structs, so it doesn't help for all members of a struct to have type uint8_t. I think arm always pads to make the size a multiple of 4. The natural size of the above struct is 6, so it seems to need __packed. Bruce From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 18:30:45 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC0421065675; Wed, 8 Jul 2009 18:30:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB548FC29; Wed, 8 Jul 2009 18:30:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-90.carlnfd1.nsw.optusnet.com.au (c122-107-120-90.carlnfd1.nsw.optusnet.com.au [122.107.120.90]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n68IUfge012460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 9 Jul 2009 04:30:43 +1000 Date: Thu, 9 Jul 2009 04:30:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Rui Paulo In-Reply-To: <200907081604.n68G4F0g056097@svn.freebsd.org> Message-ID: <20090709042523.B46144@delplex.bde.org> References: <200907081604.n68G4F0g056097@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195463 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 18:30:46 -0000 On Wed, 8 Jul 2009, Rui Paulo wrote: > Log: > Revert 195460: gcc does evil things without __packed. Oops, I asked if __packed was really spurious before seeing this. gcc does evil things with __packed (starting with it not being a syntax error). Did it only break on arm? Bruce From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 18:37:05 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57ACF1065687; Wed, 8 Jul 2009 18:37:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4733C8FC1B; Wed, 8 Jul 2009 18:37:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68Ib5Gx059670; Wed, 8 Jul 2009 18:37:05 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68Ib5rq059668; Wed, 8 Jul 2009 18:37:05 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907081837.n68Ib5rq059668@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 8 Jul 2009 18:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195476 - projects/libprocstat/usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 18:37:05 -0000 Author: stas Date: Wed Jul 8 18:37:05 2009 New Revision: 195476 URL: http://svn.freebsd.org/changeset/base/195476 Log: - Add dev id detection support for cd9660 filesystem. Obtained from: fuser Modified: projects/libprocstat/usr.bin/fstat/cd9660.c Modified: projects/libprocstat/usr.bin/fstat/cd9660.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/cd9660.c Wed Jul 8 17:43:58 2009 (r195475) +++ projects/libprocstat/usr.bin/fstat/cd9660.c Wed Jul 8 18:37:05 2009 (r195476) @@ -50,6 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define _KERNEL +#include +#undef _KERNEL #include #include @@ -61,20 +64,25 @@ int isofs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) { struct iso_node isonode; + struct iso_mnt mnt; if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &isonode, sizeof(isonode))) { dprintf(stderr, "can't read iso_node at %p\n", (void *)VTOI(vp)); - return 0; + return (0); } -#if 0 - fsp->fsid = dev2udev(isonode.i_dev); -#endif + if (!kvm_read_all(kd, (unsigned long)isonode.i_mnt, &mnt, + sizeof(mnt))) { + dprintf(stderr, "can't read iso_mnt at %p\n", + (void *)VTOI(vp)); + return (0); + } + fsp->fsid = dev2udev(kd, mnt.im_dev); fsp->mode = (mode_t)isonode.inode.iso_mode; fsp->rdev = isonode.inode.iso_rdev; fsp->fileid = (long)isonode.i_number; fsp->size = (u_long)isonode.i_size; - return 1; + return (1); } From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 22:28:36 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A4FD106566C; Wed, 8 Jul 2009 22:28:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 777728FC24; Wed, 8 Jul 2009 22:28:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68MSaFr064104; Wed, 8 Jul 2009 22:28:36 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68MSaGb064101; Wed, 8 Jul 2009 22:28:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200907082228.n68MSaGb064101@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 8 Jul 2009 22:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195478 - in projects/mips/sys/mips: include mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 22:28:36 -0000 Author: gonzo Date: Wed Jul 8 22:28:36 2009 New Revision: 195478 URL: http://svn.freebsd.org/changeset/base/195478 Log: - Port busdma code from FreeBSD/arm. This is more mature version that takes into account all limitation to DMA memory (boundaries, alignment) and implements bounce pages. - Add BUS_DMASYNC_POSTREAD case to bus_dmamap_sync_buf Modified: projects/mips/sys/mips/include/md_var.h projects/mips/sys/mips/mips/busdma_machdep.c Modified: projects/mips/sys/mips/include/md_var.h ============================================================================== --- projects/mips/sys/mips/include/md_var.h Wed Jul 8 21:45:48 2009 (r195477) +++ projects/mips/sys/mips/include/md_var.h Wed Jul 8 22:28:36 2009 (r195478) @@ -70,4 +70,7 @@ void mips_proc0_init(void); /* Platform call-downs. */ void platform_identify(void); +extern int busdma_swi_pending; +void busdma_swi(void); + #endif /* !_MACHINE_MD_VAR_H_ */ Modified: projects/mips/sys/mips/mips/busdma_machdep.c ============================================================================== --- projects/mips/sys/mips/mips/busdma_machdep.c Wed Jul 8 21:45:48 2009 (r195477) +++ projects/mips/sys/mips/mips/busdma_machdep.c Wed Jul 8 22:28:36 2009 (r195478) @@ -23,50 +23,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred */ -/*- - * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, - * NASA Ames Research Center. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* $NetBSD: bus_dma.c,v 1.17 2006/03/01 12:38:11 yamt Exp $ */ - #include __FBSDID("$FreeBSD$"); +/* + * MIPS bus dma support routines + */ + #include #include #include @@ -79,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -88,6 +55,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#define MAX_BPAGES 64 +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 + +struct bounce_zone; struct bus_dma_tag { bus_dma_tag_t parent; @@ -105,12 +79,47 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; - /* XXX: machine-dependent fields */ - vm_offset_t _physbase; - vm_offset_t _wbase; - vm_offset_t _wsize; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + vm_offset_t vaddr_nocache; /* kva of bounce buffer uncached */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; }; +static struct mtx bounce_lock; +static int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + #define DMAMAP_LINEAR 0x1 #define DMAMAP_MBUF 0x2 #define DMAMAP_UIO 0x4 @@ -118,6 +127,9 @@ struct bus_dma_tag { #define DMAMAP_TYPE_MASK (DMAMAP_LINEAR|DMAMAP_MBUF|DMAMAP_UIO) #define DMAMAP_COHERENT 0x8 struct bus_dmamap { + struct bp_list bpages; + int pagesneeded; + int pagesreserved; bus_dma_tag_t dmat; int flags; void *buffer; @@ -125,8 +137,15 @@ struct bus_dmamap { void *allocbuffer; TAILQ_ENTRY(bus_dmamap) freelist; int len; + STAILQ_ENTRY(bus_dmamap) links; + bus_dmamap_callback_t *callback; + void *callback_arg; + }; +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; + static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = TAILQ_HEAD_INITIALIZER(dmamap_freelist); @@ -137,6 +156,45 @@ static struct mtx busdma_mtx; MTX_SYSINIT(busdma_mtx, &busdma_mtx, "busdma lock", MTX_DEF); +static void init_bounce_pages(void *dummy); +static int alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); + +/* Default tag, as most drivers provide no parent tag. */ +bus_dma_tag_t mips_root_dma_tag; + +/* + * Return true if a match is made. + * + * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. + * + * If paddr is within the bounds of the dma tag then call the filter callback + * to check for a match, if there is no filter callback then assume a match. + */ +static int +run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) +{ + int retval; + + retval = 0; + + do { + if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) + || ((paddr & (dmat->alignment - 1)) != 0)) + && (dmat->filter == NULL + || (*dmat->filter)(dmat->filterarg, paddr) != 0)) + retval = 1; + + dmat = dmat->parent; + } while (retval == 0 && dmat != NULL); + return (retval); +} + static void mips_dmamap_freelist_init(void *dummy) { @@ -157,6 +215,19 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma bus_dmamap_t map, void *buf, bus_size_t buflen, struct pmap *pmap, int flags, vm_offset_t *lastaddrp, int *segp); +static __inline int +_bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr) +{ + int i; + for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { + if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) + || (lowaddr < phys_avail[i] && + highaddr > phys_avail[i])) + return (1); + } + return (0); +} + /* * Convenience function for manipulating driver locks from busdma (during * busdma_swi, for example). Drivers that don't provide their own locks @@ -213,6 +284,7 @@ _busdma_alloc_dmamap(void) map->flags = DMAMAP_ALLOCATED; } else map->flags = 0; + STAILQ_INIT(&map->bpages); return (map); } @@ -228,6 +300,11 @@ _busdma_free_dmamap(bus_dmamap_t map) } } +/* + * Allocate a device specific dma_tag. + */ +#define SEG_NB 1024 + int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, bus_size_t boundary, bus_addr_t lowaddr, @@ -238,16 +315,12 @@ bus_dma_tag_create(bus_dma_tag_t parent, { bus_dma_tag_t newtag; int error = 0; - - /* Basic sanity checking */ - if (boundary != 0 && boundary < maxsegsz) - maxsegsz = boundary; - /* Return a NULL tag on failure */ *dmat = NULL; + if (!parent) + parent = mips_root_dma_tag; - newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, - M_ZERO | M_NOWAIT); + newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_NOWAIT); if (newtag == NULL) { CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, 0, error); @@ -257,21 +330,16 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->parent = parent; newtag->alignment = alignment; newtag->boundary = boundary; - newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + - (PAGE_SIZE - 1); + newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_offset_t)highaddr) + (PAGE_SIZE - 1); newtag->filter = filter; newtag->filterarg = filterarg; - newtag->maxsize = maxsize; - newtag->nsegments = nsegments; + newtag->maxsize = maxsize; + newtag->nsegments = nsegments; newtag->maxsegsz = maxsegsz; newtag->flags = flags; newtag->ref_count = 1; /* Count ourself */ newtag->map_count = 0; - newtag->_wbase = 0; - newtag->_physbase = 0; - /* XXXMIPS: Should we limit window size to amount of physical memory */ - newtag->_wsize = MIPS_KSEG1_START - MIPS_KSEG0_START; if (lockfunc != NULL) { newtag->lockfunc = lockfunc; newtag->lockfuncarg = lockfuncarg; @@ -279,36 +347,68 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } - - /* Take into account any restrictions imposed by our parent tag */ - if (parent != NULL) { - newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); - newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); + /* + * Take into account any restrictions imposed by our parent tag + */ + if (parent != NULL) { + newtag->lowaddr = min(parent->lowaddr, newtag->lowaddr); + newtag->highaddr = max(parent->highaddr, newtag->highaddr); if (newtag->boundary == 0) newtag->boundary = parent->boundary; else if (parent->boundary != 0) - newtag->boundary = MIN(parent->boundary, + newtag->boundary = min(parent->boundary, newtag->boundary); - if (newtag->filter == NULL) { - /* - * Short circuit looking at our parent directly - * since we have encapsulated all of its information - */ - newtag->filter = parent->filter; - newtag->filterarg = parent->filterarg; - newtag->parent = parent->parent; + if ((newtag->filter != NULL) || + ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + if (newtag->filter == NULL) { + /* + * Short circuit looking at our parent directly + * since we have encapsulated all of its information + */ + newtag->filter = parent->filter; + newtag->filterarg = parent->filterarg; + newtag->parent = parent->parent; } if (newtag->parent != NULL) atomic_add_int(&parent->ref_count, 1); } + if (_bus_dma_can_bounce(newtag->lowaddr, newtag->highaddr) + || newtag->alignment > 1) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + + if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) - bz->total_bpages; - if (error != 0) { + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->flags |= BUS_DMA_MIN_ALLOC_COMP; + } else + newtag->bounce_zone = NULL; + if (error != 0) free(newtag, M_DEVBUF); - } else { + else *dmat = newtag; - } CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, (newtag != NULL ? newtag->flags : 0), error); + return (error); } @@ -346,6 +446,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) return (0); } +#include /* * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. @@ -354,9 +455,7 @@ int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { bus_dmamap_t newmap; -#ifdef KTR int error = 0; -#endif newmap = _busdma_alloc_dmamap(); if (newmap == NULL) { @@ -365,13 +464,60 @@ bus_dmamap_create(bus_dma_tag_t dmat, in } *mapp = newmap; newmap->dmat = dmat; + newmap->allocbuffer = NULL; dmat->map_count++; + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->flags & BUS_DMA_COULD_BOUNCE) { + + /* Must bounce */ + struct bounce_zone *bz; + int maxpages; + + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) { + _busdma_free_dmamap(newmap); + *mapp = NULL; + return (error); + } + } + bz = dmat->bounce_zone; + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + maxpages = MAX_BPAGES; + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { + int pages; + + pages = MAX(atop(dmat->maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { + if (error == 0) + dmat->flags |= BUS_DMA_MIN_ALLOC_COMP; + } else { + error = 0; + } + } + bz->map_count++; + } CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, error); return (0); - } /* @@ -381,7 +527,15 @@ bus_dmamap_create(bus_dma_tag_t dmat, in int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { + _busdma_free_dmamap(map); + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); @@ -417,7 +571,10 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi *mapp = newmap; newmap->dmat = dmat; - if (dmat->maxsize <= PAGE_SIZE) { + if (dmat->maxsize <= PAGE_SIZE && + (dmat->alignment < dmat->maxsize) && + !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr) && + !(flags & BUS_DMA_COHERENT)) { *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); } else { /* @@ -440,7 +597,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi maxphys = dmat->lowaddr; } *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags, - 0ul, maxphys, dmat->alignment? dmat->alignment : 1ul, + 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, dmat->boundary); } if (*vaddr == NULL) { @@ -451,22 +608,37 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi *mapp = NULL; return (ENOMEM); } + if (flags & BUS_DMA_COHERENT) { void *tmpaddr = (void *)*vaddr; + unsigned char *buf1 = (void *)*vaddr; if (tmpaddr) { + int gi; tmpaddr = (void *)MIPS_PHYS_TO_KSEG1(vtophys(tmpaddr)); + unsigned char *buf2 = tmpaddr; + unsigned char *buf3 = (void + *)MIPS_PHYS_TO_KSEG0(vtophys(tmpaddr)); newmap->origbuffer = *vaddr; newmap->allocbuffer = tmpaddr; mips_dcache_wbinv_range((vm_offset_t)*vaddr, dmat->maxsize); *vaddr = tmpaddr; + for (gi = 0; gi < dmat->maxsize; gi++) { + if (buf1[gi] != buf2[gi]) + panic("cache fucked up\n"); + + if (buf1[gi] != buf3[gi]) + panic("cache fucked up2\n"); + } } else newmap->origbuffer = newmap->allocbuffer = NULL; - } else + } else { + unsigned char *buf1 = (void *)*vaddr; newmap->origbuffer = newmap->allocbuffer = NULL; - return (0); + } + return (0); } /* @@ -481,7 +653,9 @@ bus_dmamem_free(bus_dma_tag_t dmat, void ("Trying to freeing the wrong DMA buffer")); vaddr = map->origbuffer; } - if (dmat->maxsize <= PAGE_SIZE) + if (dmat->maxsize <= PAGE_SIZE && + dmat->alignment < dmat->maxsize && + !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr)) free(vaddr, M_DEVBUF); else { contigfree(vaddr, dmat->maxsize, M_DEVBUF); @@ -489,7 +663,60 @@ bus_dmamem_free(bus_dma_tag_t dmat, void dmat->map_count--; _busdma_free_dmamap(map); CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); +} +static int +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) +{ + vm_offset_t vaddr; + vm_offset_t vendaddr; + bus_addr_t paddr; + + if ((map->pagesneeded == 0)) { + CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", + dmat->lowaddr, dmat->boundary, dmat->alignment); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", + map, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = trunc_page((vm_offset_t)buf); + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + KASSERT(kernel_pmap == pmap, ("pmap is not kernel pmap")); + paddr = pmap_kextract(vaddr); + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + run_filter(dmat, paddr) != 0) + map->pagesneeded++; + vaddr += PAGE_SIZE; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } + + /* Reserve Necessary Bounce Pages */ + if (map->pagesneeded != 0) { + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, + map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + } + + return (0); } /* @@ -504,8 +731,7 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma int flags, vm_offset_t *lastaddrp, int *segp) { bus_size_t sgsize; - bus_size_t bmask; - vm_offset_t curaddr, lastaddr; + bus_addr_t curaddr, lastaddr, baddr, bmask; vm_offset_t vaddr = (vm_offset_t)buf; int seg; int error = 0; @@ -513,36 +739,48 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); + if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, + flags); + if (error) + return (error); + } + CTR3(KTR_BUSDMA, "lowaddr= %d boundary= %d, " + "alignment= %d", dmat->lowaddr, dmat->boundary, dmat->alignment); + for (seg = *segp; buflen > 0 ; ) { /* * Get the physical address for this segment. + * + * XXX Don't support checking for coherent mappings + * XXX in user address space. */ KASSERT(kernel_pmap == pmap, ("pmap is not kernel pmap")); curaddr = pmap_kextract(vaddr); /* - * If we're beyond the current DMA window, indicate - * that and try to fall back onto something else. - */ - if (curaddr < dmat->_physbase || - curaddr >= (dmat->_physbase + dmat->_wsize)) - return (EINVAL); - - /* - * In a valid DMA range. Translate the physical - * memory address to an address in the DMA window. - */ - curaddr = (curaddr - dmat->_physbase) + dmat->_wbase; - - - /* * Compute the segment size, and adjust counts. */ sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); + if (sgsize > dmat->maxsegsz) + sgsize = dmat->maxsegsz; if (buflen < sgsize) sgsize = buflen; /* + * Make sure we don't cross any boundaries. + */ + if (dmat->boundary > 0) { + baddr = (curaddr + dmat->boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + curaddr = add_bounce_page(dmat, map, vaddr, sgsize); + } + + /* * Insert chunk into a segment, coalescing with * the previous segment if possible. */ @@ -569,14 +807,15 @@ segdone: *segp = seg; *lastaddrp = lastaddr; + if (map->flags & DMAMAP_COHERENT) + panic("not coherent\n"); /* * Did we fit? */ if (buflen != 0) - error = EFBIG; - - return error; + error = EFBIG; /* XXX better return value here? */ + return (error); } /* @@ -597,14 +836,17 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ KASSERT(dmat != NULL, ("dmatag is NULL")); KASSERT(map != NULL, ("dmamap is NULL")); + map->callback = callback; + map->callback_arg = callback_arg; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_LINEAR|DMAMAP_COHERENT; + map->flags |= DMAMAP_LINEAR; map->buffer = buf; map->len = buflen; error = bus_dmamap_load_buffer(dmat, dm_segments, map, buf, buflen, kernel_pmap, flags, &lastaddr, &nsegs); - + if (error == EINPROGRESS) + return (error); if (error) (*callback)(callback_arg, NULL, 0, error); else @@ -613,8 +855,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, nsegs + 1, error); - return (0); - + return (error); } /* @@ -635,10 +876,9 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, M_ASSERTPKTHDR(m0); map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_COHERENT; + map->flags |= DMAMAP_MBUF; map->buffer = m0; map->len = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { vm_offset_t lastaddr = 0; struct mbuf *m; @@ -676,16 +916,14 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm int flags) { int error = 0; - M_ASSERTPKTHDR(m0); flags |= BUS_DMA_NOWAIT; *nsegs = -1; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_COHERENT; - map->buffer = m0; + map->flags |= DMAMAP_MBUF; + map->buffer = m0; map->len = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { vm_offset_t lastaddr = 0; struct mbuf *m; @@ -693,8 +931,9 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, segs, map, - m->m_data, m->m_len, - kernel_pmap, flags, &lastaddr, nsegs); + m->m_data, m->m_len, + kernel_pmap, flags, &lastaddr, + nsegs); map->len += m->m_len; } } @@ -702,12 +941,11 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm error = EINVAL; } + /* XXX FIXME: Having to increment nsegs is really annoying */ ++*nsegs; CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, error, *nsegs); - return (error); - } /* @@ -718,9 +956,65 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { + vm_offset_t lastaddr = 0; +#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT + bus_dma_segment_t dm_segments[dmat->nsegments]; +#else + bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; +#endif + int nsegs, i, error; + bus_size_t resid; + struct iovec *iov; + struct pmap *pmap; - panic("Unimplemented %s at %s:%d\n", __func__, __FILE__, __LINE__); - return (0); + resid = uio->uio_resid; + iov = uio->uio_iov; + map->flags &= ~DMAMAP_TYPE_MASK; + map->flags |= DMAMAP_UIO; + map->buffer = uio; + map->len = 0; + + if (uio->uio_segflg == UIO_USERSPACE) { + KASSERT(uio->uio_td != NULL, + ("bus_dmamap_load_uio: USERSPACE but no proc")); + /* XXX: pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); */ + panic("can't do it yet"); + } else + pmap = kernel_pmap; + + error = 0; + nsegs = -1; + for (i = 0; i < uio->uio_iovcnt && resid != 0 && !error; i++) { + /* + * Now at the first iovec to load. Load each iovec + * until we have exhausted the residual count. + */ + bus_size_t minlen = + resid < iov[i].iov_len ? resid : iov[i].iov_len; + caddr_t addr = (caddr_t) iov[i].iov_base; + + if (minlen > 0) { + error = bus_dmamap_load_buffer(dmat, dm_segments, map, + addr, minlen, pmap, flags, &lastaddr, &nsegs); + + map->len += minlen; + resid -= minlen; + } + } + + if (error) { + /* + * force "no valid mappings" on error in callback. + */ + (*callback)(callback_arg, dm_segments, 0, 0, error); + } else { + (*callback)(callback_arg, dm_segments, nsegs+1, + uio->uio_resid, error); + } + + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, nsegs + 1); + return (error); } /* @@ -729,21 +1023,31 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, void _bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) { + struct bounce_page *bpage; + map->flags &= ~DMAMAP_TYPE_MASK; + while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + STAILQ_REMOVE_HEAD(&map->bpages, links); + free_bounce_page(dmat, bpage); + } return; } -static __inline void +static void bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op) { - switch (op) { + case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: + case BUS_DMASYNC_POSTREAD: + mips_dcache_inv_range((vm_offset_t)buf, len); + break; + case BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE: mips_dcache_wbinv_range((vm_offset_t)buf, len); break; case BUS_DMASYNC_PREREAD: -#if 1 +#if 0 mips_dcache_wbinv_range((vm_offset_t)buf, len); #else mips_dcache_inv_range((vm_offset_t)buf, len); @@ -756,6 +1060,52 @@ bus_dmamap_sync_buf(void *buf, int len, } } +static void +_bus_dmamap_sync_bp(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) +{ + struct bounce_page *bpage; + + panic("sync bp"); + STAILQ_FOREACH(bpage, &map->bpages, links) { + if (op & BUS_DMASYNC_PREWRITE) { + bcopy((void *)bpage->datavaddr, + (void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : bpage->vaddr), + bpage->datacount); + if (bpage->vaddr_nocache == 0) { + mips_dcache_wb_range(bpage->vaddr, + bpage->datacount); + } + dmat->bounce_zone->total_bounced++; + } + if (op & BUS_DMASYNC_POSTREAD) { + if (bpage->vaddr_nocache == 0) { + mips_dcache_inv_range(bpage->vaddr, + bpage->datacount); + } + bcopy((void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : bpage->vaddr), + (void *)bpage->datavaddr, bpage->datacount); + dmat->bounce_zone->total_bounced++; + } + } +} + +static __inline int +_bus_dma_buf_is_in_bp(bus_dmamap_t map, void *buf, int len) +{ + struct bounce_page *bpage; + + STAILQ_FOREACH(bpage, &map->bpages, links) { + if ((vm_offset_t)buf >= bpage->datavaddr && + (vm_offset_t)buf + len <= bpage->datavaddr + + bpage->datacount) + return (1); + } + return (0); + +} + void _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) { @@ -764,51 +1114,23 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus int resid; struct iovec *iov; - - /* - * Mixing PRE and POST operations is not allowed. - */ - if ((op & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) != 0 && - (op & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0) - panic("_bus_dmamap_sync: mix PRE and POST"); - - /* - * Since we're dealing with a virtually-indexed, write-back - * cache, we need to do the following things: - * - * PREREAD -- Invalidate D-cache. Note we might have - * to also write-back here if we have to use an Index - * op, or if the buffer start/end is not cache-line aligned. - * - * PREWRITE -- Write-back the D-cache. If we have to use - * an Index op, we also have to invalidate. Note that if - * we are doing PREREAD|PREWRITE, we can collapse everything - * into a single op. - * - * POSTREAD -- Nothing. - * - * POSTWRITE -- Nothing. - */ - - /* - * Flush the write buffer. - * XXX Is this always necessary? - */ - mips_wbflush(); - - op &= (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); - if (op == 0) + if (op == BUS_DMASYNC_POSTWRITE) + return; + if (STAILQ_FIRST(&map->bpages)) + _bus_dmamap_sync_bp(dmat, map, op); + if (map->flags & DMAMAP_COHERENT) return; - CTR3(KTR_BUSDMA, "%s: op %x flags %x", __func__, op, map->flags); switch(map->flags & DMAMAP_TYPE_MASK) { case DMAMAP_LINEAR: - bus_dmamap_sync_buf(map->buffer, map->len, op); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 23:09:04 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A13BA106564A; Wed, 8 Jul 2009 23:09:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7EC8FC0A; Wed, 8 Jul 2009 23:09:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68N94uq064970; Wed, 8 Jul 2009 23:09:04 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68N94kf064962; Wed, 8 Jul 2009 23:09:04 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907082309.n68N94kf064962@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 8 Jul 2009 23:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195479 - projects/libprocstat/usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 23:09:04 -0000 Author: stas Date: Wed Jul 8 23:09:04 2009 New Revision: 195479 URL: http://svn.freebsd.org/changeset/base/195479 Log: - Add preliminary fuser support. Obtained from: fuser Added: projects/libprocstat/usr.bin/fstat/functions.h projects/libprocstat/usr.bin/fstat/main.c Deleted: projects/libprocstat/usr.bin/fstat/fstat.h Modified: projects/libprocstat/usr.bin/fstat/Makefile projects/libprocstat/usr.bin/fstat/cd9660.c projects/libprocstat/usr.bin/fstat/fstat.c projects/libprocstat/usr.bin/fstat/msdosfs.c projects/libprocstat/usr.bin/fstat/zfs.c Modified: projects/libprocstat/usr.bin/fstat/Makefile ============================================================================== --- projects/libprocstat/usr.bin/fstat/Makefile Wed Jul 8 22:28:36 2009 (r195478) +++ projects/libprocstat/usr.bin/fstat/Makefile Wed Jul 8 23:09:04 2009 (r195479) @@ -4,13 +4,16 @@ .include PROG= fstat -SRCS= cd9660.c common.c fstat.c msdosfs.c +SRCS= cd9660.c common.c fstat.c main.c msdosfs.c fuser.c +LINKS= ${BINDIR}/fstat ${BINDIR}/fuser DPADD= ${LIBKVM} LDADD= -lkvm BINGRP= kmem BINMODE=2555 WARNS?= 6 +MAN1= fuser.1 fstat.1 + CFLAGS+=-D_KVM_VNODE # XXX This is a hack. Modified: projects/libprocstat/usr.bin/fstat/cd9660.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/cd9660.c Wed Jul 8 22:28:36 2009 (r195478) +++ projects/libprocstat/usr.bin/fstat/cd9660.c Wed Jul 8 23:09:04 2009 (r195479) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include "common.h" -#include "fstat.h" int isofs_filestat(kvm_t *kd, struct vnode *vp, struct filestat *fsp) Modified: projects/libprocstat/usr.bin/fstat/fstat.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/fstat.c Wed Jul 8 22:28:36 2009 (r195478) +++ projects/libprocstat/usr.bin/fstat/fstat.c Wed Jul 8 23:09:04 2009 (r195479) @@ -103,7 +103,7 @@ __FBSDID("$FreeBSD$"); #include #include "common.h" -#include "fstat.h" +#include "functions.h" #define TEXT -1 #define CDIR -2 @@ -112,8 +112,6 @@ __FBSDID("$FreeBSD$"); #define MMAP -5 #define JDIR -6 -DEVS *devs; - #ifdef notdef struct nlist nl[] = { { "" }, @@ -140,6 +138,14 @@ int maxfiles; maxfiles = (d); \ } +typedef struct devs { + struct devs *next; + long fsid; + long ino; + const char *name; +} DEVS; + +DEVS *devs; char *memf, *nlistf; kvm_t *kd; @@ -157,7 +163,7 @@ int getfname(const char *filename); void usage(void); int -main(int argc, char **argv) +do_fstat(int argc, char **argv) { struct passwd *passwd; int arg, ch, what; Added: projects/libprocstat/usr.bin/fstat/functions.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/usr.bin/fstat/functions.h Wed Jul 8 23:09:04 2009 (r195479) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2009 The FreeBSD Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __FUNCTIONS_H__ +#define __FUNCTIONS_H__ + +int do_fstat(int argc, char *argv[]); +int do_fuser(int argc, char *argv[]); + +#endif /* !__FUNCTIONS_H__ */ Added: projects/libprocstat/usr.bin/fstat/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/usr.bin/fstat/main.c Wed Jul 8 23:09:04 2009 (r195479) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2009 Stanislav Sedov . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +int do_fstat(int argc, char *argv[]); +int do_fuser(int argc, char *argv[]); + +int +main(int argc, char *argv[]) +{ + char *p; + + p = basename(argv[0]); + if (p == NULL) + err(1, "basename(%s)", argv[0]); + if (!strcmp(p, "fuser")) + return (do_fuser(argc, argv)); + else + return (do_fstat(argc, argv)); +} Modified: projects/libprocstat/usr.bin/fstat/msdosfs.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/msdosfs.c Wed Jul 8 22:28:36 2009 (r195478) +++ projects/libprocstat/usr.bin/fstat/msdosfs.c Wed Jul 8 23:09:04 2009 (r195479) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #define VTODE(vp) ((struct denode *)(vp)->v_data) #include "common.h" -#include "fstat.h" struct dosmount { struct dosmount *next; Modified: projects/libprocstat/usr.bin/fstat/zfs.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/zfs.c Wed Jul 8 22:28:36 2009 (r195478) +++ projects/libprocstat/usr.bin/fstat/zfs.c Wed Jul 8 23:09:04 2009 (r195479) @@ -52,7 +52,6 @@ #define ZFS #undef dprintf #include "common.h" -#include "fstat.h" /* * Offset calculations that are used to get data from znode without having the From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 23:41:11 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6711C106566B; Wed, 8 Jul 2009 23:41:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 551498FC16; Wed, 8 Jul 2009 23:41:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68NfB7p065579; Wed, 8 Jul 2009 23:41:11 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68NfBYR065577; Wed, 8 Jul 2009 23:41:11 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907082341.n68NfBYR065577@svn.freebsd.org> From: Sam Leffler Date: Wed, 8 Jul 2009 23:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195480 - projects/mesh11s/sbin/ifconfig X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 23:41:11 -0000 Author: sam Date: Wed Jul 8 23:41:11 2009 New Revision: 195480 URL: http://svn.freebsd.org/changeset/base/195480 Log: minor re-wording and consistency Modified: projects/mesh11s/sbin/ifconfig/ifconfig.8 Modified: projects/mesh11s/sbin/ifconfig/ifconfig.8 ============================================================================== --- projects/mesh11s/sbin/ifconfig/ifconfig.8 Wed Jul 8 23:09:04 2009 (r195479) +++ projects/mesh11s/sbin/ifconfig/ifconfig.8 Wed Jul 8 23:41:11 2009 (r195480) @@ -1282,7 +1282,8 @@ When operating as an access point displa currently associated. When operating in ad-hoc mode display stations identified as neighbors in the IBSS. -When operating in mesh mode display the neighbor mesh stations. +When operating in mesh mode display stations identified as +neighbors in the MBSS. When operating in station mode display the access point. Capabilities advertised by the stations are described under the @@ -1824,12 +1825,26 @@ mode: .It Cm meshid Ar meshid Set the desired Mesh Identifier. The Mesh ID is a string up to 32 characters in length. +A mesh interface must have a Mesh Identifier specified +to reach an operational state. .It Cm meshttl Ar ttl -Set the desired time to live for mesh forwarded packets. +Set the desired ``time to live'' for mesh forwarded packets; +this is the number of hops a packet may be forwarded before +it is discarded. +The default setting for +.Cm meshttl +is 31. .It Cm meshpeering Enable or disable peering with neighbor mesh stations. +Stations must peer before any data packets can be exchanged. +By default +.Cm meshpeering +is enabled. .It Cm meshforward Enable or disable forwarding packets by a mesh interface. +By default +.Cm meshforward +is enabled. .It Cm meshmetric Ar protocol Set the specified .Ar protocol @@ -1841,39 +1856,46 @@ The mesh interface will restart after ch Set the specified .Ar protocol as the path selection protocol used on a mesh network. -The default protocol is called +The only available protocol at the moment is called .Ar HWMP (Hybrid Wireless Mesh Protocol). The mesh interface will restart after changing this setting. .It Cm hwmprootmode Ar mode -Stations on a mesh network can operate as root nodes. +Stations on a mesh network can operate as ``root nodes.'' Root nodes try to find paths to all mesh nodes and advertise themselves regularly. When there is a root mesh node on a network, other mesh nodes can setup -paths between themselves faster because they will use the root node -to reach the destination. This path may not be the best, but on-demand +paths between themselves faster because they can use the root node +to find the destination. +This path may not be the best, but on-demand routing will eventually find the best path. The following modes are recognized: .Pp .Bl -tag -width ".Cm PROACTIVE" -compact .It Cm DISABLED -root mode disabled. +Disable root mode. .It Cm NORMAL -sends broadcast path requests every two seconds. +Send broadcast path requests every two seconds. Nodes on the mesh without a path to this root mesh station with try to discover a path to us. .It Cm PROACTIVE -sends broadcast path requests every two seconds and every node must reply with +Send broadcast path requests every two seconds and every node must reply with with a path reply even if it already has a path to this root mesh station, .It Cm RANN -sends broadcast root annoucement (RANN) frames. +Send broadcast root annoucement (RANN) frames. Nodes on the mesh without a path to this root mesh station with try to discover a path to us. .El +By default +.Cm hwmprootmode +is set to +.Ar DISABLED . .It Cm hwmpmaxhops Ar cnt -Use the specified -.Ar cnt -as the maximum number of hops allowed in an HWMP path. +Set the maximum number of hops allowed in an HMWP path to +.Ar cnt . +The default setting for +.Cm hwmpmaxhops +is 31. .El .Pp The following parameters are for compatibility with other systems: From owner-svn-src-projects@FreeBSD.ORG Wed Jul 8 23:58:13 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC8E106564A; Wed, 8 Jul 2009 23:58:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2E628FC19; Wed, 8 Jul 2009 23:58:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n68NwD2D065926; Wed, 8 Jul 2009 23:58:13 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n68NwDwM065924; Wed, 8 Jul 2009 23:58:13 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907082358.n68NwDwM065924@svn.freebsd.org> From: Sam Leffler Date: Wed, 8 Jul 2009 23:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195481 - projects/mesh11s/share/man/man4 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2009 23:58:14 -0000 Author: sam Date: Wed Jul 8 23:58:13 2009 New Revision: 195481 URL: http://svn.freebsd.org/changeset/base/195481 Log: add mesh Modified: projects/mesh11s/share/man/man4/wlan.4 Modified: projects/mesh11s/share/man/man4/wlan.4 ============================================================================== --- projects/mesh11s/share/man/man4/wlan.4 Wed Jul 8 23:41:11 2009 (r195480) +++ projects/mesh11s/share/man/man4/wlan.4 Wed Jul 8 23:58:13 2009 (r195481) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 15, 2009 +.Dd July 8, 2009 .Dt WLAN 4 .Os .Sh NAME @@ -48,7 +48,7 @@ support. .Nm supports multi-mode devices capable of operating in both 2.4GHz and 5GHz bands and supports numerous -802.11 standards: 802.11a, 802.11b, 802.11g, and 802.11n. +802.11 standards: 802.11a, 802.11b, 802.11g, 802.11n, and 802.11s (Draft 3.0). The WPA, 802.11i, and 802.1x security protocols are supported through a combination of in-kernel code and user-mode applications. The WME/WMM multi-media protocols are supported entirely within @@ -83,6 +83,8 @@ A client station in an infrastructure bs (i.e. one that associates to an access point). .It Cm hostap An access point in an infrastructure bss. +.It Cm mesh +A mesh station in an MBSS network. .It Cm adhoc A station in an IBSS network. .It Cm ahdemo @@ -115,8 +117,6 @@ interface that does not send beacon fram interfaces may be created. .El .Pp -More types are planned to support -802.11s mesh nodes (station and ap). Note that an interface's type cannot be changed once it is created. .Pp .Nm @@ -161,6 +161,12 @@ The module name of .Nm was used to be compatible with .Nx . +.Pp +Mesh stations follow the 802.11s Draft 3.0 specification which is +not ratified and subject to change. +Beware that this specification is incompatible with earlier drafts; +and stations implementing earlier drafts (e.g. Linux) +may not interoperate. .Sh SEE ALSO .Xr an 4 , .Xr ath 4 , From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 00:04:25 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1855F1065673; Thu, 9 Jul 2009 00:04:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05F528FC0C; Thu, 9 Jul 2009 00:04:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6904OtQ066198; Thu, 9 Jul 2009 00:04:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6904Omi066194; Thu, 9 Jul 2009 00:04:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907090004.n6904Omi066194@svn.freebsd.org> From: Sam Leffler Date: Thu, 9 Jul 2009 00:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195482 - projects/mesh11s/share/man/man4 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 00:04:25 -0000 Author: sam Date: Thu Jul 9 00:04:24 2009 New Revision: 195482 URL: http://svn.freebsd.org/changeset/base/195482 Log: update drivers that have working mesh support Modified: projects/mesh11s/share/man/man4/ath.4 projects/mesh11s/share/man/man4/mwl.4 projects/mesh11s/share/man/man4/ral.4 Modified: projects/mesh11s/share/man/man4/ath.4 ============================================================================== --- projects/mesh11s/share/man/man4/ath.4 Wed Jul 8 23:58:13 2009 (r195481) +++ projects/mesh11s/share/man/man4/ath.4 Thu Jul 9 00:04:24 2009 (r195482) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd March 25, 2009 +.Dd July 8, 2009 .Dt ATH 4 .Os .Sh NAME @@ -61,7 +61,7 @@ These APIs are used by a wide variety of a PCI and/or CardBus interface are supported. .Pp Supported features include 802.11 and 802.3 frames, power management, BSS, -IBSS, TDMA, and host-based access point operation modes. +IBSS, MBSS, TDMA, and host-based access point operation modes. All host/device interaction is via DMA. .Pp The @@ -102,6 +102,7 @@ The driver supports .Cm adhoc , .Cm adhoc-demo , .Cm hostap , +.Cm mesh , .Cm wds , and .Cm monitor @@ -175,6 +176,12 @@ ifconfig wlan0 inet 192.168.0.10 netmask mode 11g .Ed .Pp +Create an 802.11a mesh station: +.Bd -literal -offset indent +ifconfig wlan0 create wlandev ath0 wlanmode mesh +ifconfig wlan0 meshid my_mesh mode 11a inet 192.168.0.10/24 +.Ed +.Pp Create two virtual 802.11a host-based access points, one with with WEP enabled and one with no security, and bridge them to the fxp0 (wired) device: Modified: projects/mesh11s/share/man/man4/mwl.4 ============================================================================== --- projects/mesh11s/share/man/man4/mwl.4 Wed Jul 8 23:58:13 2009 (r195481) +++ projects/mesh11s/share/man/man4/mwl.4 Thu Jul 9 00:04:24 2009 (r195482) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd June 9, 2009 +.Dd July 8, 2009 .Dt MWL 4 .Os .Sh NAME @@ -64,7 +64,7 @@ module to work. Normally this module is loaded on demand by the driver but it may also be compiled into the kernel. .Pp -Supported features include 802.11n, power management, BSS, +Supported features include 802.11n, power management, BSS, MBSS, and host-based access point operation modes. All host/device interaction is via DMA. .Pp @@ -83,6 +83,7 @@ AES-CCM, TKIP, and Michael cryptographic The driver supports .Cm station , .Cm hostap , +.Cm mesh , and .Cm wds mode operation. @@ -139,6 +140,12 @@ ifconfig wlan0 inet 192.168.0.10 netmask mode 11g .Ed .Pp +Create an 802.11a mesh station: +.Bd -literal -offset indent +ifconfig wlan0 create wlandev mwl0 wlanmode mesh +ifconfig wlan0 meshid my_mesh mode 11a inet 192.168.0.10/24 +.Ed +.Pp Create two virtual 802.11a host-based access points, one with with WEP enabled and one with no security, and bridge them to the fxp0 (wired) device: Modified: projects/mesh11s/share/man/man4/ral.4 ============================================================================== --- projects/mesh11s/share/man/man4/ral.4 Wed Jul 8 23:58:13 2009 (r195481) +++ projects/mesh11s/share/man/man4/ral.4 Thu Jul 9 00:04:24 2009 (r195482) @@ -15,7 +15,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 13, 2008 +.Dd July 8, 2009 .Os .Dt RAL 4 .Sh NAME @@ -72,12 +72,15 @@ supports .Cm station , .Cm adhoc , .Cm hostap , +.Cm mesh , .Cm wds , and .Cm monitor mode operation. Only one .Cm hostap +or +.Cm mesh virtual interface may be configured at a time. Any number of .Cm wds From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 08:31:59 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37FB61065672; Thu, 9 Jul 2009 08:31:59 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id 872098FC19; Thu, 9 Jul 2009 08:31:58 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ewy24 with SMTP id 24so449015ewy.43 for ; Thu, 09 Jul 2009 01:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=Ko6JFBtTKdcZ714Cqy0qH6bPlGCo2qO2uaKMIdmY0hs=; b=MRdIljIBMEku41A3x+bnG3DkUqgM3UwVSHcNIIOSgdIX4N1Xyx845hQW9os7fo8a1U XJcAvRciLo4ewSBVr5fI1SL8M3Ho+fuZ6nbVFRdiykuD2h5bLtxtDgInOwXcoKy7iIJP Avr09UfsowgMkcFEEl6FvyfmKxlzDPqE4mKto= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=JEO2zhLmYxKZ9LzM1YIYAal84APyQuN3hP/FiyczTZUOEtrQc4mUxFA2MEdOiWxEIw R4/kL641Ch9zPoae8EdD+bec4OE56wszksrFErMDRKk2Hf6JZDXDgiqlwvjZKCgGHA2P zUlCnL+svOpOlibwCyyIBE0Hu8i3UzhaO0JqM= Received: by 10.210.128.5 with SMTP id a5mr590226ebd.70.1247128317691; Thu, 09 Jul 2009 01:31:57 -0700 (PDT) Received: from omega.lan (bl6-157-190.dsl.telepac.pt [82.155.157.190]) by mx.google.com with ESMTPS id 23sm4650416eya.26.2009.07.09.01.31.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Jul 2009 01:31:57 -0700 (PDT) Sender: Rui Paulo Message-Id: From: Rui Paulo To: Bruce Evans In-Reply-To: <20090709042523.B46144@delplex.bde.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 9 Jul 2009 09:31:55 +0100 References: <200907081604.n68G4F0g056097@svn.freebsd.org> <20090709042523.B46144@delplex.bde.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195463 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 08:31:59 -0000 On 8 Jul 2009, at 19:30, Bruce Evans wrote: > On Wed, 8 Jul 2009, Rui Paulo wrote: > >> Log: >> Revert 195460: gcc does evil things without __packed. > > Oops, I asked if __packed was really spurious before seeing this. > > gcc does evil things with __packed (starting with it not being a > syntax > error). > > Did it only break on arm? I didn't have a chance to try other architectures. But possibly, yes. For example, sizeof(meshconf_ie) is 23 but, on arm and without __packed, it gave me 26 IIRC. -- Rui Paulo From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 08:32:53 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C4B6106566C; Thu, 9 Jul 2009 08:32:53 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id EDA028FC22; Thu, 9 Jul 2009 08:32:52 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ewy24 with SMTP id 24so449555ewy.43 for ; Thu, 09 Jul 2009 01:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=93x3wSJE2oj4GCyhSgGPFodDbEk7x0tzInvPMR82jyw=; b=wkAclGA4dga8GpSiRuomFVYEatMhxXk7v1901DdGk3SRqfdSSAnr1/AqDgWXhSkSNo Nibz5fi/Ho2HlCRc0XE6rcgNgQtaz14GhtwzFQnV33Jr8WqTKRAfNHH9+2wT0V2pg7e8 9O2QQGshil/w2UoLvbFCs9T3GuqfnK7BQjmgk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=VDwdzXrSjPqkB701H4ma5SblzrWK5txP77KW48EXkI84yjfHSWszgm2uY1k+/l36MZ znAT/Id+7ViYwTv782AszlP3pmaINDrQotLIqrKTxRF6U/GHuK+//B0aKjCDauiyc7oh xQaHG8gmeaz7sdJGe0gZVJpw05gjvsYAt/v+Y= Received: by 10.211.178.12 with SMTP id f12mr587924ebp.83.1247128372158; Thu, 09 Jul 2009 01:32:52 -0700 (PDT) Received: from omega.lan (bl6-157-190.dsl.telepac.pt [82.155.157.190]) by mx.google.com with ESMTPS id 23sm4650416eya.26.2009.07.09.01.32.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Jul 2009 01:32:51 -0700 (PDT) Sender: Rui Paulo Message-Id: From: Rui Paulo To: Bruce Evans In-Reply-To: <20090709041145.G46111@delplex.bde.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 9 Jul 2009 09:32:51 +0100 References: <200907081526.n68FQYDb055185@svn.freebsd.org> <20090709041145.G46111@delplex.bde.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 08:32:53 -0000 On 8 Jul 2009, at 19:24, Bruce Evans wrote: > On Wed, 8 Jul 2009, Rui Paulo wrote: > >> Log: >> Remove some spurious __packed attributes. > > Are they spurious? All uses of __packed are wrong, but they might > still > help work around ABI bugs. > >> Modified: >> projects/mesh11s/sys/net80211/ieee80211_mesh.h >> >> Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 >> 15:25:27 2009 (r195459) >> +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Wed Jul 8 >> 15:26:34 2009 (r195460) >> @@ -46,7 +46,7 @@ struct ieee80211_meshconf_ie { >> uint8_t conf_authid[4]; /* Auth. Protocol ID */ >> uint8_t conf_form; /* Formation Information */ >> uint8_t conf_cap; >> -} __packed; >> +}; > > Broken ABIs (e.g., arm?) may add padding at the end of structs, so it > doesn't help for all members of a struct to have type uint8_t. I > think > arm always pads to make the size a multiple of 4. The natural size of > the above struct is 6, so it seems to need __packed. You're right. -- Rui Paulo From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 08:35:47 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FFD9106566C; Thu, 9 Jul 2009 08:35:47 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id B08738FC15; Thu, 9 Jul 2009 08:35:46 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ewy24 with SMTP id 24so450976ewy.43 for ; Thu, 09 Jul 2009 01:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=5UyEzGlv06INayGhdxCR+z2j8Ze8zort8oJoH1DUdng=; b=kZPk1K23+UmnFWyIPKKrc7bTsZY6CpvTqLfOpqNcIkRooIgWtlMBiQbiayAZ3MVyWY q77VmTDfv7v3Jh0JaSwMr1l5G1AOovJII+LKvXe7enHzLZ9m/eyIRyf8xPTvZZxn91ge 4csPKUZRevts4zR8g7cyiBH0Zv3SBMl7fL9/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=l3setFwyludFCeJkGFgpRSZ0yXfAqb6XxQpioxtZSUWu12jEvgC7ReQWCUS+9hwHU2 1fNBC5n8N5A1RumYqUcOpJ6M1pyVd0D4YeIMcgAUPsdfqoBwGs+aYlW6UJY6DfXCbwN9 ATGi1wXx9zjeGeKAEZ6Y916z82ag3sF/a0yY0= Received: by 10.210.71.13 with SMTP id t13mr608179eba.57.1247128545473; Thu, 09 Jul 2009 01:35:45 -0700 (PDT) Received: from omega.lan (bl6-157-190.dsl.telepac.pt [82.155.157.190]) by mx.google.com with ESMTPS id 23sm4689009eya.6.2009.07.09.01.35.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Jul 2009 01:35:44 -0700 (PDT) Message-Id: From: Rui Paulo To: Bruce Evans , src-committers@freebsd.org, svn-src-projects@freebsd.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Thu, 9 Jul 2009 09:35:42 +0100 References: <200907081604.n68G4F0g056097@svn.freebsd.org> <20090709042523.B46144@delplex.bde.org> X-Mailer: Apple Mail (2.935.3) Cc: Subject: Re: svn commit: r195463 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 08:35:47 -0000 On 9 Jul 2009, at 09:31, Rui Paulo wrote: > On 8 Jul 2009, at 19:30, Bruce Evans wrote: > >> On Wed, 8 Jul 2009, Rui Paulo wrote: >> >>> Log: >>> Revert 195460: gcc does evil things without __packed. >> >> Oops, I asked if __packed was really spurious before seeing this. >> >> gcc does evil things with __packed (starting with it not being a >> syntax >> error). >> >> Did it only break on arm? > > I didn't have a chance to try other architectures. But possibly, yes. > For example, sizeof(meshconf_ie) is 23 but, on arm and without > __packed, it gave me 26 IIRC. Actually, sizeof(meshconf_ie) should be 25, but on arm sizeof(meshconf_ie) == 28 (next multiple of 4). We then decrement 2 from the sizeof in the code, so this gives 26 (the correct answer would be 23, of course). -- Rui Paulo From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 09:44:55 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEEEA106564A; Thu, 9 Jul 2009 09:44:55 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC1CB8FC08; Thu, 9 Jul 2009 09:44:55 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n699itKn078420; Thu, 9 Jul 2009 09:44:55 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n699itXU078418; Thu, 9 Jul 2009 09:44:55 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907090944.n699itXU078418@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 9 Jul 2009 09:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195487 - projects/libprocstat/usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 09:44:56 -0000 Author: stas Date: Thu Jul 9 09:44:55 2009 New Revision: 195487 URL: http://svn.freebsd.org/changeset/base/195487 Log: - Fix copyright line. Suggested by: rwatson Modified: projects/libprocstat/usr.bin/fstat/functions.h Modified: projects/libprocstat/usr.bin/fstat/functions.h ============================================================================== --- projects/libprocstat/usr.bin/fstat/functions.h Thu Jul 9 09:34:11 2009 (r195486) +++ projects/libprocstat/usr.bin/fstat/functions.h Thu Jul 9 09:44:55 2009 (r195487) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 The FreeBSD Project. + * Copyright (c) 2009 Stanislav Sedov * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 09:46:34 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E65471065672; Thu, 9 Jul 2009 09:46:34 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1A2B8FC0A; Thu, 9 Jul 2009 09:46:34 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n699kYhS078506; Thu, 9 Jul 2009 09:46:34 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n699kYCF078503; Thu, 9 Jul 2009 09:46:34 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907090946.n699kYCF078503@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 9 Jul 2009 09:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195488 - projects/libprocstat/usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 09:46:35 -0000 Author: stas Date: Thu Jul 9 09:46:34 2009 New Revision: 195488 URL: http://svn.freebsd.org/changeset/base/195488 Log: - Add files forgotten in yesterday commit. Added: projects/libprocstat/usr.bin/fstat/fuser.1 projects/libprocstat/usr.bin/fstat/fuser.c Added: projects/libprocstat/usr.bin/fstat/fuser.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/usr.bin/fstat/fuser.1 Thu Jul 9 09:46:34 2009 (r195488) @@ -0,0 +1,141 @@ +.\" Copyright (c) 2005 Stanislav Sedov +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $Id: fuser.1,v 1.3 2005/08/29 12:07:19 stas Exp $ +.\" +.Dd August 24, 2005 +.Dt FUSER 1 +.Os +.Sh NAME +.Nm fuser +.Nd list IDs of all processes that have one or more files open +.Sh SYNOPSIS +.Nm +.Op Fl cfkmu +.Op Fl C Ar core +.Op Fl K Ar kernel +.Op Fl s Ar signal +.Op Ar +.Sh DESCRIPTION +The +.Nm +utility shall write to stdout the process IDs of processes that have one or +more named files open. For block and character special devices, all processes +using files on that device are listed. +A file is considered open by a process if it was explicitly opened, +is the working directory, root directory, jail root directory, +active executable text, kernel trace file for that process or controlling tty +of the process. +If +.Fl m +option is specified, the +.Nm +utility will search through mmapped files also. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl c +Treat files as mount point and report on any files open in the file system. +.It Fl f +The report must be only for named files. +.It Fl k +Send signal to reported processes +.Pq SIGKILL by default . +.It Fl m +Report on mmapped files too. +.It Fl u +Write the user name, associated with each process, to stdout. +.It Fl C +Use given kernel core file instead of default +.Pa /dev/kmem . +.It Fl K +Use specified kernel image instead of the default one, +which is the image the system has booted from. +.It Fl s +Use given signal name instead of default SIGKILL. +.El +.Pp +The following symbols, written to stderr will indicate how files is used: +.Bl -tag -width MOUNT +.It Cm r +The file is the root directory of the process. +.It Cm c +The file is the current workdir directory of the process. +.It Cm j +The file is the jail-root of the process. +.It Cm t +The file is the kernel tracing file for the process. +.It Cm x +The file is executable text of the process. +.It Cm y +The process use this file as its controlling tty. +.It Cm m +The file is mmapped. +.It Cm w +The file is open for writing. +.It Cm a +The file is open as append only +.Pq O_APPEND was specified . +.It Cm d +The process bypasses fs cache while writing to this file +.Pq O_DIRECT was specified . +.It Cm s +Shared lock is hold. +.It Cm e +Exclusive lock is hold. +.El +.Sh EXIT STATUS +The +.Nm +utility returns 0 on successful completion and >0 otherwise. +.Sh EXAMPLES +The command: +.Dq Li "fuser -fu ." +writes to standart output the process IDs of processes that are using the +current directory and writes to stderr an indication of how those processes are +using the direcory and user names associated with the processes that are using +this directory. +.Sh SEE ALSO +.Xr fstat 1 , +.Xr ps 1 , +.Xr systat 1 , +.Xr iostat 8 , +.Xr pstat 8 , +.Xr vmstat 8 +.Sh STANDARTS +The +.Nm +utility is expected to conform to +.St -p1003.1-2004 . +.Sh BUGS +Since +.Nm +takes a snapshot of the system, it is only correct for a very short period +of time. +Currently, not all filesystems are supported. +.Sh AUTHORS +The +.Nm +utility and this manual page was contributed by +.An Stanislav Sedov Aq ssedov@mbsd.msk.ru . Added: projects/libprocstat/usr.bin/fstat/fuser.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/libprocstat/usr.bin/fstat/fuser.c Thu Jul 9 09:46:34 2009 (r195488) @@ -0,0 +1,755 @@ +/*- + * Copyright (c) 2005,2009 Stanislav Sedov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define _WANT_FILE +#include +#include +#define _KERNEL +#include +#include +#undef _KERNEL + +#include +#include +#include + +#include "common.h" +#include "functions.h" + +/* + * Local types + */ + +enum {REQFILE, REQDEV, REQMNT}; /* Type of requested file */ +typedef struct reqfile { + ino_t ino; + dev_t dev; + const char *fname; + int type; + SLIST_ENTRY(reqfile) next; +} reqfile_t; +typedef SLIST_HEAD(, finfo) fds_head_t; /* List of opened files */ + +typedef struct pinfo { + pid_t pid; + uid_t uid; + fds_head_t fds; + SLIST_ENTRY(pinfo) next; +} pinfo_t; + +typedef struct finfo{ + struct filestat stat; + int uflags; /* How this file is used */ + SLIST_ENTRY(finfo) next; +} finfo_t; + +/* + * Local definitions + */ + +/* Option flags */ +#define UFLAG 0x01 /* -u flag: show users */ +#define FFLAG 0x02 /* -f flag: specified files only */ +#define CFLAG 0x04 /* -c flag: treat as mpoints */ +#define MFLAG 0x10 /* -m flag: mmapped files too */ +#define KFLAG 0x20 /* -k flag: send signal (SIGKILL by default) */ + +/* Macros for freeing SLISTs, probably must be in /sys/queue.h */ +#define SLIST_FREE(head, field, freef) do { \ + typeof(SLIST_FIRST(head)) __elm0; \ + typeof(SLIST_FIRST(head)) __elm; \ + SLIST_FOREACH_SAFE(__elm, (head), field, __elm0) \ + (void)(freef)(__elm); \ +} while(0); + +/* File's usage flags */ +#define UFL_RDIR 0x0001 /* root dir */ +#define UFL_CDIR 0x0002 /* cwd */ +#define UFL_JDIR 0x0004 /* jail root */ +#define UFL_TRACEP 0x0008 /* trace vnode */ +#define UFL_TEXTVP 0x0010 /* text(executable) file */ +#define UFL_CTTY 0x0020 /* contolling tty */ +#define UFL_MMAP 0x0040 /* file is mmapped */ +#define UFL_FREAD 0x0080 /* file opened for reading */ +#define UFL_FWRITE 0x0100 /* file opened for writing */ +#define UFL_FAPPEND 0x0200 /* file opened as append-only */ +#define UFL_FDIRECT 0x0400 /* file bypasses fs cache */ +#define UFL_FSHLOCK 0x0800 /* shared lock is obtained */ +#define UFL_FEXLOCK 0x1000 /* exclusive lock is obtained */ + +struct { + int val; + char ch; +} uflags[] = { + {UFL_RDIR, 'r'}, + {UFL_JDIR, 'j'}, + {UFL_CDIR, 'c'}, + {UFL_TRACEP, 't'}, + {UFL_TEXTVP, 'x'}, + {UFL_CTTY, 'y'}, + {UFL_MMAP, 'm'}, + {UFL_FWRITE, 'w'}, + {UFL_FAPPEND, 'a'}, + {UFL_FDIRECT, 'd'}, + {UFL_FSHLOCK, 's'}, + {UFL_FEXLOCK, 'e'}, +}; +#define NUFLAGS (sizeof(uflags) / sizeof(*uflags)) + +/* Filesystem-specific handlers */ +#define FSTYPE(fst) {#fst, fst##_filestat} +struct { + const char *tag; + int (*handler)(kvm_t *kd, struct vnode *vp, struct filestat *fsp); +} fstypes[] = { + FSTYPE(ufs), + FSTYPE(devfs), + FSTYPE(nfs), + FSTYPE(msdosfs), + FSTYPE(isofs), +/* + FSTYPE(ntfs), + FSTYPE(nwfs), + FSTYPE(smbfs), + FSTYPE(udf), +*/ +}; +#define NTYPES (sizeof(fstypes) / sizeof(*fstypes)) + +/* + * Global vars + */ + +kvm_t *kd; /* KVM descriptors */ +static int flags = 0; /* Option flags */ + +/* List of requested files */ +static SLIST_HEAD(, reqfile) rfiles = SLIST_HEAD_INITIALIZER(&rfiles); + +/* List of current processes */ +static SLIST_HEAD(, pinfo) prclist = SLIST_HEAD_INITIALIZER(&prclist); + +/* + * Prototypes + */ +static const struct vnode *get_ctty \ + __P((const struct kinfo_proc *p)); +static int vp2finfo \ + __P((const struct vnode *vp, fds_head_t *h, int fl)); +static void print_file_info \ + __P((pid_t pid, uid_t uid, int ufl)); +static int add_mmapped \ + __P((const struct kinfo_proc *p, fds_head_t *head)); +static int str2sig \ + __P((const char *str)); +static void usage \ + __P((void)) __dead2; +static int gather_pinfo \ + __P((const struct kinfo_proc *p)); +static int addfile \ + __P((const char *path)); +static int add_ofiles \ + __P((const struct filedesc *fd, fds_head_t *head)); +static int get_uflags \ + __P((const reqfile_t *rfile, const pinfo_t *pinfo)); +static void pinfo_free \ + __P((pinfo_t *pinfo)); +int main \ + __P((int argc, char *argv[])); + +static void +usage(void) +{ + + (void)fprintf(stderr, "usage: %s [-cfkmu] [-C core] [-K kernel]" \ + " [-s signal] file ...\n", getprogname()); + + exit(EX_USAGE); +} + +void +print_file_info(pid, uid, ufl) + pid_t pid; + uid_t uid; + int ufl; +{ + uint i; + + (void)fprintf(stdout, "%6d", pid); + (void)fflush(stdout); + + for (i = 0; i < NUFLAGS; i++) + if ((ufl & uflags[i].val) != 0) + (void)fprintf(stderr, "%c", uflags[i].ch); + + if ((flags & UFLAG) != 0) + (void)fprintf(stderr,"(%s)", user_from_uid(uid, 0)); + + (void)fflush(stderr); +} + +/* + * Add file to the list. + */ +static int +addfile(path) + const char *path; +{ + struct stat sb; + int type; + reqfile_t *rfile; + + assert(path); + + if (stat(path, &sb) != 0) { + warn("%s", path); + return 1; + } + + rfile = (reqfile_t *)malloc(sizeof(reqfile_t)); + if (rfile == NULL) + err(EX_OSERR, "malloc()"); + + type = sb.st_mode & S_IFMT; + + rfile->ino = sb.st_ino; + rfile->dev = sb.st_dev; + rfile->fname = path; + + if ((flags & CFLAG) != 0) + rfile->type = REQMNT; + else if ((type == S_IFCHR || type == S_IFBLK) && ((flags & FFLAG) == 0)) + rfile->type = REQDEV; + else + rfile->type = REQFILE; + + SLIST_INSERT_HEAD(&rfiles, rfile, next); + + return 0; +} + +/* + * The purpose of this routine is to walk through list of fds, opened + * by a given process and add suitable entries to list. + */ +static int +add_ofiles(fd, head) + const struct filedesc *fd; + fds_head_t *head; +{ + struct file **ofiles; + struct file file; + int nfiles; + int ufl; + uint i; + + assert(head); + assert(fd); + + nfiles = (fd->fd_lastfile + 1); + if (nfiles <= 0) { + return 1; + } + +#define OFSIZE (nfiles * sizeof(*ofiles)) + ofiles = (struct file **)malloc(OFSIZE); + if (ofiles == NULL) + err(EX_OSERR, "malloc()"); + + if (!kvm_read_all(kd, (unsigned long)fd->fd_ofiles, ofiles, OFSIZE)) { + warnx("can't read file structures at %p", fd->fd_ofiles); + + free(ofiles); + return 1; + } +#undef OFSIZE + + for (i = 0; i < (unsigned)nfiles; i++) { + if (ofiles[i] == 0) + continue; + + if (!kvm_read_all(kd, (unsigned long)ofiles[i], &file, + sizeof(file))) { + warnx("can't read file structure at %p", ofiles[i]); + continue; + } + + ufl = 0; + if ((file.f_flag & FREAD) != 0) + ufl |= UFL_FREAD; + if ((file.f_flag & FWRITE) != 0) + ufl |= UFL_FWRITE; + if ((file.f_flag & O_APPEND) != 0) + ufl |= UFL_FAPPEND; + if ((file.f_flag & O_DIRECT) != 0) + ufl |= UFL_FDIRECT; + if ((file.f_flag & O_SHLOCK) != 0) + ufl |= UFL_FSHLOCK; + if ((file.f_flag & O_EXLOCK) != 0) + ufl |= UFL_FEXLOCK; + + switch (file.f_type) { + case DTYPE_VNODE: + case DTYPE_FIFO: + (void)vp2finfo(file.f_vnode, head, ufl); + + default: + continue; + } + } + + free(ofiles); + + return 0; +} + +/* + * This routine returns controlling tty of the process, if exist. + */ +const struct vnode * +get_ctty(p) + const struct kinfo_proc *p; +{ + struct proc proc; + struct pgrp pgrp; + struct session sess; + + assert(p); + if (!kvm_read_all(kd, (unsigned long)p->ki_paddr, &proc, + sizeof(proc))) { + warnx("can't read proc struct at %p for pid %d", \ + p->ki_paddr, p->ki_pid); + return NULL; + } + + if (proc.p_pgrp == NULL) + return NULL; + + if (!kvm_read_all(kd, (unsigned long)proc.p_pgrp, &pgrp, sizeof(pgrp))) { + warnx("can't read pgrp struct at %p for pid %d", \ + proc.p_pgrp, p->ki_pid); + return NULL; + } + + if (!kvm_read_all(kd, (unsigned long)pgrp.pg_session, &sess, + sizeof(sess))) { + warnx("can't read session struct at %p for pid %d", \ + pgrp.pg_session, p->ki_pid); + return NULL; + } + + return sess.s_ttyvp; +} + +/* + * The purpose of this routine is to build the entire pinfo structure for + * given process. The structure's pointer will be inserted in the list. + */ +int +gather_pinfo(p) + const struct kinfo_proc *p; +{ + struct filedesc fd_info; + pinfo_t *pinfo; + + assert(p); + if (p->ki_stat == SZOMB || p->ki_fd == NULL) + return 1; + + if (!kvm_read_all(kd, (unsigned long)p->ki_fd, &fd_info, + sizeof(fd_info))) { + warnx("can't read open file's info at %p for pid %d", \ + p->ki_fd, p->ki_pid); + return 1; + } + + pinfo = (pinfo_t *)malloc(sizeof(pinfo_t)); + if (pinfo == NULL) + err(EX_OSERR, "malloc()"); + + pinfo->pid = p->ki_pid; + pinfo->uid = p->ki_uid; + SLIST_INIT(&pinfo->fds); + + /* Add files from process's open fds list */ + (void)add_ofiles(&fd_info, &pinfo->fds); + + if ((flags & MFLAG) != 0) + (void)add_mmapped(p, &pinfo->fds); + + (void)vp2finfo(p->ki_tracep, &pinfo->fds, \ + UFL_FREAD|UFL_FWRITE|UFL_TRACEP); + + (void)vp2finfo(p->ki_textvp, &pinfo->fds, UFL_FREAD|UFL_TEXTVP); + + (void)vp2finfo(get_ctty(p), &pinfo->fds, UFL_CTTY); + + (void)vp2finfo(fd_info.fd_rdir, &pinfo->fds, UFL_FREAD|UFL_RDIR); + + (void)vp2finfo(fd_info.fd_cdir, &pinfo->fds, UFL_FREAD|UFL_CDIR); + + (void)vp2finfo(fd_info.fd_jdir, &pinfo->fds, UFL_FREAD|UFL_JDIR); + + SLIST_INSERT_HEAD(&prclist, pinfo, next); + + return 0; +} + +/* + * Insert finfo structure for given vnode into the list + */ +static int +vp2finfo(vp, head, ufl) + const struct vnode *vp; + fds_head_t *head; + int ufl; +{ + struct vnode vn; + finfo_t *finfo; + char tag[8]; /* Max expected fs name length */ + uint found, i; + + assert(head); + if (vp == NULL) + return 1; + + finfo = (finfo_t *)malloc(sizeof(finfo_t)); + if (finfo == NULL) + err(EX_OSERR, "malloc()"); + + if (!kvm_read_all(kd, (unsigned long)vp, &vn, sizeof(vn))) { + warnx("can't read vnode at %p", vp); + return 1; + } + + if (!kvm_read_all(kd, (unsigned long)vn.v_tag, &tag, sizeof(tag))) { + warnx("can't read v_tag at %p", vp); + return 1; + } + tag[sizeof(tag) - 1] = 0; + + if (vn.v_type == VNON || vn.v_type == VBAD) + return 1; + + for (i = 0, found = 0; i < NTYPES; i++) + if (!strcmp(fstypes[i].tag, tag)) { + if (fstypes[i].handler(kd, &vn, &(finfo->stat)) != 0) + return 1; + found = 1; + break; + } + if (found == 0) + return 1; + + finfo->uflags = ufl; + SLIST_INSERT_HEAD(head, finfo, next); + + return 0; +} + +/* + * This routine walks through linked list of opened files and gathers + * informations how given file is used. + */ +static int +get_uflags(rfile, pinfo) + const reqfile_t *rfile; + const pinfo_t *pinfo; +{ + finfo_t *fd; + int ufl = 0; + + assert(rfile); + assert(pinfo); + + switch (rfile->type) { + case REQFILE: + SLIST_FOREACH(fd, &pinfo->fds, next) + if (fd->stat.fileid == rfile->ino && \ + fd->stat.fsid == rfile->dev) + ufl |= fd->uflags; + + return ufl; + + case REQMNT: + SLIST_FOREACH(fd, &pinfo->fds, next) + if (fd->stat.fsid == rfile->dev) + ufl |= fd->uflags; + + return ufl; + + case REQDEV: + SLIST_FOREACH(fd, &pinfo->fds, next) + if ((fd->stat.fileid == rfile->ino && \ + fd->stat.fsid == rfile->dev) || \ + fd->stat.fsid == rfile->ino) + ufl |= fd->uflags; + + return ufl; + + default: + break; + } + + return 0; +} + +/* + * Helper routine to free pinfo structure + */ +static void +pinfo_free(pinfo) + pinfo_t *pinfo; +{ + + assert(pinfo); + SLIST_FREE(&pinfo->fds, next, free); + free(pinfo); +} + +int +do_fuser(argc, argv) + int argc; + char *argv[]; +{ + reqfile_t *rfile; + pinfo_t *pinfo; + struct kinfo_proc *procs; + char buf[_POSIX2_LINE_MAX]; /* KVM mandatory */ + char ch; + int ufl, cnt; + int sig = SIGKILL; /* Default to kill */ + char *ep; + char *kernimg = NULL; /* We are using curr. sys by default */ + char *mcore = NULL; + + while ((ch = getopt(argc, argv, "C:K:cfkms:u")) != -1) + switch(ch) { + case 'f': + if ((flags & CFLAG) != 0) + usage(); + flags |= FFLAG; + break; + + case 'c': + if ((flags & FFLAG) != 0) + usage(); + flags |= CFLAG; + break; + + case 'K': + kernimg = optarg; + break; + + case 'C': + mcore = optarg; + break; + + case 'u': + flags |= UFLAG; + break; + + case 'm': + flags |= MFLAG; + break; + + case 'k': + flags |= KFLAG; + break; + + case 's': + if (isdigit(*optarg)) { + sig = strtol(optarg, &ep, 10); + if (*ep != '\0' || sig < 0 || sig >= sys_nsig) + errx(EX_USAGE, "illegal signal number" \ + ": %s", optarg); + } + else { + sig = str2sig(optarg); + if (sig < 0) + errx(EX_USAGE, "illegal signal name: " \ + "%s", optarg); + } + break; + + default: + usage(); + } + + argv += optind; + argc -= optind; + + assert(argc >= 0); + if (argc == 0) + usage(); + + while (argc--) + (void)addfile(argv[argc]); + + if (SLIST_EMPTY(&rfiles)) + errx(EX_IOERR, "files not accessible"); + + kd = kvm_openfiles(kernimg, mcore, NULL, O_RDONLY, buf); + if (kd == NULL) + errx(EX_OSERR, "kvm_openfiles(): %s", buf); + + procs = kvm_getprocs(kd, KERN_PROC_ALL, 0, &cnt); + if (procs == NULL) + errx(EX_OSERR, "kvm_getproc(): %s", buf); + + while(cnt--) + (void)gather_pinfo(procs++); + + SLIST_FOREACH(rfile, &rfiles, next) { + (void)fprintf(stderr, "%s:", rfile->fname); + (void)fflush(stderr); + + SLIST_FOREACH(pinfo, &prclist, next) { + ufl = get_uflags(rfile, pinfo); + + if (ufl != 0) { + print_file_info(pinfo->pid, \ + pinfo->uid, ufl); + if ((flags & KFLAG) != 0) + (void)kill(pinfo->pid, sig); + } + } + (void)fprintf(stderr, "\n"); + } + + SLIST_FREE(&rfiles, next, free); + SLIST_FREE(&prclist, next, pinfo_free); + (void)kvm_close(kd); + + return 0; + +} + +int +add_mmapped(p, head) + const struct kinfo_proc *p; + fds_head_t *head; +{ + vm_map_t map; + struct vmspace vmspace; + struct vm_map_entry entry; + vm_map_entry_t entryp; + struct vm_object object; + vm_object_t objp; + int ufl; + + assert(p); + if (!kvm_read_all(kd, (unsigned long)p->ki_vmspace, &vmspace, + sizeof(vmspace))) { + warnx("can't read vmspace at %p for pid %d\n", + (void *)p->ki_vmspace, p->ki_pid); + return 1; + } + + map = &vmspace.vm_map; + + for (entryp = map->header.next; + entryp != &p->ki_vmspace->vm_map.header; entryp = entry.next) { + if (!kvm_read_all(kd, (unsigned long)entryp, &entry, + sizeof(entry))) { + warnx("can't read vm_map_entry at %p for pid %d\n", + (void *)entryp, p->ki_pid); + return 1; + } + + if (entry.eflags & MAP_ENTRY_IS_SUB_MAP) + continue; + + if ((objp = entry.object.vm_object) == NULL) + continue; + + for (; objp; objp = object.backing_object) { + if (!kvm_read_all(kd, (unsigned long)objp, &object, + sizeof(object))) { + warnx("can't read vm_object at %p for pid %d\n", + (void *)objp, p->ki_pid); + return 1; + } + } + + ufl = (entry.protection & VM_PROT_READ ? UFL_FREAD : 0); + ufl |= (entry.protection & VM_PROT_WRITE ? UFL_FWRITE : 0); + ufl |= UFL_MMAP; + + if (object.type == OBJT_VNODE) + (void)vp2finfo((struct vnode *)object.handle, head, \ + ufl); + } + + return 0; +} + +/* + * Returns signal number for it's string representation + */ +static int +str2sig(str) + const char *str; +{ + int n; + + if (!strncasecmp(str, "sig", (size_t)3)) + str += 3; + + for (n = 1; n < sys_nsig; n++) { + if (!strcasecmp(sys_signame[n], str)) + return (n); + } + + return -1; +} From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 11:48:48 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63B6E106564A; Thu, 9 Jul 2009 11:48:48 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50FA68FC1C; Thu, 9 Jul 2009 11:48:48 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69Bmmx1084167; Thu, 9 Jul 2009 11:48:48 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69Bmm1q084164; Thu, 9 Jul 2009 11:48:48 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907091148.n69Bmm1q084164@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 9 Jul 2009 11:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195489 - projects/libprocstat/usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 11:48:48 -0000 Author: stas Date: Thu Jul 9 11:48:48 2009 New Revision: 195489 URL: http://svn.freebsd.org/changeset/base/195489 Log: - Merge sysctl-bases access routines from fstat_vnode.c into fstat.c. - Link fstat against libutil. Deleted: projects/libprocstat/usr.bin/fstat/fstat_vnode.c Modified: projects/libprocstat/usr.bin/fstat/Makefile projects/libprocstat/usr.bin/fstat/fstat.c Modified: projects/libprocstat/usr.bin/fstat/Makefile ============================================================================== --- projects/libprocstat/usr.bin/fstat/Makefile Thu Jul 9 09:46:34 2009 (r195488) +++ projects/libprocstat/usr.bin/fstat/Makefile Thu Jul 9 11:48:48 2009 (r195489) @@ -7,7 +7,7 @@ PROG= fstat SRCS= cd9660.c common.c fstat.c main.c msdosfs.c fuser.c LINKS= ${BINDIR}/fstat ${BINDIR}/fuser DPADD= ${LIBKVM} -LDADD= -lkvm +LDADD= -lkvm -lutil BINGRP= kmem BINMODE=2555 WARNS?= 6 Modified: projects/libprocstat/usr.bin/fstat/fstat.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/fstat.c Thu Jul 9 09:46:34 2009 (r195488) +++ projects/libprocstat/usr.bin/fstat/fstat.c Thu Jul 9 11:48:48 2009 (r195489) @@ -65,8 +65,8 @@ __FBSDID("$FreeBSD$"); #include #include #define _KERNEL -#include #include +#include #include #include #include @@ -91,6 +91,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -152,6 +153,7 @@ kvm_t *kd; static void fstat_kvm(int, int); static void fstat_sysctl(int, int); void dofiles(struct kinfo_proc *kp); +void dofiles_kinfo(struct kinfo_proc *kp); void dommap(struct kinfo_proc *kp); void vtrans(struct vnode *vp, int i, int flag); char *getmnton(struct mount *m); @@ -161,6 +163,12 @@ void ptstrans(struct tty *tp, int i, int void getinetproto(int number); int getfname(const char *filename); void usage(void); +static int kinfo_proc_compare(const void *, const void *); +static void kinfo_proc_sort(struct kinfo_proc *, int); +void vtrans_kinfo(struct kinfo_file *, int i, int flag); + +/* XXX: sys/mount.h */ +int statfs(const char *, struct statfs *); int do_fstat(int argc, char **argv) @@ -288,12 +296,66 @@ fstat_kvm(int what, int arg) } } +/* + * Sort processes first by pid and then tid. + */ +static int +kinfo_proc_compare(const void *a, const void *b) +{ + int i; + + i = ((const struct kinfo_proc *)b)->ki_pid - + ((const struct kinfo_proc *)a)->ki_pid; + if (i != 0) + return (i); + i = ((const struct kinfo_proc *)b)->ki_tid - + ((const struct kinfo_proc *)a)->ki_tid; + return (i); +} + static void -fstat_sysctl(int what, int arg) +kinfo_proc_sort(struct kinfo_proc *kipp, int count) { - /* not yet implemented */ - fstat_kvm(what, arg); + qsort(kipp, count, sizeof(*kipp), kinfo_proc_compare); +} + +static void +fstat_sysctl(int what, int arg) +{ + struct kinfo_proc *kipp; + int name[4]; + size_t len; + unsigned int i; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = what; + name[3] = arg; + + len = 0; + if (sysctl(name, 4, NULL, &len, NULL, 0) < 0) + err(-1, "sysctl: kern.proc"); + kipp = malloc(len); + if (kipp == NULL) + err(-1, "malloc"); + + if (sysctl(name, 4, kipp, &len, NULL, 0) < 0) { + free(kipp); + err(-1, "sysctl: kern.proc"); + } + if (len % sizeof(*kipp) != 0) + err(-1, "kinfo_proc mismatch"); + if (kipp->ki_structsize != sizeof(*kipp)) + err(-1, "kinfo_proc structure mismatch"); + kinfo_proc_sort(kipp, len / sizeof(*kipp)); + print_header(); + for (i = 0; i < len / sizeof(*kipp); i++) { + dofiles_kinfo(&kipp[i]); + if (mflg) + dommap(&kipp[i]); + } + free(kipp); } const char *Uname, *Comm; @@ -430,6 +492,108 @@ dofiles(struct kinfo_proc *kp) } } +/* + * print open files attributed to this process using kinfo + */ +void +dofiles_kinfo(struct kinfo_proc *kp) +{ + struct kinfo_file *kif, *freep; +#if 0 + struct kinfo_file kifb; +#endif + int i, cnt, fd_type, flags; + + Uname = user_from_uid(kp->ki_uid, 0); + Pid = kp->ki_pid; + Comm = kp->ki_comm; + + if (kp->ki_fd == NULL) + return; + +#if 0 + /* + * ktrace vnode, if one + */ + if (kp->ki_tracep) + vtrans_kin(kp->ki_tracep, TRACE, FREAD|FWRITE); + /* + * text vnode, if one + */ + vtrans(kp->ki_textvp, TEXT, FREAD); + /* Text vnode. */ + if (kp->ki_textvp) { + if (gettextvp(kp, &kifb) == 0) + vtrans_kinfo(&kifb, TEXT, FREAD); + } +#endif + + /* + * open files + */ + freep = kinfo_getfile(kp->ki_pid, &cnt); + if (freep == NULL) + err(1, "kinfo_getfile"); + + for (i = 0; i < cnt; i++) { + kif = &freep[i]; + switch (kif->kf_type) { + case KF_TYPE_VNODE: + if (kif->kf_fd == KF_FD_TYPE_CWD) { + fd_type = CDIR; + flags = FREAD; + } else if (kif->kf_fd == KF_FD_TYPE_ROOT) { + fd_type = RDIR; + flags = FREAD; + } else if (kif->kf_fd == KF_FD_TYPE_JAIL) { + fd_type = JDIR; + flags = FREAD; + } else { + fd_type = i; + flags = kif->kf_flags; + } + /* Only do this if the attributes are valid. */ + if (kif->kf_status & KF_ATTR_VALID) + vtrans_kinfo(kif, fd_type, flags); + break; +#if 0 + case KF_TYPE_PIPE: + if (checkfile == 0) + pipetrans_kinfo(kif, i, kif->kf_flags); + break; + else if (file.f_type == DTYPE_SOCKET) { + if (checkfile == 0) + socktrans(file.f_data, i); + } +#ifdef DTYPE_PIPE + else if (file.f_type == DTYPE_PIPE) { + if (checkfile == 0) + pipetrans(file.f_data, i, file.f_flag); + } +#endif +#ifdef DTYPE_FIFO + else if (file.f_type == DTYPE_FIFO) { + if (checkfile == 0) + vtrans(file.f_vnode, i, file.f_flag); + } +#endif +#ifdef DTYPE_PTS + else if (file.f_type == DTYPE_PTS) { + if (checkfile == 0) + ptstrans(file.f_data, i, file.f_flag); + } +#endif + else { + dprintf(stderr, + "unknown file type %d for file %d of pid %d\n", + file.f_type, i, Pid); + } +#endif + } + } + free(freep); +} + void dommap(struct kinfo_proc *kp) { @@ -602,10 +766,106 @@ vtrans(struct vnode *vp, int i, int flag putchar('\n'); } +void +vtrans_kinfo(struct kinfo_file *kif, int i, int flag) +{ + struct filestat fst; + char rw[3], mode[15]; + const char *badtype, *filename; + struct statfs stbuf; + + filename = badtype = NULL; + fst.fsid = fst.fileid = fst.mode = fst.size = fst.rdev = 0; + bzero(&stbuf, sizeof(struct statfs)); + switch (kif->kf_vnode_type) { + case VNON: + badtype = "none"; + break; + case VBAD: + badtype = "bad"; + break; + default: + fst.fsid = kif->kf_file_fsid; + fst.fileid = kif->kf_file_fileid; + fst.mode = kif->kf_file_mode; + fst.size = kif->kf_file_size; + fst.rdev = kif->kf_file_rdev; + break; + } + if (checkfile) { + int fsmatch = 0; + DEVS *d; + + if (badtype) + return; + for (d = devs; d != NULL; d = d->next) + if (d->fsid == fst.fsid) { + fsmatch = 1; + if (d->ino == fst.fileid) { + filename = d->name; + break; + } + } + if (fsmatch == 0 || (filename == NULL && fsflg == 0)) + return; + } + PREFIX(i); + if (badtype) { + (void)printf(" - - %10s -\n", badtype); + return; + } + if (nflg) + (void)printf(" %2d,%-2d", major(fst.fsid), minor(fst.fsid)); + else { + if (strlen(kif->kf_path) > 0) + statfs(kif->kf_path, &stbuf); + (void)printf(" %-8s", stbuf.f_mntonname); + } + if (nflg) + (void)sprintf(mode, "%o", fst.mode); + else { + strmode(fst.mode, mode); + } + (void)printf(" %6ld %10s", fst.fileid, mode); + switch (kif->kf_vnode_type) { + case KF_VTYPE_VBLK: { + char *name; + name = devname(fst.rdev, S_IFBLK); + if (nflg || !name) + printf(" %2d,%-2d", major(fst.rdev), minor(fst.rdev)); + else { + printf(" %6s", name); + } + break; + } + case KF_VTYPE_VCHR: { + char *name; + name = devname(fst.rdev, S_IFCHR); + if (nflg || !name) + printf(" %2d,%-2d", major(fst.rdev), minor(fst.rdev)); + else { + printf(" %6s", name); + } + break; + } + default: + printf(" %6lu", fst.size); + } + rw[0] = '\0'; + if (flag & FREAD) + strcat(rw, "r"); + if (flag & FWRITE) + strcat(rw, "w"); + printf(" %2s", rw); + if (filename && !fsflg) + printf(" %s", filename); + putchar('\n'); +} + char * getmnton(struct mount *m) { - static struct mount mount; + static struct mount mnt; static struct mtab { struct mtab *next; struct mount *m; @@ -616,14 +876,14 @@ getmnton(struct mount *m) for (mt = mhead; mt != NULL; mt = mt->next) if (m == mt->m) return (mt->mntonname); - if (!kvm_read_all(kd, (unsigned long)m, &mount, sizeof(struct mount))) { + if (!kvm_read_all(kd, (unsigned long)m, &mnt, sizeof(struct mount))) { warnx("can't read mount table at %p", (void *)m); return (NULL); } if ((mt = malloc(sizeof (struct mtab))) == NULL) err(1, NULL); mt->m = m; - bcopy(&mount.mnt_stat.f_mntonname[0], &mt->mntonname[0], MNAMELEN); + bcopy(&mnt.mnt_stat.f_mntonname[0], &mt->mntonname[0], MNAMELEN); mt->next = mhead; mhead = mt; return (mt->mntonname); From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 12:48:44 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 303921065676; Thu, 9 Jul 2009 12:48:44 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13C868FC17; Thu, 9 Jul 2009 12:48:44 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69Cmhf6085404; Thu, 9 Jul 2009 12:48:43 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69CmhX3085403; Thu, 9 Jul 2009 12:48:43 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200907091248.n69CmhX3085403@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 9 Jul 2009 12:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195490 - projects/libprocstat/usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 12:48:44 -0000 Author: stas Date: Thu Jul 9 12:48:43 2009 New Revision: 195490 URL: http://svn.freebsd.org/changeset/base/195490 Log: - Delete old ifdefs. - Allocate memory dynamically whenever needed instead of using global buffer. Modified: projects/libprocstat/usr.bin/fstat/fstat.c Modified: projects/libprocstat/usr.bin/fstat/fstat.c ============================================================================== --- projects/libprocstat/usr.bin/fstat/fstat.c Thu Jul 9 11:48:48 2009 (r195489) +++ projects/libprocstat/usr.bin/fstat/fstat.c Thu Jul 9 12:48:43 2009 (r195490) @@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -113,12 +112,6 @@ __FBSDID("$FreeBSD$"); #define MMAP -5 #define JDIR -6 -#ifdef notdef -struct nlist nl[] = { - { "" }, -}; -#endif - int fsflg, /* show files on same filesystem as file(s) argument */ pflg, /* show files open by a particular pid */ uflg; /* show files open by a particular (effective) user */ @@ -126,19 +119,6 @@ int checkfile; /* true if restricting t int nflg; /* (numerical) display f.s. and rdev as dev_t */ int mflg; /* include memory-mapped files */ - -struct file **ofiles; /* buffer of pointers to file structures */ -int maxfiles; -#define ALLOC_OFILES(d) \ - if ((d) > maxfiles) { \ - free(ofiles); \ - ofiles = malloc((d) * sizeof(struct file *)); \ - if (ofiles == NULL) { \ - err(1, NULL); \ - } \ - maxfiles = (d); \ - } - typedef struct devs { struct devs *next; long fsid; @@ -268,8 +248,6 @@ fstat_kvm(int what, int arg) char buf[_POSIX2_LINE_MAX]; int cnt; - ALLOC_OFILES(256); /* reserve space for file pointers */ - /* * Discard setgid privileges if not the running kernel so that bad * guys can't print interesting stuff from kernel memory. @@ -280,10 +258,6 @@ fstat_kvm(int what, int arg) if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) errx(1, "%s", buf); setgid(getgid()); -#ifdef notdef - if (kvm_nlist(kd, nl) != 0) - errx(1, "no namelist: %s", kvm_geterr(kd)); -#endif if ((p = kvm_getprocs(kd, what, arg, &cnt)) == NULL) errx(1, "%s", kvm_geterr(kd)); print_header(); @@ -395,6 +369,8 @@ dofiles(struct kinfo_proc *kp) int i; struct file file; struct filedesc filed; + unsigned int nfiles; + struct file **ofiles; Uname = user_from_uid(kp->ki_uid, 0); Pid = kp->ki_pid; @@ -443,12 +419,18 @@ dofiles(struct kinfo_proc *kp) if (filed.fd_lastfile <= -1 || filed.fd_lastfile > MAX_LASTFILE) return; - ALLOC_OFILES(filed.fd_lastfile+1); + nfiles = filed.fd_lastfile + 1; + ofiles = malloc(nfiles * sizeof(struct file *)); + if (ofiles == NULL) { + warn("malloc(%zd)", nfiles * sizeof(struct file *)); + return; + } if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles, (filed.fd_lastfile+1) * FPSIZE)) { dprintf(stderr, "can't read file structures at %p for pid %d\n", (void *)filed.fd_ofiles, Pid); + free(ofiles); return; } for (i = 0; i <= filed.fd_lastfile; i++) { @@ -490,6 +472,7 @@ dofiles(struct kinfo_proc *kp) file.f_type, i, Pid); } } + free(ofiles); } /* From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 13:42:20 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06FE31065678; Thu, 9 Jul 2009 13:42:20 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA0CB8FC15; Thu, 9 Jul 2009 13:42:19 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69DgIL2086608; Thu, 9 Jul 2009 13:42:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69DgIBu086606; Thu, 9 Jul 2009 13:42:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907091342.n69DgIBu086606@svn.freebsd.org> From: Rui Paulo Date: Thu, 9 Jul 2009 13:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195491 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 13:42:20 -0000 Author: rpaulo Date: Thu Jul 9 13:42:18 2009 New Revision: 195491 URL: http://svn.freebsd.org/changeset/base/195491 Log: Set table seqno only if we didn't send one already. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jul 9 12:48:43 2009 (r195490) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jul 9 13:42:18 2009 (r195491) @@ -720,7 +720,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, prep.prep_lifetime = preq->preq_lifetime; prep.prep_metric = IEEE80211_MESHLMETRIC_INITIALVAL; IEEE80211_ADDR_COPY(prep.prep_origaddr, vap->iv_myaddr); - prep.prep_origseq = hs->hs_seq++; + prep.prep_origseq = ++hs->hs_seq; hwmp_send_prep(ni, vap->iv_myaddr, wh->i_addr2, &prep); /* * Build the reverse path, if we don't have it already. @@ -983,8 +983,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, } } else { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "discard PREP from %s, wrong seqno %u", - ether_sprintf(prep->prep_origaddr), prep->prep_targetseq); + "discard PREP from %s, wrong seqno %u != %u", + ether_sprintf(prep->prep_origaddr), prep->prep_targetseq, + hr->hr_seq); vap->iv_stats.is_hwmp_wrongseq++; } @@ -1239,8 +1240,10 @@ hwmp_discover(struct ieee80211vap *vap, hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route); if (IEEE80211_ADDR_EQ(rt->rt_nexthop, invalidaddr)) { - hr->hr_seq = ++hs->hs_seq; - hr->hr_preqid = ++hs->hs_preqid; + if (hr->hr_preqid == 0) { + hr->hr_seq = ++hs->hs_seq; + hr->hr_preqid = ++hs->hs_preqid; + } rt->rt_metric = IEEE80211_MESHLMETRIC_INITIALVAL; rt->rt_lifetime = timeval2msecs(ieee80211_hwmp_pathtimeout); From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 14:54:09 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E353106564A; Thu, 9 Jul 2009 14:54:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA318FC1E; Thu, 9 Jul 2009 14:54:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69Es9ni088275; Thu, 9 Jul 2009 14:54:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69Es9n3088273; Thu, 9 Jul 2009 14:54:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907091454.n69Es9n3088273@svn.freebsd.org> From: Warner Losh Date: Thu, 9 Jul 2009 14:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195494 - projects/mips/sys/mips/malta X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 14:54:09 -0000 Author: imp Date: Thu Jul 9 14:54:09 2009 New Revision: 195494 URL: http://svn.freebsd.org/changeset/base/195494 Log: Addresses should be unsigned long. Make the address constants unsigned long. Modified: projects/mips/sys/mips/malta/maltareg.h Modified: projects/mips/sys/mips/malta/maltareg.h ============================================================================== --- projects/mips/sys/mips/malta/maltareg.h Thu Jul 9 14:53:05 2009 (r195493) +++ projects/mips/sys/mips/malta/maltareg.h Thu Jul 9 14:54:09 2009 (r195494) @@ -94,37 +94,37 @@ 15 Secondary IDE Secondary IDE slot/Compact flash connector */ -#define MALTA_SYSTEMRAM_BASE 0x00000000 /* System RAM: */ +#define MALTA_SYSTEMRAM_BASE 0x00000000ul /* System RAM: */ #define MALTA_SYSTEMRAM_SIZE 0x08000000 /* 128 MByte */ -#define MALTA_PCIMEM1_BASE 0x08000000 /* PCI 1 memory: */ +#define MALTA_PCIMEM1_BASE 0x08000000ul /* PCI 1 memory: */ #define MALTA_PCIMEM1_SIZE 0x08000000 /* 128 MByte */ -#define MALTA_PCIMEM2_BASE 0x10000000 /* PCI 2 memory: */ +#define MALTA_PCIMEM2_BASE 0x10000000ul /* PCI 2 memory: */ #define MALTA_PCIMEM2_SIZE 0x08000000 /* 128 MByte */ -#define MALTA_PCIMEM3_BASE 0x18000000 /* PCI 3 memory */ +#define MALTA_PCIMEM3_BASE 0x18000000ul /* PCI 3 memory */ #define MALTA_PCIMEM3_SIZE 0x03e00000 /* 62 MByte */ -#define MALTA_CORECTRL_BASE 0x1be00000 /* Core control: */ +#define MALTA_CORECTRL_BASE 0x1be00000ul /* Core control: */ #define MALTA_CORECTRL_SIZE 0x00200000 /* 2 MByte */ -#define MALTA_RESERVED_BASE1 0x1c000000 /* Reserved: */ +#define MALTA_RESERVED_BASE1 0x1c000000ul /* Reserved: */ #define MALTA_RESERVED_SIZE1 0x02000000 /* 32 MByte */ -#define MALTA_MONITORFLASH_BASE 0x1e000000 /* Monitor Flash: */ +#define MALTA_MONITORFLASH_BASE 0x1e000000ul /* Monitor Flash: */ #define MALTA_MONITORFLASH_SIZE 0x003e0000 /* 4 MByte */ #define MALTA_MONITORFLASH_SECTORSIZE 0x00010000 /* Sect. = 64 KB */ -#define MALTA_FILEFLASH_BASE 0x1e3e0000 /* File Flash (for monitor): */ +#define MALTA_FILEFLASH_BASE 0x1e3e0000ul /* File Flash (for monitor): */ #define MALTA_FILEFLASH_SIZE 0x00020000 /* 128 KByte */ #define MALTA_FILEFLASH_SECTORSIZE 0x00010000 /* Sect. = 64 KB */ -#define MALTA_RESERVED_BASE2 0x1e400000 /* Reserved: */ +#define MALTA_RESERVED_BASE2 0x1e400000ul /* Reserved: */ #define MALTA_RESERVED_SIZE2 0x00c00000 /* 12 MByte */ -#define MALTA_FPGA_BASE 0x1f000000 /* FPGA: */ +#define MALTA_FPGA_BASE 0x1f000000ul /* FPGA: */ #define MALTA_FPGA_SIZE 0x00c00000 /* 12 MByte */ #define MALTA_NMISTATUS (MALTA_FPGA_BASE + 0x24) @@ -191,10 +191,10 @@ #define MALTA_I2COUT 0x10 #define MALTA_I2CSEL 0x18 -#define MALTA_BOOTROM_BASE 0x1fc00000 /* Boot ROM: */ +#define MALTA_BOOTROM_BASE 0x1fc00000ul /* Boot ROM: */ #define MALTA_BOOTROM_SIZE 0x00400000 /* 4 MByte */ -#define MALTA_REVISION 0x1fc00010 +#define MALTA_REVISION 0x1fc00010ul #define MALTA_REV_FPGRV 0xff0000 /* CBUS FPGA revision */ #define MALTA_REV_CORID 0x00fc00 /* Core Board ID */ #define MALTA_REV_CORRV 0x000300 /* Core Board Revision */ From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 15:04:24 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0FD81065686; Thu, 9 Jul 2009 15:04:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A06178FC1A; Thu, 9 Jul 2009 15:04:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69F4O4T088554; Thu, 9 Jul 2009 15:04:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69F4OXN088552; Thu, 9 Jul 2009 15:04:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907091504.n69F4OXN088552@svn.freebsd.org> From: Warner Losh Date: Thu, 9 Jul 2009 15:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195495 - projects/mips/sys/mips/malta X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 15:04:25 -0000 Author: imp Date: Thu Jul 9 15:04:24 2009 New Revision: 195495 URL: http://svn.freebsd.org/changeset/base/195495 Log: Make the yamon function pointer stuff 64-bit safe. Make the base unsigned long, and sign extend the address of the function we're calling through. Modified: projects/mips/sys/mips/malta/yamon.h Modified: projects/mips/sys/mips/malta/yamon.h ============================================================================== --- projects/mips/sys/mips/malta/yamon.h Thu Jul 9 14:54:09 2009 (r195494) +++ projects/mips/sys/mips/malta/yamon.h Thu Jul 9 15:04:24 2009 (r195495) @@ -38,7 +38,7 @@ #ifndef _MALTA_YAMON_H_ #define _MALTA_YAMON_H_ -#define YAMON_FUNCTION_BASE 0x1fc00500 +#define YAMON_FUNCTION_BASE 0x1fc00500ul #define YAMON_PRINT_COUNT_OFS (YAMON_FUNCTION_BASE + 0x04) #define YAMON_EXIT_OFS (YAMON_FUNCTION_BASE + 0x20) @@ -53,7 +53,7 @@ #define YAMON_GETCHAR_OFS (YAMON_FUNCTION_BASE + 0x50) #define YAMON_SYSCON_READ_OFS (YAMON_FUNCTION_BASE + 0x54) -#define YAMON_FUNC(ofs) (*(uint32_t *)(MIPS_PHYS_TO_KSEG0(ofs))) +#define YAMON_FUNC(ofs) ((long)(*(int32_t *)(MIPS_PHYS_TO_KSEG0(ofs)))) typedef void (*t_yamon_print_count)(uint32_t port, char *s, uint32_t count); #define YAMON_PRINT_COUNT(s, count) \ From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 15:04:52 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE26110656C0; Thu, 9 Jul 2009 15:04:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 830F28FC14; Thu, 9 Jul 2009 15:04:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69F4qmU088597; Thu, 9 Jul 2009 15:04:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69F4qK9088595; Thu, 9 Jul 2009 15:04:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907091504.n69F4qK9088595@svn.freebsd.org> From: Warner Losh Date: Thu, 9 Jul 2009 15:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195496 - projects/mips/sys/mips/malta X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 15:04:53 -0000 Author: imp Date: Thu Jul 9 15:04:52 2009 New Revision: 195496 URL: http://svn.freebsd.org/changeset/base/195496 Log: Don't force ISA_MIPS32. Modified: projects/mips/sys/mips/malta/std.malta Modified: projects/mips/sys/mips/malta/std.malta ============================================================================== --- projects/mips/sys/mips/malta/std.malta Thu Jul 9 15:04:24 2009 (r195495) +++ projects/mips/sys/mips/malta/std.malta Thu Jul 9 15:04:52 2009 (r195496) @@ -2,7 +2,7 @@ files "../malta/files.malta" cpu CPU_MIPS4KC -options ISA_MIPS32 +#options ISA_MIPS32 device pci device ata device atadisk From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 15:05:51 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00B0E1065675; Thu, 9 Jul 2009 15:05:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D93B58FC0A; Thu, 9 Jul 2009 15:05:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69F5o2F088674; Thu, 9 Jul 2009 15:05:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69F5oq2088671; Thu, 9 Jul 2009 15:05:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907091505.n69F5oq2088671@svn.freebsd.org> From: Warner Losh Date: Thu, 9 Jul 2009 15:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195497 - projects/mips/sys/mips/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 15:05:51 -0000 Author: imp Date: Thu Jul 9 15:05:50 2009 New Revision: 195497 URL: http://svn.freebsd.org/changeset/base/195497 Log: Add support for compiling MALTA as mips64. # MALTA64 builds, but doesn't link yet. Added: projects/mips/sys/mips/conf/MALTA64 Modified: projects/mips/sys/mips/conf/MALTA Modified: projects/mips/sys/mips/conf/MALTA ============================================================================== --- projects/mips/sys/mips/conf/MALTA Thu Jul 9 15:04:52 2009 (r195496) +++ projects/mips/sys/mips/conf/MALTA Thu Jul 9 15:05:50 2009 (r195497) @@ -33,6 +33,8 @@ options TICK_USE_YAMON_FREQ=defined include "../malta/std.malta" +options ISA_MIPS32 + hints "MALTA.hints" #Default places to look for devices. makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols Added: projects/mips/sys/mips/conf/MALTA64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/mips/sys/mips/conf/MALTA64 Thu Jul 9 15:05:50 2009 (r195497) @@ -0,0 +1,70 @@ +# MALTA -- Kernel config for MALTA boards +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# 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 +# in NOTES. +# +# $FreeBSD: projects/mips/sys/mips/conf/MALTA 192819 2009-05-26 17:01:12Z gonzo $ + +ident MALTA + +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" +makeoptions MIPS_LITTLE_ENDIAN=defined + +options YAMON + +# Don't build any modules yet. +makeoptions MODULES_OVERRIDE="" + +options KERNVIRTADDR=0x80100000 +options TICK_USE_YAMON_FREQ=defined +#options TICK_USE_MALTA_RTC=defined + +include "../malta/std.malta" + +options ISA_MIPS64 + +hints "MALTA.hints" #Default places to look for devices. + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +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 ROOTDEVNAME=\"ufs:ad0s1a\" + + +# Debugging for use in -current +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 + +device loop +device ether +device le +device miibus +device md +device uart From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 15:41:30 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D6A110656C7; Thu, 9 Jul 2009 15:41:30 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB098FC1A; Thu, 9 Jul 2009 15:41:30 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 1757F6D41C; Thu, 9 Jul 2009 17:41:29 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id DF080844F1; Thu, 9 Jul 2009 17:41:28 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans References: <200907081526.n68FQYDb055185@svn.freebsd.org> <20090709041145.G46111@delplex.bde.org> Date: Thu, 09 Jul 2009 17:41:28 +0200 In-Reply-To: <20090709041145.G46111@delplex.bde.org> (Bruce Evans's message of "Thu, 9 Jul 2009 04:24:46 +1000 (EST)") Message-ID: <86prc9g8yf.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 15:41:30 -0000 Bruce Evans writes: > Broken ABIs (e.g., arm?) may add padding at the end of structs, Padding at the end of a struct is *required* to ensure proper alignment of the next element in an array, e.g. struct foo { int i; char c; } bar[2]; Assuming a four-byte alignment requirement for int, the compiler *must* add three bytes of padding at the end of struct foo so bar[1].i is correctly aligned. cf. ISO/IEC 9899:1999 =C2=A76.7.2.1: 15 There may be unnamed padding at the end of a structure or union. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 16:41:05 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8AF31065706; Thu, 9 Jul 2009 16:41:05 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9480E8FC29; Thu, 9 Jul 2009 16:41:05 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: (from root@localhost) by kientzle.com (8.14.3/8.14.3) id n69G20E9016339; Thu, 9 Jul 2009 09:02:00 -0700 (PDT) (envelope-from kientzle@freebsd.org) Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id wutsgkqes44eeze6s3ekxw36bn; Thu, 09 Jul 2009 09:01:59 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <4A561477.7000508@freebsd.org> Date: Thu, 09 Jul 2009 09:01:59 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.21) Gecko/20090601 SeaMonkey/1.1.16 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200907081526.n68FQYDb055185@svn.freebsd.org> <20090709041145.G46111@delplex.bde.org> <86prc9g8yf.fsf@ds4.des.no> In-Reply-To: <86prc9g8yf.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org, Rui Paulo , Bruce Evans Subject: Re: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 16:41:06 -0000 Dag-Erling Smørgrav wrote: > Bruce Evans writes: >> Broken ABIs (e.g., arm?) may add padding at the end of structs, > > Padding at the end of a struct is *required* to ensure proper alignment > of the next element in an array, e.g. > > struct foo { int i; char c; } bar[2]; > > Assuming a four-byte alignment requirement for int, the compiler *must* > add three bytes of padding at the end of struct foo so bar[1].i is > correctly aligned. > > cf. ISO/IEC 9899:1999 §6.7.2.1: > > 15 There may be unnamed padding at the end of a structure or union. Everyone (I hope!) expects alignment in the case you outlined. But many of us have been surprised to see the ARM compiler pad struct foo { char f1[4]; char f2[1]; char f3[1]; }; to 12 bytes. This breaks a lot of traditional code that uses structs of char arrays to define memory and disk layouts. I'm not claiming that the ARM compiler is broken, just that its padding behavior surprises a lot of people. Tim From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 17:56:04 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB8561065692; Thu, 9 Jul 2009 17:56:04 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2AB8FC0C; Thu, 9 Jul 2009 17:56:04 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69Hu4Jd092591; Thu, 9 Jul 2009 17:56:04 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69Hu4OL092589; Thu, 9 Jul 2009 17:56:04 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907091756.n69Hu4OL092589@svn.freebsd.org> From: Rui Paulo Date: Thu, 9 Jul 2009 17:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195504 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 17:56:05 -0000 Author: rpaulo Date: Thu Jul 9 17:56:04 2009 New Revision: 195504 URL: http://svn.freebsd.org/changeset/base/195504 Log: Fix another case of localid == 0. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 16:59:29 2009 (r195503) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 17:56:04 2009 (r195504) @@ -1573,8 +1573,8 @@ mesh_recv_action_meshpeering_confirm(str break; case IEEE80211_NODE_MESH_CONFIRMRCV: if (ni->ni_mllid != meshpeer->peer_llinkid) { - args[0] = ni->ni_mllid; - args[1] = ni->ni_mlpid; + args[0] = ni->ni_mlpid; + args[1] = ni->ni_mllid; args[2] = IEEE80211_REASON_PEER_LINK_CANCELED; ieee80211_send_action(ni, IEEE80211_ACTION_CAT_MESHPEERING, From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 18:14:07 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2FC6106567F; Thu, 9 Jul 2009 18:14:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B16EE8FC1A; Thu, 9 Jul 2009 18:14:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69IE7Qr093068; Thu, 9 Jul 2009 18:14:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69IE7LI093066; Thu, 9 Jul 2009 18:14:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907091814.n69IE7LI093066@svn.freebsd.org> From: Rui Paulo Date: Thu, 9 Jul 2009 18:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195505 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 18:14:08 -0000 Author: rpaulo Date: Thu Jul 9 18:14:07 2009 New Revision: 195505 URL: http://svn.freebsd.org/changeset/base/195505 Log: mesh_parse_meshpeering_action(): return mp, not meshpeer. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 17:56:04 2009 (r195504) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 18:14:07 2009 (r195505) @@ -1399,7 +1399,7 @@ mesh_parse_meshpeering_action(struct iee } return NULL; } - return (const struct ieee80211_meshpeer_ie *) meshpeer; + return (const struct ieee80211_meshpeer_ie *) mp; } static int From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 18:17:02 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF01106568E; Thu, 9 Jul 2009 18:17:02 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 321338FC12; Thu, 9 Jul 2009 18:17:02 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69IH2PK093166; Thu, 9 Jul 2009 18:17:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69IH2ZM093164; Thu, 9 Jul 2009 18:17:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907091817.n69IH2ZM093164@svn.freebsd.org> From: Rui Paulo Date: Thu, 9 Jul 2009 18:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195506 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 18:17:02 -0000 Author: rpaulo Date: Thu Jul 9 18:17:01 2009 New Revision: 195506 URL: http://svn.freebsd.org/changeset/base/195506 Log: Use __inline instead of inline. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 18:14:07 2009 (r195505) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 18:17:01 2009 (r195506) @@ -64,7 +64,7 @@ static int mesh_select_proto_path(struct static int mesh_select_proto_metric(struct ieee80211vap *, const char *); static void mesh_vattach(struct ieee80211vap *); static int mesh_newstate(struct ieee80211vap *, enum ieee80211_state, int); -static inline void mesh_linkchange(struct ieee80211_node *, +static __inline void mesh_linkchange(struct ieee80211_node *, enum ieee80211_mesh_mlstate); static void mesh_checkid(void *, struct ieee80211_node *); static uint32_t mesh_generateid(struct ieee80211vap *); @@ -78,10 +78,10 @@ static void mesh_forward(struct ieee8021 static int mesh_input(struct ieee80211_node *, struct mbuf *, int, int); static void mesh_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int, int); -static inline void mesh_peer_timeout_setup(struct ieee80211_node *); +static __inline void mesh_peer_timeout_setup(struct ieee80211_node *); static void mesh_peer_timeout_backoff(struct ieee80211_node *); static void mesh_peer_timeout_cb(void *); -static inline void mesh_peer_timeout_stop(struct ieee80211_node *); +static __inline void mesh_peer_timeout_stop(struct ieee80211_node *); static int mesh_verify_meshpeerver(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshid(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshconf(struct ieee80211vap *, const uint8_t *); @@ -566,7 +566,7 @@ mesh_newstate(struct ieee80211vap *vap, * of the less interesting frames that come frequently * (e.g. beacons). */ -static inline int +static __inline int doprint(struct ieee80211vap *vap, int subtype) { switch (subtype) { @@ -581,7 +581,7 @@ doprint(struct ieee80211vap *vap, int su /* * Helper function to note the Mesh Peer Link FSM change. */ -static inline void +static __inline void mesh_linkchange(struct ieee80211_node *ni, enum ieee80211_mesh_mlstate state) { struct ieee80211vap *vap = ni->ni_vap; @@ -1957,7 +1957,7 @@ mesh_send_action_meshlink_reply(struct i } } -static inline void +static __inline void mesh_peer_timeout_setup(struct ieee80211_node *ni) { switch (ni->ni_mlstate) { @@ -1992,7 +1992,7 @@ mesh_peer_timeout_backoff(struct ieee802 ni); } -static inline void +static __inline void mesh_peer_timeout_stop(struct ieee80211_node *ni) { callout_stop(&ni->ni_mltimer); @@ -2058,7 +2058,7 @@ mesh_peer_timeout_cb(void *arg) } } -static inline int +static __inline int mesh_verify_meshpeerver(struct ieee80211vap *vap, const uint8_t *ie) { static const uint8_t peer[4] = IEEE80211_MESHPEERVER_PEER; @@ -2069,7 +2069,7 @@ mesh_verify_meshpeerver(struct ieee80211 return memcmp(meshpeerver->peerver_proto, peer, 4); } -static inline int +static __inline int mesh_verify_meshid(struct ieee80211vap *vap, const uint8_t *ie) { struct ieee80211_mesh_state *ms = vap->iv_mesh; From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 18:18:03 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0DC81065677; Thu, 9 Jul 2009 18:18:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3DB8FC18; Thu, 9 Jul 2009 18:18:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69II37i093218; Thu, 9 Jul 2009 18:18:03 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69II3YK093216; Thu, 9 Jul 2009 18:18:03 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907091818.n69II3YK093216@svn.freebsd.org> From: Rui Paulo Date: Thu, 9 Jul 2009 18:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195507 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 18:18:04 -0000 Author: rpaulo Date: Thu Jul 9 18:18:03 2009 New Revision: 195507 URL: http://svn.freebsd.org/changeset/base/195507 Log: Use __inline instead of inline. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jul 9 18:17:01 2009 (r195506) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Thu Jul 9 18:18:03 2009 (r195507) @@ -106,7 +106,7 @@ static int hwmp_send_perr(struct ieee802 static void hwmp_recv_rann(struct ieee80211vap *, struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_meshrann_ie *); -static inline int hwmp_send_rann(struct ieee80211_node *, +static __inline int hwmp_send_rann(struct ieee80211_node *, const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshrann_ie *); @@ -1016,7 +1016,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, } } -static inline int +static __inline int hwmp_send_prep(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], @@ -1121,7 +1121,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, #undef PEER_DADDR #undef PERR_DSEQ -static inline int +static __inline int hwmp_send_perr(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], @@ -1186,7 +1186,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, } } -static inline int +static __inline int hwmp_send_rann(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 19:02:17 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D13461065680; Thu, 9 Jul 2009 19:02:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEAED8FC21; Thu, 9 Jul 2009 19:02:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69J2H0A094316; Thu, 9 Jul 2009 19:02:17 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69J2Hek094314; Thu, 9 Jul 2009 19:02:17 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200907091902.n69J2Hek094314@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Jul 2009 19:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195511 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 19:02:18 -0000 Author: gonzo Date: Thu Jul 9 19:02:17 2009 New Revision: 195511 URL: http://svn.freebsd.org/changeset/base/195511 Log: - Ooops, this debug code wasn't supposed to get into final commit. My appologises. Modified: projects/mips/sys/mips/mips/busdma_machdep.c Modified: projects/mips/sys/mips/mips/busdma_machdep.c ============================================================================== --- projects/mips/sys/mips/mips/busdma_machdep.c Thu Jul 9 19:00:29 2009 (r195510) +++ projects/mips/sys/mips/mips/busdma_machdep.c Thu Jul 9 19:02:17 2009 (r195511) @@ -611,32 +611,18 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi if (flags & BUS_DMA_COHERENT) { void *tmpaddr = (void *)*vaddr; - unsigned char *buf1 = (void *)*vaddr; if (tmpaddr) { - int gi; tmpaddr = (void *)MIPS_PHYS_TO_KSEG1(vtophys(tmpaddr)); - unsigned char *buf2 = tmpaddr; - unsigned char *buf3 = (void - *)MIPS_PHYS_TO_KSEG0(vtophys(tmpaddr)); newmap->origbuffer = *vaddr; newmap->allocbuffer = tmpaddr; mips_dcache_wbinv_range((vm_offset_t)*vaddr, dmat->maxsize); *vaddr = tmpaddr; - for (gi = 0; gi < dmat->maxsize; gi++) { - if (buf1[gi] != buf2[gi]) - panic("cache fucked up\n"); - - if (buf1[gi] != buf3[gi]) - panic("cache fucked up2\n"); - } } else newmap->origbuffer = newmap->allocbuffer = NULL; - } else { - unsigned char *buf1 = (void *)*vaddr; + } else newmap->origbuffer = newmap->allocbuffer = NULL; - } return (0); } @@ -807,8 +793,6 @@ segdone: *segp = seg; *lastaddrp = lastaddr; - if (map->flags & DMAMAP_COHERENT) - panic("not coherent\n"); /* * Did we fit? @@ -1065,7 +1049,6 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, { struct bounce_page *bpage; - panic("sync bp"); STAILQ_FOREACH(bpage, &map->bpages, links) { if (op & BUS_DMASYNC_PREWRITE) { bcopy((void *)bpage->datavaddr, From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 20:11:26 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D69FB1065670; Thu, 9 Jul 2009 20:11:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38228FC14; Thu, 9 Jul 2009 20:11:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69KBQ3T095892; Thu, 9 Jul 2009 20:11:26 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69KBQgK095887; Thu, 9 Jul 2009 20:11:26 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200907092011.n69KBQgK095887@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Jul 2009 20:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195513 - projects/mips/sys/mips/atheros X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 20:11:27 -0000 Author: gonzo Date: Thu Jul 9 20:11:26 2009 New Revision: 195513 URL: http://svn.freebsd.org/changeset/base/195513 Log: - Move CPU/AHB frequency calculations to functions to prevent code duplication Modified: projects/mips/sys/mips/atheros/ar71xx_machdep.c projects/mips/sys/mips/atheros/ar71xxreg.h projects/mips/sys/mips/atheros/uart_bus_ar71xx.c projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c Modified: projects/mips/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- projects/mips/sys/mips/atheros/ar71xx_machdep.c Thu Jul 9 19:27:58 2009 (r195512) +++ projects/mips/sys/mips/atheros/ar71xx_machdep.c Thu Jul 9 20:11:26 2009 (r195513) @@ -100,8 +100,8 @@ platform_start(__register_t a0 __unused, __register_t a2 __unused, __register_t a3 __unused) { vm_offset_t kernend; - uint64_t platform_counter_freq, freq; - uint32_t reg, div, pll_config; + uint64_t platform_counter_freq; + uint32_t reg; int argc, i, count = 0; char **argv, **envp; @@ -151,12 +151,7 @@ platform_start(__register_t a0 __unused, * should be called first. */ init_param1(); - pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG); - div = ((pll_config >> PLL_FB_SHIFT) & PLL_FB_MASK) + 1; - freq = div * AR71XX_BASE_FREQ; - div = ((pll_config >> PLL_CPU_DIV_SEL_SHIFT) & PLL_CPU_DIV_SEL_MASK) - + 1; - platform_counter_freq = freq / div; + platform_counter_freq = ar71xx_cpu_freq(); mips_timer_init_params(platform_counter_freq, 1); cninit(); Modified: projects/mips/sys/mips/atheros/ar71xxreg.h ============================================================================== --- projects/mips/sys/mips/atheros/ar71xxreg.h Thu Jul 9 19:27:58 2009 (r195512) +++ projects/mips/sys/mips/atheros/ar71xxreg.h Thu Jul 9 20:11:26 2009 (r195513) @@ -26,12 +26,6 @@ #ifndef _AR71XX_REG_H_ #define _AR71XX_REG_H_ -#define ATH_READ_REG(reg) \ - *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) - -#define ATH_WRITE_REG(reg, val) \ - *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val) - /* PCI region */ #define AR71XX_PCI_MEM_BASE 0x10000000 /* @@ -174,6 +168,15 @@ #define AR71XX_PLL_ETH_EXT_CLK 0x18050018 #define AR71XX_PLL_PCI_CLK 0x1805001C +#define AR71XX_RST_WDOG_CONTROL 0x18060008 +#define RST_WDOG_LAST (1 << 31) +#define RST_WDOG_ACTION_MASK 3 +#define RST_WDOG_ACTION_RESET 3 +#define RST_WDOG_ACTION_NMI 2 +#define RST_WDOG_ACTION_GP_INTR 1 +#define RST_WDOG_ACTION_NOACTION 0 + +#define AR71XX_RST_WDOG_TIMER 0x1806000C /* * APB interrupt status and mask register and interrupt bit numbers for */ @@ -419,4 +422,43 @@ #define SPI_IO_CTRL_DO 1 #define AR71XX_SPI_RDS 0x0C +#define ATH_READ_REG(reg) \ + *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) + +#define ATH_WRITE_REG(reg, val) \ + *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val) + +static inline uint64_t +ar71xx_cpu_freq(void) +{ + uint32_t pll_config, div; + uint64_t freq; + + /* PLL freq */ + pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG); + div = ((pll_config >> PLL_FB_SHIFT) & PLL_FB_MASK) + 1; + freq = div * AR71XX_BASE_FREQ; + /* CPU freq */ + div = ((pll_config >> PLL_CPU_DIV_SEL_SHIFT) & PLL_CPU_DIV_SEL_MASK) + + 1; + freq = freq / div; + + return (freq); +} + +static inline uint64_t +ar71xx_ahb_freq(void) +{ + uint32_t pll_config, div; + uint64_t freq; + + /* PLL freq */ + pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG); + /* AHB freq */ + div = (((pll_config >> PLL_AHB_DIV_SHIFT) & PLL_AHB_DIV_MASK) + 1) * 2; + freq = ar71xx_cpu_freq() / div; + return (freq); +} + + #endif /* _AR71XX_REG_H_ */ Modified: projects/mips/sys/mips/atheros/uart_bus_ar71xx.c ============================================================================== --- projects/mips/sys/mips/atheros/uart_bus_ar71xx.c Thu Jul 9 19:27:58 2009 (r195512) +++ projects/mips/sys/mips/atheros/uart_bus_ar71xx.c Thu Jul 9 20:11:26 2009 (r195513) @@ -67,20 +67,9 @@ static int uart_ar71xx_probe(device_t dev) { struct uart_softc *sc; - uint32_t pll_config, div; uint64_t freq; - /* PLL freq */ - pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG); - div = ((pll_config >> PLL_FB_SHIFT) & PLL_FB_MASK) + 1; - freq = div * AR71XX_BASE_FREQ; - /* CPU freq */ - div = ((pll_config >> PLL_CPU_DIV_SEL_SHIFT) & PLL_CPU_DIV_SEL_MASK) - + 1; - freq = freq / div; - /* AHB freq */ - div = (((pll_config >> PLL_AHB_DIV_SHIFT) & PLL_AHB_DIV_MASK) + 1) * 2; - freq = freq / div; + freq = ar71xx_ahb_freq(); sc = device_get_softc(dev); sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); Modified: projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c ============================================================================== --- projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c Thu Jul 9 19:27:58 2009 (r195512) +++ projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c Thu Jul 9 20:11:26 2009 (r195513) @@ -53,20 +53,9 @@ uart_cpu_eqres(struct uart_bas *b1, stru int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { - uint32_t pll_config, div; uint64_t freq; - /* PLL freq */ - pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG); - div = ((pll_config >> PLL_FB_SHIFT) & PLL_FB_MASK) + 1; - freq = div * AR71XX_BASE_FREQ; - /* CPU freq */ - div = ((pll_config >> PLL_CPU_DIV_SEL_SHIFT) & PLL_CPU_DIV_SEL_MASK) - + 1; - freq = freq / div; - /* AHB freq */ - div = (((pll_config >> PLL_AHB_DIV_SHIFT) & PLL_AHB_DIV_MASK) + 1) * 2; - freq = freq / div; + freq = ar71xx_ahb_freq(); di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 20:16:01 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 929E4106567D; Thu, 9 Jul 2009 20:16:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E81B8FC1A; Thu, 9 Jul 2009 20:16:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69KG1BL096025; Thu, 9 Jul 2009 20:16:01 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69KG1Hp096020; Thu, 9 Jul 2009 20:16:01 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <200907092016.n69KG1Hp096020@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Jul 2009 20:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195514 - in projects/mips/sys/mips: atheros conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 20:16:02 -0000 Author: gonzo Date: Thu Jul 9 20:16:01 2009 New Revision: 195514 URL: http://svn.freebsd.org/changeset/base/195514 Log: - Add AR71XX watchdog timer driver Added: projects/mips/sys/mips/atheros/ar71xx_wdog.c Modified: projects/mips/sys/mips/atheros/files.ar71xx projects/mips/sys/mips/conf/AR71XX projects/mips/sys/mips/conf/AR71XX.hints Added: projects/mips/sys/mips/atheros/ar71xx_wdog.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/mips/sys/mips/atheros/ar71xx_wdog.c Thu Jul 9 20:16:01 2009 (r195514) @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Watchdog driver for AR71xx + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +struct ar71xx_wdog_softc { + device_t dev; + int armed; +}; + +static void +ar71xx_wdog_watchdog_fn(void *private, u_int cmd, int *error) +{ + struct ar71xx_wdog_softc *sc = private; + uint64_t timer_val; + + cmd &= WD_INTERVAL; + if (cmd > 0) { + timer_val = (uint64_t)(1ULL << cmd) * ar71xx_ahb_freq() / + 1000000000; + /* + * Load timer with large enough value to prevent spurious + * reset + */ + ATH_WRITE_REG(AR71XX_RST_WDOG_TIMER, + ar71xx_ahb_freq() * 10); + ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, + RST_WDOG_ACTION_RESET); + ATH_WRITE_REG(AR71XX_RST_WDOG_TIMER, + (timer_val & 0xffffffff)); + sc->armed = 1; + *error = 0; + } else { + if (sc->armed) { + ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, + RST_WDOG_ACTION_NOACTION); + sc->armed = 0; + } + } +} + +static int +ar71xx_wdog_probe(device_t dev) +{ + + device_set_desc(dev, "Atheros AR71XX watchdog timer"); + return (0); +} + +static int +ar71xx_wdog_attach(device_t dev) +{ + struct ar71xx_wdog_softc *sc = device_get_softc(dev); + + if (ATH_READ_REG(AR71XX_RST_WDOG_CONTROL) & RST_WDOG_LAST) + device_printf (dev, + "Previous reset was due to watchdog timeout\n"); + + ATH_WRITE_REG(AR71XX_RST_WDOG_CONTROL, RST_WDOG_ACTION_NOACTION); + + sc->dev = dev; + EVENTHANDLER_REGISTER(watchdog_list, ar71xx_wdog_watchdog_fn, sc, 0); + + return (0); +} + +static device_method_t ar71xx_wdog_methods[] = { + DEVMETHOD(device_probe, ar71xx_wdog_probe), + DEVMETHOD(device_attach, ar71xx_wdog_attach), + {0, 0}, +}; + +static driver_t ar71xx_wdog_driver = { + "ar71xx_wdog", + ar71xx_wdog_methods, + sizeof(struct ar71xx_wdog_softc), +}; +static devclass_t ar71xx_wdog_devclass; + +DRIVER_MODULE(ar71xx_wdog, nexus, ar71xx_wdog_driver, ar71xx_wdog_devclass, 0, 0); Modified: projects/mips/sys/mips/atheros/files.ar71xx ============================================================================== --- projects/mips/sys/mips/atheros/files.ar71xx Thu Jul 9 20:11:26 2009 (r195513) +++ projects/mips/sys/mips/atheros/files.ar71xx Thu Jul 9 20:16:01 2009 (r195514) @@ -7,6 +7,7 @@ mips/atheros/ar71xx_ohci.c optional ohci mips/atheros/ar71xx_pci.c optional pci mips/atheros/ar71xx_pci_bus_space.c optional pci mips/atheros/ar71xx_spi.c optional ar71xx_spi +mips/atheros/ar71xx_wdog.c optional ar71xx_wdog mips/atheros/if_arge.c optional arge mips/atheros/uart_bus_ar71xx.c optional uart mips/atheros/uart_cpu_ar71xx.c optional uart Modified: projects/mips/sys/mips/conf/AR71XX ============================================================================== --- projects/mips/sys/mips/conf/AR71XX Thu Jul 9 20:11:26 2009 (r195513) +++ projects/mips/sys/mips/conf/AR71XX Thu Jul 9 20:16:01 2009 (r195514) @@ -74,6 +74,8 @@ device ar71xx_spi device mx25l # device geom_redboot +device ar71xx_wdog + device uart device loop Modified: projects/mips/sys/mips/conf/AR71XX.hints ============================================================================== --- projects/mips/sys/mips/conf/AR71XX.hints Thu Jul 9 20:11:26 2009 (r195513) +++ projects/mips/sys/mips/conf/AR71XX.hints Thu Jul 9 20:16:01 2009 (r195514) @@ -41,3 +41,6 @@ hint.spi.0.msize=0x10 hint.mx25l.0.at="spibus0" hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 20:49:56 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89BF6106566B; Thu, 9 Jul 2009 20:49:56 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DBFE8FC0C; Thu, 9 Jul 2009 20:49:56 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69KnuZM096841; Thu, 9 Jul 2009 20:49:56 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69KnuEY096839; Thu, 9 Jul 2009 20:49:56 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907092049.n69KnuEY096839@svn.freebsd.org> From: Rui Paulo Date: Thu, 9 Jul 2009 20:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195516 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 20:49:56 -0000 Author: rpaulo Date: Thu Jul 9 20:49:56 2009 New Revision: 195516 URL: http://svn.freebsd.org/changeset/base/195516 Log: Rework mesh_forward() to use if_start instead of raw_xmit. Gives more throughput. Sponsored by: sam Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 20:22:05 2009 (r195515) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 20:49:56 2009 (r195516) @@ -681,13 +681,12 @@ mesh_forward(struct ieee80211vap *vap, s struct ieee80211com *ic = vap->iv_ic; struct ieee80211_mesh_state *ms = vap->iv_mesh; struct ifnet *ifp = vap->iv_ifp; + struct ifnet *parent = ic->ic_ifp; const struct ieee80211_frame *wh = mtod(m, const struct ieee80211_frame *); struct mbuf *mcopy; struct ieee80211_meshcntl *mccopy; struct ieee80211_frame *whcopy; - const struct ieee80211_txparam *tp; - struct ieee80211_bpf_params params; struct ieee80211_node *ni; int err; @@ -724,16 +723,11 @@ mesh_forward(struct ieee80211vap *vap, s whcopy = mtod(mcopy, struct ieee80211_frame *); mccopy = (struct ieee80211_meshcntl *) (mtod(mcopy, uint8_t *) + ieee80211_hdrspace(ic, wh)); - memset(¶ms, 0, sizeof(params)); /* XXX clear other bits? */ whcopy->i_fc[1] &= ~IEEE80211_FC1_RETRY; IEEE80211_ADDR_COPY(whcopy->i_addr2, vap->iv_myaddr); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { - ni = vap->iv_bss; - tp = ni->ni_txparms; - params.ibp_rate0 = tp->mcastrate; - params.ibp_flags |= IEEE80211_BPF_NOACK; - params.ibp_try0 = 1; + ni = ieee80211_ref_node(vap->iv_bss); mcopy->m_flags |= M_MCAST; } else { ni = mesh_find_txnode(vap, whcopy->i_addr3); @@ -744,36 +738,28 @@ mesh_forward(struct ieee80211vap *vap, s m_freem(mcopy); return; } - tp = ni->ni_txparms; - params.ibp_rate0 = tp->ucastrate; - params.ibp_try0 = tp->maxretry; IEEE80211_ADDR_COPY(whcopy->i_addr1, ni->ni_macaddr); } IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, ni, "fwd %s frame from %s ttl %d", IEEE80211_IS_MULTICAST(wh->i_addr1) ? "mcast" : "ucast", ether_sprintf(wh->i_addr3), mccopy->mc_ttl); + KASSERT(mccopy->mc_ttl > 0, ("%s called with wrong ttl", __func__)); mccopy->mc_ttl--; + /* XXX calculate priority so drivers can find the tx queue */ M_WME_SETAC(mcopy, WME_AC_BE); - params.ibp_pri = M_WME_GETAC(mcopy); - params.ibp_power = ni->ni_txpower; -#ifdef IEEE80211_DEBUG_REFCNT - IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE, - "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", - __func__, __LINE__, - ni, ether_sprintf(ni->ni_macaddr), - ieee80211_node_refcnt(ni)+1); -#endif - ieee80211_ref_node(ni); - err = ic->ic_raw_xmit(ni, mcopy, ¶ms); - if (err) { + + /* XXX do we know m_nextpkt is NULL? */ + mcopy->m_pkthdr.rcvif = (void *) ni; + err = parent->if_transmit(parent, mcopy); + if (err != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ - ifp->if_oerrors++; ieee80211_free_node(ni); - } else + } else { ifp->if_opackets++; + } } static int From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 22:10:29 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1B04106564A; Thu, 9 Jul 2009 22:10:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A09848FC17; Thu, 9 Jul 2009 22:10:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69MATI3098581; Thu, 9 Jul 2009 22:10:29 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69MATxh098579; Thu, 9 Jul 2009 22:10:29 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907092210.n69MATxh098579@svn.freebsd.org> From: Sam Leffler Date: Thu, 9 Jul 2009 22:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195517 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 22:10:29 -0000 Author: sam Date: Thu Jul 9 22:10:29 2009 New Revision: 195517 URL: http://svn.freebsd.org/changeset/base/195517 Log: add %b mbuf flag bits for tx/rx Modified: projects/mesh11s/sys/net80211/ieee80211_freebsd.h Modified: projects/mesh11s/sys/net80211/ieee80211_freebsd.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_freebsd.h Thu Jul 9 20:49:56 2009 (r195516) +++ projects/mesh11s/sys/net80211/ieee80211_freebsd.h Thu Jul 9 22:10:29 2009 (r195517) @@ -209,6 +209,19 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_AMPDU_MPDU M_PROTO8 /* A-MPDU re-order done */ #endif #define M_80211_RX (M_AMPDU|M_WEP|M_AMPDU_MPDU) + +#define IEEE80211_MBUF_TX_FLAG_BITS \ + "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_ENCAP\6M_WEP\7M_EAPOL" \ + "\10M_PWR_SAV\11M_MORE_DATA\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG" \ + "\16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC" \ + "\23M_NOFREE\24M_FF\25M_TXCB\26M_AMPDU_MPDU\27M_FLOWID" + +#define IEEE80211_MBUF_RX_FLAG_BITS \ + "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_AMPDU\6M_WEP\7M_PROTO3" \ + "\10M_PROTO4\11M_PROTO5\12M_BCAST\13M_MCAST\14M_FRAG\15M_FIRSTFRAG" \ + "\16M_LASTFRAG\17M_SKIP_FIREWALL\20M_FREELIST\21M_VLANTAG\22M_PROMISC" \ + "\23M_NOFREE\24M_PROTO6\25M_PROTO7\26M_AMPDU_MPDU\27M_FLOWID" + /* * Store WME access control bits in the vlan tag. * This is safe since it's done after the packet is classified From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 22:11:33 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95C001065673; Thu, 9 Jul 2009 22:11:33 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A30F8FC1E; Thu, 9 Jul 2009 22:11:33 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69MBX7H098651; Thu, 9 Jul 2009 22:11:33 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69MBXPr098649; Thu, 9 Jul 2009 22:11:33 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907092211.n69MBXPr098649@svn.freebsd.org> From: Sam Leffler Date: Thu, 9 Jul 2009 22:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195518 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 22:11:33 -0000 Author: sam Date: Thu Jul 9 22:11:33 2009 New Revision: 195518 URL: http://svn.freebsd.org/changeset/base/195518 Log: add ageq+hash key; fixup some other formatting to match Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ddb.c Thu Jul 9 22:10:29 2009 (r195517) +++ projects/mesh11s/sys/net80211/ieee80211_ddb.c Thu Jul 9 22:11:33 2009 (r195518) @@ -75,6 +75,7 @@ static void _db_show_roamparams(const ch const struct ieee80211_roamparam *rp); static void _db_show_txparams(const char *tag, const void *arg, const struct ieee80211_txparam *tp); +static void _db_show_ageq(const char *tag, const struct ieee80211_ageq *q); static void _db_show_stats(const struct ieee80211_stats *); static void _db_show_mesh(const struct ieee80211_mesh_state *); @@ -581,10 +582,13 @@ _db_show_com(const struct ieee80211com * db_printf("\n"); db_printf("\tmax_keyix %d", ic->ic_max_keyix); + db_printf(" hash_key 0x%x", ic->ic_hash_key); db_printf(" wme %p", &ic->ic_wme); if (!showsta) db_printf(" sta %p", &ic->ic_sta); db_printf("\n"); + db_printf("\tstageq@%p:\n", &ic->ic_stageq); + _db_show_ageq("\t", &ic->ic_stageq); if (showsta) _db_show_node_table("\t", &ic->ic_sta); @@ -661,16 +665,16 @@ _db_show_node_table(const char *tag, con int i; db_printf("%s%s@%p:\n", tag, nt->nt_name, nt); - db_printf("%s nodelock %p", tag, &nt->nt_nodelock); + db_printf("%s nodelock %p", tag, &nt->nt_nodelock); db_printf(" inact_init %d", nt->nt_inact_init); db_printf(" scanlock %p", &nt->nt_scanlock); db_printf(" scangen %u\n", nt->nt_scangen); - db_printf("%s keyixmax %d keyixmap %p\n", + db_printf("%s keyixmax %d keyixmap %p\n", tag, nt->nt_keyixmax, nt->nt_keyixmap); for (i = 0; i < nt->nt_keyixmax; i++) { const struct ieee80211_node *ni = nt->nt_keyixmap[i]; if (ni != NULL) - db_printf("%s [%3u] %p %s\n", tag, i, ni, + db_printf("%s [%3u] %p %s\n", tag, i, ni, ether_sprintf(ni->ni_macaddr)); } } @@ -828,6 +832,20 @@ _db_show_txparams(const char *tag, const } static void +_db_show_ageq(const char *tag, const struct ieee80211_ageq *q) +{ + const struct mbuf *m; + + db_printf("%s lock %p len %d maxlen %d drops %d head %p tail %p\n", + tag, &q->aq_lock, q->aq_len, q->aq_maxlen, q->aq_drops, + q->aq_head, q->aq_tail); + for (m = q->aq_head; m != NULL; m = m->m_nextpkt) + db_printf("%s %p (len %d, %b)\n", tag, m, m->m_len, + /* XXX could be either TX or RX but is mostly TX */ + m->m_flags, IEEE80211_MBUF_TX_FLAG_BITS); +} + +static void _db_show_stats(const struct ieee80211_stats *is) { } From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 23:12:49 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F4AC1065791; Thu, 9 Jul 2009 23:12:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 495118FC1C; Thu, 9 Jul 2009 23:12:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69NCm2u000109; Thu, 9 Jul 2009 23:12:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69NCmAF000104; Thu, 9 Jul 2009 23:12:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907092312.n69NCmAF000104@svn.freebsd.org> From: Sam Leffler Date: Thu, 9 Jul 2009 23:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195520 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 23:12:49 -0000 Author: sam Date: Thu Jul 9 23:12:47 2009 New Revision: 195520 URL: http://svn.freebsd.org/changeset/base/195520 Log: Give mac acl's some tlc: o use the linker set mechanism for ioctls and remove the aclator hooks; this pushes more code out of ieee80211_ioctl.c and allows further simplifications in the future o mark ieee80211req_maclist __packed to fix list mac on arm Modified: projects/mesh11s/sys/net80211/ieee80211_acl.c projects/mesh11s/sys/net80211/ieee80211_ioctl.c projects/mesh11s/sys/net80211/ieee80211_ioctl.h projects/mesh11s/sys/net80211/ieee80211_proto.h Modified: projects/mesh11s/sys/net80211/ieee80211_acl.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_acl.c Thu Jul 9 22:21:18 2009 (r195519) +++ projects/mesh11s/sys/net80211/ieee80211_acl.c Thu Jul 9 23:12:47 2009 (r195520) @@ -277,20 +277,18 @@ acl_getpolicy(struct ieee80211vap *vap) } static int -acl_setioctl(struct ieee80211vap *vap, struct ieee80211req *ireq) +acl_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { - - return EINVAL; -} - -static int -acl_getioctl(struct ieee80211vap *vap, struct ieee80211req *ireq) -{ - struct aclstate *as = vap->iv_as; + struct aclstate *as; struct acl *acl; struct ieee80211req_maclist *ap; int error, space, i; + if (ireq->i_type != IEEE80211_IOC_MACCMD) + return ENOSYS; + if (vap->iv_acl == NULL) + return EINVAL; + as = vap->iv_as; switch (ireq->i_val) { case IEEE80211_MACCMD_POLICY: ireq->i_val = as->as_policy; @@ -322,6 +320,85 @@ acl_getioctl(struct ieee80211vap *vap, s } return EINVAL; } +IEEE80211_IOCTL_GET(acl, acl_ioctl_get80211); + +static int +acl_ioctl_macmac(struct ieee80211vap *vap, struct ieee80211req *ireq) +{ + uint8_t mac[IEEE80211_ADDR_LEN]; + const struct ieee80211_aclator *acl = vap->iv_acl; + int error; + + if (ireq->i_len != sizeof(mac)) + return EINVAL; + error = copyin(ireq->i_data, mac, ireq->i_len); + if (error) + return error; + if (acl == NULL) { + acl = ieee80211_aclator_get("mac"); + if (acl == NULL || !acl_attach(vap)) + return EINVAL; + vap->iv_acl = acl; + } + if (ireq->i_type == IEEE80211_IOC_ADDMAC) + acl_add(vap, mac); + else + acl_remove(vap, mac); + return 0; +} + +static int +acl_ioctl_setmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) +{ + const struct ieee80211_aclator *acl = vap->iv_acl; + + switch (ireq->i_val) { + case IEEE80211_MACCMD_POLICY_OPEN: + case IEEE80211_MACCMD_POLICY_ALLOW: + case IEEE80211_MACCMD_POLICY_DENY: + case IEEE80211_MACCMD_POLICY_RADIUS: + if (acl == NULL) { + acl = ieee80211_aclator_get("mac"); + if (acl == NULL || !acl_attach(vap)) + return EINVAL; + vap->iv_acl = acl; + } + acl_setpolicy(vap, ireq->i_val); + break; + case IEEE80211_MACCMD_FLUSH: + if (acl != NULL) + acl_free_all(vap); + /* NB: silently ignore when not in use */ + break; + case IEEE80211_MACCMD_DETACH: + if (acl != NULL) { + vap->iv_acl = NULL; + acl_detach(vap); + } + break; + default: + return EINVAL; + } + return 0; +} + +static int +acl_ioctl_set80211(struct ieee80211vap *vap, struct ieee80211req *ireq) +{ + switch (ireq->i_type) { + case IEEE80211_IOC_ADDMAC: + case IEEE80211_IOC_DELMAC: + return acl_ioctl_macmac(vap, ireq); + break; + case IEEE80211_IOC_MACCMD: + return acl_ioctl_setmaccmd(vap, ireq); + break; + default: + return ENOSYS; + } + return 0; +} +IEEE80211_IOCTL_SET(acl, acl_ioctl_set80211); static const struct ieee80211_aclator mac = { .iac_name = "mac", @@ -333,7 +410,5 @@ static const struct ieee80211_aclator ma .iac_flush = acl_free_all, .iac_setpolicy = acl_setpolicy, .iac_getpolicy = acl_getpolicy, - .iac_setioctl = acl_setioctl, - .iac_getioctl = acl_getioctl, }; IEEE80211_ACL_MODULE(wlan_acl, mac, 1); Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.c Thu Jul 9 22:21:18 2009 (r195519) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.c Thu Jul 9 23:12:47 2009 (r195520) @@ -585,14 +585,6 @@ ieee80211_ioctl_getwmeparam(struct ieee8 } static __noinline int -ieee80211_ioctl_getmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) -{ - const struct ieee80211_aclator *acl = vap->iv_acl; - - return (acl == NULL ? EINVAL : acl->iac_getioctl(vap, ireq)); -} - -static __noinline int ieee80211_ioctl_getcurchan(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -985,9 +977,6 @@ ieee80211_ioctl_get80211(struct ieee8021 case IEEE80211_IOC_FRAGTHRESHOLD: ireq->i_val = vap->iv_fragthreshold; break; - case IEEE80211_IOC_MACCMD: - error = ieee80211_ioctl_getmaccmd(vap, ireq); - break; case IEEE80211_IOC_BURST: ireq->i_val = (vap->iv_flags & IEEE80211_F_BURST) != 0; break; @@ -1514,69 +1503,6 @@ ieee80211_ioctl_setmlme(struct ieee80211 } static __noinline int -ieee80211_ioctl_macmac(struct ieee80211vap *vap, struct ieee80211req *ireq) -{ - uint8_t mac[IEEE80211_ADDR_LEN]; - const struct ieee80211_aclator *acl = vap->iv_acl; - int error; - - if (ireq->i_len != sizeof(mac)) - return EINVAL; - error = copyin(ireq->i_data, mac, ireq->i_len); - if (error) - return error; - if (acl == NULL) { - acl = ieee80211_aclator_get("mac"); - if (acl == NULL || !acl->iac_attach(vap)) - return EINVAL; - vap->iv_acl = acl; - } - if (ireq->i_type == IEEE80211_IOC_ADDMAC) - acl->iac_add(vap, mac); - else - acl->iac_remove(vap, mac); - return 0; -} - -static __noinline int -ieee80211_ioctl_setmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) -{ - const struct ieee80211_aclator *acl = vap->iv_acl; - - switch (ireq->i_val) { - case IEEE80211_MACCMD_POLICY_OPEN: - case IEEE80211_MACCMD_POLICY_ALLOW: - case IEEE80211_MACCMD_POLICY_DENY: - case IEEE80211_MACCMD_POLICY_RADIUS: - if (acl == NULL) { - acl = ieee80211_aclator_get("mac"); - if (acl == NULL || !acl->iac_attach(vap)) - return EINVAL; - vap->iv_acl = acl; - } - acl->iac_setpolicy(vap, ireq->i_val); - break; - case IEEE80211_MACCMD_FLUSH: - if (acl != NULL) - acl->iac_flush(vap); - /* NB: silently ignore when not in use */ - break; - case IEEE80211_MACCMD_DETACH: - if (acl != NULL) { - vap->iv_acl = NULL; - acl->iac_detach(vap); - } - break; - default: - if (acl == NULL) - return EINVAL; - else - return acl->iac_setioctl(vap, ireq); - } - return 0; -} - -static __noinline int ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -2833,13 +2759,6 @@ ieee80211_ioctl_set80211(struct ieee8021 ieee80211_syncflag_ht(vap, -IEEE80211_FHT_USEHT40); error = ENETRESET; break; - case IEEE80211_IOC_ADDMAC: - case IEEE80211_IOC_DELMAC: - error = ieee80211_ioctl_macmac(vap, ireq); - break; - case IEEE80211_IOC_MACCMD: - error = ieee80211_ioctl_setmaccmd(vap, ireq); - break; case IEEE80211_IOC_STA_STATS: error = ieee80211_ioctl_setstastats(vap, ireq); break; Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.h Thu Jul 9 22:21:18 2009 (r195519) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.h Thu Jul 9 23:12:47 2009 (r195520) @@ -315,7 +315,7 @@ enum { struct ieee80211req_maclist { uint8_t ml_macaddr[IEEE80211_ADDR_LEN]; -}; +} __packed; /* * Mesh Routing Table Operations. Modified: projects/mesh11s/sys/net80211/ieee80211_proto.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_proto.h Thu Jul 9 22:21:18 2009 (r195519) +++ projects/mesh11s/sys/net80211/ieee80211_proto.h Thu Jul 9 23:12:47 2009 (r195520) @@ -177,7 +177,6 @@ void ieee80211_authenticator_register(in void ieee80211_authenticator_unregister(int type); const struct ieee80211_authenticator *ieee80211_authenticator_get(int auth); -struct ieee80211req; /* * Template for an MAC ACL policy module. Such modules * register with the protocol code and are passed the sender's @@ -196,8 +195,6 @@ struct ieee80211_aclator { int (*iac_flush)(struct ieee80211vap *); int (*iac_setpolicy)(struct ieee80211vap *, int); int (*iac_getpolicy)(struct ieee80211vap *); - int (*iac_setioctl)(struct ieee80211vap *, struct ieee80211req *); - int (*iac_getioctl)(struct ieee80211vap *, struct ieee80211req *); }; void ieee80211_aclator_register(const struct ieee80211_aclator *); void ieee80211_aclator_unregister(const struct ieee80211_aclator *); From owner-svn-src-projects@FreeBSD.ORG Thu Jul 9 23:50:37 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66287106566C; Thu, 9 Jul 2009 23:50:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55F758FC0C; Thu, 9 Jul 2009 23:50:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n69NobYF000969; Thu, 9 Jul 2009 23:50:37 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n69NobnS000967; Thu, 9 Jul 2009 23:50:37 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907092350.n69NobnS000967@svn.freebsd.org> From: Sam Leffler Date: Thu, 9 Jul 2009 23:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195521 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2009 23:50:37 -0000 Author: sam Date: Thu Jul 9 23:50:37 2009 New Revision: 195521 URL: http://svn.freebsd.org/changeset/base/195521 Log: add a hack to flush pending frames in the stageq waiting for path discovery; this belongs in the hwmp module hidden behind a method pointer and probably is needed for other cases but will leave that for rui Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 23:12:47 2009 (r195520) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Thu Jul 9 23:50:37 2009 (r195521) @@ -348,6 +348,7 @@ ieee80211_mesh_detach(struct ieee80211co static void mesh_vdetach_peers(void *arg, struct ieee80211_node *ni) { + struct ieee80211com *ic = ni->ni_ic; uint16_t args[3]; if (ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED) { @@ -360,6 +361,9 @@ mesh_vdetach_peers(void *arg, struct iee args); } callout_stop(&ni->ni_mltimer); + /* XXX belongs in hwmp */ + ieee80211_ageq_drain_node(&ic->ic_stageq, + (void *)(uintptr_t) ieee80211_mac_hash(ic, ni->ni_macaddr)); } From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 00:04:52 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53F941065678; Fri, 10 Jul 2009 00:04:52 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B5848FC22; Fri, 10 Jul 2009 00:04:52 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A04qMK001315; Fri, 10 Jul 2009 00:04:52 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A04qgF001313; Fri, 10 Jul 2009 00:04:52 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <200907100004.n6A04qgF001313@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 10 Jul 2009 00:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195522 - projects/jbuild/usr.bin/jdirdep X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 00:04:52 -0000 Author: rodrigc Date: Fri Jul 10 00:04:51 2009 New Revision: 195522 URL: http://svn.freebsd.org/changeset/base/195522 Log: Add #!/bin/sh at top of shell script. Modified: projects/jbuild/usr.bin/jdirdep/jgetsrc Modified: projects/jbuild/usr.bin/jdirdep/jgetsrc ============================================================================== --- projects/jbuild/usr.bin/jdirdep/jgetsrc Thu Jul 9 23:50:37 2009 (r195521) +++ projects/jbuild/usr.bin/jdirdep/jgetsrc Fri Jul 10 00:04:51 2009 (r195522) @@ -1,3 +1,5 @@ +#!/bin/sh + dirs=$* ROOTDIR=`pwd` From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 00:40:15 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD9F310656A6; Fri, 10 Jul 2009 00:40:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BCC18FC1B; Fri, 10 Jul 2009 00:40:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A0eFoP002054; Fri, 10 Jul 2009 00:40:15 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A0eFnO002052; Fri, 10 Jul 2009 00:40:15 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907100040.n6A0eFnO002052@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 00:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195523 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 00:40:18 -0000 Author: sam Date: Fri Jul 10 00:40:15 2009 New Revision: 195523 URL: http://svn.freebsd.org/changeset/base/195523 Log: correctly set the tailq ptr when removing the last item in the q Modified: projects/mesh11s/sys/net80211/ieee80211_ageq.c Modified: projects/mesh11s/sys/net80211/ieee80211_ageq.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ageq.c Fri Jul 10 00:04:51 2009 (r195522) +++ projects/mesh11s/sys/net80211/ieee80211_ageq.c Fri Jul 10 00:40:15 2009 (r195523) @@ -211,7 +211,6 @@ ieee80211_ageq_remove(struct ieee80211_a /* * Remove from forward list; tail pointer is harder. */ - *prev = m->m_nextpkt; if (aq->aq_tail == m) { KASSERT(m->m_nextpkt == NULL, ("not last")); if (aq->aq_head == m) { /* list empty */ @@ -223,6 +222,8 @@ ieee80211_ageq_remove(struct ieee80211_a offsetof(struct mbuf, m_nextpkt)); } } + *prev = m->m_nextpkt; + /* add to private list for return */ *phead = m; phead = &m->m_nextpkt; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 00:40:33 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E1861065697; Fri, 10 Jul 2009 00:40:33 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15CC58FC08; Fri, 10 Jul 2009 00:40:33 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A0eWAe002099; Fri, 10 Jul 2009 00:40:32 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A0eWTC002097; Fri, 10 Jul 2009 00:40:32 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907100040.n6A0eWTC002097@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 00:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195524 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 00:40:36 -0000 Author: sam Date: Fri Jul 10 00:40:32 2009 New Revision: 195524 URL: http://svn.freebsd.org/changeset/base/195524 Log: add %b support for mesh link state values Modified: projects/mesh11s/sys/net80211/ieee80211_node.h Modified: projects/mesh11s/sys/net80211/ieee80211_node.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.h Fri Jul 10 00:40:15 2009 (r195523) +++ projects/mesh11s/sys/net80211/ieee80211_node.h Fri Jul 10 00:40:32 2009 (r195524) @@ -100,6 +100,8 @@ enum ieee80211_mesh_mlstate { IEEE80211_NODE_MESH_ESTABLISHED = 4, /* link established */ IEEE80211_NODE_MESH_HOLDING = 5, /* link closing */ }; +#define IEEE80211_MESH_MLSTATE_BITS \ + "\20\1IDLE\2OPENSNT\2OPENRCV\3CONFIRMRCV\4ESTABLISHED\5HOLDING" /* * Node specific information. Note that drivers are expected From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 00:40:56 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32506106567B; Fri, 10 Jul 2009 00:40:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 203008FC1D; Fri, 10 Jul 2009 00:40:56 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A0euC5002142; Fri, 10 Jul 2009 00:40:56 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A0euv1002140; Fri, 10 Jul 2009 00:40:56 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907100040.n6A0euv1002140@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 00:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195525 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 00:40:57 -0000 Author: sam Date: Fri Jul 10 00:40:55 2009 New Revision: 195525 URL: http://svn.freebsd.org/changeset/base/195525 Log: fix formatting for per-node mesh state Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ddb.c Fri Jul 10 00:40:32 2009 (r195524) +++ projects/mesh11s/sys/net80211/ieee80211_ddb.c Fri Jul 10 00:40:55 2009 (r195525) @@ -298,10 +298,10 @@ _db_show_sta(const struct ieee80211_node db_printf("\tinact %u inact_reload %u txrate %u\n", ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); - _db_show_ssid(" meshid ", 0, ni->ni_meshidlen, ni->ni_meshid); - db_printf("\tmlstate %d mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n", - ni->ni_mlstate, ni->ni_mllid, ni->ni_mlpid, ni->ni_mlrcnt, - ni->ni_mltval); + _db_show_ssid("\tmeshid ", 0, ni->ni_meshidlen, ni->ni_meshid); + db_printf(" mlstate %b mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n", + ni->ni_mlstate, IEEE80211_MESH_MLSTATE_BITS, + ni->ni_mllid, ni->ni_mlpid, ni->ni_mlrcnt, ni->ni_mltval); /* XXX wdsq */ } From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 02:16:00 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EDB6106564A; Fri, 10 Jul 2009 02:16:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 481188FC1A; Fri, 10 Jul 2009 02:16:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A2G0st004208; Fri, 10 Jul 2009 02:16:00 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A2G0GH004204; Fri, 10 Jul 2009 02:16:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907100216.n6A2G0GH004204@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 02:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195526 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 02:16:00 -0000 Author: sam Date: Fri Jul 10 02:15:59 2009 New Revision: 195526 URL: http://svn.freebsd.org/changeset/base/195526 Log: revert all of r195520 except packing the acl struct; linker sets for modules are not merged into existing linker sets so we cannot use it to handle ioctl methods Modified: projects/mesh11s/sys/net80211/ieee80211_acl.c projects/mesh11s/sys/net80211/ieee80211_ioctl.c projects/mesh11s/sys/net80211/ieee80211_proto.h Modified: projects/mesh11s/sys/net80211/ieee80211_acl.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_acl.c Fri Jul 10 00:40:55 2009 (r195525) +++ projects/mesh11s/sys/net80211/ieee80211_acl.c Fri Jul 10 02:15:59 2009 (r195526) @@ -277,18 +277,20 @@ acl_getpolicy(struct ieee80211vap *vap) } static int -acl_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) +acl_setioctl(struct ieee80211vap *vap, struct ieee80211req *ireq) { - struct aclstate *as; + + return EINVAL; +} + +static int +acl_getioctl(struct ieee80211vap *vap, struct ieee80211req *ireq) +{ + struct aclstate *as = vap->iv_as; struct acl *acl; struct ieee80211req_maclist *ap; int error, space, i; - if (ireq->i_type != IEEE80211_IOC_MACCMD) - return ENOSYS; - if (vap->iv_acl == NULL) - return EINVAL; - as = vap->iv_as; switch (ireq->i_val) { case IEEE80211_MACCMD_POLICY: ireq->i_val = as->as_policy; @@ -320,85 +322,6 @@ acl_ioctl_get80211(struct ieee80211vap * } return EINVAL; } -IEEE80211_IOCTL_GET(acl, acl_ioctl_get80211); - -static int -acl_ioctl_macmac(struct ieee80211vap *vap, struct ieee80211req *ireq) -{ - uint8_t mac[IEEE80211_ADDR_LEN]; - const struct ieee80211_aclator *acl = vap->iv_acl; - int error; - - if (ireq->i_len != sizeof(mac)) - return EINVAL; - error = copyin(ireq->i_data, mac, ireq->i_len); - if (error) - return error; - if (acl == NULL) { - acl = ieee80211_aclator_get("mac"); - if (acl == NULL || !acl_attach(vap)) - return EINVAL; - vap->iv_acl = acl; - } - if (ireq->i_type == IEEE80211_IOC_ADDMAC) - acl_add(vap, mac); - else - acl_remove(vap, mac); - return 0; -} - -static int -acl_ioctl_setmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) -{ - const struct ieee80211_aclator *acl = vap->iv_acl; - - switch (ireq->i_val) { - case IEEE80211_MACCMD_POLICY_OPEN: - case IEEE80211_MACCMD_POLICY_ALLOW: - case IEEE80211_MACCMD_POLICY_DENY: - case IEEE80211_MACCMD_POLICY_RADIUS: - if (acl == NULL) { - acl = ieee80211_aclator_get("mac"); - if (acl == NULL || !acl_attach(vap)) - return EINVAL; - vap->iv_acl = acl; - } - acl_setpolicy(vap, ireq->i_val); - break; - case IEEE80211_MACCMD_FLUSH: - if (acl != NULL) - acl_free_all(vap); - /* NB: silently ignore when not in use */ - break; - case IEEE80211_MACCMD_DETACH: - if (acl != NULL) { - vap->iv_acl = NULL; - acl_detach(vap); - } - break; - default: - return EINVAL; - } - return 0; -} - -static int -acl_ioctl_set80211(struct ieee80211vap *vap, struct ieee80211req *ireq) -{ - switch (ireq->i_type) { - case IEEE80211_IOC_ADDMAC: - case IEEE80211_IOC_DELMAC: - return acl_ioctl_macmac(vap, ireq); - break; - case IEEE80211_IOC_MACCMD: - return acl_ioctl_setmaccmd(vap, ireq); - break; - default: - return ENOSYS; - } - return 0; -} -IEEE80211_IOCTL_SET(acl, acl_ioctl_set80211); static const struct ieee80211_aclator mac = { .iac_name = "mac", @@ -410,5 +333,7 @@ static const struct ieee80211_aclator ma .iac_flush = acl_free_all, .iac_setpolicy = acl_setpolicy, .iac_getpolicy = acl_getpolicy, + .iac_setioctl = acl_setioctl, + .iac_getioctl = acl_getioctl, }; IEEE80211_ACL_MODULE(wlan_acl, mac, 1); Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.c Fri Jul 10 00:40:55 2009 (r195525) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.c Fri Jul 10 02:15:59 2009 (r195526) @@ -585,6 +585,14 @@ ieee80211_ioctl_getwmeparam(struct ieee8 } static __noinline int +ieee80211_ioctl_getmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) +{ + const struct ieee80211_aclator *acl = vap->iv_acl; + + return (acl == NULL ? EINVAL : acl->iac_getioctl(vap, ireq)); +} + +static __noinline int ieee80211_ioctl_getcurchan(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -977,6 +985,9 @@ ieee80211_ioctl_get80211(struct ieee8021 case IEEE80211_IOC_FRAGTHRESHOLD: ireq->i_val = vap->iv_fragthreshold; break; + case IEEE80211_IOC_MACCMD: + error = ieee80211_ioctl_getmaccmd(vap, ireq); + break; case IEEE80211_IOC_BURST: ireq->i_val = (vap->iv_flags & IEEE80211_F_BURST) != 0; break; @@ -1503,6 +1514,69 @@ ieee80211_ioctl_setmlme(struct ieee80211 } static __noinline int +ieee80211_ioctl_macmac(struct ieee80211vap *vap, struct ieee80211req *ireq) +{ + uint8_t mac[IEEE80211_ADDR_LEN]; + const struct ieee80211_aclator *acl = vap->iv_acl; + int error; + + if (ireq->i_len != sizeof(mac)) + return EINVAL; + error = copyin(ireq->i_data, mac, ireq->i_len); + if (error) + return error; + if (acl == NULL) { + acl = ieee80211_aclator_get("mac"); + if (acl == NULL || !acl->iac_attach(vap)) + return EINVAL; + vap->iv_acl = acl; + } + if (ireq->i_type == IEEE80211_IOC_ADDMAC) + acl->iac_add(vap, mac); + else + acl->iac_remove(vap, mac); + return 0; +} + +static __noinline int +ieee80211_ioctl_setmaccmd(struct ieee80211vap *vap, struct ieee80211req *ireq) +{ + const struct ieee80211_aclator *acl = vap->iv_acl; + + switch (ireq->i_val) { + case IEEE80211_MACCMD_POLICY_OPEN: + case IEEE80211_MACCMD_POLICY_ALLOW: + case IEEE80211_MACCMD_POLICY_DENY: + case IEEE80211_MACCMD_POLICY_RADIUS: + if (acl == NULL) { + acl = ieee80211_aclator_get("mac"); + if (acl == NULL || !acl->iac_attach(vap)) + return EINVAL; + vap->iv_acl = acl; + } + acl->iac_setpolicy(vap, ireq->i_val); + break; + case IEEE80211_MACCMD_FLUSH: + if (acl != NULL) + acl->iac_flush(vap); + /* NB: silently ignore when not in use */ + break; + case IEEE80211_MACCMD_DETACH: + if (acl != NULL) { + vap->iv_acl = NULL; + acl->iac_detach(vap); + } + break; + default: + if (acl == NULL) + return EINVAL; + else + return acl->iac_setioctl(vap, ireq); + } + return 0; +} + +static __noinline int ieee80211_ioctl_setchanlist(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; @@ -2759,6 +2833,13 @@ ieee80211_ioctl_set80211(struct ieee8021 ieee80211_syncflag_ht(vap, -IEEE80211_FHT_USEHT40); error = ENETRESET; break; + case IEEE80211_IOC_ADDMAC: + case IEEE80211_IOC_DELMAC: + error = ieee80211_ioctl_macmac(vap, ireq); + break; + case IEEE80211_IOC_MACCMD: + error = ieee80211_ioctl_setmaccmd(vap, ireq); + break; case IEEE80211_IOC_STA_STATS: error = ieee80211_ioctl_setstastats(vap, ireq); break; Modified: projects/mesh11s/sys/net80211/ieee80211_proto.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_proto.h Fri Jul 10 00:40:55 2009 (r195525) +++ projects/mesh11s/sys/net80211/ieee80211_proto.h Fri Jul 10 02:15:59 2009 (r195526) @@ -177,6 +177,7 @@ void ieee80211_authenticator_register(in void ieee80211_authenticator_unregister(int type); const struct ieee80211_authenticator *ieee80211_authenticator_get(int auth); +struct ieee80211req; /* * Template for an MAC ACL policy module. Such modules * register with the protocol code and are passed the sender's @@ -195,6 +196,8 @@ struct ieee80211_aclator { int (*iac_flush)(struct ieee80211vap *); int (*iac_setpolicy)(struct ieee80211vap *, int); int (*iac_getpolicy)(struct ieee80211vap *); + int (*iac_setioctl)(struct ieee80211vap *, struct ieee80211req *); + int (*iac_getioctl)(struct ieee80211vap *, struct ieee80211req *); }; void ieee80211_aclator_register(const struct ieee80211_aclator *); void ieee80211_aclator_unregister(const struct ieee80211_aclator *); From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 04:43:58 2009 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FFA71065679; Fri, 10 Jul 2009 04:43:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 3F86E8FC15; Fri, 10 Jul 2009 04:43:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-90.carlnfd1.nsw.optusnet.com.au (c122-107-120-90.carlnfd1.nsw.optusnet.com.au [122.107.120.90]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n6A4hl75001671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Jul 2009 14:43:50 +1000 Date: Fri, 10 Jul 2009 14:43:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <86prc9g8yf.fsf@ds4.des.no> Message-ID: <20090710143710.S47337@delplex.bde.org> References: <200907081526.n68FQYDb055185@svn.freebsd.org> <20090709041145.G46111@delplex.bde.org> <86prc9g8yf.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1974545925-1247201027=:47337" Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, Rui Paulo , Bruce Evans Subject: Re: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 04:43:58 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1974545925-1247201027=:47337 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 9 Jul 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Bruce Evans writes: >> Broken ABIs (e.g., arm?) may add padding at the end of structs, > > Padding at the end of a struct is *required* to ensure proper alignment > of the next element in an array, e.g. Not for arrays of uint8_t's, which were the subject of discussion. I should have written "may add unnatural padding". unnatural :=3D not required for alignment of any member in the struct. Bruce --0-1974545925-1247201027=:47337-- From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 07:18:31 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FAC1106566B; Fri, 10 Jul 2009 07:18:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2FFF8FC08; Fri, 10 Jul 2009 07:18:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A7IU1s010475; Fri, 10 Jul 2009 07:18:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A7IUBg010473; Fri, 10 Jul 2009 07:18:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907100718.n6A7IUBg010473@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 07:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195530 - projects/mips/gnu/usr.bin/binutils/ld X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 07:18:31 -0000 Author: imp Date: Fri Jul 10 07:18:30 2009 New Revision: 195530 URL: http://svn.freebsd.org/changeset/base/195530 Log: Always build all 4 emulators into the mips toolchain. # I think we have a gcc spec file issue with abi=64 since I have to do other # hacks to get it mostly kinda right. Modified: projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips Modified: projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jul 10 06:57:00 2009 (r195529) +++ projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jul 10 07:18:30 2009 (r195530) @@ -10,15 +10,22 @@ NATIVE_EMULATION=elf${_sz}btsmip_fbsd NATIVE_EMULATION=elf${_sz}ltsmip_fbsd .endif -SRCS+= e${NATIVE_EMULATION}.c -CLEANFILES+= e${NATIVE_EMULATION}.c - +MIPS_ABIS=elf32btsmip_fbsd elf32ltsmip_fbsd elf64btsmip_fbsd elf64ltsmip_fbsd +.for abi in ${MIPS_ABIS} +.if (${abi} != ${NATIVE_EMULATION}) +EMS+= ${abi} +.endif +.for ext in ${ELF_SCR_EXT} +LDSCRIPTS+= ${abi}.${ext} +.endfor +SRCS+= e${abi}.c +CLEANFILES+= e${abi}.c # nb: elf32 handles both elf32 and elf64 targets -e${NATIVE_EMULATION}.c: ${.CURDIR}/${NATIVE_EMULATION}.sh emultempl/elf32.em \ +e${abi}.c: ${.CURDIR}/${abi}.sh emultempl/elf32.em \ scripttempl/elf.sc genscripts.sh stringify.sed sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \ ${TOOLS_PREFIX}/usr \ ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \ - ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} \ - ${.CURDIR}/${NATIVE_EMULATION}.sh - + ${abi} "" no ${abi} ${TARGET_TUPLE} \ + ${.CURDIR}/${abi}.sh +.endfor From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 07:19:31 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CC67106566C; Fri, 10 Jul 2009 07:19:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C6918FC17; Fri, 10 Jul 2009 07:19:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A7JVrT010530; Fri, 10 Jul 2009 07:19:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A7JVMb010528; Fri, 10 Jul 2009 07:19:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907100719.n6A7JVMb010528@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 07:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195531 - projects/mips/sys/mips/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 07:19:31 -0000 Author: imp Date: Fri Jul 10 07:19:30 2009 New Revision: 195531 URL: http://svn.freebsd.org/changeset/base/195531 Log: Flag this as a 64-bit build. # Too many flagas needed to build 64-bit, plus different endian, etc. The # makefile is getting kinda gross with ifdefs. Modified: projects/mips/sys/mips/conf/MALTA64 Modified: projects/mips/sys/mips/conf/MALTA64 ============================================================================== --- projects/mips/sys/mips/conf/MALTA64 Fri Jul 10 07:18:30 2009 (r195530) +++ projects/mips/sys/mips/conf/MALTA64 Fri Jul 10 07:19:30 2009 (r195531) @@ -21,6 +21,7 @@ ident MALTA makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" makeoptions MIPS_LITTLE_ENDIAN=defined +makeoptions TARGET_64BIT=t options YAMON From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 07:20:07 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E465B106566C; Fri, 10 Jul 2009 07:20:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D41898FC18; Fri, 10 Jul 2009 07:20:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A7K7JH010593; Fri, 10 Jul 2009 07:20:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A7K7BD010591; Fri, 10 Jul 2009 07:20:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907100720.n6A7K7BD010591@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 07:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195532 - projects/mips/sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 07:20:08 -0000 Author: imp Date: Fri Jul 10 07:20:07 2009 New Revision: 195532 URL: http://svn.freebsd.org/changeset/base/195532 Log: Properly size things for n64 builds. Modified: projects/mips/sys/sys/user.h Modified: projects/mips/sys/sys/user.h ============================================================================== --- projects/mips/sys/sys/user.h Fri Jul 10 07:19:30 2009 (r195531) +++ projects/mips/sys/sys/user.h Fri Jul 10 07:20:07 2009 (r195532) @@ -100,8 +100,12 @@ #define KINFO_PROC_SIZE 768 #endif #ifdef __mips__ +#if defined(__mips_n64) +#define KINFO_PROC_SIZE 1088 +#else #define KINFO_PROC_SIZE 816 #endif +#endif #ifdef __powerpc__ #define KINFO_PROC_SIZE 768 #endif From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 07:21:26 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72C7B1065670; Fri, 10 Jul 2009 07:21:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61BBE8FC08; Fri, 10 Jul 2009 07:21:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6A7LQLY010659; Fri, 10 Jul 2009 07:21:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6A7LQ6i010657; Fri, 10 Jul 2009 07:21:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907100721.n6A7LQ6i010657@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 07:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195533 - projects/mips/sys/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 07:21:27 -0000 Author: imp Date: Fri Jul 10 07:21:26 2009 New Revision: 195533 URL: http://svn.freebsd.org/changeset/base/195533 Log: Add in the emulation selection when linking... We're still not 100% of the way there, but we're better with it. hack.so build now, but we die when we try to link it in. Modified: projects/mips/sys/conf/Makefile.mips Modified: projects/mips/sys/conf/Makefile.mips ============================================================================== --- projects/mips/sys/conf/Makefile.mips Fri Jul 10 07:20:07 2009 (r195532) +++ projects/mips/sys/conf/Makefile.mips Fri Jul 10 07:21:26 2009 (r195533) @@ -53,14 +53,23 @@ SYSTEM_LD+=-EB EXTRA_FLAGS+=-EB TRAMP_LDFLAGS+=-Wl,-EB HACK_EXTRA_FLAGS+=-EB -Wl,-EB +.if defined(TARGET_64BIT) +SYSTEM_LD+=-m elf64btsmip_fbsd +HACK_EXTRA_FLAGS+=-Wl,-m,elf64btsmip_fbsd +.endif .else CFLAGS+=-EL SYSTEM_LD+=-EL EXTRA_FLAGS+=-EL TRAMP_LDFLAGS+=-Wl,-EL HACK_EXTRA_FLAGS+=-EL -Wl,-EL +.if defined(TARGET_64BIT) +SYSTEM_LD+=-m elf64ltsmip_fbsd +HACK_EXTRA_FLAGS+=-Wl,-m,elf64ltsmip_fbsd +.endif .endif + # We add the -fno-pic flag to kernels because otherwise performance # is extremely poor, as well as -mno-abicalls to force no ABI usage. CFLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS) From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 07:30:35 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1E5F1065672; Fri, 10 Jul 2009 07:30:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1C08FC1F; Fri, 10 Jul 2009 07:30:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n6A7PnxJ087026; Fri, 10 Jul 2009 01:25:49 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 10 Jul 2009 01:26:30 -0600 (MDT) Message-Id: <20090710.012630.-875846397.imp@bsdimp.com> To: kientzle@freebsd.org From: "M. Warner Losh" In-Reply-To: <4A561477.7000508@freebsd.org> References: <20090709041145.G46111@delplex.bde.org> <86prc9g8yf.fsf@ds4.des.no> <4A561477.7000508@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, des@des.no, src-committers@freebsd.org, rpaulo@freebsd.org, brde@optusnet.com.au Subject: Re: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 07:30:36 -0000 In message: <4A561477.7000508@freebsd.org> Tim Kientzle writes: : Dag-Erling Sm=F8rgrav wrote: : > Bruce Evans writes: : >> Broken ABIs (e.g., arm?) may add padding at the end of structs, : > = : > Padding at the end of a struct is *required* to ensure proper align= ment : > of the next element in an array, e.g. : > = : > struct foo { int i; char c; } bar[2]; : > = : > Assuming a four-byte alignment requirement for int, the compiler *m= ust* : > add three bytes of padding at the end of struct foo so bar[1].i is : > correctly aligned. : > = : > cf. ISO/IEC 9899:1999 =A76.7.2.1: : > = : > 15 There may be unnamed padding at the end of a structure or union.= : = : Everyone (I hope!) expects alignment in the : case you outlined. But many of us have been : surprised to see the ARM compiler pad : = : struct foo { : char f1[4]; : char f2[1]; : char f3[1]; : }; : = : to 12 bytes. This breaks a lot of traditional : code that uses structs of char arrays to : define memory and disk layouts. : = : I'm not claiming that the ARM compiler is broken, : just that its padding behavior surprises : a lot of people. It isn't a compiler bug. It is an ABI requirement for ARM. At least for the ABI we use. there are others that might be better, and not suffer from this surprise. We[*] should investigate them. Warner [*] By "we" of course I mean "some smart guy that isn't me" :) From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 10:28:39 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDE5106564A; Fri, 10 Jul 2009 10:28:39 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f227.google.com (mail-ew0-f227.google.com [209.85.219.227]) by mx1.freebsd.org (Postfix) with ESMTP id 7F9528FC18; Fri, 10 Jul 2009 10:28:38 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ewy27 with SMTP id 27so89249ewy.43 for ; Fri, 10 Jul 2009 03:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=uS0rPrmQdjAIgKdiHm7V+BZrA2H12fS9MFPE+TNc3Ik=; b=X0wIvuSocmVsDqRIap9G6zrK27wqq6pRIKwABu6mUEH5HWipeu2Sf7ORhaSTUnqWa+ dGYgC4oVWGgiGM0NR50KjAXc+ny4GZ5zdzm22EqL3jYxlTtYqlEnGYnKpZsnjFunGTk4 gLjqKyfLR6Qw4sFuQt8v3+DkEI38gdfbSk0iE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=gMlUMUErhcqUrIQ+1r3eyzT8L+Yj4LQpI++I3MmtEQmFPacfbG01EI7jQOH/j3Tyv0 QKMb12NdD26QU481Ry42VG5qHT5fid/GvJ5hLVVt/qw/KXW4Wkqzlg7klm6RM0Kb3RXg KgRIl5opCRlIRMGCIZzT/KEl52w26+0rClD6k= Received: by 10.210.63.18 with SMTP id l18mr2261178eba.11.1247221717351; Fri, 10 Jul 2009 03:28:37 -0700 (PDT) Received: from omega.lan (bl6-157-190.dsl.telepac.pt [82.155.157.190]) by mx.google.com with ESMTPS id 5sm2348690eyf.24.2009.07.10.03.28.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 10 Jul 2009 03:28:36 -0700 (PDT) Sender: Rui Paulo Message-Id: <8C5DD2ED-C2C2-4101-8FCC-4690A838684B@freebsd.org> From: Rui Paulo To: M. Warner Losh In-Reply-To: <20090710.012630.-875846397.imp@bsdimp.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Fri, 10 Jul 2009 11:28:35 +0100 References: <20090709041145.G46111@delplex.bde.org> <86prc9g8yf.fsf@ds4.des.no> <4A561477.7000508@freebsd.org> <20090710.012630.-875846397.imp@bsdimp.com> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-projects@freebsd.org, des@des.no, kientzle@freebsd.org, src-committers@freebsd.org, brde@optusnet.com.au Subject: Re: svn commit: r195460 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 10:28:39 -0000 On 10 Jul 2009, at 08:26, M. Warner Losh wrote: > It isn't a compiler bug. It is an ABI requirement for ARM. At least > for the ABI we use. there are others that might be better, and not > suffer from this surprise. We[*] should investigate them. Verbatim copy from gcc/config/arm/netbsd-elf.h: /* VERY BIG NOTE: Change of structure alignment for NetBSD/arm. There are consequences you should be aware of... Normally GCC/arm uses a structure alignment of 32 for compatibility with armcc. This means that structures are padded to a word boundary. However this causes problems with bugged NetBSD kernel code (possibly userland code as well - I have not checked every binary). The nature of this bugged code is to rely on sizeof() returning the correct size of various structures rounded to the nearest byte (SCSI and ether code are two examples, the vm system is another). This code breaks when the structure alignment is 32 as sizeof() will report a word=rounded size. By changing the structure alignment to 8. GCC will conform to what is expected by NetBSD. This has several side effects that should be considered. 1. Structures will only be aligned to the size of the largest member. i.e. structures containing only bytes will be byte aligned. structures containing shorts will be half word aligned. structures containing ints will be word aligned. This means structures should be padded to a word boundary if alignment of 32 is required for byte structures etc. 2. A potential performance penalty may exist if strings are no longer word aligned. GCC will not be able to use word load/stores to copy short strings. This modification is not encouraged but with the present state of the NetBSD source tree it is currently the only solution that meets the requirements. */ #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 -- So, this is how NetBSD avoided it, don't know if it's the best way to do it. We have DEFAULT_STRUCTURE_SIZE_BOUNDARY equal to 32 (the default), so our case is different and this is the reason why alignment will always be done on a word basis. -- Rui Paulo From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 10:49:24 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0492106566C; Fri, 10 Jul 2009 10:49:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F45F8FC1C; Fri, 10 Jul 2009 10:49:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AAnOSX017548; Fri, 10 Jul 2009 10:49:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AAnOPK017546; Fri, 10 Jul 2009 10:49:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101049.n6AAnOPK017546@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 10:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195536 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 10:49:24 -0000 Author: rpaulo Date: Fri Jul 10 10:49:24 2009 New Revision: 195536 URL: http://svn.freebsd.org/changeset/base/195536 Log: Clarify comment. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211.h Modified: projects/mesh11s/sys/net80211/ieee80211.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211.h Fri Jul 10 10:29:16 2009 (r195535) +++ projects/mesh11s/sys/net80211/ieee80211.h Fri Jul 10 10:49:24 2009 (r195536) @@ -707,8 +707,9 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * XXXRP: new IEs for 11s. Keep them compatible with Linux until - * ANA defines new ones. + * 802.11s IEs based on D3.0 spec and were not assigned by + * ANA. Beware changing them because some of them are being + * kept compatible with Linux. */ IEEE80211_ELEMID_MESHCONF = 51, IEEE80211_ELEMID_MESHID = 52, From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 10:51:15 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E350A106567D; Fri, 10 Jul 2009 10:51:15 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D007E8FC08; Fri, 10 Jul 2009 10:51:15 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AApFm8017622; Fri, 10 Jul 2009 10:51:15 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AApFwA017620; Fri, 10 Jul 2009 10:51:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101051.n6AApFwA017620@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 10:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195537 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 10:51:16 -0000 Author: rpaulo Date: Fri Jul 10 10:51:15 2009 New Revision: 195537 URL: http://svn.freebsd.org/changeset/base/195537 Log: Make is_spare the size it was before. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jul 10 10:49:24 2009 (r195536) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jul 10 10:51:15 2009 (r195537) @@ -236,7 +236,7 @@ struct ieee80211_stats { uint32_t is_hwmp_rootreqs; /* root PREQs sent */ uint32_t is_hwmp_rootrann; /* root RANNs sent */ - uint32_t is_spare[7]; + uint32_t is_spare[16]; }; /* From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 10:52:27 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63AFA106566B; Fri, 10 Jul 2009 10:52:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 529CE8FC08; Fri, 10 Jul 2009 10:52:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AAqRuK017677; Fri, 10 Jul 2009 10:52:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AAqRT2017675; Fri, 10 Jul 2009 10:52:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101052.n6AAqRT2017675@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 10:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195538 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 10:52:28 -0000 Author: rpaulo Date: Fri Jul 10 10:52:27 2009 New Revision: 195538 URL: http://svn.freebsd.org/changeset/base/195538 Log: Note the draft version. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:51:15 2009 (r195537) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:52:27 2009 (r195538) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); /* * IEEE 802.11s Mesh Point (MBSS) support. + * + * Based on March 2009, D3.0 802.11s draft spec. */ #include "opt_inet.h" #include "opt_wlan.h" From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 10:53:25 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E321E106564A; Fri, 10 Jul 2009 10:53:25 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D24128FC08; Fri, 10 Jul 2009 10:53:25 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AArPEa017732; Fri, 10 Jul 2009 10:53:25 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AArPvG017730; Fri, 10 Jul 2009 10:53:25 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101053.n6AArPvG017730@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 10:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195539 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 10:53:26 -0000 Author: rpaulo Date: Fri Jul 10 10:53:25 2009 New Revision: 195539 URL: http://svn.freebsd.org/changeset/base/195539 Log: Note were timeout values come from. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:52:27 2009 (r195538) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:53:25 2009 (r195539) @@ -89,7 +89,9 @@ static int mesh_verify_meshid(struct iee static int mesh_verify_meshconf(struct ieee80211vap *, const uint8_t *); uint32_t mesh_airtime_calc(struct ieee80211_node *); -/* timeout values in miliseconds */ +/* + * Timeout values come from the specification and are in miliseconds. + */ static const int ieee80211_mesh_retrytimeout = 40; #define RETRY_TIMEOUT msecs_to_ticks(ieee80211_mesh_retrytimeout) static const int ieee80211_mesh_holdingtimeout = 40; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 10:55:24 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B7DD1065670; Fri, 10 Jul 2009 10:55:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A8CE8FC13; Fri, 10 Jul 2009 10:55:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AAtOei017820; Fri, 10 Jul 2009 10:55:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AAtOQi017817; Fri, 10 Jul 2009 10:55:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101055.n6AAtOQi017817@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 10:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195540 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 10:55:24 -0000 Author: rpaulo Date: Fri Jul 10 10:55:23 2009 New Revision: 195540 URL: http://svn.freebsd.org/changeset/base/195540 Log: Move default ttl define to mesh.h Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:53:25 2009 (r195539) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:55:23 2009 (r195540) @@ -100,8 +100,6 @@ static const int ieee80211_mesh_confirmt #define CONFIRM_TIMEOUT msecs_to_ticks(ieee80211_mesh_confirmtimeout) static const int ieee80211_mesh_maxretries = 2; -#define IEEE80211_MESH_DEFAULT_TTL 31 - static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 10:53:25 2009 (r195539) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 10:55:23 2009 (r195540) @@ -31,6 +31,8 @@ #ifndef _NET80211_IEEE80211_MESH_H_ #define _NET80211_IEEE80211_MESH_H_ +#define IEEE80211_MESH_DEFAULT_TTL 31 + /* * 802.11s Information Elements. */ From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 10:56:26 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC057106564A; Fri, 10 Jul 2009 10:56:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB33C8FC16; Fri, 10 Jul 2009 10:56:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AAuQjf017876; Fri, 10 Jul 2009 10:56:26 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AAuQ0D017874; Fri, 10 Jul 2009 10:56:26 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101056.n6AAuQ0D017874@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 10:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195541 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 10:56:27 -0000 Author: rpaulo Date: Fri Jul 10 10:56:26 2009 New Revision: 195541 URL: http://svn.freebsd.org/changeset/base/195541 Log: Remove fat comment. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:55:23 2009 (r195540) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:56:26 2009 (r195541) @@ -900,11 +900,6 @@ mesh_input(struct ieee80211_node *ni, st (mtod(m, const uint8_t *) + hdrspace); hdrspace += sizeof(struct ieee80211_meshcntl) + (mc->mc_flags & 3) * IEEE80211_ADDR_LEN; - - /* - * BIG FAT XXX - * ugly - */ seq = LE_READ_4(mc->mc_seq); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) addr = wh->i_addr3; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:00:52 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC09106568C; Fri, 10 Jul 2009 11:00:52 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C2118FC29; Fri, 10 Jul 2009 11:00:52 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AB0qBn018006; Fri, 10 Jul 2009 11:00:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AB0qSg018004; Fri, 10 Jul 2009 11:00:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101100.n6AB0qSg018004@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195542 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:01:02 -0000 Author: rpaulo Date: Fri Jul 10 11:00:52 2009 New Revision: 195542 URL: http://svn.freebsd.org/changeset/base/195542 Log: Replace ms_idlen with IEEE80211_MESHID_LEN. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 10:56:26 2009 (r195541) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:00:52 2009 (r195542) @@ -1700,7 +1700,7 @@ mesh_send_action_meshpeering_open(struct + sizeof(struct ieee80211_meshpeerver_ie) + 2 + IEEE80211_RATE_SIZE + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) - + 2 + ms->ms_idlen /* Mesh ID */ + + 2 + IEEE80211_MESHID_LEN + sizeof(struct ieee80211_meshconf_ie) + sizeof(struct ieee80211_meshpeer_ie) ); @@ -1767,7 +1767,7 @@ mesh_send_action_meshpeering_confirm(str + sizeof(struct ieee80211_meshpeerver_ie) + 2 + IEEE80211_RATE_SIZE + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) - + 2 + ms->ms_idlen /* Mesh ID */ + + 2 + IEEE80211_MESHID_LEN + sizeof(struct ieee80211_meshconf_ie) + sizeof(struct ieee80211_meshpeer_ie) ); @@ -1834,7 +1834,7 @@ mesh_send_action_meshpeering_close(struc sizeof(uint16_t) /* action+category */ + sizeof(uint16_t) /* reason code */ + sizeof(struct ieee80211_meshpeerver_ie) - + 2 + ms->ms_idlen /* Mesh ID */ + + 2 + IEEE80211_MESHID_LEN + sizeof(struct ieee80211_meshpeer_ie) ); if (m != NULL) { From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:02:31 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9120F106567A; Fri, 10 Jul 2009 11:02:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 802D58FC13; Fri, 10 Jul 2009 11:02:31 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AB2VoP018069; Fri, 10 Jul 2009 11:02:31 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AB2VF5018067; Fri, 10 Jul 2009 11:02:31 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101102.n6AB2VF5018067@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195543 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:02:31 -0000 Author: rpaulo Date: Fri Jul 10 11:02:31 2009 New Revision: 195543 URL: http://svn.freebsd.org/changeset/base/195543 Log: mesh_verify_meshpeerver(): verify len Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:00:52 2009 (r195542) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:02:31 2009 (r195543) @@ -2052,7 +2052,9 @@ mesh_verify_meshpeerver(struct ieee80211 const struct ieee80211_meshpeerver_ie *meshpeerver = (const struct ieee80211_meshpeerver_ie *) ie; - /* XXX verify length */ + if (meshpeerver->peerver_len != + sizeof(struct ieee80211_meshpeerver_ie) - 2) + return 1; return memcmp(meshpeerver->peerver_proto, peer, 4); } From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:06:43 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 264401065672; Fri, 10 Jul 2009 11:06:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1522B8FC1D; Fri, 10 Jul 2009 11:06:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AB6gL3018177; Fri, 10 Jul 2009 11:06:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AB6gv6018175; Fri, 10 Jul 2009 11:06:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101106.n6AB6gv6018175@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195544 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:06:43 -0000 Author: rpaulo Date: Fri Jul 10 11:06:42 2009 New Revision: 195544 URL: http://svn.freebsd.org/changeset/base/195544 Log: move packed comment to the top. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 11:02:31 2009 (r195543) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 11:06:42 2009 (r195544) @@ -34,6 +34,10 @@ #define IEEE80211_MESH_DEFAULT_TTL 31 /* + * NB: all structures are__packed so sizeof works on arm, et. al. + */ + +/* * 802.11s Information Elements. */ /* Mesh Configuration */ @@ -339,8 +343,6 @@ enum { /* * Different mesh control structures based on the AE * (Address Extension) bits. - * - * NB: __packed added so sizeof works on arm, et. al. */ struct ieee80211_meshcntl { uint8_t mc_flags; /* Address Extension 00 */ From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:16:01 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65B141065670; Fri, 10 Jul 2009 11:16:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54D8F8FC1B; Fri, 10 Jul 2009 11:16:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABG1Tq018380; Fri, 10 Jul 2009 11:16:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABG1v6018378; Fri, 10 Jul 2009 11:16:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101116.n6ABG1v6018378@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195545 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:16:01 -0000 Author: rpaulo Date: Fri Jul 10 11:16:01 2009 New Revision: 195545 URL: http://svn.freebsd.org/changeset/base/195545 Log: pad ieee80211req_sta_info. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jul 10 11:06:42 2009 (r195544) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jul 10 11:16:01 2009 (r195545) @@ -417,6 +417,7 @@ struct ieee80211req_sta_info { uint16_t isi_pad; uint32_t isi_jointime; /* time of assoc/join */ struct ieee80211_mimo_info isi_mimo; /* MIMO info for 11n sta's */ + uint8_t _pad[3]; /* 11s info */ uint8_t isi_peerstate; uint16_t isi_peerid; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:17:42 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A88E106566C; Fri, 10 Jul 2009 11:17:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 199B68FC1C; Fri, 10 Jul 2009 11:17:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABHfhY018442; Fri, 10 Jul 2009 11:17:41 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABHfZJ018440; Fri, 10 Jul 2009 11:17:41 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101117.n6ABHfZJ018440@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195546 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:17:42 -0000 Author: rpaulo Date: Fri Jul 10 11:17:41 2009 New Revision: 195546 URL: http://svn.freebsd.org/changeset/base/195546 Log: replace NWID_LEN with MESHID_LEN. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:16:01 2009 (r195545) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:17:41 2009 (r195546) @@ -2483,7 +2483,7 @@ mesh_ioctl_set80211(struct ieee80211vap error = 0; switch (ireq->i_type) { case IEEE80211_IOC_MESH_ID: - if (ireq->i_val != 0 || ireq->i_len > IEEE80211_NWID_LEN) + if (ireq->i_val != 0 || ireq->i_len > IEEE80211_MESHID_LEN) return EINVAL; error = copyin(ireq->i_data, tmpmeshid, ireq->i_len); if (error) From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:25:04 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F4D1065672; Fri, 10 Jul 2009 11:25:04 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2DFC8FC12; Fri, 10 Jul 2009 11:25:04 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABP4MM018611; Fri, 10 Jul 2009 11:25:04 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABP45W018609; Fri, 10 Jul 2009 11:25:04 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101125.n6ABP45W018609@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195547 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:25:05 -0000 Author: rpaulo Date: Fri Jul 10 11:25:04 2009 New Revision: 195547 URL: http://svn.freebsd.org/changeset/base/195547 Log: Implement get_mesh_rssi(). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_node.c Modified: projects/mesh11s/sys/net80211/ieee80211_node.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.c Fri Jul 10 11:17:41 2009 (r195546) +++ projects/mesh11s/sys/net80211/ieee80211_node.c Fri Jul 10 11:25:04 2009 (r195547) @@ -2553,6 +2553,26 @@ get_adhoc_rssi(void *arg, struct ieee802 } } +static void +get_mesh_rssi(void *arg, struct ieee80211_node *ni) +{ + struct rssiinfo *info = arg; + struct ieee80211vap *vap = ni->ni_vap; + int8_t rssi; + + if (info->vap != vap) + return; + /* only neighbors that peered successfully */ + if (ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) + return; + rssi = vap->iv_ic->ic_node_getrssi(ni); + if (rssi != 0) { + info->rssi_samples++; + info->rssi_total += rssi; + } +} + + int8_t ieee80211_getrssi(struct ieee80211vap *vap) { @@ -2572,7 +2592,7 @@ ieee80211_getrssi(struct ieee80211vap *v ieee80211_iterate_nodes(&ic->ic_sta, get_hostap_rssi, &info); break; case IEEE80211_M_MBSS: /* average of all mesh neighbors */ - /* XXX ieee80211_iterate_nodes(&ic->ic_sta, get_mesh_rssi, &info);*/ + ieee80211_iterate_nodes(&ic->ic_sta, get_mesh_rssi, &info); break; case IEEE80211_M_MONITOR: /* XXX */ case IEEE80211_M_STA: /* use stats from associated ap */ From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:25:59 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 920B01065670; Fri, 10 Jul 2009 11:25:59 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 811EF8FC19; Fri, 10 Jul 2009 11:25:59 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABPxIe018663; Fri, 10 Jul 2009 11:25:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABPx8i018662; Fri, 10 Jul 2009 11:25:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101125.n6ABPx8i018662@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195548 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:25:59 -0000 Author: rpaulo Date: Fri Jul 10 11:25:57 2009 New Revision: 195548 URL: http://svn.freebsd.org/changeset/base/195548 Log: fix build Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:25:04 2009 (r195547) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:25:57 2009 (r195548) @@ -1679,7 +1679,6 @@ mesh_send_action_meshpeering_open(struct { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_mesh_state *ms = vap->iv_mesh; uint16_t *args = args0; const struct ieee80211_rateset *rs; struct mbuf *m; @@ -1743,7 +1742,6 @@ mesh_send_action_meshpeering_confirm(str { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_mesh_state *ms = vap->iv_mesh; uint16_t *args = args0; const struct ieee80211_rateset *rs; struct mbuf *m; @@ -1815,7 +1813,6 @@ mesh_send_action_meshpeering_close(struc { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_mesh_state *ms = vap->iv_mesh; uint16_t *args = args0; struct mbuf *m; uint8_t *frm; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:30:55 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681CC106567B; Fri, 10 Jul 2009 11:30:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573868FC25; Fri, 10 Jul 2009 11:30:55 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABUtHo018791; Fri, 10 Jul 2009 11:30:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABUtjT018789; Fri, 10 Jul 2009 11:30:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101130.n6ABUtjT018789@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195549 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:30:55 -0000 Author: rpaulo Date: Fri Jul 10 11:30:55 2009 New Revision: 195549 URL: http://svn.freebsd.org/changeset/base/195549 Log: Kill mesh_update_beacon and use hostap code. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_output.c Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Fri Jul 10 11:25:57 2009 (r195548) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Fri Jul 10 11:30:55 2009 (r195549) @@ -2834,10 +2834,8 @@ ieee80211_beacon_update(struct ieee80211 ieee80211_tdma_update_beacon(vap, bo); } #endif - if (vap->iv_opmode == IEEE80211_M_MBSS) { - /*ieee80211_mesh_update_beacon(vap, bo);*/ - } - if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* NB: no IBSS support*/ + if (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_MBSS) { /* NB: no IBSS support*/ struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) bo->bo_tim; if (isset(bo->bo_flags, IEEE80211_BEACON_TIM)) { From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:34:43 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DF481065673; Fri, 10 Jul 2009 11:34:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D69AC8FC0C; Fri, 10 Jul 2009 11:34:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABYgig018907; Fri, 10 Jul 2009 11:34:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABYgI1018904; Fri, 10 Jul 2009 11:34:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101134.n6ABYgI1018904@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195550 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:34:43 -0000 Author: rpaulo Date: Fri Jul 10 11:34:42 2009 New Revision: 195550 URL: http://svn.freebsd.org/changeset/base/195550 Log: inline ieee80211_mesh_discover(). sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:30:55 2009 (r195549) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:34:42 2009 (r195550) @@ -2256,13 +2256,6 @@ ieee80211_add_meshpeer(uint8_t *frm, uin return frm; } -struct ieee80211_node * -ieee80211_mesh_discover(struct ieee80211vap *vap, - const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) -{ - struct ieee80211_mesh_state *ms = vap->iv_mesh; - return ms->ms_ppath->mpp_discover(vap, dest, m); -} /* * Compute an Airtime Link Metric for the link with this node. * @@ -2365,6 +2358,14 @@ ieee80211_mesh_init_neighbor(struct ieee ieee80211_parse_meshid(ni, sp->meshid); } +static __inline struct ieee80211_node * +ieee80211_mesh_discover(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + return ms->ms_ppath->mpp_discover(vap, dest, m); +} + static int mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 11:30:55 2009 (r195549) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 11:34:42 2009 (r195550) @@ -493,7 +493,7 @@ struct ieee80211_scanparams; void ieee80211_mesh_init_neighbor(struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_scanparams *); -struct ieee80211_node * +__inline struct ieee80211_node * ieee80211_mesh_discover(struct ieee80211vap *, const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); #endif /* _KERNEL */ From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:53:36 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C85B1065670; Fri, 10 Jul 2009 11:53:36 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A93A8FC15; Fri, 10 Jul 2009 11:53:36 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABra96019282; Fri, 10 Jul 2009 11:53:36 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABrZLf019273; Fri, 10 Jul 2009 11:53:35 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101153.n6ABrZLf019273@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195551 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:53:36 -0000 Author: rpaulo Date: Fri Jul 10 11:53:35 2009 New Revision: 195551 URL: http://svn.freebsd.org/changeset/base/195551 Log: Fix previous to include the function inside mesh.h. To accomplish this, I had to movie IEEE80211_MESHID_LEN to ieee80211.h and include ieee80211_mesh.h on a bunch of files (should've done that in the first place). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211.h projects/mesh11s/sys/net80211/ieee80211_action.c projects/mesh11s/sys/net80211/ieee80211_ddb.c projects/mesh11s/sys/net80211/ieee80211_hwmp.c projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h projects/mesh11s/sys/net80211/ieee80211_node.h projects/mesh11s/sys/net80211/ieee80211_scan_sta.c Modified: projects/mesh11s/sys/net80211/ieee80211.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211.h Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211.h Fri Jul 10 11:53:35 2009 (r195551) @@ -185,6 +185,7 @@ struct ieee80211_qosframe_addr4 { (IEEE80211_SEQ_SUB(b, a+1) < IEEE80211_SEQ_BA_RANGE-1) #define IEEE80211_NWID_LEN 32 +#define IEEE80211_MESHID_LEN 32 #define IEEE80211_QOS_TXOP 0x00ff /* bit 8 is reserved */ Modified: projects/mesh11s/sys/net80211/ieee80211_action.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_action.c Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211_action.c Fri Jul 10 11:53:35 2009 (r195551) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static int send_inval(struct ieee80211_node *ni, int cat, int act, void *sa) Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ddb.c Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211_ddb.c Fri Jul 10 11:53:35 2009 (r195551) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_TDMA #include #endif +#include #include #include Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 11:53:35 2009 (r195551) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static void hwmp_vattach(struct ieee80211vap *); static void hwmp_vdetach(struct ieee80211vap *); Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:53:35 2009 (r195551) @@ -2358,14 +2358,6 @@ ieee80211_mesh_init_neighbor(struct ieee ieee80211_parse_meshid(ni, sp->meshid); } -static __inline struct ieee80211_node * -ieee80211_mesh_discover(struct ieee80211vap *vap, - const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) -{ - struct ieee80211_mesh_state *ms = vap->iv_mesh; - return ms->ms_ppath->mpp_discover(vap, dest, m); -} - static int mesh_ioctl_get80211(struct ieee80211vap *vap, struct ieee80211req *ireq) { Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 11:53:35 2009 (r195551) @@ -36,7 +36,6 @@ /* * NB: all structures are__packed so sizeof works on arm, et. al. */ - /* * 802.11s Information Elements. */ @@ -101,8 +100,6 @@ struct ieee80211_meshid_ie { uint8_t id_len; } __packed; -#define IEEE80211_MESHID_LEN IEEE80211_NWID_LEN - /* Link Metric Report */ struct ieee80211_meshlmetric_ie { uint8_t lm_ie; /* IEEE80211_ELEMID_MESHLINK */ @@ -493,8 +490,13 @@ struct ieee80211_scanparams; void ieee80211_mesh_init_neighbor(struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_scanparams *); -__inline struct ieee80211_node * - ieee80211_mesh_discover(struct ieee80211vap *, - const uint8_t [IEEE80211_ADDR_LEN], struct mbuf *); +static __inline struct ieee80211_node * +ieee80211_mesh_discover(struct ieee80211vap *vap, + const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) +{ + struct ieee80211_mesh_state *ms = vap->iv_mesh; + return ms->ms_ppath->mpp_discover(vap, dest, m); +} + #endif /* _KERNEL */ #endif /* !_NET80211_IEEE80211_MESH_H_ */ Modified: projects/mesh11s/sys/net80211/ieee80211_node.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.h Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211_node.h Fri Jul 10 11:53:35 2009 (r195551) @@ -30,7 +30,6 @@ #include /* for ieee80211_nodestats */ #include /* for aggregation state */ -#include /* for mesh defines */ /* * Each ieee80211com instance has a single timer that fires every Modified: projects/mesh11s/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_scan_sta.c Fri Jul 10 11:34:42 2009 (r195550) +++ projects/mesh11s/sys/net80211/ieee80211_scan_sta.c Fri Jul 10 11:53:35 2009 (r195551) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_TDMA #include #endif +#include #include From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:55:02 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10B8E106564A; Fri, 10 Jul 2009 11:55:02 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F03BD8FC1D; Fri, 10 Jul 2009 11:55:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABt1SU019361; Fri, 10 Jul 2009 11:55:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABt1Bp019359; Fri, 10 Jul 2009 11:55:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101155.n6ABt1Bp019359@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195552 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:55:02 -0000 Author: rpaulo Date: Fri Jul 10 11:55:01 2009 New Revision: 195552 URL: http://svn.freebsd.org/changeset/base/195552 Log: Remove is11bclient. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:53:35 2009 (r195551) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:55:01 2009 (r195552) @@ -1039,23 +1039,6 @@ out: return type; } -static int -is11bclient(const uint8_t *rates, const uint8_t *xrates) -{ - static const uint32_t brates = (1<<2*1)|(1<<2*2)|(1<<11)|(1<<2*11); - int i; - - /* NB: the 11b clients we care about will not have xrates */ - if (xrates != NULL || rates == NULL) - return 0; - for (i = 0; i < rates[1]; i++) { - int r = rates[2+i] & IEEE80211_RATE_VAL; - if (r > 2*11 || ((1<i_addr2, - is11bclient(rates, xrates) ? IEEE80211_SEND_LEGACY_11B : 0); + ieee80211_send_proberesp(vap, wh->i_addr2, 0); break; } case IEEE80211_FC0_SUBTYPE_ACTION: From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:55:51 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27C93106564A; Fri, 10 Jul 2009 11:55:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 169B58FC15; Fri, 10 Jul 2009 11:55:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABtogd019414; Fri, 10 Jul 2009 11:55:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABtooh019412; Fri, 10 Jul 2009 11:55:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101155.n6ABtooh019412@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195553 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:55:51 -0000 Author: rpaulo Date: Fri Jul 10 11:55:50 2009 New Revision: 195553 URL: http://svn.freebsd.org/changeset/base/195553 Log: Remove explicit QOS setup. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:55:01 2009 (r195552) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:55:50 2009 (r195553) @@ -1134,10 +1134,6 @@ mesh_recv_mgmt(struct ieee80211_node *ni * Create a new entry in the neighbor table. */ ni = ieee80211_add_neighbor(vap, wh, &scan); - /* - * Mesh nodes must be QoS capable. - */ - ni->ni_flags |= IEEE80211_NODE_QOS; } /* * Automatically peer with discovered nodes if possible. From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 11:59:14 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9DC91065678; Fri, 10 Jul 2009 11:59:14 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8E258FC1D; Fri, 10 Jul 2009 11:59:14 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ABxEnr019502; Fri, 10 Jul 2009 11:59:14 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ABxEmk019500; Fri, 10 Jul 2009 11:59:14 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101159.n6ABxEmk019500@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 11:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195554 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 11:59:15 -0000 Author: rpaulo Date: Fri Jul 10 11:59:14 2009 New Revision: 195554 URL: http://svn.freebsd.org/changeset/base/195554 Log: Remove doprint(). Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:55:50 2009 (r195553) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:59:14 2009 (r195554) @@ -567,24 +567,6 @@ mesh_newstate(struct ieee80211vap *vap, } /* - * Decide if a received management frame should be - * printed when debugging is enabled. This filters some - * of the less interesting frames that come frequently - * (e.g. beacons). - */ -static __inline int -doprint(struct ieee80211vap *vap, int subtype) -{ - switch (subtype) { - case IEEE80211_FC0_SUBTYPE_BEACON: - return (vap->iv_ic->ic_flags & IEEE80211_F_SCAN); - case IEEE80211_FC0_SUBTYPE_PROBE_REQ: - return 1; - } - return 1; -} - -/* * Helper function to note the Mesh Peer Link FSM change. */ static __inline void @@ -1002,7 +984,8 @@ mesh_input(struct ieee80211_node *ni, st goto out; } #ifdef IEEE80211_DEBUG - if ((ieee80211_msg_debug(vap) && doprint(vap, subtype)) || + if ((ieee80211_msg_debug(vap) && + (vap->iv_ic->ic_flags & IEEE80211_F_SCAN)) ieee80211_msg_dumppkts(vap)) { if_printf(ifp, "received %s from %s rssi %d\n", ieee80211_mgt_subtype_name[subtype >> From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 12:00:21 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B55B8106568B; Fri, 10 Jul 2009 12:00:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3D078FC1D; Fri, 10 Jul 2009 12:00:21 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AC0LRe019591; Fri, 10 Jul 2009 12:00:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AC0Llr019589; Fri, 10 Jul 2009 12:00:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101200.n6AC0Llr019589@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 12:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195555 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 12:00:22 -0000 Author: rpaulo Date: Fri Jul 10 12:00:21 2009 New Revision: 195555 URL: http://svn.freebsd.org/changeset/base/195555 Log: fix previous commit Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 11:59:14 2009 (r195554) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 12:00:21 2009 (r195555) @@ -985,7 +985,7 @@ mesh_input(struct ieee80211_node *ni, st } #ifdef IEEE80211_DEBUG if ((ieee80211_msg_debug(vap) && - (vap->iv_ic->ic_flags & IEEE80211_F_SCAN)) + (vap->iv_ic->ic_flags & IEEE80211_F_SCAN)) || ieee80211_msg_dumppkts(vap)) { if_printf(ifp, "received %s from %s rssi %d\n", ieee80211_mgt_subtype_name[subtype >> From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 12:02:06 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C3A61065670; Fri, 10 Jul 2009 12:02:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ADD78FC18; Fri, 10 Jul 2009 12:02:06 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AC26gp019658; Fri, 10 Jul 2009 12:02:06 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AC26SA019656; Fri, 10 Jul 2009 12:02:06 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101202.n6AC26SA019656@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 12:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195556 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 12:02:07 -0000 Author: rpaulo Date: Fri Jul 10 12:02:05 2009 New Revision: 195556 URL: http://svn.freebsd.org/changeset/base/195556 Log: hwmp_newstate(): flush the table on RUN -> !RUN transition. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 12:00:21 2009 (r195555) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 12:02:05 2009 (r195556) @@ -266,8 +266,8 @@ hwmp_newstate(struct ieee80211vap *vap, __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg); - /* Flush the table on !INIT -> INIT, e.g. interface down & up */ - if (nstate != IEEE80211_S_INIT && ostate == IEEE80211_S_INIT) + /* Flush the table on RUN -> !RUN, e.g. interface down & up */ + if (nstate != IEEE80211_S_RUN && ostate == IEEE80211_S_RUN) callout_drain(&hs->hs_roottimer); return 0; } From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 12:15:24 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F42E1065672; Fri, 10 Jul 2009 12:15:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7AE88FC1C; Fri, 10 Jul 2009 12:15:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ACFN9m020007; Fri, 10 Jul 2009 12:15:23 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ACFN3U020005; Fri, 10 Jul 2009 12:15:23 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101215.n6ACFN3U020005@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 12:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195557 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 12:15:24 -0000 Author: rpaulo Date: Fri Jul 10 12:15:23 2009 New Revision: 195557 URL: http://svn.freebsd.org/changeset/base/195557 Log: Add 11s sysctl params. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 12:02:05 2009 (r195556) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 12:15:23 2009 (r195557) @@ -92,13 +92,25 @@ uint32_t mesh_airtime_calc(struct ieee80 /* * Timeout values come from the specification and are in miliseconds. */ -static const int ieee80211_mesh_retrytimeout = 40; +static int ieee80211_mesh_retrytimeout = 40; #define RETRY_TIMEOUT msecs_to_ticks(ieee80211_mesh_retrytimeout) -static const int ieee80211_mesh_holdingtimeout = 40; +static int ieee80211_mesh_holdingtimeout = 40; #define HOLDING_TIMEOUT msecs_to_ticks(ieee80211_mesh_holdingtimeout) -static const int ieee80211_mesh_confirmtimeout = 40; +static int ieee80211_mesh_confirmtimeout = 40; #define CONFIRM_TIMEOUT msecs_to_ticks(ieee80211_mesh_confirmtimeout) -static const int ieee80211_mesh_maxretries = 2; +static int ieee80211_mesh_maxretries = 2; + +SYSCTL_NODE(_net_wlan, OID_AUTO, mesh, CTLFLAG_RD, 0, + "IEEE 802.11s parameters"); +SYSCTL_INT(_net_wlan_mesh, OID_AUTO, retrytimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_retrytimeout, 0, "Retry timeout in msec"); +SYSCTL_INT(_net_wlan_mesh, OID_AUTO, holdingtimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_holdingtimeout, 0, "Holding state timeout in msec"); +SYSCTL_INT(_net_wlan_mesh, OID_AUTO, confirmtimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_confirmtimeout, 0, "Confirm state timeout in msec"); +SYSCTL_INT(_net_wlan_mesh, OID_AUTO, maxretries, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_maxretries, 0, + "Maximum retries during peer link establishment"); static const uint8_t broadcastaddr[IEEE80211_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 13:14:02 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9DB51065670; Fri, 10 Jul 2009 13:14:02 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 987048FC14; Fri, 10 Jul 2009 13:14:02 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ADE2p9021124; Fri, 10 Jul 2009 13:14:02 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ADE27g021122; Fri, 10 Jul 2009 13:14:02 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101314.n6ADE27g021122@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 13:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195558 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 13:14:02 -0000 Author: rpaulo Date: Fri Jul 10 13:14:02 2009 New Revision: 195558 URL: http://svn.freebsd.org/changeset/base/195558 Log: Check the lenght of some IEs. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 12:15:23 2009 (r195557) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 13:14:02 2009 (r195558) @@ -286,12 +286,20 @@ hwmp_recv_action_meshpath_preq(struct ie if (*iefrm == IEEE80211_ELEMID_MESHPREQ) { const struct ieee80211_meshpreq_ie *mpreq = (const struct ieee80211_meshpreq_ie *) iefrm; + /* XXX > 1 target */ + if (mpreq->preq_len != + sizeof(struct ieee80211_meshpreq_ie) - 2) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "%s", "PREQ with wrong len"); + vap->iv_stats.is_rx_mgtdiscard++; + return 1; + } memcpy(&preq, mpreq, sizeof(preq)); preq.preq_id = LE_READ_4(&mpreq->preq_id); preq.preq_origseq = LE_READ_4(&mpreq->preq_origseq); preq.preq_lifetime = LE_READ_4(&mpreq->preq_lifetime); preq.preq_metric = LE_READ_4(&mpreq->preq_metric); - /* XXX > 1 target */ preq.preq_targets[0].target_seq = LE_READ_4(&mpreq->preq_targets[0].target_seq); hwmp_recv_preq(vap, ni, wh, &preq); @@ -319,6 +327,14 @@ hwmp_recv_action_meshpath_prep(struct ie if (*iefrm == IEEE80211_ELEMID_MESHPREP) { const struct ieee80211_meshprep_ie *mprep = (const struct ieee80211_meshprep_ie *) iefrm; + if (mprep->prep_len != + sizeof(struct ieee80211_meshprep_ie) - 2) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "%s", "PREP with wrong len"); + vap->iv_stats.is_rx_mgtdiscard++; + return 1; + } memcpy(&prep, mprep, sizeof(prep)); prep.prep_targetseq = LE_READ_4(&mprep->prep_targetseq); prep.prep_lifetime = LE_READ_4(&mprep->prep_lifetime); @@ -349,8 +365,16 @@ hwmp_recv_action_meshpath_perr(struct ie if (*iefrm == IEEE80211_ELEMID_MESHPERR) { const struct ieee80211_meshperr_ie *mperr = (const struct ieee80211_meshperr_ie *) iefrm; - memcpy(&perr, mperr, sizeof(perr)); /* XXX > 1 target */ + if (mperr->perr_len != + sizeof(struct ieee80211_meshperr_ie) - 2) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "%s", "PERR with wrong len"); + vap->iv_stats.is_rx_mgtdiscard++; + return 1; + } + memcpy(&perr, mperr, sizeof(perr)); perr.perr_dests[0].dest_seq = LE_READ_4(&mperr->perr_dests[0].dest_seq); hwmp_recv_perr(vap, ni, wh, &perr); @@ -378,6 +402,14 @@ hwmp_recv_action_meshpath_rann(struct ie if (*iefrm == IEEE80211_ELEMID_MESHRANN) { const struct ieee80211_meshrann_ie *mrann = (const struct ieee80211_meshrann_ie *) iefrm; + if (mrann->rann_len != + sizeof(struct ieee80211_meshrann_ie) - 2) { + IEEE80211_DISCARD(vap, + IEEE80211_MSG_ACTION | IEEE80211_MSG_HWMP, + wh, NULL, "%s", "RAN with wrong len"); + vap->iv_stats.is_rx_mgtdiscard++; + return 1; + } memcpy(&rann, mrann, sizeof(rann)); rann.rann_seq = LE_READ_4(&mrann->rann_seq); rann.rann_metric = LE_READ_4(&mrann->rann_metric); From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 13:33:23 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C6B01065674; Fri, 10 Jul 2009 13:33:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D52148FC29; Fri, 10 Jul 2009 13:33:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ADXMUV021524; Fri, 10 Jul 2009 13:33:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ADXMYV021522; Fri, 10 Jul 2009 13:33:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101333.n6ADXMYV021522@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 13:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195559 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 13:33:23 -0000 Author: rpaulo Date: Fri Jul 10 13:33:22 2009 New Revision: 195559 URL: http://svn.freebsd.org/changeset/base/195559 Log: Verify the mesh peer IE. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 13:14:02 2009 (r195558) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 13:33:22 2009 (r195559) @@ -87,6 +87,7 @@ static __inline void mesh_peer_timeout_s static int mesh_verify_meshpeerver(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshid(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshconf(struct ieee80211vap *, const uint8_t *); +static int mesh_verify_meshpeer(struct ieee80211vap *, const uint8_t *); uint32_t mesh_airtime_calc(struct ieee80211_node *); /* @@ -1316,8 +1317,6 @@ mesh_parse_meshpeering_action(struct iee } frm += frm[1] + 2; } - /* XXX verify elements present */ - /* XXX verify ie lengths */ /* * Verify the contents of the frame. Action frames with @@ -1329,7 +1328,7 @@ mesh_parse_meshpeering_action(struct iee if (mesh_verify_meshpeerver(vap, meshpeerver) || mesh_verify_meshid(vap, meshid) || - meshpeer == NULL || + mesh_verify_meshpeer(vap, meshpeer) || mesh_verify_meshconf(vap, meshconf)) { uint16_t args[3]; @@ -2097,9 +2096,38 @@ mesh_verify_meshconf(struct ieee80211vap "not accepting peers: 0x%x\n", meshconf->conf_cap); return 1; } + return 0; +} +static int +mesh_verify_meshpeer(struct ieee80211vap *vap, const uint8_t *ie) +{ + const struct ieee80211_meshpeer_ie *meshpeer = + (const struct ieee80211_meshpeer_ie *) ie; + + if (meshpeer == NULL) + return 1; + switch (meshpeer->peer_subtype) { + case IEEE80211_MESH_PEER_LINK_OPEN: + if (meshpeer->peer_len != 3) + return 1; + break; + case IEEE80211_MESH_PEER_LINK_CONFIRM: + if (meshpeer->peer_len != 5) + return 1; + break; + case IEEE80211_MESH_PEER_LINK_CLOSE: + if (meshpeer->peer_len < 5) + return 1; + if (meshpeer->peer_len == 5 && meshpeer->peer_linkid != 0) + return 1; + if (meshpeer->peer_rcode == 0) + return 1; + break; + } return 0; } + /* * Add a Mesh ID IE to a frame. */ From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:01:21 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBBC6106566B; Fri, 10 Jul 2009 16:01:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA8F58FC18; Fri, 10 Jul 2009 16:01:21 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AG1LJ8024739; Fri, 10 Jul 2009 16:01:21 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AG1Ll3024737; Fri, 10 Jul 2009 16:01:21 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101601.n6AG1Ll3024737@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 16:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195563 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:01:22 -0000 Author: sam Date: Fri Jul 10 16:01:21 2009 New Revision: 195563 URL: http://svn.freebsd.org/changeset/base/195563 Log: shuffle members so no padding is needed; the variable-length data that follows has no alignment assumptions Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jul 10 15:28:33 2009 (r195562) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.h Fri Jul 10 16:01:21 2009 (r195563) @@ -417,11 +417,10 @@ struct ieee80211req_sta_info { uint16_t isi_pad; uint32_t isi_jointime; /* time of assoc/join */ struct ieee80211_mimo_info isi_mimo; /* MIMO info for 11n sta's */ - uint8_t _pad[3]; /* 11s info */ - uint8_t isi_peerstate; uint16_t isi_peerid; uint16_t isi_localid; + uint8_t isi_peerstate; /* XXX frag state? */ /* variable length IE data */ }; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:18:40 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2757106566C; Fri, 10 Jul 2009 16:18:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E14EA8FC13; Fri, 10 Jul 2009 16:18:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGIe51025075; Fri, 10 Jul 2009 16:18:40 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGIe2G025073; Fri, 10 Jul 2009 16:18:40 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101618.n6AGIe2G025073@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 16:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195564 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:18:41 -0000 Author: sam Date: Fri Jul 10 16:18:40 2009 New Revision: 195564 URL: http://svn.freebsd.org/changeset/base/195564 Log: style; line up comments, add some paren's, blank lines Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 16:01:21 2009 (r195563) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 16:18:40 2009 (r195564) @@ -389,10 +389,10 @@ struct ieee80211_mesh_route { uint32_t rt_metric; /* path metric */ uint16_t rt_nhops; /* number of hops */ uint32_t rt_lifetime; - uint32_t rt_lastmseq;/* last seq# seen from this dest */ - void *rt_priv; /* pointer to private data */ + uint32_t rt_lastmseq; /* last seq# seen dest */ + void *rt_priv; /* private data */ }; -#define IEEE80211_MESH_ROUTE_PRIV(rt, cast) (cast *)rt->rt_priv +#define IEEE80211_MESH_ROUTE_PRIV(rt, cast) ((cast *)rt->rt_priv) #define IEEE80211_MESH_PROTO_DSZ 12 /* description size */ /* @@ -414,6 +414,7 @@ struct ieee80211_mesh_proto_path { size_t mpp_privlen; /* size required in the routing table for private data */ }; + /* * Mesh Link Metric Report Protocol. */ @@ -490,6 +491,7 @@ struct ieee80211_scanparams; void ieee80211_mesh_init_neighbor(struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_scanparams *); + static __inline struct ieee80211_node * ieee80211_mesh_discover(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN], struct mbuf *m) From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:29:05 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB32C1065687; Fri, 10 Jul 2009 16:29:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9C438FC16; Fri, 10 Jul 2009 16:29:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGT5KH025300; Fri, 10 Jul 2009 16:29:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGT5pr025298; Fri, 10 Jul 2009 16:29:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101629.n6AGT5pr025298@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 16:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195565 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:29:06 -0000 Author: sam Date: Fri Jul 10 16:29:05 2009 New Revision: 195565 URL: http://svn.freebsd.org/changeset/base/195565 Log: instead of converting timeouts to ticks on use convert them when they are set via sysctl; in general make handling consistent with other places in net80211 Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:18:40 2009 (r195564) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:29:05 2009 (r195565) @@ -91,24 +91,23 @@ static int mesh_verify_meshpeer(struct i uint32_t mesh_airtime_calc(struct ieee80211_node *); /* - * Timeout values come from the specification and are in miliseconds. + * Timeout values come from the specification and are in milliseconds. */ -static int ieee80211_mesh_retrytimeout = 40; -#define RETRY_TIMEOUT msecs_to_ticks(ieee80211_mesh_retrytimeout) -static int ieee80211_mesh_holdingtimeout = 40; -#define HOLDING_TIMEOUT msecs_to_ticks(ieee80211_mesh_holdingtimeout) -static int ieee80211_mesh_confirmtimeout = 40; -#define CONFIRM_TIMEOUT msecs_to_ticks(ieee80211_mesh_confirmtimeout) -static int ieee80211_mesh_maxretries = 2; - SYSCTL_NODE(_net_wlan, OID_AUTO, mesh, CTLFLAG_RD, 0, "IEEE 802.11s parameters"); -SYSCTL_INT(_net_wlan_mesh, OID_AUTO, retrytimeout, CTLTYPE_INT | CTLFLAG_RW, - &ieee80211_mesh_retrytimeout, 0, "Retry timeout in msec"); -SYSCTL_INT(_net_wlan_mesh, OID_AUTO, holdingtimeout, CTLTYPE_INT | CTLFLAG_RW, - &ieee80211_mesh_holdingtimeout, 0, "Holding state timeout in msec"); -SYSCTL_INT(_net_wlan_mesh, OID_AUTO, confirmtimeout, CTLTYPE_INT | CTLFLAG_RW, - &ieee80211_mesh_confirmtimeout, 0, "Confirm state timeout in msec"); +static int ieee80211_mesh_retrytimeout = -1; +SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, retrytimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_retrytimeout, 0, ieee80211_sysctl_msecs_ticks, "I", + "Retry timeout (msec)"); +static int ieee80211_mesh_holdingtimeout = -1; +SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, holdingtimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_holdingtimeout, 0, ieee80211_sysctl_msecs_ticks, "I", + "Holding state timeout (msec)"); +static int ieee80211_mesh_confirmtimeout = -1; +SYSCTL_PROC(_net_wlan_mesh, OID_AUTO, confirmtimeout, CTLTYPE_INT | CTLFLAG_RW, + &ieee80211_mesh_confirmtimeout, 0, ieee80211_sysctl_msecs_ticks, "I", + "Confirm state timeout (msec)"); +static int ieee80211_mesh_maxretries = 2; SYSCTL_INT(_net_wlan_mesh, OID_AUTO, maxretries, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_mesh_maxretries, 0, "Maximum retries during peer link establishment"); @@ -298,17 +297,23 @@ mesh_select_proto_metric(struct ieee8021 } return ENOENT; } - - #undef N static void ieee80211_mesh_init(void) { + memset(mesh_proto_paths, 0, sizeof(mesh_proto_paths)); memset(mesh_proto_metrics, 0, sizeof(mesh_proto_metrics)); /* + * Setup mesh parameters that depends on the clock frequency. + */ + ieee80211_mesh_retrytimeout = msecs_to_ticks(40); + ieee80211_mesh_holdingtimeout = msecs_to_ticks(40); + ieee80211_mesh_confirmtimeout = msecs_to_ticks(40); + + /* * Register action frame handlers. */ ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPEERING, @@ -1918,16 +1923,17 @@ mesh_peer_timeout_setup(struct ieee80211 { switch (ni->ni_mlstate) { case IEEE80211_NODE_MESH_HOLDING: - ni->ni_mltval = HOLDING_TIMEOUT; + ni->ni_mltval = ieee80211_mesh_holdingtimeout; break; case IEEE80211_NODE_MESH_CONFIRMRCV: - ni->ni_mltval = CONFIRM_TIMEOUT; + ni->ni_mltval = ieee80211_mesh_confirmtimeout; break; case IEEE80211_NODE_MESH_IDLE: ni->ni_mltval = 0; break; default: - ni->ni_mltval = RETRY_TIMEOUT; + ni->ni_mltval = ieee80211_mesh_retrytimeout; + break; } if (ni->ni_mltval) callout_reset(&ni->ni_mltimer, ni->ni_mltval, From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:38:16 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71EBB1065670; Fri, 10 Jul 2009 16:38:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 609608FC0C; Fri, 10 Jul 2009 16:38:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGcGKB025568; Fri, 10 Jul 2009 16:38:16 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGcG82025566; Fri, 10 Jul 2009 16:38:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101638.n6AGcG82025566@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 16:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195566 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:38:16 -0000 Author: sam Date: Fri Jul 10 16:38:16 2009 New Revision: 195566 URL: http://svn.freebsd.org/changeset/base/195566 Log: whitespace/style fixes; add comment about where airtime link metric comes from Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:29:05 2009 (r195565) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:38:16 2009 (r195566) @@ -187,7 +187,7 @@ ieee80211_mesh_rt_add(struct ieee80211va return rt; } -void +void ieee80211_mesh_rt_del(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) { @@ -207,7 +207,7 @@ ieee80211_mesh_rt_del(struct ieee80211va MESH_RT_UNLOCK(ms); } -void +void ieee80211_mesh_rt_flush(struct ieee80211vap *vap) { struct ieee80211_mesh_state *ms = vap->iv_mesh; @@ -386,7 +386,6 @@ mesh_vdetach_peers(void *arg, struct iee (void *)(uintptr_t) ieee80211_mac_hash(ic, ni->ni_macaddr)); } - static void mesh_vdetach(struct ieee80211vap *vap) { @@ -2163,6 +2162,7 @@ meshconf_neighbors(void *arg, struct iee ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED) (*neighbors)++; } + /* * Add a Mesh Configuration IE to a frame. * For now just use HWMP routing, Airtime link metric, Null Congestion @@ -2266,7 +2266,7 @@ ieee80211_add_meshpeer(uint8_t *frm, uin /* * Compute an Airtime Link Metric for the link with this node. * - * Based on D3.0. + * Based on Draft 3.0 spec (11B.10, p.149). */ /* * Max 802.11s overhead. From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:40:29 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D524106566B; Fri, 10 Jul 2009 16:40:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 409208FC12; Fri, 10 Jul 2009 16:40:29 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGeTJQ025655; Fri, 10 Jul 2009 16:40:29 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGeTll025653; Fri, 10 Jul 2009 16:40:29 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101640.n6AGeTll025653@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 16:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195567 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:40:29 -0000 Author: rpaulo Date: Fri Jul 10 16:40:28 2009 New Revision: 195567 URL: http://svn.freebsd.org/changeset/base/195567 Log: whitespace fix Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:38:16 2009 (r195566) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:40:28 2009 (r195567) @@ -148,43 +148,43 @@ struct ieee80211_mesh_route * ieee80211_mesh_rt_find(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) { - struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ieee80211_mesh_route *rt; + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt; - MESH_RT_LOCK(ms); - TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { - if (IEEE80211_ADDR_EQ(dest, rt->rt_dest)) { - MESH_RT_UNLOCK(ms); - return rt; - } - } - MESH_RT_UNLOCK(ms); - return NULL; + MESH_RT_LOCK(ms); + TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) { + if (IEEE80211_ADDR_EQ(dest, rt->rt_dest)) { + MESH_RT_UNLOCK(ms); + return rt; + } + } + MESH_RT_UNLOCK(ms); + return NULL; } struct ieee80211_mesh_route * ieee80211_mesh_rt_add(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) { - struct ieee80211_mesh_state *ms = vap->iv_mesh; - struct ieee80211_mesh_route *rt; + struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_mesh_route *rt; - KASSERT(ieee80211_mesh_rt_find(vap, dest) == NULL, - ("%s: duplicate entry in the routing table", __func__)); - KASSERT(!IEEE80211_ADDR_EQ(vap->iv_myaddr, dest), - ("%s: adding self to the routing table", __func__)); - KASSERT(!IEEE80211_ADDR_EQ(broadcastaddr, dest), - ("%s: adding broadcast to the routing table", __func__)); - - rt = malloc(sizeof(struct ieee80211_mesh_route), M_80211_MESH_RT, - M_NOWAIT | M_ZERO); - IEEE80211_ADDR_COPY(rt->rt_dest, dest); + KASSERT(ieee80211_mesh_rt_find(vap, dest) == NULL, + ("%s: duplicate entry in the routing table", __func__)); + KASSERT(!IEEE80211_ADDR_EQ(vap->iv_myaddr, dest), + ("%s: adding self to the routing table", __func__)); + KASSERT(!IEEE80211_ADDR_EQ(broadcastaddr, dest), + ("%s: adding broadcast to the routing table", __func__)); + + rt = malloc(sizeof(struct ieee80211_mesh_route), M_80211_MESH_RT, + M_NOWAIT | M_ZERO); + IEEE80211_ADDR_COPY(rt->rt_dest, dest); rt->rt_priv = malloc(ms->ms_ppath->mpp_privlen, M_80211_MESH_RT, M_NOWAIT | M_ZERO); - MESH_RT_LOCK(ms); - TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); - MESH_RT_UNLOCK(ms); - return rt; + MESH_RT_LOCK(ms); + TAILQ_INSERT_TAIL(&ms->ms_routes, rt, rt_next); + MESH_RT_UNLOCK(ms); + return rt; } void @@ -409,11 +409,11 @@ mesh_vattach(struct ieee80211vap *vap) vap->iv_opdetach = mesh_vdetach; vap->iv_recv_mgmt = mesh_recv_mgmt; ms = malloc(sizeof(struct ieee80211_mesh_state), M_80211_VAP, - M_NOWAIT | M_ZERO); - if (ms == NULL) { - printf("%s: couldn't alloc MBSS state\n", __func__); - return; - } + M_NOWAIT | M_ZERO); + if (ms == NULL) { + printf("%s: couldn't alloc MBSS state\n", __func__); + return; + } vap->iv_mesh = ms; ms->ms_seq = 0; ms->ms_flags = (IEEE80211_MESHFLAGS_AP | IEEE80211_MESHFLAGS_FWD); @@ -440,13 +440,13 @@ mesh_newstate(struct ieee80211vap *vap, IEEE80211_LOCK_ASSERT(ic); - ostate = vap->iv_state; - IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", - __func__, ieee80211_state_name[ostate], - ieee80211_state_name[nstate], arg); - vap->iv_state = nstate; /* state transition */ - if (ostate != IEEE80211_S_SCAN) - ieee80211_cancel_scan(vap); /* background scan */ + ostate = vap->iv_state; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", + __func__, ieee80211_state_name[ostate], + ieee80211_state_name[nstate], arg); + vap->iv_state = nstate; /* state transition */ + if (ostate != IEEE80211_S_SCAN) + ieee80211_cancel_scan(vap); /* background scan */ ni = vap->iv_bss; /* NB: no reference held */ /* Flush the routing table */ if (nstate != IEEE80211_S_INIT && ostate == IEEE80211_S_INIT) @@ -667,12 +667,12 @@ static struct ieee80211_node * mesh_find_txnode(struct ieee80211vap *vap, const uint8_t dest[IEEE80211_ADDR_LEN]) { - struct ieee80211_mesh_route *rt; + struct ieee80211_mesh_route *rt; - rt = ieee80211_mesh_rt_find(vap, dest); - if (rt == NULL) - return NULL; - return ieee80211_find_txnode(vap, rt->rt_nexthop); + rt = ieee80211_mesh_rt_find(vap, dest); + if (rt == NULL) + return NULL; + return ieee80211_find_txnode(vap, rt->rt_nexthop); } /* @@ -1027,7 +1027,7 @@ mesh_input(struct ieee80211_node *ni, st wh, "bad", "frame type 0x%x", type); /* should not come here */ break; - } + } err: ifp->if_ierrors++; out: @@ -1067,7 +1067,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni * Count frame now that we know it's to be processed. */ if (subtype == IEEE80211_FC0_SUBTYPE_BEACON) { - vap->iv_stats.is_rx_beacon++; /* XXX remove */ + vap->iv_stats.is_rx_beacon++; /* XXX remove */ IEEE80211_NODE_STAT(ni, rx_beacons); } else IEEE80211_NODE_STAT(ni, rx_proberesp); @@ -1173,7 +1173,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni /* frame must be directed */ IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "not unicast"); - vap->iv_stats.is_rx_mgtdiscard++; /* XXX stat */ + vap->iv_stats.is_rx_mgtdiscard++; /* XXX stat */ return; } /* @@ -1182,7 +1182,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni * [tlv] supported rates * [tlv] extended supported rates * [tlv] mesh id - */ + */ ssid = meshid = rates = xrates = NULL; sfrm = frm; while (efrm - frm > 1) { @@ -2272,15 +2272,15 @@ ieee80211_add_meshpeer(uint8_t *frm, uin * Max 802.11s overhead. */ #define IEEE80211_MESH_MAXOVERHEAD \ - (sizeof(struct ieee80211_qosframe_addr4) \ + (sizeof(struct ieee80211_qosframe_addr4) \ + sizeof(struct ieee80211_meshcntl_ae11) \ - + sizeof(struct llc) \ - + IEEE80211_ADDR_LEN \ - + IEEE80211_WEP_IVLEN \ - + IEEE80211_WEP_KIDLEN \ - + IEEE80211_WEP_CRCLEN \ - + IEEE80211_WEP_MICLEN \ - + IEEE80211_CRC_LEN) + + sizeof(struct llc) \ + + IEEE80211_ADDR_LEN \ + + IEEE80211_WEP_IVLEN \ + + IEEE80211_WEP_KIDLEN \ + + IEEE80211_WEP_CRCLEN \ + + IEEE80211_WEP_MICLEN \ + + IEEE80211_CRC_LEN) uint32_t mesh_airtime_calc(struct ieee80211_node *ni) { @@ -2439,8 +2439,8 @@ mesh_ioctl_get80211(struct ieee80211vap return EINVAL; default: return ENOSYS; - } - break; + } + break; case IEEE80211_IOC_MESH_PR_METRIC: len = strlen(ms->ms_pmetric->mpm_descr); if (ireq->i_len < len) From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:41:43 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96E5106566B; Fri, 10 Jul 2009 16:41:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B82C08FC1F; Fri, 10 Jul 2009 16:41:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGfgsH025712; Fri, 10 Jul 2009 16:41:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGfg0G025710; Fri, 10 Jul 2009 16:41:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101641.n6AGfg0G025710@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 16:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195568 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:41:43 -0000 Author: rpaulo Date: Fri Jul 10 16:41:42 2009 New Revision: 195568 URL: http://svn.freebsd.org/changeset/base/195568 Log: remove an inline b/c the function grew Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:40:28 2009 (r195567) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:41:42 2009 (r195568) @@ -80,7 +80,7 @@ static void mesh_forward(struct ieee8021 static int mesh_input(struct ieee80211_node *, struct mbuf *, int, int); static void mesh_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int, int); -static __inline void mesh_peer_timeout_setup(struct ieee80211_node *); +static void mesh_peer_timeout_setup(struct ieee80211_node *); static void mesh_peer_timeout_backoff(struct ieee80211_node *); static void mesh_peer_timeout_cb(void *); static __inline void mesh_peer_timeout_stop(struct ieee80211_node *); @@ -1917,7 +1917,7 @@ mesh_send_action_meshlink_reply(struct i } } -static __inline void +static void mesh_peer_timeout_setup(struct ieee80211_node *ni) { switch (ni->ni_mlstate) { From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:41:58 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8AB9106564A; Fri, 10 Jul 2009 16:41:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3E48FC0C; Fri, 10 Jul 2009 16:41:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGfwGV025752; Fri, 10 Jul 2009 16:41:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGfwv3025750; Fri, 10 Jul 2009 16:41:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101641.n6AGfwv3025750@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 16:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195569 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:41:59 -0000 Author: sam Date: Fri Jul 10 16:41:58 2009 New Revision: 195569 URL: http://svn.freebsd.org/changeset/base/195569 Log: o remove extra blank lines o de-inline Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 16:41:42 2009 (r195568) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 16:41:58 2009 (r195569) @@ -107,7 +107,7 @@ static int hwmp_send_perr(struct ieee802 static void hwmp_recv_rann(struct ieee80211vap *, struct ieee80211_node *, const struct ieee80211_frame *, const struct ieee80211_meshrann_ie *); -static __inline int hwmp_send_rann(struct ieee80211_node *, +static int hwmp_send_rann(struct ieee80211_node *, const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN], struct ieee80211_meshrann_ie *); @@ -698,7 +698,6 @@ hwmp_rootmode_rann_cb(void *arg) hwmp_rootmode_setup(vap); } - #define PREQ_TFLAGS(n) preq->preq_targets[n].target_flags #define PREQ_TADDR(n) preq->preq_targets[n].target_addr #define PREQ_TSEQ(n) preq->preq_targets[n].target_seq @@ -1049,7 +1048,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, } } -static __inline int +static int hwmp_send_prep(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], @@ -1104,7 +1103,6 @@ hwmp_peerdown(struct ieee80211_node *ni) #undef PERR_DADDR #undef PERR_DSEQ - #define PERR_DADDR(n) perr->perr_dests[n].dest_addr #define PERR_DSEQ(n) perr->perr_dests[n].dest_seq static void @@ -1154,7 +1152,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, #undef PEER_DADDR #undef PERR_DSEQ -static __inline int +static int hwmp_send_perr(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], @@ -1219,7 +1217,7 @@ hwmp_recv_rann(struct ieee80211vap *vap, } } -static __inline int +static int hwmp_send_rann(struct ieee80211_node *ni, const uint8_t sa[IEEE80211_ADDR_LEN], const uint8_t da[IEEE80211_ADDR_LEN], From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:42:47 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC1351065670; Fri, 10 Jul 2009 16:42:47 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAB748FC1D; Fri, 10 Jul 2009 16:42:47 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGglY2025804; Fri, 10 Jul 2009 16:42:47 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGglp4025802; Fri, 10 Jul 2009 16:42:47 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101642.n6AGglp4025802@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 16:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195570 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:42:48 -0000 Author: rpaulo Date: Fri Jul 10 16:42:47 2009 New Revision: 195570 URL: http://svn.freebsd.org/changeset/base/195570 Log: style Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:41:58 2009 (r195569) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:42:47 2009 (r195570) @@ -66,7 +66,8 @@ static int mesh_select_proto_path(struct static int mesh_select_proto_metric(struct ieee80211vap *, const char *); static void mesh_vattach(struct ieee80211vap *); static int mesh_newstate(struct ieee80211vap *, enum ieee80211_state, int); -static __inline void mesh_linkchange(struct ieee80211_node *, +static __inline void + mesh_linkchange(struct ieee80211_node *, enum ieee80211_mesh_mlstate); static void mesh_checkid(void *, struct ieee80211_node *); static uint32_t mesh_generateid(struct ieee80211vap *); @@ -81,9 +82,10 @@ static int mesh_input(struct ieee80211_n static void mesh_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, int, int); static void mesh_peer_timeout_setup(struct ieee80211_node *); -static void mesh_peer_timeout_backoff(struct ieee80211_node *); -static void mesh_peer_timeout_cb(void *); -static __inline void mesh_peer_timeout_stop(struct ieee80211_node *); +static void mesh_peer_timeout_backoff(struct ieee80211_node *); +static void mesh_peer_timeout_cb(void *); +static __inline void + mesh_peer_timeout_stop(struct ieee80211_node *); static int mesh_verify_meshpeerver(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshid(struct ieee80211vap *, const uint8_t *); static int mesh_verify_meshconf(struct ieee80211vap *, const uint8_t *); From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 16:44:20 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537631065678; Fri, 10 Jul 2009 16:44:20 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41EB78FC13; Fri, 10 Jul 2009 16:44:20 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AGiKKr025891; Fri, 10 Jul 2009 16:44:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AGiK5j025889; Fri, 10 Jul 2009 16:44:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907101644.n6AGiK5j025889@svn.freebsd.org> From: Rui Paulo Date: Fri, 10 Jul 2009 16:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195571 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 16:44:20 -0000 Author: rpaulo Date: Fri Jul 10 16:44:19 2009 New Revision: 195571 URL: http://svn.freebsd.org/changeset/base/195571 Log: whitespace fix Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 16:42:47 2009 (r195570) +++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c Fri Jul 10 16:44:19 2009 (r195571) @@ -262,9 +262,9 @@ hwmp_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate = vap->iv_state; struct ieee80211_hwmp_state *hs = vap->iv_hwmp; - IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", - __func__, ieee80211_state_name[ostate], - ieee80211_state_name[nstate], arg); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", + __func__, ieee80211_state_name[ostate], + ieee80211_state_name[nstate], arg); /* Flush the table on RUN -> !RUN, e.g. interface down & up */ if (nstate != IEEE80211_S_RUN && ostate == IEEE80211_S_RUN) @@ -440,7 +440,7 @@ hwmp_send_action(struct ieee80211_node * IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT, ni, "block %s frame in CAC state", "HWMP action"); vap->iv_stats.is_tx_badstate++; - return EIO; /* XXX */ + return EIO; /* XXX */ } KASSERT(ni != NULL, ("null node")); From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 17:22:41 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FC9B106566B; Fri, 10 Jul 2009 17:22:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4508FC13; Fri, 10 Jul 2009 17:22:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AHMf2C026876; Fri, 10 Jul 2009 17:22:41 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AHMf0v026873; Fri, 10 Jul 2009 17:22:41 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101722.n6AHMf0v026873@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 17:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195572 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 17:22:41 -0000 Author: sam Date: Fri Jul 10 17:22:41 2009 New Revision: 195572 URL: http://svn.freebsd.org/changeset/base/195572 Log: o track the number of established neighbors o use the neighbor count when forming the meshconf ie instead of walking the sta table Reviewed by: rpaulo Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 16:44:19 2009 (r195571) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 17:22:41 2009 (r195572) @@ -588,7 +588,7 @@ mesh_newstate(struct ieee80211vap *vap, /* * Helper function to note the Mesh Peer Link FSM change. */ -static __inline void +static void mesh_linkchange(struct ieee80211_node *ni, enum ieee80211_mesh_mlstate state) { struct ieee80211vap *vap = ni->ni_vap; @@ -603,10 +603,21 @@ mesh_linkchange(struct ieee80211_node *n [IEEE80211_NODE_MESH_HOLDING] = "HOLDING" }; #endif - ni->ni_mlstate = state; IEEE80211_NOTE(vap, IEEE80211_MSG_MESH, - ni, "peer link: switching to state %s", - meshlinkstates[ni->ni_mlstate]); + ni, "peer link: %s -> %s", + meshlinkstates[ni->ni_mlstate], meshlinkstates[state]); + + /* track neighbor count */ + if (state == IEEE80211_NODE_MESH_ESTABLISHED && + ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) { + KASSERT(ms->ms_neighbors < 65535, ("neighbor count overflow")); + ms->ms_neighbors++; + } else if (ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED && + state != IEEE80211_NODE_MESH_ESTABLISHED) { + KASSERT(ms->ms_neighbors > 0, ("neighbor count 0")); + ms->ms_neighbors--; + } + ni->ni_mlstate = state; if (state == IEEE80211_NODE_MESH_HOLDING) ms->ms_ppath->mpp_peerdown(ni); } @@ -2152,20 +2163,6 @@ ieee80211_add_meshid(uint8_t *frm, struc } /* - * Helper function to find the number of mesh neighbors. - */ -static void -meshconf_neighbors(void *arg, struct ieee80211_node *ni) -{ - uint8_t *neighbors = arg; - - /* NB: avoid overflow */ - if (*neighbors < 15 && - ni->ni_mlstate == IEEE80211_NODE_MESH_ESTABLISHED) - (*neighbors)++; -} - -/* * Add a Mesh Configuration IE to a frame. * For now just use HWMP routing, Airtime link metric, Null Congestion * Signaling, Null Sync Protocol and Null Authentication. @@ -2173,7 +2170,6 @@ meshconf_neighbors(void *arg, struct iee uint8_t * ieee80211_add_meshconf(uint8_t *frm, struct ieee80211vap *vap) { - uint8_t neighs = 0; const struct ieee80211_mesh_state *ms = vap->iv_mesh; static const uint8_t null[4] = IEEE80211_MESHCONF_NULL; @@ -2193,10 +2189,8 @@ ieee80211_add_meshconf(uint8_t *frm, str frm += 4; memcpy(frm, null, 4); /* auth */ frm += 4; - ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, meshconf_neighbors, - &neighs); /* NB: set the number of neighbors before the rest */ - *frm = neighs << 1; + *frm = (ms->ms_neighbors > 15 ? 15 : ms->ms_neighbors) << 1; if (ms->ms_flags & IEEE80211_MESHFLAGS_PORTAL) *frm |= IEEE80211_MESHCONF_FORM_MP; frm += 1; Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 16:44:19 2009 (r195571) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 10 17:22:41 2009 (r195572) @@ -447,6 +447,7 @@ struct ieee80211_mesh_state { int ms_idlen; uint8_t ms_id[IEEE80211_MESHID_LEN]; ieee80211_mesh_seq ms_seq; /* seq no for meshcntl */ + uint16_t ms_neighbors; uint8_t ms_ttl; /* mesh ttl set in packets */ #define IEEE80211_MESHFLAGS_AP 0x01 /* accept peers */ #define IEEE80211_MESHFLAGS_PORTAL 0x02 /* mesh portal role */ From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 18:15:43 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF671065687; Fri, 10 Jul 2009 18:15:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E74D8FC0C; Fri, 10 Jul 2009 18:15:43 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AIFhBI028041; Fri, 10 Jul 2009 18:15:43 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AIFhjr028039; Fri, 10 Jul 2009 18:15:43 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101815.n6AIFhjr028039@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 18:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195574 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 18:15:44 -0000 Author: sam Date: Fri Jul 10 18:15:43 2009 New Revision: 195574 URL: http://svn.freebsd.org/changeset/base/195574 Log: match order of elements in structure Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.c Modified: projects/mesh11s/sys/net80211/ieee80211_ioctl.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ioctl.c Fri Jul 10 17:42:53 2009 (r195573) +++ projects/mesh11s/sys/net80211/ieee80211_ioctl.c Fri Jul 10 18:15:43 2009 (r195574) @@ -441,9 +441,9 @@ get_sta_info(void *arg, struct ieee80211 else si->isi_inact = vap->iv_inact_init; si->isi_inact = (si->isi_inact - ni->ni_inact) * IEEE80211_INACT_WAIT; - si->isi_peerstate = ni->ni_mlstate; si->isi_localid = ni->ni_mllid; si->isi_peerid = ni->ni_mlpid; + si->isi_peerstate = ni->ni_mlstate; if (ielen) { cp = ((uint8_t *)si) + si->isi_ie_off; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 18:24:02 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEFD2106566B; Fri, 10 Jul 2009 18:24:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD9F78FC13; Fri, 10 Jul 2009 18:24:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AIO298028232; Fri, 10 Jul 2009 18:24:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AIO2uL028230; Fri, 10 Jul 2009 18:24:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907101824.n6AIO2uL028230@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 18:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195575 - projects/mips/gnu/usr.bin/binutils/ld X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 18:24:03 -0000 Author: imp Date: Fri Jul 10 18:24:02 2009 New Revision: 195575 URL: http://svn.freebsd.org/changeset/base/195575 Log: quick hack for the problem gonzo is seeing. Modified: projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips Modified: projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jul 10 18:15:43 2009 (r195574) +++ projects/mips/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jul 10 18:24:02 2009 (r195575) @@ -12,9 +12,9 @@ NATIVE_EMULATION=elf${_sz}ltsmip_fbsd MIPS_ABIS=elf32btsmip_fbsd elf32ltsmip_fbsd elf64btsmip_fbsd elf64ltsmip_fbsd .for abi in ${MIPS_ABIS} -.if (${abi} != ${NATIVE_EMULATION}) +#.if (${abi} != ${NATIVE_EMULATION}) EMS+= ${abi} -.endif +#.endif .for ext in ${ELF_SCR_EXT} LDSCRIPTS+= ${abi}.${ext} .endfor From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 18:34:19 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97FB91065712; Fri, 10 Jul 2009 18:34:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86AE88FC12; Fri, 10 Jul 2009 18:34:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AIYJ1a028487; Fri, 10 Jul 2009 18:34:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AIYJ6p028485; Fri, 10 Jul 2009 18:34:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101834.n6AIYJ6p028485@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 18:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195576 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 18:34:20 -0000 Author: sam Date: Fri Jul 10 18:34:19 2009 New Revision: 195576 URL: http://svn.freebsd.org/changeset/base/195576 Log: fix building w/o IEEE80211_DEBUG Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 18:24:02 2009 (r195575) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 10 18:34:19 2009 (r195576) @@ -1576,11 +1576,10 @@ mesh_recv_action_meshpeering_close(struc const struct ieee80211_frame *wh, const uint8_t *frm, const uint8_t *efrm) { - struct ieee80211vap *vap = ni->ni_vap; uint16_t args[3]; - IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, ni, - "%s", "recv PEER CLOSE"); + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_MESH, + ni, "%s", "recv PEER CLOSE"); switch (ni->ni_mlstate) { case IEEE80211_NODE_MESH_IDLE: @@ -1979,11 +1978,9 @@ static void mesh_peer_timeout_cb(void *arg) { struct ieee80211_node *ni = (struct ieee80211_node *)arg; - struct ieee80211vap *vap = ni->ni_vap; uint16_t args[3]; - IEEE80211_NOTE(vap, - IEEE80211_MSG_MESH, + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_MESH, ni, "mesh link timeout, state %d, retry counter %d", ni->ni_mlstate, ni->ni_mlrcnt); From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 18:35:12 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F03106568A; Fri, 10 Jul 2009 18:35:12 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4AB78FC0C; Fri, 10 Jul 2009 18:35:11 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AIZBsr028556; Fri, 10 Jul 2009 18:35:11 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AIZBWb028546; Fri, 10 Jul 2009 18:35:11 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101835.n6AIZBWb028546@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 18:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195577 - in projects/mesh11s/sys: conf net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 18:35:12 -0000 Author: sam Date: Fri Jul 10 18:35:11 2009 New Revision: 195577 URL: http://svn.freebsd.org/changeset/base/195577 Log: add IEEE80211_SUPPORT_MESH knob to control inclusion of mesh support Modified: projects/mesh11s/sys/conf/files projects/mesh11s/sys/conf/options projects/mesh11s/sys/net80211/ieee80211.c projects/mesh11s/sys/net80211/ieee80211_ddb.c projects/mesh11s/sys/net80211/ieee80211_input.c projects/mesh11s/sys/net80211/ieee80211_node.c projects/mesh11s/sys/net80211/ieee80211_output.c projects/mesh11s/sys/net80211/ieee80211_proto.c projects/mesh11s/sys/net80211/ieee80211_scan_sta.c Modified: projects/mesh11s/sys/conf/files ============================================================================== --- projects/mesh11s/sys/conf/files Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/conf/files Fri Jul 10 18:35:11 2009 (r195577) @@ -2246,10 +2246,10 @@ net80211/ieee80211_dfs.c optional wlan net80211/ieee80211_freebsd.c optional wlan net80211/ieee80211_hostap.c optional wlan net80211/ieee80211_ht.c optional wlan -net80211/ieee80211_hwmp.c optional wlan +net80211/ieee80211_hwmp.c optional wlan ieee80211_support_mesh net80211/ieee80211_input.c optional wlan net80211/ieee80211_ioctl.c optional wlan -net80211/ieee80211_mesh.c optional wlan +net80211/ieee80211_mesh.c optional wlan ieee80211_support_mesh net80211/ieee80211_monitor.c optional wlan net80211/ieee80211_node.c optional wlan net80211/ieee80211_output.c optional wlan Modified: projects/mesh11s/sys/conf/options ============================================================================== --- projects/mesh11s/sys/conf/options Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/conf/options Fri Jul 10 18:35:11 2009 (r195577) @@ -804,6 +804,7 @@ INTR_FILTER IEEE80211_DEBUG opt_wlan.h IEEE80211_DEBUG_REFCNT opt_wlan.h IEEE80211_AMPDU_AGE opt_wlan.h +IEEE80211_SUPPORT_MESH opt_wlan.h IEEE80211_SUPPORT_SUPERG opt_wlan.h IEEE80211_SUPPORT_TDMA opt_wlan.h Modified: projects/mesh11s/sys/net80211/ieee80211.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211.c Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/net80211/ieee80211.c Fri Jul 10 18:35:11 2009 (r195577) @@ -74,7 +74,9 @@ const int ieee80211_opcap[IEEE80211_OPMO [IEEE80211_M_AHDEMO] = IEEE80211_C_AHDEMO, [IEEE80211_M_HOSTAP] = IEEE80211_C_HOSTAP, [IEEE80211_M_MONITOR] = IEEE80211_C_MONITOR, +#ifdef IEEE80211_SUPPORT_MBSS [IEEE80211_M_MBSS] = IEEE80211_C_MBSS, +#endif }; static const uint8_t ieee80211broadcastaddr[IEEE80211_ADDR_LEN] = Modified: projects/mesh11s/sys/net80211/ieee80211_ddb.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_ddb.c Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/net80211/ieee80211_ddb.c Fri Jul 10 18:35:11 2009 (r195577) @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_TDMA #include #endif +#ifdef IEEE80211_SUPPORT_MESH #include +#endif #include #include @@ -78,7 +80,9 @@ static void _db_show_txparams(const char const struct ieee80211_txparam *tp); static void _db_show_ageq(const char *tag, const struct ieee80211_ageq *q); static void _db_show_stats(const struct ieee80211_stats *); +#ifdef IEEE80211_SUPPORT_MESH static void _db_show_mesh(const struct ieee80211_mesh_state *); +#endif DB_SHOW_COMMAND(sta, db_show_sta) { @@ -181,6 +185,7 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_va } } +#ifdef IEEE80211_SUPPORT_MESH DB_SHOW_ALL_COMMAND(mesh, db_show_mesh) { const struct ieee80211_mesh_state *ms; @@ -192,6 +197,7 @@ DB_SHOW_ALL_COMMAND(mesh, db_show_mesh) ms = (const struct ieee80211_mesh_state *) addr; _db_show_mesh(ms); } +#endif /* IEEE80211_SUPPORT_MESH */ static void _db_show_txampdu(const char *sep, int ix, const struct ieee80211_tx_ampdu *tap) @@ -298,12 +304,12 @@ _db_show_sta(const struct ieee80211_node db_printf("\tinact %u inact_reload %u txrate %u\n", ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); - +#ifdef IEEE80211_SUPPORT_MESH _db_show_ssid("\tmeshid ", 0, ni->ni_meshidlen, ni->ni_meshid); db_printf(" mlstate %b mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n", ni->ni_mlstate, IEEE80211_MESH_MLSTATE_BITS, ni->ni_mllid, ni->ni_mlpid, ni->ni_mlrcnt, ni->ni_mltval); - /* XXX wdsq */ +#endif } #ifdef IEEE80211_SUPPORT_TDMA @@ -851,6 +857,7 @@ _db_show_stats(const struct ieee80211_st { } +#ifdef IEEE80211_SUPPORT_MESH static void _db_show_mesh(const struct ieee80211_mesh_state *ms) { @@ -870,4 +877,5 @@ _db_show_mesh(const struct ieee80211_mes i++; } } +#endif /* IEEE80211_SUPPORT_MESH */ #endif /* DDB */ Modified: projects/mesh11s/sys/net80211/ieee80211_input.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_input.c Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/net80211/ieee80211_input.c Fri Jul 10 18:35:11 2009 (r195577) @@ -46,7 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef IEEE80211_SUPPORT_MESH #include +#endif #include @@ -231,12 +233,16 @@ ieee80211_deliver_data(struct ieee80211v struct mbuf * ieee80211_decap(struct ieee80211vap *vap, struct mbuf *m, int hdrlen) { +#ifdef IEEE80211_SUPPORT_MESH union { struct ieee80211_qosframe_addr4 wh4; uint8_t b[sizeof(struct ieee80211_qosframe_addr4) + sizeof(struct ieee80211_meshcntl_ae11)]; } whu; #define wh whu.wh4 +#else + struct ieee80211_qosframe_addr4 wh; +#endif struct ether_header *eh; struct llc *llc; @@ -568,12 +574,14 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_HTINFO: scan->htinfo = frm; break; +#ifdef IEEE80211_SUPPORT_TDMA case IEEE80211_ELEMID_MESHID: scan->meshid = frm; break; case IEEE80211_ELEMID_MESHCONF: scan->meshconf = frm; break; +#endif case IEEE80211_ELEMID_VENDOR: if (iswpaoui(frm)) scan->wpa = frm; Modified: projects/mesh11s/sys/net80211/ieee80211_node.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.c Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/net80211/ieee80211_node.c Fri Jul 10 18:35:11 2009 (r195577) @@ -367,9 +367,11 @@ ieee80211_create_ibss(struct ieee80211va if ((vap->iv_caps & IEEE80211_C_TDMA) == 0) #endif memset(ni->ni_bssid, 0, IEEE80211_ADDR_LEN); +#ifdef IEEE80211_SUPPORT_MESH } else if (vap->iv_opmode == IEEE80211_M_MBSS) { ni->ni_meshidlen = vap->iv_mesh->ms_idlen; memcpy(ni->ni_meshid, vap->iv_mesh->ms_id, ni->ni_meshidlen); +#endif } /* * Fix the channel and related attributes. @@ -795,8 +797,10 @@ ieee80211_sta_join(struct ieee80211vap * ieee80211_parse_htcap(ni, ni->ni_ies.htcap_ie); if (ni->ni_ies.htinfo_ie != NULL) ieee80211_parse_htinfo(ni, ni->ni_ies.htinfo_ie); +#ifdef IEEE80211_SUPPORT_MESH if (ni->ni_ies.meshid_ie != NULL) ieee80211_parse_meshid(ni, ni->ni_ies.meshid_ie); +#endif #ifdef IEEE80211_SUPPORT_TDMA if (ni->ni_ies.tdma_ie != NULL) ieee80211_parse_tdma(ni, ni->ni_ies.tdma_ie); @@ -927,9 +931,11 @@ ieee80211_ies_expand(struct ieee80211_ie case IEEE80211_ELEMID_HTCAP: ies->htcap_ie = ie; break; +#ifdef IEEE80211_SUPPORT_MESH case IEEE80211_ELEMID_MESHID: ies->meshid_ie = ie; break; +#endif } ielen -= 2 + ie[1]; ie += 2 + ie[1]; @@ -967,12 +973,13 @@ node_cleanup(struct ieee80211_node *ni) else if (ni->ni_ath_flags & IEEE80211_NODE_ATH) ieee80211_ff_node_cleanup(ni); #endif +#ifdef IEEE80211_SUPPORT_MESH /* * Cleanup any mesh-related state. */ if (vap->iv_opmode == IEEE80211_M_MBSS) ieee80211_mesh_node_cleanup(ni); - +#endif /* * Clear any staging queue entries. */ @@ -1112,9 +1119,10 @@ ieee80211_alloc_node(struct ieee80211_no ni->ni_inact = ni->ni_inact_reload; ni->ni_ath_defkeyix = 0x7fff; ieee80211_psq_init(&ni->ni_psq, "unknown"); +#ifdef IEEE80211_SUPPORT_MESH if (vap->iv_opmode == IEEE80211_M_MBSS) ieee80211_mesh_node_init(vap, ni); - +#endif IEEE80211_NODE_LOCK(nt); TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list); LIST_INSERT_HEAD(&nt->nt_hash[hash], ni, ni_hash); @@ -1404,8 +1412,6 @@ ieee80211_init_neighbor(struct ieee80211 const struct ieee80211_frame *wh, const struct ieee80211_scanparams *sp) { - struct ieee80211vap *vap = ni->ni_vap; - ni->ni_esslen = sp->ssid[1]; memcpy(ni->ni_essid, sp->ssid + 2, sp->ssid[1]); IEEE80211_ADDR_COPY(ni->ni_bssid, wh->i_addr3); @@ -1417,9 +1423,10 @@ ieee80211_init_neighbor(struct ieee80211 ni->ni_fhindex = sp->fhindex; ni->ni_erp = sp->erp; ni->ni_timoff = sp->timoff; - if (vap->iv_opmode == IEEE80211_M_MBSS) +#ifdef IEEE80211_SUPPORT_MESH + if (ni->ni_vap->iv_opmode == IEEE80211_M_MBSS) ieee80211_mesh_init_neighbor(ni, wh, sp); - +#endif if (ieee80211_ies_init(&ni->ni_ies, sp->ies, sp->ies_len)) { ieee80211_ies_expand(&ni->ni_ies); if (ni->ni_ies.wme_ie != NULL) @@ -2553,6 +2560,7 @@ get_adhoc_rssi(void *arg, struct ieee802 } } +#ifdef IEEE80211_SUPPORT_MESH static void get_mesh_rssi(void *arg, struct ieee80211_node *ni) { @@ -2571,7 +2579,7 @@ get_mesh_rssi(void *arg, struct ieee8021 info->rssi_total += rssi; } } - +#endif /* IEEE80211_SUPPORT_MESH */ int8_t ieee80211_getrssi(struct ieee80211vap *vap) @@ -2591,9 +2599,11 @@ ieee80211_getrssi(struct ieee80211vap *v case IEEE80211_M_HOSTAP: /* average of all associated stations */ ieee80211_iterate_nodes(&ic->ic_sta, get_hostap_rssi, &info); break; +#ifdef IEEE80211_SUPPORT_MESH case IEEE80211_M_MBSS: /* average of all mesh neighbors */ ieee80211_iterate_nodes(&ic->ic_sta, get_mesh_rssi, &info); break; +#endif case IEEE80211_M_MONITOR: /* XXX */ case IEEE80211_M_STA: /* use stats from associated ap */ default: Modified: projects/mesh11s/sys/net80211/ieee80211_output.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_output.c Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/net80211/ieee80211_output.c Fri Jul 10 18:35:11 2009 (r195577) @@ -218,7 +218,9 @@ ieee80211_start(struct ifnet *ifp) ieee80211_dwds_mcast(vap, m); } } +#ifdef IEEE80211_SUPPORT_MESH if (vap->iv_opmode != IEEE80211_M_MBSS) { +#endif ni = ieee80211_find_txnode(vap, eh->ether_dhost); if (ni == NULL) { /* NB: ieee80211_find_txnode does stat+msg */ @@ -238,6 +240,7 @@ ieee80211_start(struct ifnet *ifp) ieee80211_free_node(ni); continue; } +#ifdef IEEE80211_SUPPORT_MESH } else { ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m); if (ni == NULL) { @@ -250,6 +253,7 @@ ieee80211_start(struct ifnet *ifp) continue; } } +#endif if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && (m->m_flags & M_PWR_SAV) == 0) { @@ -525,6 +529,7 @@ ieee80211_send_setup( IEEE80211_ADDR_COPY(WH4(wh)->i_addr4, sa); break; case IEEE80211_M_MBSS: +#ifdef IEEE80211_SUPPORT_MESH /* XXX add support for proxied addresses */ if (IEEE80211_IS_MULTICAST(da)) { wh->i_fc[1] = IEEE80211_FC1_DIR_FROMDS; @@ -540,6 +545,7 @@ ieee80211_send_setup( IEEE80211_ADDR_COPY(wh->i_addr3, da); IEEE80211_ADDR_COPY(WH4(wh)->i_addr4, sa); } +#endif break; case IEEE80211_M_MONITOR: /* NB: to quiet compiler */ break; @@ -548,9 +554,11 @@ ieee80211_send_setup( wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; IEEE80211_ADDR_COPY(wh->i_addr1, da); IEEE80211_ADDR_COPY(wh->i_addr2, sa); +#ifdef IEEE80211_SUPPORT_MESH if (vap->iv_opmode == IEEE80211_M_MBSS) IEEE80211_ADDR_COPY(wh->i_addr3, sa); else +#endif IEEE80211_ADDR_COPY(wh->i_addr3, bssid); } *(uint16_t *)&wh->i_dur[0] = 0; @@ -977,7 +985,10 @@ ieee80211_encap(struct ieee80211vap *vap { #define WH4(wh) ((struct ieee80211_frame_addr4 *)(wh)) struct ieee80211com *ic = ni->ni_ic; +#ifdef IEEE80211_SUPPORT_MESH struct ieee80211_mesh_state *ms = vap->iv_mesh; + struct ieee80211_meshcntl_ae11 *mc; +#endif struct ether_header eh; struct ieee80211_frame *wh; struct ieee80211_key *key; @@ -985,7 +996,6 @@ ieee80211_encap(struct ieee80211vap *vap int hdrsize, hdrspace, datalen, addqos, txfrag, is4addr; ieee80211_seq seqno; int meshhdrsize, meshae; - struct ieee80211_meshcntl_ae11 *mc; uint8_t *qos; /* @@ -1039,6 +1049,7 @@ ieee80211_encap(struct ieee80211vap *vap hdrsize = sizeof(struct ieee80211_qosframe); else hdrsize = sizeof(struct ieee80211_frame); +#ifdef IEEE80211_SUPPORT_MESH if (vap->iv_opmode == IEEE80211_M_MBSS) { /* * Mesh data frames are encapsulated according to the @@ -1072,6 +1083,7 @@ ieee80211_encap(struct ieee80211vap *vap meshhdrsize += 3*IEEE80211_ADDR_LEN; } } else { +#endif /* * 4-address frames need to be generated for: * o packets sent through a WDS vap (IEEE80211_M_WDS) @@ -1084,7 +1096,9 @@ ieee80211_encap(struct ieee80211vap *vap if (is4addr) hdrsize += IEEE80211_ADDR_LEN; meshhdrsize = meshae = 0; +#ifdef IEEE80211_SUPPORT_MESH } +#endif /* * Honor driver DATAPAD requirement. */ @@ -1162,6 +1176,7 @@ ieee80211_encap(struct ieee80211vap *vap IEEE80211_ADDR_COPY(wh->i_addr2, ni->ni_bssid); IEEE80211_ADDR_COPY(wh->i_addr3, eh.ether_shost); break; +#ifdef IEEE80211_SUPPORT_MESH case IEEE80211_M_MBSS: /* NB: offset by hdrspace to deal with DATAPAD */ mc = (struct ieee80211_meshcntl_ae11 *) @@ -1214,8 +1229,9 @@ ieee80211_encap(struct ieee80211vap *vap ms->ms_seq++; LE_WRITE_4(mc->mc_seq, ms->ms_seq); break; - case IEEE80211_M_MONITOR: +#endif case IEEE80211_M_WDS: /* NB: is4addr should always be true */ + default: goto bad; } if (m->m_flags & M_MORE_DATA) @@ -2222,8 +2238,10 @@ ieee80211_alloc_proberesp(struct ieee802 #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) #endif +#ifdef IEEE80211_SUPPORT_MESH + 2 + IEEE80211_MESHID_LEN + sizeof(struct ieee80211_meshconf_ie) +#endif + (vap->iv_appie_proberesp != NULL ? vap->iv_appie_proberesp->ie_len : 0) ); @@ -2313,10 +2331,12 @@ ieee80211_alloc_proberesp(struct ieee802 #endif if (vap->iv_appie_proberesp != NULL) frm = add_appie(frm, vap->iv_appie_proberesp); +#ifdef IEEE80211_SUPPORT_MESH if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshconf(frm, vap); } +#endif m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); return m; @@ -2619,10 +2639,12 @@ ieee80211_beacon_construct(struct mbuf * bo->bo_appie_len = vap->iv_appie_beacon->ie_len; frm = add_appie(frm, vap->iv_appie_beacon); } +#ifdef IEEE80211_SUPPORT_MESH if (vap->iv_opmode == IEEE80211_M_MBSS) { frm = ieee80211_add_meshid(frm, vap); frm = ieee80211_add_meshconf(frm, vap); } +#endif bo->bo_tim_trailer_len = frm - bo->bo_tim_trailer; bo->bo_csa_trailer_len = frm - bo->bo_csa; m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); @@ -2635,7 +2657,6 @@ struct mbuf * ieee80211_beacon_alloc(struct ieee80211_node *ni, struct ieee80211_beacon_offsets *bo) { - static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ifnet *ifp = vap->iv_ifp; @@ -2701,10 +2722,10 @@ ieee80211_beacon_alloc(struct ieee80211_ + (vap->iv_caps & IEEE80211_C_TDMA ? /* TDMA */ sizeof(struct ieee80211_tdma_param) : 0) #endif - + (vap->iv_opmode == IEEE80211_M_MBSS ? - 2 + ni->ni_meshidlen : 0) - + (vap->iv_opmode == IEEE80211_M_MBSS ? - sizeof(struct ieee80211_meshconf_ie) : 0) +#ifdef IEEE80211_SUPPORT_MESH + + 2 + ni->ni_meshidlen + + sizeof(struct ieee80211_meshconf_ie) +#endif + IEEE80211_MAX_APPIE ; m = ieee80211_getmgtframe(&frm, @@ -2726,9 +2747,12 @@ ieee80211_beacon_alloc(struct ieee80211_ *(uint16_t *)wh->i_dur = 0; IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr); IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr); - if (vap->iv_opmode == IEEE80211_M_MBSS) +#ifdef IEEE80211_SUPPORT_MESH + if (vap->iv_opmode == IEEE80211_M_MBSS) { + static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; IEEE80211_ADDR_COPY(wh->i_addr3, zerobssid); - else + } else +#endif IEEE80211_ADDR_COPY(wh->i_addr3, ni->ni_bssid); *(uint16_t *)wh->i_seq = 0; Modified: projects/mesh11s/sys/net80211/ieee80211_proto.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_proto.c Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/net80211/ieee80211_proto.c Fri Jul 10 18:35:11 2009 (r195577) @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef IEEE80211_SUPPORT_MESH #include +#endif #include #include @@ -154,7 +156,9 @@ ieee80211_proto_attach(struct ieee80211c ieee80211_sta_attach(ic); ieee80211_wds_attach(ic); ieee80211_hostap_attach(ic); +#ifdef IEEE80211_SUPPORT_MESH ieee80211_mesh_attach(ic); +#endif ieee80211_monitor_attach(ic); } @@ -162,7 +166,9 @@ void ieee80211_proto_detach(struct ieee80211com *ic) { ieee80211_monitor_detach(ic); +#ifdef IEEE80211_SUPPORT_MESH ieee80211_mesh_detach(ic); +#endif ieee80211_hostap_detach(ic); ieee80211_wds_detach(ic); ieee80211_adhoc_detach(ic); Modified: projects/mesh11s/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_scan_sta.c Fri Jul 10 18:34:19 2009 (r195576) +++ projects/mesh11s/sys/net80211/ieee80211_scan_sta.c Fri Jul 10 18:35:11 2009 (r195577) @@ -48,7 +48,9 @@ __FBSDID("$FreeBSD$"); #ifdef IEEE80211_SUPPORT_TDMA #include #endif +#ifdef IEEE80211_SUPPORT_MESH #include +#endif #include @@ -142,6 +144,10 @@ isocmp(const uint8_t cc1[], const uint8_ /* number of references from net80211 layer */ static int nrefs = 0; +/* + * Module glue. + */ +IEEE80211_SCANNER_MODULE(sta, 1); /* * Attach prior to any scanning work. @@ -284,8 +290,10 @@ found: memcpy(ise->se_tstamp.data, sp->tstamp, sizeof(ise->se_tstamp)); ise->se_intval = sp->bintval; ise->se_capinfo = sp->capinfo; +#ifdef IEEE80211_SUPPORT_MESH if (sp->meshid != NULL && sp->meshid[1] != 0) memcpy(ise->se_meshid, sp->meshid, 2+sp->meshid[1]); +#endif /* * Beware of overriding se_chan for frames seen * off-channel; this can cause us to attempt an @@ -996,6 +1004,7 @@ match_bss(struct ieee80211vap *vap, #endif } #endif /* IEEE80211_SUPPORT_TDMA */ +#ifdef IEEE80211_SUPPORT_MESH } else if (vap->iv_opmode == IEEE80211_M_MBSS) { const struct ieee80211_mesh_state *ms = vap->iv_mesh; /* @@ -1006,10 +1015,11 @@ match_bss(struct ieee80211vap *vap, fail |= MATCH_CAPINFO; else if (se->se_meshid == NULL) fail |= MATCH_MESH_NOID; - else if (vap->iv_mesh->ms_idlen != 0 && + else if (ms->ms_idlen != 0 && match_id(se->se_meshid, ms->ms_id, ms->ms_idlen)) fail |= MATCH_MESHID; } else { +#endif if ((se->se_capinfo & IEEE80211_CAPINFO_ESS) == 0) fail |= MATCH_CAPINFO; /* @@ -1439,6 +1449,7 @@ static const struct ieee80211_scanner st .scan_assoc_fail = sta_assoc_fail, .scan_assoc_success = sta_assoc_success, }; +IEEE80211_SCANNER_ALG(sta, IEEE80211_M_STA, sta_default); /* * Adhoc mode-specific support. @@ -1655,6 +1666,8 @@ static const struct ieee80211_scanner ad .scan_assoc_fail = sta_assoc_fail, .scan_assoc_success = sta_assoc_success, }; +IEEE80211_SCANNER_ALG(ibss, IEEE80211_M_IBSS, adhoc_default); +IEEE80211_SCANNER_ALG(ahdemo, IEEE80211_M_AHDEMO, adhoc_default); static void ap_force_promisc(struct ieee80211com *ic) @@ -1806,7 +1819,9 @@ static const struct ieee80211_scanner ap .scan_assoc_success = sta_assoc_success, .scan_assoc_fail = sta_assoc_fail, }; +IEEE80211_SCANNER_ALG(ap, IEEE80211_M_HOSTAP, ap_default); +#ifdef IEEE80211_SUPPORT_MESH /* * Pick an mbss network to join or find a channel * to use to start an mbss network. @@ -1907,13 +1922,5 @@ static const struct ieee80211_scanner me .scan_assoc_fail = sta_assoc_fail, .scan_assoc_success = sta_assoc_success, }; - -/* - * Module glue. - */ -IEEE80211_SCANNER_MODULE(sta, 1); -IEEE80211_SCANNER_ALG(sta, IEEE80211_M_STA, sta_default); -IEEE80211_SCANNER_ALG(ibss, IEEE80211_M_IBSS, adhoc_default); -IEEE80211_SCANNER_ALG(ahdemo, IEEE80211_M_AHDEMO, adhoc_default); -IEEE80211_SCANNER_ALG(ap, IEEE80211_M_HOSTAP, ap_default); IEEE80211_SCANNER_ALG(mesh, IEEE80211_M_MBSS, mesh_default); +#endif /* IEEE80211_SUPPORT_MESH */ From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 18:43:47 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D846D1065670; Fri, 10 Jul 2009 18:43:47 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C75DF8FC0A; Fri, 10 Jul 2009 18:43:47 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AIhlHM028735; Fri, 10 Jul 2009 18:43:47 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AIhlix028733; Fri, 10 Jul 2009 18:43:47 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907101843.n6AIhlix028733@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 18:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195578 - projects/mesh11s/sys/net80211 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 18:43:48 -0000 Author: sam Date: Fri Jul 10 18:43:47 2009 New Revision: 195578 URL: http://svn.freebsd.org/changeset/base/195578 Log: fix typo Modified: projects/mesh11s/sys/net80211/ieee80211.c Modified: projects/mesh11s/sys/net80211/ieee80211.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211.c Fri Jul 10 18:35:11 2009 (r195577) +++ projects/mesh11s/sys/net80211/ieee80211.c Fri Jul 10 18:43:47 2009 (r195578) @@ -74,7 +74,7 @@ const int ieee80211_opcap[IEEE80211_OPMO [IEEE80211_M_AHDEMO] = IEEE80211_C_AHDEMO, [IEEE80211_M_HOSTAP] = IEEE80211_C_HOSTAP, [IEEE80211_M_MONITOR] = IEEE80211_C_MONITOR, -#ifdef IEEE80211_SUPPORT_MBSS +#ifdef IEEE80211_SUPPORT_MESH [IEEE80211_M_MBSS] = IEEE80211_C_MBSS, #endif }; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 19:04:33 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D121065677; Fri, 10 Jul 2009 19:04:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2140C8FC13; Fri, 10 Jul 2009 19:04:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AJ4XKH029232; Fri, 10 Jul 2009 19:04:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AJ4XPV029230; Fri, 10 Jul 2009 19:04:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907101904.n6AJ4XPV029230@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 19:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195579 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 19:04:33 -0000 Author: imp Date: Fri Jul 10 19:04:32 2009 New Revision: 195579 URL: http://svn.freebsd.org/changeset/base/195579 Log: use ta0-ta3 rather than t4-t7 for n32/n64 goodness. Modified: projects/mips/sys/mips/mips/fp.S Modified: projects/mips/sys/mips/mips/fp.S ============================================================================== --- projects/mips/sys/mips/mips/fp.S Fri Jul 10 18:43:47 2009 (r195578) +++ projects/mips/sys/mips/mips/fp.S Fri Jul 10 19:04:32 2009 (r195579) @@ -634,7 +634,7 @@ func_fmt_tbl: */ sub_s: jal get_ft_fs_s - xor t4, t4, 1 # negate FT sign bit + xor ta0, ta0, 1 # negate FT sign bit b add_sub_s /* * Single precision add. @@ -643,38 +643,38 @@ add_s: jal get_ft_fs_s add_sub_s: bne t1, SEXP_INF, 1f # is FS an infinity? - bne t5, SEXP_INF, result_fs_s # if FT is not inf, result=FS + bne ta1, SEXP_INF, result_fs_s # if FT is not inf, result=FS bne t2, zero, result_fs_s # if FS is NAN, result is FS - bne t6, zero, result_ft_s # if FT is NAN, result is FT - bne t0, t4, invalid_s # both infinities same sign? + bne ta2, zero, result_ft_s # if FT is NAN, result is FT + bne t0, ta0, invalid_s # both infinities same sign? b result_fs_s # result is in FS 1: - beq t5, SEXP_INF, result_ft_s # if FT is inf, result=FT + beq ta1, SEXP_INF, result_ft_s # if FT is inf, result=FT bne t1, zero, 4f # is FS a denormalized num? beq t2, zero, 3f # is FS zero? - bne t5, zero, 2f # is FT a denormalized num? - beq t6, zero, result_fs_s # FT is zero, result=FS + bne ta1, zero, 2f # is FT a denormalized num? + beq ta2, zero, result_fs_s # FT is zero, result=FS jal renorm_fs_s jal renorm_ft_s b 5f 2: jal renorm_fs_s - subu t5, t5, SEXP_BIAS # unbias FT exponent - or t6, t6, SIMPL_ONE # set implied one bit + subu ta1, ta1, SEXP_BIAS # unbias FT exponent + or ta2, ta2, SIMPL_ONE # set implied one bit b 5f 3: - bne t5, zero, result_ft_s # if FT != 0, result=FT - bne t6, zero, result_ft_s + bne ta1, zero, result_ft_s # if FT != 0, result=FT + bne ta2, zero, result_ft_s and v0, a1, FPC_ROUNDING_BITS # get rounding mode bne v0, FPC_ROUND_RM, 1f # round to -infinity? - or t0, t0, t4 # compute result sign + or t0, t0, ta0 # compute result sign b result_fs_s 1: - and t0, t0, t4 # compute result sign + and t0, t0, ta0 # compute result sign b result_fs_s 4: - bne t5, zero, 2f # is FT a denormalized num? - beq t6, zero, result_fs_s # FT is zero, result=FS + bne ta1, zero, 2f # is FT a denormalized num? + beq ta2, zero, result_fs_s # FT is zero, result=FS subu t1, t1, SEXP_BIAS # unbias FS exponent or t2, t2, SIMPL_ONE # set implied one bit jal renorm_ft_s @@ -682,15 +682,15 @@ add_sub_s: 2: subu t1, t1, SEXP_BIAS # unbias FS exponent or t2, t2, SIMPL_ONE # set implied one bit - subu t5, t5, SEXP_BIAS # unbias FT exponent - or t6, t6, SIMPL_ONE # set implied one bit + subu ta1, ta1, SEXP_BIAS # unbias FT exponent + or ta2, ta2, SIMPL_ONE # set implied one bit /* * Perform the addition. */ 5: move t8, zero # no shifted bits (sticky reg) - beq t1, t5, 4f # no shift needed - subu v0, t1, t5 # v0 = difference of exponents + beq t1, ta1, 4f # no shift needed + subu v0, t1, ta1 # v0 = difference of exponents move v1, v0 # v1 = abs(difference) bge v0, zero, 1f negu v1 @@ -698,50 +698,50 @@ add_sub_s: ble v1, SFRAC_BITS+2, 2f # is difference too great? li t8, STICKYBIT # set the sticky bit bge v0, zero, 1f # check which exp is larger - move t1, t5 # result exp is FTs + move t1, ta1 # result exp is FTs move t2, zero # FSs fraction shifted is zero b 4f 1: - move t6, zero # FTs fraction shifted is zero + move ta2, zero # FTs fraction shifted is zero b 4f 2: li t9, 32 # compute 32 - abs(exp diff) subu t9, t9, v1 bgt v0, zero, 3f # if FS > FT, shift FTs frac - move t1, t5 # FT > FS, result exp is FTs + move t1, ta1 # FT > FS, result exp is FTs sll t8, t2, t9 # save bits shifted out srl t2, t2, v1 # shift FSs fraction b 4f 3: - sll t8, t6, t9 # save bits shifted out - srl t6, t6, v1 # shift FTs fraction + sll t8, ta2, t9 # save bits shifted out + srl ta2, ta2, v1 # shift FTs fraction 4: - bne t0, t4, 1f # if signs differ, subtract - addu t2, t2, t6 # add fractions + bne t0, ta0, 1f # if signs differ, subtract + addu t2, t2, ta2 # add fractions b norm_s 1: - blt t2, t6, 3f # subtract larger from smaller - bne t2, t6, 2f # if same, result=0 + blt t2, ta2, 3f # subtract larger from smaller + bne t2, ta2, 2f # if same, result=0 move t1, zero # result=0 move t2, zero and v0, a1, FPC_ROUNDING_BITS # get rounding mode - bne v0, FPC_ROUND_RM, 1f # round to -infinity? - or t0, t0, t4 # compute result sign + bne v0, FPC_ROUND_RM, 1f # round to -infinity? + or t0, t0, ta0 # compute result sign b result_fs_s 1: - and t0, t0, t4 # compute result sign + and t0, t0, ta0 # compute result sign b result_fs_s 2: - sltu t9, zero, t8 # compute t2:zero - t6:t8 + sltu t9, zero, t8 # compute t2:zero - ta2:t8 subu t8, zero, t8 - subu t2, t2, t6 # subtract fractions + subu t2, t2, ta2 # subtract fractions subu t2, t2, t9 # subtract barrow b norm_s 3: - move t0, t4 # sign of result = FTs - sltu t9, zero, t8 # compute t6:zero - t2:t8 + move t0, ta0 # sign of result = FTs + sltu t9, zero, t8 # compute ta2:zero - t2:t8 subu t8, zero, t8 - subu t2, t6, t2 # subtract fractions + subu t2, ta2, t2 # subtract fractions subu t2, t2, t9 # subtract barrow b norm_s @@ -750,7 +750,7 @@ add_sub_s: */ sub_d: jal get_ft_fs_d - xor t4, t4, 1 # negate sign bit + xor ta0, ta0, 1 # negate sign bit b add_sub_d /* * Double precision add. @@ -759,46 +759,46 @@ add_d: jal get_ft_fs_d add_sub_d: bne t1, DEXP_INF, 1f # is FS an infinity? - bne t5, DEXP_INF, result_fs_d # if FT is not inf, result=FS + bne ta1, DEXP_INF, result_fs_d # if FT is not inf, result=FS bne t2, zero, result_fs_d # if FS is NAN, result is FS bne t3, zero, result_fs_d - bne t6, zero, result_ft_d # if FT is NAN, result is FT - bne t7, zero, result_ft_d - bne t0, t4, invalid_d # both infinities same sign? + bne ta2, zero, result_ft_d # if FT is NAN, result is FT + bne ta3, zero, result_ft_d + bne t0, ta0, invalid_d # both infinities same sign? b result_fs_d # result is in FS 1: - beq t5, DEXP_INF, result_ft_d # if FT is inf, result=FT + beq ta1, DEXP_INF, result_ft_d # if FT is inf, result=FT bne t1, zero, 4f # is FS a denormalized num? bne t2, zero, 1f # is FS zero? beq t3, zero, 3f 1: - bne t5, zero, 2f # is FT a denormalized num? - bne t6, zero, 1f - beq t7, zero, result_fs_d # FT is zero, result=FS + bne ta1, zero, 2f # is FT a denormalized num? + bne ta2, zero, 1f + beq ta3, zero, result_fs_d # FT is zero, result=FS 1: jal renorm_fs_d jal renorm_ft_d b 5f 2: jal renorm_fs_d - subu t5, t5, DEXP_BIAS # unbias FT exponent - or t6, t6, DIMPL_ONE # set implied one bit + subu ta1, ta1, DEXP_BIAS # unbias FT exponent + or ta2, ta2, DIMPL_ONE # set implied one bit b 5f 3: - bne t5, zero, result_ft_d # if FT != 0, result=FT - bne t6, zero, result_ft_d - bne t7, zero, result_ft_d + bne ta1, zero, result_ft_d # if FT != 0, result=FT + bne ta2, zero, result_ft_d + bne ta3, zero, result_ft_d and v0, a1, FPC_ROUNDING_BITS # get rounding mode - bne v0, FPC_ROUND_RM, 1f # round to -infinity? - or t0, t0, t4 # compute result sign + bne v0, FPC_ROUND_RM, 1f # round to -infinity? + or t0, t0, ta0 # compute result sign b result_fs_d 1: - and t0, t0, t4 # compute result sign + and t0, t0, ta0 # compute result sign b result_fs_d 4: - bne t5, zero, 2f # is FT a denormalized num? - bne t6, zero, 1f - beq t7, zero, result_fs_d # FT is zero, result=FS + bne ta1, zero, 2f # is FT a denormalized num? + bne ta2, zero, 1f + beq ta3, zero, result_fs_d # FT is zero, result=FS 1: subu t1, t1, DEXP_BIAS # unbias FS exponent or t2, t2, DIMPL_ONE # set implied one bit @@ -807,15 +807,15 @@ add_sub_d: 2: subu t1, t1, DEXP_BIAS # unbias FS exponent or t2, t2, DIMPL_ONE # set implied one bit - subu t5, t5, DEXP_BIAS # unbias FT exponent - or t6, t6, DIMPL_ONE # set implied one bit + subu ta1, ta1, DEXP_BIAS # unbias FT exponent + or ta2, ta2, DIMPL_ONE # set implied one bit /* * Perform the addition. */ 5: move t8, zero # no shifted bits (sticky reg) - beq t1, t5, 4f # no shift needed - subu v0, t1, t5 # v0 = difference of exponents + beq t1, ta1, 4f # no shift needed + subu v0, t1, ta1 # v0 = difference of exponents move v1, v0 # v1 = abs(difference) bge v0, zero, 1f negu v1 @@ -823,18 +823,18 @@ add_sub_d: ble v1, DFRAC_BITS+2, 2f # is difference too great? li t8, STICKYBIT # set the sticky bit bge v0, zero, 1f # check which exp is larger - move t1, t5 # result exp is FTs + move t1, ta1 # result exp is FTs move t2, zero # FSs fraction shifted is zero move t3, zero b 4f 1: - move t6, zero # FTs fraction shifted is zero - move t7, zero + move ta2, zero # FTs fraction shifted is zero + move ta3, zero b 4f 2: li t9, 32 bge v0, zero, 3f # if FS > FT, shift FTs frac - move t1, t5 # FT > FS, result exp is FTs + move t1, ta1 # FT > FS, result exp is FTs blt v1, t9, 1f # shift right by < 32? subu v1, v1, t9 subu t9, t9, v1 @@ -856,62 +856,62 @@ add_sub_d: blt v1, t9, 1f # shift right by < 32? subu v1, v1, t9 subu t9, t9, v1 - sll t8, t6, t9 # save bits shifted out - srl t7, t6, v1 # shift FTs fraction - move t6, zero + sll t8, ta2, t9 # save bits shifted out + srl ta3, ta2, v1 # shift FTs fraction + move ta2, zero b 4f 1: subu t9, t9, v1 - sll t8, t7, t9 # save bits shifted out - srl t7, t7, v1 # shift FTs fraction - sll t9, t6, t9 # save bits shifted out of t2 - or t7, t7, t9 # and put into t3 - srl t6, t6, v1 + sll t8, ta3, t9 # save bits shifted out + srl ta3, ta3, v1 # shift FTs fraction + sll t9, ta2, t9 # save bits shifted out of t2 + or ta3, ta3, t9 # and put into t3 + srl ta2, ta2, v1 4: - bne t0, t4, 1f # if signs differ, subtract - addu t3, t3, t7 # add fractions - sltu t9, t3, t7 # compute carry - addu t2, t2, t6 # add fractions + bne t0, ta0, 1f # if signs differ, subtract + addu t3, t3, ta3 # add fractions + sltu t9, t3, ta3 # compute carry + addu t2, t2, ta2 # add fractions addu t2, t2, t9 # add carry b norm_d 1: - blt t2, t6, 3f # subtract larger from smaller - bne t2, t6, 2f - bltu t3, t7, 3f - bne t3, t7, 2f # if same, result=0 + blt t2, ta2, 3f # subtract larger from smaller + bne t2, ta2, 2f + bltu t3, ta3, 3f + bne t3, ta3, 2f # if same, result=0 move t1, zero # result=0 move t2, zero move t3, zero and v0, a1, FPC_ROUNDING_BITS # get rounding mode bne v0, FPC_ROUND_RM, 1f # round to -infinity? - or t0, t0, t4 # compute result sign + or t0, t0, ta0 # compute result sign b result_fs_d 1: - and t0, t0, t4 # compute result sign + and t0, t0, ta0 # compute result sign b result_fs_d 2: - beq t8, zero, 1f # compute t2:t3:zero - t6:t7:t8 + beq t8, zero, 1f # compute t2:t3:zero - ta2:ta3:t8 subu t8, zero, t8 sltu v0, t3, 1 # compute barrow out subu t3, t3, 1 # subtract barrow subu t2, t2, v0 1: - sltu v0, t3, t7 - subu t3, t3, t7 # subtract fractions - subu t2, t2, t6 # subtract fractions + sltu v0, t3, ta3 + subu t3, t3, ta3 # subtract fractions + subu t2, t2, ta2 # subtract fractions subu t2, t2, v0 # subtract barrow b norm_d 3: - move t0, t4 # sign of result = FTs - beq t8, zero, 1f # compute t6:t7:zero - t2:t3:t8 + move t0, ta0 # sign of result = FTs + beq t8, zero, 1f # compute ta2:ta3:zero - t2:t3:t8 subu t8, zero, t8 - sltu v0, t7, 1 # compute barrow out - subu t7, t7, 1 # subtract barrow - subu t6, t6, v0 -1: - sltu v0, t7, t3 - subu t3, t7, t3 # subtract fractions - subu t2, t6, t2 # subtract fractions + sltu v0, ta3, 1 # compute barrow out + subu ta3, ta3, 1 # subtract barrow + subu ta2, ta2, v0 +1: + sltu v0, ta3, t3 + subu t3, ta3, t3 # subtract fractions + subu t2, ta2, t2 # subtract fractions subu t2, t2, v0 # subtract barrow b norm_d @@ -920,22 +920,22 @@ add_sub_d: */ mul_s: jal get_ft_fs_s - xor t0, t0, t4 # compute sign of result - move t4, t0 + xor t0, t0, ta0 # compute sign of result + move ta0, t0 bne t1, SEXP_INF, 2f # is FS an infinity? bne t2, zero, result_fs_s # if FS is a NAN, result=FS - bne t5, SEXP_INF, 1f # FS is inf, is FT an infinity? - bne t6, zero, result_ft_s # if FT is a NAN, result=FT + bne ta1, SEXP_INF, 1f # FS is inf, is FT an infinity? + bne ta2, zero, result_ft_s # if FT is a NAN, result=FT b result_fs_s # result is infinity 1: - bne t5, zero, result_fs_s # inf * zero? if no, result=FS - bne t6, zero, result_fs_s + bne ta1, zero, result_fs_s # inf * zero? if no, result=FS + bne ta2, zero, result_fs_s b invalid_s # infinity * zero is invalid 2: - bne t5, SEXP_INF, 1f # FS != inf, is FT an infinity? + bne ta1, SEXP_INF, 1f # FS != inf, is FT an infinity? bne t1, zero, result_ft_s # zero * inf? if no, result=FT bne t2, zero, result_ft_s - bne t6, zero, result_ft_s # if FT is a NAN, result=FT + bne ta2, zero, result_ft_s # if FT is a NAN, result=FT b invalid_s # zero * infinity is invalid 1: bne t1, zero, 1f # is FS zero? @@ -946,17 +946,17 @@ mul_s: subu t1, t1, SEXP_BIAS # unbias FS exponent or t2, t2, SIMPL_ONE # set implied one bit 2: - bne t5, zero, 1f # is FT zero? - beq t6, zero, result_ft_s # result is zero + bne ta1, zero, 1f # is FT zero? + beq ta2, zero, result_ft_s # result is zero jal renorm_ft_s b 2f 1: - subu t5, t5, SEXP_BIAS # unbias FT exponent - or t6, t6, SIMPL_ONE # set implied one bit + subu ta1, ta1, SEXP_BIAS # unbias FT exponent + or ta2, ta2, SIMPL_ONE # set implied one bit 2: - addu t1, t1, t5 # compute result exponent + addu t1, t1, ta1 # compute result exponent addu t1, t1, 9 # account for binary point - multu t2, t6 # multiply fractions + multu t2, ta2 # multiply fractions mflo t8 mfhi t2 b norm_s @@ -966,27 +966,27 @@ mul_s: */ mul_d: jal get_ft_fs_d - xor t0, t0, t4 # compute sign of result - move t4, t0 + xor t0, t0, ta0 # compute sign of result + move ta0, t0 bne t1, DEXP_INF, 2f # is FS an infinity? bne t2, zero, result_fs_d # if FS is a NAN, result=FS bne t3, zero, result_fs_d - bne t5, DEXP_INF, 1f # FS is inf, is FT an infinity? - bne t6, zero, result_ft_d # if FT is a NAN, result=FT - bne t7, zero, result_ft_d + bne ta1, DEXP_INF, 1f # FS is inf, is FT an infinity? + bne ta2, zero, result_ft_d # if FT is a NAN, result=FT + bne ta3, zero, result_ft_d b result_fs_d # result is infinity 1: - bne t5, zero, result_fs_d # inf * zero? if no, result=FS - bne t6, zero, result_fs_d - bne t7, zero, result_fs_d + bne ta1, zero, result_fs_d # inf * zero? if no, result=FS + bne ta2, zero, result_fs_d + bne ta3, zero, result_fs_d b invalid_d # infinity * zero is invalid 2: - bne t5, DEXP_INF, 1f # FS != inf, is FT an infinity? + bne ta1, DEXP_INF, 1f # FS != inf, is FT an infinity? bne t1, zero, result_ft_d # zero * inf? if no, result=FT bne t2, zero, result_ft_d # if FS is a NAN, result=FS bne t3, zero, result_ft_d - bne t6, zero, result_ft_d # if FT is a NAN, result=FT - bne t7, zero, result_ft_d + bne ta2, zero, result_ft_d # if FT is a NAN, result=FT + bne ta3, zero, result_ft_d b invalid_d # zero * infinity is invalid 1: bne t1, zero, 2f # is FS zero? @@ -999,37 +999,37 @@ mul_d: subu t1, t1, DEXP_BIAS # unbias FS exponent or t2, t2, DIMPL_ONE # set implied one bit 3: - bne t5, zero, 2f # is FT zero? - bne t6, zero, 1f - beq t7, zero, result_ft_d # result is zero + bne ta1, zero, 2f # is FT zero? + bne ta2, zero, 1f + beq ta3, zero, result_ft_d # result is zero 1: jal renorm_ft_d b 3f 2: - subu t5, t5, DEXP_BIAS # unbias FT exponent - or t6, t6, DIMPL_ONE # set implied one bit + subu ta1, ta1, DEXP_BIAS # unbias FT exponent + or ta2, ta2, DIMPL_ONE # set implied one bit 3: - addu t1, t1, t5 # compute result exponent + addu t1, t1, ta1 # compute result exponent addu t1, t1, 12 # ??? - multu t3, t7 # multiply fractions (low * low) - move t4, t2 # free up t2,t3 for result - move t5, t3 + multu t3, ta3 # multiply fractions (low * low) + move ta0, t2 # free up t2,t3 for result + move ta1, t3 mflo a3 # save low order bits mfhi t8 not v0, t8 - multu t4, t7 # multiply FS(high) * FT(low) + multu ta0, ta3 # multiply FS(high) * FT(low) mflo v1 mfhi t3 # init low result sltu v0, v0, v1 # compute carry addu t8, v1 - multu t5, t6 # multiply FS(low) * FT(high) + multu ta1, ta2 # multiply FS(low) * FT(high) addu t3, t3, v0 # add carry not v0, t8 mflo v1 mfhi t2 sltu v0, v0, v1 addu t8, v1 - multu t4, t6 # multiply FS(high) * FT(high) + multu ta0, ta2 # multiply FS(high) * FT(high) addu t3, v0 not v1, t3 sltu v1, v1, t2 @@ -1050,24 +1050,24 @@ mul_d: */ div_s: jal get_ft_fs_s - xor t0, t0, t4 # compute sign of result - move t4, t0 + xor t0, t0, ta0 # compute sign of result + move ta0, t0 bne t1, SEXP_INF, 1f # is FS an infinity? bne t2, zero, result_fs_s # if FS is NAN, result is FS - bne t5, SEXP_INF, result_fs_s # is FT an infinity? - bne t6, zero, result_ft_s # if FT is NAN, result is FT + bne ta1, SEXP_INF, result_fs_s # is FT an infinity? + bne ta2, zero, result_ft_s # if FT is NAN, result is FT b invalid_s # infinity/infinity is invalid 1: - bne t5, SEXP_INF, 1f # is FT an infinity? - bne t6, zero, result_ft_s # if FT is NAN, result is FT + bne ta1, SEXP_INF, 1f # is FT an infinity? + bne ta2, zero, result_ft_s # if FT is NAN, result is FT move t1, zero # x / infinity is zero move t2, zero b result_fs_s 1: bne t1, zero, 2f # is FS zero? bne t2, zero, 1f - bne t5, zero, result_fs_s # FS=zero, is FT zero? - beq t6, zero, invalid_s # 0 / 0 + bne ta1, zero, result_fs_s # FS=zero, is FT zero? + beq ta2, zero, invalid_s # 0 / 0 b result_fs_s # result = zero 1: jal renorm_fs_s @@ -1076,8 +1076,8 @@ div_s: subu t1, t1, SEXP_BIAS # unbias FS exponent or t2, t2, SIMPL_ONE # set implied one bit 3: - bne t5, zero, 2f # is FT zero? - bne t6, zero, 1f + bne ta1, zero, 2f # is FT zero? + bne ta2, zero, 1f or a1, a1, FPC_EXCEPTION_DIV0 | FPC_STICKY_DIV0 and v0, a1, FPC_ENABLE_DIV0 # trap enabled? bne v0, zero, fpe_trap @@ -1089,18 +1089,18 @@ div_s: jal renorm_ft_s b 3f 2: - subu t5, t5, SEXP_BIAS # unbias FT exponent - or t6, t6, SIMPL_ONE # set implied one bit + subu ta1, ta1, SEXP_BIAS # unbias FT exponent + or ta2, ta2, SIMPL_ONE # set implied one bit 3: - subu t1, t1, t5 # compute exponent + subu t1, t1, ta1 # compute exponent subu t1, t1, 3 # compensate for result position li v0, SFRAC_BITS+3 # number of bits to divide move t8, t2 # init dividend move t2, zero # init result 1: - bltu t8, t6, 3f # is dividend >= divisor? + bltu t8, ta2, 3f # is dividend >= divisor? 2: - subu t8, t8, t6 # subtract divisor from dividend + subu t8, t8, ta2 # subtract divisor from dividend or t2, t2, 1 # remember that we did bne t8, zero, 3f # if not done, continue sll t2, t2, v0 # shift result to final position @@ -1117,19 +1117,19 @@ div_s: */ div_d: jal get_ft_fs_d - xor t0, t0, t4 # compute sign of result - move t4, t0 + xor t0, t0, ta0 # compute sign of result + move ta0, t0 bne t1, DEXP_INF, 1f # is FS an infinity? bne t2, zero, result_fs_d # if FS is NAN, result is FS bne t3, zero, result_fs_d - bne t5, DEXP_INF, result_fs_d # is FT an infinity? - bne t6, zero, result_ft_d # if FT is NAN, result is FT - bne t7, zero, result_ft_d + bne ta1, DEXP_INF, result_fs_d # is FT an infinity? + bne ta2, zero, result_ft_d # if FT is NAN, result is FT + bne ta3, zero, result_ft_d b invalid_d # infinity/infinity is invalid 1: - bne t5, DEXP_INF, 1f # is FT an infinity? - bne t6, zero, result_ft_d # if FT is NAN, result is FT - bne t7, zero, result_ft_d + bne ta1, DEXP_INF, 1f # is FT an infinity? + bne ta2, zero, result_ft_d # if FT is NAN, result is FT + bne ta3, zero, result_ft_d move t1, zero # x / infinity is zero move t2, zero move t3, zero @@ -1138,9 +1138,9 @@ div_d: bne t1, zero, 2f # is FS zero? bne t2, zero, 1f bne t3, zero, 1f - bne t5, zero, result_fs_d # FS=zero, is FT zero? - bne t6, zero, result_fs_d - beq t7, zero, invalid_d # 0 / 0 + bne ta1, zero, result_fs_d # FS=zero, is FT zero? + bne ta2, zero, result_fs_d + beq ta3, zero, invalid_d # 0 / 0 b result_fs_d # result = zero 1: jal renorm_fs_d @@ -1149,9 +1149,9 @@ div_d: subu t1, t1, DEXP_BIAS # unbias FS exponent or t2, t2, DIMPL_ONE # set implied one bit 3: - bne t5, zero, 2f # is FT zero? - bne t6, zero, 1f - bne t7, zero, 1f + bne ta1, zero, 2f # is FT zero? + bne ta2, zero, 1f + bne ta3, zero, 1f or a1, a1, FPC_EXCEPTION_DIV0 | FPC_STICKY_DIV0 and v0, a1, FPC_ENABLE_DIV0 # trap enabled? bne v0, zero, fpe_trap @@ -1164,10 +1164,10 @@ div_d: jal renorm_ft_d b 3f 2: - subu t5, t5, DEXP_BIAS # unbias FT exponent - or t6, t6, DIMPL_ONE # set implied one bit + subu ta1, ta1, DEXP_BIAS # unbias FT exponent + or ta2, ta2, DIMPL_ONE # set implied one bit 3: - subu t1, t1, t5 # compute exponent + subu t1, t1, ta1 # compute exponent subu t1, t1, 3 # compensate for result position li v0, DFRAC_BITS+3 # number of bits to divide move t8, t2 # init dividend @@ -1175,13 +1175,13 @@ div_d: move t2, zero # init result move t3, zero 1: - bltu t8, t6, 3f # is dividend >= divisor? - bne t8, t6, 2f - bltu t9, t7, 3f -2: - sltu v1, t9, t7 # subtract divisor from dividend - subu t9, t9, t7 - subu t8, t8, t6 + bltu t8, ta2, 3f # is dividend >= divisor? + bne t8, ta2, 2f + bltu t9, ta3, 3f +2: + sltu v1, t9, ta3 # subtract divisor from dividend + subu t9, t9, ta3 + subu t8, t8, ta2 subu t8, t8, v1 or t3, t3, 1 # remember that we did bne t8, zero, 3f # if not done, continue @@ -1576,23 +1576,23 @@ cmp_s: bne t1, SEXP_INF, 1f # is FS an infinity? bne t2, zero, unordered # FS is a NAN 1: - bne t5, SEXP_INF, 2f # is FT an infinity? - bne t6, zero, unordered # FT is a NAN + bne ta1, SEXP_INF, 2f # is FT an infinity? + bne ta2, zero, unordered # FT is a NAN 2: sll t1, t1, 23 # reassemble exp & frac or t1, t1, t2 - sll t5, t5, 23 # reassemble exp & frac - or t5, t5, t6 + sll ta1, ta1, 23 # reassemble exp & frac + or ta1, ta1, ta2 beq t0, zero, 1f # is FS positive? negu t1 1: - beq t4, zero, 1f # is FT positive? - negu t5 + beq ta0, zero, 1f # is FT positive? + negu ta1 1: li v0, COND_LESS - blt t1, t5, test_cond # is FS < FT? + blt t1, ta1, test_cond # is FS < FT? li v0, COND_EQUAL - beq t1, t5, test_cond # is FS == FT? + beq t1, ta1, test_cond # is FS == FT? move v0, zero # FS > FT b test_cond @@ -1605,14 +1605,14 @@ cmp_d: bne t2, zero, unordered bne t3, zero, unordered # FS is a NAN 1: - bne t5, DEXP_INF, 2f # is FT an infinity? - bne t6, zero, unordered - bne t7, zero, unordered # FT is a NAN + bne ta1, DEXP_INF, 2f # is FT an infinity? + bne ta2, zero, unordered + bne ta3, zero, unordered # FT is a NAN 2: sll t1, t1, 20 # reassemble exp & frac or t1, t1, t2 - sll t5, t5, 20 # reassemble exp & frac - or t5, t5, t6 + sll ta1, ta1, 20 # reassemble exp & frac + or ta1, ta1, ta2 beq t0, zero, 1f # is FS positive? not t3 # negate t1,t3 not t1 @@ -1620,21 +1620,21 @@ cmp_d: seq v0, t3, zero # compute carry addu t1, t1, v0 1: - beq t4, zero, 1f # is FT positive? - not t7 # negate t5,t7 - not t5 - addu t7, t7, 1 - seq v0, t7, zero # compute carry - addu t5, t5, v0 + beq ta0, zero, 1f # is FT positive? + not ta3 # negate ta1,ta3 + not ta1 + addu ta3, ta3, 1 + seq v0, ta3, zero # compute carry + addu ta1, ta1, v0 1: li v0, COND_LESS - blt t1, t5, test_cond # is FS(MSW) < FT(MSW)? + blt t1, ta1, test_cond # is FS(MSW) < FT(MSW)? move v0, zero - bne t1, t5, test_cond # is FS(MSW) > FT(MSW)? + bne t1, ta1, test_cond # is FS(MSW) > FT(MSW)? li v0, COND_LESS - bltu t3, t7, test_cond # is FS(LSW) < FT(LSW)? + bltu t3, ta3, test_cond # is FS(LSW) < FT(LSW)? li v0, COND_EQUAL - beq t3, t7, test_cond # is FS(LSW) == FT(LSW)? + beq t3, ta3, test_cond # is FS(LSW) == FT(LSW)? move v0, zero # FS > FT test_cond: and v0, v0, a0 # condition match instruction? @@ -1725,8 +1725,8 @@ norm_s: or t8, t8, v0 srl t2, t2, t9 norm_noshift_s: - move t5, t1 # save unrounded exponent - move t6, t2 # save unrounded fraction + move ta1, t1 # save unrounded exponent + move ta2, t2 # save unrounded fraction and v0, a1, FPC_ROUNDING_BITS # get rounding mode beq v0, FPC_ROUND_RN, 3f # round to nearest beq v0, FPC_ROUND_RZ, 5f # round to zero (truncate) @@ -1826,8 +1826,8 @@ underflow_s: * signal inexact result (if it is) and trap (if enabled). */ 1: - move t1, t5 # get unrounded exponent - move t2, t6 # get unrounded fraction + move t1, ta1 # get unrounded exponent + move t2, ta2 # get unrounded fraction li t9, SEXP_MIN # compute shift amount subu t9, t9, t1 # shift t2,t8 right by t9 blt t9, SFRAC_BITS+2, 3f # shift all the bits out? @@ -1841,7 +1841,7 @@ underflow_s: and v0, a1, FPC_ROUNDING_BITS # get rounding mode beq v0, FPC_ROUND_RN, inexact_nobias_s # round to nearest beq v0, FPC_ROUND_RZ, inexact_nobias_s # round to zero - beq v0, FPC_ROUND_RP, 1f # round to +infinity + beq v0, FPC_ROUND_RP, 1f # round to +infinity beq t0, zero, inexact_nobias_s # if sign is positive, truncate b 2f 1: @@ -1970,9 +1970,9 @@ norm_d: or t3, t3, v0 srl t2, t2, t9 norm_noshift_d: - move t5, t1 # save unrounded exponent - move t6, t2 # save unrounded fraction (MS) - move t7, t3 # save unrounded fraction (LS) + move ta1, t1 # save unrounded exponent + move ta2, t2 # save unrounded fraction (MS) + move ta3, t3 # save unrounded fraction (LS) and v0, a1, FPC_ROUNDING_BITS # get rounding mode beq v0, FPC_ROUND_RN, 3f # round to nearest beq v0, FPC_ROUND_RZ, 5f # round to zero (truncate) @@ -2078,9 +2078,9 @@ underflow_d: * signal inexact result (if it is) and trap (if enabled). */ 1: - move t1, t5 # get unrounded exponent - move t2, t6 # get unrounded fraction (MS) - move t3, t7 # get unrounded fraction (LS) + move t1, ta1 # get unrounded exponent + move t2, ta2 # get unrounded fraction (MS) + move t3, ta3 # get unrounded fraction (LS) li t9, DEXP_MIN # compute shift amount subu t9, t9, t1 # shift t2,t8 right by t9 blt t9, DFRAC_BITS+2, 3f # shift all the bits out? @@ -2095,7 +2095,7 @@ underflow_d: and v0, a1, FPC_ROUNDING_BITS # get rounding mode beq v0, FPC_ROUND_RN, inexact_nobias_d # round to nearest beq v0, FPC_ROUND_RZ, inexact_nobias_d # round to zero - beq v0, FPC_ROUND_RP, 1f # round to +infinity + beq v0, FPC_ROUND_RP, 1f # round to +infinity beq t0, zero, inexact_nobias_d # if sign is positive, truncate b 2f 1: @@ -2128,9 +2128,9 @@ underflow_d: */ 2: and v0, a1, FPC_ROUNDING_BITS # get rounding mode - beq v0, FPC_ROUND_RN, 3f # round to nearest - beq v0, FPC_ROUND_RZ, 5f # round to zero (truncate) - beq v0, FPC_ROUND_RP, 1f # round to +infinity + beq v0, FPC_ROUND_RN, 3f # round to nearest + beq v0, FPC_ROUND_RZ, 5f # round to zero (truncate) + beq v0, FPC_ROUND_RP, 1f # round to +infinity beq t0, zero, 5f # if sign is positive, truncate b 2f 1: @@ -2227,9 +2227,9 @@ ill: break 0 result_ft_s: - move t0, t4 # result is FT - move t1, t5 - move t2, t6 + move t0, ta0 # result is FT + move t1, ta1 + move t2, ta2 result_fs_s: # result is FS jal set_fd_s # save result (in t0,t1,t2) b done @@ -2239,10 +2239,10 @@ result_fs_w: b done result_ft_d: - move t0, t4 # result is FT - move t1, t5 - move t2, t6 - move t3, t7 + move t0, ta0 # result is FT + move t1, ta1 + move t2, ta2 + move t3, ta3 result_fs_d: # result is FS jal set_fd_d # save result (in t0,t1,t2,t3) @@ -2356,9 +2356,9 @@ END(get_fs_int) * t0 contains the FS sign * t1 contains the FS (biased) exponent * t2 contains the FS fraction - * t4 contains the FT sign - * t5 contains the FT (biased) exponent - * t6 contains the FT fraction + * ta0 contains the FT sign + * ta1 contains the FT (biased) exponent + * ta2 contains the FT fraction * *---------------------------------------------------------------------------- */ @@ -2389,59 +2389,59 @@ get_ft_s_tbl: .text get_ft_s_f0: - mfc1 t4, $f0 + mfc1 ta0, $f0 b get_ft_s_done get_ft_s_f2: - mfc1 t4, $f2 + mfc1 ta0, $f2 b get_ft_s_done get_ft_s_f4: - mfc1 t4, $f4 + mfc1 ta0, $f4 b get_ft_s_done get_ft_s_f6: - mfc1 t4, $f6 + mfc1 ta0, $f6 b get_ft_s_done get_ft_s_f8: - mfc1 t4, $f8 + mfc1 ta0, $f8 b get_ft_s_done get_ft_s_f10: - mfc1 t4, $f10 + mfc1 ta0, $f10 b get_ft_s_done get_ft_s_f12: - mfc1 t4, $f12 + mfc1 ta0, $f12 b get_ft_s_done get_ft_s_f14: - mfc1 t4, $f14 + mfc1 ta0, $f14 b get_ft_s_done get_ft_s_f16: - mfc1 t4, $f16 + mfc1 ta0, $f16 b get_ft_s_done get_ft_s_f18: - mfc1 t4, $f18 + mfc1 ta0, $f18 b get_ft_s_done get_ft_s_f20: - mfc1 t4, $f20 + mfc1 ta0, $f20 b get_ft_s_done get_ft_s_f22: - mfc1 t4, $f22 + mfc1 ta0, $f22 b get_ft_s_done get_ft_s_f24: - mfc1 t4, $f24 + mfc1 ta0, $f24 b get_ft_s_done get_ft_s_f26: - mfc1 t4, $f26 + mfc1 ta0, $f26 b get_ft_s_done get_ft_s_f28: - mfc1 t4, $f28 + mfc1 ta0, $f28 b get_ft_s_done get_ft_s_f30: - mfc1 t4, $f30 + mfc1 ta0, $f30 get_ft_s_done: - srl t5, t4, 23 # get exponent - and t5, t5, 0xFF - and t6, t4, 0x7FFFFF # get fraction - srl t4, t4, 31 # get sign - bne t5, SEXP_INF, 1f # is it a signaling NAN? - and v0, t6, SSIGNAL_NAN + srl ta1, ta0, 23 # get exponent + and ta1, ta1, 0xFF + and ta2, ta0, 0x7FFFFF # get fraction + srl ta0, ta0, 31 # get sign + bne ta1, SEXP_INF, 1f # is it a signaling NAN? + and v0, ta2, SSIGNAL_NAN bne v0, zero, invalid_s 1: /* fall through to get FS */ @@ -2557,10 +2557,10 @@ END(get_ft_fs_s) * t1 contains the FS (biased) exponent * t2 contains the FS fraction * t3 contains the FS remaining fraction - * t4 contains the FT sign - * t5 contains the FT (biased) exponent - * t6 contains the FT fraction - * t7 contains the FT remaining fraction + * ta0 contains the FT sign + * ta1 contains the FT (biased) exponent + * ta2 contains the FT fraction + * ta3 contains the FT remaining fraction * *---------------------------------------------------------------------------- */ @@ -2591,75 +2591,75 @@ get_ft_d_tbl: .text get_ft_d_f0: - mfc1 t7, $f0 - mfc1 t4, $f1 + mfc1 ta3, $f0 + mfc1 ta0, $f1 b get_ft_d_done get_ft_d_f2: - mfc1 t7, $f2 - mfc1 t4, $f3 + mfc1 ta3, $f2 + mfc1 ta0, $f3 b get_ft_d_done get_ft_d_f4: - mfc1 t7, $f4 - mfc1 t4, $f5 + mfc1 ta3, $f4 + mfc1 ta0, $f5 b get_ft_d_done get_ft_d_f6: - mfc1 t7, $f6 - mfc1 t4, $f7 + mfc1 ta3, $f6 + mfc1 ta0, $f7 b get_ft_d_done get_ft_d_f8: - mfc1 t7, $f8 - mfc1 t4, $f9 + mfc1 ta3, $f8 + mfc1 ta0, $f9 b get_ft_d_done get_ft_d_f10: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 19:06:15 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66C610656AD; Fri, 10 Jul 2009 19:06:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A58FB8FC22; Fri, 10 Jul 2009 19:06:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AJ6FCh029301; Fri, 10 Jul 2009 19:06:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AJ6F3T029299; Fri, 10 Jul 2009 19:06:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907101906.n6AJ6F3T029299@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 19:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195580 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 19:06:16 -0000 Author: imp Date: Fri Jul 10 19:06:15 2009 New Revision: 195580 URL: http://svn.freebsd.org/changeset/base/195580 Log: Fixed aligned macros... # I'm not sure bde will like this, but I want to commit it for others to review # as well. :) Modified: projects/mips/sys/mips/include/param.h Modified: projects/mips/sys/mips/include/param.h ============================================================================== --- projects/mips/sys/mips/include/param.h Fri Jul 10 19:04:32 2009 (r195579) +++ projects/mips/sys/mips/include/param.h Fri Jul 10 19:06:15 2009 (r195580) @@ -80,11 +80,11 @@ /* * Round p (pointer or byte index) up to a correctly-aligned value for all * data types (int, long, ...). The result is u_int and must be cast to - * any desired pointer type. + * any desired pointer type. XXX u_int isn't big enough to hod a pointer. */ #define _ALIGNBYTES 7 -#define _ALIGN(p) (((u_int)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) -#define ALIGNED_POINTER(p, t) ((((u_int32_t)(p)) & (sizeof (t) - 1)) == 0) +#define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) +#define ALIGNED_POINTER(p, t) ((((uintptr_t)(p)) & (sizeof (t) - 1)) == 0) #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 19:06:49 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 306C11065807; Fri, 10 Jul 2009 19:06:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B2A8FC28; Fri, 10 Jul 2009 19:06:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AJ6hlu029344; Fri, 10 Jul 2009 19:06:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AJ6hdP029342; Fri, 10 Jul 2009 19:06:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907101906.n6AJ6hdP029342@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 19:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195581 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 19:07:21 -0000 Author: imp Date: Fri Jul 10 19:06:43 2009 New Revision: 195581 URL: http://svn.freebsd.org/changeset/base/195581 Log: Better definitions for a few types for n32/n64. Modified: projects/mips/sys/mips/include/_types.h Modified: projects/mips/sys/mips/include/_types.h ============================================================================== --- projects/mips/sys/mips/include/_types.h Fri Jul 10 19:06:15 2009 (r195580) +++ projects/mips/sys/mips/include/_types.h Fri Jul 10 19:06:43 2009 (r195581) @@ -102,7 +102,7 @@ typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; -#if defined(__mips_n64) || defined(ISA_MIPS64) +#if defined(__mips_n64) || defined(__mips_n32) typedef __int64_t __register_t; typedef __int64_t f_register_t; #else @@ -134,13 +134,16 @@ typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; -#if defined(__mips_n64) || defined(ISA_MIPS64) +#if defined(__mips_n64) || defined(__mips_n32) typedef __uint64_t __u_register_t; +#else +typedef __uint32_t __u_register_t; +#endif +#if defined(__mips_n64) typedef __uint64_t __vm_offset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_size_t; #else -typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; typedef __uint32_t __vm_paddr_t; typedef __uint32_t __vm_size_t; From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 19:07:21 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0667106575B; Fri, 10 Jul 2009 19:07:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A785B8FC0A; Fri, 10 Jul 2009 19:07:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AJ77FF029390; Fri, 10 Jul 2009 19:07:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AJ77kF029388; Fri, 10 Jul 2009 19:07:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907101907.n6AJ77kF029388@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 19:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195582 - projects/mips/sys/mips/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 19:07:32 -0000 Author: imp Date: Fri Jul 10 19:07:07 2009 New Revision: 195582 URL: http://svn.freebsd.org/changeset/base/195582 Log: fix prototype for MipsEmulateBranch. Modified: projects/mips/sys/mips/include/md_var.h Modified: projects/mips/sys/mips/include/md_var.h ============================================================================== --- projects/mips/sys/mips/include/md_var.h Fri Jul 10 19:06:43 2009 (r195581) +++ projects/mips/sys/mips/include/md_var.h Fri Jul 10 19:07:07 2009 (r195582) @@ -48,7 +48,7 @@ extern vm_offset_t kstack0; void MipsSaveCurFPState(struct thread *); void fork_trampoline(void); void cpu_swapin(struct proc *); -u_int MipsEmulateBranch(struct trapframe *, int, int, u_int); +uintptr_t MipsEmulateBranch(struct trapframe *, uintptr_t, int, uintptr_t); u_long kvtop(void *addr); int is_physical_memory(vm_offset_t addr); int is_cacheable_mem(vm_offset_t pa); From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 19:08:48 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905111065695; Fri, 10 Jul 2009 19:08:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4AF8FC0A; Fri, 10 Jul 2009 19:08:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AJ8mfD029454; Fri, 10 Jul 2009 19:08:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AJ8mXk029452; Fri, 10 Jul 2009 19:08:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907101908.n6AJ8mXk029452@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 19:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195583 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 19:08:49 -0000 Author: imp Date: Fri Jul 10 19:08:48 2009 New Revision: 195583 URL: http://svn.freebsd.org/changeset/base/195583 Log: Use PTR_* macros to deal with pointers. Modified: projects/mips/sys/mips/mips/exception.S Modified: projects/mips/sys/mips/mips/exception.S ============================================================================== --- projects/mips/sys/mips/mips/exception.S Fri Jul 10 19:07:07 2009 (r195582) +++ projects/mips/sys/mips/mips/exception.S Fri Jul 10 19:08:48 2009 (r195583) @@ -139,12 +139,14 @@ VECTOR_END(MipsTLBMiss) *---------------------------------------------------------------------------- */ MipsDoTLBMiss: +#xxx mips64 unsafe? #ifndef SMP lui k1, %hi(_C_LABEL(pcpup)) #endif #k0 already has BadVA bltz k0, 1f #02: k0<0 -> 1f (kernel fault) srl k0, k0, SEGSHIFT - 2 #03: k0=seg offset (almost) +#xxx mips64 unsafe? #ifdef SMP GET_CPU_PCPU(k1) #else @@ -153,6 +155,7 @@ MipsDoTLBMiss: lw k1, PC_SEGBASE(k1) beqz k1, 2f #05: make sure segbase is not null andi k0, k0, 0x7fc #06: k0=seg offset (mask 0x3) +#xxx mips64 unsafe? addu k1, k0, k1 #07: k1=seg entry address lw k1, 0(k1) #08: k1=seg entry mfc0 k0, COP_0_BAD_VADDR #09: k0=bad address (again) @@ -160,6 +163,7 @@ MipsDoTLBMiss: srl k0, PGSHIFT - 2 #0b: k0=VPN (aka va>>10) andi k0, k0, ((NPTEPG/2) - 1) << 3 #0c: k0=page tab offset +#xxx mips64 unsafe? addu k1, k1, k0 #0d: k1=pte address lw k0, 0(k1) #0e: k0=lo0 pte lw k1, 4(k1) #0f: k1=lo1 pte @@ -199,8 +203,8 @@ VECTOR(MipsException, unknown) and k1, k1, CR_EXC_CODE # Mask out the cause bits. or k1, k1, k0 # change index to user table 1: - la k0, _C_LABEL(machExceptionTable) # get base of the jump table - addu k0, k0, k1 # Get the address of the + PTR_LA k0, _C_LABEL(machExceptionTable) # get base of the jump table + PTR_ADDU k0, k0, k1 # Get the address of the # function entry. Note that # the cause is already # shifted left by 2 bits so @@ -315,10 +319,10 @@ SlowFault: SAVE_REG(ra, RA, sp) ;\ SAVE_REG(a2, BADVADDR, sp) ;\ SAVE_REG(a3, PC, sp) ;\ - addu v0, sp, KERN_EXC_FRAME_SIZE ;\ + PTR_ADDU v0, sp, KERN_EXC_FRAME_SIZE ;\ SAVE_REG(v0, SP, sp) ;\ CLEAR_STATUS ;\ - addu a0, sp, STAND_ARG_SIZE ;\ + PTR_ADDU a0, sp, STAND_ARG_SIZE ;\ ITLBNOPFIX #define RESTORE_REG(reg, offs, base) \ @@ -361,7 +365,7 @@ SlowFault: RESTORE_REG(s8, S8, sp) ;\ RESTORE_REG(gp, GP, sp) ;\ RESTORE_REG(ra, RA, sp) ;\ - addu sp, sp, KERN_EXC_FRAME_SIZE;\ + PTR_ADDU sp, sp, KERN_EXC_FRAME_SIZE;\ mtc0 k0, COP_0_STATUS_REG @@ -384,8 +388,8 @@ NNON_LEAF(MipsKernGenException, KERN_EXC /* * Call the exception handler. a0 points at the saved frame. */ - la gp, _C_LABEL(_gp) - la k0, _C_LABEL(trap) + PTR_LA gp, _C_LABEL(_gp) + PTR_LA k0, _C_LABEL(trap) jalr k0 sw a3, STAND_RA_OFFSET + KERN_REG_SIZE(sp) # for debugging @@ -481,20 +485,20 @@ NNON_LEAF(MipsUserGenException, STAND_FR SAVE_U_PCB_REG(a2, BADVADDR, k1) SAVE_U_PCB_REG(a3, PC, k1) sw a3, STAND_RA_OFFSET(sp) # for debugging - la gp, _C_LABEL(_gp) # switch to kernel GP + PTR_LA gp, _C_LABEL(_gp) # switch to kernel GP # Turn off fpu and enter kernel mode and t0, a0, ~(SR_COP_1_BIT | SR_EXL | SR_KSU_MASK | SR_INT_ENAB) #ifdef TARGET_OCTEON or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) #endif mtc0 t0, COP_0_STATUS_REG - addu a0, k1, U_PCB_REGS + PTR_ADDU a0, k1, U_PCB_REGS ITLBNOPFIX /* * Call the exception handler. */ - la k0, _C_LABEL(trap) + PTR_LA k0, _C_LABEL(trap) jalr k0 nop @@ -615,9 +619,9 @@ NNON_LEAF(MipsKernIntr, KERN_EXC_FRAME_S /* * Call the interrupt handler. */ - la gp, _C_LABEL(_gp) - addu a0, sp, STAND_ARG_SIZE - la k0, _C_LABEL(cpu_intr) + PTR_LA gp, _C_LABEL(_gp) + PTR_ADDU a0, sp, STAND_ARG_SIZE + PTR_LA k0, _C_LABEL(cpu_intr) jalr k0 sw a3, STAND_RA_OFFSET + KERN_REG_SIZE(sp) /* Why no AST processing here? */ @@ -717,7 +721,7 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE SAVE_U_PCB_REG(a1, CAUSE, k1) SAVE_U_PCB_REG(a3, PC, k1) # PC in a3, note used later! subu sp, k1, STAND_FRAME_SIZE # switch to kernel SP - la gp, _C_LABEL(_gp) # switch to kernel GP + PTR_LA gp, _C_LABEL(_gp) # switch to kernel GP # Turn off fpu, disable interrupts, set kernel mode kernel mode, clear exception level. and t0, a0, ~(SR_COP_1_BIT | SR_EXL | SR_INT_ENAB | SR_KSU_MASK) @@ -726,11 +730,11 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE #endif mtc0 t0, COP_0_STATUS_REG ITLBNOPFIX - addu a0, k1, U_PCB_REGS + PTR_ADDU a0, k1, U_PCB_REGS /* * Call the interrupt handler. */ - la k0, _C_LABEL(cpu_intr) + PTR_LA k0, _C_LABEL(cpu_intr) jalr k0 sw a3, STAND_RA_OFFSET(sp) # for debugging @@ -879,6 +883,7 @@ NLEAF(MipsKernTLBInvalidException) 2: srl k0, 20 # k0=seg offset (almost) andi k0, k0, 0xffc # k0=seg offset (mask 0x3) +#xxx mips64 unsafe? addu k1, k0, k1 # k1=seg entry address lw k1, 0(k1) # k1=seg entry mfc0 k0, COP_0_BAD_VADDR # k0=bad address (again) @@ -886,6 +891,7 @@ NLEAF(MipsKernTLBInvalidException) srl k0, k0, PGSHIFT-2 andi k0, k0, 0xffc # compute offset from index tlbp # Probe the invalid entry +#xxx mips64 unsafe? addu k1, k1, k0 and k0, k0, 4 # check even/odd page nop # required for QED 5230 @@ -951,6 +957,7 @@ NLEAF(MipsUserTLBInvalidException) sltu k1, k0, k1 beqz k1, _C_LABEL(MipsUserGenException) nop +#xxx mips64 unsafe? #ifdef SMP GET_CPU_PCPU(k1) #else @@ -963,6 +970,7 @@ NLEAF(MipsUserTLBInvalidException) 2: srl k0, 20 # k0=seg offset (almost) andi k0, k0, 0xffc # k0=seg offset (mask 0x3) +#xxx mips64 unsafe? addu k1, k0, k1 # k1=seg entry address lw k1, 0(k1) # k1=seg entry mfc0 k0, COP_0_BAD_VADDR # k0=bad address (again) @@ -970,6 +978,7 @@ NLEAF(MipsUserTLBInvalidException) srl k0, k0, PGSHIFT-2 andi k0, k0, 0xffc # compute offset from index tlbp # Probe the invalid entry +#xxx mips64 unsafe? addu k1, k1, k0 and k0, k0, 4 # check even/odd page nop # required for QED 5230 @@ -1053,12 +1062,14 @@ NLEAF(MipsTLBMissException) lw k1, %lo(_C_LABEL(kernel_segmap))(k1) # k1=segment tab base beq k1, zero, _C_LABEL(MipsKernGenException) # ==0 -- no seg tab andi k0, k0, 0xffc # k0=seg offset (mask 0x3) +#xxx mips64 unsafe addu k1, k0, k1 # k1=seg entry address lw k1, 0(k1) # k1=seg entry mfc0 k0, COP_0_BAD_VADDR # k0=bad address (again) beq k1, zero, _C_LABEL(MipsKernGenException) # ==0 -- no page table srl k0, 10 # k0=VPN (aka va>>10) andi k0, k0, 0xff8 # k0=page tab offset +#xxx mips64 unsafe addu k1, k1, k0 # k1=pte address lw k0, 0(k1) # k0=lo0 pte lw k1, 4(k1) # k1=lo1 pte @@ -1083,31 +1094,31 @@ sys_stk_chk: nop # stack overflow - la a0, _C_LABEL(_start) - START_FRAME - 8 # set sp to a valid place + PTR_LA a0, _C_LABEL(_start) - START_FRAME - 8 # set sp to a valid place sw sp, 24(a0) move sp, a0 - la a0, 1f + PTR_LA a0, 1f mfc0 a2, COP_0_STATUS_REG mfc0 a3, COP_0_CAUSE_REG _MFC0 a1, COP_0_EXC_PC sw a2, 16(sp) sw a3, 20(sp) move a2, ra - la k0, _C_LABEL(printf) + PTR_LA k0, _C_LABEL(printf) jalr k0 mfc0 a3, COP_0_BAD_VADDR - la sp, _C_LABEL(_start) - START_FRAME # set sp to a valid place + PTR_LA sp, _C_LABEL(_start) - START_FRAME # set sp to a valid place #if !defined(SMP) && defined(DDB) - la a0, 2f - la k0, _C_LABEL(trapDump) + PTR_LA a0, 2f + PTR_LA k0, _C_LABEL(trapDump) jalr k0 nop li a0, 0 lw a1, _C_LABEL(num_tlbentries) - la k0, _C_LABEL(db_dump_tlb) + PTR_LA k0, _C_LABEL(db_dump_tlb) jalr k0 addu a1, -1 @@ -1184,11 +1195,12 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r */ sw a2, STAND_FRAME_SIZE + 8(sp) GET_CPU_PCPU(a0) +#mips64 unsafe? lw a0, PC_CURPCB(a0) - addu a0, a0, U_PCB_REGS # first arg is ptr to CPU registers + PTR_ADDU a0, a0, U_PCB_REGS # first arg is ptr to CPU registers move a1, a2 # second arg is instruction PC move a2, t1 # third arg is floating point CSR - la t3, _C_LABEL(MipsEmulateBranch) # compute PC after branch + PTR_LA t3, _C_LABEL(MipsEmulateBranch) # compute PC after branch jalr t3 # compute PC after branch move a3, zero # fourth arg is FALSE /* @@ -1204,6 +1216,7 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r */ 1: lw a0, 0(a2) # a0 = coproc instruction +#xxx mips64 unsafe? addu v0, a2, 4 # v0 = next pc 2: GET_CPU_PCPU(t2) @@ -1224,7 +1237,7 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r lw a0, PC_CURTHREAD(a0) # get current thread cfc1 a2, FPC_CSR # code = FP execptions ctc1 zero, FPC_CSR # Clear exceptions - la t3, _C_LABEL(trapsignal) + PTR_LA t3, _C_LABEL(trapsignal) jalr t3 li a1, SIGFPE b FPReturn @@ -1234,7 +1247,7 @@ NON_LEAF(MipsFPTrap, STAND_FRAME_SIZE, r * Finally, we can call MipsEmulateFP() where a0 is the instruction to emulate. */ 4: - la t3, _C_LABEL(MipsEmulateFP) + PTR_LA t3, _C_LABEL(MipsEmulateFP) jalr t3 nop @@ -1248,26 +1261,9 @@ FPReturn: mtc0 t0, COP_0_STATUS_REG ITLBNOPFIX j ra - addu sp, sp, STAND_FRAME_SIZE + PTR_ADDU sp, sp, STAND_FRAME_SIZE END(MipsFPTrap) - -#if 0 -/* - * Atomic ipending update - */ -LEAF(set_sint) - la v1, ipending -1: - ll v0, 0(v1) - or v0, a0 - sc v0, 0(v1) - beqz v0, 1b - j ra - nop -END(set_sint) -#endif - /* * Interrupt counters for vmstat. */ @@ -1294,7 +1290,7 @@ eintrcnt: */ .text VECTOR(MipsCache, unknown) - la k0, _C_LABEL(MipsCacheException) + PTR_LA k0, _C_LABEL(MipsCacheException) li k1, MIPS_PHYS_MASK and k0, k1 li k1, MIPS_UNCACHED_MEMORY_ADDR @@ -1313,8 +1309,8 @@ VECTOR_END(MipsCache) NESTED_NOPROFILE(MipsCacheException, KERN_EXC_FRAME_SIZE, ra) .set noat .mask 0x80000000, -4 - la k0, _C_LABEL(panic) # return to panic - la a0, 9f # panicstr + PTR_LA k0, _C_LABEL(panic) # return to panic + PTR_LA a0, 9f # panicstr _MFC0 a1, COP_0_ERROR_PC mfc0 a2, COP_0_CACHE_ERR # 3rd arg cache error From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 19:09:35 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44EA3106564A; Fri, 10 Jul 2009 19:09:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 198DE8FC13; Fri, 10 Jul 2009 19:09:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6AJ9YUa029505; Fri, 10 Jul 2009 19:09:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6AJ9YYM029503; Fri, 10 Jul 2009 19:09:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200907101909.n6AJ9YYM029503@svn.freebsd.org> From: Warner Losh Date: Fri, 10 Jul 2009 19:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195584 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 19:09:35 -0000 Author: imp Date: Fri Jul 10 19:09:34 2009 New Revision: 195584 URL: http://svn.freebsd.org/changeset/base/195584 Log: Use PTR_* macros for pointers, and not potentially mips64 unsafe operations. Modified: projects/mips/sys/mips/mips/copystr.S Modified: projects/mips/sys/mips/mips/copystr.S ============================================================================== --- projects/mips/sys/mips/mips/copystr.S Fri Jul 10 19:08:48 2009 (r195583) +++ projects/mips/sys/mips/mips/copystr.S Fri Jul 10 19:09:34 2009 (r195584) @@ -67,13 +67,13 @@ ENTRY(copystr) move v0, zero beqz a2, 2f move t1, zero -1: subu a2, 1 +1: subu a2, 1 /*XXX mips64 unsafe -- long */ lbu t0, 0(a0) - addu a0, 1 + PTR_ADDU a0, 1 sb t0, 0(a1) - addu a1, 1 + PTR_ADDU a1, 1 beqz t0, 3f /* NULL - end of string*/ - addu t1, 1 + addu t1, 1 /*XXX mips64 unsafe -- long */ bnez a2, 1b nop 2: /* ENAMETOOLONG */ @@ -81,7 +81,7 @@ ENTRY(copystr) 3: /* done != NULL -> how many bytes were copied */ beqz a3, 4f nop - sw t1, 0(a3) + sw t1, 0(a3) /*XXX mips64 unsafe -- long */ 4: jr ra nop .set reorder @@ -100,25 +100,25 @@ LEAF(copyinstr) .set noat lw t2, pcpup lw v1, PC_CURPCB(t2) - la v0, _C_LABEL(copystrerr) + PTR_LA v0, _C_LABEL(copystrerr) blt a0, zero, _C_LABEL(copystrerr) sw v0, PCB_ONFAULT(v1) move t0, a2 beq a2, zero, 4f 1: lbu v0, 0(a0) - subu a2, a2, 1 + subu a2, a2, 1 /*xxx mips64 unsafe -- long */ beq v0, zero, 2f sb v0, 0(a1) - addu a0, a0, 1 + PTR_ADDU a0, a0, 1 bne a2, zero, 1b - addu a1, a1, 1 + PTR_ADDU a1, a1, 1 4: li v0, ENAMETOOLONG 2: beq a3, zero, 3f - subu a2, t0, a2 - sw a2, 0(a3) + subu a2, t0, a2 /*xxx mips64 unsafe -- long */ + sw a2, 0(a3) /*xxx mips64 unsafe -- long */ 3: j ra # v0 is 0 or ENAMETOOLONG sw zero, PCB_ONFAULT(v1) @@ -138,25 +138,25 @@ LEAF(copyoutstr) .set noat lw t2, pcpup lw v1, PC_CURPCB(t2) - la v0, _C_LABEL(copystrerr) + PTR_LA v0, _C_LABEL(copystrerr) blt a1, zero, _C_LABEL(copystrerr) sw v0, PCB_ONFAULT(v1) move t0, a2 beq a2, zero, 4f 1: lbu v0, 0(a0) - subu a2, a2, 1 + subu a2, a2, 1 /*xxx mips64 unsafe -- long */ beq v0, zero, 2f sb v0, 0(a1) - addu a0, a0, 1 + PTR_ADDU a0, a0, 1 bne a2, zero, 1b - addu a1, a1, 1 + PTR_ADDU a1, a1, 1 4: li v0, ENAMETOOLONG 2: beq a3, zero, 3f - subu a2, t0, a2 - sw a2, 0(a3) + subu a2, t0, a2 /*xxx mips64 unsafe -- long */ + sw a2, 0(a3) /*xxx mips64 unsafe -- long */ 3: j ra # v0 is 0 or ENAMETOOLONG sw zero, PCB_ONFAULT(v1) From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 21:28:40 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4943B106564A; Fri, 10 Jul 2009 21:28:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 381108FC0A; Fri, 10 Jul 2009 21:28:40 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ALSe02032605; Fri, 10 Jul 2009 21:28:40 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ALSeNr032603; Fri, 10 Jul 2009 21:28:40 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907102128.n6ALSeNr032603@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 21:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195589 - projects/mesh11s/tools/tools/net80211/wlanstats X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 21:28:40 -0000 Author: sam Date: Fri Jul 10 21:28:39 2009 New Revision: 195589 URL: http://svn.freebsd.org/changeset/base/195589 Log: mesh+hwmp status Modified: projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c Modified: projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c ============================================================================== --- projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c Fri Jul 10 21:17:27 2009 (r195588) +++ projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c Fri Jul 10 21:28:39 2009 (r195589) @@ -322,7 +322,27 @@ static const struct fmt wlanstats[] = { { 4, "ht_downgrade", "ht_downgrade", "HT station downgraded to legacy operation" }, #define S_HT_ASSOC_NORATE AFTER(S_HT_ASSOC_DOWNGRADE) { 4, "ht_norate", "ht_norate", "HT station rejected because of HT rate set" }, -#define S_INPUT AFTER(S_HT_ASSOC_NORATE) +#define S_MESH_WRONGMESH AFTER(S_HT_ASSOC_NORATE) + { 4, "mesh_wrong", "mesh_wrong", "frame discarded because sender not a mesh sta" }, +#define S_MESH_NOLINK AFTER(S_MESH_WRONGMESH) + { 4, "mesh_nolink", "mesh_nolink", "frame discarded because link not established" }, +#define S_MESH_FWD_TTL AFTER(S_MESH_NOLINK) + { 4, "mesh_fwd_ttl", "mesh_fwd_ttl", "frame not forwarded because TTL zero" }, +#define S_MESH_FWD_NOBUF AFTER(S_MESH_FWD_TTL) + { 4, "mesh_fwd_nobuf", "mesh_fwd_nobuf", "frame not forwarded because mbuf could not be allocated" }, +#define S_MESH_FWD_TOOSHORT AFTER(S_MESH_FWD_NOBUF) + { 4, "mesh_fwd_tooshort", "mesh_fwd_tooshort", "frame not forwarded because too short to have 802.11 header" }, +#define S_MESH_FWD_DISABLED AFTER(S_MESH_FWD_TOOSHORT) + { 4, "mesh_fwd_disabled", "mesh_fwd_disabled", "frame not forwarded because administratively disabled" }, +#define S_MESH_FWD_NOPATH AFTER(S_MESH_FWD_DISABLED) + { 4, "mesh_fwd_nopath", "mesh_fwd_nopath", "frame not forwarded because no path found to destination" }, +#define S_HWMP_WRONGSEQ AFTER(S_MESH_FWD_NOPATH) + { 4, "hwmp_wrongseq", "hwmp_wrongseq", "frame discarded because of mesh sequence number is invalid (e.g. duplicate)" }, +#define S_HWMP_ROOTREQS AFTER(S_HWMP_WRONGSEQ) + { 4, "hwmp_rootreqs", "hwmp_rootreqs", "root PREQ frames sent" }, +#define S_HWMP_ROOTANN AFTER(S_HWMP_ROOTREQS) + { 4, "hwmp_rootann", "hwmp_rootann", "root RANN frames received" }, +#define S_INPUT AFTER(S_HWMP_ROOTANN) { 8, "input", "input", "total data frames received" }, #define S_RX_UCAST AFTER(S_INPUT) { 8, "rx_ucast", "rx_ucast", "unicast data frames received" }, @@ -766,6 +786,16 @@ wlan_get_curstat(struct statfoo *sf, int case S_HT_ASSOC_NOHTCAP:STAT(ht_assoc_nohtcap); case S_HT_ASSOC_DOWNGRADE:STAT(ht_assoc_downgrade); case S_HT_ASSOC_NORATE: STAT(ht_assoc_norate); + case S_MESH_WRONGMESH: STAT(mesh_wrongmesh); + case S_MESH_NOLINK: STAT(mesh_nolink); + case S_MESH_FWD_TTL: STAT(mesh_fwd_ttl); + case S_MESH_FWD_NOBUF: STAT(mesh_fwd_nobuf); + case S_MESH_FWD_TOOSHORT: STAT(mesh_fwd_tooshort); + case S_MESH_FWD_DISABLED: STAT(mesh_fwd_disabled); + case S_MESH_FWD_NOPATH: STAT(mesh_fwd_nopath); + case S_HWMP_WRONGSEQ: STAT(hwmp_wrongseq); + case S_HWMP_ROOTREQS: STAT(hwmp_rootreqs); + case S_HWMP_ROOTANN: STAT(hwmp_rootrann); case S_INPUT: NSTAT(rx_data); case S_OUTPUT: NSTAT(tx_data); case S_RX_UCAST: NSTAT(rx_ucast); @@ -910,6 +940,16 @@ wlan_get_totstat(struct statfoo *sf, int case S_HT_ASSOC_NOHTCAP:STAT(ht_assoc_nohtcap); case S_HT_ASSOC_DOWNGRADE:STAT(ht_assoc_downgrade); case S_HT_ASSOC_NORATE: STAT(ht_assoc_norate); + case S_MESH_WRONGMESH: STAT(mesh_wrongmesh); + case S_MESH_NOLINK: STAT(mesh_nolink); + case S_MESH_FWD_TTL: STAT(mesh_fwd_ttl); + case S_MESH_FWD_NOBUF: STAT(mesh_fwd_nobuf); + case S_MESH_FWD_TOOSHORT: STAT(mesh_fwd_tooshort); + case S_MESH_FWD_DISABLED: STAT(mesh_fwd_disabled); + case S_MESH_FWD_NOPATH: STAT(mesh_fwd_nopath); + case S_HWMP_WRONGSEQ: STAT(hwmp_wrongseq); + case S_HWMP_ROOTREQS: STAT(hwmp_rootreqs); + case S_HWMP_ROOTANN: STAT(hwmp_rootrann); case S_INPUT: NSTAT(rx_data); case S_OUTPUT: NSTAT(tx_data); case S_RX_UCAST: NSTAT(rx_ucast); From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 21:42:06 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDC1B1065670; Fri, 10 Jul 2009 21:42:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD2B78FC08; Fri, 10 Jul 2009 21:42:06 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ALg6UW033008; Fri, 10 Jul 2009 21:42:06 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ALg6Bc033006; Fri, 10 Jul 2009 21:42:06 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907102142.n6ALg6Bc033006@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 21:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195592 - projects/mesh11s/tools/tools/nanobsd X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 21:42:07 -0000 Author: sam Date: Fri Jul 10 21:42:06 2009 New Revision: 195592 URL: http://svn.freebsd.org/changeset/base/195592 Log: undo pollution Modified: projects/mesh11s/tools/tools/nanobsd/nanobsd.sh Modified: projects/mesh11s/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- projects/mesh11s/tools/tools/nanobsd/nanobsd.sh Fri Jul 10 21:38:05 2009 (r195591) +++ projects/mesh11s/tools/tools/nanobsd/nanobsd.sh Fri Jul 10 21:42:06 2009 (r195592) @@ -40,7 +40,7 @@ set -e NANO_NAME=full # Source tree directory -NANO_SRC=/home/rpaulo/freebsd/mesh11s +NANO_SRC=/usr/src # Where nanobsd additional files live under the source tree NANO_TOOLS=tools/tools/nanobsd @@ -51,7 +51,7 @@ NANO_PACKAGE_LIST="*" # Object tree directory # default is subdir of /usr/obj -NANO_OBJ="/home/rpaulo/freebsd/obj" +#NANO_OBJ="" # The directory to put the final images # default is ${NANO_OBJ} From owner-svn-src-projects@FreeBSD.ORG Fri Jul 10 21:42:24 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523E81065700; Fri, 10 Jul 2009 21:42:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41B858FC15; Fri, 10 Jul 2009 21:42:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6ALgO5V033051; Fri, 10 Jul 2009 21:42:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ALgOej033048; Fri, 10 Jul 2009 21:42:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907102142.n6ALgOej033048@svn.freebsd.org> From: Sam Leffler Date: Fri, 10 Jul 2009 21:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195593 - projects/mesh11s/tools/tools/nanobsd/gateworks X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2009 21:42:24 -0000 Author: sam Date: Fri Jul 10 21:42:23 2009 New Revision: 195593 URL: http://svn.freebsd.org/changeset/base/195593 Log: enable mesh support Modified: projects/mesh11s/tools/tools/nanobsd/gateworks/G2348 projects/mesh11s/tools/tools/nanobsd/gateworks/G2358 Modified: projects/mesh11s/tools/tools/nanobsd/gateworks/G2348 ============================================================================== --- projects/mesh11s/tools/tools/nanobsd/gateworks/G2348 Fri Jul 10 21:42:06 2009 (r195592) +++ projects/mesh11s/tools/tools/nanobsd/gateworks/G2348 Fri Jul 10 21:42:23 2009 (r195593) @@ -93,6 +93,7 @@ device random # Entrop device wlan # 802.11 support options IEEE80211_DEBUG # enable debugging msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +options IEEE80211_SUPPORT_MESH options IEEE80211_SUPPORT_TDMA device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: projects/mesh11s/tools/tools/nanobsd/gateworks/G2358 ============================================================================== --- projects/mesh11s/tools/tools/nanobsd/gateworks/G2358 Fri Jul 10 21:42:06 2009 (r195592) +++ projects/mesh11s/tools/tools/nanobsd/gateworks/G2358 Fri Jul 10 21:42:23 2009 (r195593) @@ -94,6 +94,7 @@ device random # Entrop device wlan # 802.11 support options IEEE80211_DEBUG # enable debugging msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +options IEEE80211_SUPPORT_MESH options IEEE80211_SUPPORT_TDMA device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support From owner-svn-src-projects@FreeBSD.ORG Sat Jul 11 00:32:26 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65404106564A; Sat, 11 Jul 2009 00:32:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53EAB8FC16; Sat, 11 Jul 2009 00:32:26 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6B0WQ0k036978; Sat, 11 Jul 2009 00:32:26 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6B0WQ8o036976; Sat, 11 Jul 2009 00:32:26 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907110032.n6B0WQ8o036976@svn.freebsd.org> From: Sam Leffler Date: Sat, 11 Jul 2009 00:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195601 - projects/mesh11s/tools/tools/nanobsd/gateworks/cfg/ssh X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2009 00:32:26 -0000 Author: sam Date: Sat Jul 11 00:32:26 2009 New Revision: 195601 URL: http://svn.freebsd.org/changeset/base/195601 Log: enable root login w/o passwd (only on this branch) Modified: projects/mesh11s/tools/tools/nanobsd/gateworks/cfg/ssh/sshd_config Modified: projects/mesh11s/tools/tools/nanobsd/gateworks/cfg/ssh/sshd_config ============================================================================== --- projects/mesh11s/tools/tools/nanobsd/gateworks/cfg/ssh/sshd_config Fri Jul 10 23:52:56 2009 (r195600) +++ projects/mesh11s/tools/tools/nanobsd/gateworks/cfg/ssh/sshd_config Sat Jul 11 00:32:26 2009 (r195601) @@ -90,7 +90,7 @@ ChallengeResponseAuthentication no # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. -#UsePAM yes +UsePAM no #AllowAgentForwarding yes #AllowTcpForwarding yes From owner-svn-src-projects@FreeBSD.ORG Sat Jul 11 05:47:03 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8823106564A; Sat, 11 Jul 2009 05:47:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1E7D8FC08; Sat, 11 Jul 2009 05:47:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6B5l3fN043514; Sat, 11 Jul 2009 05:47:03 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6B5l3Bt043512; Sat, 11 Jul 2009 05:47:03 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907110547.n6B5l3Bt043512@svn.freebsd.org> From: Sam Leffler Date: Sat, 11 Jul 2009 05:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195610 - projects/mesh11s/tools/tools/net80211/wlanstats X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2009 05:47:04 -0000 Author: sam Date: Sat Jul 11 05:47:03 2009 New Revision: 195610 URL: http://svn.freebsd.org/changeset/base/195610 Log: shorten description Modified: projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c Modified: projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c ============================================================================== --- projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c Sat Jul 11 05:35:08 2009 (r195609) +++ projects/mesh11s/tools/tools/net80211/wlanstats/wlanstats.c Sat Jul 11 05:47:03 2009 (r195610) @@ -337,7 +337,7 @@ static const struct fmt wlanstats[] = { #define S_MESH_FWD_NOPATH AFTER(S_MESH_FWD_DISABLED) { 4, "mesh_fwd_nopath", "mesh_fwd_nopath", "frame not forwarded because no path found to destination" }, #define S_HWMP_WRONGSEQ AFTER(S_MESH_FWD_NOPATH) - { 4, "hwmp_wrongseq", "hwmp_wrongseq", "frame discarded because of mesh sequence number is invalid (e.g. duplicate)" }, + { 4, "hwmp_wrongseq", "hwmp_wrongseq", "frame discarded because mesh sequence number is invalid" }, #define S_HWMP_ROOTREQS AFTER(S_HWMP_WRONGSEQ) { 4, "hwmp_rootreqs", "hwmp_rootreqs", "root PREQ frames sent" }, #define S_HWMP_ROOTANN AFTER(S_HWMP_ROOTREQS) From owner-svn-src-projects@FreeBSD.ORG Sat Jul 11 05:57:25 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AE7B106564A; Sat, 11 Jul 2009 05:57:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A0C38FC0C; Sat, 11 Jul 2009 05:57:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6B5vOCp043731; Sat, 11 Jul 2009 05:57:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6B5vOWf043729; Sat, 11 Jul 2009 05:57:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907110557.n6B5vOWf043729@svn.freebsd.org> From: Sam Leffler Date: Sat, 11 Jul 2009 05:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195611 - projects/mesh11s/sys/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2009 05:57:25 -0000 Author: sam Date: Sat Jul 11 05:57:24 2009 New Revision: 195611 URL: http://svn.freebsd.org/changeset/base/195611 Log: add IEEE80211_SUPPORT_TDMA and IEEE80211_SUPPORT_MESH Modified: projects/mesh11s/sys/conf/NOTES Modified: projects/mesh11s/sys/conf/NOTES ============================================================================== --- projects/mesh11s/sys/conf/NOTES Sat Jul 11 05:47:03 2009 (r195610) +++ projects/mesh11s/sys/conf/NOTES Sat Jul 11 05:57:24 2009 (r195611) @@ -738,6 +738,8 @@ device vlan device wlan options IEEE80211_DEBUG #enable debugging msgs options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's +options IEEE80211_MESH #enable 802.11s D3.0 support +options IEEE80211_TDMA #enable TDMA support # The `wlan_wep', `wlan_tkip', and `wlan_ccmp' devices provide # support for WEP, TKIP, and AES-CCMP crypto protocols optionally From owner-svn-src-projects@FreeBSD.ORG Sat Jul 11 05:58:29 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4176F106564A; Sat, 11 Jul 2009 05:58:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15E288FC12; Sat, 11 Jul 2009 05:58:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6B5wSUm043789; Sat, 11 Jul 2009 05:58:28 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6B5wStU043784; Sat, 11 Jul 2009 05:58:28 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907110558.n6B5wStU043784@svn.freebsd.org> From: Sam Leffler Date: Sat, 11 Jul 2009 05:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195612 - in projects/mesh11s/sys: amd64/conf i386/conf pc98/conf sparc64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2009 05:58:29 -0000 Author: sam Date: Sat Jul 11 05:58:28 2009 New Revision: 195612 URL: http://svn.freebsd.org/changeset/base/195612 Log: add IEEE80211_SUPPORT_MESH where net80211 is configured Modified: projects/mesh11s/sys/amd64/conf/GENERIC projects/mesh11s/sys/i386/conf/GENERIC projects/mesh11s/sys/pc98/conf/GENERIC projects/mesh11s/sys/sparc64/conf/GENERIC Modified: projects/mesh11s/sys/amd64/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/amd64/conf/GENERIC Sat Jul 11 05:57:24 2009 (r195611) +++ projects/mesh11s/sys/amd64/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) @@ -258,6 +258,7 @@ device xe # Xircom pccard Ethernet device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +options IEEE80211_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support Modified: projects/mesh11s/sys/i386/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/i386/conf/GENERIC Sat Jul 11 05:57:24 2009 (r195611) +++ projects/mesh11s/sys/i386/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) @@ -270,6 +270,7 @@ device xe # Xircom pccard Ethernet device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +options IEEE80211_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support Modified: projects/mesh11s/sys/pc98/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/pc98/conf/GENERIC Sat Jul 11 05:57:24 2009 (r195611) +++ projects/mesh11s/sys/pc98/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) @@ -223,6 +223,7 @@ device xe # Xircom pccard Ethernet #device wlan # 802.11 support #options IEEE80211_DEBUG # enable debug msgs #options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +#options IEEE80211_MESH # enable 802.11s D3.0 support #device wlan_wep # 802.11 WEP support #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support Modified: projects/mesh11s/sys/sparc64/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/sparc64/conf/GENERIC Sat Jul 11 05:57:24 2009 (r195611) +++ projects/mesh11s/sys/sparc64/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) @@ -201,6 +201,7 @@ device xl # 3Com 3c90x (``Boomerang'', device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's +options IEEE80211_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support From owner-svn-src-projects@FreeBSD.ORG Sat Jul 11 06:02:51 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF9D106566C; Sat, 11 Jul 2009 06:02:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B26E8FC13; Sat, 11 Jul 2009 06:02:51 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6B62oWN043931; Sat, 11 Jul 2009 06:02:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6B62oEx043925; Sat, 11 Jul 2009 06:02:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200907110602.n6B62oEx043925@svn.freebsd.org> From: Sam Leffler Date: Sat, 11 Jul 2009 06:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195613 - in projects/mesh11s/sys: amd64/conf conf i386/conf pc98/conf sparc64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2009 06:02:51 -0000 Author: sam Date: Sat Jul 11 06:02:50 2009 New Revision: 195613 URL: http://svn.freebsd.org/changeset/base/195613 Log: spell things correctly Modified: projects/mesh11s/sys/amd64/conf/GENERIC projects/mesh11s/sys/conf/NOTES projects/mesh11s/sys/i386/conf/GENERIC projects/mesh11s/sys/pc98/conf/GENERIC projects/mesh11s/sys/sparc64/conf/GENERIC Modified: projects/mesh11s/sys/amd64/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/amd64/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) +++ projects/mesh11s/sys/amd64/conf/GENERIC Sat Jul 11 06:02:50 2009 (r195613) @@ -258,7 +258,7 @@ device xe # Xircom pccard Ethernet device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's -options IEEE80211_MESH # enable 802.11s D3.0 support +options IEEE80211_SUPPORT_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support Modified: projects/mesh11s/sys/conf/NOTES ============================================================================== --- projects/mesh11s/sys/conf/NOTES Sat Jul 11 05:58:28 2009 (r195612) +++ projects/mesh11s/sys/conf/NOTES Sat Jul 11 06:02:50 2009 (r195613) @@ -738,8 +738,8 @@ device vlan device wlan options IEEE80211_DEBUG #enable debugging msgs options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's -options IEEE80211_MESH #enable 802.11s D3.0 support -options IEEE80211_TDMA #enable TDMA support +options IEEE80211_SUPPORT_MESH #enable 802.11s D3.0 support +options IEEE80211_SUPPORT_TDMA #enable TDMA support # The `wlan_wep', `wlan_tkip', and `wlan_ccmp' devices provide # support for WEP, TKIP, and AES-CCMP crypto protocols optionally Modified: projects/mesh11s/sys/i386/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/i386/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) +++ projects/mesh11s/sys/i386/conf/GENERIC Sat Jul 11 06:02:50 2009 (r195613) @@ -270,7 +270,7 @@ device xe # Xircom pccard Ethernet device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's -options IEEE80211_MESH # enable 802.11s D3.0 support +options IEEE80211_SUPPORT_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support Modified: projects/mesh11s/sys/pc98/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/pc98/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) +++ projects/mesh11s/sys/pc98/conf/GENERIC Sat Jul 11 06:02:50 2009 (r195613) @@ -223,7 +223,7 @@ device xe # Xircom pccard Ethernet #device wlan # 802.11 support #options IEEE80211_DEBUG # enable debug msgs #options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's -#options IEEE80211_MESH # enable 802.11s D3.0 support +#options IEEE80211_SUPPORT_MESH # enable 802.11s D3.0 support #device wlan_wep # 802.11 WEP support #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support Modified: projects/mesh11s/sys/sparc64/conf/GENERIC ============================================================================== --- projects/mesh11s/sys/sparc64/conf/GENERIC Sat Jul 11 05:58:28 2009 (r195612) +++ projects/mesh11s/sys/sparc64/conf/GENERIC Sat Jul 11 06:02:50 2009 (r195613) @@ -201,7 +201,7 @@ device xl # 3Com 3c90x (``Boomerang'', device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's -options IEEE80211_MESH # enable 802.11s D3.0 support +options IEEE80211_SUPPORT_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support