From owner-svn-src-projects@FreeBSD.ORG Sun Feb 8 20:07: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 E710C106564A; Sun, 8 Feb 2009 20:07:50 +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 C97AB8FC14; Sun, 8 Feb 2009 20:07:50 +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 n18K7oJY033005; Sun, 8 Feb 2009 20:07:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18K7o1d033002; Sun, 8 Feb 2009 20:07:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902082007.n18K7o1d033002@svn.freebsd.org> From: Sam Leffler Date: Sun, 8 Feb 2009 20:07: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: r188328 - in projects/vap7/tools/tools/ath: . athstats 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, 08 Feb 2009 20:07:51 -0000 Author: sam Date: Sun Feb 8 20:07:50 2009 New Revision: 188328 URL: http://svn.freebsd.org/changeset/base/188328 Log: merge 188327: use humanize number for totals Modified: projects/vap7/tools/tools/ath/ (props changed) projects/vap7/tools/tools/ath/athstats/Makefile projects/vap7/tools/tools/ath/athstats/athstats.c projects/vap7/tools/tools/ath/athstats/statfoo.c Modified: projects/vap7/tools/tools/ath/athstats/Makefile ============================================================================== --- projects/vap7/tools/tools/ath/athstats/Makefile Sun Feb 8 20:02:58 2009 (r188327) +++ projects/vap7/tools/tools/ath/athstats/Makefile Sun Feb 8 20:07:50 2009 (r188328) @@ -4,6 +4,9 @@ PROG= athstats SRCS= main.c statfoo.c athstats.c +DPADD= ${LIBUTIL} +LDADD= -lutil + .include SRCDIR= ${.CURDIR}/../../../.. Modified: projects/vap7/tools/tools/ath/athstats/athstats.c ============================================================================== --- projects/vap7/tools/tools/ath/athstats/athstats.c Sun Feb 8 20:02:58 2009 (r188327) +++ projects/vap7/tools/tools/ath/athstats/athstats.c Sun Feb 8 20:07:50 2009 (r188328) @@ -46,6 +46,7 @@ #include #include #include +#include #include "ah.h" #include "ah_desc.h" @@ -67,15 +68,15 @@ static const struct fmt athstats[] = { #define S_INPUT 0 - { 8, "input", "input", "data frames received" }, + { 7, "input", "input", "data frames received" }, #define S_OUTPUT AFTER(S_INPUT) - { 8, "output", "output", "data frames transmit" }, + { 7, "output", "output", "data frames transmit" }, #define S_TX_ALTRATE AFTER(S_OUTPUT) { 7, "altrate", "altrate", "tx frames with an alternate rate" }, #define S_TX_SHORTRETRY AFTER(S_TX_ALTRATE) - { 7, "short", "short", "short on-chip tx retries" }, + { 6, "short", "short", "short on-chip tx retries" }, #define S_TX_LONGRETRY AFTER(S_TX_SHORTRETRY) - { 7, "long", "long", "long on-chip tx retries" }, + { 6, "long", "long", "long on-chip tx retries" }, #define S_TX_XRETRIES AFTER(S_TX_LONGRETRY) { 6, "xretry", "xretry", "tx failed 'cuz too many retries" }, #define S_MIB AFTER(S_TX_XRETRIES) @@ -201,7 +202,7 @@ static const struct fmt athstats[] = { #define S_BE_NOMBUF AFTER(S_RX_PHY_CCK_RESTART) { 4, "benombuf", "benombuf", "beacon setup failed 'cuz no mbuf" }, #define S_BE_XMIT AFTER(S_BE_NOMBUF) - { 7, "bexmit", "bexmit", "beacons transmitted" }, + { 6, "bexmit", "bexmit", "beacons transmitted" }, #define S_PER_CAL AFTER(S_BE_XMIT) { 4, "pcal", "pcal", "periodic calibrations" }, #define S_PER_CALFAIL AFTER(S_PER_CAL) @@ -210,13 +211,13 @@ static const struct fmt athstats[] = { { 4, "prfga", "prfga", "rfgain value change" }, #if ATH_SUPPORT_TDMA #define S_TDMA_UPDATE AFTER(S_PER_RFGAIN) - { 5, "tdmau", "tdmau", "TDMA slot timing updates" }, + { 6, "tdmau", "tdmau", "TDMA slot timing updates" }, #define S_TDMA_TIMERS AFTER(S_TDMA_UPDATE) - { 5, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, + { 6, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, #define S_TDMA_TSF AFTER(S_TDMA_TIMERS) - { 5, "tdmat", "tdmat", "TDMA slot update set TSF" }, + { 6, "tdmat", "tdmat", "TDMA slot update set TSF" }, #define S_TDMA_TSFADJ AFTER(S_TDMA_TSF) - { 8, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, + { 6, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, #define S_TDMA_ACK AFTER(S_TDMA_TSFADJ) { 5, "tdmack", "tdmack", "TDMA tx failed 'cuz ACK required" }, #define S_RATE_CALLS AFTER(S_TDMA_ACK) @@ -306,9 +307,9 @@ static const struct fmt athstats[] = { #define S_ANI_STEPDOWN AFTER(S_ANI_STEPUP) { 5, "step-","STEP-", "ANI decreased first step level" }, #define S_ANI_OFDMERRS AFTER(S_ANI_STEPDOWN) - { 8, "ofdm", "OFDM", "cumulative OFDM phy error count" }, + { 7, "ofdm", "OFDM", "cumulative OFDM phy error count" }, #define S_ANI_CCKERRS AFTER(S_ANI_OFDMERRS) - { 8, "cck", "CCK", "cumulative CCK phy error count" }, + { 7, "cck", "CCK", "cumulative CCK phy error count" }, #define S_ANI_RESET AFTER(S_ANI_CCKERRS) { 5, "reset","RESET", "ANI parameters zero'd for non-STA operation" }, #define S_ANI_LZERO AFTER(S_ANI_RESET) @@ -316,15 +317,15 @@ static const struct fmt athstats[] = { #define S_ANI_LNEG AFTER(S_ANI_LZERO) { 5, "lneg", "LNEG", "ANI calculated listen time < 0" }, #define S_MIB_ACKBAD AFTER(S_ANI_LNEG) - { 5, "ackbad","ACKBAD", "missing ACK's" }, + { 7, "ackbad","ACKBAD", "missing ACK's" }, #define S_MIB_RTSBAD AFTER(S_MIB_ACKBAD) - { 5, "rtsbad","RTSBAD", "RTS without CTS" }, + { 7, "rtsbad","RTSBAD", "RTS without CTS" }, #define S_MIB_RTSGOOD AFTER(S_MIB_RTSBAD) - { 5, "rtsgood","RTSGOOD", "successful RTS" }, + { 7, "rtsgood","RTSGOOD", "successful RTS" }, #define S_MIB_FCSBAD AFTER(S_MIB_RTSGOOD) - { 5, "fcsbad","FCSBAD", "bad FCS" }, + { 7, "fcsbad","FCSBAD", "bad FCS" }, #define S_MIB_BEACONS AFTER(S_MIB_FCSBAD) - { 5, "beacons","beacons", "beacons received" }, + { 7, "beacons","beacons", "beacons received" }, #define S_NODE_AVGBRSSI AFTER(S_MIB_BEACONS) { 3, "avgbrssi","BSI", "average rssi (beacons only)" }, #define S_NODE_AVGRSSI AFTER(S_NODE_AVGBRSSI) @@ -335,37 +336,37 @@ static const struct fmt athstats[] = { #else #define S_ANT_TX0 AFTER(S_ANT_TXSWITCH) #endif /* ATH_SUPPORT_ANI */ - { 8, "tx0", "ant0(tx)", "frames tx on antenna 0" }, + { 7, "tx0", "ant0(tx)", "frames tx on antenna 0" }, #define S_ANT_TX1 AFTER(S_ANT_TX0) - { 8, "tx1", "ant1(tx)", "frames tx on antenna 1" }, + { 7, "tx1", "ant1(tx)", "frames tx on antenna 1" }, #define S_ANT_TX2 AFTER(S_ANT_TX1) - { 8, "tx2", "ant2(tx)", "frames tx on antenna 2" }, + { 7, "tx2", "ant2(tx)", "frames tx on antenna 2" }, #define S_ANT_TX3 AFTER(S_ANT_TX2) - { 8, "tx3", "ant3(tx)", "frames tx on antenna 3" }, + { 7, "tx3", "ant3(tx)", "frames tx on antenna 3" }, #define S_ANT_TX4 AFTER(S_ANT_TX3) - { 8, "tx4", "ant4(tx)", "frames tx on antenna 4" }, + { 7, "tx4", "ant4(tx)", "frames tx on antenna 4" }, #define S_ANT_TX5 AFTER(S_ANT_TX4) - { 8, "tx5", "ant5(tx)", "frames tx on antenna 5" }, + { 7, "tx5", "ant5(tx)", "frames tx on antenna 5" }, #define S_ANT_TX6 AFTER(S_ANT_TX5) - { 8, "tx6", "ant6(tx)", "frames tx on antenna 6" }, + { 7, "tx6", "ant6(tx)", "frames tx on antenna 6" }, #define S_ANT_TX7 AFTER(S_ANT_TX6) - { 8, "tx7", "ant7(tx)", "frames tx on antenna 7" }, + { 7, "tx7", "ant7(tx)", "frames tx on antenna 7" }, #define S_ANT_RX0 AFTER(S_ANT_TX7) - { 8, "rx0", "ant0(rx)", "frames rx on antenna 0" }, + { 7, "rx0", "ant0(rx)", "frames rx on antenna 0" }, #define S_ANT_RX1 AFTER(S_ANT_RX0) - { 8, "rx1", "ant1(rx)", "frames rx on antenna 1" }, + { 7, "rx1", "ant1(rx)", "frames rx on antenna 1" }, #define S_ANT_RX2 AFTER(S_ANT_RX1) - { 8, "rx2", "ant2(rx)", "frames rx on antenna 2" }, + { 7, "rx2", "ant2(rx)", "frames rx on antenna 2" }, #define S_ANT_RX3 AFTER(S_ANT_RX2) - { 8, "rx3", "ant3(rx)", "frames rx on antenna 3" }, + { 7, "rx3", "ant3(rx)", "frames rx on antenna 3" }, #define S_ANT_RX4 AFTER(S_ANT_RX3) - { 8, "rx4", "ant4(rx)", "frames rx on antenna 4" }, + { 7, "rx4", "ant4(rx)", "frames rx on antenna 4" }, #define S_ANT_RX5 AFTER(S_ANT_RX4) - { 8, "rx5", "ant5(rx)", "frames rx on antenna 5" }, + { 7, "rx5", "ant5(rx)", "frames rx on antenna 5" }, #define S_ANT_RX6 AFTER(S_ANT_RX5) - { 8, "rx6", "ant6(rx)", "frames rx on antenna 6" }, + { 7, "rx6", "ant6(rx)", "frames rx on antenna 6" }, #define S_ANT_RX7 AFTER(S_ANT_RX6) - { 8, "rx7", "ant7(rx)", "frames rx on antenna 7" }, + { 7, "rx7", "ant7(rx)", "frames rx on antenna 7" }, #define S_TX_SIGNAL AFTER(S_ANT_RX7) { 4, "asignal", "asig", "signal of last ack (dBm)" }, #define S_RX_SIGNAL AFTER(S_TX_SIGNAL) @@ -710,32 +711,38 @@ ath_get_curstat(struct statfoo *sf, int #undef STAT } +int +hnprintf(char *b, size_t bs, const char *fmt, int64_t v) +{ + humanize_number(b, bs, v, "", HN_AUTOSCALE, HN_NOSPACE); +} + static int ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_##x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_##x); return 1 #define PHY(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_rx_phy[x]); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_rx_phy[x]); return 1 #define ANI(x) \ - snprintf(b, bs, "%u", wf->total.ani_state.x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ani_state.x); return 1 #define ANISTAT(x) \ - snprintf(b, bs, "%u", wf->total.ani_stats.ast_ani_##x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_ani_##x); return 1 #define MIBSTAT(x) \ - snprintf(b, bs, "%u", wf->total.ani_stats.ast_mibstats.x); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_mibstats.x); return 1 #define TXANT(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_ant_tx[x]); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_tx[x]); return 1 #define RXANT(x) \ - snprintf(b, bs, "%u", wf->total.ath.ast_ant_rx[x]); return 1 + hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_rx[x]); return 1 switch (s) { case S_INPUT: - snprintf(b, bs, "%lu", + hnprintf(b, bs, "%lu", wf->total.ath.ast_rx_packets - wf->total.ath.ast_rx_mgt); return 1; case S_OUTPUT: - snprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); + hnprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); return 1; case S_RATE: snprintrate(b, bs, wf->total.ath.ast_tx_rate); Modified: projects/vap7/tools/tools/ath/athstats/statfoo.c ============================================================================== --- projects/vap7/tools/tools/ath/athstats/statfoo.c Sun Feb 8 20:02:58 2009 (r188327) +++ projects/vap7/tools/tools/ath/athstats/statfoo.c Sun Feb 8 20:07:50 2009 (r188328) @@ -109,7 +109,7 @@ statfoo_print_current(struct statfoo *sf for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_curstat(sf, *cp &~ 0x80, buf, sizeof(buf))) + if (sf->get_curstat(sf, *cp &~ 0x80, buf, f->width)) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); @@ -126,7 +126,7 @@ statfoo_print_total(struct statfoo *sf, for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_totstat(sf, *cp &~ 0x80, buf, sizeof(buf))) + if (sf->get_totstat(sf, *cp &~ 0x80, buf, f->width)) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); From owner-svn-src-projects@FreeBSD.ORG Sun Feb 8 22:31: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 3CD43106564A; Sun, 8 Feb 2009 22:31:32 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC518FC0C; Sun, 8 Feb 2009 22:31:32 +0000 (UTC) (envelope-from kmacy@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 n18MVWJZ036826; Sun, 8 Feb 2009 22:31:32 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18MVWFu036825; Sun, 8 Feb 2009 22:31:32 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200902082231.n18MVWFu036825@svn.freebsd.org> From: Kip Macy Date: Sun, 8 Feb 2009 22:31: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: r188349 - projects/releng_7_xen/sys/i386/xen 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, 08 Feb 2009 22:31:32 -0000 Author: kmacy Date: Sun Feb 8 22:31:31 2009 New Revision: 188349 URL: http://svn.freebsd.org/changeset/base/188349 Log: don't touch page tables directly Modified: projects/releng_7_xen/sys/i386/xen/pmap.c Modified: projects/releng_7_xen/sys/i386/xen/pmap.c ============================================================================== --- projects/releng_7_xen/sys/i386/xen/pmap.c Sun Feb 8 22:17:24 2009 (r188348) +++ projects/releng_7_xen/sys/i386/xen/pmap.c Sun Feb 8 22:31:31 2009 (r188349) @@ -3664,14 +3664,17 @@ pmap_remove_write(vm_page_t m) retry: oldpte = *pte; if ((oldpte & PG_RW) != 0) { + vm_paddr_t newpte = oldpte & ~(PG_RW | PG_M); + /* * Regardless of whether a pte is 32 or 64 bits * in size, PG_RW and PG_M are among the least * significant 32 bits. */ - if (!atomic_cmpset_int((u_int *)pte, oldpte, - oldpte & ~(PG_RW | PG_M))) + PT_SET_VA_MA(pte, newpte, TRUE); + if (*pte != newpte) goto retry; + if ((oldpte & PG_M) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); From owner-svn-src-projects@FreeBSD.ORG Sun Feb 8 23:12: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 BBD15106566B; Sun, 8 Feb 2009 23:12:29 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAA2C8FC0A; Sun, 8 Feb 2009 23:12:29 +0000 (UTC) (envelope-from kmacy@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 n18NCTeb037753; Sun, 8 Feb 2009 23:12:29 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n18NCTc4037751; Sun, 8 Feb 2009 23:12:29 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200902082312.n18NCTc4037751@svn.freebsd.org> From: Kip Macy Date: Sun, 8 Feb 2009 23:12: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: r188351 - in projects/release_6_3_xen/sys: dev/xen/netfront i386/i386 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, 08 Feb 2009 23:12:30 -0000 Author: kmacy Date: Sun Feb 8 23:12:29 2009 New Revision: 188351 URL: http://svn.freebsd.org/changeset/base/188351 Log: fixing netfront build without witness and reboot handling Modified: projects/release_6_3_xen/sys/dev/xen/netfront/netfront.c projects/release_6_3_xen/sys/i386/i386/vm_machdep.c Modified: projects/release_6_3_xen/sys/dev/xen/netfront/netfront.c ============================================================================== --- projects/release_6_3_xen/sys/dev/xen/netfront/netfront.c Sun Feb 8 22:54:58 2009 (r188350) +++ projects/release_6_3_xen/sys/dev/xen/netfront/netfront.c Sun Feb 8 23:12:29 2009 (r188351) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: projects/release_6_3_xen/sys/i386/i386/vm_machdep.c ============================================================================== --- projects/release_6_3_xen/sys/i386/i386/vm_machdep.c Sun Feb 8 22:54:58 2009 (r188350) +++ projects/release_6_3_xen/sys/i386/i386/vm_machdep.c Sun Feb 8 23:12:29 2009 (r188351) @@ -597,7 +597,10 @@ cpu_reset_real() #endif #ifdef XEN - HYPERVISOR_shutdown(SHUTDOWN_poweroff); + if (smp_processor_id() == 0) + HYPERVISOR_shutdown(SHUTDOWN_reboot); + else + HYPERVISOR_shutdown(SHUTDOWN_poweroff); #endif disable_intr(); #ifdef CPU_ELAN From owner-svn-src-projects@FreeBSD.ORG Mon Feb 9 18:01: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 43DF810656F1; Mon, 9 Feb 2009 18:01:55 +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 31C848FC18; Mon, 9 Feb 2009 18:01:55 +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 n19I1tSD067320; Mon, 9 Feb 2009 18:01:55 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19I1tkJ067319; Mon, 9 Feb 2009 18:01:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902091801.n19I1tkJ067319@svn.freebsd.org> From: Sam Leffler Date: Mon, 9 Feb 2009 18:01: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: r188402 - projects/cambria/sys/arm/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, 09 Feb 2009 18:01:56 -0000 Author: sam Date: Mon Feb 9 18:01:54 2009 New Revision: 188402 URL: http://svn.freebsd.org/changeset/base/188402 Log: temporarily remove crypto stuff Modified: projects/cambria/sys/arm/conf/CAMBRIA Modified: projects/cambria/sys/arm/conf/CAMBRIA ============================================================================== --- projects/cambria/sys/arm/conf/CAMBRIA Mon Feb 9 17:53:45 2009 (r188401) +++ projects/cambria/sys/arm/conf/CAMBRIA Mon Feb 9 18:01:54 2009 (r188402) @@ -83,9 +83,9 @@ device ata device atadisk # ATA disk drives device avila_ata # Gateworks CF/IDE support -device ixpcrypto # requires npe + qmgr -device crypto -device cryptodev +#device ixpcrypto # requires npe + qmgr +#device crypto +#device cryptodev device npe # Network Processing Engine device npe_fw From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 01:39: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 13CF8106564A; Tue, 10 Feb 2009 01:39: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 02D328FC17; Tue, 10 Feb 2009 01:39: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 n1A1dtGJ077134; Tue, 10 Feb 2009 01:39:55 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A1dtUo077133; Tue, 10 Feb 2009 01:39:55 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902100139.n1A1dtUo077133@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 01:39: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: r188428 - projects/vap7/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, 10 Feb 2009 01:39:56 -0000 Author: sam Date: Tue Feb 10 01:39:55 2009 New Revision: 188428 URL: http://svn.freebsd.org/changeset/base/188428 Log: merge 188427: correctly fixup iv_des_chan after installing a new channel table Modified: projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_regdomain.c Modified: projects/vap7/sys/net80211/ieee80211_regdomain.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_regdomain.c Tue Feb 10 01:37:55 2009 (r188427) +++ projects/vap7/sys/net80211/ieee80211_regdomain.c Tue Feb 10 01:39:55 2009 (r188428) @@ -428,8 +428,9 @@ ieee80211_setregdomain(struct ieee80211v ieee80211_scan_flush(vap); ieee80211_dfs_reset(ic); if (vap->iv_des_chan != IEEE80211_CHAN_ANYC) { + c = ieee80211_find_channel(ic, desfreq, desflags); /* NB: may be NULL if not present in new channel list */ - vap->iv_des_chan = ieee80211_find_channel(ic, desfreq, desflags); + vap->iv_des_chan = (c != NULL) ? c : IEEE80211_CHAN_ANYC; } IEEE80211_UNLOCK(ic); From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 04:56: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 77A70106564A; Tue, 10 Feb 2009 04:56:09 +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 612908FC12; Tue, 10 Feb 2009 04:56:09 +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 n1A4u9TC081667; Tue, 10 Feb 2009 04:56:09 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A4u8oG081651; Tue, 10 Feb 2009 04:56:08 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200902100456.n1A4u8oG081651@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 10 Feb 2009 04:56: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: r188430 - in projects/tcp_cc_7.x: . bin bin/chio bin/cp bin/dd bin/ln bin/sh contrib contrib/bind9 contrib/gcc contrib/gdb contrib/gdtoa contrib/ntp contrib/opie contrib/sendmail contri... 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, 10 Feb 2009 04:56:09 -0000 Author: lstewart Date: Tue Feb 10 04:56:08 2009 New Revision: 188430 URL: http://svn.freebsd.org/changeset/base/188430 Log: Merge r188055:188429 from stable/7 Added: projects/tcp_cc_7.x/lib/libarchive/test/test_write_disk_sparse.c - copied unchanged from r188429, stable/7/lib/libarchive/test/test_write_disk_sparse.c projects/tcp_cc_7.x/share/man/man5/portindex.5 - copied unchanged from r188429, stable/7/share/man/man5/portindex.5 projects/tcp_cc_7.x/share/man/man7/adding_user.7 - copied unchanged from r188429, stable/7/share/man/man7/adding_user.7 Deleted: projects/tcp_cc_7.x/share/man/man8/adding_user.8 Modified: projects/tcp_cc_7.x/ (props changed) projects/tcp_cc_7.x/COPYRIGHT (props changed) projects/tcp_cc_7.x/Makefile (contents, props changed) projects/tcp_cc_7.x/Makefile.inc1 (props changed) projects/tcp_cc_7.x/ObsoleteFiles.inc projects/tcp_cc_7.x/UPDATING (contents, props changed) projects/tcp_cc_7.x/bin/ (props changed) projects/tcp_cc_7.x/bin/chio/ (props changed) projects/tcp_cc_7.x/bin/cp/ (props changed) projects/tcp_cc_7.x/bin/cp/utils.c projects/tcp_cc_7.x/bin/dd/ (props changed) projects/tcp_cc_7.x/bin/ln/ (props changed) projects/tcp_cc_7.x/bin/sh/ (props changed) projects/tcp_cc_7.x/contrib/ (props changed) projects/tcp_cc_7.x/contrib/bind9/ (props changed) projects/tcp_cc_7.x/contrib/gcc/ (props changed) projects/tcp_cc_7.x/contrib/gdb/ (props changed) projects/tcp_cc_7.x/contrib/gdtoa/ (props changed) projects/tcp_cc_7.x/contrib/ntp/ (props changed) projects/tcp_cc_7.x/contrib/opie/opiekey.1 projects/tcp_cc_7.x/contrib/sendmail/ (props changed) projects/tcp_cc_7.x/contrib/smbfs/ (props changed) projects/tcp_cc_7.x/contrib/tcsh/ (props changed) projects/tcp_cc_7.x/contrib/telnet/ (props changed) projects/tcp_cc_7.x/contrib/top/ (props changed) projects/tcp_cc_7.x/contrib/traceroute/ (props changed) projects/tcp_cc_7.x/crypto/openssh/ (props changed) projects/tcp_cc_7.x/etc/ (props changed) projects/tcp_cc_7.x/etc/defaults/rc.conf projects/tcp_cc_7.x/etc/periodic/weekly/ (props changed) projects/tcp_cc_7.x/etc/rc.d/jail projects/tcp_cc_7.x/games/fortune/ (props changed) projects/tcp_cc_7.x/games/fortune/fortune/ (props changed) projects/tcp_cc_7.x/gnu/ (props changed) projects/tcp_cc_7.x/gnu/usr.bin/cc/ (props changed) projects/tcp_cc_7.x/gnu/usr.bin/cvs/ (props changed) projects/tcp_cc_7.x/gnu/usr.bin/gdb/kgdb/ (props changed) projects/tcp_cc_7.x/gnu/usr.bin/groff/tmac/mdoc.local (props changed) projects/tcp_cc_7.x/gnu/usr.bin/sort/ (props changed) projects/tcp_cc_7.x/include/ (props changed) projects/tcp_cc_7.x/kerberos5/ (props changed) projects/tcp_cc_7.x/lib/ (props changed) projects/tcp_cc_7.x/lib/bind/ (props changed) projects/tcp_cc_7.x/lib/csu/ (props changed) projects/tcp_cc_7.x/lib/libarchive/ (props changed) projects/tcp_cc_7.x/lib/libarchive/archive_write_disk.c projects/tcp_cc_7.x/lib/libarchive/test/Makefile projects/tcp_cc_7.x/lib/libbluetooth/ (props changed) projects/tcp_cc_7.x/lib/libc/ (props changed) projects/tcp_cc_7.x/lib/libc/string/ffsll.c (props changed) projects/tcp_cc_7.x/lib/libc/string/flsll.c (props changed) projects/tcp_cc_7.x/lib/libc/sys/cpuset_getaffinity.2 projects/tcp_cc_7.x/lib/libc/sys/jail.2 projects/tcp_cc_7.x/lib/libc_r/ (props changed) projects/tcp_cc_7.x/lib/libcam/ (props changed) projects/tcp_cc_7.x/lib/libdisk/ (props changed) projects/tcp_cc_7.x/lib/libfetch/ (props changed) projects/tcp_cc_7.x/lib/libftpio/ (props changed) projects/tcp_cc_7.x/lib/libgeom/ (props changed) projects/tcp_cc_7.x/lib/libgssapi/ (props changed) projects/tcp_cc_7.x/lib/libkse/ (props changed) projects/tcp_cc_7.x/lib/libkvm/ (props changed) projects/tcp_cc_7.x/lib/libkvm/kvm_proc.c projects/tcp_cc_7.x/lib/libmagic/ (props changed) projects/tcp_cc_7.x/lib/libstand/ (props changed) projects/tcp_cc_7.x/lib/libthr/ (props changed) projects/tcp_cc_7.x/lib/libutil/ (props changed) projects/tcp_cc_7.x/lib/msun/ (props changed) projects/tcp_cc_7.x/libexec/ (props changed) projects/tcp_cc_7.x/libexec/ftpd/ftpd.8 projects/tcp_cc_7.x/libexec/rpc.rstatd/ (props changed) projects/tcp_cc_7.x/libexec/rtld-elf/ (props changed) projects/tcp_cc_7.x/release/ (props changed) projects/tcp_cc_7.x/release/scripts/src-install.sh (props changed) projects/tcp_cc_7.x/rescue/ (props changed) projects/tcp_cc_7.x/sbin/ (props changed) projects/tcp_cc_7.x/sbin/atacontrol/ (props changed) projects/tcp_cc_7.x/sbin/ddb/ (props changed) projects/tcp_cc_7.x/sbin/devfs/ (props changed) projects/tcp_cc_7.x/sbin/dhclient/ (props changed) projects/tcp_cc_7.x/sbin/dumpfs/ (props changed) projects/tcp_cc_7.x/sbin/dumpfs/dumpfs.8 projects/tcp_cc_7.x/sbin/dumpfs/dumpfs.c projects/tcp_cc_7.x/sbin/fdisk/ (props changed) projects/tcp_cc_7.x/sbin/fsck_ffs/ (props changed) projects/tcp_cc_7.x/sbin/geom/ (props changed) projects/tcp_cc_7.x/sbin/geom/class/part/ (props changed) projects/tcp_cc_7.x/sbin/geom/core/geom.c projects/tcp_cc_7.x/sbin/geom/misc/ (props changed) projects/tcp_cc_7.x/sbin/ifconfig/ (props changed) projects/tcp_cc_7.x/sbin/init/ (props changed) projects/tcp_cc_7.x/sbin/ipfw/ (props changed) projects/tcp_cc_7.x/sbin/md5/ (props changed) projects/tcp_cc_7.x/sbin/mdconfig/ (props changed) projects/tcp_cc_7.x/sbin/mksnap_ffs/ (props changed) projects/tcp_cc_7.x/sbin/mount/ (props changed) projects/tcp_cc_7.x/sbin/natd/ (props changed) projects/tcp_cc_7.x/sbin/ping6/ (props changed) projects/tcp_cc_7.x/sbin/sconfig/ (props changed) projects/tcp_cc_7.x/secure/lib/libssh/ (props changed) projects/tcp_cc_7.x/secure/libexec/sftp-server/ (props changed) projects/tcp_cc_7.x/secure/usr.bin/ssh/ (props changed) projects/tcp_cc_7.x/secure/usr.sbin/sshd/ (props changed) projects/tcp_cc_7.x/share/ (props changed) projects/tcp_cc_7.x/share/colldef/ (props changed) projects/tcp_cc_7.x/share/doc/bind9/ (props changed) projects/tcp_cc_7.x/share/examples/ (props changed) projects/tcp_cc_7.x/share/man/man3/ (props changed) projects/tcp_cc_7.x/share/man/man4/ (props changed) projects/tcp_cc_7.x/share/man/man4/ddb.4 projects/tcp_cc_7.x/share/man/man4/igb.4 (props changed) projects/tcp_cc_7.x/share/man/man5/ (props changed) projects/tcp_cc_7.x/share/man/man5/Makefile projects/tcp_cc_7.x/share/man/man5/rc.conf.5 projects/tcp_cc_7.x/share/man/man7/ (props changed) projects/tcp_cc_7.x/share/man/man7/Makefile projects/tcp_cc_7.x/share/man/man8/Makefile projects/tcp_cc_7.x/share/man/man9/ (props changed) projects/tcp_cc_7.x/share/mk/ (props changed) projects/tcp_cc_7.x/share/mk/bsd.own.mk projects/tcp_cc_7.x/share/sendmail/ (props changed) projects/tcp_cc_7.x/share/syscons/ (props changed) projects/tcp_cc_7.x/share/syscons/keymaps/ (props changed) projects/tcp_cc_7.x/share/timedef/ (props changed) projects/tcp_cc_7.x/share/zoneinfo/ (props changed) projects/tcp_cc_7.x/sys/ (props changed) projects/tcp_cc_7.x/sys/arm/arm/busdma_machdep.c projects/tcp_cc_7.x/sys/compat/freebsd32/freebsd32.h projects/tcp_cc_7.x/sys/compat/freebsd32/freebsd32_misc.c projects/tcp_cc_7.x/sys/compat/freebsd32/freebsd32_proto.h projects/tcp_cc_7.x/sys/compat/freebsd32/freebsd32_syscall.h projects/tcp_cc_7.x/sys/compat/freebsd32/freebsd32_syscalls.c projects/tcp_cc_7.x/sys/compat/freebsd32/freebsd32_sysent.c projects/tcp_cc_7.x/sys/compat/freebsd32/syscalls.master projects/tcp_cc_7.x/sys/conf/kern.post.mk projects/tcp_cc_7.x/sys/conf/kern.pre.mk projects/tcp_cc_7.x/sys/contrib/pf/ (props changed) projects/tcp_cc_7.x/sys/dev/acpi_support/acpi_asus.c projects/tcp_cc_7.x/sys/dev/ath/ath_hal/ (props changed) projects/tcp_cc_7.x/sys/dev/cxgb/ (props changed) projects/tcp_cc_7.x/sys/dev/fxp/if_fxp.c projects/tcp_cc_7.x/sys/dev/fxp/if_fxpreg.h projects/tcp_cc_7.x/sys/dev/fxp/if_fxpvar.h projects/tcp_cc_7.x/sys/dev/kbdmux/kbdmux.c projects/tcp_cc_7.x/sys/dev/msk/if_msk.c projects/tcp_cc_7.x/sys/dev/msk/if_mskreg.h projects/tcp_cc_7.x/sys/dev/re/if_re.c projects/tcp_cc_7.x/sys/dev/sound/pci/hda/hdac.c projects/tcp_cc_7.x/sys/dev/usb/if_axe.c projects/tcp_cc_7.x/sys/dev/usb/if_axereg.h projects/tcp_cc_7.x/sys/dev/usb/usbdevs projects/tcp_cc_7.x/sys/fs/fifofs/fifo_vnops.c projects/tcp_cc_7.x/sys/kern/kern_cpuset.c projects/tcp_cc_7.x/sys/kern/kern_exit.c projects/tcp_cc_7.x/sys/kern/kern_fork.c projects/tcp_cc_7.x/sys/kern/kern_jail.c projects/tcp_cc_7.x/sys/kern/tty.c projects/tcp_cc_7.x/sys/kern/uipc_socket.c projects/tcp_cc_7.x/sys/kern/uipc_usrreq.c projects/tcp_cc_7.x/sys/kern/vfs_subr.c projects/tcp_cc_7.x/sys/net/if.c projects/tcp_cc_7.x/sys/net/rtsock.c projects/tcp_cc_7.x/sys/netgraph/bluetooth/hci/ng_hci_main.c projects/tcp_cc_7.x/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c projects/tcp_cc_7.x/sys/netinet/in.c projects/tcp_cc_7.x/sys/netinet/in_pcb.c projects/tcp_cc_7.x/sys/netinet/raw_ip.c projects/tcp_cc_7.x/sys/netinet/sctp_pcb.c projects/tcp_cc_7.x/sys/netinet/sctp_usrreq.c projects/tcp_cc_7.x/sys/netinet/tcp_usrreq.c projects/tcp_cc_7.x/sys/netinet/udp_usrreq.c projects/tcp_cc_7.x/sys/netinet6/in6.c projects/tcp_cc_7.x/sys/netinet6/in6_pcb.c projects/tcp_cc_7.x/sys/netinet6/in6_src.c projects/tcp_cc_7.x/sys/netinet6/raw_ip6.c projects/tcp_cc_7.x/sys/netinet6/udp6_usrreq.c projects/tcp_cc_7.x/sys/netipx/ipx_usrreq.c projects/tcp_cc_7.x/sys/pci/if_rlreg.h projects/tcp_cc_7.x/sys/security/audit/audit.c projects/tcp_cc_7.x/sys/security/audit/audit_arg.c projects/tcp_cc_7.x/sys/security/audit/audit_bsm.c projects/tcp_cc_7.x/sys/security/audit/audit_bsm_klib.c projects/tcp_cc_7.x/sys/security/audit/audit_pipe.c projects/tcp_cc_7.x/sys/security/audit/audit_private.h projects/tcp_cc_7.x/sys/security/audit/audit_syscalls.c projects/tcp_cc_7.x/sys/security/mac/mac_audit.c projects/tcp_cc_7.x/sys/security/mac/mac_priv.c projects/tcp_cc_7.x/sys/security/mac_bsdextended/mac_bsdextended.c projects/tcp_cc_7.x/sys/sys/cpuset.h projects/tcp_cc_7.x/sys/sys/jail.h projects/tcp_cc_7.x/sys/sys/param.h projects/tcp_cc_7.x/sys/ufs/ffs/ffs_alloc.c projects/tcp_cc_7.x/sys/ufs/ffs/ffs_balloc.c projects/tcp_cc_7.x/sys/ufs/ffs/ffs_extern.h projects/tcp_cc_7.x/sys/ufs/ffs/ffs_inode.c projects/tcp_cc_7.x/sys/ufs/ffs/ffs_vnops.c projects/tcp_cc_7.x/tools/build/ (props changed) projects/tcp_cc_7.x/tools/regression/atm/ (props changed) projects/tcp_cc_7.x/tools/regression/file/flock/ (props changed) projects/tcp_cc_7.x/tools/regression/usr.bin/ (props changed) projects/tcp_cc_7.x/tools/regression/usr.bin/tr/ (props changed) projects/tcp_cc_7.x/tools/sched/ (props changed) projects/tcp_cc_7.x/tools/tools/crypto/ (props changed) projects/tcp_cc_7.x/tools/tools/editing/ (props changed) projects/tcp_cc_7.x/tools/tools/nanobsd/ (props changed) projects/tcp_cc_7.x/usr.bin/ (props changed) projects/tcp_cc_7.x/usr.bin/basename/ (props changed) projects/tcp_cc_7.x/usr.bin/basename/basename.1 projects/tcp_cc_7.x/usr.bin/calendar/ (props changed) projects/tcp_cc_7.x/usr.bin/cksum/ (props changed) projects/tcp_cc_7.x/usr.bin/comm/ (props changed) projects/tcp_cc_7.x/usr.bin/cpuset/ (props changed) projects/tcp_cc_7.x/usr.bin/cpuset/cpuset.1 projects/tcp_cc_7.x/usr.bin/cpuset/cpuset.c projects/tcp_cc_7.x/usr.bin/dirname/ (props changed) projects/tcp_cc_7.x/usr.bin/dirname/dirname.c projects/tcp_cc_7.x/usr.bin/du/ (props changed) projects/tcp_cc_7.x/usr.bin/fetch/ (props changed) projects/tcp_cc_7.x/usr.bin/file/ (props changed) projects/tcp_cc_7.x/usr.bin/gzip/ (props changed) projects/tcp_cc_7.x/usr.bin/ipcrm/ (props changed) projects/tcp_cc_7.x/usr.bin/ipcs/ (props changed) projects/tcp_cc_7.x/usr.bin/kdump/ (props changed) projects/tcp_cc_7.x/usr.bin/ktrace/ (props changed) projects/tcp_cc_7.x/usr.bin/ldd/ (props changed) projects/tcp_cc_7.x/usr.bin/lockf/ (props changed) projects/tcp_cc_7.x/usr.bin/logger/ (props changed) projects/tcp_cc_7.x/usr.bin/make/ (props changed) projects/tcp_cc_7.x/usr.bin/netstat/ (props changed) projects/tcp_cc_7.x/usr.bin/nsupdate/ (props changed) projects/tcp_cc_7.x/usr.bin/procstat/ (props changed) projects/tcp_cc_7.x/usr.bin/sed/ (props changed) projects/tcp_cc_7.x/usr.bin/sed/compile.c projects/tcp_cc_7.x/usr.bin/shar/ (props changed) projects/tcp_cc_7.x/usr.bin/su/ (props changed) projects/tcp_cc_7.x/usr.bin/tar/ (props changed) projects/tcp_cc_7.x/usr.bin/top/ (props changed) projects/tcp_cc_7.x/usr.bin/truncate/ (props changed) projects/tcp_cc_7.x/usr.bin/truss/ (props changed) projects/tcp_cc_7.x/usr.bin/units/ (props changed) projects/tcp_cc_7.x/usr.bin/vmstat/ (props changed) projects/tcp_cc_7.x/usr.bin/wc/ (props changed) projects/tcp_cc_7.x/usr.bin/whereis/ (props changed) projects/tcp_cc_7.x/usr.bin/window/ (props changed) projects/tcp_cc_7.x/usr.bin/xargs/ (props changed) projects/tcp_cc_7.x/usr.sbin/ (props changed) projects/tcp_cc_7.x/usr.sbin/adduser/ (props changed) projects/tcp_cc_7.x/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) projects/tcp_cc_7.x/usr.sbin/cdcontrol/ (props changed) projects/tcp_cc_7.x/usr.sbin/config/ (props changed) projects/tcp_cc_7.x/usr.sbin/cpucontrol/ (props changed) projects/tcp_cc_7.x/usr.sbin/cron/ (props changed) projects/tcp_cc_7.x/usr.sbin/cron/cron/ (props changed) projects/tcp_cc_7.x/usr.sbin/extattr/ (props changed) projects/tcp_cc_7.x/usr.sbin/freebsd-update/ (props changed) projects/tcp_cc_7.x/usr.sbin/fwcontrol/ (props changed) projects/tcp_cc_7.x/usr.sbin/iostat/ (props changed) projects/tcp_cc_7.x/usr.sbin/jail/ (props changed) projects/tcp_cc_7.x/usr.sbin/jail/Makefile projects/tcp_cc_7.x/usr.sbin/jail/jail.8 projects/tcp_cc_7.x/usr.sbin/jail/jail.c projects/tcp_cc_7.x/usr.sbin/jexec/ (props changed) projects/tcp_cc_7.x/usr.sbin/jexec/Makefile projects/tcp_cc_7.x/usr.sbin/jexec/jexec.8 projects/tcp_cc_7.x/usr.sbin/jexec/jexec.c projects/tcp_cc_7.x/usr.sbin/jls/ (props changed) projects/tcp_cc_7.x/usr.sbin/jls/Makefile projects/tcp_cc_7.x/usr.sbin/jls/jls.8 projects/tcp_cc_7.x/usr.sbin/jls/jls.c projects/tcp_cc_7.x/usr.sbin/mergemaster/ (props changed) projects/tcp_cc_7.x/usr.sbin/mountd/ (props changed) projects/tcp_cc_7.x/usr.sbin/mtree/ (props changed) projects/tcp_cc_7.x/usr.sbin/ndiscvt/ (props changed) projects/tcp_cc_7.x/usr.sbin/newsyslog/newsyslog.conf.5 (props changed) projects/tcp_cc_7.x/usr.sbin/nscd/ (props changed) projects/tcp_cc_7.x/usr.sbin/ntp/ (props changed) projects/tcp_cc_7.x/usr.sbin/pciconf/ (props changed) projects/tcp_cc_7.x/usr.sbin/pkg_install/ (props changed) projects/tcp_cc_7.x/usr.sbin/pmcstat/ (props changed) projects/tcp_cc_7.x/usr.sbin/portsnap/ (props changed) projects/tcp_cc_7.x/usr.sbin/powerd/ (props changed) projects/tcp_cc_7.x/usr.sbin/pw/ (props changed) projects/tcp_cc_7.x/usr.sbin/rpc.lockd/ (props changed) projects/tcp_cc_7.x/usr.sbin/rpc.statd/ (props changed) projects/tcp_cc_7.x/usr.sbin/rpc.yppasswdd/ (props changed) projects/tcp_cc_7.x/usr.sbin/setfib/ (props changed) projects/tcp_cc_7.x/usr.sbin/sysinstall/ (props changed) projects/tcp_cc_7.x/usr.sbin/syslogd/ (props changed) projects/tcp_cc_7.x/usr.sbin/traceroute/ (props changed) projects/tcp_cc_7.x/usr.sbin/tzsetup/ (props changed) projects/tcp_cc_7.x/usr.sbin/wpa/wpa_supplicant/ (props changed) Modified: projects/tcp_cc_7.x/Makefile ============================================================================== --- projects/tcp_cc_7.x/Makefile Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/Makefile Tue Feb 10 04:56:08 2009 (r188430) @@ -279,7 +279,7 @@ universe_prologue: @echo "--------------------------------------------------------------" .for target in ${TARGETS} KERNCONFS!= cd ${.CURDIR}/sys/${target}/conf && \ - find [A-Z]*[A-Z] -type f -maxdepth 0 \ + find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ ! -name DEFAULTS ! -name LINT KERNCONFS:= ${KERNCONFS:S/^NOTES$/LINT/} universe: universe_${target} Modified: projects/tcp_cc_7.x/ObsoleteFiles.inc ============================================================================== --- projects/tcp_cc_7.x/ObsoleteFiles.inc Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/ObsoleteFiles.inc Tue Feb 10 04:56:08 2009 (r188430) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090203: adding_user.8 moved to adding_user.7 +OLD_FILES+=usr/share/man/man8/adding_user.8.gz # 20080407: pkg_sign has been removed OLD_FILES+=usr/sbin/pkg_check OLD_FILES+=usr/sbin/pkg_sign Modified: projects/tcp_cc_7.x/UPDATING ============================================================================== --- projects/tcp_cc_7.x/UPDATING Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/UPDATING Tue Feb 10 04:56:08 2009 (r188430) @@ -8,6 +8,19 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20090207: + ZFS users on amd64 machines with 4GB or more of RAM should + reevaluate their need for setting vm.kmem_size_max and + vm.kmem_size manually. In fact, after recent changes to the + kernel, the default value of vm.kmem_size is larger than the + suggested manual setting in most ZFS/FreeBSD tuning guides. + +20090207: + Multi-IPv4/v6/no-IP jail support was merged to STABLE. + You need to rebuild jls(8) and to use the new features + jail(8), jexec(8) and cpuset(1) with a new kernel. + __FreeBSD_version was bumped to 701103. + 20090119: NTFS has been removed from GENERIC kernel on amd64 to match GENERIC on i386. Should not cause any issues since mount_ntfs(8) Modified: projects/tcp_cc_7.x/bin/cp/utils.c ============================================================================== --- projects/tcp_cc_7.x/bin/cp/utils.c Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/bin/cp/utils.c Tue Feb 10 04:56:08 2009 (r188430) @@ -137,41 +137,39 @@ copy_file(const FTSENT *entp, int dne) * Mmap and write if less than 8M (the limit is so we don't totally * trash memory on big files. This is really a minor hack, but it * wins some CPU back. + * Some filesystems, such as smbnetfs, don't support mmap, + * so this is a best-effort attempt. */ #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED if (S_ISREG(fs->st_mode) && fs->st_size > 0 && - fs->st_size <= 8 * 1048576) { - if ((p = mmap(NULL, (size_t)fs->st_size, PROT_READ, - MAP_SHARED, from_fd, (off_t)0)) == MAP_FAILED) { + fs->st_size <= 8 * 1024 * 1024 && + (p = mmap(NULL, (size_t)fs->st_size, PROT_READ, + MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) { + wtotal = 0; + for (bufp = p, wresid = fs->st_size; ; + bufp += wcount, wresid -= (size_t)wcount) { + wcount = write(to_fd, bufp, wresid); + if (wcount <= 0) + break; + wtotal += wcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); + } + if (wcount >= (ssize_t)wresid) + break; + } + if (wcount != (ssize_t)wresid) { + warn("%s", to.p_path); + rval = 1; + } + /* Some systems don't unmap on close(2). */ + if (munmap(p, fs->st_size) < 0) { warn("%s", entp->fts_path); rval = 1; - } else { - wtotal = 0; - for (bufp = p, wresid = fs->st_size; ; - bufp += wcount, wresid -= (size_t)wcount) { - wcount = write(to_fd, bufp, wresid); - if (wcount <= 0) - break; - wtotal += wcount; - if (info) { - info = 0; - (void)fprintf(stderr, - "%s -> %s %3d%%\n", - entp->fts_path, to.p_path, - cp_pct(wtotal, fs->st_size)); - } - if (wcount >= (ssize_t)wresid) - break; - } - if (wcount != (ssize_t)wresid) { - warn("%s", to.p_path); - rval = 1; - } - /* Some systems don't unmap on close(2). */ - if (munmap(p, fs->st_size) < 0) { - warn("%s", entp->fts_path); - rval = 1; - } } } else #endif Modified: projects/tcp_cc_7.x/contrib/opie/opiekey.1 ============================================================================== --- projects/tcp_cc_7.x/contrib/opie/opiekey.1 Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/contrib/opie/opiekey.1 Tue Feb 10 04:56:08 2009 (r188430) @@ -157,8 +157,7 @@ this mistake. Better checks are needed. .BR opieinfo (1), .BR opiekeys (5), .BR opieaccess (5), -.BR opiegen (1) -.BR su (1), +.BR su (1) .SH AUTHOR Bellcore's S/Key was written by Phil Karn, Neil M. Haller, and John S. Walden Modified: projects/tcp_cc_7.x/etc/defaults/rc.conf ============================================================================== --- projects/tcp_cc_7.x/etc/defaults/rc.conf Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/etc/defaults/rc.conf Tue Feb 10 04:56:08 2009 (r188430) @@ -615,24 +615,27 @@ jail_sysvipc_allow="NO" # Allow SystemV # each jail, specified in jail_list, with the following variables. # NOTES: # - replace 'example' with the jail's name. -# - except rootdir, hostname and ip, all of the following variables may be made -# global jail variables if you don't specify a jail name (ie. jail_interface). +# - except rootdir, hostname, ip and the _multi addresses, +# all of the following variables may be made global jail variables +# if you don't specify a jail name (ie. jail_interface, jail_devfs_ruleset). # #jail_example_rootdir="/usr/jail/default" # Jail's root directory #jail_example_hostname="default.domain.com" # Jail's hostname -#jail_example_ip="192.168.0.10" # Jail's IP number -#jail_example_interface="" # Interface to create the IP alias on -#jail_example_fib="0" # routing table for setfib(1) +#jail_example_interface="" # Jail's interface variable to create IP aliases on +#jail_example_fib="0" # Routing table for setfib(1) +#jail_example_ip="192.0.2.10,2001:db8::17" # Jail's primary IPv4 and IPv6 address +#jail_example_ip_multi0="2001:db8::10" # and another IPv6 address #jail_example_exec_start="/bin/sh /etc/rc" # command to execute in jail for starting #jail_example_exec_afterstart0="/bin/sh command" # command to execute after the one for # starting the jail. More than one can be # specified using a trailing number #jail_example_exec_stop="/bin/sh /etc/rc.shutdown" # command to execute in jail for stopping #jail_example_devfs_enable="NO" # mount devfs in the jail +#jail_example_devfs_ruleset="ruleset_name" # devfs ruleset to apply to jail - + # usually you want "devfsrules_jail". #jail_example_fdescfs_enable="NO" # mount fdescfs in the jail #jail_example_procfs_enable="NO" # mount procfs in jail #jail_example_mount_enable="NO" # mount/umount jail's fs -#jail_example_devfs_ruleset="ruleset_name" # devfs ruleset to apply to jail #jail_example_fstab="" # fstab(5) for mount/umount #jail_example_flags="-l -U root" # flags for jail(8) Modified: projects/tcp_cc_7.x/etc/rc.d/jail ============================================================================== --- projects/tcp_cc_7.x/etc/rc.d/jail Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/etc/rc.d/jail Tue Feb 10 04:56:08 2009 (r188430) @@ -93,6 +93,7 @@ init_variables() debug "$_j mount enable: $_mount" debug "$_j hostname: $_hostname" debug "$_j ip: $_ip" + jail_show_addresses ${_j} debug "$_j interface: $_interface" debug "$_j fib: $_fib" debug "$_j root: $_rootdir" @@ -126,10 +127,6 @@ init_variables() if [ -z "${_rootdir}" ]; then err 3 "$name: No root directory has been defined for ${_j}" fi - if [ -z "${_ip}" ]; then - err 3 "$name: No IP address has been defined for ${_j}" - fi - } # set_sysctl rc_knob mib msg @@ -275,6 +272,208 @@ jail_mount_fstab() mount -a -F "${_fstab}" } +# jail_show_addresses jail +# Debug print the input for the given _multi aliases +# for a jail for init_variables(). +# +jail_show_addresses() +{ + local _j _type alias + _j="$1" + alias=0 + + if [ -z "${_j}" ]; then + warn "jail_show_addresses: you must specify a jail" + return + fi + + while : ; do + eval _addr=\"\$jail_${_j}_ip_multi${alias}\" + if [ -n "${_addr}" ]; then + debug "${_j} ip_multi${alias}: $_addr" + alias=$((${alias} + 1)) + else + break + fi + done +} + +# jail_extract_address argument +# The second argument is the string from one of the _ip +# or the _multi variables. In case of a comma separated list +# only one argument must be passed in at a time. +# The function alters the _type, _iface, _addr and _mask variables. +# +jail_extract_address() +{ + local _i + _i=$1 + + if [ -z "${_i}" ]; then + warn "jail_extract_address: called without input" + return + fi + + # Check if we have an interface prefix given and split into + # iFace and rest. + case "${_i}" in + *\|*) # ifN|.. prefix there + _iface=${_i%%|*} + _r=${_i##*|} + ;; + *) _iface="" + _r=${_i} + ;; + esac + + # In case the IP has no interface given, check if we have a global one. + _iface=${_iface:-${_interface}} + + # Set address, cut off any prefix/netmask/prefixlen. + _addr=${_r} + _addr=${_addr%%[/ ]*} + + # Theoretically we can return here if interface is not set, + # as we only care about the _mask if we call ifconfig. + # This is not done because we may want to santize IP addresses + # based on _type later, and optionally change the type as well. + + # Extract the prefix/netmask/prefixlen part by cutting off the address. + _mask=${_r} + _mask=`expr "${_mask}" : "${_addr}\(.*\)"` + + # Identify type {inet,inet6}. + case "${_addr}" in + *\.*\.*\.*) _type="inet" ;; + *:*) _type="inet6" ;; + *) warn "jail_extract_address: type not identified" + ;; + esac + + # Handle the special /netmask instead of /prefix or + # "netmask xxx" case for legacy IP. + # We do NOT support shortend class-full netmasks. + if [ "${_type}" = "inet" ]; then + case "${_mask}" in + /*\.*\.*\.*) _mask=" netmask ${_mask#/}" ;; + *) ;; + esac + + # In case _mask is still not set use /32. + _mask=${_mask:-/32} + + elif [ "${_type}" = "inet6" ]; then + # In case _maske is not set for IPv6, use /128. + _mask=${_mask:-/128} + fi +} + +# jail_handle_ips_option {add,del} input +# Handle a single argument imput which can be a comma separated +# list of addresses (theoretically with an option interface and +# prefix/netmask/prefixlen). +# +jail_handle_ips_option() +{ + local _x _action _type _i + _action=$1 + _x=$2 + + if [ -z "${_x}" ]; then + # No IP given. This can happen for the primary address + # of each address family. + return + fi + + # Loop, in case we find a comma separated list, we need to handle + # each argument on its own. + while [ ${#_x} -gt 0 ]; do + case "${_x}" in + *,*) # Extract the first argument and strip it off the list. + _i=`expr "${_x}" : '^\([^,]*\)'` + _x=`expr "${_x}" : "^[^,]*,\(.*\)"` + ;; + *) _i=${_x} + _x="" + ;; + esac + + _type="" + _iface="" + _addr="" + _mask="" + jail_extract_address "${_i}" + + # make sure we got an address. + case "${_addr}" in + "") continue ;; + *) ;; + esac + + # Append address to list of addresses for the jail command. + case "${_addrl}" in + "") _addrl="${_addr}" ;; + *) _addrl="${_addrl},${_addr}" ;; + esac + + # Configure interface alias if requested by a given interface + # and if we could correctly parse everything. + case "${_iface}" in + "") continue ;; + esac + case "${_type}" in + inet) ;; + inet6) ;; + *) warn "Could not determine address family. Not going" \ + "to ${_action} address '${_addr}' for ${_jail}." + continue + ;; + esac + case "${_action}" in + add) ifconfig ${_iface} ${_type} ${_addr}${_mask} alias + ;; + del) # When removing the IP, ignore the _mask. + ifconfig ${_iface} ${_type} ${_addr} -alias + ;; + esac + done +} + +# jail_ips {add,del} +# Extract the comma separated list of addresses and return them +# for the jail command. +# Handle more than one address via the _multi option as well. +# If an interface is given also add/remove an alias for the +# address with an optional netmask. +# +jail_ips() +{ + local _action + _action=$1 + + case "${_action}" in + add) ;; + del) ;; + *) warn "jail_ips: invalid action '${_action}'" + return + ;; + esac + + # Handle addresses. + jail_handle_ips_option ${_action} "${_ip}" + # Handle jail_xxx_ip_multi + alias=0 + while : ; do + eval _x=\"\$jail_${_jail}_ip_multi${alias}\" + case "${_x}" in + "") break ;; + *) jail_handle_ips_option ${_action} "${_x}" + alias=$((${alias} + 1)) + ;; + esac + done +} + jail_start() { echo -n 'Configuring jails:' @@ -296,9 +495,8 @@ jail_start() echo -n " [${_hostname} already running (/var/run/jail_${_jail}.id exists)]" continue; fi - if [ -n "${_interface}" ]; then - ifconfig ${_interface} alias ${_ip} netmask 255.255.255.255 - fi + _addrl="" + jail_ips "add" if [ -n "${_fib}" ]; then _setfib="setfib -F '${_fib}'" else @@ -358,7 +556,7 @@ jail_start() fi _tmp_jail=${_tmp_dir}/jail.$$ eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ - ${_ip} ${_exec_start} > ${_tmp_jail} 2>&1 + \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 if [ "$?" -eq 0 ] ; then _jail_id=$(head -1 ${_tmp_jail}) @@ -379,9 +577,7 @@ jail_start() echo ${_jail_id} > /var/run/jail_${_jail}.id else jail_umount_fs - if [ -n "${_interface}" ]; then - ifconfig ${_interface} -alias ${_ip} - fi + jail_ips "del" echo " cannot start jail \"${_jail}\": " tail +2 ${_tmp_jail} fi @@ -410,9 +606,7 @@ jail_stop() jail_umount_fs echo -n " $_hostname" fi - if [ -n "${_interface}" ]; then - ifconfig ${_interface} -alias ${_ip} - fi + jail_ips "del" rm /var/run/jail_${_jail}.id else echo " cannot stop jail ${_jail}. No jail id in /var/run" Modified: projects/tcp_cc_7.x/lib/libarchive/archive_write_disk.c ============================================================================== --- projects/tcp_cc_7.x/lib/libarchive/archive_write_disk.c Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/lib/libarchive/archive_write_disk.c Tue Feb 10 04:56:08 2009 (r188430) @@ -176,6 +176,8 @@ struct archive_write_disk { int fd; /* Current offset for writing data to the file. */ off_t offset; + /* Last offset actually written to disk. */ + off_t fd_offset; /* Maximum size of file, -1 if unknown. */ off_t filesize; /* Dir we were in before this restore; only for deep paths. */ @@ -185,8 +187,6 @@ struct archive_write_disk { /* UID/GID to use in restoring this entry. */ uid_t uid; gid_t gid; - /* Last offset written to disk. */ - off_t last_offset; }; /* @@ -232,7 +232,7 @@ static struct fixup_entry *sort_dir_list static gid_t trivial_lookup_gid(void *, const char *, gid_t); static uid_t trivial_lookup_uid(void *, const char *, uid_t); static ssize_t write_data_block(struct archive_write_disk *, - const char *, size_t, off_t); + const char *, size_t); static struct archive_vtable *archive_write_disk_vtable(void); @@ -334,7 +334,7 @@ _archive_write_header(struct archive *_a } a->entry = archive_entry_clone(entry); a->fd = -1; - a->last_offset = 0; + a->fd_offset = 0; a->offset = 0; a->uid = a->user_uid; a->mode = archive_entry_mode(a->entry); @@ -500,9 +500,9 @@ archive_write_disk_set_skip_file(struct } static ssize_t -write_data_block(struct archive_write_disk *a, - const char *buff, size_t size, off_t offset) +write_data_block(struct archive_write_disk *a, const char *buff, size_t size) { + uint64_t start_size = size; ssize_t bytes_written = 0; ssize_t block_size = 0, bytes_to_write; int r; @@ -519,8 +519,9 @@ write_data_block(struct archive_write_di block_size = a->pst->st_blksize; } - if (a->filesize >= 0 && (off_t)(offset + size) > a->filesize) - size = (size_t)(a->filesize - offset); + /* If this write would run beyond the file size, truncate it. */ + if (a->filesize >= 0 && (off_t)(a->offset + size) > a->filesize) + start_size = size = (size_t)(a->filesize - a->offset); /* Write the data. */ while (size > 0) { @@ -536,7 +537,7 @@ write_data_block(struct archive_write_di if (*p != '\0') break; } - offset += p - buff; + a->offset += p - buff; size -= p - buff; buff = p; if (size == 0) @@ -544,22 +545,25 @@ write_data_block(struct archive_write_di /* Calculate next block boundary after offset. */ block_end - = (offset / block_size) * block_size + block_size; + = (a->offset / block_size + 1) * block_size; /* If the adjusted write would cross block boundary, * truncate it to the block boundary. */ bytes_to_write = size; - if (offset + bytes_to_write > block_end) - bytes_to_write = block_end - offset; + if (a->offset + bytes_to_write > block_end) + bytes_to_write = block_end - a->offset; } /* Seek if necessary to the specified offset. */ - if (offset != a->last_offset) { - if (lseek(a->fd, offset, SEEK_SET) < 0) { + if (a->offset != a->fd_offset) { + if (lseek(a->fd, a->offset, SEEK_SET) < 0) { archive_set_error(&a->archive, errno, "Seek failed"); return (ARCHIVE_FATAL); } + a->fd_offset = a->offset; + a->archive.file_position = a->offset; + a->archive.raw_position = a->offset; } bytes_written = write(a->fd, buff, bytes_to_write); if (bytes_written < 0) { @@ -568,12 +572,12 @@ write_data_block(struct archive_write_di } buff += bytes_written; size -= bytes_written; - offset += bytes_written; + a->offset += bytes_written; a->archive.file_position += bytes_written; a->archive.raw_position += bytes_written; - a->last_offset = a->offset = offset; + a->fd_offset = a->offset; } - return (bytes_written); + return (start_size - size); } static ssize_t @@ -586,9 +590,9 @@ _archive_write_data_block(struct archive __archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_DATA, "archive_write_disk_block"); - r = write_data_block(a, buff, size, offset); - - if (r < 0) + a->offset = offset; + r = write_data_block(a, buff, size); + if (r < ARCHIVE_OK) return (r); if ((size_t)r < size) { archive_set_error(&a->archive, 0, @@ -606,7 +610,7 @@ _archive_write_data(struct archive *_a, __archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_DATA, "archive_write_data"); - return (write_data_block(a, buff, size, a->offset)); + return (write_data_block(a, buff, size)); } static int @@ -627,7 +631,7 @@ _archive_write_finish_entry(struct archi /* There's no file. */ } else if (a->filesize < 0) { /* File size is unknown, so we can't set the size. */ - } else if (a->last_offset == a->filesize) { + } else if (a->fd_offset == a->filesize) { /* Last write ended at exactly the filesize; we're done. */ /* Hopefully, this is the common case. */ } else { Modified: projects/tcp_cc_7.x/lib/libarchive/test/Makefile ============================================================================== --- projects/tcp_cc_7.x/lib/libarchive/test/Makefile Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/lib/libarchive/test/Makefile Tue Feb 10 04:56:08 2009 (r188430) @@ -58,6 +58,7 @@ TESTS= \ test_write_disk_hardlink.c \ test_write_disk_perms.c \ test_write_disk_secure.c \ + test_write_disk_sparse.c \ test_write_format_ar.c \ test_write_format_cpio.c \ test_write_format_cpio_empty.c \ Copied: projects/tcp_cc_7.x/lib/libarchive/test/test_write_disk_sparse.c (from r188429, stable/7/lib/libarchive/test/test_write_disk_sparse.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/tcp_cc_7.x/lib/libarchive/test/test_write_disk_sparse.c Tue Feb 10 04:56:08 2009 (r188430, copy of r188429, stable/7/lib/libarchive/test/test_write_disk_sparse.c) @@ -0,0 +1,278 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Write a file using archive_write_data call, read the file + * back and verify the contents. The data written includes large + * blocks of nulls, so it should exercise the sparsification logic + * if ARCHIVE_EXTRACT_SPARSE is enabled. + */ +static void +verify_write_data(struct archive *a, int sparse) +{ + static const char data[]="abcdefghijklmnopqrstuvwxyz"; + struct stat st; + struct archive_entry *ae; + size_t buff_size = 64 * 1024; + char *buff, *p; + const char *msg = sparse ? "sparse" : "non-sparse"; + int fd; + + buff = malloc(buff_size); + assert(buff != NULL); + + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_size(ae, 8 * buff_size); + archive_entry_set_pathname(ae, "test_write_data"); + archive_entry_set_mode(ae, AE_IFREG | 0755); + assertEqualIntA(a, 0, archive_write_header(a, ae)); + + /* Use archive_write_data() to write three relatively sparse blocks. */ + + /* First has non-null data at beginning. */ + memset(buff, 0, buff_size); + memcpy(buff, data, sizeof(data)); + failure("%s", msg); + assertEqualInt(buff_size, archive_write_data(a, buff, buff_size)); + + /* Second has non-null data in the middle. */ + memset(buff, 0, buff_size); + memcpy(buff + buff_size / 2 - 3, data, sizeof(data)); + failure("%s", msg); + assertEqualInt(buff_size, archive_write_data(a, buff, buff_size)); + + /* Third has non-null data at the end. */ + memset(buff, 0, buff_size); + memcpy(buff + buff_size - sizeof(data), data, sizeof(data)); + failure("%s", msg); + assertEqualInt(buff_size, archive_write_data(a, buff, buff_size)); + + failure("%s", msg); + assertEqualIntA(a, 0, archive_write_finish_entry(a)); + + /* Test the entry on disk. */ + assert(0 == stat(archive_entry_pathname(ae), &st)); + assertEqualInt(st.st_size, 8 * buff_size); + fd = open(archive_entry_pathname(ae), O_RDONLY); + if (!assert(fd >= 0)) + return; + + /* Check first block. */ + assertEqualInt(buff_size, read(fd, buff, buff_size)); + failure("%s", msg); + assertEqualMem(buff, data, sizeof(data)); + for (p = buff + sizeof(data); p < buff + buff_size; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + + /* Check second block. */ + assertEqualInt(buff_size, read(fd, buff, buff_size)); + for (p = buff; p < buff + buff_size; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (p == buff + buff_size / 2 - 3) { + assertEqualMem(p, data, sizeof(data)); + p += sizeof(data); + } else if (!assertEqualInt(0, *p)) + break; + } + + /* Check third block. */ + assertEqualInt(buff_size, read(fd, buff, buff_size)); + for (p = buff; p < buff + buff_size - sizeof(data); ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + failure("%s", msg); + assertEqualMem(buff + buff_size - sizeof(data), data, sizeof(data)); + + /* XXX more XXX */ + + assertEqualInt(0, close(fd)); + free(buff); +} + +/* + * As above, but using the archive_write_data_block() call. + */ +static void +verify_write_data_block(struct archive *a, int sparse) +{ + static const char data[]="abcdefghijklmnopqrstuvwxyz"; + struct stat st; + struct archive_entry *ae; + size_t buff_size = 64 * 1024; + char *buff, *p; + const char *msg = sparse ? "sparse" : "non-sparse"; + int fd; + + buff = malloc(buff_size); + assert(buff != NULL); + + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_size(ae, 8 * buff_size); + archive_entry_set_pathname(ae, "test_write_data_block"); + archive_entry_set_mode(ae, AE_IFREG | 0755); + assertEqualIntA(a, 0, archive_write_header(a, ae)); + + /* Use archive_write_data_block() to write three + relatively sparse blocks. */ + + /* First has non-null data at beginning. */ + memset(buff, 0, buff_size); + memcpy(buff, data, sizeof(data)); + failure("%s", msg); + assertEqualInt(ARCHIVE_OK, + archive_write_data_block(a, buff, buff_size, 100)); + + /* Second has non-null data in the middle. */ + memset(buff, 0, buff_size); + memcpy(buff + buff_size / 2 - 3, data, sizeof(data)); + failure("%s", msg); + assertEqualInt(ARCHIVE_OK, + archive_write_data_block(a, buff, buff_size, buff_size + 200)); + + /* Third has non-null data at the end. */ + memset(buff, 0, buff_size); + memcpy(buff + buff_size - sizeof(data), data, sizeof(data)); + failure("%s", msg); + assertEqualInt(ARCHIVE_OK, + archive_write_data_block(a, buff, buff_size, buff_size * 2 + 300)); + + failure("%s", msg); + assertEqualIntA(a, 0, archive_write_finish_entry(a)); + + /* Test the entry on disk. */ + assert(0 == stat(archive_entry_pathname(ae), &st)); + assertEqualInt(st.st_size, 8 * buff_size); + fd = open(archive_entry_pathname(ae), O_RDONLY); + if (!assert(fd >= 0)) + return; + + /* Check 100-byte gap at beginning */ + assertEqualInt(100, read(fd, buff, 100)); + failure("%s", msg); + for (p = buff; p < buff + 100; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + + /* Check first block. */ + assertEqualInt(buff_size, read(fd, buff, buff_size)); + failure("%s", msg); + assertEqualMem(buff, data, sizeof(data)); + for (p = buff + sizeof(data); p < buff + buff_size; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + + /* Check 100-byte gap */ + assertEqualInt(100, read(fd, buff, 100)); + failure("%s", msg); + for (p = buff; p < buff + 100; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + + /* Check second block. */ + assertEqualInt(buff_size, read(fd, buff, buff_size)); + for (p = buff; p < buff + buff_size; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (p == buff + buff_size / 2 - 3) { + assertEqualMem(p, data, sizeof(data)); + p += sizeof(data); + } else if (!assertEqualInt(0, *p)) + break; + } + + /* Check 100-byte gap */ + assertEqualInt(100, read(fd, buff, 100)); + failure("%s", msg); + for (p = buff; p < buff + 100; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + + /* Check third block. */ + assertEqualInt(buff_size, read(fd, buff, buff_size)); + for (p = buff; p < buff + buff_size - sizeof(data); ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + failure("%s", msg); + assertEqualMem(buff + buff_size - sizeof(data), data, sizeof(data)); + + /* Check another block size beyond last we wrote. */ + assertEqualInt(buff_size, read(fd, buff, buff_size)); + failure("%s", msg); + for (p = buff; p < buff + buff_size; ++p) { + failure("offset: %d, %s", (int)(p - buff), msg); + if (!assertEqualInt(0, *p)) + break; + } + + + /* XXX more XXX */ + + assertEqualInt(0, close(fd)); + free(buff); +} + +DEFINE_TEST(test_write_disk_sparse) +{ + struct archive *ad; + + + /* + * The return values, etc, of the write data functions + * shouldn't change regardless of whether we've requested + * sparsification. (The performance and pattern of actual + * write calls to the disk should vary, of course, but the + * client program shouldn't see any difference.) + */ + assert((ad = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(ad, 0); + verify_write_data(ad, 0); + verify_write_data_block(ad, 0); + assertEqualInt(0, archive_write_finish(ad)); + + assert((ad = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(ad, ARCHIVE_EXTRACT_SPARSE); + verify_write_data(ad, 1); + verify_write_data_block(ad, 1); + assertEqualInt(0, archive_write_finish(ad)); + +} Modified: projects/tcp_cc_7.x/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- projects/tcp_cc_7.x/lib/libc/sys/cpuset_getaffinity.2 Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/lib/libc/sys/cpuset_getaffinity.2 Tue Feb 10 04:56:08 2009 (r188430) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2008 +.Dd November 29, 2008 .Dt CPUSET 2 .Os .Sh NAME @@ -46,7 +46,7 @@ and .Fn cpuset_setaffinity allow the manipulation of sets of CPUs available to processes, threads, -interrupts and other resources. +interrupts, jails and other resources. These functions may manipulate sets of CPUs that contain many processes or per-object anonymous masks that effect only a single object. .Pp Modified: projects/tcp_cc_7.x/lib/libc/sys/jail.2 ============================================================================== --- projects/tcp_cc_7.x/lib/libc/sys/jail.2 Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/lib/libc/sys/jail.2 Tue Feb 10 04:56:08 2009 (r188430) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2003 +.Dd January 6, 2009 .Dt JAIL 2 .Os .Sh NAME @@ -32,15 +32,20 @@ The argument is a pointer to a structure .Bd -literal -offset indent struct jail { u_int32_t version; - char *path; - char *hostname; - u_int32_t ip_number; + char *path; + char *hostname; + char *jailname; + unsigned int ip4s; + unsigned int ip6s; + struct in_addr *ip4; + struct in6_addr *ip6; }; .Ed .Pp .Dq Li version defines the version of the API in use. -It should be set to zero at this time. +.Dv JAIL_API_VERSION +is defined for the current version. .Pp The .Dq Li path @@ -54,8 +59,24 @@ This can be changed from the inside of the prison. .Pp The -.Dq Li ip_number -can be set to the IP number assigned to the prison. +.Dq Li jailname +pointer is an optional name that can be assigned to the jail +for example for managment purposes. +.Pp +The +.Dq Li ip4s +and +.Dq Li ip6s +give the numbers of IPv4 and IPv6 addresses that will be passed +via their respective pointers. +.Pp +The +.Dq Li ip4 +and +.Dq Li ip6 +pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to +the prison, or NULL if none. +IPv4 addresses must be in network byte order. .Pp The .Fn jail_attach @@ -97,6 +118,12 @@ or, if present, the per-jail .Pp All IP activity will be forced to happen to/from the IP number specified, which should be an alias on one of the network interfaces. +All connections to/from the loopback address +.Pf ( Li 127.0.0.1 +for IPv4, +.Li ::1 +for IPv6) will be changed to be to/from the primary address +of the jail for the given address family. .Pp It is possible to identify a process as jailed by examining .Dq Li /proc//status : Modified: projects/tcp_cc_7.x/lib/libkvm/kvm_proc.c ============================================================================== --- projects/tcp_cc_7.x/lib/libkvm/kvm_proc.c Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/lib/libkvm/kvm_proc.c Tue Feb 10 04:56:08 2009 (r188430) @@ -54,10 +54,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _WANT_PRISON /* make jail.h give us 'struct prison' */ -#include +#include #include #include +#define _WANT_PRISON /* make jail.h give us 'struct prison' */ +#include #include #include #include Modified: projects/tcp_cc_7.x/libexec/ftpd/ftpd.8 ============================================================================== --- projects/tcp_cc_7.x/libexec/ftpd/ftpd.8 Tue Feb 10 02:43:07 2009 (r188429) +++ projects/tcp_cc_7.x/libexec/ftpd/ftpd.8 Tue Feb 10 04:56:08 2009 (r188430) @@ -205,7 +205,7 @@ for more information. Note that option is a virtual no-op in .Fx 5.0 and above; both port -ranges are indentical by default. +ranges are identical by default. .It Fl u The default file creation mode mask is set to .Ar umask , *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 08:09: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 745851065670; Tue, 10 Feb 2009 08:09:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61B4E8FC14; Tue, 10 Feb 2009 08:09:03 +0000 (UTC) (envelope-from mckusick@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 n1A893cB085440; Tue, 10 Feb 2009 08:09:03 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A893qN085439; Tue, 10 Feb 2009 08:09:03 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <200902100809.n1A893qN085439@svn.freebsd.org> From: Kirk McKusick Date: Tue, 10 Feb 2009 08:09: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: r188432 - projects/quota64/usr.sbin/edquota 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, 10 Feb 2009 08:09:03 -0000 Author: mckusick Date: Tue Feb 10 08:09:03 2009 New Revision: 188432 URL: http://svn.freebsd.org/changeset/base/188432 Log: More updates to edquota based on feedback from Dag-Erling Smorgrav. Modified: projects/quota64/usr.sbin/edquota/edquota.c Modified: projects/quota64/usr.sbin/edquota/edquota.c ============================================================================== --- projects/quota64/usr.sbin/edquota/edquota.c Tue Feb 10 06:08:28 2009 (r188431) +++ projects/quota64/usr.sbin/edquota/edquota.c Tue Feb 10 08:09:03 2009 (r188432) @@ -101,9 +101,11 @@ struct quotause { int alldigits(const char *s); int cvtatos(u_int64_t, char *, u_int64_t *); char *cvtstoa(u_int64_t); -u_int64_t cvtval(u_int64_t, char); +u_int64_t cvtblkval(u_int64_t, char, const char *); +u_int64_t cvtinoval(u_int64_t, char, const char *); int editit(char *); -char *fmthumanval(int64_t); +char *fmthumanvalblks(int64_t); +char *fmthumanvalinos(int64_t); void freeprivs(struct quotause *); int getentry(const char *, int); struct quotause *getprivs(long, int, char *); @@ -165,6 +167,12 @@ main(int argc, char *argv[]) (cp = strsep(&optarg, ":")) != NULL; i++) { if (cp != oldoptarg) *(cp - 1) = ':'; + if (i > 0 && !isdigit(*cp)) { + warnx("incorrect quota specification: " + "%s", oldoptarg); + usage(); + /* Not Reached */ + } switch (i) { case 0: strlcpy(qup->fsname, cp, @@ -173,34 +181,34 @@ main(int argc, char *argv[]) case 1: lim = strtoll(cp, &endpt, 10); qup->dqblk.dqb_bsoftlimit = - cvtval(lim, *endpt); + cvtblkval(lim, *endpt, + "block soft limit"); continue; case 2: lim = strtoll(cp, &endpt, 10); qup->dqblk.dqb_bhardlimit = - cvtval(lim, *endpt); + cvtblkval(lim, *endpt, + "block hard limit"); continue; case 3: lim = strtoll(cp, &endpt, 10); qup->dqblk.dqb_isoftlimit = - cvtval(lim, *endpt); + cvtinoval(lim, *endpt, + "inode soft limit"); continue; case 4: lim = strtoll(cp, &endpt, 10); qup->dqblk.dqb_ihardlimit = - cvtval(lim, *endpt); + cvtinoval(lim, *endpt, + "inode hard limit"); continue; default: warnx("incorrect quota specification: " "%s", oldoptarg); usage(); - break; /* XXX: report an error */ + /* Not Reached */ } } - qup->dqblk.dqb_bsoftlimit = - btodb((off_t)qup->dqblk.dqb_bsoftlimit * 1024); - qup->dqblk.dqb_bhardlimit = - btodb((off_t)qup->dqblk.dqb_bhardlimit * 1024); if (protoprivs == NULL) { protoprivs = curprivs = qup; } else { @@ -212,6 +220,7 @@ main(int argc, char *argv[]) break; default: usage(); + /* Not Reached */ } } argc -= optind; @@ -518,28 +527,29 @@ writeprivs(struct quotause *quplist, int fprintf(fd, "Quotas for %s %s:\n", qfextension[quotatype], name); for (qup = quplist; qup; qup = qup->next) { fprintf(fd, "%s: in use: %s, ", qup->fsname, - fmthumanval(qup->dqblk.dqb_curblocks)); + fmthumanvalblks(qup->dqblk.dqb_curblocks)); fprintf(fd, "limits (soft = %s, ", - fmthumanval(qup->dqblk.dqb_bsoftlimit)); + fmthumanvalblks(qup->dqblk.dqb_bsoftlimit)); fprintf(fd, "hard = %s)\n", - fmthumanval(qup->dqblk.dqb_bhardlimit)); - fprintf(fd, "%s %llu, limits (soft = %llu, hard = %llu)\n", - "\tinodes in use:", - qup->dqblk.dqb_curinodes, - qup->dqblk.dqb_isoftlimit, - qup->dqblk.dqb_ihardlimit); + fmthumanvalblks(qup->dqblk.dqb_bhardlimit)); + fprintf(fd, "\tinodes in use: %s, ", + fmthumanvalinos(qup->dqblk.dqb_curinodes)); + fprintf(fd, "limits (soft = %s, ", + fmthumanvalinos(qup->dqblk.dqb_isoftlimit)); + fprintf(fd, "hard = %s)\n", + fmthumanvalinos(qup->dqblk.dqb_ihardlimit)); } fclose(fd); return (1); } char * -fmthumanval(int64_t blocks) +fmthumanvalblks(int64_t blocks) { static char numbuf[20]; if (hflag) { - humanize_number(numbuf, sizeof(numbuf) - (blocks < 0 ? 0 : 1), + humanize_number(numbuf, blocks < 0 ? 7 : 6, dbtob(blocks), "", HN_AUTOSCALE, HN_NOSPACE); return (numbuf); } @@ -547,6 +557,20 @@ fmthumanval(int64_t blocks) return(numbuf); } +char * +fmthumanvalinos(int64_t inos) +{ + static char numbuf[20]; + + if (hflag) { + humanize_number(numbuf, inos < 0 ? 7 : 6, + inos, "", HN_AUTOSCALE, HN_NOSPACE | HN_DIVISOR_1000); + return (numbuf); + } + snprintf(numbuf, sizeof(numbuf), "%llu", inos); + return(numbuf); +} + /* * Merge changes to an ASCII file into a quotause list. */ @@ -607,42 +631,48 @@ readprivs(struct quotause *quplist, char warnx("%s:%s: bad format", fsp, cp); return (0); } - dqblk.dqb_curblocks = cvtval(curitems, curitemunits); - dqblk.dqb_bsoftlimit = cvtval(softlimit, softunits); - dqblk.dqb_bhardlimit = cvtval(hardlimit, hardunits); + dqblk.dqb_curblocks = cvtblkval(curitems, curitemunits, + "current block count"); + dqblk.dqb_bsoftlimit = cvtblkval(softlimit, softunits, + "block soft limit"); + dqblk.dqb_bhardlimit = cvtblkval(hardlimit, hardunits, + "block hard limit"); if ((cp = strtok(line2, "\n")) == NULL) { warnx("%s: %s: bad format", fsp, line2); return (0); } - cnt = sscanf(cp, - " in use: %llu%c, limits (soft = %llu%c, hard = %llu%c)", + cnt = sscanf(&cp[7], + " in use: %llu%c limits (soft = %llu%c, hard = %llu%c)", &curitems, &curitemunits, &softlimit, &softunits, &hardlimit, &hardunits); /* * The next three check for old-style input formats. */ if (cnt != 6) - cnt = sscanf(cp, - " in use: %llu%c, limits (soft = %llu%c hard = %llu%c", + cnt = sscanf(&cp[7], + " in use: %llu%c limits (soft = %llu%c hard = %llu%c", &curitems, &curitemunits, &softlimit, &softunits, &hardlimit, &hardunits); if (cnt != 6) - cnt = sscanf(cp, - " in use: %llu%c, limits (soft = %llu%c hard = %llu%c)", + cnt = sscanf(&cp[7], + " in use: %llu%c limits (soft = %llu%c hard = %llu%c)", &curitems, &curitemunits, &softlimit, &softunits, &hardlimit, &hardunits); if (cnt != 6) - cnt = sscanf(cp, - " in use: %llu%c, limits (soft = %llu%c, hard = %llu%c", + cnt = sscanf(&cp[7], + " in use: %llu%c limits (soft = %llu%c, hard = %llu%c", &curitems, &curitemunits, &softlimit, &softunits, &hardlimit, &hardunits); - if (cnt != 3) { - warnx("%s: %s: bad format", fsp, line2); + if (cnt != 6) { + warnx("%s: %s: bad format cnt %d", fsp, &cp[7], cnt); return (0); } - dqblk.dqb_curinodes = cvtval(curitems, curitemunits); - dqblk.dqb_isoftlimit = cvtval(softlimit, softunits); - dqblk.dqb_ihardlimit = cvtval(hardlimit, hardunits); + dqblk.dqb_curinodes = cvtinoval(curitems, curitemunits, + "current inode count"); + dqblk.dqb_isoftlimit = cvtinoval(softlimit, softunits, + "inode soft limit"); + dqblk.dqb_ihardlimit = cvtinoval(hardlimit, hardunits, + "inode hard limit"); for (qup = quplist; qup; qup = qup->next) { if (strcmp(fsp, qup->fsname)) continue; @@ -669,8 +699,10 @@ readprivs(struct quotause *quplist, char qup->dqblk.dqb_isoftlimit = dqblk.dqb_isoftlimit; qup->dqblk.dqb_ihardlimit = dqblk.dqb_ihardlimit; qup->flags |= FOUND; - if (dqblk.dqb_curblocks == qup->dqblk.dqb_curblocks && - dqblk.dqb_curinodes == qup->dqblk.dqb_curinodes) + /* Humanized input returns only approximate counts */ + if (hflag || + (dqblk.dqb_curblocks == qup->dqblk.dqb_curblocks && + dqblk.dqb_curinodes == qup->dqblk.dqb_curinodes)) break; warnx("%s: cannot change current allocation", fsp); break; @@ -836,7 +868,7 @@ cvtatos(u_int64_t period, char *units, u * Convert a limit to number of disk blocks. */ u_int64_t -cvtval(u_int64_t limit, char units) +cvtblkval(u_int64_t limit, char units, const char *itemname) { switch(units) { @@ -872,11 +904,62 @@ cvtval(u_int64_t limit, char units) limit *= btodb(1152921504606846976); break; case ' ': - errx(2, "No space permitted between value and units\n"); + errx(2, "No space permitted between value and units for %s\n", + itemname); + break; + default: + errx(2, "%llu%c: unknown units for %s, specify none, K, M, G, T, P, or E\n", + limit, units, itemname); + break; + } + return (limit); +} + +/* + * Convert a limit to number of inodes. + */ +u_int64_t +cvtinoval(u_int64_t limit, char units, const char *itemname) +{ + + switch(units) { + case 'B': + case 'b': + case '\0': /* historic behavior */ + case ',': /* historic behavior */ + case ')': /* historic behavior */ + break; + case 'K': + case 'k': + limit *= 1000; + break; + case 'M': + case 'm': + limit *= 1000000; + break; + case 'G': + case 'g': + limit *= 1000000000; + break; + case 'T': + case 't': + limit *= 1000000000000; + break; + case 'P': + case 'p': + limit *= 1000000000000000; + break; + case 'E': + case 'e': + limit *= 1000000000000000000; + break; + case ' ': + errx(2, "No space permitted between value and units for %s\n", + itemname); break; default: - errx(2, "%llu%c: unknown units, specify K, M, G, T, P, or E\n", - limit, units); + errx(2, "%llu%c: unknown units for %s, specify none, K, M, G, T, P, or E\n", + limit, units, itemname); break; } return (limit); From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 08:11: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 8F47F106586E; Tue, 10 Feb 2009 08:11:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CA078FC26; Tue, 10 Feb 2009 08:11:44 +0000 (UTC) (envelope-from mckusick@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 n1A8Biwh085660; Tue, 10 Feb 2009 08:11:44 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1A8Bigw085658; Tue, 10 Feb 2009 08:11:44 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <200902100811.n1A8Bigw085658@svn.freebsd.org> From: Kirk McKusick Date: Tue, 10 Feb 2009 08:11: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: r188434 - projects/quota64/lib/libutil 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, 10 Feb 2009 08:11:46 -0000 Author: mckusick Date: Tue Feb 10 08:11:44 2009 New Revision: 188434 URL: http://svn.freebsd.org/changeset/base/188434 Log: Bug fixes found from using these functions in edquota. Modified: projects/quota64/lib/libutil/quotafile.3 projects/quota64/lib/libutil/quotafile.c Modified: projects/quota64/lib/libutil/quotafile.3 ============================================================================== --- projects/quota64/lib/libutil/quotafile.3 Tue Feb 10 08:10:57 2009 (r188433) +++ projects/quota64/lib/libutil/quotafile.3 Tue Feb 10 08:11:44 2009 (r188434) @@ -45,9 +45,9 @@ .Ft "struct quotafile *" .Fn quota_create "const char *path" .Ft int -.Fn quota_read "struct quotafile *qf" "struct dqblk *dqb" "int type" +.Fn quota_read "struct quotafile *qf" "struct dqblk *dqb" "int id" .Ft int -.Fn quota_write "struct quotafile *qf" "const struct dqblk *dqb" "int type" +.Fn quota_write "struct quotafile *qf" "const struct dqblk *dqb" "int id" .Ft int .Fn quota_close "struct quotafile *qf" .Sh DESCRIPTION Modified: projects/quota64/lib/libutil/quotafile.c ============================================================================== --- projects/quota64/lib/libutil/quotafile.c Tue Feb 10 08:10:57 2009 (r188433) +++ projects/quota64/lib/libutil/quotafile.c Tue Feb 10 08:11:44 2009 (r188434) @@ -231,7 +231,7 @@ quota_write32(struct quotafile *qf, cons off = id * sizeof(struct dqblk32); if (lseek(qf->fd, off, SEEK_SET) == -1) return (-1); - return (write(qf->fd, &dqb32, sizeof(dqb32))); + return (write(qf->fd, &dqb32, sizeof(dqb32)) == -1); } static int @@ -252,7 +252,7 @@ quota_write64(struct quotafile *qf, cons off = sizeof(struct dqhdr64) + id * sizeof(struct dqblk64); if (lseek(qf->fd, off, SEEK_SET) == -1) return (-1); - return (write(qf->fd, &dqb64, sizeof(dqb64))); + return (write(qf->fd, &dqb64, sizeof(dqb64)) == -1); } int From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 19:37: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 00079106566B; Tue, 10 Feb 2009 19:37:38 +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 E00E18FC27; Tue, 10 Feb 2009 19:37:38 +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 n1AJbcOU002394; Tue, 10 Feb 2009 19:37:38 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1AJbcKb002392; Tue, 10 Feb 2009 19:37:38 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902101937.n1AJbcKb002392@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 19:37:38 +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: r188448 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 10 Feb 2009 19:37:39 -0000 Author: sam Date: Tue Feb 10 19:37:38 2009 New Revision: 188448 URL: http://svn.freebsd.org/changeset/base/188448 Log: merge r188444: consolidate conditional code merge r188445: fix resume when ah_curchan is NULL merge r188446: add hw.ath.bstuck to control the stuck beacon threshold merge r188447: fix keycache leak Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/ath/if_ath.c projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) Modified: projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Tue Feb 10 19:27:50 2009 (r188447) +++ projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Tue Feb 10 19:37:38 2009 (r188448) @@ -278,14 +278,12 @@ ar5212AniControl(struct ath_hal *ah, HAL if (on) { OS_REG_SET_BIT(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); + ahp->ah_stats.ast_ani_ofdmon++; } else { OS_REG_CLR_BIT(ah, AR_PHY_SFCORR_LOW, AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW); - } - if (on) - ahp->ah_stats.ast_ani_ofdmon++; - else ahp->ah_stats.ast_ani_ofdmoff++; + } aniState->ofdmWeakSigDetectOff = !on; break; } Modified: projects/vap7/sys/dev/ath/if_ath.c ============================================================================== --- projects/vap7/sys/dev/ath/if_ath.c Tue Feb 10 19:27:50 2009 (r188447) +++ projects/vap7/sys/dev/ath/if_ath.c Tue Feb 10 19:37:38 2009 (r188448) @@ -283,6 +283,10 @@ SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTL 0, "tx buffers allocated"); TUNABLE_INT("hw.ath.txbuf", &ath_txbuf); +static int ath_bstuck_threshold = 4; /* max missed beacons */ +SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, + 0, "max missed beacon xmits before chip reset"); + #ifdef ATH_DEBUG enum { ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ @@ -1201,7 +1205,9 @@ ath_resume(struct ath_softc *sc) * Must reset the chip before we reload the * keycache as we were powered down on suspend. */ - ath_hal_reset(ah, sc->sc_opmode, sc->sc_curchan, AH_FALSE, &status); + ath_hal_reset(ah, sc->sc_opmode, + sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, + AH_FALSE, &status); ath_reset_keycache(sc); if (sc->sc_resume_up) { if (ic->ic_opmode == IEEE80211_M_STA) { @@ -3116,7 +3122,7 @@ ath_beacon_proc(void *arg, int pending) DPRINTF(sc, ATH_DEBUG_BEACON, "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount > 3) /* NB: 3 is a guess */ + if (sc->sc_bmisscount >= ath_bstuck_threshold) taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); return; } @@ -6087,6 +6093,8 @@ ath_setup_stationkey(struct ieee80211_no /* XXX locking? */ ni->ni_ucastkey.wk_keyix = keyix; ni->ni_ucastkey.wk_rxkeyix = rxkeyix; + /* NB: must mark device key to get called back on delete */ + ni->ni_ucastkey.wk_flags |= IEEE80211_KEY_DEVKEY; IEEE80211_ADDR_COPY(ni->ni_ucastkey.wk_macaddr, ni->ni_macaddr); /* NB: this will create a pass-thru key entry */ ath_keyset(sc, &ni->ni_ucastkey, vap->iv_bss); @@ -7610,7 +7618,7 @@ ath_tdma_beacon_send(struct ath_softc *s DPRINTF(sc, ATH_DEBUG_BEACON, "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); - if (sc->sc_bmisscount > 3) /* NB: 3 is a guess */ + if (sc->sc_bmisscount >= ath_bstuck_threshold) taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); return; } From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 23: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 064A3106566B; Tue, 10 Feb 2009 23:55: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 E5A218FC16; Tue, 10 Feb 2009 23:55:23 +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 n1ANtN3O008125; Tue, 10 Feb 2009 23:55:23 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANtNhh008121; Tue, 10 Feb 2009 23:55:23 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902102355.n1ANtNhh008121@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 23:55: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: r188468 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 10 Feb 2009 23:55:24 -0000 Author: sam Date: Tue Feb 10 23:55:23 2009 New Revision: 188468 URL: http://svn.freebsd.org/changeset/base/188468 Log: merge r188465: don't do phantom beacon miss checking for s/w bmiss handling Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/ath/if_ath.c projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_adhoc.c projects/vap7/sys/net80211/ieee80211_tdma.c Modified: projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c Tue Feb 10 23:52:28 2009 (r188467) +++ projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c Tue Feb 10 23:55:23 2009 (r188468) @@ -786,8 +786,10 @@ static REG_DMN_FREQ_BAND regDmn5GhzFreq[ * 5GHz Turbo (dynamic & static) tags */ static REG_DMN_FREQ_BAND regDmn5GhzTurboFreq[] = { + { 4950, 4980, 30, 6, 40, 40, NO_DFS, PSCAN_FCC }, +#define T1_4950_4980 0 { 5130, 5210, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, -#define T1_5130_5210 0 +#define T1_5130_5210 AFTER(T1_4950_4980) { 5250, 5330, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN }, #define T1_5250_5330 AFTER(T1_5130_5210) { 5370, 5490, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, @@ -1043,7 +1045,8 @@ static REG_DOMAIN regDomains[] = { F3_5120_5240, F3_5260_5700, F8_5745_5825), - .chan11a_turbo = BM8(T1_5130_5210, + .chan11a_turbo = BM9(T1_4950_4980, + T1_5130_5210, T1_5250_5330, T1_5370_5490, T1_5530_5650, Modified: projects/vap7/sys/dev/ath/if_ath.c ============================================================================== --- projects/vap7/sys/dev/ath/if_ath.c Tue Feb 10 23:52:28 2009 (r188467) +++ projects/vap7/sys/dev/ath/if_ath.c Tue Feb 10 23:55:23 2009 (r188468) @@ -1372,29 +1372,34 @@ ath_fatal_proc(void *arg, int pending) static void ath_bmiss_vap(struct ieee80211vap *vap) { - struct ifnet *ifp = vap->iv_ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; - u_int64_t lastrx = sc->sc_lastrx; - u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); - u_int bmisstimeout = - vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024; - - DPRINTF(sc, ATH_DEBUG_BEACON, - "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n", - __func__, (unsigned long long) tsf, - (unsigned long long)(tsf - lastrx), - (unsigned long long) lastrx, bmisstimeout); /* * Workaround phantom bmiss interrupts by sanity-checking * the time of our last rx'd frame. If it is within the * beacon miss interval then ignore the interrupt. If it's * truly a bmiss we'll get another interrupt soon and that'll - * be dispatched up for processing. + * be dispatched up for processing. Note this applies only + * for h/w beacon miss events. */ - if (tsf - lastrx > bmisstimeout) - ATH_VAP(vap)->av_bmiss(vap); - else - sc->sc_stats.ast_bmiss_phantom++; + if ((vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) == 0) { + struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ath_softc *sc = ifp->if_softc; + u_int64_t lastrx = sc->sc_lastrx; + u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); + u_int bmisstimeout = + vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024; + + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n", + __func__, (unsigned long long) tsf, + (unsigned long long)(tsf - lastrx), + (unsigned long long) lastrx, bmisstimeout); + + if (tsf - lastrx <= bmisstimeout) { + sc->sc_stats.ast_bmiss_phantom++; + return; + } + } + ATH_VAP(vap)->av_bmiss(vap); } static int Modified: projects/vap7/sys/net80211/ieee80211_adhoc.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:52:28 2009 (r188467) +++ projects/vap7/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:55:23 2009 (r188468) @@ -110,6 +110,15 @@ adhoc_vattach(struct ieee80211vap *vap) #endif } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * IEEE80211_M_IBSS+IEEE80211_M_AHDEMO vap state machine handler. */ @@ -146,8 +155,11 @@ adhoc_newstate(struct ieee80211vap *vap, break; case IEEE80211_S_SCAN: switch (ostate) { - case IEEE80211_S_INIT: case IEEE80211_S_RUN: /* beacon miss */ + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + /* fall thru... */ + case IEEE80211_S_INIT: if (vap->iv_des_chan != IEEE80211_CHAN_ANYC && !IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan)) { /* Modified: projects/vap7/sys/net80211/ieee80211_tdma.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_tdma.c Tue Feb 10 23:52:28 2009 (r188467) +++ projects/vap7/sys/net80211/ieee80211_tdma.c Tue Feb 10 23:55:23 2009 (r188468) @@ -173,6 +173,15 @@ tdma_vdetach(struct ieee80211vap *vap) setackpolicy(vap->iv_ic, 0); /* enable ACK's */ } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * TDMA state machine handler. */ @@ -180,10 +189,11 @@ static int tdma_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211_tdma_state *ts = vap->iv_tdma; + struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state ostate; int status; - IEEE80211_LOCK_ASSERT(vap->iv_ic); + IEEE80211_LOCK_ASSERT(ic); ostate = vap->iv_state; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", @@ -201,6 +211,11 @@ tdma_newstate(struct ieee80211vap *vap, */ vap->iv_state = nstate; /* state transition */ ieee80211_cancel_scan(vap); /* background scan */ + if (ostate == IEEE80211_S_RUN) { + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + ieee80211_free_node(vap->iv_bss); /* XXX */ + } if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) { ieee80211_check_scan(vap, vap->iv_scanreq_flags, @@ -326,7 +341,6 @@ tdma_recv_mgmt(struct ieee80211_node *ni * Count beacon frame for s/w bmiss handling. */ vap->iv_swbmiss_count++; - vap->iv_bmiss_count = 0; /* * Process tdma ie. The contents are used to sync * the slot timing, reconfigure the bss, etc. From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 23:58: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 1A0E9106566B; Tue, 10 Feb 2009 23:58:01 +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 080E38FC0C; Tue, 10 Feb 2009 23:58:01 +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 n1ANw0Ci008249; Tue, 10 Feb 2009 23:58:00 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANw0Il008246; Tue, 10 Feb 2009 23:58:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902102358.n1ANw0Il008246@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 23:58: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: r188469 - in projects/vap7/sys: dev/ath/ath_hal 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, 10 Feb 2009 23:58:01 -0000 Author: sam Date: Tue Feb 10 23:58:00 2009 New Revision: 188469 URL: http://svn.freebsd.org/changeset/base/188469 Log: revert spammage in r188468 Modified: projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_adhoc.c projects/vap7/sys/net80211/ieee80211_tdma.c Modified: projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c Tue Feb 10 23:55:23 2009 (r188468) +++ projects/vap7/sys/dev/ath/ath_hal/ah_regdomain.c Tue Feb 10 23:58:00 2009 (r188469) @@ -786,10 +786,8 @@ static REG_DMN_FREQ_BAND regDmn5GhzFreq[ * 5GHz Turbo (dynamic & static) tags */ static REG_DMN_FREQ_BAND regDmn5GhzTurboFreq[] = { - { 4950, 4980, 30, 6, 40, 40, NO_DFS, PSCAN_FCC }, -#define T1_4950_4980 0 { 5130, 5210, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, -#define T1_5130_5210 AFTER(T1_4950_4980) +#define T1_5130_5210 0 { 5250, 5330, 5, 6, 40, 40, DFS_FCC3, NO_PSCAN }, #define T1_5250_5330 AFTER(T1_5130_5210) { 5370, 5490, 5, 6, 40, 40, NO_DFS, NO_PSCAN }, @@ -1045,8 +1043,7 @@ static REG_DOMAIN regDomains[] = { F3_5120_5240, F3_5260_5700, F8_5745_5825), - .chan11a_turbo = BM9(T1_4950_4980, - T1_5130_5210, + .chan11a_turbo = BM8(T1_5130_5210, T1_5250_5330, T1_5370_5490, T1_5530_5650, Modified: projects/vap7/sys/net80211/ieee80211_adhoc.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:55:23 2009 (r188468) +++ projects/vap7/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:58:00 2009 (r188469) @@ -110,15 +110,6 @@ adhoc_vattach(struct ieee80211vap *vap) #endif } -static void -sta_leave(void *arg, struct ieee80211_node *ni) -{ - struct ieee80211vap *vap = arg; - - if (ni->ni_vap == vap && ni != vap->iv_bss) - ieee80211_node_leave(ni); -} - /* * IEEE80211_M_IBSS+IEEE80211_M_AHDEMO vap state machine handler. */ @@ -155,11 +146,8 @@ adhoc_newstate(struct ieee80211vap *vap, break; case IEEE80211_S_SCAN: switch (ostate) { - case IEEE80211_S_RUN: /* beacon miss */ - /* purge station table; entries are stale */ - ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); - /* fall thru... */ case IEEE80211_S_INIT: + case IEEE80211_S_RUN: /* beacon miss */ if (vap->iv_des_chan != IEEE80211_CHAN_ANYC && !IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan)) { /* Modified: projects/vap7/sys/net80211/ieee80211_tdma.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_tdma.c Tue Feb 10 23:55:23 2009 (r188468) +++ projects/vap7/sys/net80211/ieee80211_tdma.c Tue Feb 10 23:58:00 2009 (r188469) @@ -173,15 +173,6 @@ tdma_vdetach(struct ieee80211vap *vap) setackpolicy(vap->iv_ic, 0); /* enable ACK's */ } -static void -sta_leave(void *arg, struct ieee80211_node *ni) -{ - struct ieee80211vap *vap = arg; - - if (ni->ni_vap == vap && ni != vap->iv_bss) - ieee80211_node_leave(ni); -} - /* * TDMA state machine handler. */ @@ -189,11 +180,10 @@ static int tdma_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211_tdma_state *ts = vap->iv_tdma; - struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state ostate; int status; - IEEE80211_LOCK_ASSERT(ic); + IEEE80211_LOCK_ASSERT(vap->iv_ic); ostate = vap->iv_state; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", @@ -211,11 +201,6 @@ tdma_newstate(struct ieee80211vap *vap, */ vap->iv_state = nstate; /* state transition */ ieee80211_cancel_scan(vap); /* background scan */ - if (ostate == IEEE80211_S_RUN) { - /* purge station table; entries are stale */ - ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); - ieee80211_free_node(vap->iv_bss); /* XXX */ - } if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) { ieee80211_check_scan(vap, vap->iv_scanreq_flags, @@ -341,6 +326,7 @@ tdma_recv_mgmt(struct ieee80211_node *ni * Count beacon frame for s/w bmiss handling. */ vap->iv_swbmiss_count++; + vap->iv_bmiss_count = 0; /* * Process tdma ie. The contents are used to sync * the slot timing, reconfigure the bss, etc. From owner-svn-src-projects@FreeBSD.ORG Tue Feb 10 23:59: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 BB93C1065703; Tue, 10 Feb 2009 23:59:59 +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 8D6248FC1A; Tue, 10 Feb 2009 23:59:59 +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 n1ANxxOG008344; Tue, 10 Feb 2009 23:59:59 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ANxxxY008343; Tue, 10 Feb 2009 23:59:59 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902102359.n1ANxxxY008343@svn.freebsd.org> From: Sam Leffler Date: Tue, 10 Feb 2009 23:59: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: r188470 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 11 Feb 2009 00:00:00 -0000 Author: sam Date: Tue Feb 10 23:59:59 2009 New Revision: 188470 URL: http://svn.freebsd.org/changeset/base/188470 Log: merge r188466: clean neighbor entries on beacon miss Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_adhoc.c Modified: projects/vap7/sys/net80211/ieee80211_adhoc.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:58:00 2009 (r188469) +++ projects/vap7/sys/net80211/ieee80211_adhoc.c Tue Feb 10 23:59:59 2009 (r188470) @@ -110,6 +110,15 @@ adhoc_vattach(struct ieee80211vap *vap) #endif } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * IEEE80211_M_IBSS+IEEE80211_M_AHDEMO vap state machine handler. */ @@ -146,8 +155,11 @@ adhoc_newstate(struct ieee80211vap *vap, break; case IEEE80211_S_SCAN: switch (ostate) { - case IEEE80211_S_INIT: case IEEE80211_S_RUN: /* beacon miss */ + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + /* fall thru... */ + case IEEE80211_S_INIT: if (vap->iv_des_chan != IEEE80211_CHAN_ANYC && !IEEE80211_IS_CHAN_RADAR(vap->iv_des_chan)) { /* From owner-svn-src-projects@FreeBSD.ORG Wed Feb 11 00:01: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 7ADAB106566B; Wed, 11 Feb 2009 00:01:02 +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 4DB2F8FC1D; Wed, 11 Feb 2009 00:01:02 +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 n1B012YZ008442; Wed, 11 Feb 2009 00:01:02 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1B012DA008441; Wed, 11 Feb 2009 00:01:02 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902110001.n1B012DA008441@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 00:01: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: r188471 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 11 Feb 2009 00:01:03 -0000 Author: sam Date: Wed Feb 11 00:01:02 2009 New Revision: 188471 URL: http://svn.freebsd.org/changeset/base/188471 Log: merge r188467: clear neighbor entries and the peer bss node on beacon miss Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_tdma.c Modified: projects/vap7/sys/net80211/ieee80211_tdma.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_tdma.c Tue Feb 10 23:59:59 2009 (r188470) +++ projects/vap7/sys/net80211/ieee80211_tdma.c Wed Feb 11 00:01:02 2009 (r188471) @@ -173,6 +173,15 @@ tdma_vdetach(struct ieee80211vap *vap) setackpolicy(vap->iv_ic, 0); /* enable ACK's */ } +static void +sta_leave(void *arg, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = arg; + + if (ni->ni_vap == vap && ni != vap->iv_bss) + ieee80211_node_leave(ni); +} + /* * TDMA state machine handler. */ @@ -180,10 +189,11 @@ static int tdma_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct ieee80211_tdma_state *ts = vap->iv_tdma; + struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state ostate; int status; - IEEE80211_LOCK_ASSERT(vap->iv_ic); + IEEE80211_LOCK_ASSERT(ic); ostate = vap->iv_state; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (%d)\n", @@ -201,6 +211,11 @@ tdma_newstate(struct ieee80211vap *vap, */ vap->iv_state = nstate; /* state transition */ ieee80211_cancel_scan(vap); /* background scan */ + if (ostate == IEEE80211_S_RUN) { + /* purge station table; entries are stale */ + ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); + ieee80211_free_node(vap->iv_bss); /* XXX */ + } if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) { ieee80211_check_scan(vap, vap->iv_scanreq_flags, @@ -326,7 +341,6 @@ tdma_recv_mgmt(struct ieee80211_node *ni * Count beacon frame for s/w bmiss handling. */ vap->iv_swbmiss_count++; - vap->iv_bmiss_count = 0; /* * Process tdma ie. The contents are used to sync * the slot timing, reconfigure the bss, etc. From owner-svn-src-projects@FreeBSD.ORG Wed Feb 11 11:20: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 6B09F106564A for ; Wed, 11 Feb 2009 11:20:21 +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 2E0E78FC08 for ; Wed, 11 Feb 2009 11:20:20 +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 3F5566D44C; Wed, 11 Feb 2009 11:05:18 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 17ABF844BA; Wed, 11 Feb 2009 12:05:18 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kirk McKusick References: <200902100811.n1A8Bigw085658@svn.freebsd.org> Date: Wed, 11 Feb 2009 12:05:17 +0100 In-Reply-To: <200902100811.n1A8Bigw085658@svn.freebsd.org> (Kirk McKusick's message of "Tue, 10 Feb 2009 08:11:44 +0000 (UTC)") Message-ID: <86iqnhnsia.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (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 Subject: Re: svn commit: r188434 - projects/quota64/lib/libutil 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, 11 Feb 2009 11:20:21 -0000 Kirk McKusick writes: > @@ -231,7 +231,7 @@ quota_write32(struct quotafile *qf, cons > off =3D id * sizeof(struct dqblk32); > if (lseek(qf->fd, off, SEEK_SET) =3D=3D -1) > return (-1); > - return (write(qf->fd, &dqb32, sizeof(dqb32))); > + return (write(qf->fd, &dqb32, sizeof(dqb32)) =3D=3D -1); > } >=20=20 > static int I would prefer -1 for failure and 0 for success... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-projects@FreeBSD.ORG Wed Feb 11 17:32: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 D8F0E1065676; Wed, 11 Feb 2009 17:32:45 +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 A94608FC13; Wed, 11 Feb 2009 17:32:45 +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 n1BHWj5i031699; Wed, 11 Feb 2009 17:32:45 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BHWjE1031698; Wed, 11 Feb 2009 17:32:45 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111732.n1BHWjE1031698@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 17:32:45 +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: r188490 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 11 Feb 2009 17:32:46 -0000 Author: sam Date: Wed Feb 11 17:32:45 2009 New Revision: 188490 URL: http://svn.freebsd.org/changeset/base/188490 Log: merge r188488: fix mis-numbering of IEEE80211_MSG_BITS Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_var.h Modified: projects/vap7/sys/net80211/ieee80211_var.h ============================================================================== --- projects/vap7/sys/net80211/ieee80211_var.h Wed Feb 11 17:30:36 2009 (r188489) +++ projects/vap7/sys/net80211/ieee80211_var.h Wed Feb 11 17:32:45 2009 (r188490) @@ -720,10 +720,10 @@ ieee80211_htchanflags(const struct ieee8 #define IEEE80211_MSG_ANY 0xffffffff /* anything */ #define IEEE80211_MSG_BITS \ - "\20\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ - "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1X\22POWER" \ - "\23STATE\24OUTPUT\25SCAN\26AUTH\27ASSOC\30NODE\31ELEMID\32XRATE" \ - "\33INPUT\34CRYPTO\35DUPMPKTS\36DEBUG\3711N" + "\20\2TDMA\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ + "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1XSM\22DOT1X" \ + "\23POWER\24STATE\25OUTPUT\26SCAN\27AUTH\30ASSOC\31NODE\32ELEMID" \ + "\33XRATE\34INPUT\35CRYPTO\36DUPMPKTS\37DEBUG\4011N" #ifdef IEEE80211_DEBUG #define ieee80211_msg(_vap, _m) ((_vap)->iv_debug & (_m)) From owner-svn-src-projects@FreeBSD.ORG Wed Feb 11 17:33: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 506F3106566C; Wed, 11 Feb 2009 17:33: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 3CDBA8FC1D; Wed, 11 Feb 2009 17:33: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 n1BHXbNp031786; Wed, 11 Feb 2009 17:33:37 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BHXbLq031785; Wed, 11 Feb 2009 17:33:37 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111733.n1BHXbLq031785@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 17:33: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: r188491 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 11 Feb 2009 17:33:37 -0000 Author: sam Date: Wed Feb 11 17:33:36 2009 New Revision: 188491 URL: http://svn.freebsd.org/changeset/base/188491 Log: merge r188489: emove bogus reference reclaim on the slave-side bss node on beacon miss Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_tdma.c Modified: projects/vap7/sys/net80211/ieee80211_tdma.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_tdma.c Wed Feb 11 17:32:45 2009 (r188490) +++ projects/vap7/sys/net80211/ieee80211_tdma.c Wed Feb 11 17:33:36 2009 (r188491) @@ -214,7 +214,6 @@ tdma_newstate(struct ieee80211vap *vap, if (ostate == IEEE80211_S_RUN) { /* purge station table; entries are stale */ ieee80211_iterate_nodes(&ic->ic_sta, sta_leave, vap); - ieee80211_free_node(vap->iv_bss); /* XXX */ } if (vap->iv_flags_ext & IEEE80211_FEXT_SCANREQ) { ieee80211_check_scan(vap, From owner-svn-src-projects@FreeBSD.ORG Wed Feb 11 18:41: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 817A91065678; Wed, 11 Feb 2009 18:41:48 +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 6E04B8FC0C; Wed, 11 Feb 2009 18:41: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 n1BIfm7Y033275; Wed, 11 Feb 2009 18:41:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1BIfm4v033274; Wed, 11 Feb 2009 18:41:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111841.n1BIfm4v033274@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 18:41: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: r188495 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 11 Feb 2009 18:41:48 -0000 Author: sam Date: Wed Feb 11 18:41:48 2009 New Revision: 188495 URL: http://svn.freebsd.org/changeset/base/188495 Log: merge r188493: fix octal escape sequence Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_var.h Modified: projects/vap7/sys/net80211/ieee80211_var.h ============================================================================== --- projects/vap7/sys/net80211/ieee80211_var.h Wed Feb 11 18:40:09 2009 (r188494) +++ projects/vap7/sys/net80211/ieee80211_var.h Wed Feb 11 18:41:48 2009 (r188495) @@ -723,7 +723,7 @@ ieee80211_htchanflags(const struct ieee8 "\20\2TDMA\3IOCTL\4WDS\5ACTION\6RATECTL\7ROAM\10INACT\11DOTH\12SUPERG" \ "\13WME\14ACL\15WPA\16RADKEYS\17RADDUMP\20RADIUS\21DOT1XSM\22DOT1X" \ "\23POWER\24STATE\25OUTPUT\26SCAN\27AUTH\30ASSOC\31NODE\32ELEMID" \ - "\33XRATE\34INPUT\35CRYPTO\36DUPMPKTS\37DEBUG\4011N" + "\33XRATE\34INPUT\35CRYPTO\36DUPMPKTS\37DEBUG\04011N" #ifdef IEEE80211_DEBUG #define ieee80211_msg(_vap, _m) ((_vap)->iv_debug & (_m)) From owner-svn-src-projects@FreeBSD.ORG Wed Feb 11 18: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 8B10C106566B; Wed, 11 Feb 2009 18: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 5D6E38FC1B; Wed, 11 Feb 2009 18: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 n1BIguu1033342; Wed, 11 Feb 2009 18: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 n1BIgu3R033341; Wed, 11 Feb 2009 18:42:56 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902111842.n1BIgu3R033341@svn.freebsd.org> From: Sam Leffler Date: Wed, 11 Feb 2009 18: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: r188496 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 11 Feb 2009 18:42:56 -0000 Author: sam Date: Wed Feb 11 18:42:56 2009 New Revision: 188496 URL: http://svn.freebsd.org/changeset/base/188496 Log: merge r188494: improve key index map reclaim debug msg Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_node.c Modified: projects/vap7/sys/net80211/ieee80211_node.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_node.c Wed Feb 11 18:41:48 2009 (r188495) +++ projects/vap7/sys/net80211/ieee80211_node.c Wed Feb 11 18:42:56 2009 (r188496) @@ -1719,8 +1719,8 @@ node_reclaim(struct ieee80211_node_table if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax && nt->nt_keyixmap[keyix] == ni) { IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry\n", - __func__, ni, ether_sprintf(ni->ni_macaddr)); + "%s: %p<%s> clear key map entry %u\n", + __func__, ni, ether_sprintf(ni->ni_macaddr), keyix); nt->nt_keyixmap[keyix] = NULL; ieee80211_node_decref(ni); /* NB: don't need free */ } @@ -1763,8 +1763,7 @@ ieee80211_node_reclaim(struct ieee80211_ */ _ieee80211_free_node(ni); nt = NULL; - } else if (ieee80211_node_refcnt(ni) == 1 && - nt->nt_keyixmap != NULL) { + } else if (ieee80211_node_refcnt(ni) == 1 && nt->nt_keyixmap != NULL) { ieee80211_keyix keyix; /* * Check for a last reference in the key mapping table. @@ -1774,8 +1773,8 @@ ieee80211_node_reclaim(struct ieee80211_ nt->nt_keyixmap[keyix] == ni) { IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry", __func__, - ni, ether_sprintf(ni->ni_macaddr)); + "%s: %p<%s> clear key map entry %u", __func__, + ni, ether_sprintf(ni->ni_macaddr), keyix); nt->nt_keyixmap[keyix] = NULL; ieee80211_node_decref(ni); /* XXX needed? */ _ieee80211_free_node(ni); From owner-svn-src-projects@FreeBSD.ORG Thu Feb 12 21:50: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 153C110656C4; Thu, 12 Feb 2009 21:50: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 01E298FC16; Thu, 12 Feb 2009 21:50: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 n1CLnxrT067853; Thu, 12 Feb 2009 21:49:59 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CLnxAh067852; Thu, 12 Feb 2009 21:49:59 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902122149.n1CLnxAh067852@svn.freebsd.org> From: Sam Leffler Date: Thu, 12 Feb 2009 21:49: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: r188538 - projects/vap7/sys/arm/arm 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, 12 Feb 2009 21:50:00 -0000 Author: sam Date: Thu Feb 12 21:49:59 2009 New Revision: 188538 URL: http://svn.freebsd.org/changeset/base/188538 Log: merge r188420: correct cache line invalidation for bounce buffer Modified: projects/vap7/sys/arm/arm/busdma_machdep.c Modified: projects/vap7/sys/arm/arm/busdma_machdep.c ============================================================================== --- projects/vap7/sys/arm/arm/busdma_machdep.c Thu Feb 12 21:01:16 2009 (r188537) +++ projects/vap7/sys/arm/arm/busdma_machdep.c Thu Feb 12 21:49:59 2009 (r188538) @@ -1165,7 +1165,7 @@ _bus_dma_buf_is_in_bp(bus_dmamap_t map, STAILQ_FOREACH(bpage, &map->bpages, links) { if ((vm_offset_t)buf >= bpage->datavaddr && - (vm_offset_t)buf + len < bpage->datavaddr + + (vm_offset_t)buf + len <= bpage->datavaddr + bpage->datacount) return (1); } From owner-svn-src-projects@FreeBSD.ORG Thu Feb 12 23:44: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 BDFD6106566B; Thu, 12 Feb 2009 23:44:59 +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 A15208FC13; Thu, 12 Feb 2009 23:44:59 +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 n1CNixnG070146; Thu, 12 Feb 2009 23:44:59 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CNixUS070143; Thu, 12 Feb 2009 23:44:59 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902122344.n1CNixUS070143@svn.freebsd.org> From: Sam Leffler Date: Thu, 12 Feb 2009 23:44: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: r188542 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 12 Feb 2009 23:45:00 -0000 Author: sam Date: Thu Feb 12 23:44:59 2009 New Revision: 188542 URL: http://svn.freebsd.org/changeset/base/188542 Log: merge r180140+r182862: add support to set the bridge MAC address to the MAC address of the first interface (conditional on net.link.bridge.inherit_mac) Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/ath/if_ath.c projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net/if_bridge.c Modified: projects/vap7/sys/dev/ath/if_ath.c ============================================================================== --- projects/vap7/sys/dev/ath/if_ath.c Thu Feb 12 23:34:58 2009 (r188541) +++ projects/vap7/sys/dev/ath/if_ath.c Thu Feb 12 23:44:59 2009 (r188542) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_ath.h" +#include "opt_wlan.h" #include #include Modified: projects/vap7/sys/net/if_bridge.c ============================================================================== --- projects/vap7/sys/net/if_bridge.c Thu Feb 12 23:34:58 2009 (r188541) +++ projects/vap7/sys/net/if_bridge.c Thu Feb 12 23:44:59 2009 (r188542) @@ -220,6 +220,7 @@ struct bridge_softc { LIST_HEAD(, bridge_iflist) sc_spanlist; /* span ports list */ struct bstp_state sc_stp; /* STP state */ uint32_t sc_brtexceeded; /* # of cache drops */ + u_char sc_defaddr[6]; /* Default MAC address */ }; static struct mtx bridge_list_mtx; @@ -349,6 +350,7 @@ static int pfil_ipfw_arp = 0; /* layer static int pfil_local_phys = 0; /* run pfil hooks on the physical interface for locally destined packets */ static int log_stp = 0; /* log STP state changes */ +static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW, &pfil_onlyip, 0, "Only pass IP packets when pfil is enabled"); SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW, @@ -362,6 +364,9 @@ SYSCTL_INT(_net_link_bridge, OID_AUTO, p "Packet filter on the physical interface for locally destined packets"); SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW, &log_stp, 0, "Log STP state changes"); +SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, + &bridge_inherit_mac, 0, + "Inherit MAC address from the first bridge member"); struct bridge_control { int (*bc_func)(struct bridge_softc *, void *); @@ -552,7 +557,6 @@ bridge_clone_create(struct if_clone *ifc { struct bridge_softc *sc, *sc2; struct ifnet *bifp, *ifp; - u_char eaddr[6]; int retry; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); @@ -594,21 +598,22 @@ bridge_clone_create(struct if_clone *ifc * this hardware address isn't already in use on another bridge. */ for (retry = 1; retry != 0;) { - arc4rand(eaddr, ETHER_ADDR_LEN, 1); - eaddr[0] &= ~1; /* clear multicast bit */ - eaddr[0] |= 2; /* set the LAA bit */ + arc4rand(sc->sc_defaddr, ETHER_ADDR_LEN, 1); + sc->sc_defaddr[0] &= ~1; /* clear multicast bit */ + sc->sc_defaddr[0] |= 2; /* set the LAA bit */ retry = 0; mtx_lock(&bridge_list_mtx); LIST_FOREACH(sc2, &bridge_list, sc_list) { bifp = sc2->sc_ifp; - if (memcmp(eaddr, IF_LLADDR(bifp), ETHER_ADDR_LEN) == 0) + if (memcmp(sc->sc_defaddr, + IF_LLADDR(bifp), ETHER_ADDR_LEN) == 0) retry = 1; } mtx_unlock(&bridge_list_mtx); } bstp_attach(&sc->sc_stp, &bridge_ops); - ether_ifattach(ifp, eaddr); + ether_ifattach(ifp, sc->sc_defaddr); /* Now undo some of the damage... */ ifp->if_baudrate = 0; ifp->if_type = IFT_BRIDGE; @@ -880,6 +885,7 @@ bridge_delete_member(struct bridge_softc int gone) { struct ifnet *ifs = bif->bif_ifp; + struct ifnet *fif = NULL; BRIDGE_LOCK_ASSERT(sc); @@ -914,6 +920,24 @@ bridge_delete_member(struct bridge_softc LIST_REMOVE(bif, bif_next); BRIDGE_XDROP(sc); + /* + * If removing the interface that gave the bridge its mac address, set + * the mac address of the bridge to the address of the next member, or + * to its default address if no members are left. + */ + if (bridge_inherit_mac && + !memcmp(IF_LLADDR(sc->sc_ifp), IF_LLADDR(ifs), ETHER_ADDR_LEN)) { + if (LIST_EMPTY(&sc->sc_iflist)) + bcopy(sc->sc_defaddr, + IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + else { + fif = LIST_FIRST(&sc->sc_iflist)->bif_ifp; + bcopy(IF_LLADDR(fif), + IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + } + } + + bridge_mutecaps(sc); /* recalcuate now this interface is removed */ bridge_rtdelete(sc, ifs, IFBF_FLUSHALL); KASSERT(bif->bif_addrcnt == 0, @@ -1005,6 +1029,15 @@ bridge_ioctl_add(struct bridge_softc *sc goto out; } + /* + * Assign the interface's MAC address to the bridge if it's the first + * member and the MAC address of the bridge has not been changed from + * the default randomly generated one. + */ + if (bridge_inherit_mac && LIST_EMPTY(&sc->sc_iflist) && + !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) + bcopy(IF_LLADDR(ifs), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + ifs->if_bridge = sc; bstp_create(&sc->sc_stp, &bif->bif_stp, bif->bif_ifp); /* From owner-svn-src-projects@FreeBSD.ORG Thu Feb 12 23:45: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 AE7DA106566C; Thu, 12 Feb 2009 23:45: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 9B0328FC1C; Thu, 12 Feb 2009 23:45: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 n1CNjwGZ070219; Thu, 12 Feb 2009 23:45:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CNjwfY070218; Thu, 12 Feb 2009 23:45:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902122345.n1CNjwfY070218@svn.freebsd.org> From: Sam Leffler Date: Thu, 12 Feb 2009 23:45: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: r188543 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 12 Feb 2009 23:45:59 -0000 Author: sam Date: Thu Feb 12 23:45:58 2009 New Revision: 188543 URL: http://svn.freebsd.org/changeset/base/188543 Log: merge r188541: replace ieee80211_node_reclaim by individual operations Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_node.c Modified: projects/vap7/sys/net80211/ieee80211_node.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_node.c Thu Feb 12 23:44:59 2009 (r188542) +++ projects/vap7/sys/net80211/ieee80211_node.c Thu Feb 12 23:45:58 2009 (r188543) @@ -87,7 +87,6 @@ static void ieee80211_node_table_init(st int inact, int keymaxix); static void ieee80211_node_table_reset(struct ieee80211_node_table *, struct ieee80211vap *); -static void ieee80211_node_reclaim(struct ieee80211_node *); static void ieee80211_node_table_cleanup(struct ieee80211_node_table *nt); static void ieee80211_erp_timeout(struct ieee80211com *); @@ -674,7 +673,8 @@ ieee80211_sta_join1(struct ieee80211_nod vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */ if (obss != NULL) { copy_bss(selbs, obss); - ieee80211_node_reclaim(obss); + ieee80211_node_decref(obss); /* iv_bss reference */ + ieee80211_free_node(obss); /* station table reference */ obss = NULL; /* NB: guard against later use */ } @@ -1739,64 +1739,6 @@ node_reclaim(struct ieee80211_node_table } /* - * Reclaim a (bss) node. Decrement the refcnt and reclaim - * the node if the only other reference to it is in the sta - * table. This is effectively ieee80211_free_node followed - * by node_reclaim when the refcnt is 1 (after the free). - */ -static void -ieee80211_node_reclaim(struct ieee80211_node *ni) -{ - struct ieee80211_node_table *nt = ni->ni_table; - - KASSERT(nt != NULL, ("reclaim node not in table")); - -#ifdef IEEE80211_DEBUG_REFCNT - IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, - "%s %p<%s> refcnt %d\n", __func__, ni, - ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)-1); -#endif - IEEE80211_NODE_LOCK(nt); - if (ieee80211_node_dectestref(ni)) { - /* - * Last reference, reclaim state. - */ - _ieee80211_free_node(ni); - nt = NULL; - } else if (ieee80211_node_refcnt(ni) == 1 && nt->nt_keyixmap != NULL) { - ieee80211_keyix keyix; - /* - * Check for a last reference in the key mapping table. - */ - keyix = ni->ni_ucastkey.wk_rxkeyix; - if (keyix < nt->nt_keyixmax && - nt->nt_keyixmap[keyix] == ni) { - IEEE80211_DPRINTF(ni->ni_vap, - IEEE80211_MSG_NODE, - "%s: %p<%s> clear key map entry %u", __func__, - ni, ether_sprintf(ni->ni_macaddr), keyix); - nt->nt_keyixmap[keyix] = NULL; - ieee80211_node_decref(ni); /* XXX needed? */ - _ieee80211_free_node(ni); - nt = NULL; - } - } - if (nt != NULL && ieee80211_node_refcnt(ni) == 1) { - /* - * Last reference is in the sta table; complete - * the reclaim. This handles bss nodes being - * recycled: the node has two references, one for - * iv_bss and one for the table. After dropping - * the iv_bss ref above we need to reclaim the sta - * table reference. - */ - ieee80211_node_decref(ni); /* NB: be pendantic */ - _ieee80211_free_node(ni); - } - IEEE80211_NODE_UNLOCK(nt); -} - -/* * Node table support. */ From owner-svn-src-projects@FreeBSD.ORG Thu Feb 12 23:54: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 50E7B106564A; Thu, 12 Feb 2009 23:54:08 +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 3EDA78FC12; Thu, 12 Feb 2009 23:54:08 +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 n1CNs8W3070422; Thu, 12 Feb 2009 23:54:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1CNs8UG070420; Thu, 12 Feb 2009 23:54:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902122354.n1CNs8UG070420@svn.freebsd.org> From: Sam Leffler Date: Thu, 12 Feb 2009 23:54: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: r188544 - in projects/vap7/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5312 ath_hal/ar5416 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, 12 Feb 2009 23:54:08 -0000 Author: sam Date: Thu Feb 12 23:54:07 2009 New Revision: 188544 URL: http://svn.freebsd.org/changeset/base/188544 Log: backout unintentional part of 188542 Modified: projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/ath/if_ath.c Modified: projects/vap7/sys/dev/ath/if_ath.c ============================================================================== --- projects/vap7/sys/dev/ath/if_ath.c Thu Feb 12 23:45:58 2009 (r188543) +++ projects/vap7/sys/dev/ath/if_ath.c Thu Feb 12 23:54:07 2009 (r188544) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_ath.h" -#include "opt_wlan.h" #include #include From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 05:48:18 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 B1271106564A; Fri, 13 Feb 2009 05:48:18 +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 9D9EE8FC08; Fri, 13 Feb 2009 05:48:18 +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 n1D5mIBf077852; Fri, 13 Feb 2009 05:48:18 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5mIAR077851; Fri, 13 Feb 2009 05:48:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130548.n1D5mIAR077851@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:48: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: r188561 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 13 Feb 2009 05:48:18 -0000 Author: sam Date: Fri Feb 13 05:48:18 2009 New Revision: 188561 URL: http://svn.freebsd.org/changeset/base/188561 Log: merge r188554: strip M_FRAG & co mbufs coming down from ip_output Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211_freebsd.h Modified: projects/vap7/sys/net80211/ieee80211_freebsd.h ============================================================================== --- projects/vap7/sys/net80211/ieee80211_freebsd.h Fri Feb 13 05:45:23 2009 (r188560) +++ projects/vap7/sys/net80211/ieee80211_freebsd.h Fri Feb 13 05:48:18 2009 (r188561) @@ -221,7 +221,8 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ #define M_80211_TX \ - (M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) + (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|\ + M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) /* rx path usage */ #define M_AMPDU M_PROTO1 /* A-MPDU subframe */ From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 05:49: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 4F72F1065673; Fri, 13 Feb 2009 05:49:04 +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 217818FC0A; Fri, 13 Feb 2009 05:49:04 +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 n1D5n4ul077929; Fri, 13 Feb 2009 05:49:04 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5n317077926; Fri, 13 Feb 2009 05:49:03 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130549.n1D5n317077926@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:49: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: r188562 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 13 Feb 2009 05:49:04 -0000 Author: sam Date: Fri Feb 13 05:49:03 2009 New Revision: 188562 URL: http://svn.freebsd.org/changeset/base/188562 Log: merge r188555: dd driver stat to count tx drops due to insufficient frag buffers Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/ath/if_ath.c projects/vap7/sys/dev/ath/if_athioctl.h projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) Modified: projects/vap7/sys/dev/ath/if_ath.c ============================================================================== --- projects/vap7/sys/dev/ath/if_ath.c Fri Feb 13 05:48:18 2009 (r188561) +++ projects/vap7/sys/dev/ath/if_ath.c Fri Feb 13 05:49:03 2009 (r188562) @@ -2071,7 +2071,6 @@ static void ath_start(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; - struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_node *ni; struct ath_buf *bf; struct mbuf *m, *next; @@ -2141,7 +2140,7 @@ ath_start(struct ifnet *ifp) !ath_txfrag_setup(sc, &frags, m, ni)) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); - ic->ic_stats.is_tx_nobuf++; /* XXX */ + sc->sc_stats.ast_tx_nofrag++; ath_freetx(m); goto bad; } Modified: projects/vap7/sys/dev/ath/if_athioctl.h ============================================================================== --- projects/vap7/sys/dev/ath/if_athioctl.h Fri Feb 13 05:48:18 2009 (r188561) +++ projects/vap7/sys/dev/ath/if_athioctl.h Fri Feb 13 05:49:03 2009 (r188562) @@ -117,7 +117,8 @@ struct ath_stats { u_int16_t ast_tdma_tsfadjm;/* TDMA slot adjust- (usec, smoothed)*/ u_int32_t ast_tdma_ack; /* TDMA tx failed 'cuz ACK required */ u_int32_t ast_tx_raw_fail;/* raw tx failed 'cuz h/w down */ - u_int32_t ast_pad[15]; + u_int32_t ast_tx_nofrag; /* tx dropped 'cuz no ath frag buffer */ + u_int32_t ast_pad[14]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 05:49: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 27785106566B; Fri, 13 Feb 2009 05:49: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 0AFF18FC0A; Fri, 13 Feb 2009 05:49: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 n1D5ngMf077988; Fri, 13 Feb 2009 05:49:42 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5ngu4077985; Fri, 13 Feb 2009 05:49:42 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130549.n1D5ngu4077985@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:49: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: r188563 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 13 Feb 2009 05:49:43 -0000 Author: sam Date: Fri Feb 13 05:49:42 2009 New Revision: 188563 URL: http://svn.freebsd.org/changeset/base/188563 Log: merge r188556: remove ic_stats Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) projects/vap7/sys/net80211/ieee80211.c projects/vap7/sys/net80211/ieee80211_ddb.c projects/vap7/sys/net80211/ieee80211_var.h Modified: projects/vap7/sys/net80211/ieee80211.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211.c Fri Feb 13 05:49:03 2009 (r188562) +++ projects/vap7/sys/net80211/ieee80211.c Fri Feb 13 05:49:42 2009 (r188563) @@ -533,7 +533,6 @@ ieee80211_vap_detach(struct ieee80211vap */ ieee80211_stop_locked(vap); - /* XXX accumulate iv_stats in ic_stats? */ TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); ieee80211_syncflag_locked(ic, IEEE80211_F_WME); ieee80211_syncflag_locked(ic, IEEE80211_F_TURBOP); Modified: projects/vap7/sys/net80211/ieee80211_ddb.c ============================================================================== --- projects/vap7/sys/net80211/ieee80211_ddb.c Fri Feb 13 05:49:03 2009 (r188562) +++ projects/vap7/sys/net80211/ieee80211_ddb.c Fri Feb 13 05:49:42 2009 (r188563) @@ -432,7 +432,6 @@ _db_show_com(const struct ieee80211com * db_printf("\tifp %p", ic->ic_ifp); db_printf(" comlock %p", &ic->ic_comlock); db_printf("\n"); - _db_show_stats(&ic->ic_stats); db_printf("\theadroom %d", ic->ic_headroom); db_printf(" phytype %d", ic->ic_phytype); db_printf(" opmode %s", ieee80211_opmode_name[ic->ic_opmode]); Modified: projects/vap7/sys/net80211/ieee80211_var.h ============================================================================== --- projects/vap7/sys/net80211/ieee80211_var.h Fri Feb 13 05:49:03 2009 (r188562) +++ projects/vap7/sys/net80211/ieee80211_var.h Fri Feb 13 05:49:42 2009 (r188563) @@ -111,7 +111,6 @@ struct ieee80211com { struct ifnet *ic_ifp; /* associated device */ ieee80211_com_lock_t ic_comlock; /* state update lock */ TAILQ_HEAD(, ieee80211vap) ic_vaps; /* list of vap instances */ - struct ieee80211_stats ic_stats; /* statistics */ int ic_headroom; /* driver tx headroom needs */ enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */ enum ieee80211_opmode ic_opmode; /* operation mode */ From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 05:50: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 439BB106566C; Fri, 13 Feb 2009 05:50: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 15D738FC15; Fri, 13 Feb 2009 05:50: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 n1D5oIwr078058; Fri, 13 Feb 2009 05:50:18 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5oIam078055; Fri, 13 Feb 2009 05:50:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130550.n1D5oIam078055@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:50: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: r188564 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 13 Feb 2009 05:50:19 -0000 Author: sam Date: Fri Feb 13 05:50:18 2009 New Revision: 188564 URL: http://svn.freebsd.org/changeset/base/188564 Log: merge r188557: add SIOCZATHSTATS ioctl to zero driver statistics Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/ath/if_ath.c projects/vap7/sys/dev/ath/if_athioctl.h projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net80211/ (props changed) Modified: projects/vap7/sys/dev/ath/if_ath.c ============================================================================== --- projects/vap7/sys/dev/ath/if_ath.c Fri Feb 13 05:49:42 2009 (r188563) +++ projects/vap7/sys/dev/ath/if_ath.c Fri Feb 13 05:50:18 2009 (r188564) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -6583,6 +6584,11 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC; return copyout(&sc->sc_stats, ifr->ifr_data, sizeof (sc->sc_stats)); + case SIOCZATHSTATS: + error = priv_check(curthread, PRIV_DRIVER); + if (error == 0) + memset(&sc->sc_stats, 0, sizeof(sc->sc_stats)); + break; #ifdef ATH_DIAGAPI case SIOCGATHDIAG: error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); Modified: projects/vap7/sys/dev/ath/if_athioctl.h ============================================================================== --- projects/vap7/sys/dev/ath/if_athioctl.h Fri Feb 13 05:49:42 2009 (r188563) +++ projects/vap7/sys/dev/ath/if_athioctl.h Fri Feb 13 05:50:18 2009 (r188564) @@ -122,6 +122,7 @@ struct ath_stats { }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) +#define SIOCZATHSTATS _IOWR('i', 139, struct ifreq) struct ath_diag { char ad_name[IFNAMSIZ]; /* if name, e.g. "ath0" */ From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 05:51: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 74A89106564A; Fri, 13 Feb 2009 05:51:36 +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 6295E8FC12; Fri, 13 Feb 2009 05:51:36 +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 n1D5pasP078128; Fri, 13 Feb 2009 05:51:36 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5paPp078125; Fri, 13 Feb 2009 05:51:36 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130551.n1D5paPp078125@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:51: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: r188565 - in projects/vap7/tools/tools/ath: . athstats 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, 13 Feb 2009 05:51:36 -0000 Author: sam Date: Fri Feb 13 05:51:36 2009 New Revision: 188565 URL: http://svn.freebsd.org/changeset/base/188565 Log: merge r188558: backout r188327, it broke summary printing Modified: projects/vap7/tools/tools/ath/ (props changed) projects/vap7/tools/tools/ath/athstats/Makefile projects/vap7/tools/tools/ath/athstats/athstats.c projects/vap7/tools/tools/ath/athstats/statfoo.c Modified: projects/vap7/tools/tools/ath/athstats/Makefile ============================================================================== --- projects/vap7/tools/tools/ath/athstats/Makefile Fri Feb 13 05:50:18 2009 (r188564) +++ projects/vap7/tools/tools/ath/athstats/Makefile Fri Feb 13 05:51:36 2009 (r188565) @@ -4,9 +4,6 @@ PROG= athstats SRCS= main.c statfoo.c athstats.c -DPADD= ${LIBUTIL} -LDADD= -lutil - .include SRCDIR= ${.CURDIR}/../../../.. Modified: projects/vap7/tools/tools/ath/athstats/athstats.c ============================================================================== --- projects/vap7/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:50:18 2009 (r188564) +++ projects/vap7/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:51:36 2009 (r188565) @@ -46,7 +46,6 @@ #include #include #include -#include #include "ah.h" #include "ah_desc.h" @@ -68,15 +67,15 @@ static const struct fmt athstats[] = { #define S_INPUT 0 - { 7, "input", "input", "data frames received" }, + { 8, "input", "input", "data frames received" }, #define S_OUTPUT AFTER(S_INPUT) - { 7, "output", "output", "data frames transmit" }, + { 8, "output", "output", "data frames transmit" }, #define S_TX_ALTRATE AFTER(S_OUTPUT) { 7, "altrate", "altrate", "tx frames with an alternate rate" }, #define S_TX_SHORTRETRY AFTER(S_TX_ALTRATE) - { 6, "short", "short", "short on-chip tx retries" }, + { 7, "short", "short", "short on-chip tx retries" }, #define S_TX_LONGRETRY AFTER(S_TX_SHORTRETRY) - { 6, "long", "long", "long on-chip tx retries" }, + { 7, "long", "long", "long on-chip tx retries" }, #define S_TX_XRETRIES AFTER(S_TX_LONGRETRY) { 6, "xretry", "xretry", "tx failed 'cuz too many retries" }, #define S_MIB AFTER(S_TX_XRETRIES) @@ -202,7 +201,7 @@ static const struct fmt athstats[] = { #define S_BE_NOMBUF AFTER(S_RX_PHY_CCK_RESTART) { 4, "benombuf", "benombuf", "beacon setup failed 'cuz no mbuf" }, #define S_BE_XMIT AFTER(S_BE_NOMBUF) - { 6, "bexmit", "bexmit", "beacons transmitted" }, + { 7, "bexmit", "bexmit", "beacons transmitted" }, #define S_PER_CAL AFTER(S_BE_XMIT) { 4, "pcal", "pcal", "periodic calibrations" }, #define S_PER_CALFAIL AFTER(S_PER_CAL) @@ -211,13 +210,13 @@ static const struct fmt athstats[] = { { 4, "prfga", "prfga", "rfgain value change" }, #if ATH_SUPPORT_TDMA #define S_TDMA_UPDATE AFTER(S_PER_RFGAIN) - { 6, "tdmau", "tdmau", "TDMA slot timing updates" }, + { 5, "tdmau", "tdmau", "TDMA slot timing updates" }, #define S_TDMA_TIMERS AFTER(S_TDMA_UPDATE) - { 6, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, + { 5, "tdmab", "tdmab", "TDMA slot update set beacon timers" }, #define S_TDMA_TSF AFTER(S_TDMA_TIMERS) - { 6, "tdmat", "tdmat", "TDMA slot update set TSF" }, + { 5, "tdmat", "tdmat", "TDMA slot update set TSF" }, #define S_TDMA_TSFADJ AFTER(S_TDMA_TSF) - { 6, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, + { 8, "tdmadj", "tdmadj", "TDMA slot adjust (usecs, smoothed)" }, #define S_TDMA_ACK AFTER(S_TDMA_TSFADJ) { 5, "tdmack", "tdmack", "TDMA tx failed 'cuz ACK required" }, #define S_RATE_CALLS AFTER(S_TDMA_ACK) @@ -307,9 +306,9 @@ static const struct fmt athstats[] = { #define S_ANI_STEPDOWN AFTER(S_ANI_STEPUP) { 5, "step-","STEP-", "ANI decreased first step level" }, #define S_ANI_OFDMERRS AFTER(S_ANI_STEPDOWN) - { 7, "ofdm", "OFDM", "cumulative OFDM phy error count" }, + { 8, "ofdm", "OFDM", "cumulative OFDM phy error count" }, #define S_ANI_CCKERRS AFTER(S_ANI_OFDMERRS) - { 7, "cck", "CCK", "cumulative CCK phy error count" }, + { 8, "cck", "CCK", "cumulative CCK phy error count" }, #define S_ANI_RESET AFTER(S_ANI_CCKERRS) { 5, "reset","RESET", "ANI parameters zero'd for non-STA operation" }, #define S_ANI_LZERO AFTER(S_ANI_RESET) @@ -317,15 +316,15 @@ static const struct fmt athstats[] = { #define S_ANI_LNEG AFTER(S_ANI_LZERO) { 5, "lneg", "LNEG", "ANI calculated listen time < 0" }, #define S_MIB_ACKBAD AFTER(S_ANI_LNEG) - { 7, "ackbad","ACKBAD", "missing ACK's" }, + { 5, "ackbad","ACKBAD", "missing ACK's" }, #define S_MIB_RTSBAD AFTER(S_MIB_ACKBAD) - { 7, "rtsbad","RTSBAD", "RTS without CTS" }, + { 5, "rtsbad","RTSBAD", "RTS without CTS" }, #define S_MIB_RTSGOOD AFTER(S_MIB_RTSBAD) - { 7, "rtsgood","RTSGOOD", "successful RTS" }, + { 5, "rtsgood","RTSGOOD", "successful RTS" }, #define S_MIB_FCSBAD AFTER(S_MIB_RTSGOOD) - { 7, "fcsbad","FCSBAD", "bad FCS" }, + { 5, "fcsbad","FCSBAD", "bad FCS" }, #define S_MIB_BEACONS AFTER(S_MIB_FCSBAD) - { 7, "beacons","beacons", "beacons received" }, + { 5, "beacons","beacons", "beacons received" }, #define S_NODE_AVGBRSSI AFTER(S_MIB_BEACONS) { 3, "avgbrssi","BSI", "average rssi (beacons only)" }, #define S_NODE_AVGRSSI AFTER(S_NODE_AVGBRSSI) @@ -336,37 +335,37 @@ static const struct fmt athstats[] = { #else #define S_ANT_TX0 AFTER(S_ANT_TXSWITCH) #endif /* ATH_SUPPORT_ANI */ - { 7, "tx0", "ant0(tx)", "frames tx on antenna 0" }, + { 8, "tx0", "ant0(tx)", "frames tx on antenna 0" }, #define S_ANT_TX1 AFTER(S_ANT_TX0) - { 7, "tx1", "ant1(tx)", "frames tx on antenna 1" }, + { 8, "tx1", "ant1(tx)", "frames tx on antenna 1" }, #define S_ANT_TX2 AFTER(S_ANT_TX1) - { 7, "tx2", "ant2(tx)", "frames tx on antenna 2" }, + { 8, "tx2", "ant2(tx)", "frames tx on antenna 2" }, #define S_ANT_TX3 AFTER(S_ANT_TX2) - { 7, "tx3", "ant3(tx)", "frames tx on antenna 3" }, + { 8, "tx3", "ant3(tx)", "frames tx on antenna 3" }, #define S_ANT_TX4 AFTER(S_ANT_TX3) - { 7, "tx4", "ant4(tx)", "frames tx on antenna 4" }, + { 8, "tx4", "ant4(tx)", "frames tx on antenna 4" }, #define S_ANT_TX5 AFTER(S_ANT_TX4) - { 7, "tx5", "ant5(tx)", "frames tx on antenna 5" }, + { 8, "tx5", "ant5(tx)", "frames tx on antenna 5" }, #define S_ANT_TX6 AFTER(S_ANT_TX5) - { 7, "tx6", "ant6(tx)", "frames tx on antenna 6" }, + { 8, "tx6", "ant6(tx)", "frames tx on antenna 6" }, #define S_ANT_TX7 AFTER(S_ANT_TX6) - { 7, "tx7", "ant7(tx)", "frames tx on antenna 7" }, + { 8, "tx7", "ant7(tx)", "frames tx on antenna 7" }, #define S_ANT_RX0 AFTER(S_ANT_TX7) - { 7, "rx0", "ant0(rx)", "frames rx on antenna 0" }, + { 8, "rx0", "ant0(rx)", "frames rx on antenna 0" }, #define S_ANT_RX1 AFTER(S_ANT_RX0) - { 7, "rx1", "ant1(rx)", "frames rx on antenna 1" }, + { 8, "rx1", "ant1(rx)", "frames rx on antenna 1" }, #define S_ANT_RX2 AFTER(S_ANT_RX1) - { 7, "rx2", "ant2(rx)", "frames rx on antenna 2" }, + { 8, "rx2", "ant2(rx)", "frames rx on antenna 2" }, #define S_ANT_RX3 AFTER(S_ANT_RX2) - { 7, "rx3", "ant3(rx)", "frames rx on antenna 3" }, + { 8, "rx3", "ant3(rx)", "frames rx on antenna 3" }, #define S_ANT_RX4 AFTER(S_ANT_RX3) - { 7, "rx4", "ant4(rx)", "frames rx on antenna 4" }, + { 8, "rx4", "ant4(rx)", "frames rx on antenna 4" }, #define S_ANT_RX5 AFTER(S_ANT_RX4) - { 7, "rx5", "ant5(rx)", "frames rx on antenna 5" }, + { 8, "rx5", "ant5(rx)", "frames rx on antenna 5" }, #define S_ANT_RX6 AFTER(S_ANT_RX5) - { 7, "rx6", "ant6(rx)", "frames rx on antenna 6" }, + { 8, "rx6", "ant6(rx)", "frames rx on antenna 6" }, #define S_ANT_RX7 AFTER(S_ANT_RX6) - { 7, "rx7", "ant7(rx)", "frames rx on antenna 7" }, + { 8, "rx7", "ant7(rx)", "frames rx on antenna 7" }, #define S_TX_SIGNAL AFTER(S_ANT_RX7) { 4, "asignal", "asig", "signal of last ack (dBm)" }, #define S_RX_SIGNAL AFTER(S_TX_SIGNAL) @@ -711,38 +710,32 @@ ath_get_curstat(struct statfoo *sf, int #undef STAT } -int -hnprintf(char *b, size_t bs, const char *fmt, int64_t v) -{ - humanize_number(b, bs, v, "", HN_AUTOSCALE, HN_NOSPACE); -} - static int ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs) { struct athstatfoo_p *wf = (struct athstatfoo_p *) sf; #define STAT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_##x); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_##x); return 1 #define PHY(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_rx_phy[x]); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_rx_phy[x]); return 1 #define ANI(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ani_state.x); return 1 + snprintf(b, bs, "%u", wf->total.ani_state.x); return 1 #define ANISTAT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_ani_##x); return 1 + snprintf(b, bs, "%u", wf->total.ani_stats.ast_ani_##x); return 1 #define MIBSTAT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ani_stats.ast_mibstats.x); return 1 + snprintf(b, bs, "%u", wf->total.ani_stats.ast_mibstats.x); return 1 #define TXANT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_tx[x]); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_ant_tx[x]); return 1 #define RXANT(x) \ - hnprintf(b, bs, "%u", (int64_t) wf->total.ath.ast_ant_rx[x]); return 1 + snprintf(b, bs, "%u", wf->total.ath.ast_ant_rx[x]); return 1 switch (s) { case S_INPUT: - hnprintf(b, bs, "%lu", + snprintf(b, bs, "%lu", wf->total.ath.ast_rx_packets - wf->total.ath.ast_rx_mgt); return 1; case S_OUTPUT: - hnprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); + snprintf(b, bs, "%lu", wf->total.ath.ast_tx_packets); return 1; case S_RATE: snprintrate(b, bs, wf->total.ath.ast_tx_rate); Modified: projects/vap7/tools/tools/ath/athstats/statfoo.c ============================================================================== --- projects/vap7/tools/tools/ath/athstats/statfoo.c Fri Feb 13 05:50:18 2009 (r188564) +++ projects/vap7/tools/tools/ath/athstats/statfoo.c Fri Feb 13 05:51:36 2009 (r188565) @@ -109,7 +109,7 @@ statfoo_print_current(struct statfoo *sf for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_curstat(sf, *cp &~ 0x80, buf, f->width)) + if (sf->get_curstat(sf, *cp &~ 0x80, buf, sizeof(buf))) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); @@ -126,7 +126,7 @@ statfoo_print_total(struct statfoo *sf, for (cp = sf->fmts; *cp != '\0'; cp++) { if (*cp & 0x80) { const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_totstat(sf, *cp &~ 0x80, buf, f->width)) + if (sf->get_totstat(sf, *cp &~ 0x80, buf, sizeof(buf))) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 05:52: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 6E604106564A; Fri, 13 Feb 2009 05:52:10 +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 5D1C28FC12; Fri, 13 Feb 2009 05:52:10 +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 n1D5qAVn078194; Fri, 13 Feb 2009 05:52:10 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5qA6V078193; Fri, 13 Feb 2009 05:52:10 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130552.n1D5qA6V078193@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:52:10 +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: r188566 - in projects/vap7/tools/tools/ath: . athstats 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, 13 Feb 2009 05:52:10 -0000 Author: sam Date: Fri Feb 13 05:52:10 2009 New Revision: 188566 URL: http://svn.freebsd.org/changeset/base/188566 Log: merge r188559: add stats no frags and missing stat for no dma buffers Modified: projects/vap7/tools/tools/ath/ (props changed) projects/vap7/tools/tools/ath/athstats/athstats.c Modified: projects/vap7/tools/tools/ath/athstats/athstats.c ============================================================================== --- projects/vap7/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:51:36 2009 (r188565) +++ projects/vap7/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:52:10 2009 (r188566) @@ -116,7 +116,11 @@ static const struct fmt athstats[] = { { 5, "txencode", "txencode", "tx encapsulation failed" }, #define S_TX_NONODE AFTER(S_TX_ENCAP) { 5, "txnonode", "txnonode", "tx failed 'cuz no node" }, -#define S_TX_NOMBUF AFTER(S_TX_NONODE) +#define S_TX_NOBUF AFTER(S_TX_NONODE) + { 5, "txnobuf", "txnobuf", "tx failed 'cuz dma buffer allocation failed" }, +#define S_TX_NOFRAG AFTER(S_TX_NOBUF) + { 5, "txnofrag", "txnofrag", "tx failed 'cuz frag buffer allocation(s) failed" }, +#define S_TX_NOMBUF AFTER(S_TX_NOFRAG) { 5, "txnombuf", "txnombuf", "tx failed 'cuz mbuf allocation failed" }, #ifndef __linux__ #define S_TX_NOMCL AFTER(S_TX_NOMBUF) @@ -542,6 +546,8 @@ ath_get_curstat(struct statfoo *sf, int case S_TX_QSTOP: STAT(tx_qstop); case S_TX_ENCAP: STAT(tx_encap); case S_TX_NONODE: STAT(tx_nonode); + case S_TX_NOBUF: STAT(tx_nobuf); + case S_TX_NOFRAG: STAT(tx_nofrag); case S_TX_NOMBUF: STAT(tx_nombuf); #ifdef S_TX_NOMCL case S_TX_NOMCL: STAT(tx_nomcl); @@ -759,6 +765,8 @@ ath_get_totstat(struct statfoo *sf, int case S_TX_QSTOP: STAT(tx_qstop); case S_TX_ENCAP: STAT(tx_encap); case S_TX_NONODE: STAT(tx_nonode); + case S_TX_NOBUF: STAT(tx_nobuf); + case S_TX_NOFRAG: STAT(tx_nofrag); case S_TX_NOMBUF: STAT(tx_nombuf); #ifdef S_TX_NOMCL case S_TX_NOMCL: STAT(tx_nomcl); From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 05:52: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 9522610656C0; Fri, 13 Feb 2009 05:52: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 78C078FC0A; Fri, 13 Feb 2009 05:52: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 n1D5qhcE078256; Fri, 13 Feb 2009 05:52:43 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D5qhhx078253; Fri, 13 Feb 2009 05:52:43 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902130552.n1D5qhhx078253@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 05:52: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: r188567 - in projects/vap7/tools/tools/ath: . athstats 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, 13 Feb 2009 05:52:43 -0000 Author: sam Date: Fri Feb 13 05:52:43 2009 New Revision: 188567 URL: http://svn.freebsd.org/changeset/base/188567 Log: merge r188560: add -z option to zero driver statistics Modified: projects/vap7/tools/tools/ath/ (props changed) projects/vap7/tools/tools/ath/athstats/athstats.c projects/vap7/tools/tools/ath/athstats/athstats.h projects/vap7/tools/tools/ath/athstats/main.c Modified: projects/vap7/tools/tools/ath/athstats/athstats.c ============================================================================== --- projects/vap7/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:52:10 2009 (r188566) +++ projects/vap7/tools/tools/ath/athstats/athstats.c Fri Feb 13 05:52:43 2009 (r188567) @@ -436,6 +436,15 @@ ath_setifname(struct athstatfoo *wf0, co #endif } +static void +ath_zerostats(struct athstatfoo *wf0) +{ + struct athstatfoo_p *wf = (struct athstatfoo_p *) wf0; + + if (ioctl(wf->s, SIOCZATHSTATS, &wf->ifr) < 0) + err(-1, wf->ifr.ifr_name); +} + static void ath_collect(struct athstatfoo_p *wf, struct _athstats *stats) { @@ -997,6 +1006,7 @@ athstats_new(const char *ifname, const c #if 0 wf->base.setstamac = wlan_setstamac; #endif + wf->base.zerostats = ath_zerostats; wf->s = socket(AF_INET, SOCK_DGRAM, 0); if (wf->s < 0) err(1, "socket"); Modified: projects/vap7/tools/tools/ath/athstats/athstats.h ============================================================================== --- projects/vap7/tools/tools/ath/athstats/athstats.h Fri Feb 13 05:52:10 2009 (r188566) +++ projects/vap7/tools/tools/ath/athstats/athstats.h Fri Feb 13 05:52:43 2009 (r188567) @@ -46,6 +46,8 @@ struct athstatfoo { void (*setifname)(struct athstatfoo *, const char *ifname); /* set the mac address of the associated station/ap */ void (*setstamac)(struct athstatfoo *, const uint8_t mac[]); + /* zero in-kernel statistics */ + void (*zerostats)(struct athstatfoo *); }; struct athstatfoo *athstats_new(const char *ifname, const char *fmtstring); Modified: projects/vap7/tools/tools/ath/athstats/main.c ============================================================================== --- projects/vap7/tools/tools/ath/athstats/main.c Fri Feb 13 05:52:10 2009 (r188566) +++ projects/vap7/tools/tools/ath/athstats/main.c Fri Feb 13 05:52:43 2009 (r188567) @@ -33,7 +33,7 @@ * Simple Atheros-specific tool to inspect and monitor network traffic * statistics. * - * athstats [-i interface] [-l] [-o fmtstring] [interval] + * athstats [-i interface] [-z] [-l] [-o fmtstring] [interval] * * (default interface is ath0). If interval is specified a rolling output * a la netstat -i is displayed every interval seconds. The format of @@ -95,7 +95,7 @@ main(int argc, char *argv[]) if (ifname == NULL) ifname = "ath0"; wf = athstats_new(ifname, getfmt("default")); - while ((c = getopt(argc, argv, "i:lo:")) != -1) { + while ((c = getopt(argc, argv, "i:lo:z")) != -1) { switch (c) { case 'i': wf->setifname(wf, optarg); @@ -106,8 +106,11 @@ main(int argc, char *argv[]) case 'o': wf->setfmt(wf, getfmt(optarg)); break; + case 'z': + wf->zerostats(wf); + break; default: - errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [interval]\n", argv[0]); + errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [-z] [interval]\n", argv[0]); /*NOTREACHED*/ } } From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 06:12: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 56048106564A; Fri, 13 Feb 2009 06:12:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42DA48FC14; Fri, 13 Feb 2009 06:12:16 +0000 (UTC) (envelope-from mckusick@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 n1D6CGZc078675; Fri, 13 Feb 2009 06:12:16 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D6CGNG078672; Fri, 13 Feb 2009 06:12:16 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <200902130612.n1D6CGNG078672@svn.freebsd.org> From: Kirk McKusick Date: Fri, 13 Feb 2009 06:12: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: r188568 - in projects/quota64: lib/libutil usr.sbin/edquota 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, 13 Feb 2009 06:12:16 -0000 Author: mckusick Date: Fri Feb 13 06:12:15 2009 New Revision: 188568 URL: http://svn.freebsd.org/changeset/base/188568 Log: Move hasquota() function to libutil. Modified: projects/quota64/lib/libutil/libutil.h projects/quota64/lib/libutil/quotafile.c projects/quota64/usr.sbin/edquota/edquota.c Modified: projects/quota64/lib/libutil/libutil.h ============================================================================== --- projects/quota64/lib/libutil/libutil.h Fri Feb 13 05:52:43 2009 (r188567) +++ projects/quota64/lib/libutil/libutil.h Fri Feb 13 06:12:15 2009 (r188568) @@ -142,11 +142,13 @@ int pidfile_remove(struct pidfh *pfh); #ifdef _UFS_UFS_QUOTA_H_ struct quotafile; +struct fstab; struct quotafile *quota_open(const char *); struct quotafile *quota_create(const char *); void quota_close(struct quotafile *); int quota_read(struct quotafile *, struct dqblk *, int); int quota_write(struct quotafile *, const struct dqblk *, int); +int hasquota(struct fstab *, int, char **); #endif __END_DECLS Modified: projects/quota64/lib/libutil/quotafile.c ============================================================================== --- projects/quota64/lib/libutil/quotafile.c Fri Feb 13 05:52:43 2009 (r188567) +++ projects/quota64/lib/libutil/quotafile.c Fri Feb 13 06:12:15 2009 (r188568) @@ -29,16 +29,19 @@ #include #include +#include #include #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -48,6 +51,8 @@ struct quotafile { int type; /* 32 or 64 */ }; +static const char *qfextension[] = INITQFNAMES; + struct quotafile * quota_open(const char *fn) { @@ -231,7 +236,7 @@ quota_write32(struct quotafile *qf, cons off = id * sizeof(struct dqblk32); if (lseek(qf->fd, off, SEEK_SET) == -1) return (-1); - return (write(qf->fd, &dqb32, sizeof(dqb32)) == -1); + return (write(qf->fd, &dqb32, sizeof(dqb32)) == sizeof(dqb32)); } static int @@ -252,7 +257,7 @@ quota_write64(struct quotafile *qf, cons off = sizeof(struct dqhdr64) + id * sizeof(struct dqblk64); if (lseek(qf->fd, off, SEEK_SET) == -1) return (-1); - return (write(qf->fd, &dqb64, sizeof(dqb64)) == -1); + return (write(qf->fd, &dqb64, sizeof(dqb64)) == sizeof(dqb64)); } int @@ -270,3 +275,50 @@ quota_write(struct quotafile *qf, const } /* not reached */ } + +/* + * Check to see if a particular quota is to be enabled. + */ +int +hasquota(struct fstab *fs, int type, char **qfnamep) +{ + char *opt; + char *cp; + struct statfs sfb; + static char initname, usrname[100], grpname[100]; + static char buf[BUFSIZ]; + + if (!initname) { + (void)snprintf(usrname, sizeof(usrname), "%s%s", + qfextension[USRQUOTA], QUOTAFILENAME); + (void)snprintf(grpname, sizeof(grpname), "%s%s", + qfextension[GRPQUOTA], QUOTAFILENAME); + initname = 1; + } + strcpy(buf, fs->fs_mntops); + for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) { + if ((cp = index(opt, '='))) + *cp++ = '\0'; + if (type == USRQUOTA && strcmp(opt, usrname) == 0) + break; + if (type == GRPQUOTA && strcmp(opt, grpname) == 0) + break; + } + if (!opt) + return (0); + if (cp) + *qfnamep = cp; + else { + (void)snprintf(buf, sizeof(buf), "%s/%s.%s", fs->fs_file, + QUOTAFILENAME, qfextension[type]); + *qfnamep = buf; + } + /* + * Ensure that the filesystem is mounted. + */ + if (statfs(fs->fs_file, &sfb) != 0 || + strcmp(fs->fs_file, sfb.f_mntonname)) { + return (0); + } + return (1); +} Modified: projects/quota64/usr.sbin/edquota/edquota.c ============================================================================== --- projects/quota64/usr.sbin/edquota/edquota.c Fri Feb 13 05:52:43 2009 (r188567) +++ projects/quota64/usr.sbin/edquota/edquota.c Fri Feb 13 06:12:15 2009 (r188568) @@ -83,7 +83,6 @@ __FBSDID("$FreeBSD$"); #define dbtokb(db) (db) #endif -const char *qfname = QUOTAFILENAME; const char *qfextension[] = INITQFNAMES; const char *quotagroup = QUOTAGROUP; char tmpfil[] = _PATH_TMP; @@ -109,7 +108,6 @@ char *fmthumanvalinos(int64_t); void freeprivs(struct quotause *); int getentry(const char *, int); struct quotause *getprivs(long, int, char *); -int hasquota(struct fstab *, int, char **); void putprivs(long, int, struct quotause *); int readprivs(struct quotause *, char *); int readtimes(struct quotause *, char *); @@ -230,6 +228,8 @@ main(int argc, char *argv[]) if ((protoid = getentry(protoname, quotatype)) == -1) exit(1); protoprivs = getprivs(protoid, quotatype, fspath); + if (protoprivs == NULL) + exit(0); for (qup = protoprivs; qup; qup = qup->next) { qup->dqblk.dqb_btime = 0; qup->dqblk.dqb_itime = 0; @@ -259,20 +259,20 @@ main(int argc, char *argv[]) *argv); if ((id = getentry(buf, quotatype)) < 0) continue; - if (eflag) { - for (qup = protoprivs; qup; - qup = qup->next) { - curprivs = getprivs(id, - quotatype, qup->fsname); - if (curprivs == NULL) - continue; - strcpy(qup->qfname, - curprivs->qfname); - strcpy(qup->fsname, - curprivs->fsname); - } + if (!eflag) { + putprivs(id, quotatype, protoprivs); + continue; + } + for (qup = protoprivs; qup; + qup = qup->next) { + curprivs = getprivs(id, quotatype, + qup->fsname); + if (curprivs == NULL) + continue; + strcpy(qup->qfname, curprivs->qfname); + strcpy(qup->fsname, curprivs->fsname); + putprivs(id, quotatype, protoprivs); } - putprivs(id, quotatype, protoprivs); } } exit(0); @@ -280,12 +280,12 @@ main(int argc, char *argv[]) tmpfd = mkstemp(tmpfil); fchown(tmpfd, getuid(), getgid()); if (tflag) { - protoprivs = getprivs(0, quotatype, fspath); - if (writetimes(protoprivs, tmpfd, quotatype) == 0) - exit(1); - if (editit(tmpfil) && readtimes(protoprivs, tmpfil)) - putprivs(0L, quotatype, protoprivs); - freeprivs(protoprivs); + if ((protoprivs = getprivs(0, quotatype, fspath)) != NULL) { + if (writetimes(protoprivs, tmpfd, quotatype) != 0 && + editit(tmpfil) && readtimes(protoprivs, tmpfil)) + putprivs(0L, quotatype, protoprivs); + freeprivs(protoprivs); + } close(tmpfd); unlink(tmpfil); exit(0); @@ -293,7 +293,8 @@ main(int argc, char *argv[]) for ( ; argc > 0; argc--, argv++) { if ((id = getentry(*argv, quotatype)) == -1) continue; - curprivs = getprivs(id, quotatype, fspath); + if ((curprivs = getprivs(id, quotatype, fspath)) == NULL) + exit(1); if (writeprivs(curprivs, tmpfd, *argv, quotatype) == 0) continue; if (editit(tmpfil) && readprivs(curprivs, tmpfil)) @@ -412,6 +413,9 @@ getprivs(long id, int quotatype, char *f quptail = qup; qup->next = 0; } + if (quphead == NULL) { + warnx("No quotas on %s", fspath ? fspath : "any filesystems"); + } endfsent(); return (quphead); } @@ -462,7 +466,7 @@ putprivs(long id, int quotatype, struct qup->dqblk.dqb_itime = 0; qup->dqblk.dqb_curinodes = dqbuf.dqb_curinodes; qup->dqblk.dqb_curblocks = dqbuf.dqb_curblocks; - if (quota_write(qf, &qup->dqblk, id) != 0) { + if (quota_write(qf, &qup->dqblk, id) == 0) { warn("%s", qup->qfname); } quota_close(qf); @@ -994,54 +998,3 @@ alldigits(const char *s) } while ((c = *s++)); return (1); } - -/* - * Check to see if a particular quota is to be enabled. - */ -int -hasquota(struct fstab *fs, int type, char **qfnamep) -{ - char *opt; - char *cp; - struct statfs sfb; - static char initname, usrname[100], grpname[100]; - static char buf[BUFSIZ]; - - if (!initname) { - (void)snprintf(usrname, sizeof(usrname), "%s%s", - qfextension[USRQUOTA], qfname); - (void)snprintf(grpname, sizeof(grpname), "%s%s", - qfextension[GRPQUOTA], qfname); - initname = 1; - } - strcpy(buf, fs->fs_mntops); - for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) { - if ((cp = index(opt, '='))) - *cp++ = '\0'; - if (type == USRQUOTA && strcmp(opt, usrname) == 0) - break; - if (type == GRPQUOTA && strcmp(opt, grpname) == 0) - break; - } - if (!opt) - return (0); - if (cp) - *qfnamep = cp; - else { - (void)snprintf(buf, sizeof(buf), "%s/%s.%s", fs->fs_file, - qfname, qfextension[type]); - *qfnamep = buf; - } - if (statfs(fs->fs_file, &sfb) != 0) { - warn("cannot statfs mount point %s", fs->fs_file); - sleep(3); - return (0); - } - if (strcmp(fs->fs_file, sfb.f_mntonname)) { - warnx("%s not mounted for %s quotas", fs->fs_file, - type == USRQUOTA ? "user" : "group"); - sleep(3); - return (0); - } - return (1); -} From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 06:17: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 C20F61065672; Fri, 13 Feb 2009 06:17:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B064A8FC1C; Fri, 13 Feb 2009 06:17:53 +0000 (UTC) (envelope-from mckusick@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 n1D6HrvL078813; Fri, 13 Feb 2009 06:17:53 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1D6HrGa078812; Fri, 13 Feb 2009 06:17:53 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <200902130617.n1D6HrGa078812@svn.freebsd.org> From: Kirk McKusick Date: Fri, 13 Feb 2009 06:17: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: r188569 - projects/quota64/lib/libutil 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, 13 Feb 2009 06:17:54 -0000 Author: mckusick Date: Fri Feb 13 06:17:53 2009 New Revision: 188569 URL: http://svn.freebsd.org/changeset/base/188569 Log: Move hasquota() function to libutil. Modified: projects/quota64/lib/libutil/quotafile.3 Modified: projects/quota64/lib/libutil/quotafile.3 ============================================================================== --- projects/quota64/lib/libutil/quotafile.3 Fri Feb 13 06:12:15 2009 (r188568) +++ projects/quota64/lib/libutil/quotafile.3 Fri Feb 13 06:17:53 2009 (r188569) @@ -50,6 +50,8 @@ .Fn quota_write "struct quotafile *qf" "const struct dqblk *dqb" "int id" .Ft int .Fn quota_close "struct quotafile *qf" +.Ft int +.Fn hasquota "struct fstab *fs" "int type" "char **qfnamep" .Sh DESCRIPTION .Sh RETURN VALUES .Sh SEE ALSO From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 19:25: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 63E3B1065677; Fri, 13 Feb 2009 19:25:36 +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 360688FC23; Fri, 13 Feb 2009 19:25:36 +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 n1DJPaBH097249; Fri, 13 Feb 2009 19:25:36 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DJPaT2097248; Fri, 13 Feb 2009 19:25:36 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200902131925.n1DJPaT2097248@svn.freebsd.org> From: Sam Leffler Date: Fri, 13 Feb 2009 19:25: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: r188595 - in projects/vap7/sys: . contrib/pf dev dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210 dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54... 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, 13 Feb 2009 19:25:36 -0000 Author: sam Date: Fri Feb 13 19:25:35 2009 New Revision: 188595 URL: http://svn.freebsd.org/changeset/base/188595 Log: merge r188594: fix null ptr deref on ifnet removal w/ inherit_mac enabled Modified: projects/vap7/sys/ (props changed) projects/vap7/sys/contrib/pf/ (props changed) projects/vap7/sys/dev/ (props changed) projects/vap7/sys/dev/ath/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed) projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed) projects/vap7/sys/dev/cxgb/ (props changed) projects/vap7/sys/dev/usb2/ (props changed) projects/vap7/sys/i386/conf/USB2 (props changed) projects/vap7/sys/modules/usb2/ (props changed) projects/vap7/sys/net/if_bridge.c projects/vap7/sys/net80211/ (props changed) Modified: projects/vap7/sys/net/if_bridge.c ============================================================================== --- projects/vap7/sys/net/if_bridge.c Fri Feb 13 19:20:25 2009 (r188594) +++ projects/vap7/sys/net/if_bridge.c Fri Feb 13 19:25:35 2009 (r188595) @@ -220,6 +220,7 @@ struct bridge_softc { LIST_HEAD(, bridge_iflist) sc_spanlist; /* span ports list */ struct bstp_state sc_stp; /* STP state */ uint32_t sc_brtexceeded; /* # of cache drops */ + struct ifnet *sc_ifaddr; /* member mac copied from */ u_char sc_defaddr[6]; /* Default MAC address */ }; @@ -925,15 +926,16 @@ bridge_delete_member(struct bridge_softc * the mac address of the bridge to the address of the next member, or * to its default address if no members are left. */ - if (bridge_inherit_mac && - !memcmp(IF_LLADDR(sc->sc_ifp), IF_LLADDR(ifs), ETHER_ADDR_LEN)) { - if (LIST_EMPTY(&sc->sc_iflist)) + if (bridge_inherit_mac && sc->sc_ifaddr == ifs) { + if (LIST_EMPTY(&sc->sc_iflist)) { bcopy(sc->sc_defaddr, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); - else { + sc->sc_ifaddr = NULL; + } else { fif = LIST_FIRST(&sc->sc_iflist)->bif_ifp; bcopy(IF_LLADDR(fif), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = fif; } } @@ -1035,8 +1037,10 @@ bridge_ioctl_add(struct bridge_softc *sc * the default randomly generated one. */ if (bridge_inherit_mac && LIST_EMPTY(&sc->sc_iflist) && - !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) + !memcmp(IF_LLADDR(sc->sc_ifp), sc->sc_defaddr, ETHER_ADDR_LEN)) { bcopy(IF_LLADDR(ifs), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); + sc->sc_ifaddr = ifs; + } ifs->if_bridge = sc; bstp_create(&sc->sc_stp, &bif->bif_stp, bif->bif_ifp); From owner-svn-src-projects@FreeBSD.ORG Fri Feb 13 19:57: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 37A0E1065670; Fri, 13 Feb 2009 19:57:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8B18FC1C; Fri, 13 Feb 2009 19:57:00 +0000 (UTC) (envelope-from mckusick@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 n1DJuxkt097925; Fri, 13 Feb 2009 19:56:59 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DJuxes097923; Fri, 13 Feb 2009 19:56:59 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <200902131956.n1DJuxes097923@svn.freebsd.org> From: Kirk McKusick Date: Fri, 13 Feb 2009 19:56: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: r188598 - projects/quota64/lib/libutil 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, 13 Feb 2009 19:57:00 -0000 Author: mckusick Date: Fri Feb 13 19:56:59 2009 New Revision: 188598 URL: http://svn.freebsd.org/changeset/base/188598 Log: Make hasquota thread safe. Modified: projects/quota64/lib/libutil/libutil.h projects/quota64/lib/libutil/quotafile.c Modified: projects/quota64/lib/libutil/libutil.h ============================================================================== --- projects/quota64/lib/libutil/libutil.h Fri Feb 13 19:49:51 2009 (r188597) +++ projects/quota64/lib/libutil/libutil.h Fri Feb 13 19:56:59 2009 (r188598) @@ -148,7 +148,7 @@ struct quotafile *quota_create(const cha void quota_close(struct quotafile *); int quota_read(struct quotafile *, struct dqblk *, int); int quota_write(struct quotafile *, const struct dqblk *, int); -int hasquota(struct fstab *, int, char **); +int hasquota(struct fstab *, int, char *, int); #endif __END_DECLS Modified: projects/quota64/lib/libutil/quotafile.c ============================================================================== --- projects/quota64/lib/libutil/quotafile.c Fri Feb 13 19:49:51 2009 (r188597) +++ projects/quota64/lib/libutil/quotafile.c Fri Feb 13 19:56:59 2009 (r188598) @@ -280,13 +280,13 @@ quota_write(struct quotafile *qf, const * Check to see if a particular quota is to be enabled. */ int -hasquota(struct fstab *fs, int type, char **qfnamep) +hasquota(struct fstab *fs, int type, char *qfnamep, int qfbufsize) { char *opt; char *cp; struct statfs sfb; + char buf[BUFSIZ]; static char initname, usrname[100], grpname[100]; - static char buf[BUFSIZ]; if (!initname) { (void)snprintf(usrname, sizeof(usrname), "%s%s", @@ -306,13 +306,6 @@ hasquota(struct fstab *fs, int type, cha } if (!opt) return (0); - if (cp) - *qfnamep = cp; - else { - (void)snprintf(buf, sizeof(buf), "%s/%s.%s", fs->fs_file, - QUOTAFILENAME, qfextension[type]); - *qfnamep = buf; - } /* * Ensure that the filesystem is mounted. */ @@ -320,5 +313,11 @@ hasquota(struct fstab *fs, int type, cha strcmp(fs->fs_file, sfb.f_mntonname)) { return (0); } + if (cp) { + strncpy(qfnamep, cp, qfbufsize); + } else { + (void)snprintf(qfnamep, qfbufsize, "%s/%s.%s", fs->fs_file, + QUOTAFILENAME, qfextension[type]); + } return (1); } From owner-svn-src-projects@FreeBSD.ORG Sat Feb 14 08:08: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 150E3106564A; Sat, 14 Feb 2009 08:08:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 018188FC0C; Sat, 14 Feb 2009 08:08:09 +0000 (UTC) (envelope-from mckusick@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 n1E888lm011833; Sat, 14 Feb 2009 08:08:08 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1E888Ks011829; Sat, 14 Feb 2009 08:08:08 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <200902140808.n1E888Ks011829@svn.freebsd.org> From: Kirk McKusick Date: Sat, 14 Feb 2009 08:08: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: r188604 - in projects/quota64: lib/libutil usr.sbin/edquota 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, 14 Feb 2009 08:08:09 -0000 Author: mckusick Date: Sat Feb 14 08:08:08 2009 New Revision: 188604 URL: http://svn.freebsd.org/changeset/base/188604 Log: Update the quotafile library to manage both active quotas via the quotactl(2) interface and inactive quotas by accessing the quota files directly. Update the edquota program to use this new interface as proof of concept. Modified: projects/quota64/lib/libutil/libutil.h projects/quota64/lib/libutil/quotafile.3 projects/quota64/lib/libutil/quotafile.c projects/quota64/usr.sbin/edquota/edquota.c Modified: projects/quota64/lib/libutil/libutil.h ============================================================================== --- projects/quota64/lib/libutil/libutil.h Fri Feb 13 23:36:08 2009 (r188603) +++ projects/quota64/lib/libutil/libutil.h Sat Feb 14 08:08:08 2009 (r188604) @@ -143,12 +143,11 @@ int pidfile_remove(struct pidfh *pfh); #ifdef _UFS_UFS_QUOTA_H_ struct quotafile; struct fstab; -struct quotafile *quota_open(const char *); -struct quotafile *quota_create(const char *); +struct quotafile *quota_open(struct fstab *, int, int); void quota_close(struct quotafile *); int quota_read(struct quotafile *, struct dqblk *, int); -int quota_write(struct quotafile *, const struct dqblk *, int); -int hasquota(struct fstab *, int, char *, int); +int quota_write_limits(struct quotafile *, struct dqblk *, int); +int quota_write_usage(struct quotafile *, struct dqblk *, int); #endif __END_DECLS Modified: projects/quota64/lib/libutil/quotafile.3 ============================================================================== --- projects/quota64/lib/libutil/quotafile.3 Fri Feb 13 23:36:08 2009 (r188603) +++ projects/quota64/lib/libutil/quotafile.3 Sat Feb 14 08:08:08 2009 (r188604) @@ -25,35 +25,132 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2008 +.Dd February 14, 2009 .Dt QUOTAFILE 3 .Os .Sh NAME .Nm quota_open -.Nm quota_create .Nm quota_read -.Nm quota_write +.Nm quota_write_limits +.Nm quota_write_usage .Nm quota_close -.Nd "Manipulate quota files" +.Nd "Manipulate quotas" .Sh LIBRARY .Lb libutil .Sh SYNOPSIS .In ufs/ufs/quota.h .In libutil.h +.In fstab.h .Ft "struct quotafile *" -.Fn quota_open "const char *path" -.Ft "struct quotafile *" -.Fn quota_create "const char *path" +.Fn quota_open "struct fstab *fs" "int quotatype" "int openflags" .Ft int .Fn quota_read "struct quotafile *qf" "struct dqblk *dqb" "int id" .Ft int -.Fn quota_write "struct quotafile *qf" "const struct dqblk *dqb" "int id" +.Fn quota_write_limits "struct quotafile *qf" "struct dqblk *dqb" "int id" .Ft int -.Fn quota_close "struct quotafile *qf" +.Fn quota_write_usage "struct quotafile *qf" "struct dqblk *dqb" "int id" .Ft int -.Fn hasquota "struct fstab *fs" "int type" "char **qfnamep" +.Fn quota_close "struct quotafile *qf" .Sh DESCRIPTION +These functions are designed to simplify access to filesystem quotas. +If quotas are active on a filesystem, +these functions will access them directly from the kernel using the +.Fn quotactl +system call. +If quotas are not active, +these functions will access them by reading and writing +the quota files directly. +.Pp +The +.Fn quota_open +function takes a pointer to an +.Vt fstab +entry corresponding to the filesystem on which quotas +are to be accessed. +The +.Va quotatype +field indicates the type of quotas being sought, either +.Dv USRQUOTA +or +.Dv GRPQUOTA . +The +.Va openflags +are those used by the +.Fn open +system call, usually either +.Dv O_RDONLY +if the quotas are just to be read, or +.Dv O_RDWR +if the quotas are to be updated. +The +.Dv O_CREAT +flag should be specified if a new quota file of the requested type should +be created if it does not already exist. +.Pp +The +.Fn quota_read +function reads the quota from the filesystem and quota type referenced by +.Va qf +for the user (or group) specified by +.Va id +into the +.Vt dqblk +quota structure pointed to by +.Va dqb . +.Pp +The +.Fn quota_write_limits +function updates the limit fields (but not the usage fields) +for the filesystem and quota type referenced by +.Va qf +for the user (or group) specified by +.Va id +from the +.Vt dqblk +quota structure pointed to by +.Va dqb . +.Pp +The +.Fn quota_write_usage +function updates the usage fields (but not the limit fields) +for the filesystem and quota type referenced by +.Va qf +for the user (or group) specified by +.Va id +from the +.Vt dqblk +quota structure pointed to by +.Va dqb . +.Pp +The +.Fn quota_close +function closes any open file descriptors and frees any storage +associated with the filesystem and quota type referenced by +.Va qf . .Sh RETURN VALUES +If the filesystem has quotas associated with it, +.Fn quota_open +returns a pointer to a +.Vt quotafile +structure used in subsequent quota access calls. +If the filesystem has no quotas, or access permission is denied +.Dv NULL +is returned and +.Va errno +is set to indicate the cause of failure. +.Pp +The +.Fn quota_read , +.Fn quota_write_limits , +.Fn quota_write_usage , +and +.Fn quota_close +functions return zero on success. +On error they return +.Dv -1 +and set +.Va errno +to indicate the cause of failure. .Sh SEE ALSO .Xr quotactl 2 , .Xr quota.user 5 , @@ -68,4 +165,6 @@ functions first appeared in The .Nm functions and this manual page were written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org +and +.An Marshall Kirk McKusick . Modified: projects/quota64/lib/libutil/quotafile.c ============================================================================== --- projects/quota64/lib/libutil/quotafile.c Fri Feb 13 23:36:08 2009 (r188603) +++ projects/quota64/lib/libutil/quotafile.c Sat Feb 14 08:08:08 2009 (r188604) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2008 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2008 Marshall Kirk McKusick * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -47,76 +48,132 @@ #include struct quotafile { - int fd; - int type; /* 32 or 64 */ + int fd; /* -1 means using quotactl for access */ + int wordsize; /* 32-bit or 64-bit limits */ + int quotatype; /* USRQUOTA or GRPQUOTA */ + char fsname[MAXPATHLEN + 1]; /* mount point of filesystem */ + char qfname[MAXPATHLEN + 1]; /* quota file if not using quotactl */ }; static const char *qfextension[] = INITQFNAMES; +/* + * Check to see if a particular quota is to be enabled. + */ +static int +hasquota(struct fstab *fs, int type, char *qfnamep, int qfbufsize) +{ + char *opt; + char *cp; + struct statfs sfb; + char buf[BUFSIZ]; + static char initname, usrname[100], grpname[100]; + + if (!initname) { + (void)snprintf(usrname, sizeof(usrname), "%s%s", + qfextension[USRQUOTA], QUOTAFILENAME); + (void)snprintf(grpname, sizeof(grpname), "%s%s", + qfextension[GRPQUOTA], QUOTAFILENAME); + initname = 1; + } + strcpy(buf, fs->fs_mntops); + for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) { + if ((cp = index(opt, '='))) + *cp++ = '\0'; + if (type == USRQUOTA && strcmp(opt, usrname) == 0) + break; + if (type == GRPQUOTA && strcmp(opt, grpname) == 0) + break; + } + if (!opt) + return (0); + /* + * Ensure that the filesystem is mounted. + */ + if (statfs(fs->fs_file, &sfb) != 0 || + strcmp(fs->fs_file, sfb.f_mntonname)) { + return (0); + } + if (cp) { + strncpy(qfnamep, cp, qfbufsize); + } else { + (void)snprintf(qfnamep, qfbufsize, "%s/%s.%s", fs->fs_file, + QUOTAFILENAME, qfextension[type]); + } + return (1); +} + struct quotafile * -quota_open(const char *fn) +quota_open(struct fstab *fs, int quotatype, int openflags) { struct quotafile *qf; struct dqhdr64 dqh; - int serrno; + struct group *grp; + int qcmd, serrno; if ((qf = calloc(1, sizeof(*qf))) == NULL) return (NULL); - if ((qf->fd = open(fn, O_RDWR)) < 0) { - serrno = errno; + qf->quotatype = quotatype; + strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); + qcmd = QCMD(Q_GETQUOTA, quotatype); + if (quotactl(fs->fs_file, qcmd, 0, &dqh) == 0) { + qf->wordsize = 64; + qf->fd = -1; + return (qf); + } + if (!hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname))) { free(qf); - errno = serrno; + errno = EOPNOTSUPP; return (NULL); } - qf->type = 32; - switch (read(qf->fd, &dqh, sizeof(dqh))) { - case -1: + if ((qf->fd = open(qf->qfname, openflags & O_ACCMODE)) < 0 && + (openflags & O_CREAT) == 0) { serrno = errno; - close(qf->fd); free(qf); errno = serrno; return (NULL); - case sizeof(dqh): - if (strcmp(dqh.dqh_magic, Q_DQHDR64_MAGIC) != 0) { - /* no magic, assume 32 bits */ - qf->type = 32; - return (qf); - } - if (be32toh(dqh.dqh_version) != Q_DQHDR64_VERSION || - be32toh(dqh.dqh_hdrlen) != sizeof(struct dqhdr64) || - be32toh(dqh.dqh_reclen) != sizeof(struct dqblk64)) { - /* correct magic, wrong version / lengths */ + } + /* File open worked, so process it */ + if (qf->fd != -1) { + qf->wordsize = 32; + switch (read(qf->fd, &dqh, sizeof(dqh))) { + case -1: + serrno = errno; close(qf->fd); free(qf); - errno = EINVAL; + errno = serrno; return (NULL); + case sizeof(dqh): + if (strcmp(dqh.dqh_magic, Q_DQHDR64_MAGIC) != 0) { + /* no magic, assume 32 bits */ + qf->wordsize = 32; + return (qf); + } + if (be32toh(dqh.dqh_version) != Q_DQHDR64_VERSION || + be32toh(dqh.dqh_hdrlen) != sizeof(struct dqhdr64) || + be32toh(dqh.dqh_reclen) != sizeof(struct dqblk64)) { + /* correct magic, wrong version / lengths */ + close(qf->fd); + free(qf); + errno = EINVAL; + return (NULL); + } + qf->wordsize = 64; + return (qf); + default: + qf->wordsize = 32; + return (qf); } - qf->type = 64; - return (qf); - default: - qf->type = 32; - return (qf); + /* not reached */ } - /* not reached */ -} - -struct quotafile * -quota_create(const char *fn) -{ - struct quotafile *qf; - struct dqhdr64 dqh; - struct group *grp; - int serrno; - - if ((qf = calloc(1, sizeof(*qf))) == NULL) - return (NULL); - if ((qf->fd = open(fn, O_RDWR|O_CREAT|O_TRUNC, 0)) < 0) { + /* Open failed above, but O_CREAT specified, so create a new file */ + if ((qf->fd = open(qf->qfname, O_RDWR|O_CREAT|O_TRUNC, 0)) < 0) { serrno = errno; free(qf); errno = serrno; return (NULL); } - qf->type = 64; + qf->wordsize = 64; memset(&dqh, 0, sizeof(dqh)); memcpy(dqh.dqh_magic, Q_DQHDR64_MAGIC, sizeof(dqh.dqh_magic)); dqh.dqh_version = htobe32(Q_DQHDR64_VERSION); @@ -124,7 +181,7 @@ quota_create(const char *fn) dqh.dqh_reclen = htobe32(sizeof(struct dqblk64)); if (write(qf->fd, &dqh, sizeof(dqh)) != sizeof(dqh)) { serrno = errno; - unlink(fn); + unlink(qf->qfname); close(qf->fd); free(qf); errno = serrno; @@ -140,7 +197,8 @@ void quota_close(struct quotafile *qf) { - close(qf->fd); + if (qf->fd != -1) + close(qf->fd); free(qf); } @@ -203,8 +261,13 @@ quota_read64(struct quotafile *qf, struc int quota_read(struct quotafile *qf, struct dqblk *dqb, int id) { + int qcmd; - switch (qf->type) { + if (qf->fd == -1) { + qcmd = QCMD(Q_GETQUOTA, qf->quotatype); + return (quotactl(qf->fsname, qcmd, id, dqb)); + } + switch (qf->wordsize) { case 32: return quota_read32(qf, dqb, id); case 64: @@ -236,7 +299,9 @@ quota_write32(struct quotafile *qf, cons off = id * sizeof(struct dqblk32); if (lseek(qf->fd, off, SEEK_SET) == -1) return (-1); - return (write(qf->fd, &dqb32, sizeof(dqb32)) == sizeof(dqb32)); + if (write(qf->fd, &dqb32, sizeof(dqb32)) == sizeof(dqb32)) + return (0); + return (-1); } static int @@ -257,18 +322,48 @@ quota_write64(struct quotafile *qf, cons off = sizeof(struct dqhdr64) + id * sizeof(struct dqblk64); if (lseek(qf->fd, off, SEEK_SET) == -1) return (-1); - return (write(qf->fd, &dqb64, sizeof(dqb64)) == sizeof(dqb64)); + if (write(qf->fd, &dqb64, sizeof(dqb64)) == sizeof(dqb64)) + return (0); + return (-1); } int -quota_write(struct quotafile *qf, const struct dqblk *dqb, int id) +quota_write_usage(struct quotafile *qf, struct dqblk *dqb, int id) { + struct dqblk dqbuf; + int qcmd; - switch (qf->type) { + if (qf->fd == -1) { + qcmd = QCMD(Q_SETUSE, qf->quotatype); + return (quotactl(qf->fsname, qcmd, id, dqb)); + } + /* + * Have to do read-modify-write of quota in file. + */ + if (quota_read(qf, &dqbuf, id) != 0) + return (-1); + /* + * Reset time limit if have a soft limit and were + * previously under it, but are now over it. + */ + if (dqbuf.dqb_bsoftlimit && id != 0 && + dqbuf.dqb_curblocks < dqbuf.dqb_bsoftlimit && + dqb->dqb_curblocks >= dqbuf.dqb_bsoftlimit) + dqbuf.dqb_btime = 0; + if (dqbuf.dqb_isoftlimit && id != 0 && + dqbuf.dqb_curinodes < dqbuf.dqb_isoftlimit && + dqb->dqb_curinodes >= dqbuf.dqb_isoftlimit) + dqbuf.dqb_itime = 0; + dqbuf.dqb_curinodes = dqb->dqb_curinodes; + dqbuf.dqb_curblocks = dqb->dqb_curblocks; + /* + * Write it back. + */ + switch (qf->wordsize) { case 32: - return quota_write32(qf, dqb, id); + return quota_write32(qf, &dqbuf, id); case 64: - return quota_write64(qf, dqb, id); + return quota_write64(qf, &dqbuf, id); default: errno = EINVAL; return (-1); @@ -276,48 +371,56 @@ quota_write(struct quotafile *qf, const /* not reached */ } -/* - * Check to see if a particular quota is to be enabled. - */ int -hasquota(struct fstab *fs, int type, char *qfnamep, int qfbufsize) +quota_write_limits(struct quotafile *qf, struct dqblk *dqb, int id) { - char *opt; - char *cp; - struct statfs sfb; - char buf[BUFSIZ]; - static char initname, usrname[100], grpname[100]; + struct dqblk dqbuf; + int qcmd; - if (!initname) { - (void)snprintf(usrname, sizeof(usrname), "%s%s", - qfextension[USRQUOTA], QUOTAFILENAME); - (void)snprintf(grpname, sizeof(grpname), "%s%s", - qfextension[GRPQUOTA], QUOTAFILENAME); - initname = 1; + if (qf->fd == -1) { + qcmd = QCMD(Q_SETQUOTA, qf->quotatype); + return (quotactl(qf->fsname, qcmd, id, dqb)); } - strcpy(buf, fs->fs_mntops); - for (opt = strtok(buf, ","); opt; opt = strtok(NULL, ",")) { - if ((cp = index(opt, '='))) - *cp++ = '\0'; - if (type == USRQUOTA && strcmp(opt, usrname) == 0) - break; - if (type == GRPQUOTA && strcmp(opt, grpname) == 0) - break; - } - if (!opt) - return (0); /* - * Ensure that the filesystem is mounted. + * Have to do read-modify-write of quota in file. */ - if (statfs(fs->fs_file, &sfb) != 0 || - strcmp(fs->fs_file, sfb.f_mntonname)) { - return (0); - } - if (cp) { - strncpy(qfnamep, cp, qfbufsize); - } else { - (void)snprintf(qfnamep, qfbufsize, "%s/%s.%s", fs->fs_file, - QUOTAFILENAME, qfextension[type]); + if (quota_read(qf, &dqbuf, id) != 0) + return (-1); + /* + * Reset time limit if have a soft limit and were + * previously under it, but are now over it + * or if there previously was no soft limit, but + * now have one and are over it. + */ + if (dqbuf.dqb_bsoftlimit && id != 0 && + dqbuf.dqb_curblocks < dqbuf.dqb_bsoftlimit && + dqbuf.dqb_curblocks >= dqb->dqb_bsoftlimit) + dqb->dqb_btime = 0; + if (dqbuf.dqb_bsoftlimit == 0 && id != 0 && + dqb->dqb_bsoftlimit > 0 && + dqbuf.dqb_curblocks >= dqb->dqb_bsoftlimit) + dqb->dqb_btime = 0; + if (dqbuf.dqb_isoftlimit && id != 0 && + dqbuf.dqb_curinodes < dqbuf.dqb_isoftlimit && + dqbuf.dqb_curinodes >= dqb->dqb_isoftlimit) + dqb->dqb_itime = 0; + if (dqbuf.dqb_isoftlimit == 0 && id !=0 && + dqb->dqb_isoftlimit > 0 && + dqbuf.dqb_curinodes >= dqb->dqb_isoftlimit) + dqb->dqb_itime = 0; + dqb->dqb_curinodes = dqbuf.dqb_curinodes; + dqb->dqb_curblocks = dqbuf.dqb_curblocks; + /* + * Write it back. + */ + switch (qf->wordsize) { + case 32: + return quota_write32(qf, dqb, id); + case 64: + return quota_write64(qf, dqb, id); + default: + errno = EINVAL; + return (-1); } - return (1); + /* not reached */ } Modified: projects/quota64/usr.sbin/edquota/edquota.c ============================================================================== --- projects/quota64/usr.sbin/edquota/edquota.c Fri Feb 13 23:36:08 2009 (r188603) +++ projects/quota64/usr.sbin/edquota/edquota.c Sat Feb 14 08:08:08 2009 (r188604) @@ -84,16 +84,15 @@ __FBSDID("$FreeBSD$"); #endif const char *qfextension[] = INITQFNAMES; -const char *quotagroup = QUOTAGROUP; char tmpfil[] = _PATH_TMP; int hflag; struct quotause { struct quotause *next; - long flags; + struct quotafile *qf; struct dqblk dqblk; + int flags; char fsname[MAXPATHLEN + 1]; - char qfname[1]; /* actually longer */ }; #define FOUND 0x01 @@ -108,7 +107,7 @@ char *fmthumanvalinos(int64_t); void freeprivs(struct quotause *); int getentry(const char *, int); struct quotause *getprivs(long, int, char *); -void putprivs(long, int, struct quotause *); +void putprivs(long, struct quotause *); int readprivs(struct quotause *, char *); int readtimes(struct quotause *, char *); static void usage(void); @@ -142,6 +141,11 @@ main(int argc, char *argv[]) fspath = optarg; break; case 'p': + if (eflag) { + warnx("cannot specify both -e and -p"); + usage(); + /* not reached */ + } protoname = optarg; pflag++; break; @@ -158,7 +162,12 @@ main(int argc, char *argv[]) tflag++; break; case 'e': - if ((qup = calloc(1, sizeof(*qup) + BUFSIZ)) == NULL) + if (pflag) { + warnx("cannot specify both -e and -p"); + usage(); + /* not reached */ + } + if ((qup = calloc(1, sizeof(*qup))) == NULL) errx(2, "out of memory"); oldoptarg = optarg; for (i = 0, cp = optarg; @@ -214,7 +223,6 @@ main(int argc, char *argv[]) curprivs = qup; } eflag++; - pflag++; break; default: usage(); @@ -223,8 +231,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (pflag) { - if (protoprivs == NULL) { + if (pflag || eflag) { + if (pflag) { if ((protoid = getentry(protoname, quotatype)) == -1) exit(1); protoprivs = getprivs(protoid, quotatype, fspath); @@ -259,22 +267,23 @@ main(int argc, char *argv[]) *argv); if ((id = getentry(buf, quotatype)) < 0) continue; - if (!eflag) { - putprivs(id, quotatype, protoprivs); + if (pflag) { + putprivs(id, protoprivs); continue; } - for (qup = protoprivs; qup; - qup = qup->next) { + for (qup = protoprivs; qup; qup = qup->next) { curprivs = getprivs(id, quotatype, qup->fsname); if (curprivs == NULL) continue; - strcpy(qup->qfname, curprivs->qfname); - strcpy(qup->fsname, curprivs->fsname); - putprivs(id, quotatype, protoprivs); + curprivs->dqblk = qup->dqblk; + putprivs(id, curprivs); + freeprivs(curprivs); } } } + if (pflag) + freeprivs(protoprivs); exit(0); } tmpfd = mkstemp(tmpfil); @@ -283,7 +292,7 @@ main(int argc, char *argv[]) if ((protoprivs = getprivs(0, quotatype, fspath)) != NULL) { if (writetimes(protoprivs, tmpfd, quotatype) != 0 && editit(tmpfil) && readtimes(protoprivs, tmpfil)) - putprivs(0L, quotatype, protoprivs); + putprivs(0L, protoprivs); freeprivs(protoprivs); } close(tmpfd); @@ -298,7 +307,7 @@ main(int argc, char *argv[]) if (writeprivs(curprivs, tmpfd, *argv, quotatype) == 0) continue; if (editit(tmpfil) && readprivs(curprivs, tmpfil)) - putprivs(id, quotatype, curprivs); + putprivs(id, curprivs); freeprivs(curprivs); } close(tmpfd); @@ -366,46 +375,29 @@ getprivs(long id, int quotatype, char *f struct fstab *fs; struct quotause *qup, *quptail; struct quotause *quphead; - int qcmd, qupsize; - char *qfpathname; - static int warned = 0; setfsent(); quphead = quptail = NULL; - qcmd = QCMD(Q_GETQUOTA, quotatype); while ((fs = getfsent())) { if (fspath && *fspath && strcmp(fspath, fs->fs_spec) && strcmp(fspath, fs->fs_file)) continue; if (strcmp(fs->fs_vfstype, "ufs")) continue; - if (!hasquota(fs, quotatype, &qfpathname)) + if ((qf = quota_open(fs, quotatype, O_CREAT|O_RDWR)) == NULL) { + if (errno != EOPNOTSUPP) + warn("cannot open quotas on %s", fs->fs_file); continue; - qupsize = sizeof(*qup) + strlen(qfpathname); - if ((qup = (struct quotause *)malloc(qupsize)) == NULL) + } + if ((qup = (struct quotause *)calloc(1, sizeof(*qup))) == NULL) errx(2, "out of memory"); - if (quotactl(fs->fs_file, qcmd, id, &qup->dqblk) != 0) { - if (errno == EOPNOTSUPP && !warned) { - warned++; - warnx("warning: quotas are not compiled into this kernel"); - sleep(3); - } - if ((qf = quota_open(qfpathname)) == NULL && - (qf = quota_create(qfpathname)) == NULL) { - warn("%s", qfpathname); - free(qup); - continue; - } - if (quota_read(qf, &qup->dqblk, id) != 0) { - warn("read error in %s", qfpathname); - quota_close(qf); - free(qup); - continue; - } - quota_close(qf); + qup->qf = qf; + strncpy(qup->fsname, fs->fs_file, sizeof(qup->fsname)); + if (quota_read(qf, &qup->dqblk, id) == -1) { + warn("cannot read quotas on %s", fs->fs_file); + freeprivs(qup); + continue; } - strcpy(qup->qfname, qfpathname); - strcpy(qup->fsname, fs->fs_file); if (quphead == NULL) quphead = qup; else @@ -424,53 +416,13 @@ getprivs(long id, int quotatype, char *f * Store the requested quota information. */ void -putprivs(long id, int quotatype, struct quotause *quplist) +putprivs(long id, struct quotause *quplist) { - struct quotafile *qf; struct quotause *qup; - int qcmd; - struct dqblk dqbuf; - qcmd = QCMD(Q_SETQUOTA, quotatype); - for (qup = quplist; qup; qup = qup->next) { - if (quotactl(qup->fsname, qcmd, id, &qup->dqblk) == 0) - continue; - if ((qf = quota_open(qup->qfname)) == NULL) { - warn("%s", qup->qfname); - continue; - } - if (quota_read(qf, &dqbuf, id) != 0) { - warn("read error in %s", qup->qfname); - quota_close(qf); - continue; - } - /* - * Reset time limit if have a soft limit and were - * previously under it, but are now over it - * or if there previously was no soft limit, but - * now have one and are over it. - */ - if (dqbuf.dqb_bsoftlimit && id != 0 && - dqbuf.dqb_curblocks < dqbuf.dqb_bsoftlimit && - dqbuf.dqb_curblocks >= qup->dqblk.dqb_bsoftlimit) - qup->dqblk.dqb_btime = 0; - if (dqbuf.dqb_bsoftlimit == 0 && id != 0 && - dqbuf.dqb_curblocks >= qup->dqblk.dqb_bsoftlimit) - qup->dqblk.dqb_btime = 0; - if (dqbuf.dqb_isoftlimit && id != 0 && - dqbuf.dqb_curinodes < dqbuf.dqb_isoftlimit && - dqbuf.dqb_curinodes >= qup->dqblk.dqb_isoftlimit) - qup->dqblk.dqb_itime = 0; - if (dqbuf.dqb_isoftlimit == 0 && id !=0 && - dqbuf.dqb_curinodes >= qup->dqblk.dqb_isoftlimit) - qup->dqblk.dqb_itime = 0; - qup->dqblk.dqb_curinodes = dqbuf.dqb_curinodes; - qup->dqblk.dqb_curblocks = dqbuf.dqb_curblocks; - if (quota_write(qf, &qup->dqblk, id) == 0) { - warn("%s", qup->qfname); - } - quota_close(qf); - } + for (qup = quplist; qup; qup = qup->next) + if (quota_write_limits(qup->qf, &qup->dqblk, id) == -1) + warn("%s", qup->fsname); } /* @@ -978,6 +930,7 @@ freeprivs(struct quotause *quplist) struct quotause *qup, *nextqup; for (qup = quplist; qup; qup = nextqup) { + quota_close(qup->qf); nextqup = qup->next; free(qup); }