From f45d974ee9cec2e5ea2efd33dacade8449134781 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 7 Feb 2017 02:21:34 +0000 Subject: [PATCH 1/6] [ath] prepare for station side quiet time support. * Track the current quiet time configuration in the ath_vap struct. * Add an accessor method for calling the quiet time HAL method. --- sys/dev/ath/if_athvar.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index ce2abc1f240..2a183ad0ed8 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -490,6 +490,7 @@ struct ath_vap { int (*av_set_tim)(struct ieee80211_node *, int); void (*av_recv_pspoll)(struct ieee80211_node *, struct mbuf *); + struct ieee80211_quiet_ie quiet_ie; }; #define ATH_VAP(vap) ((struct ath_vap *)(vap)) @@ -1484,6 +1485,8 @@ void ath_intr(void *); ((*(_ah)->ah_get11nExtBusy)((_ah))) #define ath_hal_setchainmasks(_ah, _txchainmask, _rxchainmask) \ ((*(_ah)->ah_setChainMasks)((_ah), (_txchainmask), (_rxchainmask))) +#define ath_hal_set_quiet(_ah, _p, _d, _o, _f) \ + ((*(_ah)->ah_setQuiet)((_ah), (_p), (_d), (_o), (_f))) #define ath_hal_spectral_supported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_SPECTRAL_SCAN, 0, NULL) == HAL_OK) From d5f154d3cfe6e4bb04cc3f0e61edced19b814553 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 7 Feb 2017 02:32:49 +0000 Subject: [PATCH 2/6] hcreate(3): fix the ERRORS section and bump .Dd - Add missing comma between functions that trigger ENOMEM error. - Fix the description for ESRCH. The action that triggers this error is FIND, not SEARCH (SEARCH does not exist). MFC after: 1 week Sponsored by: Dell EMC Isilon --- lib/libc/stdlib/hcreate.3 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdlib/hcreate.3 b/lib/libc/stdlib/hcreate.3 index 57091570dcb..260aa91b6c7 100644 --- a/lib/libc/stdlib/hcreate.3 +++ b/lib/libc/stdlib/hcreate.3 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 26, 2015 +.Dd February 6, 2017 .Dt HCREATE 3 .Os .Sh NAME @@ -265,9 +265,9 @@ main(void) .Ed .Sh ERRORS The -.Fn hcreate +.Fn hcreate , .Fn hcreate_r , -.Fn hsearch +.Fn hsearch , and .Fn hsearch_r functions will fail if: @@ -281,7 +281,7 @@ The and .Fn hsearch_r functions will also fail if the action is -.Dv SEARCH +.Dv FIND and the element is not found: .Bl -tag -width Er .It Bq Er ESRCH From 0653d1fb684ff1db074a56574aa7df3e99f07c6f Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 7 Feb 2017 03:46:48 +0000 Subject: [PATCH 3/6] Fix :hexadecimal_floating_point on i386 Don't exclude i386 from LDBL_MANT_DIG == 64; it works properly in that case. While here, replace strcmp + atf_tc_fail with ATF_CHECK_MSG for 2 reasons: - Gather as many results as possible instead of failing early and not testing the rest of the cases. - Simplify logic when checking test inputs vs outputs and printing test result. Tested on: amd64, i386 MFC after: 1 week Sponsored by: Dell EMC Isilon --- lib/libc/tests/stdio/printfloat_test.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/libc/tests/stdio/printfloat_test.c b/lib/libc/tests/stdio/printfloat_test.c index 974374fae5c..97629fb0d2b 100644 --- a/lib/libc/tests/stdio/printfloat_test.c +++ b/lib/libc/tests/stdio/printfloat_test.c @@ -70,22 +70,19 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...) va_copy(ap2, ap); smash_stack(); vsnprintf(s, sizeof(s), fmt, ap); - if (strcmp(result, s) != 0) { - atf_tc_fail( - "printf(\"%s\", %s) ==> [%s], expected [%s]", - fmt, argstr, s, result); - } + ATF_CHECK_MSG(strcmp(result, s) == 0, + "printf(\"%s\", %s) ==> [%s], expected [%s]", + fmt, argstr, s, result); smash_stack(); mbstowcs(ws, s, BUF - 1); mbstowcs(wfmt, fmt, BUF - 1); mbstowcs(wresult, result, BUF - 1); vswprintf(ws, sizeof(ws) / sizeof(ws[0]), wfmt, ap2); - if (wcscmp(wresult, ws) != 0) { - atf_tc_fail( - "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]", - wfmt, argstr, ws, wresult); - } + ATF_CHECK_MSG(wcscmp(wresult, ws) == 0, + "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]", + wfmt, argstr, ws, wresult); + va_end(ap); va_end(ap2); } @@ -318,7 +315,7 @@ ATF_TC_BODY(hexadecimal_floating_point, tc) testfmt("0x1p-1074", "%a", 0x1p-1074); testfmt("0x1.2345p-1024", "%a", 0x1.2345p-1024); -#if (LDBL_MANT_DIG == 64) && !defined(__i386__) +#if (LDBL_MANT_DIG == 64) testfmt("0x1.921fb54442d18468p+1", "%La", 0x3.243f6a8885a308dp0L); testfmt("0x1p-16445", "%La", 0x1p-16445L); testfmt("0x1.30ecap-16381", "%La", 0x9.8765p-16384L); From 87e886953f538edaf48c20214f619c3796617dee Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 7 Feb 2017 04:15:41 +0000 Subject: [PATCH 4/6] Expect :floatunditf to fail on FreeBSD/i386 The precision error on FreeBSD/i386 doesn't match the expected output in long double form. MFC after: 1 week Sponsored by: Dell EMC Isilon --- contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c b/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c index ef372f76762..c3417bb538b 100644 --- a/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c +++ b/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c @@ -119,6 +119,11 @@ ATF_TC_BODY(floatunditf, tc) #else size_t i; +#if defined(__FreeBSD__) && defined(__i386__) + atf_tc_expect_fail("the floating point error on FreeBSD/i386 doesn't " + "match the expected floating point error on NetBSD"); +#endif + for (i = 0; i < __arraycount(testcases); ++i) ATF_CHECK_MSG( testcases[i].ld == (long double)testcases[i].u64, From 1eca9a9a4913c6842401562891f28fe05fc8b4ee Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 7 Feb 2017 04:25:21 +0000 Subject: [PATCH 5/6] Wrap strcmp/wcscmp calls with ATF_CHECK_MSG and drop atf_tc_fail use The reasoning here was the same as what was done in r313376: - Gather as many results as possible instead of failing early and not testing the rest of the cases. - Simplify logic when checking test inputs vs outputs and printing test result. MFC after: 1 week Sponsored by: Dell EMC Isilon --- lib/libc/tests/stdio/printbasic_test.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/libc/tests/stdio/printbasic_test.c b/lib/libc/tests/stdio/printbasic_test.c index 7f7c6cbbd65..e1220a35f83 100644 --- a/lib/libc/tests/stdio/printbasic_test.c +++ b/lib/libc/tests/stdio/printbasic_test.c @@ -78,22 +78,19 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...) va_copy(ap2, ap); smash_stack(); vsnprintf(s, sizeof(s), fmt, ap); - if (strcmp(result, s) != 0) { - atf_tc_fail( - "printf(\"%s\", %s) ==> [%s], expected [%s]", - fmt, argstr, s, result); - } + ATF_CHECK_MSG(strcmp(result, s) == 0, + "printf(\"%s\", %s) ==> [%s], expected [%s]", + fmt, argstr, s, result); smash_stack(); mbstowcs(ws, s, BUF - 1); mbstowcs(wfmt, fmt, BUF - 1); mbstowcs(wresult, result, BUF - 1); vswprintf(ws, sizeof(ws) / sizeof(ws[0]), wfmt, ap2); - if (wcscmp(wresult, ws) != 0) { - atf_tc_fail( - "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]", - wfmt, argstr, ws, wresult); - } + ATF_CHECK_MSG(wcscmp(wresult, ws) == 0, + "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]", + wfmt, argstr, ws, wresult); + va_end(ap); va_end(ap2); } From 9a41ce4a69a107a61e23d1fc3e93d9ac6fe576fe Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 7 Feb 2017 05:39:00 +0000 Subject: [PATCH 6/6] Expect :int_within_limits to fail when ptrdiff_t/*intmax_t differ in base type The %t{d,u} (ptrdiff_t) tests fail for the following reasons: - ptrdiff_t is by definition int32_t on !LP64 architectures and int64_t on LP64 architectures. - intmax_t is by definition fixed to int64_t on all architectures. - Some of the code in lib/libc/stdio/... is promoting ptrdiff_t to *intmax_t when parsing/representing the value. PR: 191674 MFC after: 1 week Sponsored by: Dell EMC Isilon --- lib/libc/tests/stdio/printbasic_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libc/tests/stdio/printbasic_test.c b/lib/libc/tests/stdio/printbasic_test.c index e1220a35f83..322e7477da2 100644 --- a/lib/libc/tests/stdio/printbasic_test.c +++ b/lib/libc/tests/stdio/printbasic_test.c @@ -111,6 +111,11 @@ ATF_TC_BODY(int_within_limits, tc) testfmt("-1", "%jd", (intmax_t)-1); testfmt(S_UINT64MAX, "%ju", UINT64_MAX); + if (sizeof(ptrdiff_t) != sizeof(uintmax_t)) + atf_tc_expect_fail("the %%t qualifier is broken on 32-bit " + "platforms where there's a mismatch between ptrdiff_t and " + "uintmax_t's type width; bug # 191674"); + testfmt("-1", "%td", (ptrdiff_t)-1); testfmt(S_SIZEMAX, "%tu", (size_t)-1);