svn commit: r298768 - in head: bin/tests cddl/lib/tests cddl/sbin/tests cddl/tests cddl/usr.bin/tests cddl/usr.sbin/tests gnu/lib/tests gnu/tests gnu/usr.bin/tests lib/atf/libatf-c/tests/detail lib...
Author: gjb Date: Fri Apr 29 05:28:40 2016 New Revision: 298768 URL: https://svnweb.freebsd.org/changeset/base/298768 Log: Fix including Kyuafile in packaged base system. Fix a related typo while here. Note, this change results in the Kyuafile inclusion in the runtime package, which needs to be fixed, however addresses the PR as far as I can tell in my tests. PR: 209114 Submitted by: ngie Sponsored by: The FreeBSD Foundation Modified: head/bin/tests/Makefile head/cddl/lib/tests/Makefile head/cddl/sbin/tests/Makefile head/cddl/tests/Makefile head/cddl/usr.bin/tests/Makefile head/cddl/usr.sbin/tests/Makefile head/gnu/lib/tests/Makefile head/gnu/tests/Makefile head/gnu/usr.bin/tests/Makefile head/lib/atf/libatf-c/tests/detail/Makefile head/lib/atf/tests/Makefile head/lib/atf/tests/test-programs/Makefile head/lib/tests/Makefile head/libexec/atf/atf-sh/tests/Makefile head/libexec/atf/tests/Makefile head/libexec/tests/Makefile head/sbin/tests/Makefile head/secure/lib/tests/Makefile head/secure/libexec/tests/Makefile head/secure/tests/Makefile head/secure/usr.bin/tests/Makefile head/secure/usr.sbin/tests/Makefile head/share/examples/tests/Makefile head/share/examples/tests/tests/Makefile head/share/examples/tests/tests/atf/Makefile head/share/examples/tests/tests/plain/Makefile head/share/tests/Makefile head/tests/Makefile head/tests/etc/Makefile head/usr.bin/tests/Makefile head/usr.sbin/tests/Makefile Modified: head/bin/tests/Makefile == --- head/bin/tests/Makefile Fri Apr 29 03:13:18 2016(r298767) +++ head/bin/tests/Makefile Fri Apr 29 05:28:40 2016(r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+=Kyuafile Modified: head/cddl/lib/tests/Makefile == --- head/cddl/lib/tests/MakefileFri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/lib/tests/MakefileFri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+=Kyuafile Modified: head/cddl/sbin/tests/Makefile == --- head/cddl/sbin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/sbin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+=Kyuafile Modified: head/cddl/tests/Makefile == --- head/cddl/tests/MakefileFri Apr 29 03:13:18 2016(r298767) +++ head/cddl/tests/MakefileFri Apr 29 05:28:40 2016(r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+=Kyuafile Modified: head/cddl/usr.bin/tests/Makefile == --- head/cddl/usr.bin/tests/MakefileFri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/usr.bin/tests/MakefileFri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+=Kyuafile Modified: head/cddl/usr.sbin/tests/Makefile == --- head/cddl/usr.sbin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/usr.sbin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+=Kyuafile Modified: head/gnu/lib/tests/Makefile == --- head/gnu/lib/tests/Makefile Fri Apr 29 03:13:18 2016(r298767) +++ head/gnu/lib/tests/Makefile Fri Apr 29 05:28:40 2016(r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+=Kyuafile Modified: head/gnu/tests/Makefile == --- head/gnu/tests/Makefile Fri Apr 29 03:13:18 2016(r298767) +++ head/gnu/tests/Makefile Fri Apr 29 05:28:40 2016(r298768) @@ -2,8 +2,
svn commit: r298767 - stable/9/bin/ed
Author: pfg Date: Fri Apr 29 03:13:18 2016 New Revision: 298767 URL: https://svnweb.freebsd.org/changeset/base/298767 Log: MFC r298640: ed(1): switch two statements so we check the index before dereferencing. Modified: stable/9/bin/ed/cbc.c Directory Properties: stable/9/bin/ed/ (props changed) Modified: stable/9/bin/ed/cbc.c == --- stable/9/bin/ed/cbc.c Fri Apr 29 03:12:14 2016(r298766) +++ stable/9/bin/ed/cbc.c Fri Apr 29 03:13:18 2016(r298767) @@ -263,7 +263,7 @@ expand_des_key(char *obuf, char *kbuf) /* * now translate it, bombing on any illegal binary digit */ - for (i = 0; kbuf[i] && i < 16; i++) + for (i = 0; i < 16 && kbuf[i]; i++) if ((nbuf[i] = hex_to_binary((int) kbuf[i], 2)) == -1) des_error("bad binary digit in key"); while (i < 64) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298766 - stable/10/bin/ed
Author: pfg Date: Fri Apr 29 03:12:14 2016 New Revision: 298766 URL: https://svnweb.freebsd.org/changeset/base/298766 Log: MFC r298640: ed(1): switch two statements so we check the index before dereferencing. Modified: stable/10/bin/ed/cbc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ed/cbc.c == --- stable/10/bin/ed/cbc.c Fri Apr 29 03:06:42 2016(r298765) +++ stable/10/bin/ed/cbc.c Fri Apr 29 03:12:14 2016(r298766) @@ -257,7 +257,7 @@ expand_des_key(char *obuf, char *kbuf) /* * now translate it, bombing on any illegal binary digit */ - for (i = 0; kbuf[i] && i < 16; i++) + for (i = 0; i < 16 && kbuf[i]; i++) if ((nbuf[i] = hex_to_binary((int) kbuf[i], 2)) == -1) des_error("bad binary digit in key"); while (i < 64) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298765 - stable/9/sbin/fsck_ffs
Author: pfg Date: Fri Apr 29 03:06:42 2016 New Revision: 298765 URL: https://svnweb.freebsd.org/changeset/base/298765 Log: MFC r298551, r298679, r298680: fsck_ffs: use uint32_t for closedisk(). fs_ncg is of type uint32_t, and we were indexing it with an int. Fixed this using an unsigned type. Reviewed by: mckusick Modified: stable/9/sbin/fsck_ffs/suj.c Directory Properties: stable/9/sbin/fsck_ffs/ (props changed) Modified: stable/9/sbin/fsck_ffs/suj.c == --- stable/9/sbin/fsck_ffs/suj.cFri Apr 29 03:04:56 2016 (r298764) +++ stable/9/sbin/fsck_ffs/suj.cFri Apr 29 03:06:42 2016 (r298765) @@ -216,7 +216,7 @@ static void closedisk(const char *devnam) { struct csum *cgsum; - int i; + uint32_t i; /* * Recompute the fs summary info from correct cs summaries. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298764 - stable/10/sbin/fsck_ffs
Author: pfg Date: Fri Apr 29 03:04:56 2016 New Revision: 298764 URL: https://svnweb.freebsd.org/changeset/base/298764 Log: MFC r298551, r298679, r298680: fsck_ffs: use uint32_t for closedisk(). fs_ncg is of type uint32_t, and we were indexing it with an int. Fixed this using an unsigned type. Reviewed by: mckusick Modified: stable/10/sbin/fsck_ffs/suj.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_ffs/suj.c == --- stable/10/sbin/fsck_ffs/suj.c Fri Apr 29 02:56:03 2016 (r298763) +++ stable/10/sbin/fsck_ffs/suj.c Fri Apr 29 03:04:56 2016 (r298764) @@ -217,7 +217,7 @@ static void closedisk(const char *devnam) { struct csum *cgsum; - int i; + uint32_t i; /* * Recompute the fs summary info from correct cs summaries. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298763 - stable/10/usr.bin/patch
Author: pfg Date: Fri Apr 29 02:56:03 2016 New Revision: 298763 URL: https://svnweb.freebsd.org/changeset/base/298763 Log: MFC r298530: patch(1): avoid signed integer overflow when debugging. Integer i is used to index p_end of type LINENUM (actually long). Match the types. Modified: stable/10/usr.bin/patch/pch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/patch/pch.c == --- stable/10/usr.bin/patch/pch.c Fri Apr 29 01:53:45 2016 (r298762) +++ stable/10/usr.bin/patch/pch.c Fri Apr 29 02:56:03 2016 (r298763) @@ -1142,7 +1142,7 @@ hunk_done: say("Not enough memory to swap next hunk!\n"); #ifdef DEBUGGING if (debug & 2) { - int i; + LINENUM i; charspecial; for (i = 0; i <= p_end; i++) { @@ -1150,7 +1150,7 @@ hunk_done: special = '^'; else special = ' '; - fprintf(stderr, "%3d %c %c %s", i, p_char[i], + fprintf(stderr, "%3ld %c %c %s", i, p_char[i], special, p_line[i]); fflush(stderr); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298762 - head/sys/dev/ath
Author: adrian Date: Fri Apr 29 01:53:45 2016 New Revision: 298762 URL: https://svnweb.freebsd.org/changeset/base/298762 Log: [ath] Add LDPC transmit support. LDPC adds better transmit reliability if both ends support it. You in theory can do both STBC and LDPC at the same time. If I see issues I'll disable it. * Only enable it if both ends of a connection negotiate it. * Disable it if any rate is non-11n. * Count both LDPC TX and STBC TX. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c == --- head/sys/dev/ath/if_ath_tx_ht.c Fri Apr 29 01:52:06 2016 (r298761) +++ head/sys/dev/ath/if_ath_tx_ht.c Fri Apr 29 01:53:45 2016 (r298762) @@ -227,6 +227,20 @@ ath_tx_rate_fill_rcflags(struct ath_soft struct ath_rc_series *rc = bf->bf_state.bfs_rc; uint8_t rate; int i; + int do_ldpc; + int do_stbc; + + /* +* We only do LDPC if the rate is 11n, both we and the +* receiver support LDPC and it's enabled. +* +* It's a global flag, not a per-try flag, so we clear +* it if any of the rate entries aren't 11n. +*/ + if ((ni->ni_vap->iv_htcaps & IEEE80211_HTCAP_LDPC) && + (ni->ni_htcap & IEEE80211_HTCAP_LDPC)) + do_ldpc = 1; + do_stbc = 0; for (i = 0; i < ATH_RC_NUM; i++) { rc[i].flags = 0; @@ -250,6 +264,12 @@ ath_tx_rate_fill_rcflags(struct ath_soft (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) rc[i].flags |= ATH_RC_RTSCTS_FLAG; + /* +* If we can't do LDPC, don't. +*/ + if (! IS_HT_RATE(rate)) + do_ldpc = 0; + /* Only enable shortgi, 2040, dual-stream if HT is set */ if (IS_HT_RATE(rate)) { rc[i].flags |= ATH_RC_HT_FLAG; @@ -281,6 +301,7 @@ ath_tx_rate_fill_rcflags(struct ath_soft (sc->sc_cur_txchainmask > 1) && HT_RC_2_STREAMS(rate) == 1) { rc[i].flags |= ATH_RC_STBC_FLAG; + do_stbc = 1; } /* @@ -324,6 +345,18 @@ ath_tx_rate_fill_rcflags(struct ath_soft "%s: i=%d, rate=0x%x, flags=0x%x, max4ms=%d\n", __func__, i, rate, rc[i].flags, rc[i].max4msframelen); } + + /* +* LDPC is a global flag, so ... +*/ + if (do_ldpc) { + bf->bf_state.bfs_txflags |= HAL_TXDESC_LDPC; + sc->sc_stats.ast_tx_ldpc++; + } + + if (do_stbc) { + sc->sc_stats.ast_tx_stbc++; + } } /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298761 - head/sys/dev/ath
Author: adrian Date: Fri Apr 29 01:52:06 2016 New Revision: 298761 URL: https://svnweb.freebsd.org/changeset/base/298761 Log: [ath] turn the BA hardware bug back into a printf(). I saw this happen a couple of times and all I saw was a dump of the transmit descriptors. Log the message for now so I can see whta happened. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c == --- head/sys/dev/ath/if_ath_tx.cFri Apr 29 01:51:27 2016 (r298760) +++ head/sys/dev/ath/if_ath_tx.cFri Apr 29 01:52:06 2016 (r298761) @@ -4876,7 +4876,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * /* AR5416 BA bug; this requires an interface reset */ if (isaggr && tx_ok && (! hasba)) { - DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, + device_printf(sc->sc_dev, "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, " "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298760 - head/sys/dev/ath
Author: adrian Date: Fri Apr 29 01:51:27 2016 New Revision: 298760 URL: https://svnweb.freebsd.org/changeset/base/298760 Log: [ath] Add counters for STBC TX and LDPC TX. This is a big no-op until the TX path changes to enable LDPC TX are added. Modified: head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_sysctl.c == --- head/sys/dev/ath/if_ath_sysctl.cThu Apr 28 22:14:09 2016 (r298759) +++ head/sys/dev/ath/if_ath_sysctl.cFri Apr 29 01:51:27 2016 (r298760) @@ -1285,6 +1285,12 @@ ath_sysctl_stats_attach(struct ath_softc SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_stbc", CTLFLAG_RD, &sc->sc_stats.ast_rx_stbc, 0, "Number of STBC frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_stbc", + CTLFLAG_RD, &sc->sc_stats.ast_tx_stbc, 0, + "Number of STBC frames transmitted"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_ldpc", + CTLFLAG_RD, &sc->sc_stats.ast_tx_ldpc, 0, + "Number of LDPC frames transmitted"); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_athioctl.h == --- head/sys/dev/ath/if_athioctl.h Thu Apr 28 22:14:09 2016 (r298759) +++ head/sys/dev/ath/if_athioctl.h Fri Apr 29 01:51:27 2016 (r298760) @@ -166,7 +166,9 @@ struct ath_stats { u_int32_t ast_tx_node_psq_overflow; u_int32_t ast_rx_stbc;/* RX STBC frame */ u_int32_t ast_tx_nodeq_overflow; /* node sw queue overflow */ - u_int32_t ast_pad[12]; + u_int32_t ast_tx_ldpc;/* TX LDPC frame */ + u_int32_t ast_tx_stbc;/* TX STBC frame */ + u_int32_t ast_pad[10]; }; #defineSIOCGATHSTATS _IOWR('i', 137, struct ifreq) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298759 - head/share/man/man7
Author: wblock (doc committer) Date: Thu Apr 28 22:14:09 2016 New Revision: 298759 URL: https://svnweb.freebsd.org/changeset/base/298759 Log: Clarify build(7) instructions for alternate object directory. PR: 209062 Submitted by: Shawn Debnath MFC after:1 week Differential Revision:https://reviews.freebsd.org/D6106 Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 == --- head/share/man/man7/build.7 Thu Apr 28 21:17:23 2016(r298758) +++ head/share/man/man7/build.7 Thu Apr 28 22:14:09 2016(r298759) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2016 +.Dd April 28, 2016 .Dt BUILD 7 .Os .Sh NAME @@ -195,6 +195,12 @@ Build everything but the kernel, configu .Pa etc , and .Pa release . +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. The actual build location prefix used is .Pa ${MAKEOBJDIRPREFIX}${.CURDIR} for native builds, and @@ -278,6 +284,12 @@ are: .Bl -tag -width ".Cm distributekernel" .It Cm buildkernel Rebuild the kernel and the kernel modules. +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. .It Cm installkernel Install the kernel and the kernel modules to directory .Pa ${DESTDIR}/boot/kernel , @@ -347,7 +359,7 @@ should be set as with .Dq Li "make installworld" . .It Cm delete-old-libs Delete obsolete base system libraries interactively. -This target should only be used if no 3rd party software uses these +This target should only be used if no third party software uses these libraries. When .Li -DBATCH_DELETE_OLD_FILES @@ -560,7 +572,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e., manpages, locale data files, timezone data files and +subdirectory (i.e., manual pages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298758 - head/sbin/camcontrol
Author: ngie Date: Thu Apr 28 21:17:23 2016 New Revision: 298758 URL: https://svnweb.freebsd.org/changeset/base/298758 Log: Remove logically impossible test in scsidoinquiry(..) It was already done 4 lines prior and the value of error didn't change MFC after: 3 days Reported by: Coverity CID: 1011236 Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c == --- head/sbin/camcontrol/camcontrol.c Thu Apr 28 20:30:49 2016 (r298757) +++ head/sbin/camcontrol/camcontrol.c Thu Apr 28 21:17:23 2016 (r298758) @@ -814,9 +814,6 @@ scsidoinquiry(struct cam_device *device, if (arglist & CAM_ARG_GET_SERIAL) scsiserial(device, retry_count, timeout); - if (error != 0) - return(error); - if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298757 - head/sys/net80211
Author: adrian Date: Thu Apr 28 20:30:49 2016 New Revision: 298757 URL: https://svnweb.freebsd.org/changeset/base/298757 Log: [net80211] fix indenting. Sponsored by: Eva Automation, Inc. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c == --- head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 20:29:49 2016 (r298756) +++ head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 20:30:49 2016 (r298757) @@ -854,8 +854,8 @@ adhoc_recv_mgmt(struct ieee80211_node *n case IEEE80211_FC0_SUBTYPE_ACTION: case IEEE80211_FC0_SUBTYPE_ACTION_NOACK: - if ((ni == vap->iv_bss) && - !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { + if ((ni == vap->iv_bss) && + !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "unknown node"); vap->iv_stats.is_rx_mgtdiscard++; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298756 - head/sys/net80211
Author: adrian Date: Thu Apr 28 20:29:49 2016 New Revision: 298756 URL: https://svnweb.freebsd.org/changeset/base/298756 Log: [net80211] handle action frames in adhoc mode from the node that created the BSS. We don't have a separate bss node; instead we dup the first node we saw and turn that into the BSS node. This means that action frames from that node would be rejected. So, check that the node is the bss node /and/ the MAC doesn't match ni_macaddr. That's the "right" way for now to verify it's an unknown node. This fixes handling action frames in adhoc mode, which includes negotiating 11n aggregation via ADDBA/DELBA. This by itself isn't enough to correctly create 11n adhoc networks; but it is required for aggregation to be negotiated. Tested: * AR9380, 11n adhoc mode * broadcom 11ac adhoc (vendor platform) Sponsored by: Eva Automation, Inc. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c == --- head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 19:26:46 2016 (r298755) +++ head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 20:29:49 2016 (r298756) @@ -854,7 +854,8 @@ adhoc_recv_mgmt(struct ieee80211_node *n case IEEE80211_FC0_SUBTYPE_ACTION: case IEEE80211_FC0_SUBTYPE_ACTION_NOACK: - if (ni == vap->iv_bss) { + if ((ni == vap->iv_bss) && + !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "unknown node"); vap->iv_stats.is_rx_mgtdiscard++; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298755 - in head/sys/geom: journal raid
Author: pfg Date: Thu Apr 28 19:26:46 2016 New Revision: 298755 URL: https://svnweb.freebsd.org/changeset/base/298755 Log: sys/geom: spelling fixes. These affect debugging messages. MFC after:2 weeks Modified: head/sys/geom/journal/g_journal.h head/sys/geom/raid/g_raid_ctl.c head/sys/geom/raid/md_ddf.c Modified: head/sys/geom/journal/g_journal.h == --- head/sys/geom/journal/g_journal.h Thu Apr 28 18:53:14 2016 (r298754) +++ head/sys/geom/journal/g_journal.h Thu Apr 28 19:26:46 2016 (r298755) @@ -224,7 +224,7 @@ struct g_journal_entry { #defineGJ_VALIDATE_OFFSET(offset, sc) do { \ if ((offset) + GJ_RECORD_MAX_SIZE(sc) >= (sc)->sc_jend) { \ (offset) = (sc)->sc_jstart; \ - GJ_DEBUG(2, "Starting from the begining (%s).", \ + GJ_DEBUG(2, "Starting from the beginning (%s).", \ (sc)->sc_name); \ } \ } while (0) Modified: head/sys/geom/raid/g_raid_ctl.c == --- head/sys/geom/raid/g_raid_ctl.c Thu Apr 28 18:53:14 2016 (r298754) +++ head/sys/geom/raid/g_raid_ctl.c Thu Apr 28 19:26:46 2016 (r298755) @@ -117,7 +117,7 @@ g_raid_ctl_label(struct gctl_req *req, s } format = gctl_get_asciiparam(req, "arg0"); if (format == NULL) { - gctl_error(req, "No format recieved."); + gctl_error(req, "No format received."); return; } crstatus = g_raid_create_node_format(format, req, &geom); @@ -164,7 +164,7 @@ g_raid_ctl_stop(struct gctl_req *req, st } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); @@ -204,7 +204,7 @@ g_raid_ctl_other(struct gctl_req *req, s } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); Modified: head/sys/geom/raid/md_ddf.c == --- head/sys/geom/raid/md_ddf.c Thu Apr 28 18:53:14 2016(r298754) +++ head/sys/geom/raid/md_ddf.c Thu Apr 28 19:26:46 2016(r298755) @@ -257,7 +257,7 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("BBM Log %u:%u\n", GET32(meta, hdr->bbmlog_section), GET32(meta, hdr->bbmlog_length)); printf("Diagnostic Space %u:%u\n", GET32(meta, hdr->Diagnostic_Space), GET32(meta, hdr->Diagnostic_Space_Length)); printf("Vendor_Specific_Logs %u:%u\n", GET32(meta, hdr->Vendor_Specific_Logs), GET32(meta, hdr->Vendor_Specific_Logs_Length)); - printf(" Controler Data \n"); + printf(" Controller Data \n"); printf("Controller_GUID "); print_guid(meta->cdr->Controller_GUID); printf("\n"); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298754 - head/sys/dev/acpica
Author: jhb Date: Thu Apr 28 18:53:14 2016 New Revision: 298754 URL: https://svnweb.freebsd.org/changeset/base/298754 Log: Only count CPU devices that are using the ACPI CPU driver. Arguably we should only be doing the probe/attach to children of these devices as well. Tested by:Michal Stanek (arm64) Differential Revision:https://reviews.freebsd.org/D6133 Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c == --- head/sys/dev/acpica/acpi_cpu.c Thu Apr 28 18:41:55 2016 (r298753) +++ head/sys/dev/acpica/acpi_cpu.c Thu Apr 28 18:53:14 2016 (r298754) @@ -429,7 +429,8 @@ acpi_cpu_postattach(void *unused __unuse } attached = 0; for (i = 0; i < n; i++) - if (device_is_attached(devices[i])) + if (device_is_attached(devices[i]) && + device_get_driver(devices[i]) == &acpi_cpu_driver) attached = 1; for (i = 0; i < n; i++) bus_generic_probe(devices[i]); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298753 - head/lib/libcam
Author: ngie Date: Thu Apr 28 18:41:55 2016 New Revision: 298753 URL: https://svnweb.freebsd.org/changeset/base/298753 Log: Fix va_list handling - Add missing va_end's after corresponding va_start's to cleanup state - Eliminate questionable bzero'ing of va_list passed in to do_buff_decode(..) and do_encode(..) from buff_{de,en}code_visit(..) and csio_{de,en}code_visit(..). Make va_list a pointer instead and pass NULL into the underlying functions to handler this in a portable way. - Do some minor style(9) clean up in affected functions. Differential Revision: https://reviews.freebsd.org/D6072 MFC after: 3 days Reported by: cppcheck, Coverity CID: 1018500-1018503 Reviewed by: cem Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libcam/scsi_cmdparse.c Modified: head/lib/libcam/scsi_cmdparse.c == --- head/lib/libcam/scsi_cmdparse.c Thu Apr 28 18:23:18 2016 (r298752) +++ head/lib/libcam/scsi_cmdparse.c Thu Apr 28 18:41:55 2016 (r298753) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); static int do_buff_decode(u_int8_t *databuf, size_t len, void (*arg_put)(void *, int , void *, int, char *), - void *puthook, const char *fmt, va_list ap) + void *puthook, const char *fmt, va_list *ap) { int assigned = 0; int width; @@ -128,7 +128,7 @@ do_buff_decode(u_int8_t *databuf, size_t (void *)((long)(ARG)), width, \ field_name); \ else \ - *(va_arg(ap, int *)) = (ARG); \ + *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ } \ field_name[0] = 0; \ @@ -255,7 +255,7 @@ do_buff_decode(u_int8_t *databuf, size_t databuf, width, field_name); else { char *dest; - dest = va_arg(ap, char *); + dest = va_arg(*ap, char *); bcopy(databuf, dest, width); if (letter == 'z') { char *p; @@ -287,7 +287,7 @@ do_buff_decode(u_int8_t *databuf, size_t * can't have a variable seek when you are using * "arg_put". */ - width = (arg_put) ? 0 : va_arg(ap, int); + width = (arg_put) ? 0 : va_arg(*ap, int); fmt++; } else { width = strtol(fmt, &intendp, 10); @@ -539,7 +539,7 @@ next_field(const char **pp, char *fmt, i static int do_encode(u_char *buff, size_t vec_max, size_t *used, int (*arg_get)(void *, char *), void *gethook, const char *fmt, - va_list ap) + va_list *ap) { int ind; int shift; @@ -564,7 +564,7 @@ do_encode(u_char *buff, size_t vec_max, else value = arg_get ? (*arg_get)(gethook, field_name) : - va_arg(ap, int); + va_arg(*ap, int); } #if 0 @@ -662,11 +662,16 @@ int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - 0, 0, fmt, ap)); + retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, 0, 0, +fmt, &ap); + + va_end(ap); + + return (retval); } int @@ -674,29 +679,31 @@ csio_decode_visit(struct ccb_scsiio *csi void (*arg_put)(void *, int, void *, int, char *), void *puthook) { - va_list ap; /* * We need some way to output things; we can't do it without * the arg_put function. */ if (arg_put == NULL) - return(-1); - - bzero(&ap, sizeof(ap)); + return (-1); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - arg_put, puthook, fmt, ap)); + return (do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, + arg_put, puthook, fmt, NULL)); } int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(buff, len, 0, 0, fmt, ap)); + retval = do_buff_decode(buff, len, 0, 0, fmt, &ap); + +
svn commit: r298752 - head/share/man/man9
Author: jhb Date: Thu Apr 28 18:23:18 2016 New Revision: 298752 URL: https://svnweb.freebsd.org/changeset/base/298752 Log: Add some notes about the implicit resource mapping for activated resources. Specifically, mention that rman_get_bustag/handle/virtual are valid after a resource is activated. Also, mention the wrapper API that accepts a struct resource instead of a bus tag and handle. Modified: head/share/man/man9/bus_activate_resource.9 Modified: head/share/man/man9/bus_activate_resource.9 == --- head/share/man/man9/bus_activate_resource.9 Thu Apr 28 18:01:25 2016 (r298751) +++ head/share/man/man9/bus_activate_resource.9 Thu Apr 28 18:23:18 2016 (r298752) @@ -52,8 +52,12 @@ .Sh DESCRIPTION These functions activate or deactivate a previously allocated resource. In general, resources must be activated before they can be accessed by -the driver so that the bus driver can map the resource into the -devices space. +the driver. +Bus drivers may perform additional actions to ensure that the resource is +ready to be accessed. +For example, +the PCI bus driver enables memory decoding in a PCI device's command register +when activating a memory resource. .Pp The arguments are as follows: .Bl -tag -width indent @@ -84,6 +88,47 @@ A pointer to the returned by .Xr bus_alloc_resource 9 . .El +.Ss Resource Mapping +Resources which can be mapped for CPU access by a +.Xr bus_space +tag and handle will create a mapping of the entire resource when activated. +The tag and handle for this mapping are stored in +.Fa r +and can be retrieved via +.Xr rman_get_bustag 9 +and +.Xr rman_get_bushandle 9 . +These can be used with the +.Xr bus_space 9 +API to access device registers or memory described by +.Fa r . +If the mapping is associated with a virtual address, +the virtual address can be retrieved via +.Xr rman_get_virtual 9 . +.Pp +A wrapper API for +.Xr bus_space 9 +is also provided that accepts the associated resource as the first argument +in place of the +.Xr bus_space 9 +tag and handle. +The functions in this wrapper API are named similarly to the +.Xr bus_space 9 +API except that +.Dq _space +is removed from their name. +For example, +.Fn bus_read_4 +can be used in place of +.Fn bus_space_read_4 . +The wrapper API is preferred in new drivers. +.Pp +These two statements both read a 32-bit register at the start of a +resource: +.Bd -literal + bus_space_read_4(rman_get_bustag(res), rman_get_bushandle(res), 0); + bus_read_4(res, 0); +.Ed .Sh RETURN VALUES Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298751 - head/share/man/man9
Author: jhb Date: Thu Apr 28 18:01:25 2016 New Revision: 298751 URL: https://svnweb.freebsd.org/changeset/base/298751 Log: Document RF_PREFETCHABLE. Modified: head/share/man/man9/bus_alloc_resource.9 Modified: head/share/man/man9/bus_alloc_resource.9 == --- head/share/man/man9/bus_alloc_resource.9Thu Apr 28 17:57:17 2016 (r298750) +++ head/share/man/man9/bus_alloc_resource.9Thu Apr 28 18:01:25 2016 (r298751) @@ -154,6 +154,8 @@ The resource still needs to be activated .Xr bus_activate_resource 9 . .It Dv RF_ACTIVE activate resource atomically. +.It Dv RF_PREFETCHABLE +resource is prefetchable. .It Dv RF_SHAREABLE resource permits contemporaneous sharing. It should always be set unless you know that the resource cannot be shared. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298750 - head/usr.sbin/bsnmpd/tools/libbsnmptools
Author: ngie Date: Thu Apr 28 17:57:17 2016 New Revision: 298750 URL: https://svnweb.freebsd.org/changeset/base/298750 Log: Use a better idiom for finding UTC prefixed timezones Instead of copy-pasting the string literal for "UTC" 3 times and using strlen, use a static char[3] buffer and sizeof(..). MFC after: 3 days X-MFC with: r298507 Submitted by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c == --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Thu Apr 28 17:50:16 2016(r298749) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Thu Apr 28 17:57:17 2016(r298750) @@ -338,8 +338,9 @@ static char * snmp_date2asn_oid(char *str, struct asn_oid *oid) { char *endptr, *ptr; - uint32_t v; + static const char UTC[3] = "UTC"; int32_t saved_errno; + uint32_t v; if (snmp_suboid_append(oid, (asn_subid_t) SNMP_DATETIME_OCTETS) < 0) return (NULL); @@ -440,8 +441,8 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'UTC' - optional */ ptr = endptr + 1; - if (strncmp(ptr, "UTC", strlen("UTC")) == 0) - ptr += strlen("UTC"); + if (strncmp(ptr, UTC, sizeof(UTC)) == 0) + ptr += sizeof(UTC); /* '+/-' */ if (*ptr == '-' || *ptr == '+') { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298749 - head/share/man/man9
Author: jhb Date: Thu Apr 28 17:50:16 2016 New Revision: 298749 URL: https://svnweb.freebsd.org/changeset/base/298749 Log: Document PCI_RES_BUS as a possible resource type. Modified: head/share/man/man9/bus_activate_resource.9 head/share/man/man9/bus_alloc_resource.9 Modified: head/share/man/man9/bus_activate_resource.9 == --- head/share/man/man9/bus_activate_resource.9 Thu Apr 28 17:48:52 2016 (r298748) +++ head/share/man/man9/bus_activate_resource.9 Thu Apr 28 17:50:16 2016 (r298749) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2003 +.Dd April 28, 2016 .Dt BUS_ACTIVATE_RESOURCE 9 .Os .Sh NAME @@ -65,6 +65,8 @@ The type of resource you want to allocat It is one of: .Pp .Bl -tag -width ".Dv SYS_RES_MEMORY" -compact +.It Dv PCI_RES_BUS +for PCI bus numbers .It Dv SYS_RES_IRQ for IRQs .It Dv SYS_RES_DRQ Modified: head/share/man/man9/bus_alloc_resource.9 == --- head/share/man/man9/bus_alloc_resource.9Thu Apr 28 17:48:52 2016 (r298748) +++ head/share/man/man9/bus_alloc_resource.9Thu Apr 28 17:50:16 2016 (r298749) @@ -95,6 +95,8 @@ Before allocation, the resource is owned is the type of resource you want to allocate. It is one of: .Bl -tag -width SYS_RES_MEMORY +.It Dv PCI_RES_BUS +for PCI bus numbers .It Dv SYS_RES_IRQ for IRQs .It Dv SYS_RES_DRQ @@ -111,7 +113,7 @@ For ISA this is an index into an array o for this device by either the PnP mechanism, or via the hints mechanism. For PCCARD, this is an index into the array of resources described by the PC Card's CIS entry. -For PCI, the offset into pci config space which has the BAR to use to access +For PCI, the offset into PCI config space which has the BAR to use to access the resource. The bus methods are free to change the RIDs that they are given as a parameter. You must not depend on the value you gave it earlier. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298748 - head/share/man/man9
Author: jhb Date: Thu Apr 28 17:48:52 2016 New Revision: 298748 URL: https://svnweb.freebsd.org/changeset/base/298748 Log: Remove a stale reference to the removed RF_TIMESHARE flag. Modified: head/share/man/man9/bus_alloc_resource.9 Modified: head/share/man/man9/bus_alloc_resource.9 == --- head/share/man/man9/bus_alloc_resource.9Thu Apr 28 15:53:10 2016 (r298747) +++ head/share/man/man9/bus_alloc_resource.9Thu Apr 28 17:48:52 2016 (r298748) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2016 +.Dd April 28, 2016 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -162,8 +162,6 @@ For example, cannot share IRQs while .Xr cardbus 4 can. -.It Dv RF_TIMESHARE -resource permits time-division sharing. .El .El .Sh RETURN VALUES ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298747 - in head/sys: net netinet netinet6
Author: rrs Date: Thu Apr 28 15:53:10 2016 New Revision: 298747 URL: https://svnweb.freebsd.org/changeset/base/298747 Log: Complete the UDP tunneling of ICMP msgs to those protocols interested in having tunneled UDP and finding out about the ICMP (tested by Michael Tuexen with SCTP.. soon to be using this feature). Differential Revision:http://reviews.freebsd.org/D5875 Modified: head/sys/net/if_vxlan.c head/sys/netinet/sctputil.c head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/udp6_usrreq.c Modified: head/sys/net/if_vxlan.c == --- head/sys/net/if_vxlan.c Thu Apr 28 15:20:08 2016(r298746) +++ head/sys/net/if_vxlan.c Thu Apr 28 15:53:10 2016(r298747) @@ -930,7 +930,7 @@ vxlan_socket_init(struct vxlan_socket *v } error = udp_set_kernel_tunneling(vso->vxlso_sock, - vxlan_rcv_udp_packet, vso); + vxlan_rcv_udp_packet, NULL, vso); if (error) { if_printf(ifp, "cannot set tunneling function: %d\n", error); return (error); Modified: head/sys/netinet/sctputil.c == --- head/sys/netinet/sctputil.c Thu Apr 28 15:20:08 2016(r298746) +++ head/sys/netinet/sctputil.c Thu Apr 28 15:53:10 2016(r298747) @@ -6945,7 +6945,7 @@ sctp_over_udp_start(void) } /* Call the special UDP hook. */ if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp4_tun_socket), - sctp_recv_udp_tunneled_packet, NULL))) { + sctp_recv_udp_tunneled_packet, NULL, NULL))) { sctp_over_udp_stop(); return (ret); } @@ -6969,7 +6969,7 @@ sctp_over_udp_start(void) } /* Call the special UDP hook. */ if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp6_tun_socket), - sctp_recv_udp_tunneled_packet, NULL))) { + sctp_recv_udp_tunneled_packet, NULL, NULL))) { sctp_over_udp_stop(); return (ret); } Modified: head/sys/netinet/udp_usrreq.c == --- head/sys/netinet/udp_usrreq.c Thu Apr 28 15:20:08 2016 (r298746) +++ head/sys/netinet/udp_usrreq.c Thu Apr 28 15:53:10 2016 (r298747) @@ -792,6 +792,21 @@ udp_common_ctlinput(int cmd, struct sock udp_notify(inp, inetctlerrmap[cmd]); } INP_RUNLOCK(inp); + } else { + inp = in_pcblookup(pcbinfo, faddr, uh->uh_dport, + ip->ip_src, uh->uh_sport, + INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL); + if (inp != NULL) { + struct udpcb *up; + + up = intoudpcb(inp); + if (up->u_icmp_func != NULL) { + INP_RUNLOCK(inp); + (*up->u_icmp_func)(cmd, sa, vip, up->u_tun_ctx); + } else { + INP_RUNLOCK(inp); + } + } } } else in_pcbnotifyall(pcbinfo, faddr, inetctlerrmap[cmd], @@ -1748,7 +1763,7 @@ udp_attach(struct socket *so, int proto, #endif /* INET */ int -udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, void *ctx) +udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, udp_tun_icmp_t i, void *ctx) { struct inpcb *inp; struct udpcb *up; @@ -1759,11 +1774,13 @@ udp_set_kernel_tunneling(struct socket * KASSERT(inp != NULL, ("udp_set_kernel_tunneling: inp == NULL")); INP_WLOCK(inp); up = intoudpcb(inp); - if (up->u_tun_func != NULL) { + if ((up->u_tun_func != NULL) || + (up->u_icmp_func != NULL)) { INP_WUNLOCK(inp); return (EBUSY); } up->u_tun_func = f; + up->u_icmp_func = i; up->u_tun_ctx = ctx; INP_WUNLOCK(inp); return (0); Modified: head/sys/netinet/udp_var.h == --- head/sys/netinet/udp_var.h Thu Apr 28 15:20:08 2016(r298746) +++ head/sys/netinet/udp_var.h Thu Apr 28 15:53:10 2016(r298747) @@ -55,14 +55,16 @@ struct udpiphdr { struct inpcb; struct mbuf; -typedef void(*udp_tun_func_t)(struct mbuf *, int off, struct inpcb *, +typedef void(*udp_tun_func_t)(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); - +typedef void(*udp_tun_icmp_t)(int, struct sockaddr *, void *, void *); +
svn commit: r298746 - head/usr.bin/localedef
Author: pfg Date: Thu Apr 28 15:20:08 2016 New Revision: 298746 URL: https://svnweb.freebsd.org/changeset/base/298746 Log: Small typo. Modified: head/usr.bin/localedef/wide.c Modified: head/usr.bin/localedef/wide.c == --- head/usr.bin/localedef/wide.c Thu Apr 28 15:18:28 2016 (r298745) +++ head/usr.bin/localedef/wide.c Thu Apr 28 15:20:08 2016 (r298746) @@ -92,7 +92,7 @@ static struct { { "EUC-CN", "EUC-CN", 16, towide_euccn, tomb_mbs }, { "eucCN", "EUC-CN", 16, towide_euccn, tomb_mbs }, /* -* Becuase the 3-byte form of EUC-JP use the same leading byte, +* Because the 3-byte form of EUC-JP use the same leading byte, * only 17 bits required to provide unique priorities. (The low * bit of that first byte is set.) By setting this value low, * we can get by with only 3 bytes in the strxfrm expansion. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298745 - head/sys/cam/scsi
Author: pfg Date: Thu Apr 28 15:18:28 2016 New Revision: 298745 URL: https://svnweb.freebsd.org/changeset/base/298745 Log: Small typos. Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c == --- head/sys/cam/scsi/scsi_all.cThu Apr 28 15:13:50 2016 (r298744) +++ head/sys/cam/scsi/scsi_all.cThu Apr 28 15:18:28 2016 (r298745) @@ -5505,7 +5505,7 @@ scsi_calc_syncsrate(u_int period_factor) } /* - * Return the SCSI sync parameter that corresponsd to + * Return the SCSI sync parameter that corresponds to * the passed in period in 10ths of ns. */ u_int @@ -5956,7 +5956,7 @@ scsi_parse_transportid_64bit(int proto_i break; default: if (error_str != NULL) { - snprintf(error_str, error_str_len, "%s: unsupoprted " + snprintf(error_str, error_str_len, "%s: unsupported " "protocol %d", __func__, proto_id); } retval = 1; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298744 - head/usr.sbin/extattr/tests
Author: asomers Date: Thu Apr 28 15:13:50 2016 New Revision: 298744 URL: https://svnweb.freebsd.org/changeset/base/298744 Log: Add PACKAGE fields to usr.sbin/extattr/tests/Makefile usr.sbin/extattr/tests/Makefile Add boiler plate required by 298107 but omitted by 298483. These two changes passed through CR in parallel. I think this should get the full test suite running in Jenkins again. MFC after:22 days X-MFC-with: 298483 Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/extattr/tests/Makefile Modified: head/usr.sbin/extattr/tests/Makefile == --- head/usr.sbin/extattr/tests/MakefileThu Apr 28 13:27:12 2016 (r298743) +++ head/usr.sbin/extattr/tests/MakefileThu Apr 28 15:13:50 2016 (r298744) @@ -1,5 +1,9 @@ # $FreeBSD$ +PACKAGE= tests +FILESGROUPS= TESTS +TESTSPACKAGE= ${PACKAGE} + ATF_TESTS_SH= extattr_test .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298743 - in head/sys/netinet: . tcp_stacks
Author: rrs Date: Thu Apr 28 13:27:12 2016 New Revision: 298743 URL: https://svnweb.freebsd.org/changeset/base/298743 Log: This cleans up the timers code in TCP to start using the new async_drain functionality. This as been tested in NF as well as by Verisign. Still to do in here is to remove all the old flags. They are currently left being maintained but probably are no longer needed. Sponsored by: Netflix Inc. Differential Revision:http://reviews.freebsd.org/D5924 Modified: head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_stacks/fastpath.c == --- head/sys/netinet/tcp_stacks/fastpath.c Thu Apr 28 13:00:40 2016 (r298742) +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Apr 28 13:27:12 2016 (r298743) @@ -2386,7 +2386,6 @@ struct tcp_function_block __tcp_fastslow NULL, NULL, NULL, - NULL, 0, 0 @@ -2403,7 +2402,6 @@ struct tcp_function_block __tcp_fastack NULL, NULL, NULL, - NULL, 0, 0 }; Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Thu Apr 28 13:00:40 2016(r298742) +++ head/sys/netinet/tcp_subr.c Thu Apr 28 13:27:12 2016(r298743) @@ -244,7 +244,6 @@ static struct inpcb *tcp_mtudisc_notify( static void tcp_mtudisc(struct inpcb *, int); static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr); -static voidtcp_timer_discard(struct tcpcb *, uint32_t); static struct tcp_function_block tcp_def_funcblk = { @@ -258,7 +257,6 @@ static struct tcp_function_block tcp_def NULL, NULL, NULL, - NULL, 0, 0 }; @@ -528,7 +526,6 @@ register_tcp_functions(struct tcp_functi return (EINVAL); } if (blk->tfb_tcp_timer_stop_all || - blk->tfb_tcp_timers_left || blk->tfb_tcp_timer_activate || blk->tfb_tcp_timer_active || blk->tfb_tcp_timer_stop) { @@ -537,7 +534,6 @@ register_tcp_functions(struct tcp_functi * must have them all. */ if ((blk->tfb_tcp_timer_stop_all == NULL) || - (blk->tfb_tcp_timers_left == NULL) || (blk->tfb_tcp_timer_activate == NULL) || (blk->tfb_tcp_timer_active == NULL) || (blk->tfb_tcp_timer_stop == NULL)) { @@ -1343,13 +1339,21 @@ tcp_discardcb(struct tcpcb *tp) * callout, and the last discard function called will take care of * deleting the tcpcb. */ + tp->t_timers->tt_draincnt = 0; tcp_timer_stop(tp, TT_REXMT); tcp_timer_stop(tp, TT_PERSIST); tcp_timer_stop(tp, TT_KEEP); tcp_timer_stop(tp, TT_2MSL); tcp_timer_stop(tp, TT_DELACK); if (tp->t_fb->tfb_tcp_timer_stop_all) { - /* Call the stop-all function of the methods */ + /* +* Call the stop-all function of the methods, +* this function should call the tcp_timer_stop() +* method with each of the function specific timeouts. +* That stop will be called via the tfb_tcp_timer_stop() +* which should use the async drain function of the +* callout system (see tcp_var.h). +*/ tp->t_fb->tfb_tcp_timer_stop_all(tp); } @@ -1434,13 +1438,8 @@ tcp_discardcb(struct tcpcb *tp) CC_ALGO(tp) = NULL; inp->inp_ppcb = NULL; - if ((tp->t_timers->tt_flags & TT_MASK) == 0) { + if (tp->t_timers->tt_draincnt == 0) { /* We own the last reference on tcpcb, let's free it. */ - if ((tp->t_fb->tfb_tcp_timers_left) && - (tp->t_fb->tfb_tcp_timers_left(tp))) { - /* Some fb timers left running! */ - return; - } if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp); refcount_release(&tp->t_fb->tfb_refcnt); @@ -1453,45 +1452,12 @@ tcp_discardcb(struct tcpcb *tp) } void -tcp_timer_2msl_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_2MSL); -} - -void -tcp_timer_keep_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_KEEP); -} - -void -tcp_timer_persist_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_PERSIST); -} - -void -tcp_timer_rexmt_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_REXMT); -} - -void -tcp_timer_delack_discard(void *xtp) -{
svn commit: r298742 - head/sys/arm/nvidia
Author: mmel Date: Thu Apr 28 13:00:40 2016 New Revision: 298742 URL: https://svnweb.freebsd.org/changeset/base/298742 Log: TEGRA: Add interrupt support for Tegra GPIO controller. Modified: head/sys/arm/nvidia/tegra_gpio.c Modified: head/sys/arm/nvidia/tegra_gpio.c == --- head/sys/arm/nvidia/tegra_gpio.cThu Apr 28 12:24:58 2016 (r298741) +++ head/sys/arm/nvidia/tegra_gpio.cThu Apr 28 13:00:40 2016 (r298742) @@ -30,21 +30,20 @@ __FBSDID("$FreeBSD$"); /* * Tegra GPIO driver. */ -#include -__FBSDID("$FreeBSD$"); - +#include "opt_platform.h" #include #include #include - +#include #include -#include +#include #include #include +#include #include -#include #include +#include #include #include @@ -53,14 +52,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pic_if.h" -#defineGPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#defineGPIO_UNLOCK(_sc)mtx_unlock(&(_sc)->sc_mtx) -#defineGPIO_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ - device_get_nameunit(_sc->sc_dev), "tegra_gpio", MTX_DEF) -#defineGPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#defineGPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#defineGPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#defineGPIO_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#defineGPIO_UNLOCK(_sc)mtx_unlock(&(_sc)->mtx) +#defineGPIO_LOCK_INIT(_sc) mtx_init(&_sc->mtx, \ + device_get_nameunit(_sc->dev), "tegra_gpio", MTX_DEF) +#defineGPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->mtx); +#defineGPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED); +#defineGPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->mtx, MA_NOTOWNED); #defineWR4(_sc, _r, _v)bus_write_4((_sc)->mem_res, (_r), (_v)) #defineRD4(_sc, _r)bus_read_4((_sc)->mem_res, (_r)) @@ -87,6 +87,11 @@ __FBSDID("$FreeBSD$"); #defineGPIO_INT_STA0x40 #defineGPIO_INT_ENB0x50 #defineGPIO_INT_LVL0x60 +#define GPIO_INT_LVL_DELTA(1 << 16) +#define GPIO_INT_LVL_EDGE (1 << 8) +#define GPIO_INT_LVL_HIGH (1 << 0) +#define GPIO_INT_LVL_MASK (GPIO_INT_LVL_DELTA | \ +GPIO_INT_LVL_EDGE | GPIO_INT_LVL_HIGH) #defineGPIO_INT_CLR0x70 #defineGPIO_MSK_CNF0x80 #defineGPIO_MSK_OE 0x90 @@ -102,19 +107,33 @@ char *tegra_gpio_port_names[] = { "M", "N", "O", "P", /* Bank 3 */ "Q", "R", "S", "T", /* Bank 4 */ "U", "V", "W", "X", /* Bank 5 */ -"Y", "Z", "AA", "BB", /* Bank 5 */ - "CC", "DD", "EE"/* Bank 5 */ +"Y", "Z", "AA", "BB", /* Bank 6 */ + "CC", "DD", "EE"/* Bank 7 */ +}; + +struct tegra_gpio_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + uint32_tcfgreg; +}; + +struct tegra_gpio_softc; +struct tegra_gpio_irq_cookie { + struct tegra_gpio_softc *sc; + int bank_num; }; struct tegra_gpio_softc { device_tdev; - device_tsc_busdev; - struct mtx sc_mtx; + device_tbusdev; + struct mtx mtx; struct resource *mem_res; - struct resource *irq_res; - void*gpio_ih; + struct resource *irq_res[GPIO_NUM_BANKS]; + void*irq_ih[GPIO_NUM_BANKS]; + struct tegra_gpio_irq_cookie irq_cookies[GPIO_NUM_BANKS]; int gpio_npins; struct gpio_pin gpio_pins[NGPIO]; + struct tegra_gpio_irqsrc *isrcs; }; static struct ofw_compat_data compat_data[] = { @@ -122,6 +141,11 @@ static struct ofw_compat_data compat_dat {NULL, 0} }; +/* -- + * + * GPIO + * + */ static inline void gpio_write_masked(struct tegra_gpio_softc *sc, bus_size_t reg, struct gpio_pin *pin, uint32_t val) @@ -134,6 +158,7 @@ gpio_write_masked(struct tegra_gpio_soft tmp |= (val & 1) << bit;/* value */ bus_write_4(sc->mem_res, reg + GPIO_REGNUM(pin->gp_pin), tmp); } + static inline uint32_t gpio_read(struct tegra_gpio_softc *sc, bus_size_t reg, struct gpio_pin *pin) { @@ -170,7 +195,7 @@ tegra_gpio_get_bus(device_t dev) struct tegra_gpio_softc *sc; sc = device_get_softc(dev); - return (sc->sc_busdev); + return (sc->busdev); } static int @@ -308,32 +333,363 @@ tegra_gpio_pin_toggle(device_t dev, uint return (0);
svn commit: r298741 - head/contrib/jemalloc/include/jemalloc
Author: andrew Date: Thu Apr 28 12:24:58 2016 New Revision: 298741 URL: https://svnweb.freebsd.org/changeset/base/298741 Log: Stop using sbrk(2) with malloc. This helps reduce the number of places within the tree where we call this legacy interface. Reviewed by: jasone Obtained from:brooks Sponsored by: ABT Systems Ltd Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h == --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Apr 28 12:05:07 2016(r298740) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Apr 28 12:24:58 2016(r298741) @@ -8,6 +8,8 @@ #defineJEMALLOC_DEBUG #endif +#undef JEMALLOC_DSS + /* * The following are architecture-dependent, so conditionally define them for * each supported architecture. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298740 - head/sys/arm/arm
Author: mmel Date: Thu Apr 28 12:05:07 2016 New Revision: 298740 URL: https://svnweb.freebsd.org/changeset/base/298740 Log: ARM: Use kernel pmap as intermediate mapping in context switch. On ARM, we can directly switch between translation tables only when the size of the mapping for any given virtual address is the same in the old and new translation tables. The load of new TTB and subsequent TLB flush is not atomic operation. So speculative page table walk can load TLB entry from new mapping while rest of TLB entries are still the old ones. In worst case, this can lead to situation when TLB cache can contain multiple matching TLB entries. One (from old mapping) L2 entry for VA + 4k and one (from new mapping) L1 entry for VA. Thus, we must switch to kernel pmap translation table as intermediate mapping because all sizes of these (old pmap and kernel pmap) mappings are same (or unmapped). The same is true for switch from kernel pmap translation table to new pmap one. Modified: head/sys/arm/arm/swtch-v6.S Modified: head/sys/arm/arm/swtch-v6.S == --- head/sys/arm/arm/swtch-v6.S Thu Apr 28 12:04:12 2016(r298739) +++ head/sys/arm/arm/swtch-v6.S Thu Apr 28 12:05:07 2016(r298740) @@ -114,25 +114,37 @@ __FBSDID("$FreeBSD$"); .Lblocked_lock: .word _C_LABEL(blocked_lock) -ENTRY(cpu_context_switch) /* QQQ: What about macro instead of function? */ +ENTRY(cpu_context_switch) DSB - mcr CP15_TTBR0(r0) /* set the new TTB */ + /* + * We can directly switch between translation tables only when the + * size of the mapping for any given virtual address is the same + * in the old and new translation tables. + * Thus, we must switch to kernel pmap translation table as + * intermediate mapping because all sizes of these mappings are same + * (or unmapped). The same is true for switch from kernel pmap + * translation table to new pmap one. + */ + mov r2, #(CPU_ASID_KERNEL) + ldr r1, =(_C_LABEL(pmap_kern_ttb)) + ldr r1, [r1] + mcr CP15_TTBR0(r1) /* switch to kernel TTB */ + ISB + mcr CP15_TLBIASID(r2) /* flush not global TLBs */ + DSB + mcr CP15_TTBR0(r0) /* switch to new TTB */ ISB - mov r0, #(CPU_ASID_KERNEL) - mcr CP15_TLBIASID(r0) /* flush not global TLBs */ + /* + * We must flush not global TLBs again because PT2MAP mapping + * is different. + */ + mcr CP15_TLBIASID(r2) /* flush not global TLBs */ /* * Flush entire Branch Target Cache because of the branch predictor * is not architecturally invisible. See ARM Architecture Reference * Manual ARMv7-A and ARMv7-R edition, page B2-1264(65), Branch * predictors and Requirements for branch predictor maintenance * operations sections. - * - * QQQ: The predictor is virtually addressed and holds virtual target - * addresses. Therefore, if mapping is changed, the predictor cache - * must be flushed.The flush is part of entire i-cache invalidation - * what is always called when code mapping is changed. So herein, - * it's the only place where standalone predictor flush must be - * executed in kernel (except self modifying code case). */ mcr CP15_BPIALL /* flush entire Branch Target Cache */ DSB ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298739 - in head/sys: dev/gpio kern sys
Author: mmel Date: Thu Apr 28 12:04:12 2016 New Revision: 298739 URL: https://svnweb.freebsd.org/changeset/base/298739 Log: INTRNG: Define 'INTR_IRQ_INVALID' constant and use it consistently as error indicator. Modified: head/sys/dev/gpio/gpiobus.c head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/dev/gpio/gpiobus.c == --- head/sys/dev/gpio/gpiobus.c Thu Apr 28 12:03:22 2016(r298738) +++ head/sys/dev/gpio/gpiobus.c Thu Apr 28 12:04:12 2016(r298739) @@ -90,7 +90,7 @@ gpio_alloc_intr_resource(device_t consum * into it. */ irqnum = intr_gpio_map_irq(pin->dev, pin->pin, pin->flags, intr_mode); - if (irqnum == 0x) + if (irqnum == INTR_IRQ_INVALID) return (NULL); return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, Modified: head/sys/kern/subr_intr.c == --- head/sys/kern/subr_intr.c Thu Apr 28 12:03:22 2016(r298738) +++ head/sys/kern/subr_intr.c Thu Apr 28 12:04:12 2016(r298739) @@ -109,8 +109,6 @@ static struct mtx isrc_table_lock; static struct intr_irqsrc *irq_sources[NIRQ]; u_int irq_next_free; -#define IRQ_INVALIDnitems(irq_sources) - /* * XXX - All stuff around struct intr_dev_data is considered as temporary * until better place for storing struct intr_map_data will be find. @@ -138,7 +136,7 @@ static struct intr_dev_data *intr_ddata_ static u_int intr_ddata_first_unused; #define IRQ_DDATA_BASE 1 -CTASSERT(IRQ_DDATA_BASE > IRQ_INVALID); +CTASSERT(IRQ_DDATA_BASE > nitems(irq_sources)); #ifdef SMP static boolean_t irq_assign_cpu = FALSE; @@ -399,7 +397,7 @@ isrc_free_irq(struct intr_irqsrc *isrc) return (EINVAL); irq_sources[isrc->isrc_irq] = NULL; - isrc->isrc_irq = IRQ_INVALID; /* just to be safe */ + isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */ return (0); } @@ -427,7 +425,7 @@ intr_isrc_register(struct intr_irqsrc *i bzero(isrc, sizeof(struct intr_irqsrc)); isrc->isrc_dev = dev; - isrc->isrc_irq = IRQ_INVALID; /* just to be safe */ + isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */ isrc->isrc_flags = flags; va_start(ap, fmt); @@ -560,7 +558,7 @@ intr_acpi_map_irq(device_t dev, u_int ir ddata = intr_ddata_alloc(0); if (ddata == NULL) - return (0x);/* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_dev = dev; ddata->idd_data.type = INTR_MAP_DATA_ACPI; @@ -585,7 +583,7 @@ intr_fdt_map_irq(phandle_t node, pcell_t cellsize = ncells * sizeof(*cells); ddata = intr_ddata_alloc(cellsize); if (ddata == NULL) - return (0x);/* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_xref = (intptr_t)node; ddata->idd_data.type = INTR_MAP_DATA_FDT; @@ -607,7 +605,7 @@ intr_gpio_map_irq(device_t dev, u_int pi ddata = intr_ddata_alloc(0); if (ddata == NULL) - return (0x);/* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_dev = dev; ddata->idd_data.type = INTR_MAP_DATA_GPIO; Modified: head/sys/sys/intr.h == --- head/sys/sys/intr.h Thu Apr 28 12:03:22 2016(r298738) +++ head/sys/sys/intr.h Thu Apr 28 12:04:12 2016(r298739) @@ -32,6 +32,8 @@ #include +#defineINTR_IRQ_INVALID0x + enum intr_map_data_type { INTR_MAP_DATA_ACPI, INTR_MAP_DATA_FDT, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298738 - in head/sys: dev/gpio kern sys
Author: mmel Date: Thu Apr 28 12:03:22 2016 New Revision: 298738 URL: https://svnweb.freebsd.org/changeset/base/298738 Log: GPIO: Add support for gpio pin interrupts. Add new function gpio_alloc_intr_resource(), which allows an allocation of interrupt resource associated to given gpio pin. It also allows to specify interrupt configuration. Note: This functionality is dependent on INTRNG, and must be implemented in each GPIO controller. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/kern/subr_intr.c head/sys/sys/gpio.h head/sys/sys/intr.h Modified: head/sys/dev/gpio/gpiobus.c == --- head/sys/dev/gpio/gpiobus.c Thu Apr 28 09:40:24 2016(r298737) +++ head/sys/dev/gpio/gpiobus.c Thu Apr 28 12:03:22 2016(r298738) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,6 +73,31 @@ static int gpiobus_pin_set(device_t, dev static int gpiobus_pin_get(device_t, device_t, uint32_t, unsigned int*); static int gpiobus_pin_toggle(device_t, device_t, uint32_t); +/* + * XXX -> Move me to better place - gpio_subr.c? + * Also, this function must be changed when interrupt configuration + * data will be moved into struct resource. + */ +#ifdef INTRNG +struct resource * +gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, +gpio_pin_t pin, uint32_t intr_mode) +{ + u_int irqnum; + + /* +* Allocate new fictitious interrupt number and store configuration +* into it. +*/ + irqnum = intr_gpio_map_irq(pin->dev, pin->pin, pin->flags, intr_mode); + if (irqnum == 0x) + return (NULL); + + return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, + irqnum, irqnum, 1, alloc_flags)); +} +#endif + int gpio_check_flags(uint32_t caps, uint32_t flags) { Modified: head/sys/dev/gpio/gpiobusvar.h == --- head/sys/dev/gpio/gpiobusvar.h Thu Apr 28 09:40:24 2016 (r298737) +++ head/sys/dev/gpio/gpiobusvar.h Thu Apr 28 12:03:22 2016 (r298738) @@ -61,6 +61,9 @@ #defineGPIOBUS_WAIT1 #defineGPIOBUS_DONTWAIT2 +/* Use default interrupt mode - for gpio_alloc_intr_resource */ +#define GPIO_INTR_CONFORM GPIO_INTR_NONE + struct gpiobus_pin_data { int mapped; /* pin is mapped/reserved. */ @@ -122,6 +125,10 @@ int gpio_pin_is_active(gpio_pin_t pin, b int gpio_pin_set_active(gpio_pin_t pin, bool active); int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags); #endif +#ifdef INTRNG +struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid, +u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode); +#endif int gpio_check_flags(uint32_t, uint32_t); device_t gpiobus_attach_bus(device_t); int gpiobus_detach_bus(device_t); Modified: head/sys/kern/subr_intr.c == --- head/sys/kern/subr_intr.c Thu Apr 28 09:40:24 2016(r298737) +++ head/sys/kern/subr_intr.c Thu Apr 28 12:03:22 2016(r298738) @@ -596,6 +596,27 @@ intr_fdt_map_irq(phandle_t node, pcell_t } #endif +/* + * Store GPIO interrupt decription in framework and return unique interrupt + * number (resource handle) associated with it. + */ +u_int +intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, u_int intr_mode) +{ + struct intr_dev_data *ddata; + + ddata = intr_ddata_alloc(0); + if (ddata == NULL) + return (0x);/* no space left */ + + ddata->idd_dev = dev; + ddata->idd_data.type = INTR_MAP_DATA_GPIO; + ddata->idd_data.gpio.gpio_pin_num = pin_num; + ddata->idd_data.gpio.gpio_pin_flags = pin_flags; + ddata->idd_data.gpio.gpio_intr_mode = intr_mode; + return (ddata->idd_irq); +} + #ifdef INTR_SOLO /* * Setup filter into interrupt source. Modified: head/sys/sys/gpio.h == --- head/sys/sys/gpio.h Thu Apr 28 09:40:24 2016(r298737) +++ head/sys/sys/gpio.h Thu Apr 28 12:03:22 2016(r298738) @@ -60,16 +60,26 @@ #define GPIOMAXNAME64 /* GPIO pin configuration flags */ -#define GPIO_PIN_INPUT 0x0001 /* input direction */ -#define GPIO_PIN_OUTPUT0x0002 /* output direction */ -#define GPIO_PIN_OPENDRAIN 0x0004 /* open-drain output */ -#define GPIO_PIN_PUSHPULL 0x0008 /* push-pull output */ -#define GPIO_PIN_TRISTATE 0x0010 /* output disabled */ -#define GPIO_PIN_PULLUP0x0020 /* internal pull-up enabled */ -#define GPIO_PIN_PULLDOWN 0x0040 /* internal pull-down enabled */ -#define GPIO_PIN_INVIN 0x0080 /* invert input */
svn commit: r298737 - head/sys/amd64/amd64
Author: avg Date: Thu Apr 28 09:40:24 2016 New Revision: 298737 URL: https://svnweb.freebsd.org/changeset/base/298737 Log: fix missing variable in r298736 Pointyhat to: avg Reported by: Ivan Klymenko MFC after:2 weeks X-MFC with: r298736 Modified: head/sys/amd64/amd64/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c == --- head/sys/amd64/amd64/initcpu.c Thu Apr 28 08:29:57 2016 (r298736) +++ head/sys/amd64/amd64/initcpu.c Thu Apr 28 09:40:24 2016 (r298737) @@ -58,6 +58,7 @@ static inthw_clflush_disable = -1; static void init_amd(void) { + uint64_t msr; /* * Work around Erratum 721 for Family 10h and 12h processors. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r298736 - head/sys/amd64/amd64
On Thu, 28 Apr 2016 08:29:57 + (UTC) Andriy Gapon wrote: > Author: avg > Date: Thu Apr 28 08:29:57 2016 > New Revision: 298736 > URL: https://svnweb.freebsd.org/changeset/base/298736 > > Log: > ensure that initial local apic id is sane on AMD 10h systems > > Summary: > The Initial Local APIC ID is returned by CPUID function 1 (in EBX). > On AMD Family 10h systems the way that ID is built is controlled by > an MSR bit (InitApicIdCpuIdLo). BKDG instructs BIOS to set it in a > certain way, but a BIOS can be buggy. In that case the ID can > confuse tools that use it, e.g. hwloc. > For example, on a system that I own real Local APIC IDs are > configured as 0, 1, 2, 3, but IDs reported via CPUID.1 are 0, 0x40, > 0x80, 0xc0. See: https://github.com/open-mpi/hwloc/issues/183 > > Reviewed by:kib > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D6060 > > Modified: > head/sys/amd64/amd64/initcpu.c > > Modified: head/sys/amd64/amd64/initcpu.c > == > --- head/sys/amd64/amd64/initcpu.cThu Apr 28 06:20:43 > 2016 (r298735) +++ head/sys/amd64/amd64/initcpu.cThu > Apr 28 08:29:57 2016 (r298736) @@ -80,6 +80,19 @@ > init_amd(void) wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); > break; > } > + > + /* > + * BIOS may fail to set InitApicIdCpuIdLo to 1 as it should > per BKDG. > + * So, do it here or otherwise some tools could be confused > by > + * Initial Local APIC ID reported with CPUID Function 1 in > EBX. > + */ > + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { > + if ((cpu_feature2 & CPUID2_HV) == 0) { > + msr = rdmsr(MSR_NB_CFG1); > + msr |= (uint64_t)1 << 54; > + wrmsr(MSR_NB_CFG1, msr); > + } > + } > } > > /* > ___ ... --- initcpu.o --- /usr/src/sys/amd64/amd64/initcpu.c:91:4: error: use of undeclared identifier 'msr' msr = rdmsr(MSR_NB_CFG1); ^ /usr/src/sys/amd64/amd64/initcpu.c:92:4: error: use of undeclared identifier 'msr' msr |= (uint64_t)1 << 54; ^ /usr/src/sys/amd64/amd64/initcpu.c:93:23: error: use of undeclared identifier 'msr' wrmsr(MSR_NB_CFG1, msr); ^ 3 errors generated. *** [initcpu.o] Error code 1 make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 1 error make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 *** [buildkernel] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildkernel] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r298736 - head/sys/amd64/amd64
Author: avg Date: Thu Apr 28 08:29:57 2016 New Revision: 298736 URL: https://svnweb.freebsd.org/changeset/base/298736 Log: ensure that initial local apic id is sane on AMD 10h systems Summary: The Initial Local APIC ID is returned by CPUID function 1 (in EBX). On AMD Family 10h systems the way that ID is built is controlled by an MSR bit (InitApicIdCpuIdLo). BKDG instructs BIOS to set it in a certain way, but a BIOS can be buggy. In that case the ID can confuse tools that use it, e.g. hwloc. For example, on a system that I own real Local APIC IDs are configured as 0, 1, 2, 3, but IDs reported via CPUID.1 are 0, 0x40, 0x80, 0xc0. See: https://github.com/open-mpi/hwloc/issues/183 Reviewed by: kib MFC after:2 weeks Differential Revision: https://reviews.freebsd.org/D6060 Modified: head/sys/amd64/amd64/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c == --- head/sys/amd64/amd64/initcpu.c Thu Apr 28 06:20:43 2016 (r298735) +++ head/sys/amd64/amd64/initcpu.c Thu Apr 28 08:29:57 2016 (r298736) @@ -80,6 +80,19 @@ init_amd(void) wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } + + /* +* BIOS may fail to set InitApicIdCpuIdLo to 1 as it should per BKDG. +* So, do it here or otherwise some tools could be confused by +* Initial Local APIC ID reported with CPUID Function 1 in EBX. +*/ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(MSR_NB_CFG1); + msr |= (uint64_t)1 << 54; + wrmsr(MSR_NB_CFG1, msr); + } + } } /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"