svn commit: r210230 - stable/8/sys/geom/cache
Author: ru Date: Mon Jul 19 10:55:44 2010 New Revision: 210230 URL: http://svn.freebsd.org/changeset/base/210230 Log: MFC r210046: Fixed cache size decoding read from a label. PR: kern/144732 Modified: stable/8/sys/geom/cache/g_cache.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/cache/g_cache.h == --- stable/8/sys/geom/cache/g_cache.h Mon Jul 19 07:28:35 2010 (r210229) +++ stable/8/sys/geom/cache/g_cache.h Mon Jul 19 10:55:44 2010 (r210230) @@ -139,7 +139,7 @@ cache_metadata_decode(const u_char *data md-md_version = le32dec(data + 16); bcopy(data + 20, md-md_name, sizeof(md-md_name)); md-md_bsize = le32dec(data + 36); - md-md_size = le16dec(data + 40); + md-md_size = le32dec(data + 40); md-md_provsize = le64dec(data + 44); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210231 - stable/8/sys/amd64/amd64
Author: kib Date: Mon Jul 19 12:16:41 2010 New Revision: 210231 URL: http://svn.freebsd.org/changeset/base/210231 Log: MFC r209955: When switching the thread from the processor, store %dr7 content into the pcb before disabling watchpoints. Otherwise, when the thread is restored on a processor, watchpoints are still disabled. Modified: stable/8/sys/amd64/amd64/cpu_switch.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/cpu_switch.S == --- stable/8/sys/amd64/amd64/cpu_switch.S Mon Jul 19 10:55:44 2010 (r210230) +++ stable/8/sys/amd64/amd64/cpu_switch.S Mon Jul 19 12:16:41 2010 (r210231) @@ -245,13 +245,13 @@ store_dr: movq%dr2,%r13 movq%dr3,%r12 movq%dr6,%r11 - andq$0xfc00, %rax /* disable all watchpoints */ movq%r15,PCB_DR0(%r8) movq%r14,PCB_DR1(%r8) movq%r13,PCB_DR2(%r8) movq%r12,PCB_DR3(%r8) movq%r11,PCB_DR6(%r8) movq%rax,PCB_DR7(%r8) + andq$0xfc00, %rax /* disable all watchpoints */ movq%rax,%dr7 jmp done_store_dr ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210232 - stable/8/sys/ddb
Author: kib Date: Mon Jul 19 12:32:24 2010 New Revision: 210232 URL: http://svn.freebsd.org/changeset/base/210232 Log: MFC r209934: Use _SIG_VALID(). Modified: stable/8/sys/ddb/db_command.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ddb/db_command.c == --- stable/8/sys/ddb/db_command.c Mon Jul 19 12:16:41 2010 (r210231) +++ stable/8/sys/ddb/db_command.c Mon Jul 19 12:32:24 2010 (r210232) @@ -633,7 +633,7 @@ db_kill(dummy1, dummy2, dummy3, dummy4) if (!db_expression(pid)) DB_ERROR((Missing process ID\n)); db_skip_to_eol(); - if (sig 1 || sig _SIG_MAXSIG) + if (!_SIG_VALID(sig)) DB_ERROR((Signal number out of range\n)); /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210233 - stable/8/lib/libthr/thread
Author: kib Date: Mon Jul 19 12:37:28 2010 New Revision: 210233 URL: http://svn.freebsd.org/changeset/base/210233 Log: MFC r209933: Use _SIG_VALID instead of expanded form of the macro. Modified: stable/8/lib/libthr/thread/thr_sig.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_sig.c == --- stable/8/lib/libthr/thread/thr_sig.cMon Jul 19 12:32:24 2010 (r210232) +++ stable/8/lib/libthr/thread/thr_sig.cMon Jul 19 12:37:28 2010 (r210233) @@ -194,7 +194,7 @@ int _sigaction(int sig, const struct sigaction * act, struct sigaction * oact) { /* Check if the signal number is out of range: */ - if (sig 1 || sig _SIG_MAXSIG || sig == SIGCANCEL) { + if (!_SIG_VALID(sig) || sig == SIGCANCEL) { /* Return an invalid argument: */ errno = EINVAL; return (-1); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210234 - stable/8/lib/libc/compat-43
Author: kib Date: Mon Jul 19 12:41:05 2010 New Revision: 210234 URL: http://svn.freebsd.org/changeset/base/210234 Log: MFC r209932: For xsi_sigpause(3), remove the supplied signal from the process mask during sigpause(2) call. It was backward. Check that the signal number is valid. Modified: stable/8/lib/libc/compat-43/sigcompat.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/compat-43/sigcompat.c == --- stable/8/lib/libc/compat-43/sigcompat.c Mon Jul 19 12:37:28 2010 (r210233) +++ stable/8/lib/libc/compat-43/sigcompat.c Mon Jul 19 12:41:05 2010 (r210234) @@ -35,6 +35,7 @@ __FBSDID($FreeBSD$); #include namespace.h #include sys/param.h +#include errno.h #include signal.h #include string.h #include un-namespace.h @@ -111,9 +112,16 @@ int xsi_sigpause(int sig) { sigset_t set; + int error; - sigemptyset(set); - sigaddset(set, sig); + if (!_SIG_VALID(sig)) { + errno = EINVAL; + return (-1); + } + error = _sigprocmask(SIG_BLOCK, NULL, set); + if (error != 0) + return (error); + sigdelset(set, sig); return (_sigsuspend(set)); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210235 - stable/8/sys/sys
Author: kib Date: Mon Jul 19 12:52:19 2010 New Revision: 210235 URL: http://svn.freebsd.org/changeset/base/210235 Log: MFC r209197: Add assert to check that the (current) thread is in critical section. MFC r209204: Rename CRITSECT_ASSERT to CRITICAL_ASSERT Modified: stable/8/sys/sys/proc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/proc.h == --- stable/8/sys/sys/proc.h Mon Jul 19 12:41:05 2010(r210234) +++ stable/8/sys/sys/proc.h Mon Jul 19 12:52:19 2010(r210235) @@ -326,6 +326,9 @@ do { \ #defineTHREAD_LOCKPTR_ASSERT(td, lock) #endif +#defineCRITICAL_ASSERT(td) \ +KASSERT((td)-td_critnest = 1, (Not in critical section)); + /* * Flags kept in td_flags: * To change these you MUST have the scheduler lock. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210236 - vendor/opensolaris/dist/cmd/plockstat
Author: rpaulo Date: Mon Jul 19 14:57:01 2010 New Revision: 210236 URL: http://svn.freebsd.org/changeset/base/210236 Log: Import plockstat from OpenSolaris r12768. Added: vendor/opensolaris/dist/cmd/plockstat/ vendor/opensolaris/dist/cmd/plockstat/plockstat.c (contents, props changed) Added: vendor/opensolaris/dist/cmd/plockstat/plockstat.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/opensolaris/dist/cmd/plockstat/plockstat.c Mon Jul 19 14:57:01 2010(r210236) @@ -0,0 +1,996 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the License). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets [] replaced with your own identifying + * information: Portions Copyright [] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident %Z%%M% %I% %E% SMI + +#include assert.h +#include dtrace.h +#include limits.h +#include link.h +#include priv.h +#include signal.h +#include stdlib.h +#include stdarg.h +#include stdio.h +#include string.h +#include strings.h +#include errno.h +#include sys/wait.h +#include libgen.h +#include libproc.h + +static char *g_pname; +static dtrace_hdl_t *g_dtp; +struct ps_prochandle *g_pr; + +#defineE_SUCCESS 0 +#defineE_ERROR 1 +#defineE_USAGE 2 + +/* + * For hold times we use a global associative array since for mutexes, in + * user-land, it's not invalid to release a sychonization primitive that + * another thread acquired; rwlocks require a thread-local associative array + * since multiple thread can hold the same lock for reading. Note that we + * ignore recursive mutex acquisitions and releases as they don't truly + * affect lock contention. + */ +static const char *g_hold_init = +plockstat$target:::rw-acquire\n +{\n + self-rwhold[arg0] = timestamp;\n +}\n +plockstat$target:::mutex-acquire\n +/arg1 == 0/\n +{\n + mtxhold[arg0] = timestamp;\n +}\n; + +static const char *g_hold_histogram = +plockstat$target:::rw-release\n +/self-rwhold[arg0] arg1 == 1/\n +{\n + @rw_w_hold[arg0, ustack()] =\n + quantize(timestamp - self-rwhold[arg0]);\n + self-rwhold[arg0] = 0;\n + rw_w_hold_found = 1;\n +}\n +plockstat$target:::rw-release\n +/self-rwhold[arg0]/\n +{\n + @rw_r_hold[arg0, ustack()] =\n + quantize(timestamp - self-rwhold[arg0]);\n + self-rwhold[arg0] = 0;\n + rw_r_hold_found = 1;\n +}\n +plockstat$target:::mutex-release\n +/mtxhold[arg0] arg1 == 0/\n +{\n + @mtx_hold[arg0, ustack()] = quantize(timestamp - mtxhold[arg0]);\n + mtxhold[arg0] = 0;\n + mtx_hold_found = 1;\n +}\n +\n +END\n +/mtx_hold_found/\n +{\n + trace(\Mutex hold\);\n + printa(@mtx_hold);\n +}\n +END\n +/rw_r_hold_found/\n +{\n + trace(\R/W reader hold\);\n + printa(@rw_r_hold);\n +}\n +END\n +/rw_w_hold_found/\n +{\n + trace(\R/W writer hold\);\n + printa(@rw_w_hold);\n +}\n; + +static const char *g_hold_times = +plockstat$target:::rw-release\n +/self-rwhold[arg0] arg1 == 1/\n +{\n + @rw_w_hold[arg0, ustack(5)] = sum(timestamp - self-rwhold[arg0]);\n + @rw_w_hold_count[arg0, ustack(5)] = count();\n + self-rwhold[arg0] = 0;\n + rw_w_hold_found = 1;\n +}\n +plockstat$target:::rw-release\n +/self-rwhold[arg0]/\n +{\n + @rw_r_hold[arg0, ustack(5)] = sum(timestamp - self-rwhold[arg0]);\n + @rw_r_hold_count[arg0, ustack(5)] = count();\n + self-rwhold[arg0] = 0;\n + rw_r_hold_found = 1;\n +}\n +plockstat$target:::mutex-release\n +/mtxhold[arg0] arg1 == 0/\n +{\n + @mtx_hold[arg0, ustack(5)] = sum(timestamp - mtxhold[arg0]);\n + @mtx_hold_count[arg0, ustack(5)] = count();\n + mtxhold[arg0] = 0;\n + mtx_hold_found = 1;\n +}\n +\n +END\n +/mtx_hold_found/\n +{\n + trace(\Mutex hold\);\n + printa(@mtx_hold, @mtx_hold_count);\n +}\n +END\n +/rw_r_hold_found/\n +{\n + trace(\R/W reader hold\);\n + printa(@rw_r_hold, @rw_r_hold_count);\n +}\n +END\n +/rw_w_hold_found/\n +{\n + trace(\R/W writer hold\);\n + printa(@rw_w_hold, @rw_w_hold_count);\n +}\n; + + +/* + * For contention, we use thread-local associative arrays since we're tracing + * a single thread's
svn commit: r210237 - head/cddl/contrib/opensolaris/cmd/plockstat
Author: rpaulo Date: Mon Jul 19 14:59:23 2010 New Revision: 210237 URL: http://svn.freebsd.org/changeset/base/210237 Log: MFV: OpenSolaris' plockstat utility. Sponsored by: The FreeBSD Foundation Added: head/cddl/contrib/opensolaris/cmd/plockstat/ - copied from r210236, vendor/opensolaris/dist/cmd/plockstat/ Modified: Directory Properties: head/cddl/contrib/opensolaris/ (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r210225 - in head/sys: kern sys
Bruce Evans b...@optusnet.com.au writes: The /** marker is already used to make doxygen markup especially ugly. I don't know if this is part of the doxygen markup or of the @foo markup does everything. The presence or absence of @keywords is irrelevant, and there are alternative syntaxes, but /** is the most commonly used marker. DES -- Dag-Erling Smørgrav - d...@des.no ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210238 - head/sys/dev/flash
Author: adrian Date: Mon Jul 19 15:05:35 2010 New Revision: 210238 URL: http://svn.freebsd.org/changeset/base/210238 Log: Include 4k/32k erase commands. These were sourced from the MX25L128 datasheet and match up with what is used in Linux mtd/devices/m25p80.c . Add a FreeBSD keyword whilst I'm here. Modified: head/sys/dev/flash/mx25lreg.h (contents, props changed) Modified: head/sys/dev/flash/mx25lreg.h == --- head/sys/dev/flash/mx25lreg.h Mon Jul 19 14:59:23 2010 (r210237) +++ head/sys/dev/flash/mx25lreg.h Mon Jul 19 15:05:35 2010 (r210238) @@ -23,6 +23,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #ifndef __MX25LREG_H__ @@ -41,6 +43,8 @@ #define CMD_PAGE_PROGRAM 0x02 #define CMD_SECTOR_ERASE 0xD8 #define CMD_BULK_ERASE 0xC7 +#defineCMD_BLOCK_4K_ERASE 0x20 +#defineCMD_BLOCK_32K_ERASE 0x52 /* * Status register flags ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210239 - in stable/8/release/doc: en_US.ISO8859-1/errata en_US.ISO8859-1/relnotes share/sgml
Author: hrs Date: Mon Jul 19 15:26:42 2010 New Revision: 210239 URL: http://svn.freebsd.org/changeset/base/210239 Log: - Clean up old contents and bump version numbers. - Add items for security advisories. Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml stable/8/release/doc/share/sgml/release.dsl stable/8/release/doc/share/sgml/release.ent Modified: stable/8/release/doc/en_US.ISO8859-1/errata/article.sgml == --- stable/8/release/doc/en_US.ISO8859-1/errata/article.sgmlMon Jul 19 15:05:35 2010(r210238) +++ stable/8/release/doc/en_US.ISO8859-1/errata/article.sgmlMon Jul 19 15:26:42 2010(r210239) @@ -16,7 +16,7 @@ !ENTITY % release PUBLIC -//FreeBSD//ENTITIES Release Specification//EN %release; -!ENTITY release.bugfix 8.0-RELEASE +!ENTITY release.bugfix 8.1-RELEASE ] article @@ -40,7 +40,7 @@ pubdate$FreeBSD$/pubdate copyright - year2009/year + year2010/year holder role=mailto:d...@freebsd.org;The os; Documentation Project/holder /copyright @@ -119,7 +119,6 @@ paraFor a list of all os; CERT security advisories, see ulink url=http://www.FreeBSD.org/security/;/ulink or ulink url=ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/;/ulink./para - /sect1 sect1 id=security @@ -144,34 +143,74 @@ tbody row - entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-09:17.freebsd-update.asc; - SA-09:17.freebsd-update/ulink/entry - entry03nbsp;Decembernbsp;2009/entry - entryparaInappropriate directory permissions in freebsd-update(8)/para/entry + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-09:15.ssl.asc; + SA-09:15.ssl/ulink/entry + entry3nbsp;Decnbsp;2009/entry + entryparaSSL protocol flaw/para/entry /row row entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-09:16.rtld.asc; SA-09:16.rtld/ulink/entry - entry03nbsp;Decembernbsp;2009/entry - entryparaImproper environment sanitization in rtld(1)/para/entry + entry3nbsp;Decnbsp;2009/entry + entryparaImproper environment sanitization in man.rtld.1;/para/entry /row row - entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-09:15.ssl.asc; - SA-09:15.ssl/ulink/entry - entry03nbsp;Decembernbsp;2009/entry - entryparaSSL protocol flaw/para/entry + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-09:17.freebsd-update.asc; + SA-09:17.freebsd-update/ulink/entry + entry3nbsp;Decnbsp;2009/entry + entryparaInappropriate directory permissions in man.freebsd-update.8;/para/entry + /row + row + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-10:01.bind.asc; + SA-10:01.bind/ulink/entry + entry6nbsp;Jannbsp;2010/entry + entryparaBIND man.named.8; cache poisoning with DNSSEC validation/para/entry + /row + row + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-10:02.ntpd.asc; + SA-10:02.ntpd/ulink/entry + entry6nbsp;Jannbsp;2010/entry + entryparantpd mode 7 denial of service/para/entry + /row + row + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-10:03.zfs.asc; + SA-10:03.zfs/ulink/entry + entry6nbsp;Jannbsp;2010/entry + entryparaZFS ZIL playback with insecure permissions/para/entry + /row + row + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-10:04.jail.asc; + SA-10:04.jail/ulink/entry + entry27nbsp;Maynbsp;2010/entry + entryparaInsufficient environment sanitization in man.jail.8;/para/entry + /row + row + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-10:05.opie.asc; + SA-10:05.opie/ulink/entry + entry27nbsp;Maynbsp;2010/entry + entryparaOPIE off-by-one stack overflow/para/entry + /row + row + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-10:06.nfsclient.asc; + SA-10:06.nfsclient/ulink/entry + entry27nbsp;Maynbsp;2010/entry + entryparaUnvalidated input in nfsclient/para/entry + /row + row + entryulink url=http://security.freebsd.org/advisories/FreeBSD-SA-10:07.mbuf.asc; + SA-10:07.mbuf/ulink/entry + entry13nbsp;Julynbsp;2010/entry + entryparaLost mbuf flag resulting in data corruption/para/entry /row /tbody
svn commit: r210243 - head/usr.sbin/tzsetup
Author: nork Date: Mon Jul 19 16:38:45 2010 New Revision: 210243 URL: http://svn.freebsd.org/changeset/base/210243 Log: Fix support for chrooted installs. Approved by: imp (mentor) Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c == --- head/usr.sbin/tzsetup/tzsetup.c Mon Jul 19 16:08:47 2010 (r210242) +++ head/usr.sbin/tzsetup/tzsetup.c Mon Jul 19 16:38:45 2010 (r210243) @@ -821,16 +821,16 @@ main(int argc, char **argv) or you don't know, please choose NO here!); if (!DIALOG_UTC(title, prompt, 7, 72)) { if (reallydoit) - unlink(_PATH_WALL_CMOS_CLOCK); + unlink(path_wall_cmos_clock); } else { if (reallydoit) { - fd = open(_PATH_WALL_CMOS_CLOCK, + fd = open(path_wall_cmos_clock, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IRGRP | S_IROTH); if (fd 0) { end_dialog(); err(1, create %s, - _PATH_WALL_CMOS_CLOCK); + path_wall_cmos_clock); } close(fd); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210244 - head/sys/pci
Author: yongari Date: Mon Jul 19 18:01:06 2010 New Revision: 210244 URL: http://svn.freebsd.org/changeset/base/210244 Log: Implement WOL. WOL is supported on RTL8139B or newer controllers. PR: kern/148013 Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c == --- head/sys/pci/if_rl.cMon Jul 19 16:38:45 2010(r210243) +++ head/sys/pci/if_rl.cMon Jul 19 18:01:06 2010(r210244) @@ -222,6 +222,8 @@ static int rl_suspend(device_t); static void rl_tick(void *); static void rl_txeof(struct rl_softc *); static void rl_watchdog(struct rl_softc *); +static void rl_setwol(struct rl_softc *); +static void rl_clrwol(struct rl_softc *); #ifdef RL_USEIOSPACE #define RL_RES SYS_RES_IOPORT @@ -803,7 +805,7 @@ rl_attach(device_t dev) struct rl_type *t; struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; - int error = 0, i, rid; + int error = 0, hwrev, i, pmc, rid; int unit; uint16_trl_did = 0; chartn[32]; @@ -938,6 +940,25 @@ rl_attach(device_t dev) ifp-if_start = rl_start; ifp-if_init = rl_init; ifp-if_capabilities = IFCAP_VLAN_MTU; + /* Check WOL for RTL8139B or newer controllers. */ + if (sc-rl_type == RL_8139 + pci_find_extcap(sc-rl_dev, PCIY_PMG, pmc) == 0) { + hwrev = CSR_READ_4(sc, RL_TXCFG) RL_TXCFG_HWREV; + switch (hwrev) { + case RL_HWREV_8139B: + case RL_HWREV_8130: + case RL_HWREV_8139C: + case RL_HWREV_8139D: + case RL_HWREV_8101: + case RL_HWREV_8100: + ifp-if_capabilities |= IFCAP_WOL; + /* Disable WOL. */ + rl_clrwol(sc); + break; + default: + break; + } + } ifp-if_capenable = ifp-if_capabilities; #ifdef DEVICE_POLLING ifp-if_capabilities |= IFCAP_POLLING; @@ -1926,7 +1947,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma struct ifreq*ifr = (struct ifreq *)data; struct mii_data *mii; struct rl_softc *sc = ifp-if_softc; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFFLAGS: @@ -1953,6 +1974,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma error = ifmedia_ioctl(ifp, ifr, mii-mii_media, command); break; case SIOCSIFCAP: + mask = ifr-ifr_reqcap ^ ifp-if_capenable; #ifdef DEVICE_POLLING if (ifr-ifr_reqcap IFCAP_POLLING !(ifp-if_capenable IFCAP_POLLING)) { @@ -1978,6 +2000,15 @@ rl_ioctl(struct ifnet *ifp, u_long comma return (error); } #endif /* DEVICE_POLLING */ + if ((mask IFCAP_WOL) != 0 + (ifp-if_capabilities IFCAP_WOL) != 0) { + if ((mask IFCAP_WOL_UCAST) != 0) + ifp-if_capenable ^= IFCAP_WOL_UCAST; + if ((mask IFCAP_WOL_MCAST) != 0) + ifp-if_capenable ^= IFCAP_WOL_MCAST; + if ((mask IFCAP_WOL_MAGIC) != 0) + ifp-if_capenable ^= IFCAP_WOL_MAGIC; + } break; default: error = ether_ioctl(ifp, command, data); @@ -2066,6 +2097,7 @@ rl_suspend(device_t dev) RL_LOCK(sc); rl_stop(sc); + rl_setwol(sc); sc-suspended = 1; RL_UNLOCK(sc); @@ -2082,12 +2114,31 @@ rl_resume(device_t dev) { struct rl_softc *sc; struct ifnet*ifp; + int pmc; + uint16_tpmstat; sc = device_get_softc(dev); ifp = sc-rl_ifp; RL_LOCK(sc); + if ((ifp-if_capabilities IFCAP_WOL) != 0 + pci_find_extcap(sc-rl_dev, PCIY_PMG, pmc) == 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc-rl_dev, + pmc + PCIR_POWER_STATUS, 2); + if ((pmstat PCIM_PSTAT_PMEENABLE) != 0) { + pmstat = ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc-rl_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } + /* +* Clear WOL matching such that normal Rx filtering +* wouldn't interfere with WOL patterns. +*/ + rl_clrwol(sc); + } + /* reinitialize interface if necessary */ if (ifp-if_flags IFF_UP)
svn commit: r210245 - head/contrib/binutils/ld/emultempl
Author: avg Date: Mon Jul 19 18:20:44 2010 New Revision: 210245 URL: http://svn.freebsd.org/changeset/base/210245 Log: binutils/ld: fix incorrect placement of __start_SECNAME in some cases __start_SECNAME and __stop_SECNAME symbols are automatically generated by ld for orphan sections, i.e. those not explicitely referenced by a linker script. The symbols are supposed to be placed correspondingly at the start and the end of the section in output file. In some cases __start_SECNAME may be placed at the address after the end of the previous section (if any) and before the start the section. This happens when following conditions are met: 1. the orphan section is found in more than one input file 2. the orphan section has different alignment requirements across input files 3. the first instance of the section encountered doesn't have the greatest alignment requirement In these conditions resulting output section will be placed at address after the end of the previous section aligned to the greatest alignment requirement in the inputs, but __start_SECNAME will be placed at address after the end of the previous section aligned to the alignment requirement of the first input in which the section is encountered. See commit message of r196118 for a concrete example of problems caused by this bug. The fix is to place __start_SECNAME inside the section and use ABSOLUTE directive, rather than placing __start_SECNAME outside the section and trying to guess address alignment. This fix is in line with upstream binutils change/fix made between versions 2.19 and 2.20 in revision of 1.307 ldlang.c. MFC after:3 weeks Modified: head/contrib/binutils/ld/emultempl/elf32.em Modified: head/contrib/binutils/ld/emultempl/elf32.em == --- head/contrib/binutils/ld/emultempl/elf32.em Mon Jul 19 18:01:06 2010 (r210244) +++ head/contrib/binutils/ld/emultempl/elf32.em Mon Jul 19 18:20:44 2010 (r210245) @@ -1314,26 +1314,6 @@ gld${EMULATION_NAME}_place_orphan (lang_ lang_list_init (stat_ptr); } - if (config.build_constructors) -{ - /* If the name of the section is representable in C, then create -symbols to mark the start and the end of the section. */ - for (ps = secname; *ps != '\0'; ps++) - if (! ISALNUM (*ps) *ps != '_') - break; - if (*ps == '\0') - { - char *symname; - etree_type *e_align; - - symname = (char *) xmalloc (ps - secname + sizeof __start_); - sprintf (symname, __start_%s, secname); - e_align = exp_unop (ALIGN_K, - exp_intop ((bfd_vma) 1 s-alignment_power)); - lang_add_assignment (exp_assop ('=', symname, e_align)); - } -} - address = NULL; if (link_info.relocatable || (s-flags (SEC_LOAD | SEC_ALLOC)) == 0) address = exp_intop ((bfd_vma) 0); @@ -1354,6 +1334,26 @@ gld${EMULATION_NAME}_place_orphan (lang_ (etree_type *) NULL, load_base); + if (config.build_constructors) +{ + /* If the name of the section is representable in C, then create +symbols to mark the start and the end of the section. */ + for (ps = secname; *ps != '\0'; ps++) + if (! ISALNUM (*ps) *ps != '_') + break; + if (*ps == '\0') + { + char *symname; + etree_type *e_align; + + symname = (char *) xmalloc (ps - secname + sizeof __start_); + sprintf (symname, __start_%s, secname); + lang_add_assignment (exp_assop ('=', symname, + exp_unop (ABSOLUTE, + exp_nameop (NAME, .; + } +} + lang_add_section (os-children, s, os, file); lang_leave_output_section_statement ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210246 - in head/sys: arm/mv conf dev/fdt
Author: raj Date: Mon Jul 19 18:41:50 2010 New Revision: 210246 URL: http://svn.freebsd.org/changeset/base/210246 Log: Move MRVL FDT fixups and PIC decode routine to a platform specific area. This allows for better encapsulation (and eliminates generic fdt_arm.c, at least for now). Deleted: head/sys/dev/fdt/fdt_arm.c Modified: head/sys/arm/mv/common.c head/sys/conf/files.arm Modified: head/sys/arm/mv/common.c == --- head/sys/arm/mv/common.cMon Jul 19 18:20:44 2010(r210245) +++ head/sys/arm/mv/common.cMon Jul 19 18:41:50 2010(r210246) @@ -1834,3 +1834,45 @@ fdt_win_setup(void) return (0); } + +static void +fdt_fixup_busfreq(phandle_t root) +{ + phandle_t sb; + pcell_t freq; + + /* +* This fixup sets the simple-bus bus-frequency property. +*/ + + if ((sb = fdt_find_compatible(root, simple-bus, 1)) == 0) + return; + + freq = cpu_to_fdt32(get_tclk()); + OF_setprop(sb, bus-frequency, (void *)freq, sizeof(freq)); +} + +struct fdt_fixup_entry fdt_fixup_table[] = { + { mrvl,DB-88F6281, fdt_fixup_busfreq }, + { NULL, NULL } +}; + +static int +fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, +int *pol) +{ + + if (!fdt_is_compatible(node, mrvl,pic)) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + +fdt_pic_decode_t fdt_pic_table[] = { + fdt_pic_decode_ic, + NULL +}; Modified: head/sys/conf/files.arm == --- head/sys/conf/files.arm Mon Jul 19 18:20:44 2010(r210245) +++ head/sys/conf/files.arm Mon Jul 19 18:41:50 2010(r210246) @@ -47,7 +47,6 @@ arm/arm/vm_machdep.c standard arm/fpe-arm/armfpe_glue.S optionalarmfpe arm/fpe-arm/armfpe_init.c optionalarmfpe arm/fpe-arm/armfpe.S optionalarmfpe -dev/fdt/fdt_arm.c optionalfdt dev/hwpmc/hwpmc_arm.c optionalhwpmc dev/ofw/openfirm.c optionalfdt dev/ofw/openfirmio.c optionalfdt ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210247 - in head/sys: arm/include arm/mv dev/fdt dev/uart powerpc/booke powerpc/include
Author: raj Date: Mon Jul 19 18:47:18 2010 New Revision: 210247 URL: http://svn.freebsd.org/changeset/base/210247 Log: Eliminate FDT_IMMR_VA define. This removes platform dependencies from machine/fdt.h for the benfit of portability. Modified: head/sys/arm/include/fdt.h head/sys/arm/mv/mv_machdep.c head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/uart/uart_bus_fdt.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/fdt.h Modified: head/sys/arm/include/fdt.h == --- head/sys/arm/include/fdt.h Mon Jul 19 18:41:50 2010(r210246) +++ head/sys/arm/include/fdt.h Mon Jul 19 18:47:18 2010(r210247) @@ -37,18 +37,10 @@ #include vm/vm.h #include vm/pmap.h +#include machine/bus.h #include machine/pmap.h #include machine/intr.h -#include arm/mv/mvvar.h -#include arm/mv/mvwin.h - -/* - * This is the base virtual address the internal mem-mapped registers (IMMR) - * range is available at. - */ -#define FDT_IMMR_VAMV_BASE - /* Max interrupt number */ #define FDT_INTR_MAX NIRQ Modified: head/sys/arm/mv/mv_machdep.c == --- head/sys/arm/mv/mv_machdep.cMon Jul 19 18:41:50 2010 (r210246) +++ head/sys/arm/mv/mv_machdep.cMon Jul 19 18:47:18 2010 (r210247) @@ -380,7 +380,7 @@ initarm(void *mdp, void *unused __unused memsize) != 0) while(1); - if (fdt_immr_addr() != 0) + if (fdt_immr_addr(MV_BASE) != 0) while (1); /* Platform-specific initialisation */ Modified: head/sys/dev/fdt/fdt_common.c == --- head/sys/dev/fdt/fdt_common.c Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/fdt/fdt_common.c Mon Jul 19 18:47:18 2010 (r210247) @@ -63,7 +63,7 @@ vm_offset_t fdt_immr_va; vm_offset_t fdt_immr_size; int -fdt_immr_addr(void) +fdt_immr_addr(vm_offset_t immr_va) { pcell_t ranges[6], *rangesptr; phandle_t node; @@ -122,7 +122,7 @@ moveon: size = fdt_data_get((void *)rangesptr, size_cells); fdt_immr_pa = base; - fdt_immr_va = FDT_IMMR_VA; + fdt_immr_va = immr_va; fdt_immr_size = size; return (0); Modified: head/sys/dev/fdt/fdt_common.h == --- head/sys/dev/fdt/fdt_common.h Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/fdt/fdt_common.h Mon Jul 19 18:47:18 2010 (r210247) @@ -90,7 +90,7 @@ int fdt_data_verify(void *, int); phandle_t fdt_find_compatible(phandle_t, const char *, int); int fdt_get_mem_regions(struct mem_region *, int *, uint32_t *); int fdt_get_phyaddr(phandle_t node, int *); -int fdt_immr_addr(void); +int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); int fdt_intr_decode(phandle_t, pcell_t *, int *, int *, int *); int fdt_intr_to_rl(phandle_t, struct resource_list *, struct fdt_sense_level *); Modified: head/sys/dev/uart/uart_bus_fdt.c == --- head/sys/dev/uart/uart_bus_fdt.cMon Jul 19 18:41:50 2010 (r210246) +++ head/sys/dev/uart/uart_bus_fdt.cMon Jul 19 18:47:18 2010 (r210247) @@ -188,7 +188,7 @@ uart_cpu_getdev(int devtype, struct uart err = fdt_regsize(node, start, size); if (err) return (ENXIO); - start += FDT_IMMR_VA; + start += fdt_immr_va; uart_bus_space_mem = fdtbus_bs_tag; uart_bus_space_io = NULL; Modified: head/sys/powerpc/booke/machdep.c == --- head/sys/powerpc/booke/machdep.cMon Jul 19 18:41:50 2010 (r210246) +++ head/sys/powerpc/booke/machdep.cMon Jul 19 18:47:18 2010 (r210247) @@ -319,7 +319,7 @@ e500_init(u_int32_t startkernel, u_int32 if (OF_init((void *)dtbp) != 0) while (1); - if (fdt_immr_addr() != 0) + if (fdt_immr_addr(CCSRBAR_VA) != 0) while (1); OF_interpret(perform-fixup, 0); Modified: head/sys/powerpc/include/fdt.h == --- head/sys/powerpc/include/fdt.h Mon Jul 19 18:41:50 2010 (r210246) +++ head/sys/powerpc/include/fdt.h Mon Jul 19 18:47:18 2010 (r210247) @@ -34,14 +34,6 @@ #include machine/bus.h #include machine/intr_machdep.h -#include machine/platform.h -#include machine/vmparam.h - -/* - * This is the base virtual address the internal mem-mapped registers (IMMR) - * range is available at. - */ -#define FDT_IMMR_VACCSRBAR_VA /* Max interrupt number */ #define FDT_INTR_MAX INTR_VECTORS
svn commit: r210248 - head/sys/dev/syscons
Author: jkim Date: Mon Jul 19 18:56:18 2010 New Revision: 210248 URL: http://svn.freebsd.org/changeset/base/210248 Log: Fix two long-standing line wrapping bugs in VGA renderer for pixel mode. Font size may be smaller than 16 and logical scan line may be larger than the displayed scan line. MFC after:3 days Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c == --- head/sys/dev/syscons/scvgarndr.cMon Jul 19 18:47:18 2010 (r210247) +++ head/sys/dev/syscons/scvgarndr.cMon Jul 19 18:56:18 2010 (r210248) @@ -766,8 +766,9 @@ vga_vgadraw_direct(scr_stat *scp, int fr d += 8 * pixel_size; if ((i % scp-xsize) == scp-xsize - 1) - d += scp-xoff * 16 * pixel_size + -(scp-font_size - 1) * line_width; + d += scp-xoff * scp-font_size * pixel_size + + scp-font_size * line_width - + scp-xpixel * pixel_size; } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210249 - in head/sys: arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion conf
Author: raj Date: Mon Jul 19 19:19:33 2010 New Revision: 210249 URL: http://svn.freebsd.org/changeset/base/210249 Log: Now that we are fully FDT-driven on MRVL platforms, remove PHYSMEM_SIZE option. Modified: head/sys/arm/mv/discovery/std.db78xxx head/sys/arm/mv/kirkwood/std.db88f6xxx head/sys/arm/mv/kirkwood/std.sheevaplug head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/orion/std.db88f5xxx head/sys/conf/options.arm Modified: head/sys/arm/mv/discovery/std.db78xxx == --- head/sys/arm/mv/discovery/std.db78xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/discovery/std.db78xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -9,5 +9,4 @@ makeoptions KERNVIRTADDR=0xc090 optionsKERNPHYSADDR=0x0090 optionsKERNVIRTADDR=0xc090 optionsPHYSADDR=0x -optionsPHYSMEM_SIZE=0x2000 optionsSTARTUP_PAGETABLE_ADDR=0x0010 Modified: head/sys/arm/mv/kirkwood/std.db88f6xxx == --- head/sys/arm/mv/kirkwood/std.db88f6xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/kirkwood/std.db88f6xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -3,5 +3,3 @@ include../mv/std.mv include ../mv/kirkwood/std.kirkwood files ../mv/kirkwood/files.kirkwood - -optionsPHYSMEM_SIZE=0x2000 Modified: head/sys/arm/mv/kirkwood/std.sheevaplug == --- head/sys/arm/mv/kirkwood/std.sheevaplug Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/kirkwood/std.sheevaplug Mon Jul 19 19:19:33 2010 (r210249) @@ -3,5 +3,3 @@ include../mv/std.mv include ../mv/kirkwood/std.kirkwood files ../mv/kirkwood/files.sheevaplug - -optionsPHYSMEM_SIZE=0x2000 Modified: head/sys/arm/mv/mv_machdep.c == --- head/sys/arm/mv/mv_machdep.cMon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/mv_machdep.cMon Jul 19 19:19:33 2010 (r210249) @@ -153,7 +153,7 @@ static int availmem_regions_sz; static void print_kenv(void); static void print_kernel_section_addr(void); -static void physmap_init(int); +static void physmap_init(void); static int platform_devmap_init(void); static int platform_mpp_init(void); @@ -202,7 +202,7 @@ print_kernel_section_addr(void) } static void -physmap_init(int hardcoded) +physmap_init(void) { int i, j, cnt; vm_offset_t phys_kernelend, kernload; @@ -213,22 +213,6 @@ physmap_init(int hardcoded) kernload = KERNPHYSADDR; /* -* Use hardcoded physical addresses if we don't use memory regions -* from metadata. -*/ - if (hardcoded) { - phys_avail[0] = 0; - phys_avail[1] = kernload; - - phys_avail[2] = phys_kernelend; - phys_avail[3] = PHYSMEM_SIZE; - - phys_avail[4] = 0; - phys_avail[5] = 0; - return; - } - - /* * Remove kernel physical address range from avail * regions list. Page align all regions. * Non-page aligned memory isn't very interesting to us. @@ -352,12 +336,6 @@ initarm(void *mdp, void *unused __unused } else { /* Fall back to hardcoded metadata. */ lastaddr = fake_preload_metadata(); - - /* -* Assume a single memory region of size specified in board -* configuration file. -*/ - memsize = PHYSMEM_SIZE; } #if defined(FDT_DTB_STATIC) @@ -602,10 +580,8 @@ initarm(void *mdp, void *unused __unused /* * Prepare map of physical memory regions available to vm subsystem. -* If metadata pointer doesn't point to a valid address, use hardcoded -* values. */ - physmap_init((mdp != NULL) ? 0 : 1); + physmap_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: head/sys/arm/mv/orion/std.db88f5xxx == --- head/sys/arm/mv/orion/std.db88f5xxx Mon Jul 19 18:56:18 2010 (r210248) +++ head/sys/arm/mv/orion/std.db88f5xxx Mon Jul 19 19:19:33 2010 (r210249) @@ -9,5 +9,4 @@ makeoptions KERNVIRTADDR=0xc090 optionsKERNPHYSADDR=0x0090 optionsKERNVIRTADDR=0xc090 optionsPHYSADDR=0x -optionsPHYSMEM_SIZE=0x0800 optionsSTARTUP_PAGETABLE_ADDR=0x0010 Modified: head/sys/conf/options.arm == ---
svn commit: r210251 - stable/8/lib/libjail
Author: jamie Date: Mon Jul 19 19:51:17 2010 New Revision: 210251 URL: http://svn.freebsd.org/changeset/base/210251 Log: MFC r210133: Don't import parameter values in jail_getv, except for the search key. Remove the internal jailparam_vlist, in favor of using variants of its logic separately in jail_setv and jail_getv. Free the temporary parameter list and exported values in jail_setv and jail_getv. Noted by: Stanislav Uzunchev Modified: stable/8/lib/libjail/jail.c Directory Properties: stable/8/lib/libjail/ (props changed) Modified: stable/8/lib/libjail/jail.c == --- stable/8/lib/libjail/jail.c Mon Jul 19 19:40:38 2010(r210250) +++ stable/8/lib/libjail/jail.c Mon Jul 19 19:51:17 2010(r210251) @@ -56,7 +56,6 @@ __FBSDID($FreeBSD$); static int jailparam_import_enum(const char **values, int nvalues, const char *valstr, size_t valsize, int *value); -static int jailparam_vlist(struct jailparam **jpp, va_list ap); static int jailparam_type(struct jailparam *jp); static char *noname(const char *name); static char *nononame(const char *name); @@ -74,16 +73,31 @@ static const char *jailsys_values[] = { int jail_setv(int flags, ...) { - va_list ap; + va_list ap, tap; struct jailparam *jp; - int njp; + const char *name, *value; + int njp, jid; + /* Create the parameter list and import the parameters. */ va_start(ap, flags); - njp = jailparam_vlist(jp, ap); + va_copy(tap, ap); + for (njp = 0; va_arg(tap, char *) != NULL; njp++) + (void)va_arg(tap, char *); + va_end(tap); + jp = alloca(njp * sizeof(struct jailparam)); + for (njp = 0; (name = va_arg(ap, char *)) != NULL; njp++) { + value = va_arg(ap, char *); + if (jailparam_init(jp + njp, name) 0 || + jailparam_import(jp + njp, value) 0) { + jailparam_free(jp, njp); + va_end(ap); + return (-1); + } + } va_end(ap); - if (njp 0) - return (njp); - return (jailparam_set(jp, njp, flags)); + jid = jailparam_set(jp, njp, flags); + jailparam_free(jp, njp); + return (jid); } /* @@ -94,48 +108,85 @@ int jail_getv(int flags, ...) { va_list ap, tap; - struct jailparam *jp; - char *valarg; - const char *value; - int njp, i, jid, namekey, zero; + struct jailparam *jp, *jp_lastjid, *jp_jid, *jp_name, *jp_key; + char *valarg, *value; + const char *name, *key_value, *lastjid_value, *jid_value, *name_value; + int njp, i, jid; + /* Create the parameter list and find the key. */ va_start(ap, flags); va_copy(tap, ap); - njp = jailparam_vlist(jp, tap); + for (njp = 0; va_arg(tap, char *) != NULL; njp++) + (void)va_arg(tap, char *); va_end(tap); - if (njp 0) - return (njp); - /* -* See if the name is the search key. If so, we don't want to write -* it back in case it's a read-only string. -*/ - namekey = 1; - zero = 0; - for (i = 0; i njp; i++) { - if (!strcmp(jp-jp_name, lastjid) || - (!strcmp(jp-jp_name, jid) -memcmp(jp-jp_value, zero, sizeof(zero - namekey = 0; + + jp = alloca(njp * sizeof(struct jailparam)); + va_copy(tap, ap); + jp_lastjid = jp_jid = jp_name = NULL; + lastjid_value = jid_value = name_value = NULL; + for (njp = 0; (name = va_arg(tap, char *)) != NULL; njp++) { + value = va_arg(tap, char *); + if (jailparam_init(jp + njp, name) 0) { + va_end(tap); + goto error; + } + if (!strcmp(jp[njp].jp_name, lastjid)) { + jp_lastjid = jp + njp; + lastjid_value = value; + } else if (!strcmp(jp[njp].jp_name, jid)) { + jp_jid = jp + njp; + jid_value = value; + } if (!strcmp(jp[njp].jp_name, name)) { + jp_name = jp + njp; + name_value = value; + } } - jid = jailparam_get(jp, njp, flags); - if (jid 0) { - va_end(ap); - return (-1); + va_end(tap); + /* Import the key parameter. */ + if (jp_lastjid != NULL) { + jp_key = jp_lastjid; + key_value = lastjid_value; + } else if (jp_jid != NULL strtol(jid_value, NULL, 10) != 0) { + jp_key = jp_jid; + key_value = jid_value; + } else if (jp_name != NULL) { + jp_key = jp_name; + key_value =
svn commit: r210252 - stable/8/lib/libjail
Author: jamie Date: Mon Jul 19 19:52:02 2010 New Revision: 210252 URL: http://svn.freebsd.org/changeset/base/210252 Log: MFC r210134: Don't copy and return a potentially unset buffer when jail_get fails. Modified: stable/8/lib/libjail/jail_getid.c Directory Properties: stable/8/lib/libjail/ (props changed) Modified: stable/8/lib/libjail/jail_getid.c == --- stable/8/lib/libjail/jail_getid.c Mon Jul 19 19:51:17 2010 (r210251) +++ stable/8/lib/libjail/jail_getid.c Mon Jul 19 19:52:02 2010 (r210252) @@ -94,11 +94,15 @@ jail_getname(int jid) jiov[5].iov_len = JAIL_ERRMSGLEN; jail_errmsg[0] = 0; jid = jail_get(jiov, 6, 0); - if (jid 0 !jail_errmsg[0]) - snprintf(jail_errmsg, JAIL_ERRMSGLEN, jail_get: %s, - strerror(errno)); - name = strdup(namebuf); - if (name == NULL) - strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN); + if (jid 0) { + if (!jail_errmsg[0]) + snprintf(jail_errmsg, JAIL_ERRMSGLEN, jail_get: %s, + strerror(errno)); + return NULL; + } else { + name = strdup(namebuf); + if (name == NULL) + strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN); + } return name; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210254 - in head/etc: defaults periodic/security
Author: gabor Date: Mon Jul 19 20:19:14 2010 New Revision: 210254 URL: http://svn.freebsd.org/changeset/base/210254 Log: - Add a periodic script, which can be used to find installed ports' files with mismatched checksum PR: conf/124641 Submitted by: Alex Kozlov s...@rm-rf.kiev.ua Approved by: delphij (mentor) Added: head/etc/periodic/security/460.chkportsum (contents, props changed) Modified: head/etc/defaults/periodic.conf head/etc/periodic/security/Makefile Modified: head/etc/defaults/periodic.conf == --- head/etc/defaults/periodic.conf Mon Jul 19 19:54:37 2010 (r210253) +++ head/etc/defaults/periodic.conf Mon Jul 19 20:19:14 2010 (r210254) @@ -171,6 +171,9 @@ daily_status_security_passwdless_enable= # 410.logincheck daily_status_security_logincheck_enable=YES +# 460.chkportsum +daily_status_security_chkportsum_enable=NO # Check ports w/ wrong checksum + # 500.ipfwdenied daily_status_security_ipfwdenied_enable=YES Added: head/etc/periodic/security/460.chkportsum == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/periodic/security/460.chkportsum Mon Jul 19 20:19:14 2010 (r210254) @@ -0,0 +1,68 @@ +#!/bin/sh - +# +# Copyright (c) 2010 The FreeBSD Project +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +if [ -r /etc/defaults/periodic.conf ] +then +. /etc/defaults/periodic.conf +source_periodic_confs +fi + +. /etc/periodic/security/security.functions + +rc=0 + +echo +echo 'Checking for ports with mismatched checksums:' + +case ${daily_status_security_chkportsum_enable} in + [Yy][Ee][Ss]) + pkg_info -ga 2/dev/null | \ + while read one two three; do + case ${one} in + Information) + case ${two} in + for) name=${three%%:} ;; + *) name='??' ;; + esac + ;; + Mismatched|'') ;; + *) + if [ -n ${name} ]; then + echo ${name}: ${one} + fi + ;; + esac + done + ;; + *) + rc=0 + ;; +esac + +exit $rc Modified: head/etc/periodic/security/Makefile == --- head/etc/periodic/security/Makefile Mon Jul 19 19:54:37 2010 (r210253) +++ head/etc/periodic/security/Makefile Mon Jul 19 20:19:14 2010 (r210254) @@ -7,6 +7,7 @@ FILES= 100.chksetuid \ 300.chkuid0 \ 400.passwdless \ 410.logincheck \ + 460.chkportsum \ 700.kernelmsg \ 800.loginfail \ 900.tcpwrap \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210255 - head/usr.sbin/sysinstall
Author: gabor Date: Mon Jul 19 20:22:21 2010 New Revision: 210255 URL: http://svn.freebsd.org/changeset/base/210255 Log: - Add Latinamerican keymaps to sysinstall's Makefile so that it can find them [1] - While here, also add a missing Spanish entry PR: bin/67365 [1] Submitted by: Pedro F. Giffuni giffu...@asme.org [1] Approved by: delphij (mentor) Modified: head/usr.sbin/sysinstall/Makefile Modified: head/usr.sbin/sysinstall/Makefile == --- head/usr.sbin/sysinstall/Makefile Mon Jul 19 20:19:14 2010 (r210254) +++ head/usr.sbin/sysinstall/Makefile Mon Jul 19 20:22:21 2010 (r210255) @@ -79,8 +79,9 @@ KEYMAPS= be.iso bg.bds.ctrlcaps bg.phone ce.iso2 cs.latin2.qwertz danish.iso el.iso07 \ estonian.cp850 estonian.iso estonian.iso15 finnish.iso fr.iso \ german.iso gr.elot.acc gr.us101.acc hr.iso hu.iso2.101keys \ - it.iso icelandic.iso jp.106 norwegian.iso pl_PL.ISO8859-2 \ - pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso swedish.iso \ + it.iso icelandic.iso jp.106 latinamerican latinamerican.iso.acc \ + norwegian.iso pl_PL.ISO8859-2 \ + pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso spanish.iso.acc swedish.iso \ swissfrench.iso \ swissgerman.iso ua.koi8-u ua.koi8-u.shift.alt uk.iso us.dvorak \ us.iso us.pc-ctrl us.unix ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210256 - head/sys/dev/syscons
Author: jkim Date: Mon Jul 19 20:31:04 2010 New Revision: 210256 URL: http://svn.freebsd.org/changeset/base/210256 Log: Improve style slightly. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c == --- head/sys/dev/syscons/scvgarndr.cMon Jul 19 20:22:21 2010 (r210255) +++ head/sys/dev/syscons/scvgarndr.cMon Jul 19 20:31:04 2010 (r210256) @@ -171,39 +171,42 @@ static u_short mouse_or_mask[16] = { #endif #ifdef SC_PIXEL_MODE -#defineVIDEO_MEMORY_POS(scp, pos, x) \ - scp-sc-adp-va_window + \ - x * scp-xoff + \ - scp-yoff * scp-font_size * scp-sc-adp-va_line_width + \ - x * (pos % scp-xsize) +\ - scp-font_size * scp-sc-adp-va_line_width * (pos / scp-xsize) - -#definevga_drawpxl(pos, color) \ - switch (scp-sc-adp-va_info.vi_depth) { \ - case 32:\ - writel(pos, vga_palette32[color]); \ - break; \ - case 24:\ - if (((pos) 1) == 0) { \ - writew(pos, vga_palette32[color]); \ - writeb(pos + 2, vga_palette32[color] 16);\ - } else {\ - writeb(pos, vga_palette32[color]); \ - writew(pos + 1, vga_palette32[color] 8);\ - } \ - break; \ - case 16:\ - if (scp-sc-adp-va_info.vi_pixel_fsizes[1] == 5)\ - writew(pos, vga_palette15[color]); \ - else\ - writew(pos, vga_palette16[color]); \ - break; \ - case 15:\ - writew(pos, vga_palette15[color]); \ - break; \ - case 8: \ - writeb(pos, (uint8_t)color);\ - } +#defineGET_PIXEL(scp, pos, x, w) \ +({ \ + (scp)-sc-adp-va_window + \ + (x) * (scp)-xoff + \ + (scp)-yoff * (scp)-font_size * (w) + \ + (x) * ((pos) % (scp)-xsize) + \ + (scp)-font_size * (w) * ((pos) / (scp)-xsize);\ +}) + +#defineDRAW_PIXEL(scp, pos, color) do { \ + switch ((scp)-sc-adp-va_info.vi_depth) { \ + case 32:\ + writel((pos), vga_palette32[color]);\ + break; \ + case 24:\ + if (((pos) 1) == 0) { \ + writew((pos), vga_palette32[color]);\ + writeb((pos) + 2, vga_palette32[color] 16); \ + } else {\ + writeb((pos), vga_palette32[color]);\ + writew((pos) + 1, vga_palette32[color] 8); \ + } \ + break; \ + case 16:\ + if ((scp)-sc-adp-va_info.vi_pixel_fsizes[1] == 5)\ + writew((pos), vga_palette15[color]);\ + else\ + writew((pos), vga_palette16[color]);\ + break; \ + case 15:\ + writew((pos),
svn commit: r210257 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 21:13:07 2010 New Revision: 210257 URL: http://svn.freebsd.org/changeset/base/210257 Log: When we didn't find a matching flash device, do not touch flash config data. While I'm here, use return code of bce_init_nvram() to set error instead of directly setting ENODEV. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 20:31:04 2010(r210256) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:13:07 2010(r210257) @@ -2264,7 +2264,8 @@ bce_init_nvram(struct bce_softc *sc) sc-bce_flash_info = NULL; BCE_PRINTF(%s(%d): Unknown Flash NVRAM found!\n, __FILE__, __LINE__); - rc = ENODEV; + DBEXIT(BCE_VERBOSE_NVRAM); + return (ENODEV); } bce_init_nvram_get_flash_size: @@ -4796,10 +4797,8 @@ bce_chipinit(struct bce_softc *sc) } /* Prepare NVRAM for access. */ - if (bce_init_nvram(sc)) { - rc = ENODEV; + if ((rc = bce_init_nvram(sc)) != 0) goto bce_chipinit_exit; - } /* Set the kernel bypass block size */ val = REG_RD(sc, BCE_MQ_CONFIG); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210259 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 21:25:05 2010 New Revision: 210259 URL: http://svn.freebsd.org/changeset/base/210259 Log: Have bce_init_ctx() return error code and make caller check the return code. If context was not setup correctly give up initialization. While I'm here move variable declarations to the beginning of the function. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:24:48 2010(r210258) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:25:05 2010(r210259) @@ -429,7 +429,7 @@ static void bce_init_locked (struct bce static void bce_init (void *); static void bce_mgmt_init_locked (struct bce_softc *sc); -static void bce_init_ctx (struct bce_softc *); +static int bce_init_ctx (struct bce_softc *); static void bce_get_mac_addr (struct bce_softc *); static void bce_set_mac_addr (struct bce_softc *); static void bce_phy_intr (struct bce_softc *); @@ -4396,16 +4396,18 @@ bce_init_cpus(struct bce_softc *sc) /* Returns: */ /* Nothing. */ // -static void +static int bce_init_ctx(struct bce_softc *sc) { + u32 offset, val, vcid_addr; + int i, j, rc, retry_cnt; + rc = 0; DBENTER(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { - int i, retry_cnt = CTX_INIT_RETRY_COUNT; - u32 val; + retry_cnt = CTX_INIT_RETRY_COUNT; DBPRINT(sc, BCE_INFO_CTX, Initializing 5709 context.\n); @@ -4426,15 +4428,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(2); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val BCE_CTX_COMMAND_MEM_INIT), - BCE_PRINTF(%s(): Context memory initialization - failed!\n, __FUNCTION__)); + if ((val BCE_CTX_COMMAND_MEM_INIT) != 0) { + BCE_PRINTF(%s(): Context memory initialization failed!\n, + __FUNCTION__); + rc = EBUSY; + goto init_ctx_fail; + } for (i = 0; i sc-ctx_pages; i++) { - int j; - /* Set the physical address of the context memory. */ REG_WR(sc, BCE_CTX_HOST_PAGE_TBL_DATA0, BCE_ADDR_LO(sc-ctx_paddr[i] 0xfff0) | @@ -4452,14 +4453,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(5); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ), - BCE_PRINTF(%s(): Failed to initialize - context page %d!\n, __FUNCTION__, i)); + if ((val BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ) != 0) { + BCE_PRINTF(%s(): Failed to initialize + context page %d!\n, __FUNCTION__, i); + rc = EBUSY; + goto init_ctx_fail; + } } } else { - u32 vcid_addr, offset; DBPRINT(sc, BCE_INFO, Initializing 5706/5708 context.\n); @@ -4486,7 +4487,9 @@ bce_init_ctx(struct bce_softc *sc) } } +init_ctx_fail: DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); + return (rc); } @@ -4785,7 +4788,8 @@ bce_chipinit(struct bce_softc *sc) BCE_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE); /* Initialize context mapping and zero out the quick contexts. */ - bce_init_ctx(sc); + if ((rc = bce_init_ctx(sc)) != 0) + goto bce_chipinit_exit; /* Initialize the on-boards CPUs */ bce_init_cpus(sc); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210260 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 21:32:47 2010 New Revision: 210260 URL: http://svn.freebsd.org/changeset/base/210260 Log: Don't change current media in bce_stop(). There is no need to do this here. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:25:05 2010(r210259) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:32:47 2010(r210260) @@ -4577,9 +4577,6 @@ static void bce_stop(struct bce_softc *sc) { struct ifnet *ifp; - struct ifmedia_entry *ifm; - struct mii_data *mii = NULL; - int mtmp, itmp; DBENTER(BCE_VERBOSE_RESET); @@ -4587,8 +4584,6 @@ bce_stop(struct bce_softc *sc) ifp = sc-bce_ifp; - mii = device_get_softc(sc-bce_miibus); - callout_stop(sc-bce_tick_callout); /* Disable the transmit/receive blocks. */ @@ -4607,25 +4602,6 @@ bce_stop(struct bce_softc *sc) /* Free TX buffers. */ bce_free_tx_chain(sc); - /* -* Isolate/power down the PHY, but leave the media selection -* unchanged so that things will be put back to normal when -* we bring the interface back up. -*/ - - itmp = ifp-if_flags; - ifp-if_flags |= IFF_UP; - - /* If we are called from bce_detach(), mii is already NULL. */ - if (mii != NULL) { - ifm = mii-mii_media.ifm_cur; - mtmp = ifm-ifm_media; - ifm-ifm_media = IFM_ETHER | IFM_NONE; - mii_mediachg(mii); - ifm-ifm_media = mtmp; - } - - ifp-if_flags = itmp; sc-watchdog_timer = 0; sc-bce_link_up = FALSE; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210261 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 21:38:07 2010 New Revision: 210261 URL: http://svn.freebsd.org/changeset/base/210261 Log: Correctly check the result of media selection. Previously it always returned success. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:32:47 2010(r210260) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:38:07 2010(r210261) @@ -423,7 +423,7 @@ static void bce_start (struct ifnet *) static int bce_ioctl (struct ifnet *, u_long, caddr_t); static void bce_watchdog (struct bce_softc *); static int bce_ifmedia_upd(struct ifnet *); -static void bce_ifmedia_upd_locked (struct ifnet *); +static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts(struct ifnet *, struct ifmediareq *); static void bce_init_locked(struct bce_softc *); static void bce_init (void *); @@ -5789,15 +5789,16 @@ static int bce_ifmedia_upd(struct ifnet *ifp) { struct bce_softc *sc = ifp-if_softc; + int error; DBENTER(BCE_VERBOSE); BCE_LOCK(sc); - bce_ifmedia_upd_locked(ifp); + error = bce_ifmedia_upd_locked(ifp); BCE_UNLOCK(sc); DBEXIT(BCE_VERBOSE); - return (0); + return (error); } @@ -5807,14 +5808,16 @@ bce_ifmedia_upd(struct ifnet *ifp) /* Returns: */ /* Nothing. */ // -static void +static int bce_ifmedia_upd_locked(struct ifnet *ifp) { struct bce_softc *sc = ifp-if_softc; struct mii_data *mii; + int error; DBENTER(BCE_VERBOSE_PHY); + error = 0; BCE_LOCK_ASSERT(sc); mii = device_get_softc(sc-bce_miibus); @@ -5828,10 +5831,11 @@ bce_ifmedia_upd_locked(struct ifnet *ifp LIST_FOREACH(miisc, mii-mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); } DBEXIT(BCE_VERBOSE_PHY); + return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210262 - head/sys/dev/flash
Author: adrian Date: Mon Jul 19 21:38:15 2010 New Revision: 210262 URL: http://svn.freebsd.org/changeset/base/210262 Log: Extend the mx25l flash device support to include a set of per-device flags. Some of these parts will support 4K/32K block erases rather than a sector erase. This includes (at least) the MX25L128. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c == --- head/sys/dev/flash/mx25l.c Mon Jul 19 21:38:07 2010(r210261) +++ head/sys/dev/flash/mx25l.c Mon Jul 19 21:38:15 2010(r210262) @@ -45,6 +45,10 @@ __FBSDID($FreeBSD$); #include dev/flash/mx25lreg.h +#defineFL_NONE 0x00 +#defineFL_ERASE_4K 0x01 +#defineFL_ERASE_32K0x02 + struct mx25l_flash_ident { const char *name; @@ -52,6 +56,7 @@ struct mx25l_flash_ident uint16_tdevice_id; unsigned intsectorsize; unsigned intsectorcount; + unsigned intflags; }; struct mx25l_softc @@ -64,6 +69,7 @@ struct mx25l_softc struct disk *sc_disk; struct proc *sc_p; struct bio_queue_head sc_bio_queue; + unsigned intflags; }; #define M25PXX_LOCK(_sc) mtx_lock((_sc)-sc_mtx) @@ -83,10 +89,10 @@ static void mx25l_strategy(struct bio *b static void mx25l_task(void *arg); struct mx25l_flash_ident flash_devices[] = { - { mx25ll32, 0xc2, 0x2016, 64 * 1024, 64 }, - { mx25ll64, 0xc2, 0x2017, 64 * 1024, 128 }, - { mx25ll128, 0xc2, 0x2018, 64 * 1024, 256 }, - { s25fl128, 0x01, 0x2018, 64 * 1024, 256 }, + { mx25ll32, 0xc2, 0x2016, 64 * 1024, 64, FL_NONE }, + { mx25ll64, 0xc2, 0x2017, 64 * 1024, 128, FL_NONE }, + { mx25ll128, 0xc2, 0x2018, 64 * 1024, 256, FL_ERASE_4K | FL_ERASE_32K }, + { s25fl128, 0x01, 0x2018, 64 * 1024, 256, FL_NONE }, }; static uint8_t @@ -369,6 +375,7 @@ mx25l_attach(device_t dev) sc-sc_disk-d_dump = NULL; /* NB: no dumps */ /* Sectorsize for erase operations */ sc-sc_sectorsize = ident-sectorsize; + sc-flags = ident-flags; /* NB: use stripesize to hold the erase/region size for RedBoot */ sc-sc_disk-d_stripesize = ident-sectorsize; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210263 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 21:41:54 2010 New Revision: 210263 URL: http://svn.freebsd.org/changeset/base/210263 Log: Do not report current link state if interface is not UP. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 21:38:15 2010(r210262) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 21:41:54 2010(r210263) @@ -5855,6 +5855,10 @@ bce_ifmedia_sts(struct ifnet *ifp, struc BCE_LOCK(sc); + if ((ifp-if_flags IFF_UP) == 0) { + BCE_UNLOCK(sc); + return; + } mii = device_get_softc(sc-bce_miibus); mii_pollstat(mii); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210264 - head/sys/dev/flash
Author: adrian Date: Mon Jul 19 21:46:40 2010 New Revision: 210264 URL: http://svn.freebsd.org/changeset/base/210264 Log: Extend the mx25l erase function to support different erase commands. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c == --- head/sys/dev/flash/mx25l.c Mon Jul 19 21:41:54 2010(r210263) +++ head/sys/dev/flash/mx25l.c Mon Jul 19 21:46:40 2010(r210264) @@ -184,7 +184,7 @@ mx25l_set_writable(device_t dev, int wri } static void -mx25l_erase_sector(device_t dev, off_t sector) +mx25l_erase_cmd(device_t dev, off_t sector, uint8_t ecmd) { uint8_t txBuf[4], rxBuf[4]; struct spi_command cmd; @@ -197,7 +197,7 @@ mx25l_erase_sector(device_t dev, off_t s memset(txBuf, 0, sizeof(txBuf)); memset(rxBuf, 0, sizeof(rxBuf)); - txBuf[0] = CMD_SECTOR_ERASE; + txBuf[0] = ecmd; cmd.tx_cmd = txBuf; cmd.rx_cmd = rxBuf; cmd.rx_cmd_sz = 4; @@ -258,7 +258,7 @@ mx25l_write(device_t dev, off_t offset, * If we crossed sector boundary - erase next sector */ if (((offset + bytes_writen) % sc-sc_sectorsize) == 0) - mx25l_erase_sector(dev, offset + bytes_writen); + mx25l_erase_cmd(dev, offset + bytes_writen, CMD_SECTOR_ERASE); txBuf[0] = CMD_PAGE_PROGRAM; txBuf[1] = ((write_offset 16) 0xff); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210265 - head/sys/dev/flash
Author: adrian Date: Mon Jul 19 21:50:43 2010 New Revision: 210265 URL: http://svn.freebsd.org/changeset/base/210265 Log: Fix naming to be consistent. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c == --- head/sys/dev/flash/mx25l.c Mon Jul 19 21:46:40 2010(r210264) +++ head/sys/dev/flash/mx25l.c Mon Jul 19 21:50:43 2010(r210265) @@ -69,7 +69,7 @@ struct mx25l_softc struct disk *sc_disk; struct proc *sc_p; struct bio_queue_head sc_bio_queue; - unsigned intflags; + unsigned intsc_flags; }; #define M25PXX_LOCK(_sc) mtx_lock((_sc)-sc_mtx) @@ -375,7 +375,7 @@ mx25l_attach(device_t dev) sc-sc_disk-d_dump = NULL; /* NB: no dumps */ /* Sectorsize for erase operations */ sc-sc_sectorsize = ident-sectorsize; - sc-flags = ident-flags; + sc-sc_flags = ident-flags; /* NB: use stripesize to hold the erase/region size for RedBoot */ sc-sc_disk-d_stripesize = ident-sectorsize; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210267 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 23:25:19 2010 New Revision: 210267 URL: http://svn.freebsd.org/changeset/base/210267 Log: Add KASSERT to check number of returned DMA segments. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 22:28:07 2010(r210266) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:25:19 2010(r210267) @@ -3088,6 +3088,8 @@ bce_dma_map_addr(void *arg, bus_dma_segm { bus_addr_t *busaddr = arg; + KASSERT(nseg == 1, (%s(): Too many segments returned (%d)!, + __FUNCTION__, nseg)); /* Simulate a mapping failure. */ DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), error = ENOMEM); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210268 - head/sys/fs/nfs
Author: rmacklem Date: Mon Jul 19 23:33:42 2010 New Revision: 210268 URL: http://svn.freebsd.org/changeset/base/210268 Log: For the experimental NFSv4 server's dumplocks operation, add the MPSAFE flag to cn_flags so that it doesn't panic. The panics weren't seen since nfsdumpstate(8) is broken for the -l case, so this was never done. I'll do a separate commit to fix nfsdumpstate(8). Submitted by: zack.kirsch at isilon.com MFC after:2 weeks Modified: head/sys/fs/nfs/nfs_commonport.c Modified: head/sys/fs/nfs/nfs_commonport.c == --- head/sys/fs/nfs/nfs_commonport.cMon Jul 19 23:25:19 2010 (r210267) +++ head/sys/fs/nfs/nfs_commonport.cMon Jul 19 23:33:42 2010 (r210268) @@ -210,7 +210,8 @@ nfsrv_lookupfilename(struct nameidata *n { int error; - NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, fname, p); + NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE, UIO_USERSPACE, fname, + p); error = namei(ndp); if (!error) { NDFREE(ndp, NDF_ONLY_PNBUF); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210269 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 23:35:43 2010 New Revision: 210269 URL: http://svn.freebsd.org/changeset/base/210269 Log: Use bus_get_dma_tag() to get parent tag. Also use BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths. Previously it used MAXBSIZE which was wrong. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 23:33:42 2010(r210268) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:35:43 2010(r210269) @@ -3146,10 +3146,10 @@ bce_dma_alloc(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, 1, BCE_DMA_BOUNDARY, + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, BCE_DMA_BOUNDARY, sc-max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - MAXBSIZE, BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE_32BIT, - 0, NULL, NULL, sc-parent_tag)) { + BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, + sc-parent_tag)) { BCE_PRINTF(%s(%d): Could not allocate parent DMA tag!\n, __FILE__, __LINE__); rc = ENOMEM; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210270 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 23:41:45 2010 New Revision: 210270 URL: http://svn.freebsd.org/changeset/base/210270 Log: Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero() calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to take advantage of efficient synchronization for architectures that support that feature. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 23:35:43 2010(r210269) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:41:45 2010(r210270) @@ -3172,15 +3172,14 @@ bce_dma_alloc(device_t dev) } if(bus_dmamem_alloc(sc-status_tag, (void **)sc-status_block, - BUS_DMA_NOWAIT, sc-status_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, + sc-status_map)) { BCE_PRINTF(%s(%d): Could not allocate status block DMA memory!\n, __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc-status_block, BCE_STATUS_BLK_SZ); - error = bus_dmamap_load(sc-status_tag, sc-status_map, sc-status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, sc-status_block_paddr, BUS_DMA_NOWAIT); @@ -3211,15 +3210,13 @@ bce_dma_alloc(device_t dev) } if (bus_dmamem_alloc(sc-stats_tag, (void **)sc-stats_block, - BUS_DMA_NOWAIT, sc-stats_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, sc-stats_map)) { BCE_PRINTF(%s(%d): Could not allocate statistics block DMA memory!\n, __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc-stats_block, BCE_STATS_BLK_SZ); - error = bus_dmamap_load(sc-stats_tag, sc-stats_map, sc-stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, sc-stats_block_paddr, BUS_DMA_NOWAIT); @@ -3265,7 +3262,7 @@ bce_dma_alloc(device_t dev) if(bus_dmamem_alloc(sc-ctx_tag, (void **)sc-ctx_block[i], - BUS_DMA_NOWAIT, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, sc-ctx_map[i])) { BCE_PRINTF(%s(%d): Could not allocate CTX DMA memory!\n, __FILE__, __LINE__); @@ -3273,8 +3270,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc-ctx_block[i], BCM_PAGE_SIZE); - error = bus_dmamap_load(sc-ctx_tag, sc-ctx_map[i], sc-ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, sc-ctx_paddr[i], BUS_DMA_NOWAIT); @@ -3310,7 +3305,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i TX_PAGES; i++) { if(bus_dmamem_alloc(sc-tx_bd_chain_tag, - (void **)sc-tx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)sc-tx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, sc-tx_bd_chain_map[i])) { BCE_PRINTF(%s(%d): Could not allocate TX descriptor chain DMA memory!\n, __FILE__, __LINE__); @@ -3386,7 +3382,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i RX_PAGES; i++) { if (bus_dmamem_alloc(sc-rx_bd_chain_tag, - (void **)sc-rx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)sc-rx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, sc-rx_bd_chain_map[i])) { BCE_PRINTF(%s(%d): Could not allocate RX descriptor chain DMA memory!\n, __FILE__, __LINE__); @@ -3394,8 +3391,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc-rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc-rx_bd_chain_tag, sc-rx_bd_chain_map[i], sc-rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, @@ -3429,9 +3424,10 @@ bce_dma_alloc(device_t dev) size = 0x%jX)\n, __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc-parent_tag, 1, BCE_DMA_BOUNDARY, - sc-max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, - max_segments, max_seg_size, 0, NULL, NULL, sc-rx_mbuf_tag)) { + if (bus_dma_tag_create(sc-parent_tag, 1, + BCE_DMA_BOUNDARY, sc-max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, + max_size, max_segments, max_seg_size, 0, NULL,
svn commit: r210271 - head/sys/dev/bce
Author: yongari Date: Mon Jul 19 23:48:03 2010 New Revision: 210271 URL: http://svn.freebsd.org/changeset/base/210271 Log: Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4) controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Mon Jul 19 23:41:45 2010(r210270) +++ head/sys/dev/bce/if_bce.c Mon Jul 19 23:48:03 2010(r210271) @@ -3424,7 +3424,7 @@ bce_dma_alloc(device_t dev) size = 0x%jX)\n, __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc-parent_tag, 1, + if (bus_dma_tag_create(sc-parent_tag, BCE_RX_BUF_ALIGN, BCE_DMA_BOUNDARY, sc-max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, max_segments, max_seg_size, 0, NULL, NULL, sc-rx_mbuf_tag)) { Modified: head/sys/dev/bce/if_bcereg.h == --- head/sys/dev/bce/if_bcereg.hMon Jul 19 23:41:45 2010 (r210270) +++ head/sys/dev/bce/if_bcereg.hMon Jul 19 23:48:03 2010 (r210271) @@ -6316,6 +6316,7 @@ struct fw_info { #define BCE_DMA_ALIGN 8 #define BCE_DMA_BOUNDARY 0 +#define BCE_RX_BUF_ALIGN 16 #define BCE_MAX_CONTEXT4 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210272 - head/usr.sbin/nfsdumpstate
Author: rmacklem Date: Tue Jul 20 00:32:11 2010 New Revision: 210272 URL: http://svn.freebsd.org/changeset/base/210272 Log: Fix handling of the -l argument for nfsdumpstate(8). Submitted by: zack.kirsch at isilon.com MFC after:2 weeks Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c == --- head/usr.sbin/nfsdumpstate/nfsdumpstate.c Mon Jul 19 23:48:03 2010 (r210271) +++ head/usr.sbin/nfsdumpstate/nfsdumpstate.c Tue Jul 20 00:32:11 2010 (r210272) @@ -76,7 +76,7 @@ main(int argc, char **argv) errx(1, nfsd not loaded - self terminating); openstate = 0; lockfile = NULL; - while ((ch = getopt(argc, argv, ol)) != -1) + while ((ch = getopt(argc, argv, ol:)) != -1) switch (ch) { case 'o': openstate = 1; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210273 - stable/8/sys/sys
Author: lstewart Date: Tue Jul 20 00:46:18 2010 New Revision: 210273 URL: http://svn.freebsd.org/changeset/base/210273 Log: MFC r209978,209981,209987,210184: - Rename DPCPU_SUM to DPCPU_VARSUM to better reflect the fact it operates on member variables of a DPCPU struct (r209978). - Add DPCPU_SUM which sums a DPCPU variable (r209978,209987,210184). - Macro to simplify zeroing DPCPU variables (r209981,209987). Sponsored by: FreeBSD Foundation Modified: stable/8/sys/sys/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/pcpu.h == --- stable/8/sys/sys/pcpu.h Tue Jul 20 00:32:11 2010(r210272) +++ stable/8/sys/sys/pcpu.h Tue Jul 20 00:46:18 2010(r210273) @@ -112,7 +112,19 @@ extern uintptr_t dpcpu_off[]; /* * Utility macros. */ -#defineDPCPU_SUM(n, var) __extension__ \ +#defineDPCPU_SUM(n) __extension__ \ +({ \ + u_int _i; \ + __typeof(*DPCPU_PTR(n)) sum;\ + \ + sum = 0;\ + CPU_FOREACH(_i) { \ + sum += *DPCPU_ID_PTR(_i, n);\ + } \ + sum;\ +}) + +#defineDPCPU_VARSUM(n, var) __extension__ \ ({ \ u_int _i; \ __typeof((DPCPU_PTR(n))-var) sum; \ @@ -124,6 +136,14 @@ extern uintptr_t dpcpu_off[]; sum;\ }) +#defineDPCPU_ZERO(n) do { \ + u_int _i; \ + \ + CPU_FOREACH(_i) { \ + bzero(DPCPU_ID_PTR(_i, n), sizeof(*DPCPU_PTR(n))); \ + } \ +} while(0) + /* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210274 - head/sys/kern
Author: davidxu Date: Tue Jul 20 02:23:12 2010 New Revision: 210274 URL: http://svn.freebsd.org/changeset/base/210274 Log: Fix function name in error messages. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c == --- head/sys/kern/kern_sig.cTue Jul 20 00:46:18 2010(r210273) +++ head/sys/kern/kern_sig.cTue Jul 20 02:23:12 2010(r210274) @@ -2029,9 +2029,9 @@ tdsendsignal(struct proc *p, struct thre PROC_LOCK_ASSERT(p, MA_OWNED); if (!_SIG_VALID(sig)) - panic(tdsignal(): invalid signal %d, sig); + panic(%s(): invalid signal %d, __func__, sig); - KASSERT(ksi == NULL || !KSI_ONQ(ksi), (tdsignal: ksi on queue)); + KASSERT(ksi == NULL || !KSI_ONQ(ksi), (%s: ksi on queue, __func__)); /* * IEEE Std 1003.1-2001: return success when killing a zombie. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210275 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net
Author: thompsa Date: Tue Jul 20 03:10:22 2010 New Revision: 210275 URL: http://svn.freebsd.org/changeset/base/210275 Log: - Support for Globetrotter iCON 452. - Fixed the interface probe routine to only attach to USB interfaces the driver actually supports. This allows other drivers to attach to things like MicroSD slots etc. - Fixed network interface enumeration to be globally sequential instead of relying on the USB interface numbers. This make sure the first network interface always is at uhso0 and the second at usho1 and so on. - Added a radio kill switch; exposed through sysctl. - Updated the manual page to be verbose about the number of serial ports and include iCON 452 in the set of tested hardware. Submitted by: Fredrik Lindberg Modified: head/share/man/man4/uhso.4 head/sys/dev/usb/net/uhso.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/uhso.4 == --- head/share/man/man4/uhso.4 Tue Jul 20 02:23:12 2010(r210274) +++ head/share/man/man4/uhso.4 Tue Jul 20 03:10:22 2010(r210275) @@ -43,8 +43,9 @@ based on their packet interface. Each device has a set of serial ports and a raw IP packet interface. The serial ports of the device are accessed through the .Xr ucom 4 -driver which makes them behave like a -.Xr tty 4 . +driver which makes them behave like +.Xr tty 4 +devices. The packet interface is exposed as a network interface. .Pp Establishing a connection on the packet interface is achieved by using the @@ -60,10 +61,19 @@ these calls. Each device usually have at least two or more serial ports, their individual purpose can be identified through .Xr sysctl 8 . +Ports identified as +.Dq Modem +features a normal modem interface that can be used with PPP. +Ports identified as +.Dq Diagnostic +uses a proprietary binary interface used for firmware upgrades, this port does not +have a AT command interface and can not be used to control the device. +Other ports features an AT command interface that can be used for normal device control. .Sh HARDWARE The .Nm -driver supports at least the following cards +driver should work with most devices from Option. +The following devices have been verified to work .Pp .Bl -bullet -compact .It @@ -71,6 +81,8 @@ Option GlobeSurfer iCON 7.2 (new firmwar .It Option iCON 225 .It +Option iCON 452 +.It Option iCON 505 .El .Pp @@ -92,7 +104,8 @@ to 0 using .It Pa /dev/cuaU?.? .El .Sh EXAMPLES -Establishing a packet interface connection +Establishing a packet interface connection using the AT command interface available +at one of the serial ports .Bd -literal -offset indent AT+CGDCONT=1,,apn.provider AT_OWANCALL=1,1,1 Modified: head/sys/dev/usb/net/uhso.c == --- head/sys/dev/usb/net/uhso.c Tue Jul 20 02:23:12 2010(r210274) +++ head/sys/dev/usb/net/uhso.c Tue Jul 20 03:10:22 2010(r210275) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Fredrik Lindberg f...@shapeshifter.se + * Copyright (c) 2010 Fredrik Lindberg f...@shapeshifter.se * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ __FBSDID($FreeBSD$); #include sys/conf.h #include sys/bus.h #include sys/systm.h +#include sys/limits.h #include machine/bus.h @@ -81,6 +82,7 @@ struct uhso_softc { struct usb_device *sc_udev; struct mtx sc_mtx; uint32_tsc_type;/* Interface definition */ + int sc_radio; struct usb_xfer *sc_xfer[3]; uint8_t sc_iface_no; @@ -155,6 +157,7 @@ struct uhso_softc { * Note that these definitions are arbitrary and do not match the values * returned by the auto config descriptor. */ +#define UHSO_PORT_TYPE_UNKNOWN 0x00 #define UHSO_PORT_TYPE_CTL 0x01 #define UHSO_PORT_TYPE_APP 0x02 #define UHSO_PORT_TYPE_APP20x03 @@ -185,7 +188,7 @@ static char *uhso_port[] = { * descriptor values. */ static unsigned char uhso_port_map[] = { - 0, + UHSO_PORT_TYPE_UNKNOWN, UHSO_PORT_TYPE_DIAG, UHSO_PORT_TYPE_GPS, UHSO_PORT_TYPE_GPSCTL, @@ -243,6 +246,9 @@ static char *uhso_port_type_sysctl[] = { #define UHSO_STATIC_IFACE 0x01 #define UHSO_AUTO_IFACE0x02 +/* ifnet device unit allocations */ +static struct unrhdr *uhso_ifnet_unit = NULL; + static const struct usb_device_id uhso_devs[] = { #defineUHSO_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } /* Option GlobeSurfer iCON 7.2 */ @@ -272,6 +278,8 @@ static const struct usb_device_id uhso_d UHSO_DEV(OPTION, GTICON322, UHSO_STATIC_IFACE), /* Option iCON 505 */ UHSO_DEV(OPTION, ICON505, UHSO_AUTO_IFACE), + /* Option iCON 452 */ + UHSO_DEV(OPTION, ICON505,
svn commit: r210276 - head/usr.sbin/uhsoctl
Author: thompsa Date: Tue Jul 20 03:11:26 2010 New Revision: 210276 URL: http://svn.freebsd.org/changeset/base/210276 Log: - Fixed automatic detection of the control serial port. - Fixed segmentation fault when an invalid network interface was given. - More helpful message in case of wrong PIN number. Submitted by: Fredrik Lindberg Modified: head/usr.sbin/uhsoctl/uhsoctl.c Modified: head/usr.sbin/uhsoctl/uhsoctl.c == --- head/usr.sbin/uhsoctl/uhsoctl.c Tue Jul 20 03:10:22 2010 (r210275) +++ head/usr.sbin/uhsoctl/uhsoctl.c Tue Jul 20 03:11:26 2010 (r210276) @@ -66,6 +66,7 @@ #define TTY_NAME /dev/%s #define SYSCTL_TESTdev.uhso.%d.%%driver +#define SYSCTL_LOCATION dev.uhso.%d.%%location #define SYSCTL_PORTS dev.uhso.%d.ports #define SYSCTL_NETIF dev.uhso.%d.netif #define SYSCTL_NAME_TTYdev.uhso.%d.port.%s.tty @@ -207,9 +208,6 @@ tmr_run(struct timers *tmrs) while (te-timeout = 0) { te2 = TAILQ_NEXT(te, next); TAILQ_REMOVE(tmrs-head, te, next); - if (te2 != NULL) - te2-timeout -= tmrs-res; - te-func(te-id, te-arg); free(te); te = te2; @@ -579,12 +577,13 @@ readline(int fd, char *buf, size_t bufsz static int at_cmd(struct ctx *ctx, const char *resp, resp_cb cb, resp_arg *ra, const char *cf, ...) { + char buf[512]; + char cmd[64]; size_t l; int n, error, retval = 0; va_list ap; fd_set set; - char buf[512]; - char cmd[64]; + char *p; va_start(ap, cf); vsnprintf(cmd, sizeof(cmd), cf, ap); @@ -614,12 +613,12 @@ at_cmd(struct ctx *ctx, const char *resp do { FD_SET(ctx-fd, set); error = select(ctx-fd + 1, set, NULL, NULL, NULL); - if (error 0 errno == EINTR ctx-flags FLG_WDEXP) { + if (ctx-flags FLG_WDEXP) { watchdog_disable(ctx); - retval = -2; - break; + return (-2); } } while (error = 0 errno == EINTR); + watchdog_disable(ctx); if (error = 0) { retval = -2; @@ -635,24 +634,30 @@ at_cmd(struct ctx *ctx, const char *resp if (strcmp(buf, \r\n) == 0 || strcmp(buf, \n) == 0) continue; + if ((p = strchr(buf, '\r')) != NULL) + *p = '\0'; + else if ((p = strchr(buf, '\n')) != NULL) + *p = '\0'; #ifdef DEBUG - fprintf(stderr, SYNC_RESP: %s, buf); + fprintf(stderr, SYNC_RESP: %s\n, buf); #endif + /* Skip local echo */ + if (strncasecmp(cmd, buf, strlen(buf)) == 0) + continue; + + if (cb != NULL) + cb(ra, cmd, buf); + if (strncmp(buf, OK, 2) == 0) { + retval = retval ? retval : 0; break; - } - else if (strncmp(buf, ERROR, 5) == 0) { + } else if (strstr(buf, ERROR) != NULL) { retval = -1; break; } - - if (resp != NULL) { - retval = strncmp(resp, buf, l); - if (retval == 0 cb != NULL) { - cb(ra, cmd, buf); - } - } + if (resp != NULL) + retval = strncmp(buf, resp, l); } #ifdef DEBUG fprintf(stderr, SYNC_RETVAL=%d\n, retval); @@ -684,6 +689,10 @@ saveresp(resp_arg *ra, const char *cmd, char **buf; int i = ra-val[1].int32; +#ifdef DEBUG + fprintf(stderr, Save '%s'\n, resp); +#endif + buf = realloc(ra-val[0].ptr, sizeof(char *) * (i + 1)); if (buf == NULL) return; @@ -695,6 +704,19 @@ saveresp(resp_arg *ra, const char *cmd, } static void +freeresp(resp_arg *ra) +{ + char **buf; + int i; + + buf = ra-val[0].ptr; + for (i = 0; i ra-val[1].int32; i++) { + free(buf[i]); + } + free(buf); +} + +static void at_async_creg(void *arg, const char *resp) { struct ctx *ctx = arg; @@ -992,129 +1014,119 @@ static const char *port_type_list[] = { /* * Attempts to find a list of control tty for the interface - * FreeBSD attaches USb devices per interface so we have to go through + * FreeBSD attaches USB devices per interface so we have to go through * hoops to find which ttys that belong to our network interface. */ static char ** get_tty(struct ctx *ctx) { - char
svn commit: r210280 - stable/8/sys/dev/ata
Author: mav Date: Tue Jul 20 05:14:30 2010 New Revision: 210280 URL: http://svn.freebsd.org/changeset/base/210280 Log: MFC r210165: Improve interrupt setup errors handling. Modified: stable/8/sys/dev/ata/ata-pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-pci.c == --- stable/8/sys/dev/ata/ata-pci.c Tue Jul 20 05:14:27 2010 (r210279) +++ stable/8/sys/dev/ata/ata-pci.c Tue Jul 20 05:14:30 2010 (r210280) @@ -806,17 +806,23 @@ ata_setup_interrupt(device_t dev, void * if (msi pci_msi_count(dev) 0 pci_alloc_msi(dev, msi) == 0) { ctlr-r_irq_rid = 0x1; } else { + msi = 0; ctlr-r_irq_rid = ATA_IRQ_RID; } if (!(ctlr-r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, ctlr-r_irq_rid, RF_SHAREABLE | RF_ACTIVE))) { device_printf(dev, unable to map interrupt\n); + if (msi) + pci_release_msi(dev); return ENXIO; } if ((bus_setup_intr(dev, ctlr-r_irq, ATA_INTR_FLAGS, NULL, intr_func, ctlr, ctlr-handle))) { - /* SOS XXX release r_irq */ device_printf(dev, unable to setup interrupt\n); + bus_release_resource(dev, + SYS_RES_IRQ, ctlr-r_irq_rid, ctlr-r_irq); + if (msi) + pci_release_msi(dev); return ENXIO; } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210281 - stable/8/sys/dev/ata
Author: mav Date: Tue Jul 20 05:16:10 2010 New Revision: 210281 URL: http://svn.freebsd.org/changeset/base/210281 Log: MFC r210168: Make legacy ATA emulation detection more strict. This should fix false positive legacy detection and attach failure/panic for Marvell 88SX6141 controller and potentially some others. PR: kern/145064 Modified: stable/8/sys/dev/ata/ata-pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-pci.c == --- stable/8/sys/dev/ata/ata-pci.c Tue Jul 20 05:14:30 2010 (r210280) +++ stable/8/sys/dev/ata/ata-pci.c Tue Jul 20 05:16:10 2010 (r210281) @@ -769,7 +769,8 @@ DRIVER_MODULE(ata, atapci, ata_pcichanne int ata_legacy(device_t dev) { -return (((pci_read_config(dev, PCIR_PROGIF, 1)PCIP_STORAGE_IDE_MASTERDEV) +return (((pci_read_config(dev, PCIR_SUBCLASS, 1) == PCIS_STORAGE_IDE) +(pci_read_config(dev, PCIR_PROGIF, 1)PCIP_STORAGE_IDE_MASTERDEV) ((pci_read_config(dev, PCIR_PROGIF, 1) (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) != (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) || ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r210282 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mm Date: Tue Jul 20 05:22:14 2010 New Revision: 210282 URL: http://svn.freebsd.org/changeset/base/210282 Log: To improve latency, lower default vfs.zfs.vdev.max_pending from 35 to 10 OpenSolaris onnv changeset (partial): 10801:e0bf032e8673 Approved by: pjd, delphij (mentor) Obtained from:OpenSolaris (Bug ID 6891731) MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cTue Jul 20 05:16:10 2010(r210281) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.cTue Jul 20 05:22:14 2010(r210282) @@ -38,7 +38,7 @@ * of i/os pending to each device (before it starts ramping up to * max_pending). */ -int zfs_vdev_max_pending = 35; +int zfs_vdev_max_pending = 10; int zfs_vdev_min_pending = 4; /* deadline = pri + (LBOLT time_shift) */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org