summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-06 00:42:11 +0000
committerngie <ngie@FreeBSD.org>2015-12-06 00:42:11 +0000
commit51e48e07fddf9730600dec32c469c760f731bed5 (patch)
tree6b2e4533ad140ab45755c79cef2a60a2308894f2
parent13fcf1f8c2ed94cbabd6a4bee12f8ffb806252c5 (diff)
parent89ed7c325f5da55542cc3e261954ed9be69622d1 (diff)
downloadFreeBSD-src-51e48e07fddf9730600dec32c469c760f731bed5.zip
FreeBSD-src-51e48e07fddf9730600dec32c469c760f731bed5.tar.gz
MFhead@r291879
-rw-r--r--Makefile14
-rw-r--r--Makefile.inc1172
-rw-r--r--ObsoleteFiles.inc2
-rw-r--r--UPDATING13
-rw-r--r--bin/df/df.19
-rw-r--r--bin/ls/ls.19
-rw-r--r--bin/pkill/Makefile.depend1
-rw-r--r--bin/ps/Makefile.depend1
-rw-r--r--bin/ps/ps.111
-rw-r--r--bin/sh/tests/parameters/Makefile1
-rw-r--r--cddl/contrib/opensolaris/cmd/plockstat/plockstat.c4
-rw-r--r--cddl/lib/drti/Makefile10
-rw-r--r--cddl/lib/libctf/Makefile4
-rw-r--r--cddl/lib/libzfs/Makefile8
-rw-r--r--cddl/lib/libzfs/Makefile.depend1
-rw-r--r--cddl/lib/libzfs_core/Makefile3
-rw-r--r--cddl/lib/libzpool/Makefile4
-rw-r--r--cddl/sbin/zfs/Makefile4
-rw-r--r--cddl/sbin/zfs/Makefile.depend1
-rw-r--r--cddl/sbin/zpool/Makefile4
-rw-r--r--cddl/sbin/zpool/Makefile.depend1
-rw-r--r--cddl/usr.bin/ctfconvert/Makefile.depend2
-rw-r--r--cddl/usr.bin/ctfdump/Makefile.depend2
-rw-r--r--cddl/usr.bin/ctfmerge/Makefile.depend3
-rw-r--r--cddl/usr.bin/zinject/Makefile4
-rw-r--r--cddl/usr.bin/zstreamdump/Makefile4
-rw-r--r--cddl/usr.bin/ztest/Makefile5
-rw-r--r--cddl/usr.sbin/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/Makefile.depend3
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/proc/Makefile3
-rwxr-xr-xcddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh3
-rw-r--r--cddl/usr.sbin/plockstat/Makefile.depend27
-rw-r--r--cddl/usr.sbin/zdb/Makefile4
-rw-r--r--cddl/usr.sbin/zhack/Makefile4
-rw-r--r--contrib/elftoolchain/readelf/readelf.c29
-rw-r--r--contrib/llvm/patches/patch-10-clang-cc1as-dwarf2.diff21
-rw-r--r--contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp2
-rw-r--r--contrib/netbsd-tests/lib/libcrypt/t_crypt.c6
-rw-r--r--contrib/ofed/usr.bin/osmtest/Makefile3
-rw-r--r--contrib/wpa/src/drivers/driver_bsd.c14
-rw-r--r--crypto/openssh/pathnames.h5
-rw-r--r--crypto/openssl/CHANGES242
-rw-r--r--crypto/openssl/CONTRIBUTING38
-rwxr-xr-xcrypto/openssl/Configure11
-rw-r--r--crypto/openssl/FAQ1055
-rw-r--r--crypto/openssl/Makefile37
-rw-r--r--crypto/openssl/Makefile.org35
-rw-r--r--crypto/openssl/NEWS10
-rw-r--r--crypto/openssl/README178
-rw-r--r--crypto/openssl/apps/Makefile2
-rw-r--r--crypto/openssl/apps/app_rand.c3
-rw-r--r--crypto/openssl/apps/apps.c9
-rw-r--r--crypto/openssl/apps/asn1pars.c4
-rw-r--r--crypto/openssl/apps/ca.c14
-rw-r--r--crypto/openssl/apps/ecparam.c7
-rw-r--r--crypto/openssl/apps/engine.c5
-rw-r--r--crypto/openssl/apps/ocsp.c4
-rw-r--r--crypto/openssl/apps/pkcs12.c14
-rw-r--r--crypto/openssl/apps/s_cb.c5
-rw-r--r--crypto/openssl/apps/s_client.c11
-rw-r--r--crypto/openssl/apps/s_server.c51
-rw-r--r--crypto/openssl/appveyor.yml60
-rwxr-xr-xcrypto/openssl/crypto/aes/asm/aes-586.pl6
-rwxr-xr-xcrypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl2
-rwxr-xr-xcrypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl2
-rwxr-xr-xcrypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl9
-rwxr-xr-xcrypto/openssl/crypto/aes/asm/aesni-x86.pl2
-rwxr-xr-xcrypto/openssl/crypto/aes/asm/vpaes-ppc.pl198
-rw-r--r--crypto/openssl/crypto/asn1/asn1_par.c10
-rw-r--r--crypto/openssl/crypto/asn1/d2i_pr.c15
-rw-r--r--crypto/openssl/crypto/asn1/tasn_dec.c11
-rw-r--r--crypto/openssl/crypto/asn1/x_bignum.c5
-rw-r--r--crypto/openssl/crypto/asn1/x_pubkey.c5
-rw-r--r--crypto/openssl/crypto/asn1/x_x509.c9
-rw-r--r--crypto/openssl/crypto/asn1/x_x509a.c7
-rw-r--r--crypto/openssl/crypto/bio/b_dump.c1
-rw-r--r--crypto/openssl/crypto/bio/bss_file.c13
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/armv4-gf2m.pl10
-rw-r--r--crypto/openssl/crypto/bn/asm/ia64.S4
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/ppc64-mont.pl174
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/rsaz-x86_64.pl2
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/s390x-gf2m.pl6
-rw-r--r--crypto/openssl/crypto/bn/asm/s390x.S109
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/x86-gf2m.pl16
-rw-r--r--crypto/openssl/crypto/bn/asm/x86_64-gcc.c2
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/x86_64-gf2m.pl16
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/x86_64-mont.pl5
-rwxr-xr-xcrypto/openssl/crypto/bn/asm/x86_64-mont5.pl27
-rw-r--r--crypto/openssl/crypto/bn/bn_exp.c7
-rw-r--r--crypto/openssl/crypto/bn/bn_gcd.c2
-rw-r--r--crypto/openssl/crypto/bn/bn_gf2m.c11
-rw-r--r--crypto/openssl/crypto/bn/bn_mont.c9
-rw-r--r--crypto/openssl/crypto/bn/bn_recp.c4
-rw-r--r--crypto/openssl/crypto/bn/bn_x931p.c7
-rw-r--r--crypto/openssl/crypto/bn/bntest.c74
-rw-r--r--crypto/openssl/crypto/bn/rsaz_exp.h68
-rw-r--r--crypto/openssl/crypto/buffer/buf_str.c21
-rw-r--r--crypto/openssl/crypto/buffer/buffer.h6
-rw-r--r--crypto/openssl/crypto/cms/cms_enc.c2
-rw-r--r--crypto/openssl/crypto/cms/cms_pwri.c3
-rw-r--r--crypto/openssl/crypto/cms/cms_sd.c2
-rw-r--r--crypto/openssl/crypto/cms/cms_smime.c2
-rw-r--r--crypto/openssl/crypto/comp/c_zlib.c3
-rw-r--r--crypto/openssl/crypto/conf/conf_def.c3
-rw-r--r--crypto/openssl/crypto/conf/conf_sap.c1
-rw-r--r--crypto/openssl/crypto/cryptlib.c26
-rw-r--r--crypto/openssl/crypto/dh/dh.h2
-rw-r--r--crypto/openssl/crypto/dh/dhtest.c4
-rw-r--r--crypto/openssl/crypto/dsa/dsa_ameth.c1
-rw-r--r--crypto/openssl/crypto/dsa/dsa_gen.c19
-rw-r--r--crypto/openssl/crypto/ec/Makefile2
-rwxr-xr-xcrypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl2
-rw-r--r--crypto/openssl/crypto/ec/ec.h2
-rw-r--r--crypto/openssl/crypto/ec/ec_asn1.c8
-rw-r--r--crypto/openssl/crypto/ec/ec_key.c12
-rw-r--r--crypto/openssl/crypto/ecdsa/ecdsa.h2
-rw-r--r--crypto/openssl/crypto/ecdsa/ecs_lib.c2
-rw-r--r--crypto/openssl/crypto/engine/eng_cryptodev.c7
-rw-r--r--crypto/openssl/crypto/engine/eng_list.c1
-rw-r--r--crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c13
-rw-r--r--crypto/openssl/crypto/evp/e_des3.c2
-rw-r--r--crypto/openssl/crypto/evp/encode.c198
-rw-r--r--crypto/openssl/crypto/evp/evp_key.c6
-rw-r--r--crypto/openssl/crypto/evp/evp_lib.c36
-rw-r--r--crypto/openssl/crypto/evp/evp_pbe.c16
-rw-r--r--crypto/openssl/crypto/evp/p_lib.c2
-rw-r--r--crypto/openssl/crypto/evp/pmeth_gn.c9
-rw-r--r--crypto/openssl/crypto/hmac/hm_ameth.c9
-rw-r--r--crypto/openssl/crypto/jpake/jpake.c4
-rw-r--r--crypto/openssl/crypto/mem_clr.c4
-rwxr-xr-xcrypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl2
-rwxr-xr-xcrypto/openssl/crypto/modes/asm/ghash-armv4.pl13
-rwxr-xr-xcrypto/openssl/crypto/modes/asm/ghash-sparcv9.pl18
-rwxr-xr-xcrypto/openssl/crypto/modes/asm/ghash-x86.pl2
-rwxr-xr-xcrypto/openssl/crypto/modes/asm/ghash-x86_64.pl10
-rwxr-xr-xcrypto/openssl/crypto/modes/asm/ghashp8-ppc.pl12
-rwxr-xr-xcrypto/openssl/crypto/modes/asm/ghashv8-armx.pl22
-rw-r--r--crypto/openssl/crypto/modes/wrap128.c4
-rw-r--r--crypto/openssl/crypto/ocsp/ocsp_lib.c6
-rw-r--r--crypto/openssl/crypto/ocsp/ocsp_prn.c3
-rw-r--r--crypto/openssl/crypto/opensslconf.h2
-rw-r--r--crypto/openssl/crypto/opensslconf.h.in2
-rw-r--r--crypto/openssl/crypto/opensslv.h6
-rw-r--r--crypto/openssl/crypto/pem/pem_info.c6
-rw-r--r--crypto/openssl/crypto/pem/pvkfmt.c10
-rwxr-xr-xcrypto/openssl/crypto/perlasm/ppc-xlate.pl20
-rw-r--r--crypto/openssl/crypto/pkcs12/p12_add.c27
-rw-r--r--crypto/openssl/crypto/pkcs12/p12_crpt.c3
-rw-r--r--crypto/openssl/crypto/pkcs12/p12_mutl.c4
-rw-r--r--crypto/openssl/crypto/pkcs7/pk7_doit.c3
-rw-r--r--crypto/openssl/crypto/pkcs7/pk7_smime.c25
-rw-r--r--crypto/openssl/crypto/ppccap.c2
-rwxr-xr-xcrypto/openssl/crypto/rc4/asm/rc4-x86_64.pl2
-rw-r--r--crypto/openssl/crypto/rsa/rsa_ameth.c2
-rw-r--r--crypto/openssl/crypto/rsa/rsa_gen.c4
-rw-r--r--crypto/openssl/crypto/rsa/rsa_sign.c11
-rw-r--r--crypto/openssl/crypto/rsa/rsa_test.c32
-rw-r--r--crypto/openssl/crypto/sha/asm/sha1-586.pl4
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl2
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha1-x86_64.pl2
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha256-586.pl2
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl2
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha512-586.pl2
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha512-parisc.pl2
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha512-x86_64.pl2
-rw-r--r--crypto/openssl/crypto/sparccpuid.S2
-rw-r--r--crypto/openssl/crypto/sparcv9cap.c47
-rw-r--r--crypto/openssl/crypto/srp/srp_vfy.c34
-rw-r--r--crypto/openssl/crypto/ts/ts_rsp_verify.c2
-rwxr-xr-xcrypto/openssl/crypto/whrlpool/asm/wp-mmx.pl2
-rw-r--r--crypto/openssl/crypto/x509/x509_lu.c2
-rw-r--r--crypto/openssl/crypto/x509/x509_vfy.c11
-rw-r--r--crypto/openssl/crypto/x509/x509_vpm.c15
-rw-r--r--crypto/openssl/crypto/x509v3/v3_cpols.c4
-rw-r--r--crypto/openssl/crypto/x509v3/v3_ncons.c2
-rw-r--r--crypto/openssl/crypto/x509v3/v3_pci.c2
-rw-r--r--crypto/openssl/crypto/x509v3/v3_pcia.c2
-rw-r--r--crypto/openssl/crypto/x509v3/v3_purp.c19
-rw-r--r--crypto/openssl/crypto/x509v3/v3_scts.c4
-rw-r--r--crypto/openssl/crypto/x509v3/v3_utl.c10
-rw-r--r--crypto/openssl/doc/HOWTO/keys.txt5
-rw-r--r--crypto/openssl/doc/README27
-rw-r--r--crypto/openssl/doc/apps/dgst.pod5
-rw-r--r--crypto/openssl/doc/apps/genrsa.pod6
-rw-r--r--crypto/openssl/doc/apps/pkcs12.pod2
-rw-r--r--crypto/openssl/doc/apps/req.pod13
-rw-r--r--crypto/openssl/doc/apps/x509.pod3
-rw-r--r--crypto/openssl/doc/crypto/BIO_read.pod6
-rw-r--r--crypto/openssl/doc/crypto/BN_rand.pod4
-rw-r--r--crypto/openssl/doc/crypto/DSA_generate_parameters.pod2
-rw-r--r--crypto/openssl/doc/crypto/EC_KEY_new.pod4
-rw-r--r--crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod9
-rw-r--r--crypto/openssl/doc/crypto/EVP_EncryptInit.pod2
-rw-r--r--crypto/openssl/doc/crypto/EVP_SealInit.pod2
-rw-r--r--crypto/openssl/doc/crypto/EVP_SignInit.pod3
-rw-r--r--crypto/openssl/doc/crypto/X509_check_host.pod2
-rw-r--r--crypto/openssl/doc/crypto/buffer.pod49
-rw-r--r--crypto/openssl/doc/crypto/d2i_X509_NAME.pod2
-rw-r--r--crypto/openssl/doc/crypto/engine.pod10
-rw-r--r--crypto/openssl/doc/dir-locals.example.el15
-rw-r--r--crypto/openssl/doc/openssl-c-indent.el62
-rw-r--r--crypto/openssl/doc/openssl_button.gifbin2063 -> 0 bytes
-rw-r--r--crypto/openssl/doc/openssl_button.html7
-rw-r--r--crypto/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod35
-rw-r--r--crypto/openssl/doc/ssl/SSL_CTX_get0_param.pod2
-rw-r--r--crypto/openssl/doc/ssl/SSL_check_chain.pod85
-rw-r--r--crypto/openssl/e_os.h4
-rw-r--r--crypto/openssl/engines/e_chil.c4
-rw-r--r--crypto/openssl/ssl/Makefile2
-rw-r--r--crypto/openssl/ssl/bio_ssl.c4
-rw-r--r--crypto/openssl/ssl/clienthellotest.c219
-rw-r--r--crypto/openssl/ssl/d1_both.c7
-rw-r--r--crypto/openssl/ssl/d1_clnt.c37
-rw-r--r--crypto/openssl/ssl/d1_meth.c14
-rw-r--r--crypto/openssl/ssl/d1_srvr.c45
-rw-r--r--crypto/openssl/ssl/s23_clnt.c21
-rw-r--r--crypto/openssl/ssl/s3_both.c4
-rw-r--r--crypto/openssl/ssl/s3_cbc.c47
-rw-r--r--crypto/openssl/ssl/s3_clnt.c124
-rw-r--r--crypto/openssl/ssl/s3_enc.c110
-rw-r--r--crypto/openssl/ssl/s3_lib.c2
-rw-r--r--crypto/openssl/ssl/s3_pkt.c2
-rw-r--r--crypto/openssl/ssl/s3_srvr.c78
-rw-r--r--crypto/openssl/ssl/ssl.h4
-rw-r--r--crypto/openssl/ssl/ssl_asn1.c5
-rw-r--r--crypto/openssl/ssl/ssl_cert.c2
-rw-r--r--crypto/openssl/ssl/ssl_ciph.c22
-rw-r--r--crypto/openssl/ssl/ssl_err.c5
-rw-r--r--crypto/openssl/ssl/ssl_lib.c11
-rw-r--r--crypto/openssl/ssl/ssl_locl.h20
-rw-r--r--crypto/openssl/ssl/ssl_rsa.c41
-rw-r--r--crypto/openssl/ssl/ssl_sess.c4
-rw-r--r--crypto/openssl/ssl/ssltest.c1
-rw-r--r--crypto/openssl/ssl/t1_enc.c48
-rw-r--r--crypto/openssl/ssl/t1_lib.c65
-rw-r--r--crypto/openssl/ssl/tls1.h17
-rwxr-xr-xcrypto/openssl/util/domd3
-rw-r--r--crypto/openssl/util/indent.pro16
-rwxr-xr-xcrypto/openssl/util/mk1mf.pl2
-rwxr-xr-xcrypto/openssl/util/mkrc.pl2
-rwxr-xr-xcrypto/openssl/util/mkstack.pl2
-rw-r--r--crypto/openssl/util/pl/VC-32.pl7
-rwxr-xr-xcrypto/openssl/util/pod2mantest58
-rw-r--r--crypto/openssl/util/selftest.pl1
-rwxr-xr-xcrypto/openssl/util/toutf8.sh17
-rw-r--r--etc/Makefile2
-rw-r--r--etc/Makefile.depend11
-rw-r--r--etc/defaults/rc.conf1
-rw-r--r--etc/devd/usb.conf240
-rw-r--r--etc/mtree/BSD.include.dist2
-rw-r--r--etc/mtree/BSD.usr.dist2
-rw-r--r--etc/newsyslog.conf.d/Makefile.depend11
-rwxr-xr-xetc/rc.d/local_unbound4
-rwxr-xr-xetc/rc.d/nfsd6
-rwxr-xr-xetc/rc.d/nfsuserd9
-rwxr-xr-xetc/rc.d/rctl4
-rw-r--r--etc/rc.subr16
-rw-r--r--gnu/lib/libssp/Makefile.depend2
-rw-r--r--gnu/usr.bin/diff/Makefile.depend6
-rw-r--r--gnu/usr.bin/dtc/Makefile6
-rw-r--r--gnu/usr.bin/dtc/Makefile.depend7
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile10
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile.depend.amd641
-rw-r--r--gnu/usr.bin/gdb/kgdb/main.c21
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt.c19
-rw-r--r--gnu/usr.bin/gperf/Makefile.depend5
-rw-r--r--gnu/usr.bin/grep/Makefile.depend2
-rw-r--r--gnu/usr.bin/groff/src/devices/grodvi/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grohtml/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grolbp/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grolj4/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grops/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/devices/grotty/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/grn/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/pic/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/refer/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/preproc/tbl/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/roff/groff/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/roff/troff/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/hpftodit/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/indxbib/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/lkbib/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/lookbib/Makefile5
-rw-r--r--gnu/usr.bin/groff/src/utils/tfmtodit/Makefile5
-rw-r--r--include/Makefile38
-rw-r--r--lib/Makefile6
-rw-r--r--lib/clang/Makefile4
-rw-r--r--lib/clang/clang.build.mk20
-rw-r--r--lib/clang/include/Makefile3
-rw-r--r--lib/clang/include/Makefile.depend1
-rw-r--r--lib/clang/libclanganalysis/Makefile.depend6
-rw-r--r--lib/clang/libclangast/Makefile.depend2
-rw-r--r--lib/clang/libclangbasic/Makefile.depend1
-rw-r--r--lib/clang/libclangcodegen/Makefile.depend34
-rw-r--r--lib/clang/libclangdriver/Makefile.depend4
-rw-r--r--lib/clang/libclanglex/Makefile.depend1
-rw-r--r--lib/clang/libclangparse/Makefile.depend4
-rw-r--r--lib/clang/libclangstaticanalyzercheckers/Makefile.depend10
-rw-r--r--lib/clang/libclangstaticanalyzercore/Makefile.depend10
-rw-r--r--lib/clang/liblldb/Makefile.depend13
-rw-r--r--lib/clang/liblldbAPI/Makefile.depend194
-rw-r--r--lib/clang/liblldbBreakpoint/Makefile.depend46
-rw-r--r--lib/clang/liblldbCommands/Makefile.depend282
-rw-r--r--lib/clang/liblldbCore/Makefile.depend182
-rw-r--r--lib/clang/liblldbDataFormatters/Makefile.depend42
-rw-r--r--lib/clang/liblldbExpression/Makefile.depend20
-rw-r--r--lib/clang/liblldbHostCommon/Makefile.depend28
-rw-r--r--lib/clang/liblldbHostFreeBSD/Makefile.depend8
-rw-r--r--lib/clang/liblldbInitialization/Makefile.depend15
-rw-r--r--lib/clang/liblldbInterpreter/Makefile.depend126
-rw-r--r--lib/clang/liblldbPluginABISysV_arm/Makefile.depend24
-rw-r--r--lib/clang/liblldbPluginABISysV_arm64/Makefile.depend24
-rw-r--r--lib/clang/liblldbPluginABISysV_i386/Makefile.depend24
-rw-r--r--lib/clang/liblldbPluginABISysV_mips/Makefile.depend24
-rw-r--r--lib/clang/liblldbPluginABISysV_mips64/Makefile.depend24
-rw-r--r--lib/clang/liblldbPluginDisassemblerLLVM/Makefile.depend8
-rw-r--r--lib/clang/liblldbPluginDynamicLoaderPosixDYLD/Makefile.depend16
-rw-r--r--lib/clang/liblldbPluginDynamicLoaderStatic/Makefile.depend8
-rw-r--r--lib/clang/liblldbPluginInstructionMIPS/Makefile.depend16
-rw-r--r--lib/clang/liblldbPluginInstructionMIPS64/Makefile.depend16
-rw-r--r--lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile.depend10
-rw-r--r--lib/clang/liblldbPluginJITLoaderGDB/Makefile.depend6
-rw-r--r--lib/clang/liblldbPluginMemoryHistoryASan/Makefile.depend6
-rw-r--r--lib/clang/liblldbPluginObjectContainerBSDArchive/Makefile.depend8
-rw-r--r--lib/clang/liblldbPluginObjectFileELF/Makefile.depend8
-rw-r--r--lib/clang/liblldbPluginObjectFileJIT/Makefile.depend12
-rw-r--r--lib/clang/liblldbPluginPlatformFreeBSD/Makefile.depend12
-rw-r--r--lib/clang/liblldbPluginPlatformGDB/Makefile.depend12
-rw-r--r--lib/clang/liblldbPluginProcessElfCore/Makefile.depend10
-rw-r--r--lib/clang/liblldbPluginProcessFreeBSD/Makefile.depend10
-rw-r--r--lib/clang/liblldbPluginProcessGDBRemote/Makefile.depend20
-rw-r--r--lib/clang/liblldbPluginProcessPOSIX/Makefile.depend32
-rw-r--r--lib/clang/liblldbPluginProcessUtility/Makefile.depend42
-rw-r--r--lib/clang/liblldbPluginSymbolFileSymtab/Makefile.depend4
-rw-r--r--lib/clang/liblldbPluginSymbolVendorELF/Makefile.depend6
-rw-r--r--lib/clang/liblldbPluginUnwindAssemblyInstEmulation/Makefile.depend2
-rw-r--r--lib/clang/liblldbPluginUnwindAssemblyX86/Makefile.depend2
-rw-r--r--lib/clang/liblldbSymbol/Makefile.depend88
-rw-r--r--lib/clang/liblldbTarget/Makefile.depend134
-rw-r--r--lib/clang/libllvmaarch64codegen/Makefile.depend2
-rw-r--r--lib/clang/libllvmaarch64disassembler/Makefile.depend6
-rw-r--r--lib/clang/libllvmanalysis/Makefile.depend10
-rw-r--r--lib/clang/libllvmarmcodegen/Makefile.depend20
-rw-r--r--lib/clang/libllvmcodegen/Makefile.depend10
-rw-r--r--lib/clang/libllvmcore/Makefile.depend2
-rw-r--r--lib/clang/libllvminstrumentation/Makefile.depend2
-rw-r--r--lib/clang/libllvmipa/Makefile.depend2
-rw-r--r--lib/clang/libllvmipo/Makefile.depend6
-rw-r--r--lib/clang/libllvmmipscodegen/Makefile.depend42
-rw-r--r--lib/clang/libllvmobjcarcopts/Makefile.depend4
-rw-r--r--lib/clang/libllvmpowerpccodegen/Makefile.depend60
-rw-r--r--lib/clang/libllvmscalaropts/Makefile.depend18
-rw-r--r--lib/clang/libllvmtarget/Makefile.depend5
-rw-r--r--lib/clang/libllvmtransformutils/Makefile.depend4
-rw-r--r--lib/clang/libllvmx86codegen/Makefile.depend10
-rw-r--r--lib/clang/libllvmx86disassembler/Makefile.depend2
-rw-r--r--lib/csu/powerpc64/crti.S37
-rw-r--r--lib/lib80211/Makefile17
-rw-r--r--lib/lib80211/Makefile.depend19
-rw-r--r--lib/lib80211/lib80211.3118
-rw-r--r--lib/lib80211/lib80211_ioctl.c159
-rw-r--r--lib/lib80211/lib80211_ioctl.h71
-rw-r--r--lib/lib80211/lib80211_regdomain.c (renamed from sbin/ifconfig/regdomain.c)12
-rw-r--r--lib/lib80211/lib80211_regdomain.h (renamed from sbin/ifconfig/regdomain.h)6
-rw-r--r--lib/libarchive/Makefile4
-rw-r--r--lib/libarchive/tests/Makefile10
-rw-r--r--lib/libauditd/Makefile8
-rw-r--r--lib/libbsdstat/Makefile.depend (renamed from usr.bin/vgrind/RETEST/Makefile.depend)2
-rw-r--r--lib/libbsm/Makefile6
-rw-r--r--lib/libc++/Makefile16
-rw-r--r--lib/libc++/Makefile.depend1
-rw-r--r--lib/libc/regex/grot/Makefile3
-rw-r--r--lib/libc/regex/grot/debug.c2
-rw-r--r--lib/libc/regex/grot/main.c107
-rw-r--r--lib/libc/regex/grot/split.c31
-rw-r--r--lib/libc/tests/gen/Makefile18
-rw-r--r--lib/libc/tests/hash/Makefile6
-rw-r--r--lib/libc/tests/net/Makefile3
-rw-r--r--lib/libc/tests/regex/Makefile3
-rw-r--r--lib/libc/tests/rpc/Makefile3
-rw-r--r--lib/libc/tests/setjmp/Makefile3
-rw-r--r--lib/libc/tests/ssp/Makefile3
-rw-r--r--lib/libc/tests/stdio/Makefile7
-rw-r--r--lib/libc/tests/stdio/getdelim_test.c1
-rw-r--r--lib/libc/tests/stdlib/Makefile6
-rw-r--r--lib/libc/tests/string/Makefile7
-rw-r--r--lib/libc/tests/sys/Makefile6
-rw-r--r--lib/libc/tests/tls/Makefile11
-rw-r--r--lib/libc/tests/ttyio/Makefile3
-rw-r--r--lib/libcasper/Makefile.depend21
-rw-r--r--lib/libclang_rt/Makefile3
-rw-r--r--lib/libclang_rt/Makefile.inc3
-rw-r--r--lib/libclang_rt/asan-preinit/Makefile.depend11
-rw-r--r--lib/libclang_rt/asan/Makefile.depend16
-rw-r--r--lib/libclang_rt/asan_cxx/Makefile.depend12
-rw-r--r--lib/libclang_rt/include/Makefile19
-rw-r--r--lib/libclang_rt/include/Makefile.depend11
-rw-r--r--lib/libclang_rt/profile/Makefile.depend13
-rw-r--r--lib/libclang_rt/safestack/Makefile.depend15
-rw-r--r--lib/libclang_rt/ubsan_standalone/Makefile.depend16
-rw-r--r--lib/libclang_rt/ubsan_standalone_cxx/Makefile.depend11
-rw-r--r--lib/libcrypt/tests/Makefile14
-rw-r--r--lib/libdevctl/Makefile.depend18
-rw-r--r--lib/libelf/Makefile3
-rw-r--r--lib/libevent/Makefile.depend5
-rw-r--r--lib/libfetch/fetch.36
-rw-r--r--lib/libfetch/http.c6
-rw-r--r--lib/libkvm/Makefile44
-rw-r--r--lib/libkvm/Makefile.depend1
-rw-r--r--lib/libkvm/kvm.344
-rw-r--r--lib/libkvm/kvm.c389
-rw-r--r--lib/libkvm/kvm.h14
-rw-r--r--lib/libkvm/kvm_aarch64.h61
-rw-r--r--lib/libkvm/kvm_amd64.c290
-rw-r--r--lib/libkvm/kvm_amd64.h88
-rw-r--r--lib/libkvm/kvm_arm.c238
-rw-r--r--lib/libkvm/kvm_arm.h108
-rw-r--r--lib/libkvm/kvm_cptime.c6
-rw-r--r--lib/libkvm/kvm_file.c2
-rw-r--r--lib/libkvm/kvm_getloadavg.c6
-rw-r--r--lib/libkvm/kvm_getswapinfo.c12
-rw-r--r--lib/libkvm/kvm_i386.c362
-rw-r--r--lib/libkvm/kvm_i386.h79
-rw-r--r--lib/libkvm/kvm_minidump_aarch64.c208
-rw-r--r--lib/libkvm/kvm_minidump_amd64.c277
-rw-r--r--lib/libkvm/kvm_minidump_arm.c182
-rw-r--r--lib/libkvm/kvm_minidump_i386.c217
-rw-r--r--lib/libkvm/kvm_minidump_mips.c258
-rw-r--r--lib/libkvm/kvm_mips.c116
-rw-r--r--lib/libkvm/kvm_mips.h93
-rw-r--r--lib/libkvm/kvm_native.362
-rw-r--r--lib/libkvm/kvm_nlist.347
-rw-r--r--lib/libkvm/kvm_open.365
-rw-r--r--lib/libkvm/kvm_pcpu.c16
-rw-r--r--lib/libkvm/kvm_powerpc.c74
-rw-r--r--lib/libkvm/kvm_powerpc64.c77
-rw-r--r--lib/libkvm/kvm_private.h91
-rw-r--r--lib/libkvm/kvm_proc.c14
-rw-r--r--lib/libkvm/kvm_read.324
-rw-r--r--lib/libkvm/kvm_sparc.c236
-rw-r--r--lib/libkvm/kvm_sparc64.c141
-rw-r--r--lib/libkvm/kvm_sparc64.h118
-rw-r--r--lib/libkvm/kvm_vnet.c15
-rw-r--r--lib/libnandfs/Makefile.depend18
-rw-r--r--lib/libpjdlog/Makefile.depend20
-rw-r--r--lib/libpmc/libpmc.c118
-rw-r--r--lib/libproc/tests/Makefile3
-rw-r--r--lib/librt/Makefile3
-rw-r--r--lib/librt/Symbol.map (renamed from lib/librt/Version.map)0
-rw-r--r--lib/libthr/tests/Makefile9
-rw-r--r--lib/libthr/tests/dlopen/Makefile3
-rw-r--r--lib/libthr/tests/dlopen/dso/Makefile3
-rw-r--r--lib/libunbound/Makefile.depend1
-rw-r--r--lib/msun/Makefile9
-rw-r--r--libexec/bootpd/Makefile.depend2
-rw-r--r--libexec/casper/dns/Makefile.depend23
-rw-r--r--libexec/casper/grp/Makefile.depend23
-rw-r--r--libexec/casper/pwd/Makefile.depend23
-rw-r--r--libexec/casper/random/Makefile.depend23
-rw-r--r--libexec/casper/sysctl/Makefile.depend23
-rw-r--r--libexec/dma/dmagent/Makefile.depend1
-rw-r--r--libexec/hyperv/Makefile.depend11
-rw-r--r--libexec/rpc.rstatd/Makefile.depend1
-rw-r--r--libexec/rtld-elf/Makefile11
-rw-r--r--libexec/rtld-elf/powerpc64/reloc.c43
-rw-r--r--libexec/rtld-elf/powerpc64/rtld_start.S26
-rw-r--r--libexec/rtld-elf/rtld.c8
-rw-r--r--libexec/rtld-elf/rtld.h3
-rw-r--r--libexec/rtld-elf/tests/libpythagoras/Makefile3
-rw-r--r--rescue/rescue/Makefile4
-rw-r--r--sbin/casperd/Makefile.depend23
-rw-r--r--sbin/ddb/Makefile.depend1
-rw-r--r--sbin/dhclient/tests/Makefile3
-rw-r--r--sbin/dmesg/Makefile.depend1
-rw-r--r--sbin/ifconfig/Makefile4
-rw-r--r--sbin/ifconfig/Makefile.depend1
-rw-r--r--sbin/ifconfig/ifieee80211.c45
-rw-r--r--sbin/ipf/Makefile.inc2
-rw-r--r--sbin/ipf/ipf/Makefile.depend1
-rw-r--r--sbin/ipf/ipfs/Makefile.depend1
-rw-r--r--sbin/ipf/ipfstat/Makefile.depend1
-rw-r--r--sbin/ipf/ipftest/Makefile.depend1
-rw-r--r--sbin/ipf/ipmon/Makefile.depend1
-rw-r--r--sbin/ipf/ipnat/Makefile.depend1
-rw-r--r--sbin/ipf/ippool/Makefile.depend1
-rw-r--r--sbin/ipf/ipresend/Makefile.depend1
-rw-r--r--sbin/ipf/libipf/Makefile2
-rw-r--r--sbin/nandfs/Makefile.depend19
-rw-r--r--sbin/newfs_msdos/mkfs_msdos.c11
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c41
-rw-r--r--sbin/newfs_nandfs/Makefile.depend21
-rw-r--r--sbin/routed/Makefile.depend2
-rw-r--r--sbin/savecore/savecore.812
-rw-r--r--secure/lib/libcrypto/Makefile.inc4
-rw-r--r--secure/lib/libcrypto/Makefile.man6
-rw-r--r--secure/lib/libcrypto/amd64/x86_64-mont5.S9
-rw-r--r--secure/lib/libcrypto/engines/libcapi/Makefile.depend19
-rw-r--r--secure/lib/libcrypto/man/ASN1_OBJECT_new.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_length.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_new.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_STRING_print_ex.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_TIME_set.34
-rw-r--r--secure/lib/libcrypto/man/ASN1_generate_nconf.34
-rw-r--r--secure/lib/libcrypto/man/BIO_ctrl.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_base64.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_buffer.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_cipher.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_md.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_null.34
-rw-r--r--secure/lib/libcrypto/man/BIO_f_ssl.34
-rw-r--r--secure/lib/libcrypto/man/BIO_find_type.34
-rw-r--r--secure/lib/libcrypto/man/BIO_new.34
-rw-r--r--secure/lib/libcrypto/man/BIO_new_CMS.34
-rw-r--r--secure/lib/libcrypto/man/BIO_push.34
-rw-r--r--secure/lib/libcrypto/man/BIO_read.310
-rw-r--r--secure/lib/libcrypto/man/BIO_s_accept.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_bio.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_connect.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_fd.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_file.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_mem.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_null.34
-rw-r--r--secure/lib/libcrypto/man/BIO_s_socket.34
-rw-r--r--secure/lib/libcrypto/man/BIO_set_callback.34
-rw-r--r--secure/lib/libcrypto/man/BIO_should_retry.34
-rw-r--r--secure/lib/libcrypto/man/BN_BLINDING_new.34
-rw-r--r--secure/lib/libcrypto/man/BN_CTX_new.34
-rw-r--r--secure/lib/libcrypto/man/BN_CTX_start.34
-rw-r--r--secure/lib/libcrypto/man/BN_add.34
-rw-r--r--secure/lib/libcrypto/man/BN_add_word.34
-rw-r--r--secure/lib/libcrypto/man/BN_bn2bin.34
-rw-r--r--secure/lib/libcrypto/man/BN_cmp.34
-rw-r--r--secure/lib/libcrypto/man/BN_copy.34
-rw-r--r--secure/lib/libcrypto/man/BN_generate_prime.34
-rw-r--r--secure/lib/libcrypto/man/BN_mod_inverse.34
-rw-r--r--secure/lib/libcrypto/man/BN_mod_mul_montgomery.34
-rw-r--r--secure/lib/libcrypto/man/BN_mod_mul_reciprocal.34
-rw-r--r--secure/lib/libcrypto/man/BN_new.34
-rw-r--r--secure/lib/libcrypto/man/BN_num_bytes.34
-rw-r--r--secure/lib/libcrypto/man/BN_rand.38
-rw-r--r--secure/lib/libcrypto/man/BN_set_bit.34
-rw-r--r--secure/lib/libcrypto/man/BN_swap.34
-rw-r--r--secure/lib/libcrypto/man/BN_zero.34
-rw-r--r--secure/lib/libcrypto/man/CMS_add0_cert.34
-rw-r--r--secure/lib/libcrypto/man/CMS_add1_recipient_cert.34
-rw-r--r--secure/lib/libcrypto/man/CMS_add1_signer.34
-rw-r--r--secure/lib/libcrypto/man/CMS_compress.34
-rw-r--r--secure/lib/libcrypto/man/CMS_decrypt.34
-rw-r--r--secure/lib/libcrypto/man/CMS_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/CMS_final.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_RecipientInfos.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_SignerInfos.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get0_type.34
-rw-r--r--secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.34
-rw-r--r--secure/lib/libcrypto/man/CMS_sign.34
-rw-r--r--secure/lib/libcrypto/man/CMS_sign_receipt.34
-rw-r--r--secure/lib/libcrypto/man/CMS_uncompress.34
-rw-r--r--secure/lib/libcrypto/man/CMS_verify.34
-rw-r--r--secure/lib/libcrypto/man/CMS_verify_receipt.34
-rw-r--r--secure/lib/libcrypto/man/CONF_modules_free.34
-rw-r--r--secure/lib/libcrypto/man/CONF_modules_load_file.34
-rw-r--r--secure/lib/libcrypto/man/CRYPTO_set_ex_data.34
-rw-r--r--secure/lib/libcrypto/man/DH_generate_key.34
-rw-r--r--secure/lib/libcrypto/man/DH_generate_parameters.34
-rw-r--r--secure/lib/libcrypto/man/DH_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/DH_new.34
-rw-r--r--secure/lib/libcrypto/man/DH_set_method.34
-rw-r--r--secure/lib/libcrypto/man/DH_size.34
-rw-r--r--secure/lib/libcrypto/man/DSA_SIG_new.34
-rw-r--r--secure/lib/libcrypto/man/DSA_do_sign.34
-rw-r--r--secure/lib/libcrypto/man/DSA_dup_DH.34
-rw-r--r--secure/lib/libcrypto/man/DSA_generate_key.34
-rw-r--r--secure/lib/libcrypto/man/DSA_generate_parameters.36
-rw-r--r--secure/lib/libcrypto/man/DSA_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/DSA_new.34
-rw-r--r--secure/lib/libcrypto/man/DSA_set_method.34
-rw-r--r--secure/lib/libcrypto/man/DSA_sign.34
-rw-r--r--secure/lib/libcrypto/man/DSA_size.34
-rw-r--r--secure/lib/libcrypto/man/EC_GFp_simple_method.34
-rw-r--r--secure/lib/libcrypto/man/EC_GROUP_copy.34
-rw-r--r--secure/lib/libcrypto/man/EC_GROUP_new.34
-rw-r--r--secure/lib/libcrypto/man/EC_KEY_new.38
-rw-r--r--secure/lib/libcrypto/man/EC_POINT_add.34
-rw-r--r--secure/lib/libcrypto/man/EC_POINT_new.34
-rw-r--r--secure/lib/libcrypto/man/ERR_GET_LIB.34
-rw-r--r--secure/lib/libcrypto/man/ERR_clear_error.34
-rw-r--r--secure/lib/libcrypto/man/ERR_error_string.34
-rw-r--r--secure/lib/libcrypto/man/ERR_get_error.34
-rw-r--r--secure/lib/libcrypto/man/ERR_load_crypto_strings.34
-rw-r--r--secure/lib/libcrypto/man/ERR_load_strings.34
-rw-r--r--secure/lib/libcrypto/man/ERR_print_errors.34
-rw-r--r--secure/lib/libcrypto/man/ERR_put_error.34
-rw-r--r--secure/lib/libcrypto/man/ERR_remove_state.34
-rw-r--r--secure/lib/libcrypto/man/ERR_set_mark.34
-rw-r--r--secure/lib/libcrypto/man/EVP_BytesToKey.34
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestSignInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_DigestVerifyInit.313
-rw-r--r--secure/lib/libcrypto/man/EVP_EncryptInit.36
-rw-r--r--secure/lib/libcrypto/man/EVP_OpenInit.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_CTX_new.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_cmp.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_decrypt.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_derive.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_keygen.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_new.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_print_private.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_sign.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_verify.34
-rw-r--r--secure/lib/libcrypto/man/EVP_PKEY_verify_recover.34
-rw-r--r--secure/lib/libcrypto/man/EVP_SealInit.36
-rw-r--r--secure/lib/libcrypto/man/EVP_SignInit.37
-rw-r--r--secure/lib/libcrypto/man/EVP_VerifyInit.34
-rw-r--r--secure/lib/libcrypto/man/OBJ_nid2obj.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_Applink.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_config.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_ia32cap.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_instrument_bus.34
-rw-r--r--secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.34
-rw-r--r--secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.34
-rw-r--r--secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.34
-rw-r--r--secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.34
-rw-r--r--secure/lib/libcrypto/man/PKCS12_create.34
-rw-r--r--secure/lib/libcrypto/man/PKCS12_parse.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_decrypt.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_sign.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_sign_add_signer.34
-rw-r--r--secure/lib/libcrypto/man/PKCS7_verify.34
-rw-r--r--secure/lib/libcrypto/man/RAND_add.34
-rw-r--r--secure/lib/libcrypto/man/RAND_bytes.34
-rw-r--r--secure/lib/libcrypto/man/RAND_cleanup.34
-rw-r--r--secure/lib/libcrypto/man/RAND_egd.34
-rw-r--r--secure/lib/libcrypto/man/RAND_load_file.34
-rw-r--r--secure/lib/libcrypto/man/RAND_set_rand_method.34
-rw-r--r--secure/lib/libcrypto/man/RSA_blinding_on.34
-rw-r--r--secure/lib/libcrypto/man/RSA_check_key.34
-rw-r--r--secure/lib/libcrypto/man/RSA_generate_key.34
-rw-r--r--secure/lib/libcrypto/man/RSA_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/RSA_new.34
-rw-r--r--secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.34
-rw-r--r--secure/lib/libcrypto/man/RSA_print.34
-rw-r--r--secure/lib/libcrypto/man/RSA_private_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/RSA_public_encrypt.34
-rw-r--r--secure/lib/libcrypto/man/RSA_set_method.34
-rw-r--r--secure/lib/libcrypto/man/RSA_sign.34
-rw-r--r--secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.34
-rw-r--r--secure/lib/libcrypto/man/RSA_size.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_read_CMS.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_read_PKCS7.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_write_CMS.34
-rw-r--r--secure/lib/libcrypto/man/SMIME_write_PKCS7.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.34
-rw-r--r--secure/lib/libcrypto/man/X509_NAME_print_ex.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_get_error.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_new.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.34
-rw-r--r--secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.34
-rw-r--r--secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.34
-rw-r--r--secure/lib/libcrypto/man/X509_check_host.36
-rw-r--r--secure/lib/libcrypto/man/X509_new.34
-rw-r--r--secure/lib/libcrypto/man/X509_verify_cert.34
-rw-r--r--secure/lib/libcrypto/man/bio.34
-rw-r--r--secure/lib/libcrypto/man/blowfish.34
-rw-r--r--secure/lib/libcrypto/man/bn.34
-rw-r--r--secure/lib/libcrypto/man/bn_internal.34
-rw-r--r--secure/lib/libcrypto/man/buffer.355
-rw-r--r--secure/lib/libcrypto/man/crypto.34
-rw-r--r--secure/lib/libcrypto/man/d2i_ASN1_OBJECT.34
-rw-r--r--secure/lib/libcrypto/man/d2i_CMS_ContentInfo.34
-rw-r--r--secure/lib/libcrypto/man/d2i_DHparams.34
-rw-r--r--secure/lib/libcrypto/man/d2i_DSAPublicKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_ECPKParameters.34
-rw-r--r--secure/lib/libcrypto/man/d2i_ECPrivateKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_RSAPublicKey.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_ALGOR.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_CRL.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_NAME.36
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_REQ.34
-rw-r--r--secure/lib/libcrypto/man/d2i_X509_SIG.34
-rw-r--r--secure/lib/libcrypto/man/des.34
-rw-r--r--secure/lib/libcrypto/man/dh.34
-rw-r--r--secure/lib/libcrypto/man/dsa.34
-rw-r--r--secure/lib/libcrypto/man/ec.34
-rw-r--r--secure/lib/libcrypto/man/ecdsa.34
-rw-r--r--secure/lib/libcrypto/man/engine.314
-rw-r--r--secure/lib/libcrypto/man/err.34
-rw-r--r--secure/lib/libcrypto/man/evp.34
-rw-r--r--secure/lib/libcrypto/man/hmac.34
-rw-r--r--secure/lib/libcrypto/man/i2d_CMS_bio_stream.34
-rw-r--r--secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.34
-rw-r--r--secure/lib/libcrypto/man/lh_stats.34
-rw-r--r--secure/lib/libcrypto/man/lhash.34
-rw-r--r--secure/lib/libcrypto/man/md5.34
-rw-r--r--secure/lib/libcrypto/man/mdc2.34
-rw-r--r--secure/lib/libcrypto/man/pem.34
-rw-r--r--secure/lib/libcrypto/man/rand.34
-rw-r--r--secure/lib/libcrypto/man/rc4.34
-rw-r--r--secure/lib/libcrypto/man/ripemd.34
-rw-r--r--secure/lib/libcrypto/man/rsa.34
-rw-r--r--secure/lib/libcrypto/man/sha.34
-rw-r--r--secure/lib/libcrypto/man/threads.34
-rw-r--r--secure/lib/libcrypto/man/ui.34
-rw-r--r--secure/lib/libcrypto/man/ui_compat.34
-rw-r--r--secure/lib/libcrypto/man/x509.34
-rw-r--r--secure/lib/libssl/Makefile.man2
-rw-r--r--secure/lib/libssl/man/SSL_CIPHER_get_name.34
-rw-r--r--secure/lib/libssl/man/SSL_COMP_add_compression_method.34
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_new.34
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.34
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_set_flags.34
-rw-r--r--secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.34
-rw-r--r--secure/lib/libssl/man/SSL_CONF_cmd.34
-rw-r--r--secure/lib/libssl/man/SSL_CONF_cmd_argv.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add1_chain_cert.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.339
-rw-r--r--secure/lib/libssl/man/SSL_CTX_add_session.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_ctrl.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_flush_sessions.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_free.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get0_param.36
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get_ex_new_index.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_get_verify_mode.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_load_verify_locations.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_new.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_number.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_sessions.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set1_curves.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_store.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_cipher_list.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_client_CA_list.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_generate_session_id.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_info_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_max_cert_list.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_mode.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_msg_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_options.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_read_ahead.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_session_id_context.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_ssl_version.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_timeout.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_set_verify.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_certificate.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.34
-rw-r--r--secure/lib/libssl/man/SSL_CTX_use_serverinfo.34
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_free.34
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.34
-rw-r--r--secure/lib/libssl/man/SSL_SESSION_get_time.34
-rw-r--r--secure/lib/libssl/man/SSL_accept.34
-rw-r--r--secure/lib/libssl/man/SSL_alert_type_string.34
-rw-r--r--secure/lib/libssl/man/SSL_check_chain.3217
-rw-r--r--secure/lib/libssl/man/SSL_clear.34
-rw-r--r--secure/lib/libssl/man/SSL_connect.34
-rw-r--r--secure/lib/libssl/man/SSL_do_handshake.34
-rw-r--r--secure/lib/libssl/man/SSL_free.34
-rw-r--r--secure/lib/libssl/man/SSL_get_SSL_CTX.34
-rw-r--r--secure/lib/libssl/man/SSL_get_ciphers.34
-rw-r--r--secure/lib/libssl/man/SSL_get_client_CA_list.34
-rw-r--r--secure/lib/libssl/man/SSL_get_current_cipher.34
-rw-r--r--secure/lib/libssl/man/SSL_get_default_timeout.34
-rw-r--r--secure/lib/libssl/man/SSL_get_error.34
-rw-r--r--secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.34
-rw-r--r--secure/lib/libssl/man/SSL_get_ex_new_index.34
-rw-r--r--secure/lib/libssl/man/SSL_get_fd.34
-rw-r--r--secure/lib/libssl/man/SSL_get_peer_cert_chain.34
-rw-r--r--secure/lib/libssl/man/SSL_get_peer_certificate.34
-rw-r--r--secure/lib/libssl/man/SSL_get_psk_identity.34
-rw-r--r--secure/lib/libssl/man/SSL_get_rbio.34
-rw-r--r--secure/lib/libssl/man/SSL_get_session.34
-rw-r--r--secure/lib/libssl/man/SSL_get_verify_result.34
-rw-r--r--secure/lib/libssl/man/SSL_get_version.34
-rw-r--r--secure/lib/libssl/man/SSL_library_init.34
-rw-r--r--secure/lib/libssl/man/SSL_load_client_CA_file.34
-rw-r--r--secure/lib/libssl/man/SSL_new.34
-rw-r--r--secure/lib/libssl/man/SSL_pending.34
-rw-r--r--secure/lib/libssl/man/SSL_read.34
-rw-r--r--secure/lib/libssl/man/SSL_rstate_string.34
-rw-r--r--secure/lib/libssl/man/SSL_session_reused.34
-rw-r--r--secure/lib/libssl/man/SSL_set_bio.34
-rw-r--r--secure/lib/libssl/man/SSL_set_connect_state.34
-rw-r--r--secure/lib/libssl/man/SSL_set_fd.34
-rw-r--r--secure/lib/libssl/man/SSL_set_session.34
-rw-r--r--secure/lib/libssl/man/SSL_set_shutdown.34
-rw-r--r--secure/lib/libssl/man/SSL_set_verify_result.34
-rw-r--r--secure/lib/libssl/man/SSL_shutdown.34
-rw-r--r--secure/lib/libssl/man/SSL_state_string.34
-rw-r--r--secure/lib/libssl/man/SSL_want.34
-rw-r--r--secure/lib/libssl/man/SSL_write.34
-rw-r--r--secure/lib/libssl/man/d2i_SSL_SESSION.34
-rw-r--r--secure/lib/libssl/man/ssl.34
-rw-r--r--secure/usr.bin/openssl/man/CA.pl.14
-rw-r--r--secure/usr.bin/openssl/man/asn1parse.14
-rw-r--r--secure/usr.bin/openssl/man/c_rehash.14
-rw-r--r--secure/usr.bin/openssl/man/ca.14
-rw-r--r--secure/usr.bin/openssl/man/ciphers.14
-rw-r--r--secure/usr.bin/openssl/man/cms.14
-rw-r--r--secure/usr.bin/openssl/man/crl.14
-rw-r--r--secure/usr.bin/openssl/man/crl2pkcs7.14
-rw-r--r--secure/usr.bin/openssl/man/dgst.18
-rw-r--r--secure/usr.bin/openssl/man/dhparam.14
-rw-r--r--secure/usr.bin/openssl/man/dsa.14
-rw-r--r--secure/usr.bin/openssl/man/dsaparam.14
-rw-r--r--secure/usr.bin/openssl/man/ec.14
-rw-r--r--secure/usr.bin/openssl/man/ecparam.14
-rw-r--r--secure/usr.bin/openssl/man/enc.14
-rw-r--r--secure/usr.bin/openssl/man/errstr.14
-rw-r--r--secure/usr.bin/openssl/man/gendsa.14
-rw-r--r--secure/usr.bin/openssl/man/genpkey.14
-rw-r--r--secure/usr.bin/openssl/man/genrsa.110
-rw-r--r--secure/usr.bin/openssl/man/nseq.14
-rw-r--r--secure/usr.bin/openssl/man/ocsp.14
-rw-r--r--secure/usr.bin/openssl/man/openssl.14
-rw-r--r--secure/usr.bin/openssl/man/passwd.14
-rw-r--r--secure/usr.bin/openssl/man/pkcs12.16
-rw-r--r--secure/usr.bin/openssl/man/pkcs7.14
-rw-r--r--secure/usr.bin/openssl/man/pkcs8.14
-rw-r--r--secure/usr.bin/openssl/man/pkey.14
-rw-r--r--secure/usr.bin/openssl/man/pkeyparam.14
-rw-r--r--secure/usr.bin/openssl/man/pkeyutl.14
-rw-r--r--secure/usr.bin/openssl/man/rand.14
-rw-r--r--secure/usr.bin/openssl/man/req.117
-rw-r--r--secure/usr.bin/openssl/man/rsa.14
-rw-r--r--secure/usr.bin/openssl/man/rsautl.14
-rw-r--r--secure/usr.bin/openssl/man/s_client.14
-rw-r--r--secure/usr.bin/openssl/man/s_server.14
-rw-r--r--secure/usr.bin/openssl/man/s_time.14
-rw-r--r--secure/usr.bin/openssl/man/sess_id.14
-rw-r--r--secure/usr.bin/openssl/man/smime.14
-rw-r--r--secure/usr.bin/openssl/man/speed.14
-rw-r--r--secure/usr.bin/openssl/man/spkac.14
-rw-r--r--secure/usr.bin/openssl/man/ts.14
-rw-r--r--secure/usr.bin/openssl/man/tsget.14
-rw-r--r--secure/usr.bin/openssl/man/verify.14
-rw-r--r--secure/usr.bin/openssl/man/version.14
-rw-r--r--secure/usr.bin/openssl/man/x509.17
-rw-r--r--secure/usr.bin/openssl/man/x509v3_config.14
-rw-r--r--share/dtrace/Makefile.depend11
-rw-r--r--share/examples/libvgl/Makefile.depend3
-rw-r--r--share/examples/smbfs/Makefile.depend11
-rw-r--r--share/examples/smbfs/print/Makefile.depend11
-rw-r--r--share/keys/pkg/trusted/Makefile.depend11
-rw-r--r--share/locale-links/Makefile.depend11
-rw-r--r--share/man/man4/Makefile2
-rw-r--r--share/man/man4/arcmsr.44
-rw-r--r--share/man/man4/cxgbe.412
-rw-r--r--share/man/man4/ispfw.46
-rw-r--r--share/man/man4/miibus.45
-rw-r--r--share/man/man4/mlx5en.48
-rw-r--r--share/man/man4/pass.4132
-rw-r--r--share/man/man4/sfxge.48
-rw-r--r--share/man/man4/ure.4121
-rw-r--r--share/man/man5/src.conf.518
-rw-r--r--share/man/man9/devfs_set_cdevpriv.96
-rw-r--r--share/man/man9/style.926
-rw-r--r--share/mk/Makefile5
-rw-r--r--share/mk/bsd.dep.mk10
-rw-r--r--share/mk/bsd.libnames.mk20
-rw-r--r--share/mk/bsd.subdir.mk88
-rw-r--r--share/mk/install-new.mk18
-rw-r--r--share/mk/local.autodep.mk6
-rw-r--r--share/mk/local.dirdeps.mk68
-rw-r--r--share/mk/local.gendirdeps.mk1
-rw-r--r--share/mk/local.meta.sys.mk45
-rw-r--r--share/mk/netbsd-tests.test.mk3
-rw-r--r--share/mk/src.libnames.mk155
-rw-r--r--share/mk/src.sys.mk2
-rw-r--r--share/termcap/Makefile2
-rw-r--r--share/vt/fonts/Makefile.depend11
-rw-r--r--share/vt/keymaps/Makefile.depend11
-rw-r--r--sys/amd64/amd64/elf_machdep.c3
-rw-r--r--sys/amd64/amd64/mp_machdep.c157
-rw-r--r--sys/amd64/amd64/pmap.c6
-rw-r--r--sys/amd64/conf/GENERIC2
-rw-r--r--sys/amd64/include/cpufunc.h2
-rw-r--r--sys/amd64/include/smp.h5
-rw-r--r--sys/amd64/linux/linux_sysvec.c3
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c3
-rw-r--r--sys/arm/amlogic/aml8726/aml8726_if_dwc.c (renamed from lib/libkvm/kvm_aarch64.c)111
-rw-r--r--sys/arm/amlogic/aml8726/files.aml87261
-rw-r--r--sys/arm/arm/cpufunc.c3
-rw-r--r--sys/arm/arm/elf_machdep.c3
-rw-r--r--sys/arm/arm/exception.S40
-rw-r--r--sys/arm/arm/genassym.c1
-rw-r--r--sys/arm/arm/gic.c52
-rw-r--r--sys/arm/arm/identcpu.c4
-rw-r--r--sys/arm/arm/pmap-v6-new.c16
-rw-r--r--sys/arm/arm/trap-v6.c11
-rw-r--r--sys/arm/arm/undefined.c16
-rw-r--r--sys/arm/freescale/imx/imx6_anatop.c17
-rw-r--r--sys/arm/freescale/imx/imx6_machdep.c4
-rw-r--r--sys/arm/freescale/imx/imx_machdep.c26
-rw-r--r--sys/arm/freescale/imx/imx_machdep.h4
-rw-r--r--sys/arm/freescale/imx/imx_wdogreg.h1
-rw-r--r--sys/arm/include/armreg.h4
-rw-r--r--sys/arm/include/atomic-v4.h7
-rw-r--r--sys/arm/include/atomic-v6.h19
-rw-r--r--sys/arm/include/atomic.h1
-rw-r--r--sys/arm/include/pte-v6.h1
-rw-r--r--sys/arm/include/resource.h3
-rw-r--r--sys/arm/include/trap.h1
-rw-r--r--sys/arm/include/vm.h16
-rw-r--r--sys/arm/samsung/exynos/exynos5_combiner.c5
-rw-r--r--sys/arm/samsung/exynos/exynos5_ehci.c4
-rw-r--r--sys/arm/samsung/exynos/exynos5_pad.c5
-rw-r--r--sys/arm64/arm64/elf_machdep.c3
-rw-r--r--sys/arm64/arm64/exception.S80
-rw-r--r--sys/arm64/arm64/genassym.c3
-rw-r--r--sys/arm64/arm64/gic_v3.c2
-rw-r--r--sys/arm64/arm64/support.S2
-rw-r--r--sys/arm64/arm64/trap.c9
-rw-r--r--sys/arm64/include/atomic.h790
-rw-r--r--sys/boot/common/Makefile.depend11
-rw-r--r--sys/boot/common/disk.c36
-rw-r--r--sys/boot/common/disk.h10
-rw-r--r--sys/boot/efi/boot1/Makefile.depend12
-rw-r--r--sys/boot/efi/fdt/Makefile.depend13
-rw-r--r--sys/boot/efi/loader/Makefile.depend18
-rw-r--r--sys/boot/fdt/Makefile.depend14
-rw-r--r--sys/boot/fdt/dts/arm/odroidc1.dts2
-rw-r--r--sys/boot/ficl32/Makefile.depend17
-rw-r--r--sys/boot/forth/Makefile.depend11
-rw-r--r--sys/boot/i386/boot2/Makefile.depend3
-rw-r--r--sys/boot/i386/btx/btx/Makefile.depend11
-rw-r--r--sys/boot/i386/btx/btxldr/Makefile.depend11
-rw-r--r--sys/boot/i386/btx/lib/Makefile.depend11
-rw-r--r--sys/boot/i386/cdboot/Makefile.depend11
-rw-r--r--sys/boot/i386/gptboot/Makefile.depend15
-rw-r--r--sys/boot/i386/gptzfsboot/Makefile.depend16
-rw-r--r--sys/boot/i386/kgzldr/Makefile.depend12
-rw-r--r--sys/boot/i386/libfirewire/Makefile.depend13
-rw-r--r--sys/boot/i386/libi386/Makefile.depend13
-rw-r--r--sys/boot/i386/loader/Makefile.depend11
-rw-r--r--sys/boot/i386/mbr/Makefile.depend11
-rw-r--r--sys/boot/i386/pmbr/Makefile.depend11
-rw-r--r--sys/boot/i386/pxeldr/Makefile.depend15
-rw-r--r--sys/boot/i386/zfsboot/Makefile.depend16
-rw-r--r--sys/boot/i386/zfsloader/Makefile.depend12
-rw-r--r--sys/boot/kshim/bsd_busspace.c9
-rw-r--r--sys/boot/kshim/bsd_global.h4
-rw-r--r--sys/boot/kshim/bsd_kernel.c155
-rw-r--r--sys/boot/kshim/bsd_kernel.h83
-rw-r--r--sys/boot/libstand32/Makefile.depend58
-rw-r--r--sys/boot/ofw/libofw/ppc64_elf_freebsd.c7
-rw-r--r--sys/boot/powerpc/Makefile.inc1
-rw-r--r--sys/boot/powerpc/boot1.chrp/Makefile2
-rw-r--r--sys/boot/powerpc/kboot/ppc64_elf_freebsd.c9
-rw-r--r--sys/boot/powerpc/ps3/ppc64_elf_freebsd.c7
-rw-r--r--sys/boot/uboot/common/main.c2
-rw-r--r--sys/boot/usb/storage/umass_common.c3
-rw-r--r--sys/boot/usb/storage/umass_loader.c27
-rw-r--r--sys/boot/usb/usb_busdma_loader.c2
-rw-r--r--sys/boot/usb/usbcore.mk22
-rw-r--r--sys/boot/userboot/ficl/Makefile.depend17
-rw-r--r--sys/boot/userboot/libstand/Makefile.depend58
-rw-r--r--sys/boot/userboot/test/Makefile.depend18
-rw-r--r--sys/boot/userboot/userboot/Makefile.depend18
-rw-r--r--sys/boot/userboot/zfs/Makefile.depend13
-rw-r--r--sys/boot/zfs/Makefile.depend13
-rw-r--r--sys/cam/ata/ata_da.c25
-rw-r--r--sys/cam/cam_ccb.h6
-rw-r--r--sys/cam/cam_xpt.c11
-rw-r--r--sys/cam/cam_xpt.h4
-rw-r--r--sys/cam/ctl/ctl.c2
-rw-r--r--sys/cam/scsi/scsi_da.c29
-rw-r--r--sys/cam/scsi/scsi_pass.c1606
-rw-r--r--sys/cam/scsi/scsi_pass.h8
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c29
-rw-r--r--sys/cddl/dev/fbt/arm/fbt_isa.c30
-rw-r--r--sys/cddl/dev/profile/profile.c15
-rw-r--r--sys/compat/ia32/ia32_sysvec.c3
-rw-r--r--sys/compat/linuxkpi/common/include/linux/compat.h4
-rw-r--r--sys/compat/linuxkpi/common/include/linux/etherdevice.h19
-rw-r--r--sys/compat/linuxkpi/common/include/linux/file.h17
-rw-r--r--sys/compat/linuxkpi/common/include/linux/workqueue.h4
-rw-r--r--sys/compat/svr4/svr4_sysvec.c3
-rw-r--r--sys/conf/NOTES3
-rw-r--r--sys/conf/files5
-rw-r--r--sys/conf/files.arm641
-rw-r--r--sys/conf/files.powerpc1
-rw-r--r--sys/conf/kern.pre.mk5
-rw-r--r--sys/conf/kmod.mk14
-rw-r--r--sys/conf/ldscript.powerpc641
-rw-r--r--sys/conf/newvers.sh10
-rw-r--r--sys/conf/options1
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c153
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c69
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c8
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h7
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c2
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c21
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c2
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c86
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c28
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h33
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h1250
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p1_initvals.h291
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar953x.ini1420
-rw-r--r--sys/ddb/db_run.c24
-rw-r--r--sys/dev/ahci/ahci.c14
-rw-r--r--sys/dev/ahci/ahci.h14
-rw-r--r--sys/dev/ahci/ahci_generic.c131
-rw-r--r--sys/dev/aic7xxx/aicasm/Makefile3
-rw-r--r--sys/dev/arcmsr/arcmsr.c757
-rw-r--r--sys/dev/arcmsr/arcmsr.h21
-rw-r--r--sys/dev/ath/ath_hal/ah.c13
-rw-r--r--sys/dev/ath/ath_hal/ah_devid.h1
-rw-r--r--sys/dev/ath/ath_hal/ah_internal.h2
-rw-r--r--sys/dev/ath/ath_hal/ar9003/ar9300_devid.h1
-rw-r--r--sys/dev/ath/if_ath_tx_ht.c7
-rw-r--r--sys/dev/cxgbe/adapter.h142
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c10
-rw-r--r--sys/dev/cxgbe/iw_cxgbe/provider.c9
-rw-r--r--sys/dev/cxgbe/t4_main.c1363
-rw-r--r--sys/dev/cxgbe/t4_netmap.c288
-rw-r--r--sys/dev/cxgbe/t4_sge.c521
-rw-r--r--sys/dev/cxgbe/tom/t4_connect.c24
-rw-r--r--sys/dev/cxgbe/tom/t4_cpl_io.c7
-rw-r--r--sys/dev/cxgbe/tom/t4_listen.c91
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.c49
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.h8
-rw-r--r--sys/dev/drm2/i915/i915_debug.c90
-rw-r--r--sys/dev/drm2/i915/i915_dma.c8
-rw-r--r--sys/dev/drm2/i915/i915_drm.h260
-rw-r--r--sys/dev/hwpmc/hwpmc_core.c577
-rw-r--r--sys/dev/hwpmc/hwpmc_intel.c15
-rw-r--r--sys/dev/hwpmc/pmc_events.h629
-rw-r--r--sys/dev/ioat/ioat.c1
-rw-r--r--sys/dev/isp/isp.c168
-rw-r--r--sys/dev/isp/isp_freebsd.c349
-rw-r--r--sys/dev/isp/isp_freebsd.h26
-rw-r--r--sys/dev/isp/isp_library.c62
-rw-r--r--sys/dev/isp/isp_pci.c252
-rw-r--r--sys/dev/isp/isp_sbus.c16
-rw-r--r--sys/dev/isp/ispmbox.h17
-rw-r--r--sys/dev/isp/ispvar.h32
-rw-r--r--sys/dev/md/md.c307
-rw-r--r--sys/dev/mii/rgephy.c34
-rw-r--r--sys/dev/mii/rgephyreg.h16
-rw-r--r--sys/dev/ntb/if_ntb/if_ntb.c6
-rw-r--r--sys/dev/ofw/ofw_bus_subr.c38
-rw-r--r--sys/dev/ofw/ofw_bus_subr.h2
-rw-r--r--sys/dev/patm/genrtab/Makefile3
-rw-r--r--sys/dev/sfxge/common/ef10_tlv_layout.h108
-rw-r--r--sys/dev/sfxge/common/efsys.h2
-rw-r--r--sys/dev/sfxge/common/efx.h258
-rw-r--r--sys/dev/sfxge/common/efx_bootcfg.c18
-rw-r--r--sys/dev/sfxge/common/efx_check.h7
-rw-r--r--sys/dev/sfxge/common/efx_ev.c50
-rw-r--r--sys/dev/sfxge/common/efx_filter.c91
-rw-r--r--sys/dev/sfxge/common/efx_impl.h252
-rw-r--r--sys/dev/sfxge/common/efx_intr.c20
-rw-r--r--sys/dev/sfxge/common/efx_mac.c88
-rw-r--r--sys/dev/sfxge/common/efx_mcdi.c166
-rw-r--r--sys/dev/sfxge/common/efx_mcdi.h39
-rw-r--r--sys/dev/sfxge/common/efx_mon.c14
-rw-r--r--sys/dev/sfxge/common/efx_nic.c86
-rw-r--r--sys/dev/sfxge/common/efx_nvram.c122
-rw-r--r--sys/dev/sfxge/common/efx_phy.c48
-rw-r--r--sys/dev/sfxge/common/efx_port.c18
-rw-r--r--sys/dev/sfxge/common/efx_regs_ef10.h2558
-rw-r--r--sys/dev/sfxge/common/efx_regs_mcdi.h438
-rw-r--r--sys/dev/sfxge/common/efx_rx.c118
-rw-r--r--sys/dev/sfxge/common/efx_sram.c8
-rw-r--r--sys/dev/sfxge/common/efx_tx.c94
-rw-r--r--sys/dev/sfxge/common/efx_vpd.c106
-rw-r--r--sys/dev/sfxge/common/efx_wol.c36
-rw-r--r--sys/dev/sfxge/common/hunt_ev.c49
-rw-r--r--sys/dev/sfxge/common/hunt_filter.c84
-rw-r--r--sys/dev/sfxge/common/hunt_impl.h216
-rw-r--r--sys/dev/sfxge/common/hunt_intr.c14
-rw-r--r--sys/dev/sfxge/common/hunt_mac.c54
-rw-r--r--sys/dev/sfxge/common/hunt_mcdi.c159
-rw-r--r--sys/dev/sfxge/common/hunt_nic.c262
-rw-r--r--sys/dev/sfxge/common/hunt_nvram.c634
-rw-r--r--sys/dev/sfxge/common/hunt_phy.c52
-rw-r--r--sys/dev/sfxge/common/hunt_rx.c112
-rw-r--r--sys/dev/sfxge/common/hunt_sram.c6
-rwxr-xr-xsys/dev/sfxge/common/hunt_tx.c62
-rw-r--r--sys/dev/sfxge/common/hunt_vpd.c58
-rw-r--r--sys/dev/sfxge/common/mcdi_mon.c36
-rw-r--r--sys/dev/sfxge/common/mcdi_mon.h8
-rw-r--r--sys/dev/sfxge/common/siena_flash.h2
-rw-r--r--sys/dev/sfxge/common/siena_impl.h121
-rw-r--r--sys/dev/sfxge/common/siena_mac.c28
-rw-r--r--sys/dev/sfxge/common/siena_mcdi.c91
-rw-r--r--sys/dev/sfxge/common/siena_nic.c48
-rw-r--r--sys/dev/sfxge/common/siena_nvram.c97
-rw-r--r--sys/dev/sfxge/common/siena_phy.c52
-rw-r--r--sys/dev/sfxge/common/siena_sram.c6
-rw-r--r--sys/dev/sfxge/common/siena_vpd.c56
-rw-r--r--sys/dev/sfxge/sfxge.c19
-rw-r--r--sys/dev/sfxge/sfxge.h3
-rw-r--r--sys/dev/sfxge/sfxge_mcdi.c70
-rw-r--r--sys/dev/sfxge/sfxge_tx.c119
-rw-r--r--sys/dev/sfxge/sfxge_tx.h15
-rw-r--r--sys/dev/uart/uart_dev_imx.h1
-rw-r--r--sys/dev/usb/net/if_ure.c1070
-rw-r--r--sys/dev/usb/net/if_urereg.h435
-rw-r--r--sys/dev/usb/usbdevs1
-rw-r--r--sys/dev/usb/wlan/if_urtwn.c392
-rw-r--r--sys/dev/usb/wlan/if_urtwnreg.h3
-rw-r--r--sys/dev/wpi/if_wpi.c7
-rw-r--r--sys/fs/devfs/devfs_vnops.c2
-rw-r--r--sys/fs/nfs/nfs.h18
-rw-r--r--sys/fs/nfs/nfs_commonport.c23
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c730
-rw-r--r--sys/fs/nfs/nfs_var.h2
-rw-r--r--sys/fs/nfs/nfsport.h7
-rw-r--r--sys/fs/nfs/nfsrvstate.h17
-rw-r--r--sys/fs/nfsclient/nfs_clnode.c5
-rw-r--r--sys/fs/nfsclient/nfs_clport.c2
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c26
-rw-r--r--sys/geom/geom_disk.c188
-rw-r--r--sys/geom/geom_io.c9
-rw-r--r--sys/i386/conf/GENERIC2
-rw-r--r--sys/i386/conf/NOTES2
-rw-r--r--sys/i386/i386/elf_machdep.c3
-rw-r--r--sys/i386/i386/machdep.c4
-rw-r--r--sys/i386/i386/mp_machdep.c203
-rw-r--r--sys/i386/i386/pmap.c53
-rw-r--r--sys/i386/include/pmap.h2
-rw-r--r--sys/i386/include/smp.h9
-rw-r--r--sys/i386/linux/linux_sysvec.c6
-rw-r--r--sys/kern/imgact_aout.c6
-rw-r--r--sys/kern/imgact_elf.c3
-rw-r--r--sys/kern/init_main.c3
-rw-r--r--sys/kern/subr_bus_dma.c69
-rw-r--r--sys/kern/subr_capability.c1
-rw-r--r--sys/kern/subr_uio.c54
-rw-r--r--sys/kern/vfs_subr.c170
-rw-r--r--sys/mips/conf/AP143.hints4
-rw-r--r--sys/mips/conf/QCA953X_BASE2
-rw-r--r--sys/mips/conf/QCA953X_BASE.hints4
-rw-r--r--sys/mips/mips/elf_machdep.c6
-rw-r--r--sys/mips/mips/freebsd32_machdep.c3
-rw-r--r--sys/modules/Makefile8
-rw-r--r--sys/modules/ahci/Makefile4
-rw-r--r--sys/modules/ath/Makefile2
-rw-r--r--sys/modules/mlxen/Makefile2
-rw-r--r--sys/modules/uart/Makefile2
-rw-r--r--sys/modules/usb/Makefile2
-rw-r--r--sys/modules/usb/ure/Makefile10
-rw-r--r--sys/net/if_llatbl.c2
-rw-r--r--sys/net/if_llatbl.h15
-rw-r--r--sys/net/route.c606
-rw-r--r--sys/net/route.h21
-rw-r--r--sys/netinet/if_ether.c140
-rw-r--r--sys/netinet/igmp.c10
-rw-r--r--sys/netinet/in.c12
-rw-r--r--sys/netinet/in_rmx.c49
-rw-r--r--sys/netinet/sctp_indata.c15
-rw-r--r--sys/netinet/sctp_input.c13
-rw-r--r--sys/netinet/sctp_output.c19
-rw-r--r--sys/netinet/sctp_timer.c5
-rw-r--r--sys/netinet/sctp_usrreq.c15
-rw-r--r--sys/netinet/sctputil.c12
-rw-r--r--sys/netinet6/mld6.c10
-rw-r--r--sys/netinet6/nd6.c31
-rw-r--r--sys/netinet6/nd6_rtr.c9
-rw-r--r--sys/nfs/nfssvc.h1
-rw-r--r--sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c8
-rw-r--r--sys/ofed/drivers/net/mlx4/en_ethtool.c1616
-rw-r--r--sys/ofed/drivers/net/mlx4/en_main.c13
-rw-r--r--sys/ofed/drivers/net/mlx4/en_netdev.c276
-rw-r--r--sys/ofed/drivers/net/mlx4/en_port.c16
-rw-r--r--sys/ofed/drivers/net/mlx4/en_rx.c420
-rw-r--r--sys/ofed/drivers/net/mlx4/en_selftest.c178
-rw-r--r--sys/ofed/drivers/net/mlx4/en_tx.c852
-rw-r--r--sys/ofed/drivers/net/mlx4/main.c82
-rw-r--r--sys/ofed/drivers/net/mlx4/mlx4.h10
-rw-r--r--sys/ofed/drivers/net/mlx4/mlx4_en.h83
-rw-r--r--sys/ofed/drivers/net/mlx4/mlx4_stats.h1
-rw-r--r--sys/ofed/drivers/net/mlx4/port.c7
-rw-r--r--sys/ofed/include/linux/mlx4/cq.h2
-rw-r--r--sys/ofed/include/linux/mlx4/device.h7
-rw-r--r--sys/ofed/include/linux/mlx4/doorbell.h2
-rw-r--r--sys/ofed/include/linux/mlx4/qp.h8
-rw-r--r--sys/pc98/conf/GENERIC2
-rw-r--r--sys/pc98/conf/NOTES2
-rw-r--r--sys/pc98/include/bus.h6
-rw-r--r--sys/powerpc/aim/locore64.S4
-rw-r--r--sys/powerpc/conf/GENERIC2
-rw-r--r--sys/powerpc/include/asm.h24
-rw-r--r--sys/powerpc/include/param.h2
-rw-r--r--sys/powerpc/include/spr.h2
-rw-r--r--sys/powerpc/mpc85xx/qoriq_gpio.c309
-rw-r--r--sys/powerpc/powerpc/elf32_machdep.c3
-rw-r--r--sys/powerpc/powerpc/elf64_machdep.c6
-rw-r--r--sys/powerpc/powerpc/exec_machdep.c3
-rw-r--r--sys/powerpc/powerpc/sigcode64.S1
-rw-r--r--sys/powerpc/powerpc/swtch64.S4
-rw-r--r--sys/powerpc/powerpc/trap.c8
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c5
-rw-r--r--sys/sparc64/conf/GENERIC2
-rw-r--r--sys/sparc64/include/kerneldump.h17
-rw-r--r--sys/sparc64/sparc64/elf_machdep.c3
-rw-r--r--sys/sys/bio.h1
-rw-r--r--sys/sys/buf.h6
-rw-r--r--sys/sys/conf.h4
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/sys/pmc.h3
-rw-r--r--sys/sys/sysent.h4
-rw-r--r--sys/sys/uio.h5
-rw-r--r--sys/sys/vnode.h1
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c6
-rw-r--r--sys/vm/device_pager.c38
-rw-r--r--sys/vm/vm_object.c378
-rw-r--r--sys/vm/vm_pageout.c11
-rw-r--r--sys/vm/vm_reserv.c7
-rw-r--r--sys/x86/acpica/madt.c47
-rw-r--r--sys/x86/x86/local_apic.c10
-rw-r--r--sys/x86/x86/mp_x86.c175
-rw-r--r--targets/pseudo/bootstrap-tools/Makefile18
-rw-r--r--targets/pseudo/userland/Makefile.depend172
-rw-r--r--targets/pseudo/userland/cddl/Makefile.depend12
-rw-r--r--targets/pseudo/userland/gnu/Makefile.depend11
-rw-r--r--targets/pseudo/userland/lib/Makefile.depend30
-rw-r--r--targets/pseudo/userland/libexec/Makefile.depend7
-rw-r--r--targets/pseudo/userland/misc/Makefile.depend64
-rw-r--r--targets/pseudo/userland/secure/Makefile.depend1
-rw-r--r--targets/pseudo/userland/share/Makefile.depend8
-rw-r--r--tests/sys/aio/Makefile3
-rw-r--r--tests/sys/file/Makefile9
-rw-r--r--tests/sys/kern/Makefile7
-rw-r--r--tests/sys/mqueue/Makefile7
-rwxr-xr-xtests/sys/mqueue/mqueue_test.sh4
-rw-r--r--tools/bsdbox/Makefile.net1
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc14
-rwxr-xr-xtools/build/options/makeman2
-rw-r--r--tools/diag/dumpvfscache/Makefile3
-rw-r--r--tools/regression/gaithrstress/Makefile3
-rw-r--r--tools/regression/kgssapi/Makefile3
-rw-r--r--tools/regression/lib/libc/nss/test-getaddr.c134
-rw-r--r--tools/regression/lib/libc/nss/test-getgr.c140
-rw-r--r--tools/regression/lib/libc/nss/test-gethostby.c298
-rw-r--r--tools/regression/lib/libc/nss/test-getproto.c146
-rw-r--r--tools/regression/lib/libc/nss/test-getpw.c96
-rw-r--r--tools/regression/lib/libc/nss/test-getrpc.c146
-rw-r--r--tools/regression/lib/libc/nss/test-getserv.c148
-rw-r--r--tools/regression/lib/libc/nss/test-getusershell.c40
-rw-r--r--tools/regression/lib/libc/nss/testutil.h17
-rw-r--r--tools/regression/lib/libc/resolv/Makefile3
-rw-r--r--tools/regression/mac/mac_bsdextended/Makefile3
-rw-r--r--tools/regression/posixsem/Makefile3
-rw-r--r--tools/regression/priv/Makefile3
-rw-r--r--tools/regression/pthread/cv_cancel1/Makefile3
-rw-r--r--tools/regression/pthread/mutex_isowned_np/Makefile3
-rw-r--r--tools/regression/rpcsec_gss/Makefile3
-rw-r--r--tools/regression/sockets/sendfile/Makefile3
-rw-r--r--tools/regression/tls/ttls2/Makefile3
-rw-r--r--tools/regression/tls/ttls4/Makefile3
-rw-r--r--tools/tools/ath/athratestats/Makefile2
-rw-r--r--tools/tools/atsectl/Makefile3
-rw-r--r--tools/tools/ether_reflect/Makefile3
-rw-r--r--tools/tools/ifpifa/Makefile3
-rw-r--r--tools/tools/mctest/Makefile3
-rwxr-xr-xtools/tools/nanobsd/defaults.sh257
-rw-r--r--tools/tools/nanobsd/embedded/README14
-rw-r--r--tools/tools/nanobsd/embedded/beaglebone.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/common567
-rw-r--r--tools/tools/nanobsd/embedded/qemu-amd64.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/qemu-i386.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/qemu-mips.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/qemu-mips64.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/qemu-powerpc.cfg43
-rw-r--r--tools/tools/nanobsd/embedded/qemu-powerpc64.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/qemu-sparc64.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/rpi.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/rpi2.cfg42
-rw-r--r--tools/tools/nanobsd/embedded/sam9260ek.cfg41
-rw-r--r--tools/tools/nanobsd/embedded/sam9g20ek.cfg41
-rwxr-xr-xtools/tools/nanobsd/mtree-dedup.awk197
-rw-r--r--tools/tools/nanobsd/pcengines/ALIX_NFS115
-rw-r--r--tools/tools/nanobsd/pcengines/common.conf4
-rw-r--r--tools/tools/ncpus/Makefile3
-rw-r--r--tools/tools/net80211/stumbler/Makefile3
-rw-r--r--tools/tools/net80211/wesside/dics/Makefile3
-rw-r--r--tools/tools/net80211/wesside/udps/Makefile3
-rw-r--r--tools/tools/net80211/wesside/wesside/Makefile3
-rw-r--r--tools/tools/netrate/http/Makefile3
-rw-r--r--tools/tools/netrate/httpd/Makefile3
-rw-r--r--tools/tools/netrate/juggle/Makefile3
-rw-r--r--tools/tools/tscdrift/Makefile3
-rw-r--r--tools/tools/umastat/Makefile3
-rw-r--r--tools/tools/usbtest/Makefile3
-rw-r--r--tools/tools/vimage/Makefile3
-rw-r--r--tools/tools/zfsboottest/Makefile2
-rw-r--r--usr.bin/bluetooth/btsockstat/Makefile.depend1
-rw-r--r--usr.bin/caesar/Makefile3
-rw-r--r--usr.bin/clang/clang-tblgen/Makefile.depend1
-rw-r--r--usr.bin/clang/clang.prog.mk6
-rw-r--r--usr.bin/clang/clang/Makefile5
-rw-r--r--usr.bin/clang/clang/Makefile.depend5
-rw-r--r--usr.bin/clang/llc/Makefile5
-rw-r--r--usr.bin/clang/lldb/Makefile.depend8
-rw-r--r--usr.bin/clang/lli/Makefile5
-rw-r--r--usr.bin/clang/llvm-ar/Makefile5
-rw-r--r--usr.bin/clang/llvm-cxxdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-dwarfdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-lto/Makefile5
-rw-r--r--usr.bin/clang/llvm-mc/Makefile5
-rw-r--r--usr.bin/clang/llvm-nm/Makefile5
-rw-r--r--usr.bin/clang/llvm-objdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-pdbdump/Makefile5
-rw-r--r--usr.bin/clang/llvm-rtdyld/Makefile5
-rw-r--r--usr.bin/clang/llvm-symbolizer/Makefile5
-rw-r--r--usr.bin/clang/opt/Makefile5
-rw-r--r--usr.bin/clang/tblgen/Makefile.depend1
-rw-r--r--usr.bin/cpio/Makefile12
-rw-r--r--usr.bin/cpio/tests/Makefile16
-rw-r--r--usr.bin/dpv/Makefile.depend24
-rw-r--r--usr.bin/drill/Makefile.depend22
-rw-r--r--usr.bin/dtc/Makefile.depend21
-rw-r--r--usr.bin/factor/Makefile3
-rw-r--r--usr.bin/grdc/Makefile2
-rw-r--r--usr.bin/iconv/Makefile.depend18
-rw-r--r--usr.bin/ident/Makefile.depend19
-rw-r--r--usr.bin/ipcrm/Makefile.depend1
-rw-r--r--usr.bin/ipcs/Makefile.depend1
-rw-r--r--usr.bin/iscsictl/Makefile.depend28
-rw-r--r--usr.bin/iscsictl/iscsictl.813
-rw-r--r--usr.bin/ktrdump/Makefile.depend1
-rw-r--r--usr.bin/lex/Makefile.depend3
-rw-r--r--usr.bin/mkcsmapper/Makefile.depend26
-rw-r--r--usr.bin/mkesdb/Makefile.depend25
-rw-r--r--usr.bin/mkimg/Makefile.depend19
-rw-r--r--usr.bin/netstat/Makefile.depend1
-rw-r--r--usr.bin/netstat/netstat.19
-rw-r--r--usr.bin/netstat/route.c20
-rw-r--r--usr.bin/nfsstat/Makefile.depend1
-rw-r--r--usr.bin/patch/Makefile.depend18
-rw-r--r--usr.bin/pom/Makefile3
-rw-r--r--usr.bin/primes/Makefile3
-rw-r--r--usr.bin/protect/Makefile.depend17
-rw-r--r--usr.bin/rctl/rctl.812
-rw-r--r--usr.bin/rctl/rctl.c480
-rw-r--r--usr.bin/send-pr/Makefile.depend11
-rw-r--r--usr.bin/smbutil/Makefile.depend3
-rw-r--r--usr.bin/soelim/Makefile.depend18
-rw-r--r--usr.bin/svn/lib/libsvn_delta/Makefile.depend1
-rw-r--r--usr.bin/svn/lib/libsvn_subr/Makefile.depend1
-rw-r--r--usr.bin/svn/svn/Makefile.depend5
-rw-r--r--usr.bin/svn/svnadmin/Makefile.depend6
-rw-r--r--usr.bin/svn/svnbench/Makefile.depend5
-rw-r--r--usr.bin/svn/svndumpfilter/Makefile.depend5
-rw-r--r--usr.bin/svn/svnfsfs/Makefile.depend7
-rw-r--r--usr.bin/svn/svnlook/Makefile.depend6
-rw-r--r--usr.bin/svn/svnmucc/Makefile.depend8
-rw-r--r--usr.bin/svn/svnrdump/Makefile.depend6
-rw-r--r--usr.bin/svn/svnserve/Makefile.depend8
-rw-r--r--usr.bin/svn/svnsync/Makefile.depend6
-rw-r--r--usr.bin/svn/svnversion/Makefile.depend5
-rw-r--r--usr.bin/systat/Makefile.depend1
-rw-r--r--usr.bin/tar/Makefile10
-rw-r--r--usr.bin/tar/tests/Makefile10
-rw-r--r--usr.bin/top/Makefile.depend1
-rw-r--r--usr.bin/unifdef/unifdef.147
-rw-r--r--usr.bin/unifdef/unifdef.c141
-rw-r--r--usr.bin/unifdef/unifdef.h2
-rw-r--r--usr.bin/vgrind/RETEST/Makefile11
-rw-r--r--usr.bin/vgrind/RETEST/retest.c103
-rw-r--r--usr.bin/vi/catalog/Makefile.depend11
-rw-r--r--usr.bin/vmstat/Makefile.depend2
-rw-r--r--usr.bin/vmstat/vmstat.c24
-rw-r--r--usr.bin/w/Makefile.depend1
-rw-r--r--usr.bin/w/w.19
-rw-r--r--usr.bin/wc/wc.19
-rw-r--r--usr.bin/xo/Makefile.depend20
-rw-r--r--usr.sbin/Makefile1
-rw-r--r--usr.sbin/asf/Makefile.depend1
-rw-r--r--usr.sbin/auditdistd/Makefile.depend31
-rw-r--r--usr.sbin/autofs/Makefile.depend21
-rw-r--r--usr.sbin/bhyvectl/Makefile.depend20
-rw-r--r--usr.sbin/bhyveload/Makefile.depend20
-rw-r--r--usr.sbin/binmiscctl/Makefile.depend18
-rw-r--r--usr.sbin/bsdconfig/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/console/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/console/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/diskmgmt/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/diskmgmt/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/docsinstall/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/docsinstall/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/dot/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/dot/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/examples/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/includes/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/includes/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/mouse/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/mouse/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/networking/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/networking/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/networking/share/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/password/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/password/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/password/share/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/security/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/security/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/share/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/share/media/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/startup/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/startup/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/startup/share/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/timezone/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/timezone/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/timezone/share/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/ttys/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/ttys/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/usermgmt/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/usermgmt/include/Makefile.depend11
-rw-r--r--usr.sbin/bsdconfig/usermgmt/share/Makefile.depend11
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig21
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend2
-rw-r--r--usr.sbin/camdd/Makefile10
-rw-r--r--usr.sbin/camdd/Makefile.depend25
-rw-r--r--usr.sbin/camdd/camdd.8283
-rw-r--r--usr.sbin/camdd/camdd.c3428
-rw-r--r--usr.sbin/ctld/Makefile.depend31
-rw-r--r--usr.sbin/dconschat/Makefile.depend1
-rw-r--r--usr.sbin/devctl/Makefile.depend19
-rw-r--r--usr.sbin/fifolog/lib/Makefile1
-rw-r--r--usr.sbin/fstyp/Makefile6
-rw-r--r--usr.sbin/fstyp/Makefile.depend32
-rw-r--r--usr.sbin/ftp-proxy/Makefile.depend20
-rw-r--r--usr.sbin/gstat/Makefile.depend1
-rw-r--r--usr.sbin/hyperv/tools/Makefile.depend19
-rw-r--r--usr.sbin/iostat/Makefile.depend1
-rw-r--r--usr.sbin/iovctl/Makefile.depend21
-rw-r--r--usr.sbin/iscsid/Makefile.depend21
-rw-r--r--usr.sbin/jail/Makefile.depend1
-rw-r--r--usr.sbin/kbdmap/kbdmap.c20
-rw-r--r--usr.sbin/kgmon/Makefile.depend1
-rw-r--r--usr.sbin/mount_smbfs/Makefile.depend3
-rw-r--r--usr.sbin/nandsim/Makefile.depend18
-rw-r--r--usr.sbin/nandtool/Makefile.depend21
-rw-r--r--usr.sbin/nfsuserd/nfsuserd.820
-rw-r--r--usr.sbin/nfsuserd/nfsuserd.c60
-rw-r--r--usr.sbin/ntp/doc/drivers/Makefile.depend11
-rw-r--r--usr.sbin/ntp/doc/drivers/icons/Makefile.depend11
-rw-r--r--usr.sbin/ntp/doc/drivers/scripts/Makefile.depend11
-rw-r--r--usr.sbin/ntp/doc/hints/Makefile.depend11
-rw-r--r--usr.sbin/ntp/doc/icons/Makefile.depend11
-rw-r--r--usr.sbin/ntp/doc/pic/Makefile.depend11
-rw-r--r--usr.sbin/ntp/doc/scripts/Makefile.depend11
-rw-r--r--usr.sbin/pstat/Makefile.depend1
-rw-r--r--usr.sbin/pw/pw_user.c24
-rwxr-xr-xusr.sbin/pw/tests/pw_lock.sh20
-rw-r--r--usr.sbin/sysrc/Makefile.depend11
-rw-r--r--usr.sbin/uefisign/Makefile.depend19
-rw-r--r--usr.sbin/unbound/anchor/Makefile.depend24
-rw-r--r--usr.sbin/unbound/checkconf/Makefile.depend23
-rw-r--r--usr.sbin/unbound/control/Makefile.depend23
-rw-r--r--usr.sbin/unbound/daemon/Makefile.depend24
-rw-r--r--usr.sbin/unbound/local-setup/Makefile.depend11
-rw-r--r--usr.sbin/vigr/Makefile.depend11
1480 files changed, 35907 insertions, 20187 deletions
diff --git a/Makefile b/Makefile
index 9d18ba4..7fb9de8 100644
--- a/Makefile
+++ b/Makefile
@@ -323,21 +323,21 @@ bmake: .PHONY
@echo ">>> Building an up-to-date ${.TARGET}(1)"
@echo "--------------------------------------------------------------"
${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \
- ${MMAKE} obj && \
- ${MMAKE} depend && \
- ${MMAKE} all && \
+ ${MMAKE} obj; \
+ ${MMAKE} depend; \
+ ${MMAKE} all; \
${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR=
tinderbox toolchains kernel-toolchains: upgrade_checks
tinderbox:
- @cd ${.CURDIR} && ${SUB_MAKE} DOING_TINDERBOX=YES universe
+ @cd ${.CURDIR}; ${SUB_MAKE} DOING_TINDERBOX=YES universe
toolchains:
- @cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe
+ @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe
kernel-toolchains:
- @cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe
+ @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe
#
# universe
@@ -435,7 +435,7 @@ universe_${target}_kernels: universe_${target}_prologue .MAKE
(echo "${target} 'make LINT' failed," \
"check _.${target}.makeLINT for details"| ${MAKEFAIL}))
.endif
- @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \
+ @cd ${.CURDIR}; ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \
universe_kernels
.endif # !MAKE_JUST_WORLDS
diff --git a/Makefile.inc1 b/Makefile.inc1
index cc48d20..9d2253c 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -144,6 +144,7 @@ CLEANDIR= cleandir
.endif
LOCAL_TOOL_DIRS?=
+PACKAGEDIR?= ${DESTDIR}/${DISTDIR}
BUILDENV_SHELL?=${SHELL}
@@ -642,12 +643,9 @@ _includes:
# Special handling for SUBDIR_OVERRIDE in buildworld as they most likely need
# headers from default SUBDIR. Do SUBDIR_OVERRIDE includes last.
${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \
- buildincludes
- ${_+_}cd ${.CURDIR}; ${WMAKE} SUBDIR_OVERRIDE= SHARED=symlinks \
- installincludes
+ includes
.if !empty(SUBDIR_OVERRIDE) && make(buildworld)
- ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks buildincludes
- ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks installincludes
+ ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes
.endif
_libraries:
@echo
@@ -668,7 +666,7 @@ everything:
@echo "--------------------------------------------------------------"
@echo ">>> stage 4.4: building everything"
@echo "--------------------------------------------------------------"
- ${_+_}cd ${.CURDIR}; ${WMAKE} par-all
+ ${_+_}cd ${.CURDIR}; _PARALLEL_SUBUDIR_OK=1 ${WMAKE} all
.if defined(LIB32TMP)
build32: .PHONY
@echo
@@ -1008,11 +1006,11 @@ packageworld:
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
tar cvf - --exclude usr/lib/debug \
@${DESTDIR}/${DISTDIR}/${dist}.meta | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
.else
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
tar cvf - --exclude usr/lib/debug . | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
.endif
.endfor
@@ -1020,11 +1018,11 @@ packageworld:
. if defined(NO_ROOT)
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
. else
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
tar cvLf - usr/lib/debug | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/${dist}-dbg.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/${dist}-dbg.txz
. endif
.endfor
@@ -1109,10 +1107,14 @@ KERNCONFDIR?= ${KRNLCONFDIR}
BUILDKERNELS=
INSTALLKERNEL=
+.if defined(NO_INSTALLKERNEL)
+# All of the BUILDKERNELS loops start at index 1.
+BUILDKERNELS+= dummy
+.endif
.for _kernel in ${KERNCONF}
.if exists(${KERNCONFDIR}/${_kernel})
BUILDKERNELS+= ${_kernel}
-.if empty(INSTALLKERNEL)
+.if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL)
INSTALLKERNEL= ${_kernel}
.endif
.endif
@@ -1126,12 +1128,12 @@ ${WMAKE_TGTS:N_worldtmp:Nbuild32} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
# Builds all kernels defined by BUILDKERNELS.
#
buildkernel: .MAKE .PHONY
-.if empty(BUILDKERNELS)
+.if empty(BUILDKERNELS:Ndummy)
@echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
false
.endif
@echo
-.for _kernel in ${BUILDKERNELS}
+.for _kernel in ${BUILDKERNELS:Ndummy}
@echo "--------------------------------------------------------------"
@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
@echo "--------------------------------------------------------------"
@@ -1190,6 +1192,7 @@ buildkernel: .MAKE .PHONY
#
installkernel installkernel.debug \
reinstallkernel reinstallkernel.debug: _installcheck_kernel
+.if !defined(NO_INSTALLKERNEL)
.if empty(INSTALLKERNEL)
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
false
@@ -1200,6 +1203,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${CROSSENV} PATH=${TMPPATH} \
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
@echo "--------------------------------------------------------------"
@@ -1212,6 +1216,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel
.endif
distributekernel distributekernel.debug:
+.if !defined(NO_INSTALLKERNEL)
.if empty(INSTALLKERNEL)
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
false
@@ -1229,6 +1234,7 @@ distributekernel distributekernel.debug:
sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
${DESTDIR}/${DISTDIR}/kernel.meta
.endif
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
.if defined(NO_ROOT)
@@ -1250,25 +1256,29 @@ distributekernel distributekernel.debug:
packagekernel:
.if defined(NO_ROOT)
+.if !defined(NO_INSTALLKERNEL)
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
.endfor
.endif
.else
+.if !defined(NO_INSTALLKERNEL)
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - . | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - . | \
- ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz
+ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
.endfor
.endif
.endif
@@ -1283,7 +1293,7 @@ doxygen: .PHONY
echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
exit 1; \
fi
- ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
+ ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all
#
# update
@@ -1303,7 +1313,7 @@ update:
@echo "--------------------------------------------------------------"
@echo ">>> Updating ${.CURDIR} using Subversion"
@echo "--------------------------------------------------------------"
- @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS})
+ @(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS})
.endif
#
@@ -1336,11 +1346,11 @@ legacy:
.endif
.for _tool in tools/build ${_elftoolchain_libs}
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
- cd ${.CURDIR}/${_tool} && \
- ${MAKE} DIRPRFX=${_tool}/ obj && \
- ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \
- ${MAKE} DIRPRFX=${_tool}/ depend && \
- ${MAKE} DIRPRFX=${_tool}/ all && \
+ cd ${.CURDIR}/${_tool}; \
+ ${MAKE} DIRPRFX=${_tool}/ obj; \
+ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
+ ${MAKE} DIRPRFX=${_tool}/ depend; \
+ ${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
.endfor
@@ -1489,10 +1499,10 @@ bootstrap-tools: .PHONY
usr.bin/localedef
${_bt}-${_tool}: .PHONY .MAKE
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
- cd ${.CURDIR}/${_tool} && \
- ${MAKE} DIRPRFX=${_tool}/ obj && \
- ${MAKE} DIRPRFX=${_tool}/ depend && \
- ${MAKE} DIRPRFX=${_tool}/ all && \
+ cd ${.CURDIR}/${_tool}; \
+ ${MAKE} DIRPRFX=${_tool}/ obj; \
+ ${MAKE} DIRPRFX=${_tool}/ depend; \
+ ${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
bootstrap-tools: ${_bt}-${_tool}
@@ -1529,8 +1539,8 @@ _rescue=rescue/rescue
usr.bin/vi/catalog
build-tools_${_tool}: .PHONY
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
- cd ${.CURDIR}/${_tool} && \
- ${MAKE} DIRPRFX=${_tool}/ obj && \
+ cd ${.CURDIR}/${_tool}; \
+ ${MAKE} DIRPRFX=${_tool}/ obj; \
${MAKE} DIRPRFX=${_tool}/ build-tools
build-tools: build-tools_${_tool}
.endfor
@@ -1538,9 +1548,9 @@ build-tools: build-tools_${_tool}
${_gcc_tools}
build-tools_${_tool}: .PHONY
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
- cd ${.CURDIR}/${_tool} && \
- ${MAKE} DIRPRFX=${_tool}/ obj && \
- ${MAKE} DIRPRFX=${_tool}/ depend && \
+ cd ${.CURDIR}/${_tool}; \
+ ${MAKE} DIRPRFX=${_tool}/ obj; \
+ ${MAKE} DIRPRFX=${_tool}/ depend; \
${MAKE} DIRPRFX=${_tool}/ all
build-tools: build-tools_${_tool}
.endfor
@@ -1620,10 +1630,10 @@ cross-tools: .MAKE .PHONY
${_crunchide} \
${_usb_tools}
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
- cd ${.CURDIR}/${_tool} && \
- ${MAKE} DIRPRFX=${_tool}/ obj && \
- ${MAKE} DIRPRFX=${_tool}/ depend && \
- ${MAKE} DIRPRFX=${_tool}/ all && \
+ cd ${.CURDIR}/${_tool}; \
+ ${MAKE} DIRPRFX=${_tool}/ obj; \
+ ${MAKE} DIRPRFX=${_tool}/ depend; \
+ ${MAKE} DIRPRFX=${_tool}/ all; \
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
.endfor
@@ -1652,10 +1662,10 @@ native-xtools: .PHONY
.if ${MK_GCC_BOOTSTRAP} != "no"
mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \
- cd ${.CURDIR}/${_gperf} && \
- ${NXBMAKE} DIRPRFX=${_gperf}/ obj && \
- ${NXBMAKE} DIRPRFX=${_gperf}/ depend && \
- ${NXBMAKE} DIRPRFX=${_gperf}/ all && \
+ cd ${.CURDIR}/${_gperf}; \
+ ${NXBMAKE} DIRPRFX=${_gperf}/ obj; \
+ ${NXBMAKE} DIRPRFX=${_gperf}/ depend; \
+ ${NXBMAKE} DIRPRFX=${_gperf}/ all; \
${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
.endif
mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
@@ -1727,10 +1737,10 @@ native-xtools: .PHONY
usr.bin/yacc \
usr.sbin/chown
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
- cd ${.CURDIR}/${_tool} && \
- ${NXBMAKE} DIRPRFX=${_tool}/ obj && \
- ${NXBMAKE} DIRPRFX=${_tool}/ depend && \
- ${NXBMAKE} DIRPRFX=${_tool}/ all && \
+ cd ${.CURDIR}/${_tool}; \
+ ${NXBMAKE} DIRPRFX=${_tool}/ obj; \
+ ${NXBMAKE} DIRPRFX=${_tool}/ depend; \
+ ${NXBMAKE} DIRPRFX=${_tool}/ all; \
${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
.endfor
@@ -1738,7 +1748,7 @@ native-xtools: .PHONY
# hierarchy - ensure that all the needed directories are present
#
hierarchy hier: .MAKE .PHONY
- ${_+_}cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs
+ ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
#
# libraries - build all libraries, and install them under ${DESTDIR}.
@@ -1748,10 +1758,10 @@ hierarchy hier: .MAKE .PHONY
# ${.CURDIR}/tools/make_libdeps.sh script.
#
libraries: .MAKE .PHONY
- ${_+_}cd ${.CURDIR} && \
- ${MAKE} -f Makefile.inc1 _prereq_libs && \
- ${MAKE} -f Makefile.inc1 _startup_libs && \
- ${MAKE} -f Makefile.inc1 _prebuild_libs && \
+ ${_+_}cd ${.CURDIR}; \
+ ${MAKE} -f Makefile.inc1 _prereq_libs; \
+ ${MAKE} -f Makefile.inc1 _startup_libs; \
+ ${MAKE} -f Makefile.inc1 _prebuild_libs; \
${MAKE} -f Makefile.inc1 _generic_libs
#
@@ -1819,6 +1829,7 @@ _prebuild_libs+= lib/libc++
.endif
lib/libgeom__L: lib/libexpat__L
+lib/libkvm__L: lib/libelf__L
.if ${MK_LIBTHR} != "no"
_lib_libthr= lib/libthr
@@ -1956,11 +1967,11 @@ gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
${_lib}__PL: .PHONY .MAKE
.if exists(${.CURDIR}/${_lib})
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
- cd ${.CURDIR}/${_lib} && \
- ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \
- ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \
+ cd ${.CURDIR}/${_lib}; \
+ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
+ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
- DIRPRFX=${_lib}/ all && \
+ DIRPRFX=${_lib}/ all; \
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \
DIRPRFX=${_lib}/ install
.endif
@@ -1970,10 +1981,10 @@ ${_lib}__PL: .PHONY .MAKE
${_lib}__L: .PHONY .MAKE
.if exists(${.CURDIR}/${_lib})
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
- cd ${.CURDIR}/${_lib} && \
- ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj && \
- ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend && \
- ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all && \
+ cd ${.CURDIR}/${_lib}; \
+ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; \
+ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ depend; \
+ ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ all; \
${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ install
.endif
.endfor
@@ -1983,11 +1994,11 @@ ${_lib}__L: .PHONY .MAKE
# modules.
lib/libpam__L: .PHONY .MAKE
${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
- cd ${.CURDIR}/lib/libpam && \
- ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj && \
- ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend && \
+ cd ${.CURDIR}/lib/libpam; \
+ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ obj; \
+ ${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ depend; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
- -D_NO_LIBPAM_SO_YET all && \
+ -D_NO_LIBPAM_SO_YET all; \
${MAKE} MK_TESTS=no DIRPRFX=lib/libpam/ \
-D_NO_LIBPAM_SO_YET install
@@ -1996,16 +2007,15 @@ _startup_libs: ${_startup_libs:S/$/__L/}
_prebuild_libs: ${_prebuild_libs:S/$/__L/}
_generic_libs: ${_generic_libs:S/$/__L/}
-# Enable SUBDIR_PARALLEL when not calling 'make all', unless called as
-# 'par-all'. This is because it is unlikely that running 'make all' from
-# the top-level, especially with a SUBDIR_OVERRIDE or LOCAL_DIRS set,
-# will have a reliable build if SUBDIRs are built in parallel. This is
-# safe for the world stage of buildworld though since it has already
-# built libraries in a proper order and installed includes into WORLDTMP.
-# Special handling is done for SUBDIR ordering for 'install*' to avoid
-# trashing a system if it crashes mid-install.
-par-all: all .PHONY
-.if !make(all)
+# Enable SUBDIR_PARALLEL when not calling 'make all', unless called from
+# 'everything' with _PARALLEL_SUBUDIR_OK set. This is because it is unlikely
+# that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
+# or LOCAL_DIRS set, will have a reliable build if SUBDIRs are built in
+# parallel. This is safe for the world stage of buildworld though since it has
+# already built libraries in a proper order and installed includes into
+# WORLDTMP. Special handling is done for SUBDIR ordering for 'install*' to
+# avoid trashing a system if it crashes mid-install.
+.if !make(all) || defined(_PARALLEL_SUBUDIR_OK)
SUBDIR_PARALLEL=
.endif
@@ -2282,10 +2292,10 @@ _xb-bootstrap-tools: .PHONY
${_clang_tblgen} \
${_gperf}
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
- cd ${.CURDIR}/${_tool} && \
- ${CDMAKE} DIRPRFX=${_tool}/ obj && \
- ${CDMAKE} DIRPRFX=${_tool}/ depend && \
- ${CDMAKE} DIRPRFX=${_tool}/ all && \
+ cd ${.CURDIR}/${_tool}; \
+ ${CDMAKE} DIRPRFX=${_tool}/ obj; \
+ ${CDMAKE} DIRPRFX=${_tool}/ depend; \
+ ${CDMAKE} DIRPRFX=${_tool}/ all; \
${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
.endfor
@@ -2302,9 +2312,9 @@ _xb-cross-tools: .PHONY
${_clang} \
${_cc}
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
- cd ${.CURDIR}/${_tool} && \
- ${CDMAKE} DIRPRFX=${_tool}/ obj && \
- ${CDMAKE} DIRPRFX=${_tool}/ depend && \
+ cd ${.CURDIR}/${_tool}; \
+ ${CDMAKE} DIRPRFX=${_tool}/ obj; \
+ ${CDMAKE} DIRPRFX=${_tool}/ depend; \
${CDMAKE} DIRPRFX=${_tool}/ all
.endfor
@@ -2345,9 +2355,7 @@ _xi-cross-tools: .PHONY
.endfor
_xi-includes: .PHONY
- ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 buildincludes \
- DESTDIR=${XDDESTDIR}
- ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 installincludes \
+ ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 includes \
DESTDIR=${XDDESTDIR}
_xi-libraries: .PHONY
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index ab67627..a07758b 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -38,6 +38,8 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20151130: libelf moved from /usr/lib to /lib (libkvm dependency in r291406)
+OLD_LIBS+=usr/lib/libelf.so.2
# 20151115: Fox bad upgrade scheme
OLD_FILES+=usr/share/locale/zh_CN.GB18030/zh_Hans_CN.GB18030
OLD_FILES+=usr/share/locale/zh_CN.GB2312/zh_Hans_CN.GB2312
diff --git a/UPDATING b/UPDATING
index 8c4ca72..4169a10 100644
--- a/UPDATING
+++ b/UPDATING
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20151130:
+ r291527 changed the internal interface between the nfsd.ko and
+ nfscommon.ko modules. As such, they must both be upgraded to-gether.
+ __FreeBSD_version has been bumped because of this.
+
20151108:
Add support for unicode collation strings leads to a change of
order of files listed by ls(1) for example. To get back to the old
@@ -844,14 +849,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
keep 64-bits counters. Thus all tools, that work with networking
statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.)
-20130629:
- Fix targets that run multiple make's to use && rather than ;
- so that subsequent steps depend on success of previous.
-
- NOTE: if building 'universe' with -j* on stable/8 or stable/9
- it would be better to start the build using bmake, to avoid
- overloading the machine.
-
20130618:
Fix a bug that allowed a tracing process (e.g. gdb) to write
to a memory-mapped file in the traced process's address space
diff --git a/bin/df/df.1 b/bin/df/df.1
index 046247a..823e585 100644
--- a/bin/df/df.1
+++ b/bin/df/df.1
@@ -29,7 +29,7 @@
.\" @(#)df.1 8.3 (Berkeley) 5/8/95
.\" $FreeBSD$
.\"
-.Dd November 6, 2014
+.Dd December 1, 2015
.Dt DF 1
.Os
.Sh NAME
@@ -62,6 +62,13 @@ option below).
.Pp
The following options are available:
.Bl -tag -width indent
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl a
Show all mount points, including those that were mounted with the
.Dv MNT_IGNORE
diff --git a/bin/ls/ls.1 b/bin/ls/ls.1
index 6bca9aa..16ad49b 100644
--- a/bin/ls/ls.1
+++ b/bin/ls/ls.1
@@ -32,7 +32,7 @@
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
.\" $FreeBSD$
.\"
-.Dd September 27, 2015
+.Dd December 1, 2015
.Dt LS 1
.Os
.Sh NAME
@@ -69,6 +69,13 @@ lexicographical order.
.Pp
The following options are available:
.Bl -tag -width indent
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl A
Include directory entries whose names begin with a
dot
diff --git a/bin/pkill/Makefile.depend b/bin/pkill/Makefile.depend
index 2940edd..35df7dc 100644
--- a/bin/pkill/Makefile.depend
+++ b/bin/pkill/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libjail \
lib/libkvm \
diff --git a/bin/ps/Makefile.depend b/bin/ps/Makefile.depend
index 15f0d5c..1576eff 100644
--- a/bin/ps/Makefile.depend
+++ b/bin/ps/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libjail \
lib/libkvm \
lib/libutil \
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 240fa20..e00d313 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd May 27, 2015
+.Dd December 1, 2015
.Dt PS 1
.Os
.Sh NAME
@@ -103,6 +103,13 @@ and associated command.
.Pp
The options are as follows:
.Bl -tag -width indent
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl a
Display information about other users' processes as well as your own.
If the
@@ -135,7 +142,7 @@ column is not the last column displayed.
.It Fl e
Display the environment as well.
.It Fl f
-Show commandline and environment information about swapped out processes.
+Show command-line and environment information about swapped out processes.
This option is honored only if the UID of the user is 0.
.It Fl G
Display information about processes which are running with the specified
diff --git a/bin/sh/tests/parameters/Makefile b/bin/sh/tests/parameters/Makefile
index 231ed4d..d496492 100644
--- a/bin/sh/tests/parameters/Makefile
+++ b/bin/sh/tests/parameters/Makefile
@@ -20,6 +20,7 @@ FILES+= positional4.0
FILES+= positional5.0
FILES+= positional6.0
FILES+= positional7.0
+FILES+= positional8.0
FILES+= pwd1.0
FILES+= pwd2.0
diff --git a/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c b/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
index 8dfb0ba..e21567b 100644
--- a/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
+++ b/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
@@ -515,7 +515,7 @@ getsym(struct ps_prochandle *P, uintptr_t addr, char *buf, size_t size,
if (P == NULL || Pxlookup_by_addr(P, addr, name, sizeof (name),
&sym, &info) != 0) {
- (void) snprintf(buf, size, "%#lx", addr);
+ (void) snprintf(buf, size, "%#lx", (unsigned long)addr);
return (0);
}
#ifdef illumos
@@ -537,7 +537,7 @@ getsym(struct ps_prochandle *P, uintptr_t addr, char *buf, size_t size,
size -= len;
if (sym.st_value != addr)
- len = snprintf(buf, size, "+%#lx", addr - sym.st_value);
+ len = snprintf(buf, size, "+%#lx", (unsigned long)(addr - sym.st_value));
if (nolocks && strcmp("libc.so.1", map->pr_mapname) == 0 &&
(strstr("mutex", name) == 0 ||
diff --git a/cddl/lib/drti/Makefile b/cddl/lib/drti/Makefile
index c715809..b62d2c2 100644
--- a/cddl/lib/drti/Makefile
+++ b/cddl/lib/drti/Makefile
@@ -9,8 +9,8 @@ FILESGRP= ${LIBGRP}
FILESMODE= ${LIBMODE}
FILESDIR= ${LIBDIR}/dtrace
CLEANFILES= ${FILES}
-LIB= drti-dummy
-INTERNALLIB=
+# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
+.undef LIBRARIES_ONLY
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
@@ -20,10 +20,4 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
-DPIC ${PICFLAG}
-.if make(install) && defined(LIBRARIES_ONLY)
-install:
- ${INSTALL} -o ${FILESOWN} -g ${FILESGRP} -m ${FILESMODE} \
- ${FILES} ${DESTDIR}${FILESDIR}
-.endif
-
.include <bsd.lib.mk>
diff --git a/cddl/lib/libctf/Makefile b/cddl/lib/libctf/Makefile
index d8a645e..a79aef5 100644
--- a/cddl/lib/libctf/Makefile
+++ b/cddl/lib/libctf/Makefile
@@ -28,8 +28,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
-I${OPENSOLARIS_SYS_DISTDIR}/uts/common
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD+= z
.include <bsd.lib.mk>
-
diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile
index b960c9e..9af9674 100644
--- a/cddl/lib/libzfs/Makefile
+++ b/cddl/lib/libzfs/Makefile
@@ -6,13 +6,7 @@
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
LIB= zfs
-DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \
- ${LIBAVL} ${LIBZFS_CORE} ${LIBUUTIL} ${LIBBSDXML} ${LIBGEOM} \
- ${LIBNVPAIR} ${LIBZ}
-
-LDADD= -lmd -lpthread -lumem -lutil -luutil -lm -lnvpair -lavl \
- -lbsdxml -lgeom -lnvpair -lz -lzfs_core
-
+LIBADD= md pthread umem util uutil m avl bsdxml geom nvpair z zfs_core
SRCS= deviceid.c \
fsshare.c \
mkdirp.c \
diff --git a/cddl/lib/libzfs/Makefile.depend b/cddl/lib/libzfs/Makefile.depend
index be130df..d1ae9c3 100644
--- a/cddl/lib/libzfs/Makefile.depend
+++ b/cddl/lib/libzfs/Makefile.depend
@@ -19,6 +19,7 @@ DIRDEPS = \
lib/libmd \
lib/libthr \
lib/libutil \
+ lib/libz \
lib/msun \
diff --git a/cddl/lib/libzfs_core/Makefile b/cddl/lib/libzfs_core/Makefile
index 99ab34d..12d06d9 100644
--- a/cddl/lib/libzfs_core/Makefile
+++ b/cddl/lib/libzfs_core/Makefile
@@ -7,8 +7,7 @@
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common
LIB= zfs_core
-DPADD= ${LIBNVPAIR}
-LDADD= -lnvpair
+LIBADD= nvpair
SRCS= libzfs_core.c \
libzfs_core_compat.c \
diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
index b80af04..b305315 100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@ -56,9 +56,7 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread
CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys
CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include
-DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBZ} ${LIBNVPAIR} \
- ${LIBAVL} ${LIBUMEM}
-LDADD= -lmd -lpthread -lz -lnvpair -lavl -lumem
+LIBADD= md pthread z nvpair avl umem
# atomic.S doesn't like profiling.
MK_PROFILE= no
diff --git a/cddl/sbin/zfs/Makefile b/cddl/sbin/zfs/Makefile
index a49d278..b1a104c 100644
--- a/cddl/sbin/zfs/Makefile
+++ b/cddl/sbin/zfs/Makefile
@@ -22,8 +22,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
-DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \
- ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
-LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
+LIBADD= geom jail nvpair umem util uutil zfs_core zfs
.include <bsd.prog.mk>
diff --git a/cddl/sbin/zfs/Makefile.depend b/cddl/sbin/zfs/Makefile.depend
index 03bb95d..dc8a013 100644
--- a/cddl/sbin/zfs/Makefile.depend
+++ b/cddl/sbin/zfs/Makefile.depend
@@ -22,6 +22,7 @@ DIRDEPS = \
lib/libsbuf \
lib/libthr \
lib/libutil \
+ lib/libz \
lib/msun \
diff --git a/cddl/sbin/zpool/Makefile b/cddl/sbin/zpool/Makefile
index bfcb017..11adad2 100644
--- a/cddl/sbin/zpool/Makefile
+++ b/cddl/sbin/zpool/Makefile
@@ -27,8 +27,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common
-DPADD= ${LIBAVL} ${LIBGEOM} ${LIBNVPAIR} \
- ${LIBUMEM} ${LIBUTIL} ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS}
-LDADD= -lavl -lgeom -lnvpair -lumem -lutil -luutil -lzfs_core -lzfs
+LIBADD= avl geom nvpair umem util uutil zfs_core zfs
.include <bsd.prog.mk>
diff --git a/cddl/sbin/zpool/Makefile.depend b/cddl/sbin/zpool/Makefile.depend
index 08245ad..b1a2eff 100644
--- a/cddl/sbin/zpool/Makefile.depend
+++ b/cddl/sbin/zpool/Makefile.depend
@@ -21,6 +21,7 @@ DIRDEPS = \
lib/libsbuf \
lib/libthr \
lib/libutil \
+ lib/libz \
lib/msun \
diff --git a/cddl/usr.bin/ctfconvert/Makefile.depend b/cddl/usr.bin/ctfconvert/Makefile.depend
index 5331c43..9dafcb6 100644
--- a/cddl/usr.bin/ctfconvert/Makefile.depend
+++ b/cddl/usr.bin/ctfconvert/Makefile.depend
@@ -2,14 +2,12 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
- cddl/lib/libctf \
gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
- lib/libc_nonshared \
lib/libcompiler_rt \
lib/libdwarf \
lib/libelf \
diff --git a/cddl/usr.bin/ctfdump/Makefile.depend b/cddl/usr.bin/ctfdump/Makefile.depend
index fcfe6ac..ff9d795 100644
--- a/cddl/usr.bin/ctfdump/Makefile.depend
+++ b/cddl/usr.bin/ctfdump/Makefile.depend
@@ -8,10 +8,8 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
- lib/libc_nonshared \
lib/libcompiler_rt \
lib/libelf \
- lib/libthr \
lib/libz \
diff --git a/cddl/usr.bin/ctfmerge/Makefile.depend b/cddl/usr.bin/ctfmerge/Makefile.depend
index 5331c43..e94f8d4 100644
--- a/cddl/usr.bin/ctfmerge/Makefile.depend
+++ b/cddl/usr.bin/ctfmerge/Makefile.depend
@@ -2,16 +2,13 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
- cddl/lib/libctf \
gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
- lib/libc_nonshared \
lib/libcompiler_rt \
- lib/libdwarf \
lib/libelf \
lib/libthr \
lib/libz \
diff --git a/cddl/usr.bin/zinject/Makefile b/cddl/usr.bin/zinject/Makefile
index 008788b..68ca78d 100644
--- a/cddl/usr.bin/zinject/Makefile
+++ b/cddl/usr.bin/zinject/Makefile
@@ -21,8 +21,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBUUTIL} \
- ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
-LDADD= -lgeom -lm -lnvpair -lumem -luutil -lzfs_core -lzfs -lzpool
+LIBADD= geom m nvpair umem uutil zfs_core zfs zpool
.include <bsd.prog.mk>
diff --git a/cddl/usr.bin/zstreamdump/Makefile b/cddl/usr.bin/zstreamdump/Makefile
index 304ff7c..e6b7b90 100644
--- a/cddl/usr.bin/zstreamdump/Makefile
+++ b/cddl/usr.bin/zstreamdump/Makefile
@@ -18,9 +18,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
- ${LIBPTHREAD} ${LIBZ} ${LIBAVL}
-LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl
+LIBADD= m nvpair umem zpool pthread z avl
CSTD= c99
diff --git a/cddl/usr.bin/ztest/Makefile b/cddl/usr.bin/ztest/Makefile
index 0865226..1b3430b 100644
--- a/cddl/usr.bin/ztest/Makefile
+++ b/cddl/usr.bin/ztest/Makefile
@@ -18,10 +18,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
- ${LIBPTHREAD} ${LIBAVL} ${LIBZFS_CORE} ${LIBZFS} ${LIBUUTIL}
-LDADD= -lgeom -lm -lnvpair -lumem -lzpool -lpthread -lavl -lzfs_core -lzfs \
- -luutil
+LIBADD= geom m nvpair umem zpool pthread avl zfs_core zfs uutil
CSTD= c99
diff --git a/cddl/usr.sbin/Makefile b/cddl/usr.sbin/Makefile
index 31b55b6..3610c4e 100644
--- a/cddl/usr.sbin/Makefile
+++ b/cddl/usr.sbin/Makefile
@@ -25,10 +25,8 @@ _zhack= zhack
_dtrace= dtrace
_dtruss= dtruss
_lockstat= lockstat
-.if defined(WITH_PLOCKSTAT)
_plockstat= plockstat
.endif
-.endif
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
_dtrace= dtrace
diff --git a/cddl/usr.sbin/dtrace/Makefile b/cddl/usr.sbin/dtrace/Makefile
index 551f6cf..ec41c60 100644
--- a/cddl/usr.sbin/dtrace/Makefile
+++ b/cddl/usr.sbin/dtrace/Makefile
@@ -22,7 +22,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
#CFLAGS+= -DNEED_ERRLOC
#YFLAGS+= -d
-LIBADD= dtrace
+LIBADD= dtrace ctf elf proc
.if ${MK_DTRACE_TESTS} != "no"
SUBDIR+= tests
diff --git a/cddl/usr.sbin/dtrace/Makefile.depend b/cddl/usr.sbin/dtrace/Makefile.depend
index 9971af1..8197069 100644
--- a/cddl/usr.sbin/dtrace/Makefile.depend
+++ b/cddl/usr.sbin/dtrace/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
- lib/libc_nonshared \
lib/libcompiler_rt \
lib/libcxxrt \
lib/libelf \
@@ -18,9 +17,7 @@ DIRDEPS = \
lib/librtld_db \
lib/libthr \
lib/libutil \
- lib/liby \
lib/libz \
- usr.bin/lex/lib \
.include <dirdeps.mk>
diff --git a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
index 596474c..6ca6b58 100644
--- a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
@@ -24,7 +24,6 @@ CFILES= \
tst.sigwait.c \
-LDADD.tst.sigwait.exe+= -lrt
-DPADD.tst.sigwait.exe+= ${LIBRT}
+LIBADD.tst.sigwait.exe=rt
.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
index ec3ad24..fda81fb 100755
--- a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
+++ b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
@@ -36,8 +36,7 @@ genmakefile()
local special
if [ "$basedir" = proc ]; then
special="
-LDADD.tst.sigwait.exe+= -lrt
-DPADD.tst.sigwait.exe+= \${LIBRT}
+LIBADD.tst.sigwait.exe+= rt
"
elif [ "$basedir" = uctf ]; then
special="
diff --git a/cddl/usr.sbin/plockstat/Makefile.depend b/cddl/usr.sbin/plockstat/Makefile.depend
new file mode 100644
index 0000000..8197069
--- /dev/null
+++ b/cddl/usr.sbin/plockstat/Makefile.depend
@@ -0,0 +1,27 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ cddl/lib/libctf \
+ cddl/lib/libdtrace \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libcxxrt \
+ lib/libelf \
+ lib/libproc \
+ lib/librtld_db \
+ lib/libthr \
+ lib/libutil \
+ lib/libz \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile
index 0e2ec8f..4fbcaea 100644
--- a/cddl/usr.sbin/zdb/Makefile
+++ b/cddl/usr.sbin/zdb/Makefile
@@ -24,9 +24,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
- ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
-LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
+LIBADD= geom m nvpair pthread umem uutil zfs_core zfs zpool
# Since there are many asserts in this program, it makes no sense to compile
# it without debugging.
diff --git a/cddl/usr.sbin/zhack/Makefile b/cddl/usr.sbin/zhack/Makefile
index 8064cf1..c42a49e 100644
--- a/cddl/usr.sbin/zhack/Makefile
+++ b/cddl/usr.sbin/zhack/Makefile
@@ -23,9 +23,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head
CFLAGS+= -I${.CURDIR}/../../lib/libumem
-DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
- ${LIBUUTIL} ${LIBZFS_CORE} ${LIBZFS} ${LIBZPOOL}
-LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs_core -lzfs -lzpool
+LIBADD= geom m nvpair pthread umem uutil zfs_core zfs zpool
CFLAGS+= -DDEBUG=1
#DEBUG_FLAGS+= -g
diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c
index a1e1931..f197403 100644
--- a/contrib/elftoolchain/readelf/readelf.c
+++ b/contrib/elftoolchain/readelf/readelf.c
@@ -332,6 +332,7 @@ static const char *note_type_gnu(unsigned int nt);
static const char *note_type_netbsd(unsigned int nt);
static const char *note_type_openbsd(unsigned int nt);
static const char *note_type_unknown(unsigned int nt);
+static const char *note_type_xen(unsigned int nt);
static const char *option_kind(uint8_t kind);
static const char *phdr_type(unsigned int ptype);
static const char *ppc_abi_fp(uint64_t fp);
@@ -1585,6 +1586,8 @@ note_type(const char *name, unsigned int et, unsigned int nt)
return note_type_netbsd(nt);
else if (strcmp(name, "OpenBSD") == 0 && et != ET_CORE)
return note_type_openbsd(nt);
+ else if (strcmp(name, "Xen") == 0 && et != ET_CORE)
+ return note_type_xen(nt);
return note_type_unknown(nt);
}
@@ -1693,6 +1696,32 @@ note_type_unknown(unsigned int nt)
return (s_nt);
}
+static const char *
+note_type_xen(unsigned int nt)
+{
+ switch (nt) {
+ case 0: return "XEN_ELFNOTE_INFO";
+ case 1: return "XEN_ELFNOTE_ENTRY";
+ case 2: return "XEN_ELFNOTE_HYPERCALL_PAGE";
+ case 3: return "XEN_ELFNOTE_VIRT_BASE";
+ case 4: return "XEN_ELFNOTE_PADDR_OFFSET";
+ case 5: return "XEN_ELFNOTE_XEN_VERSION";
+ case 6: return "XEN_ELFNOTE_GUEST_OS";
+ case 7: return "XEN_ELFNOTE_GUEST_VERSION";
+ case 8: return "XEN_ELFNOTE_LOADER";
+ case 9: return "XEN_ELFNOTE_PAE_MODE";
+ case 10: return "XEN_ELFNOTE_FEATURES";
+ case 11: return "XEN_ELFNOTE_BSD_SYMTAB";
+ case 12: return "XEN_ELFNOTE_HV_START_LOW";
+ case 13: return "XEN_ELFNOTE_L1_MFN_VALID";
+ case 14: return "XEN_ELFNOTE_SUSPEND_CANCEL";
+ case 15: return "XEN_ELFNOTE_INIT_P2M";
+ case 16: return "XEN_ELFNOTE_MOD_START_PFN";
+ case 17: return "XEN_ELFNOTE_SUPPORTED_FEATURES";
+ default: return (note_type_unknown(nt));
+ }
+}
+
static struct {
const char *name;
int value;
diff --git a/contrib/llvm/patches/patch-10-clang-cc1as-dwarf2.diff b/contrib/llvm/patches/patch-10-clang-cc1as-dwarf2.diff
new file mode 100644
index 0000000..eb00168
--- /dev/null
+++ b/contrib/llvm/patches/patch-10-clang-cc1as-dwarf2.diff
@@ -0,0 +1,21 @@
+In assembler mode, clang defaulted to DWARF3, if only -g was specified.
+Change this to DWARF2, in the simplest way possible. (Upstream, this
+was fixed in clang trunk r250173, but this was done along with a lot of
+shuffling around of debug option handling, so it cannot be applied
+as-is.)
+
+Introduced here: https://svnweb.freebsd.org/changeset/base/291701
+
+Index: tools/clang/tools/driver/cc1as_main.cpp
+===================================================================
+--- tools/clang/tools/driver/cc1as_main.cpp
++++ tools/clang/tools/driver/cc1as_main.cpp
+@@ -141,7 +141,7 @@ struct AssemblerInvocation {
+ RelaxAll = 0;
+ NoExecStack = 0;
+ FatalWarnings = 0;
+- DwarfVersion = 3;
++ DwarfVersion = 2;
+ }
+
+ static bool CreateFromArgs(AssemblerInvocation &Res,
diff --git a/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp b/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp
index fd0fbb4..9068ac1 100644
--- a/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp
+++ b/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp
@@ -141,7 +141,7 @@ public:
RelaxAll = 0;
NoExecStack = 0;
FatalWarnings = 0;
- DwarfVersion = 3;
+ DwarfVersion = 2;
}
static bool CreateFromArgs(AssemblerInvocation &Res,
diff --git a/contrib/netbsd-tests/lib/libcrypt/t_crypt.c b/contrib/netbsd-tests/lib/libcrypt/t_crypt.c
index a5a4dcb..9b47692 100644
--- a/contrib/netbsd-tests/lib/libcrypt/t_crypt.c
+++ b/contrib/netbsd-tests/lib/libcrypt/t_crypt.c
@@ -124,11 +124,13 @@ ATF_TC_HEAD(crypt_salts, tc)
ATF_TC_BODY(crypt_salts, tc)
{
for (size_t i = 0; tests[i].hash; i++) {
+ char *hash = crypt(tests[i].pw, tests[i].hash);
#if defined(__FreeBSD__)
- if (22 <= i)
+ if (i >= 22 && i != 24 && i != 25)
atf_tc_expect_fail("Old-style/bad inputs fail on FreeBSD");
+ else
+ atf_tc_expect_pass();
#endif
- char *hash = crypt(tests[i].pw, tests[i].hash);
if (!hash) {
ATF_CHECK_MSG(0, "Test %zu NULL\n", i);
continue;
diff --git a/contrib/ofed/usr.bin/osmtest/Makefile b/contrib/ofed/usr.bin/osmtest/Makefile
index fef67a0..038d1db1 100644
--- a/contrib/ofed/usr.bin/osmtest/Makefile
+++ b/contrib/ofed/usr.bin/osmtest/Makefile
@@ -22,7 +22,8 @@ LDADD= -libcommon \
-losmvendor \
-losmcomp \
-lopensm \
- -lpthread
+
+LIBADD+= pthread
CFLAGS= -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP \
-I${OPENSM}/osmtest/include
diff --git a/contrib/wpa/src/drivers/driver_bsd.c b/contrib/wpa/src/drivers/driver_bsd.c
index 9d3b5e6..73f455f 100644
--- a/contrib/wpa/src/drivers/driver_bsd.c
+++ b/contrib/wpa/src/drivers/driver_bsd.c
@@ -1055,7 +1055,14 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
mode = 0 /* STA */;
break;
case IEEE80211_MODE_IBSS:
+ /*
+ * Ref bin/203086 - FreeBSD's net80211 currently uses
+ * IFM_IEEE80211_ADHOC.
+ */
+#if 0
mode = IFM_IEEE80211_IBSS;
+#endif
+ mode = IFM_IEEE80211_ADHOC;
break;
case IEEE80211_MODE_AP:
mode = IFM_IEEE80211_HOSTAP;
@@ -1102,6 +1109,13 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0)
return -1;
+ /*
+ * NB: interface must be marked UP for association
+ * or scanning (ap_scan=2)
+ */
+ if (bsd_ctrl_iface(drv, 1) < 0)
+ return -1;
+
os_memset(&mlme, 0, sizeof(mlme));
mlme.im_op = IEEE80211_MLME_ASSOC;
if (params->ssid != NULL)
diff --git a/crypto/openssh/pathnames.h b/crypto/openssh/pathnames.h
index ec89fc6..e53d67a 100644
--- a/crypto/openssh/pathnames.h
+++ b/crypto/openssh/pathnames.h
@@ -1,4 +1,5 @@
/* $OpenBSD: pathnames.h,v 1.24 2013/12/06 13:39:49 markus Exp $ */
+/* $FreeBSD$ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -121,7 +122,7 @@
* Default location of askpass
*/
#ifndef _PATH_SSH_ASKPASS_DEFAULT
-#define _PATH_SSH_ASKPASS_DEFAULT "/usr/X11R6/bin/ssh-askpass"
+#define _PATH_SSH_ASKPASS_DEFAULT "/usr/local/bin/ssh-askpass"
#endif
/* Location of ssh-keysign for hostbased authentication */
@@ -136,7 +137,7 @@
/* xauth for X11 forwarding */
#ifndef _PATH_XAUTH
-#define _PATH_XAUTH "/usr/X11R6/bin/xauth"
+#define _PATH_XAUTH "/usr/local/bin/xauth"
#endif
/* UNIX domain socket for X11 server; displaynum will replace %u */
diff --git a/crypto/openssl/CHANGES b/crypto/openssl/CHANGES
index 5d4c234..5e9225b 100644
--- a/crypto/openssl/CHANGES
+++ b/crypto/openssl/CHANGES
@@ -2,6 +2,64 @@
OpenSSL CHANGES
_______________
+ Changes between 1.0.2d and 1.0.2e [3 Dec 2015]
+
+ *) BN_mod_exp may produce incorrect results on x86_64
+
+ There is a carry propagating bug in the x86_64 Montgomery squaring
+ procedure. No EC algorithms are affected. Analysis suggests that attacks
+ against RSA and DSA as a result of this defect would be very difficult to
+ perform and are not believed likely. Attacks against DH are considered just
+ feasible (although very difficult) because most of the work necessary to
+ deduce information about a private key may be performed offline. The amount
+ of resources required for such an attack would be very significant and
+ likely only accessible to a limited number of attackers. An attacker would
+ additionally need online access to an unpatched system using the target
+ private key in a scenario with persistent DH parameters and a private
+ key that is shared between multiple clients. For example this can occur by
+ default in OpenSSL DHE based SSL/TLS ciphersuites.
+
+ This issue was reported to OpenSSL by Hanno Böck.
+ (CVE-2015-3193)
+ [Andy Polyakov]
+
+ *) Certificate verify crash with missing PSS parameter
+
+ The signature verification routines will crash with a NULL pointer
+ dereference if presented with an ASN.1 signature using the RSA PSS
+ algorithm and absent mask generation function parameter. Since these
+ routines are used to verify certificate signature algorithms this can be
+ used to crash any certificate verification operation and exploited in a
+ DoS attack. Any application which performs certificate verification is
+ vulnerable including OpenSSL clients and servers which enable client
+ authentication.
+
+ This issue was reported to OpenSSL by Loïc Jonas Etienne (Qnective AG).
+ (CVE-2015-3194)
+ [Stephen Henson]
+
+ *) X509_ATTRIBUTE memory leak
+
+ When presented with a malformed X509_ATTRIBUTE structure OpenSSL will leak
+ memory. This structure is used by the PKCS#7 and CMS routines so any
+ application which reads PKCS#7 or CMS data from untrusted sources is
+ affected. SSL/TLS is not affected.
+
+ This issue was reported to OpenSSL by Adam Langley (Google/BoringSSL) using
+ libFuzzer.
+ (CVE-2015-3195)
+ [Stephen Henson]
+
+ *) Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs.
+ This changes the decoding behaviour for some invalid messages,
+ though the change is mostly in the more lenient direction, and
+ legacy behaviour is preserved as much as possible.
+ [Emilia Käsper]
+
+ *) In DSA_generate_parameters_ex, if the provided seed is too short,
+ return an error
+ [Rich Salz and Ismo Puustinen <ismo.puustinen@intel.com>]
+
Changes between 1.0.2c and 1.0.2d [9 Jul 2015]
*) Alternate chains certificate forgery
@@ -15,8 +73,18 @@
This issue was reported to OpenSSL by Adam Langley/David Benjamin
(Google/BoringSSL).
+ (CVE-2015-1793)
[Matt Caswell]
+ *) Race condition handling PSK identify hint
+
+ If PSK identity hints are received by a multi-threaded client then
+ the values are wrongly updated in the parent SSL_CTX structure. This can
+ result in a race condition potentially leading to a double free of the
+ identify hint data.
+ (CVE-2015-3196)
+ [Stephen Henson]
+
Changes between 1.0.2b and 1.0.2c [12 Jun 2015]
*) Fix HMAC ABI incompatibility. The previous version introduced an ABI
@@ -55,9 +123,9 @@
callbacks.
This issue was reported to OpenSSL by Robert Swiecki (Google), and
- independently by Hanno Böck.
+ independently by Hanno Böck.
(CVE-2015-1789)
- [Emilia Käsper]
+ [Emilia Käsper]
*) PKCS7 crash with missing EnvelopedContent
@@ -71,7 +139,7 @@
This issue was reported to OpenSSL by Michal Zalewski (Google).
(CVE-2015-1790)
- [Emilia Käsper]
+ [Emilia Käsper]
*) CMS verify infinite loop with unknown hash function
@@ -201,7 +269,7 @@
This issue was reported to OpenSSL by Michal Zalewski (Google).
(CVE-2015-0289)
- [Emilia Käsper]
+ [Emilia Käsper]
*) DoS via reachable assert in SSLv2 servers fix
@@ -209,10 +277,10 @@
servers that both support SSLv2 and enable export cipher suites by sending
a specially crafted SSLv2 CLIENT-MASTER-KEY message.
- This issue was discovered by Sean Burford (Google) and Emilia Käsper
+ This issue was discovered by Sean Burford (Google) and Emilia Käsper
(OpenSSL development team).
(CVE-2015-0293)
- [Emilia Käsper]
+ [Emilia Käsper]
*) Empty CKE with client auth and DHE fix
@@ -272,6 +340,10 @@
Changes between 1.0.1l and 1.0.2 [22 Jan 2015]
+ *) Change RSA and DH/DSA key generation apps to generate 2048-bit
+ keys by default.
+ [Kurt Roeckx]
+
*) Facilitate "universal" ARM builds targeting range of ARM ISAs, e.g.
ARMv5 through ARMv8, as opposite to "locking" it to single one.
So far those who have to target multiple plaforms would compromise
@@ -717,12 +789,12 @@
version does not match the session's version. Resuming with a different
version, while not strictly forbidden by the RFC, is of questionable
sanity and breaks all known clients.
- [David Benjamin, Emilia Käsper]
+ [David Benjamin, Emilia Käsper]
*) Tighten handling of the ChangeCipherSpec (CCS) message: reject
early CCS messages during renegotiation. (Note that because
renegotiation is encrypted, this early CCS was not exploitable.)
- [Emilia Käsper]
+ [Emilia Käsper]
*) Tighten client-side session ticket handling during renegotiation:
ensure that the client only accepts a session ticket if the server sends
@@ -733,7 +805,7 @@
Similarly, ensure that the client requires a session ticket if one
was advertised in the ServerHello. Previously, a TLS client would
ignore a missing NewSessionTicket message.
- [Emilia Käsper]
+ [Emilia Käsper]
Changes between 1.0.1i and 1.0.1j [15 Oct 2014]
@@ -813,10 +885,10 @@
with a null pointer dereference (read) by specifying an anonymous (EC)DH
ciphersuite and sending carefully crafted handshake messages.
- Thanks to Felix Gröbert (Google) for discovering and researching this
+ Thanks to Felix Gröbert (Google) for discovering and researching this
issue.
(CVE-2014-3510)
- [Emilia Käsper]
+ [Emilia Käsper]
*) By sending carefully crafted DTLS packets an attacker could cause openssl
to leak memory. This can be exploited through a Denial of Service attack.
@@ -853,7 +925,7 @@
properly negotiated with the client. This can be exploited through a
Denial of Service attack.
- Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for
+ Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for
discovering and researching this issue.
(CVE-2014-5139)
[Steve Henson]
@@ -865,7 +937,7 @@
Thanks to Ivan Fratric (Google) for discovering this issue.
(CVE-2014-3508)
- [Emilia Käsper, and Steve Henson]
+ [Emilia Käsper, and Steve Henson]
*) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.)
for corner cases. (Certain input points at infinity could lead to
@@ -895,22 +967,22 @@
client or server. This is potentially exploitable to run arbitrary
code on a vulnerable client or server.
- Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195)
- [Jüri Aedla, Steve Henson]
+ Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195)
+ [Jüri Aedla, Steve Henson]
*) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites
are subject to a denial of service attack.
- Thanks to Felix Gröbert and Ivan Fratric at Google for discovering
+ Thanks to Felix Gröbert and Ivan Fratric at Google for discovering
this issue. (CVE-2014-3470)
- [Felix Gröbert, Ivan Fratric, Steve Henson]
+ [Felix Gröbert, Ivan Fratric, Steve Henson]
*) Harmonize version and its documentation. -f flag is used to display
compilation flags.
[mancha <mancha1@zoho.com>]
*) Fix eckey_priv_encode so it immediately returns an error upon a failure
- in i2d_ECPrivateKey.
+ in i2d_ECPrivateKey. Thanks to Ted Unangst for feedback on this issue.
[mancha <mancha1@zoho.com>]
*) Fix some double frees. These are not thought to be exploitable.
@@ -982,9 +1054,9 @@
Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
Security Group at Royal Holloway, University of London
(www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
- Emilia Käsper for the initial patch.
+ Emilia Käsper for the initial patch.
(CVE-2013-0169)
- [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
+ [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
*) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode
ciphersuites which can be exploited in a denial of service attack.
@@ -1159,7 +1231,7 @@
EC_GROUP_new_by_curve_name() will automatically use these (while
EC_GROUP_new_curve_GFp() currently prefers the more flexible
implementations).
- [Emilia Käsper, Adam Langley, Bodo Moeller (Google)]
+ [Emilia Käsper, Adam Langley, Bodo Moeller (Google)]
*) Use type ossl_ssize_t instad of ssize_t which isn't available on
all platforms. Move ssize_t definition from e_os.h to the public
@@ -1435,7 +1507,7 @@
[Adam Langley (Google)]
*) Fix spurious failures in ecdsatest.c.
- [Emilia Käsper (Google)]
+ [Emilia Käsper (Google)]
*) Fix the BIO_f_buffer() implementation (which was mixing different
interpretations of the '..._len' fields).
@@ -1449,7 +1521,7 @@
lock to call BN_BLINDING_invert_ex, and avoids one use of
BN_BLINDING_update for each BN_BLINDING structure (previously,
the last update always remained unused).
- [Emilia Käsper (Google)]
+ [Emilia Käsper (Google)]
*) In ssl3_clear, preserve s3->init_extra along with s3->rbuf.
[Bob Buckholz (Google)]
@@ -2258,7 +2330,7 @@
*) Add RFC 3161 compliant time stamp request creation, response generation
and response verification functionality.
- [Zoltán Glózik <zglozik@opentsa.org>, The OpenTSA Project]
+ [Zoltán Glózik <zglozik@opentsa.org>, The OpenTSA Project]
*) Add initial support for TLS extensions, specifically for the server_name
extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now
@@ -3426,7 +3498,7 @@
*) BN_CTX_get() should return zero-valued bignums, providing the same
initialised value as BN_new().
- [Geoff Thorpe, suggested by Ulf Möller]
+ [Geoff Thorpe, suggested by Ulf Möller]
*) Support for inhibitAnyPolicy certificate extension.
[Steve Henson]
@@ -3445,7 +3517,7 @@
some point, these tighter rules will become openssl's default to improve
maintainability, though the assert()s and other overheads will remain only
in debugging configurations. See bn.h for more details.
- [Geoff Thorpe, Nils Larsch, Ulf Möller]
+ [Geoff Thorpe, Nils Larsch, Ulf Möller]
*) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure
that can only be obtained through BN_CTX_new() (which implicitly
@@ -3512,7 +3584,7 @@
[Douglas Stebila (Sun Microsystems Laboratories)]
*) Add the possibility to load symbols globally with DSO.
- [Götz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
+ [Götz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
*) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better
control of the error stack.
@@ -4227,7 +4299,7 @@
[Steve Henson]
*) Undo Cygwin change.
- [Ulf Möller]
+ [Ulf Möller]
*) Added support for proxy certificates according to RFC 3820.
Because they may be a security thread to unaware applications,
@@ -4260,11 +4332,11 @@
[Stephen Henson, reported by UK NISCC]
*) Use Windows randomness collection on Cygwin.
- [Ulf Möller]
+ [Ulf Möller]
*) Fix hang in EGD/PRNGD query when communication socket is closed
prematurely by EGD/PRNGD.
- [Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014]
+ [Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014]
*) Prompt for pass phrases when appropriate for PKCS12 input format.
[Steve Henson]
@@ -4726,7 +4798,7 @@
pointers passed to them whenever necessary. Otherwise it is possible
the caller may have overwritten (or deallocated) the original string
data when a later ENGINE operation tries to use the stored values.
- [Götz Babin-Ebell <babinebell@trustcenter.de>]
+ [Götz Babin-Ebell <babinebell@trustcenter.de>]
*) Improve diagnostics in file reading and command-line digests.
[Ben Laurie aided and abetted by Solar Designer <solar@openwall.com>]
@@ -6831,7 +6903,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller]
*) BN_sqr() bug fix.
- [Ulf Möller, reported by Jim Ellis <jim.ellis@cavium.com>]
+ [Ulf Möller, reported by Jim Ellis <jim.ellis@cavium.com>]
*) Rabin-Miller test analyses assume uniformly distributed witnesses,
so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
@@ -6991,7 +7063,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller]
*) Fix OAEP check.
- [Ulf Möller, Bodo Möller]
+ [Ulf Möller, Bodo Möller]
*) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
@@ -7253,10 +7325,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller]
*) Use better test patterns in bntest.
- [Ulf Möller]
+ [Ulf Möller]
*) rand_win.c fix for Borland C.
- [Ulf Möller]
+ [Ulf Möller]
*) BN_rshift bugfix for n == 0.
[Bodo Moeller]
@@ -7401,14 +7473,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) New BIO_shutdown_wr macro, which invokes the BIO_C_SHUTDOWN_WR
BIO_ctrl (for BIO pairs).
- [Bodo Möller]
+ [Bodo Möller]
*) Add DSO method for VMS.
[Richard Levitte]
*) Bug fix: Montgomery multiplication could produce results with the
wrong sign.
- [Ulf Möller]
+ [Ulf Möller]
*) Add RPM specification openssl.spec and modify it to build three
packages. The default package contains applications, application
@@ -7426,7 +7498,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Don't set the two most significant bits to one when generating a
random number < q in the DSA library.
- [Ulf Möller]
+ [Ulf Möller]
*) New SSL API mode 'SSL_MODE_AUTO_RETRY'. This disables the default
behaviour that SSL_read may result in SSL_ERROR_WANT_READ (even if
@@ -7692,7 +7764,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Randomness polling function for Win9x, as described in:
Peter Gutmann, Software Generation of Practically Strong
Random Numbers.
- [Ulf Möller]
+ [Ulf Möller]
*) Fix so PRNG is seeded in req if using an already existing
DSA key.
@@ -7912,7 +7984,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) Eliminate non-ANSI declarations in crypto.h and stack.h.
- [Ulf Möller]
+ [Ulf Möller]
*) Fix for SSL server purpose checking. Server checking was
rejecting certificates which had extended key usage present
@@ -7944,7 +8016,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller]
*) Bugfix for linux-elf makefile.one.
- [Ulf Möller]
+ [Ulf Möller]
*) RSA_get_default_method() will now cause a default
RSA_METHOD to be chosen if one doesn't exist already.
@@ -8033,7 +8105,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) des_quad_cksum() byte order bug fix.
- [Ulf Möller, using the problem description in krb4-0.9.7, where
+ [Ulf Möller, using the problem description in krb4-0.9.7, where
the solution is attributed to Derrick J Brashear <shadow@DEMENTIA.ORG>]
*) Fix so V_ASN1_APP_CHOOSE works again: however its use is strongly
@@ -8134,7 +8206,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Rolf Haberrecker <rolf@suse.de>]
*) Assembler module support for Mingw32.
- [Ulf Möller]
+ [Ulf Möller]
*) Shared library support for HPUX (in shlib/).
[Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous]
@@ -8153,7 +8225,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n]
case was implemented. This caused BN_div_recp() to fail occasionally.
- [Ulf Möller]
+ [Ulf Möller]
*) Add an optional second argument to the set_label() in the perl
assembly language builder. If this argument exists and is set
@@ -8183,14 +8255,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) Fix potential buffer overrun problem in BIO_printf().
- [Ulf Möller, using public domain code by Patrick Powell; problem
+ [Ulf Möller, using public domain code by Patrick Powell; problem
pointed out by David Sacerdote <das33@cornell.edu>]
*) Support EGD <http://www.lothar.com/tech/crypto/>. New functions
RAND_egd() and RAND_status(). In the command line application,
the EGD socket can be specified like a seed file using RANDFILE
or -rand.
- [Ulf Möller]
+ [Ulf Möller]
*) Allow the string CERTIFICATE to be tolerated in PKCS#7 structures.
Some CAs (e.g. Verisign) distribute certificates in this form.
@@ -8223,7 +8295,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
#define OPENSSL_ALGORITHM_DEFINES
#include <openssl/opensslconf.h>
defines all pertinent NO_<algo> symbols, such as NO_IDEA, NO_RSA, etc.
- [Richard Levitte, Ulf and Bodo Möller]
+ [Richard Levitte, Ulf and Bodo Möller]
*) Bugfix: Tolerate fragmentation and interleaving in the SSL 3/TLS
record layer.
@@ -8274,17 +8346,17 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Bug fix for BN_div_recp() for numerators with an even number of
bits.
- [Ulf Möller]
+ [Ulf Möller]
*) More tests in bntest.c, and changed test_bn output.
- [Ulf Möller]
+ [Ulf Möller]
*) ./config recognizes MacOS X now.
[Andy Polyakov]
*) Bug fix for BN_div() when the first words of num and divsor are
equal (it gave wrong results if (rem=(n1-q*d0)&BN_MASK2) < d0).
- [Ulf Möller]
+ [Ulf Möller]
*) Add support for various broken PKCS#8 formats, and command line
options to produce them.
@@ -8292,11 +8364,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) New functions BN_CTX_start(), BN_CTX_get() and BT_CTX_end() to
get temporary BIGNUMs from a BN_CTX.
- [Ulf Möller]
+ [Ulf Möller]
*) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont()
for p == 0.
- [Ulf Möller]
+ [Ulf Möller]
*) Change the SSLeay_add_all_*() functions to OpenSSL_add_all_*() and
include a #define from the old name to the new. The original intent
@@ -8320,7 +8392,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Source code cleanups: use const where appropriate, eliminate casts,
use void * instead of char * in lhash.
- [Ulf Möller]
+ [Ulf Möller]
*) Bugfix: ssl3_send_server_key_exchange was not restartable
(the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of
@@ -8365,13 +8437,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) New function BN_pseudo_rand().
- [Ulf Möller]
+ [Ulf Möller]
*) Clean up BN_mod_mul_montgomery(): replace the broken (and unreadable)
bignum version of BN_from_montgomery() with the working code from
SSLeay 0.9.0 (the word based version is faster anyway), and clean up
the comments.
- [Ulf Möller]
+ [Ulf Möller]
*) Avoid a race condition in s2_clnt.c (function get_server_hello) that
made it impossible to use the same SSL_SESSION data structure in
@@ -8381,25 +8453,25 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) The return value of RAND_load_file() no longer counts bytes obtained
by stat(). RAND_load_file(..., -1) is new and uses the complete file
to seed the PRNG (previously an explicit byte count was required).
- [Ulf Möller, Bodo Möller]
+ [Ulf Möller, Bodo Möller]
*) Clean up CRYPTO_EX_DATA functions, some of these didn't have prototypes
used (char *) instead of (void *) and had casts all over the place.
[Steve Henson]
*) Make BN_generate_prime() return NULL on error if ret!=NULL.
- [Ulf Möller]
+ [Ulf Möller]
*) Retain source code compatibility for BN_prime_checks macro:
BN_is_prime(..., BN_prime_checks, ...) now uses
BN_prime_checks_for_size to determine the appropriate number of
Rabin-Miller iterations.
- [Ulf Möller]
+ [Ulf Möller]
*) Diffie-Hellman uses "safe" primes: DH_check() return code renamed to
DH_CHECK_P_NOT_SAFE_PRIME.
(Check if this is true? OpenPGP calls them "strong".)
- [Ulf Möller]
+ [Ulf Möller]
*) Merge the functionality of "dh" and "gendh" programs into a new program
"dhparam". The old programs are retained for now but will handle DH keys
@@ -8455,7 +8527,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Add missing #ifndefs that caused missing symbols when building libssl
as a shared library without RSA. Use #ifndef NO_SSL2 instead of
NO_RSA in ssl/s2*.c.
- [Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf Möller]
+ [Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf Möller]
*) Precautions against using the PRNG uninitialized: RAND_bytes() now
has a return value which indicates the quality of the random data
@@ -8464,7 +8536,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
guaranteed to be unique but not unpredictable. RAND_add is like
RAND_seed, but takes an extra argument for an entropy estimate
(RAND_seed always assumes full entropy).
- [Ulf Möller]
+ [Ulf Möller]
*) Do more iterations of Rabin-Miller probable prime test (specifically,
3 for 1024-bit primes, 6 for 512-bit primes, 12 for 256-bit primes
@@ -8494,7 +8566,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) Honor the no-xxx Configure options when creating .DEF files.
- [Ulf Möller]
+ [Ulf Möller]
*) Add PKCS#10 attributes to field table: challengePassword,
unstructuredName and unstructuredAddress. These are taken from
@@ -9328,7 +9400,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) More DES library cleanups: remove references to srand/rand and
delete an unused file.
- [Ulf Möller]
+ [Ulf Möller]
*) Add support for the the free Netwide assembler (NASM) under Win32,
since not many people have MASM (ml) and it can be hard to obtain.
@@ -9417,7 +9489,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
worked.
*) Fix problems with no-hmac etc.
- [Ulf Möller, pointed out by Brian Wellington <bwelling@tislabs.com>]
+ [Ulf Möller, pointed out by Brian Wellington <bwelling@tislabs.com>]
*) New functions RSA_get_default_method(), RSA_set_method() and
RSA_get_method(). These allows replacement of RSA_METHODs without having
@@ -9534,7 +9606,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Ben Laurie]
*) DES library cleanups.
- [Ulf Möller]
+ [Ulf Möller]
*) Add support for PKCS#5 v2.0 PBE algorithms. This will permit PKCS#8 to be
used with any cipher unlike PKCS#5 v1.5 which can at most handle 64 bit
@@ -9577,7 +9649,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Christian Forster <fo@hawo.stw.uni-erlangen.de>]
*) config now generates no-xxx options for missing ciphers.
- [Ulf Möller]
+ [Ulf Möller]
*) Support the EBCDIC character set (work in progress).
File ebcdic.c not yet included because it has a different license.
@@ -9690,7 +9762,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller]
*) Move openssl.cnf out of lib/.
- [Ulf Möller]
+ [Ulf Möller]
*) Fix various things to let OpenSSL even pass ``egcc -pipe -O2 -Wall
-Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes
@@ -9747,10 +9819,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Ben Laurie]
*) Support Borland C++ builder.
- [Janez Jere <jj@void.si>, modified by Ulf Möller]
+ [Janez Jere <jj@void.si>, modified by Ulf Möller]
*) Support Mingw32.
- [Ulf Möller]
+ [Ulf Möller]
*) SHA-1 cleanups and performance enhancements.
[Andy Polyakov <appro@fy.chalmers.se>]
@@ -9759,7 +9831,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Andy Polyakov <appro@fy.chalmers.se>]
*) Accept any -xxx and +xxx compiler options in Configure.
- [Ulf Möller]
+ [Ulf Möller]
*) Update HPUX configuration.
[Anonymous]
@@ -9792,7 +9864,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller]
*) OAEP decoding bug fix.
- [Ulf Möller]
+ [Ulf Möller]
*) Support INSTALL_PREFIX for package builders, as proposed by
David Harris.
@@ -9815,21 +9887,21 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Niels Poppe <niels@netbox.org>]
*) New Configure option no-<cipher> (rsa, idea, rc5, ...).
- [Ulf Möller]
+ [Ulf Möller]
*) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for
extension adding in x509 utility.
[Steve Henson]
*) Remove NOPROTO sections and error code comments.
- [Ulf Möller]
+ [Ulf Möller]
*) Partial rewrite of the DEF file generator to now parse the ANSI
prototypes.
[Steve Henson]
*) New Configure options --prefix=DIR and --openssldir=DIR.
- [Ulf Möller]
+ [Ulf Möller]
*) Complete rewrite of the error code script(s). It is all now handled
by one script at the top level which handles error code gathering,
@@ -9858,7 +9930,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) Move the autogenerated header file parts to crypto/opensslconf.h.
- [Ulf Möller]
+ [Ulf Möller]
*) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of
8 of keying material. Merlin has also confirmed interop with this fix
@@ -9876,13 +9948,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Andy Polyakov <appro@fy.chalmers.se>]
*) Change functions to ANSI C.
- [Ulf Möller]
+ [Ulf Möller]
*) Fix typos in error codes.
- [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]
+ [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]
*) Remove defunct assembler files from Configure.
- [Ulf Möller]
+ [Ulf Möller]
*) SPARC v8 assembler BIGNUM implementation.
[Andy Polyakov <appro@fy.chalmers.se>]
@@ -9919,7 +9991,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) New Configure option "rsaref".
- [Ulf Möller]
+ [Ulf Möller]
*) Don't auto-generate pem.h.
[Bodo Moeller]
@@ -9967,7 +10039,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) New functions DSA_do_sign and DSA_do_verify to provide access to
the raw DSA values prior to ASN.1 encoding.
- [Ulf Möller]
+ [Ulf Möller]
*) Tweaks to Configure
[Niels Poppe <niels@netbox.org>]
@@ -9977,11 +10049,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) New variables $(RANLIB) and $(PERL) in the Makefiles.
- [Ulf Möller]
+ [Ulf Möller]
*) New config option to avoid instructions that are illegal on the 80386.
The default code is faster, but requires at least a 486.
- [Ulf Möller]
+ [Ulf Möller]
*) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and
SSL2_SERVER_VERSION (not used at all) macros, which are now the
@@ -10520,7 +10592,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
Hagino <itojun@kame.net>]
*) File was opened incorrectly in randfile.c.
- [Ulf Möller <ulf@fitug.de>]
+ [Ulf Möller <ulf@fitug.de>]
*) Beginning of support for GeneralizedTime. d2i, i2d, check and print
functions. Also ASN1_TIME suite which is a CHOICE of UTCTime or
@@ -10530,7 +10602,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson]
*) Correct Linux 1 recognition in config.
- [Ulf Möller <ulf@fitug.de>]
+ [Ulf Möller <ulf@fitug.de>]
*) Remove pointless MD5 hash when using DSA keys in ca.
[Anonymous <nobody@replay.com>]
@@ -10677,7 +10749,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Fix the RSA header declarations that hid a bug I fixed in 0.9.0b but
was already fixed by Eric for 0.9.1 it seems.
- [Ben Laurie - pointed out by Ulf Möller <ulf@fitug.de>]
+ [Ben Laurie - pointed out by Ulf Möller <ulf@fitug.de>]
*) Autodetect FreeBSD3.
[Ben Laurie]
diff --git a/crypto/openssl/CONTRIBUTING b/crypto/openssl/CONTRIBUTING
new file mode 100644
index 0000000..9d63d8a
--- /dev/null
+++ b/crypto/openssl/CONTRIBUTING
@@ -0,0 +1,38 @@
+HOW TO CONTRIBUTE TO OpenSSL
+----------------------------
+
+Development is coordinated on the openssl-dev mailing list (see
+http://www.openssl.org for information on subscribing). If you
+would like to submit a patch, send it to rt@openssl.org with
+the string "[PATCH]" in the subject. Please be sure to include a
+textual explanation of what your patch does.
+
+You can also make GitHub pull requests. If you do this, please also send
+mail to rt@openssl.org with a brief description and a link to the PR so
+that we can more easily keep track of it.
+
+If you are unsure as to whether a feature will be useful for the general
+OpenSSL community please discuss it on the openssl-dev mailing list first.
+Someone may be already working on the same thing or there may be a good
+reason as to why that feature isn't implemented.
+
+Patches should be as up to date as possible, preferably relative to the
+current Git or the last snapshot. They should follow our coding style
+(see https://www.openssl.org/policies/codingstyle.html) and compile without
+warnings using the --strict-warnings flag. OpenSSL compiles on many varied
+platforms: try to ensure you only use portable features.
+
+Our preferred format for patch files is "git format-patch" output. For example
+to provide a patch file containing the last commit in your local git repository
+use the following command:
+
+# git format-patch --stdout HEAD^ >mydiffs.patch
+
+Another method of creating an acceptable patch file without using git is as
+follows:
+
+# cd openssl-work
+# [your changes]
+# ./Configure dist; make clean
+# cd ..
+# diff -ur openssl-orig openssl-work > mydiffs.patch
diff --git a/crypto/openssl/Configure b/crypto/openssl/Configure
index d99eed7..ac86cd6 100755
--- a/crypto/openssl/Configure
+++ b/crypto/openssl/Configure
@@ -416,6 +416,7 @@ my %table=(
"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-x86_64-clang", "clang: -m64 -DL_ENDIAN -O3 -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
+"debug-linux-x86_64-clang", "clang: -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-x86_64-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
"linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
@@ -1646,21 +1647,22 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
$shlib_minor=$2;
}
+my $ecc = $cc;
+$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
+
if ($strict_warnings)
{
- my $ecc = $cc;
- $ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
my $wopt;
die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
foreach $wopt (split /\s+/, $gcc_devteam_warn)
{
- $cflags .= " $wopt" unless ($cflags =~ /$wopt/)
+ $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
}
if ($ecc eq "clang")
{
foreach $wopt (split /\s+/, $clang_devteam_warn)
{
- $cflags .= " $wopt" unless ($cflags =~ /$wopt/)
+ $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
}
}
}
@@ -1713,6 +1715,7 @@ while (<IN>)
s/^AR=\s*ar/AR= $ar/;
s/^RANLIB=.*/RANLIB= $ranlib/;
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
+ s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
}
s/^CFLAG=.*$/CFLAG= $cflags/;
s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
diff --git a/crypto/openssl/FAQ b/crypto/openssl/FAQ
index 3be8310..22c5cf7 100644
--- a/crypto/openssl/FAQ
+++ b/crypto/openssl/FAQ
@@ -1,1053 +1,2 @@
-OpenSSL - Frequently Asked Questions
---------------------------------------
-
-[MISC] Miscellaneous questions
-
-* Which is the current version of OpenSSL?
-* Where is the documentation?
-* How can I contact the OpenSSL developers?
-* Where can I get a compiled version of OpenSSL?
-* Why aren't tools like 'autoconf' and 'libtool' used?
-* What is an 'engine' version?
-* How do I check the authenticity of the OpenSSL distribution?
-* How does the versioning scheme work?
-
-[LEGAL] Legal questions
-
-* Do I need patent licenses to use OpenSSL?
-* Can I use OpenSSL with GPL software?
-
-[USER] Questions on using the OpenSSL applications
-
-* Why do I get a "PRNG not seeded" error message?
-* Why do I get an "unable to write 'random state'" error message?
-* How do I create certificates or certificate requests?
-* Why can't I create certificate requests?
-* Why does <SSL program> fail with a certificate verify error?
-* Why can I only use weak ciphers when I connect to a server using OpenSSL?
-* How can I create DSA certificates?
-* Why can't I make an SSL connection using a DSA certificate?
-* How can I remove the passphrase on a private key?
-* Why can't I use OpenSSL certificates with SSL client authentication?
-* Why does my browser give a warning about a mismatched hostname?
-* How do I install a CA certificate into a browser?
-* Why is OpenSSL x509 DN output not conformant to RFC2253?
-* What is a "128 bit certificate"? Can I create one with OpenSSL?
-* Why does OpenSSL set the authority key identifier extension incorrectly?
-* How can I set up a bundle of commercial root CA certificates?
-
-[BUILD] Questions about building and testing OpenSSL
-
-* Why does the linker complain about undefined symbols?
-* Why does the OpenSSL test fail with "bc: command not found"?
-* Why does the OpenSSL test fail with "bc: 1 no implemented"?
-* Why does the OpenSSL test fail with "bc: stack empty"?
-* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
-* Why does the OpenSSL compilation fail with "ar: command not found"?
-* Why does the OpenSSL compilation fail on Win32 with VC++?
-* What is special about OpenSSL on Redhat?
-* Why does the OpenSSL compilation fail on MacOS X?
-* Why does the OpenSSL test suite fail on MacOS X?
-* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
-* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
-* Why does the OpenSSL test suite fail in sha512t on x86 CPU?
-* Why does compiler fail to compile sha512.c?
-* Test suite still fails, what to do?
-* I think I've found a bug, what should I do?
-* I'm SURE I've found a bug, how do I report it?
-* I've found a security issue, how do I report it?
-
-[PROG] Questions about programming with OpenSSL
-
-* Is OpenSSL thread-safe?
-* I've compiled a program under Windows and it crashes: why?
-* How do I read or write a DER encoded buffer using the ASN1 functions?
-* OpenSSL uses DER but I need BER format: does OpenSSL support BER?
-* I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
-* I've called <some function> and it fails, why?
-* I just get a load of numbers for the error output, what do they mean?
-* Why do I get errors about unknown algorithms?
-* Why can't the OpenSSH configure script detect OpenSSL?
-* Can I use OpenSSL's SSL library with non-blocking I/O?
-* Why doesn't my server application receive a client certificate?
-* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
-* I think I've detected a memory leak, is this a bug?
-* Why does Valgrind complain about the use of uninitialized data?
-* Why doesn't a memory BIO work when a file does?
-* Where are the declarations and implementations of d2i_X509() etc?
-
-===============================================================================
-
-[MISC] ========================================================================
-
-* Which is the current version of OpenSSL?
-
-The current version is available from <URL: http://www.openssl.org>.
-OpenSSL 1.0.1a was released on Apr 19th, 2012.
-
-In addition to the current stable release, you can also access daily
-snapshots of the OpenSSL development version at <URL:
-ftp://ftp.openssl.org/snapshot/>, or get it by anonymous Git access.
-
-
-* Where is the documentation?
-
-OpenSSL is a library that provides cryptographic functionality to
-applications such as secure web servers. Be sure to read the
-documentation of the application you want to use. The INSTALL file
-explains how to install this library.
-
-OpenSSL includes a command line utility that can be used to perform a
-variety of cryptographic functions. It is described in the openssl(1)
-manpage. Documentation for developers is currently being written. Many
-manual pages are available; overviews over libcrypto and
-libssl are given in the crypto(3) and ssl(3) manpages.
-
-The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a
-different directory if you specified one as described in INSTALL).
-In addition, you can read the most current versions at
-<URL: http://www.openssl.org/docs/>. Note that the online documents refer
-to the very latest development versions of OpenSSL and may include features
-not present in released versions. If in doubt refer to the documentation
-that came with the version of OpenSSL you are using. The pod format
-documentation is included in each OpenSSL distribution under the docs
-directory.
-
-There is some documentation about certificate extensions and PKCS#12
-in doc/openssl.txt
-
-The original SSLeay documentation is included in OpenSSL as
-doc/ssleay.txt. It may be useful when none of the other resources
-help, but please note that it reflects the obsolete version SSLeay
-0.6.6.
-
-
-* How can I contact the OpenSSL developers?
-
-The README file describes how to submit bug reports and patches to
-OpenSSL. Information on the OpenSSL mailing lists is available from
-<URL: http://www.openssl.org>.
-
-
-* Where can I get a compiled version of OpenSSL?
-
-You can finder pointers to binary distributions in
-<URL: http://www.openssl.org/related/binaries.html> .
-
-Some applications that use OpenSSL are distributed in binary form.
-When using such an application, you don't need to install OpenSSL
-yourself; the application will include the required parts (e.g. DLLs).
-
-If you want to build OpenSSL on a Windows system and you don't have
-a C compiler, read the "Mingw32" section of INSTALL.W32 for information
-on how to obtain and install the free GNU C compiler.
-
-A number of Linux and *BSD distributions include OpenSSL.
-
-
-* Why aren't tools like 'autoconf' and 'libtool' used?
-
-autoconf will probably be used in future OpenSSL versions. If it was
-less Unix-centric, it might have been used much earlier.
-
-* What is an 'engine' version?
-
-With version 0.9.6 OpenSSL was extended to interface to external crypto
-hardware. This was realized in a special release '0.9.6-engine'. With
-version 0.9.7 the changes were merged into the main development line,
-so that the special release is no longer necessary.
-
-* How do I check the authenticity of the OpenSSL distribution?
-
-We provide MD5 digests and ASC signatures of each tarball.
-Use MD5 to check that a tarball from a mirror site is identical:
-
- md5sum TARBALL | awk '{print $1;}' | cmp - TARBALL.md5
-
-You can check authenticity using pgp or gpg. You need the OpenSSL team
-member public key used to sign it (download it from a key server, see a
-list of keys at <URL: http://www.openssl.org/about/>). Then
-just do:
-
- pgp TARBALL.asc
-
-* How does the versioning scheme work?
-
-After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter
-releases (e.g. 1.0.1a) can only contain bug and security fixes and no
-new features. Minor releases change the last number (e.g. 1.0.2) and
-can contain new features that retain binary compatibility. Changes to
-the middle number are considered major releases and neither source nor
-binary compatibility is guaranteed.
-
-Therefore the answer to the common question "when will feature X be
-backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear
-in the next minor release.
-
-* What happens when the letter release reaches z?
-
-It was decided after the release of OpenSSL 0.9.8y the next version should
-be 0.9.8za then 0.9.8zb and so on.
-
-
-[LEGAL] =======================================================================
-
-* Do I need patent licenses to use OpenSSL?
-
-For information on intellectual property rights, please consult a lawyer.
-The OpenSSL team does not offer legal advice.
-
-You can configure OpenSSL so as not to use IDEA, MDC2 and RC5 by using
- ./config no-idea no-mdc2 no-rc5
-
-
-* Can I use OpenSSL with GPL software?
-
-On many systems including the major Linux and BSD distributions, yes (the
-GPL does not place restrictions on using libraries that are part of the
-normal operating system distribution).
-
-On other systems, the situation is less clear. Some GPL software copyright
-holders claim that you infringe on their rights if you use OpenSSL with
-their software on operating systems that don't normally include OpenSSL.
-
-If you develop open source software that uses OpenSSL, you may find it
-useful to choose an other license than the GPL, or state explicitly that
-"This program is released under the GPL with the additional exemption that
-compiling, linking, and/or using OpenSSL is allowed." If you are using
-GPL software developed by others, you may want to ask the copyright holder
-for permission to use their software with OpenSSL.
-
-
-[USER] ========================================================================
-
-* Why do I get a "PRNG not seeded" error message?
-
-Cryptographic software needs a source of unpredictable data to work
-correctly. Many open source operating systems provide a "randomness
-device" (/dev/urandom or /dev/random) that serves this purpose.
-All OpenSSL versions try to use /dev/urandom by default; starting with
-version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not
-available.
-
-On other systems, applications have to call the RAND_add() or
-RAND_seed() function with appropriate data before generating keys or
-performing public key encryption. (These functions initialize the
-pseudo-random number generator, PRNG.) Some broken applications do
-not do this. As of version 0.9.5, the OpenSSL functions that need
-randomness report an error if the random number generator has not been
-seeded with at least 128 bits of randomness. If this error occurs and
-is not discussed in the documentation of the application you are
-using, please contact the author of that application; it is likely
-that it never worked correctly. OpenSSL 0.9.5 and later make the
-error visible by refusing to perform potentially insecure encryption.
-
-If you are using Solaris 8, you can add /dev/urandom and /dev/random
-devices by installing patch 112438 (Sparc) or 112439 (x86), which are
-available via the Patchfinder at <URL: http://sunsolve.sun.com>
-(Solaris 9 includes these devices by default). For /dev/random support
-for earlier Solaris versions, see Sun's statement at
-<URL: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsrdb/27606&zone_32=SUNWski>
-(the SUNWski package is available in patch 105710).
-
-On systems without /dev/urandom and /dev/random, it is a good idea to
-use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for
-details. Starting with version 0.9.7, OpenSSL will automatically look
-for an EGD socket at /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool and
-/etc/entropy.
-
-Most components of the openssl command line utility automatically try
-to seed the random number generator from a file. The name of the
-default seeding file is determined as follows: If environment variable
-RANDFILE is set, then it names the seeding file. Otherwise if
-environment variable HOME is set, then the seeding file is $HOME/.rnd.
-If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will
-use file .rnd in the current directory while OpenSSL 0.9.6a uses no
-default seeding file at all. OpenSSL 0.9.6b and later will behave
-similarly to 0.9.6a, but will use a default of "C:\" for HOME on
-Windows systems if the environment variable has not been set.
-
-If the default seeding file does not exist or is too short, the "PRNG
-not seeded" error message may occur.
-
-The openssl command line utility will write back a new state to the
-default seeding file (and create this file if necessary) unless
-there was no sufficient seeding.
-
-Pointing $RANDFILE to an Entropy Gathering Daemon socket does not work.
-Use the "-rand" option of the OpenSSL command line tools instead.
-The $RANDFILE environment variable and $HOME/.rnd are only used by the
-OpenSSL command line tools. Applications using the OpenSSL library
-provide their own configuration options to specify the entropy source,
-please check out the documentation coming the with application.
-
-
-* Why do I get an "unable to write 'random state'" error message?
-
-
-Sometimes the openssl command line utility does not abort with
-a "PRNG not seeded" error message, but complains that it is
-"unable to write 'random state'". This message refers to the
-default seeding file (see previous answer). A possible reason
-is that no default filename is known because neither RANDFILE
-nor HOME is set. (Versions up to 0.9.6 used file ".rnd" in the
-current directory in this case, but this has changed with 0.9.6a.)
-
-
-* How do I create certificates or certificate requests?
-
-Check out the CA.pl(1) manual page. This provides a simple wrapper round
-the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check
-out the manual pages for the individual utilities and the certificate
-extensions documentation (in ca(1), req(1), x509v3_config(5) )
-
-
-* Why can't I create certificate requests?
-
-You typically get the error:
-
- unable to find 'distinguished_name' in config
- problems making Certificate Request
-
-This is because it can't find the configuration file. Check out the
-DIAGNOSTICS section of req(1) for more information.
-
-
-* Why does <SSL program> fail with a certificate verify error?
-
-This problem is usually indicated by log messages saying something like
-"unable to get local issuer certificate" or "self signed certificate".
-When a certificate is verified its root CA must be "trusted" by OpenSSL
-this typically means that the CA certificate must be placed in a directory
-or file and the relevant program configured to read it. The OpenSSL program
-'verify' behaves in a similar way and issues similar error messages: check
-the verify(1) program manual page for more information.
-
-
-* Why can I only use weak ciphers when I connect to a server using OpenSSL?
-
-This is almost certainly because you are using an old "export grade" browser
-which only supports weak encryption. Upgrade your browser to support 128 bit
-ciphers.
-
-
-* How can I create DSA certificates?
-
-Check the CA.pl(1) manual page for a DSA certificate example.
-
-
-* Why can't I make an SSL connection to a server using a DSA certificate?
-
-Typically you'll see a message saying there are no shared ciphers when
-the same setup works fine with an RSA certificate. There are two possible
-causes. The client may not support connections to DSA servers most web
-browsers (including Netscape and MSIE) only support connections to servers
-supporting RSA cipher suites. The other cause is that a set of DH parameters
-has not been supplied to the server. DH parameters can be created with the
-dhparam(1) command and loaded using the SSL_CTX_set_tmp_dh() for example:
-check the source to s_server in apps/s_server.c for an example.
-
-
-* How can I remove the passphrase on a private key?
-
-Firstly you should be really *really* sure you want to do this. Leaving
-a private key unencrypted is a major security risk. If you decide that
-you do have to do this check the EXAMPLES sections of the rsa(1) and
-dsa(1) manual pages.
-
-
-* Why can't I use OpenSSL certificates with SSL client authentication?
-
-What will typically happen is that when a server requests authentication
-it will either not include your certificate or tell you that you have
-no client certificates (Netscape) or present you with an empty list box
-(MSIE). The reason for this is that when a server requests a client
-certificate it includes a list of CAs names which it will accept. Browsers
-will only let you select certificates from the list on the grounds that
-there is little point presenting a certificate which the server will
-reject.
-
-The solution is to add the relevant CA certificate to your servers "trusted
-CA list". How you do this depends on the server software in uses. You can
-print out the servers list of acceptable CAs using the OpenSSL s_client tool:
-
-openssl s_client -connect www.some.host:443 -prexit
-
-If your server only requests certificates on certain URLs then you may need
-to manually issue an HTTP GET command to get the list when s_client connects:
-
-GET /some/page/needing/a/certificate.html
-
-If your CA does not appear in the list then this confirms the problem.
-
-
-* Why does my browser give a warning about a mismatched hostname?
-
-Browsers expect the server's hostname to match the value in the commonName
-(CN) field of the certificate. If it does not then you get a warning.
-
-
-* How do I install a CA certificate into a browser?
-
-The usual way is to send the DER encoded certificate to the browser as
-MIME type application/x-x509-ca-cert, for example by clicking on an appropriate
-link. On MSIE certain extensions such as .der or .cacert may also work, or you
-can import the certificate using the certificate import wizard.
-
-You can convert a certificate to DER form using the command:
-
-openssl x509 -in ca.pem -outform DER -out ca.der
-
-Occasionally someone suggests using a command such as:
-
-openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem
-
-DO NOT DO THIS! This command will give away your CAs private key and
-reduces its security to zero: allowing anyone to forge certificates in
-whatever name they choose.
-
-* Why is OpenSSL x509 DN output not conformant to RFC2253?
-
-The ways to print out the oneline format of the DN (Distinguished Name) have
-been extended in version 0.9.7 of OpenSSL. Using the new X509_NAME_print_ex()
-interface, the "-nameopt" option could be introduded. See the manual
-page of the "openssl x509" commandline tool for details. The old behaviour
-has however been left as default for the sake of compatibility.
-
-* What is a "128 bit certificate"? Can I create one with OpenSSL?
-
-The term "128 bit certificate" is a highly misleading marketing term. It does
-*not* refer to the size of the public key in the certificate! A certificate
-containing a 128 bit RSA key would have negligible security.
-
-There were various other names such as "magic certificates", "SGC
-certificates", "step up certificates" etc.
-
-You can't generally create such a certificate using OpenSSL but there is no
-need to any more. Nowadays web browsers using unrestricted strong encryption
-are generally available.
-
-When there were tight restrictions on the export of strong encryption
-software from the US only weak encryption algorithms could be freely exported
-(initially 40 bit and then 56 bit). It was widely recognised that this was
-inadequate. A relaxation of the rules allowed the use of strong encryption but
-only to an authorised server.
-
-Two slighly different techniques were developed to support this, one used by
-Netscape was called "step up", the other used by MSIE was called "Server Gated
-Cryptography" (SGC). When a browser initially connected to a server it would
-check to see if the certificate contained certain extensions and was issued by
-an authorised authority. If these test succeeded it would reconnect using
-strong encryption.
-
-Only certain (initially one) certificate authorities could issue the
-certificates and they generally cost more than ordinary certificates.
-
-Although OpenSSL can create certificates containing the appropriate extensions
-the certificate would not come from a permitted authority and so would not
-be recognized.
-
-The export laws were later changed to allow almost unrestricted use of strong
-encryption so these certificates are now obsolete.
-
-
-* Why does OpenSSL set the authority key identifier (AKID) extension incorrectly?
-
-It doesn't: this extension is often the cause of confusion.
-
-Consider a certificate chain A->B->C so that A signs B and B signs C. Suppose
-certificate C contains AKID.
-
-The purpose of this extension is to identify the authority certificate B. This
-can be done either by including the subject key identifier of B or its issuer
-name and serial number.
-
-In this latter case because it is identifying certifcate B it must contain the
-issuer name and serial number of B.
-
-It is often wrongly assumed that it should contain the subject name of B. If it
-did this would be redundant information because it would duplicate the issuer
-name of C.
-
-
-* How can I set up a bundle of commercial root CA certificates?
-
-The OpenSSL software is shipped without any root CA certificate as the
-OpenSSL project does not have any policy on including or excluding
-any specific CA and does not intend to set up such a policy. Deciding
-about which CAs to support is up to application developers or
-administrators.
-
-Other projects do have other policies so you can for example extract the CA
-bundle used by Mozilla and/or modssl as described in this article:
-
- <URL: http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html>
-
-
-[BUILD] =======================================================================
-
-* Why does the linker complain about undefined symbols?
-
-Maybe the compilation was interrupted, and make doesn't notice that
-something is missing. Run "make clean; make".
-
-If you used ./Configure instead of ./config, make sure that you
-selected the right target. File formats may differ slightly between
-OS versions (for example sparcv8/sparcv9, or a.out/elf).
-
-In case you get errors about the following symbols, use the config
-option "no-asm", as described in INSTALL:
-
- BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt,
- CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt,
- RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words,
- bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4,
- bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3,
- des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3,
- des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order
-
-If none of these helps, you may want to try using the current snapshot.
-If the problem persists, please submit a bug report.
-
-
-* Why does the OpenSSL test fail with "bc: command not found"?
-
-You didn't install "bc", the Unix calculator. If you want to run the
-tests, get GNU bc from ftp://ftp.gnu.org or from your OS distributor.
-
-
-* Why does the OpenSSL test fail with "bc: 1 no implemented"?
-
-On some SCO installations or versions, bc has a bug that gets triggered
-when you run the test suite (using "make test"). The message returned is
-"bc: 1 not implemented".
-
-The best way to deal with this is to find another implementation of bc
-and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
-for download instructions) can be safely used, for example.
-
-
-* Why does the OpenSSL test fail with "bc: stack empty"?
-
-On some DG/ux versions, bc seems to have a too small stack for calculations
-that the OpenSSL bntest throws at it. This gets triggered when you run the
-test suite (using "make test"). The message returned is "bc: stack empty".
-
-The best way to deal with this is to find another implementation of bc
-and compile/install it. GNU bc (see <URL: http://www.gnu.org/software/software.html>
-for download instructions) can be safely used, for example.
-
-
-* Why does the OpenSSL compilation fail on Alpha Tru64 Unix?
-
-On some Alpha installations running Tru64 Unix and Compaq C, the compilation
-of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual
-memory to continue compilation.' As far as the tests have shown, this may be
-a compiler bug. What happens is that it eats up a lot of resident memory
-to build something, probably a table. The problem is clearly in the
-optimization code, because if one eliminates optimization completely (-O0),
-the compilation goes through (and the compiler consumes about 2MB of resident
-memory instead of 240MB or whatever one's limit is currently).
-
-There are three options to solve this problem:
-
-1. set your current data segment size soft limit higher. Experience shows
-that about 241000 kbytes seems to be enough on an AlphaServer DS10. You do
-this with the command 'ulimit -Sd nnnnnn', where 'nnnnnn' is the number of
-kbytes to set the limit to.
-
-2. If you have a hard limit that is lower than what you need and you can't
-get it changed, you can compile all of OpenSSL with -O0 as optimization
-level. This is however not a very nice thing to do for those who expect to
-get the best result from OpenSSL. A bit more complicated solution is the
-following:
-
------ snip:start -----
- make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \
- sed -e 's/ -O[0-9] / -O0 /'`"
- rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'`
- make
------ snip:end -----
-
-This will only compile sha_dgst.c with -O0, the rest with the optimization
-level chosen by the configuration process. When the above is done, do the
-test and installation and you're set.
-
-3. Reconfigure the toolkit with no-sha0 option to leave out SHA0. It
-should not be used and is not used in SSL/TLS nor any other recognized
-protocol in either case.
-
-
-* Why does the OpenSSL compilation fail with "ar: command not found"?
-
-Getting this message is quite usual on Solaris 2, because Sun has hidden
-away 'ar' and other development commands in directories that aren't in
-$PATH by default. One of those directories is '/usr/ccs/bin'. The
-quickest way to fix this is to do the following (it assumes you use sh
-or any sh-compatible shell):
-
------ snip:start -----
- PATH=${PATH}:/usr/ccs/bin; export PATH
------ snip:end -----
-
-and then redo the compilation. What you should really do is make sure
-'/usr/ccs/bin' is permanently in your $PATH, for example through your
-'.profile' (again, assuming you use a sh-compatible shell).
-
-
-* Why does the OpenSSL compilation fail on Win32 with VC++?
-
-Sometimes, you may get reports from VC++ command line (cl) that it
-can't find standard include files like stdio.h and other weirdnesses.
-One possible cause is that the environment isn't correctly set up.
-To solve that problem for VC++ versions up to 6, one should run
-VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
-installation directory (somewhere under 'Program Files'). For VC++
-version 7 (and up?), which is also called VS.NET, the file is called
-VSVARS32.BAT instead.
-This needs to be done prior to running NMAKE, and the changes are only
-valid for the current DOS session.
-
-
-* What is special about OpenSSL on Redhat?
-
-Red Hat Linux (release 7.0 and later) include a preinstalled limited
-version of OpenSSL. Red Hat has chosen to disable support for IDEA, RC5 and
-MDC2 in this version. The same may apply to other Linux distributions.
-Users may therefore wish to install more or all of the features left out.
-
-To do this you MUST ensure that you do not overwrite the openssl that is in
-/usr/bin on your Red Hat machine. Several packages depend on this file,
-including sendmail and ssh. /usr/local/bin is a good alternative choice. The
-libraries that come with Red Hat 7.0 onwards have different names and so are
-not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and
-/lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and
-/lib/libcrypto.so.2 respectively).
-
-Please note that we have been advised by Red Hat attempting to recompile the
-openssl rpm with all the cryptography enabled will not work. All other
-packages depend on the original Red Hat supplied openssl package. It is also
-worth noting that due to the way Red Hat supplies its packages, updates to
-openssl on each distribution never change the package version, only the
-build number. For example, on Red Hat 7.1, the latest openssl package has
-version number 0.9.6 and build number 9 even though it contains all the
-relevant updates in packages up to and including 0.9.6b.
-
-A possible way around this is to persuade Red Hat to produce a non-US
-version of Red Hat Linux.
-
-
-* Why does the OpenSSL compilation fail on MacOS X?
-
-If the failure happens when trying to build the "openssl" binary, with
-a large number of undefined symbols, it's very probable that you have
-OpenSSL 0.9.6b delivered with the operating system (you can find out by
-running '/usr/bin/openssl version') and that you were trying to build
-OpenSSL 0.9.7 or newer. The problem is that the loader ('ld') in
-MacOS X has a misfeature that's quite difficult to go around.
-Look in the file PROBLEMS for a more detailed explanation and for possible
-solutions.
-
-
-* Why does the OpenSSL test suite fail on MacOS X?
-
-If the failure happens when running 'make test' and the RC4 test fails,
-it's very probable that you have OpenSSL 0.9.6b delivered with the
-operating system (you can find out by running '/usr/bin/openssl version')
-and that you were trying to build OpenSSL 0.9.6d. The problem is that
-the loader ('ld') in MacOS X has a misfeature that's quite difficult to
-go around and has linked the programs "openssl" and the test programs
-with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the
-libraries you just built.
-Look in the file PROBLEMS for a more detailed explanation and for possible
-solutions.
-
-* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]?
-
-Failure in BN_sqr test is most likely caused by a failure to configure the
-toolkit for current platform or lack of support for the platform in question.
-Run './config -t' and './apps/openssl version -p'. Do these platform
-identifiers match? If they don't, then you most likely failed to run
-./config and you're hereby advised to do so before filing a bug report.
-If ./config itself fails to run, then it's most likely problem with your
-local environment and you should turn to your system administrator (or
-similar). If identifiers match (and/or no alternative identifier is
-suggested by ./config script), then the platform is unsupported. There might
-or might not be a workaround. Most notably on SPARC64 platforms with GNU
-C compiler you should be able to produce a working build by running
-'./config -m32'. I understand that -m32 might not be what you want/need,
-but the build should be operational. For further details turn to
-<openssl-dev@openssl.org>.
-
-* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"?
-
-As of 0.9.7 assembler routines were overhauled for position independence
-of the machine code, which is essential for shared library support. For
-some reason OpenBSD is equipped with an out-of-date GNU assembler which
-finds the new code offensive. To work around the problem, configure with
-no-asm (and sacrifice a great deal of performance) or patch your assembler
-according to <URL: http://www.openssl.org/~appro/gas-1.92.3.OpenBSD.patch>.
-For your convenience a pre-compiled replacement binary is provided at
-<URL: http://www.openssl.org/~appro/gas-1.92.3.static.aout.bin>.
-Reportedly elder *BSD a.out platforms also suffer from this problem and
-remedy should be same. Provided binary is statically linked and should be
-working across wider range of *BSD branches, not just OpenBSD.
-
-* Why does the OpenSSL test suite fail in sha512t on x86 CPU?
-
-If the test program in question fails withs SIGILL, Illegal Instruction
-exception, then you more than likely to run SSE2-capable CPU, such as
-Intel P4, under control of kernel which does not support SSE2
-instruction extentions. See accompanying INSTALL file and
-OPENSSL_ia32cap(3) documentation page for further information.
-
-* Why does compiler fail to compile sha512.c?
-
-OpenSSL SHA-512 implementation depends on compiler support for 64-bit
-integer type. Few elder compilers [ULTRIX cc, SCO compiler to mention a
-couple] lack support for this and therefore are incapable of compiling
-the module in question. The recommendation is to disable SHA-512 by
-adding no-sha512 to ./config [or ./Configure] command line. Another
-possible alternative might be to switch to GCC.
-
-* Test suite still fails, what to do?
-
-Another common reason for failure to complete some particular test is
-simply bad code generated by a buggy component in toolchain or deficiency
-in run-time environment. There are few cases documented in PROBLEMS file,
-consult it for possible workaround before you beat the drum. Even if you
-don't find solution or even mention there, do reserve for possibility of
-a compiler bug. Compiler bugs might appear in rather bizarre ways, they
-never make sense, and tend to emerge when you least expect them. In order
-to identify one, drop optimization level, e.g. by editing CFLAG line in
-top-level Makefile, recompile and re-run the test.
-
-* I think I've found a bug, what should I do?
-
-If you are a new user then it is quite likely you haven't found a bug and
-something is happening you aren't familiar with. Check this FAQ, the associated
-documentation and the mailing lists for similar queries. If you are still
-unsure whether it is a bug or not submit a query to the openssl-users mailing
-list.
-
-
-* I'm SURE I've found a bug, how do I report it?
-
-Bug reports with no security implications should be sent to the request
-tracker. This can be done by mailing the report to <rt@openssl.org> (or its
-alias <openssl-bugs@openssl.org>), please note that messages sent to the
-request tracker also appear in the public openssl-dev mailing list.
-
-The report should be in plain text. Any patches should be sent as
-plain text attachments because some mailers corrupt patches sent inline.
-If your issue affects multiple versions of OpenSSL check any patches apply
-cleanly and, if possible include patches to each affected version.
-
-The report should be given a meaningful subject line briefly summarising the
-issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful.
-
-By sending reports to the request tracker the bug can then be given a priority
-and assigned to the appropriate maintainer. The history of discussions can be
-accessed and if the issue has been addressed or a reason why not. If patches
-are only sent to openssl-dev they can be mislaid if a team member has to
-wade through months of old messages to review the discussion.
-
-See also <URL: http://www.openssl.org/support/rt.html>
-
-
-* I've found a security issue, how do I report it?
-
-If you think your bug has security implications then please send it to
-openssl-security@openssl.org if you don't get a prompt reply at least
-acknowledging receipt then resend or mail it directly to one of the
-more active team members (e.g. Steve).
-
-Note that bugs only present in the openssl utility are not in general
-considered to be security issues.
-
-[PROG] ========================================================================
-
-* Is OpenSSL thread-safe?
-
-Yes (with limitations: an SSL connection may not concurrently be used
-by multiple threads). On Windows and many Unix systems, OpenSSL
-automatically uses the multi-threaded versions of the standard
-libraries. If your platform is not one of these, consult the INSTALL
-file.
-
-Multi-threaded applications must provide two callback functions to
-OpenSSL by calling CRYPTO_set_locking_callback() and
-CRYPTO_set_id_callback(), for all versions of OpenSSL up to and
-including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback()
-and associated APIs are deprecated by CRYPTO_THREADID_set_callback()
-and friends. This is described in the threads(3) manpage.
-
-* I've compiled a program under Windows and it crashes: why?
-
-This is usually because you've missed the comment in INSTALL.W32.
-Your application must link against the same version of the Win32
-C-Runtime against which your openssl libraries were linked. The
-default version for OpenSSL is /MD - "Multithreaded DLL".
-
-If you are using Microsoft Visual C++'s IDE (Visual Studio), in
-many cases, your new project most likely defaulted to "Debug
-Singlethreaded" - /ML. This is NOT interchangeable with /MD and your
-program will crash, typically on the first BIO related read or write
-operation.
-
-For each of the six possible link stage configurations within Win32,
-your application must link against the same by which OpenSSL was
-built. If you are using MS Visual C++ (Studio) this can be changed
-by:
-
- 1. Select Settings... from the Project Menu.
- 2. Select the C/C++ Tab.
- 3. Select "Code Generation from the "Category" drop down list box
- 4. Select the Appropriate library (see table below) from the "Use
- run-time library" drop down list box. Perform this step for both
- your debug and release versions of your application (look at the
- top left of the settings panel to change between the two)
-
- Single Threaded /ML - MS VC++ often defaults to
- this for the release
- version of a new project.
- Debug Single Threaded /MLd - MS VC++ often defaults to
- this for the debug version
- of a new project.
- Multithreaded /MT
- Debug Multithreaded /MTd
- Multithreaded DLL /MD - OpenSSL defaults to this.
- Debug Multithreaded DLL /MDd
-
-Note that debug and release libraries are NOT interchangeable. If you
-built OpenSSL with /MD your application must use /MD and cannot use /MDd.
-
-As per 0.9.8 the above limitation is eliminated for .DLLs. OpenSSL
-.DLLs compiled with some specific run-time option [we insist on the
-default /MD] can be deployed with application compiled with different
-option or even different compiler. But there is a catch! Instead of
-re-compiling OpenSSL toolkit, as you would have to with prior versions,
-you have to compile small C snippet with compiler and/or options of
-your choice. The snippet gets installed as
-<install-root>/include/openssl/applink.c and should be either added to
-your application project or simply #include-d in one [and only one]
-of your application source files. Failure to link this shim module
-into your application manifests itself as fatal "no OPENSSL_Applink"
-run-time error. An explicit reminder is due that in this situation
-[mixing compiler options] it is as important to add CRYPTO_malloc_init
-prior first call to OpenSSL.
-
-* How do I read or write a DER encoded buffer using the ASN1 functions?
-
-You have two options. You can either use a memory BIO in conjunction
-with the i2d_*_bio() or d2i_*_bio() functions or you can use the
-i2d_*(), d2i_*() functions directly. Since these are often the
-cause of grief here are some code fragments using PKCS7 as an example:
-
- unsigned char *buf, *p;
- int len;
-
- len = i2d_PKCS7(p7, NULL);
- buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */
- p = buf;
- i2d_PKCS7(p7, &p);
-
-At this point buf contains the len bytes of the DER encoding of
-p7.
-
-The opposite assumes we already have len bytes in buf:
-
- unsigned char *p;
- p = buf;
- p7 = d2i_PKCS7(NULL, &p, len);
-
-At this point p7 contains a valid PKCS7 structure or NULL if an error
-occurred. If an error occurred ERR_print_errors(bio) should give more
-information.
-
-The reason for the temporary variable 'p' is that the ASN1 functions
-increment the passed pointer so it is ready to read or write the next
-structure. This is often a cause of problems: without the temporary
-variable the buffer pointer is changed to point just after the data
-that has been read or written. This may well be uninitialized data
-and attempts to free the buffer will have unpredictable results
-because it no longer points to the same address.
-
-Memory allocation and encoding can also be combined in a single
-operation by the ASN1 routines:
-
- unsigned char *buf = NULL; /* mandatory */
- int len;
- len = i2d_PKCS7(p7, &buf);
- if (len < 0)
- /* Error */
- /* Do some things with 'buf' */
- /* Finished with buf: free it */
- OPENSSL_free(buf);
-
-In this special case the "buf" parameter is *not* incremented, it points
-to the start of the encoding.
-
-
-* OpenSSL uses DER but I need BER format: does OpenSSL support BER?
-
-The short answer is yes, because DER is a special case of BER and OpenSSL
-ASN1 decoders can process BER.
-
-The longer answer is that ASN1 structures can be encoded in a number of
-different ways. One set of ways is the Basic Encoding Rules (BER) with various
-permissible encodings. A restriction of BER is the Distinguished Encoding
-Rules (DER): these uniquely specify how a given structure is encoded.
-
-Therefore, because DER is a special case of BER, DER is an acceptable encoding
-for BER.
-
-
-* I've tried using <M_some_evil_pkcs12_macro> and I get errors why?
-
-This usually happens when you try compiling something using the PKCS#12
-macros with a C++ compiler. There is hardly ever any need to use the
-PKCS#12 macros in a program, it is much easier to parse and create
-PKCS#12 files using the PKCS12_parse() and PKCS12_create() functions
-documented in doc/openssl.txt and with examples in demos/pkcs12. The
-'pkcs12' application has to use the macros because it prints out
-debugging information.
-
-
-* I've called <some function> and it fails, why?
-
-Before submitting a report or asking in one of the mailing lists, you
-should try to determine the cause. In particular, you should call
-ERR_print_errors() or ERR_print_errors_fp() after the failed call
-and see if the message helps. Note that the problem may occur earlier
-than you think -- you should check for errors after every call where
-it is possible, otherwise the actual problem may be hidden because
-some OpenSSL functions clear the error state.
-
-
-* I just get a load of numbers for the error output, what do they mean?
-
-The actual format is described in the ERR_print_errors() manual page.
-You should call the function ERR_load_crypto_strings() before hand and
-the message will be output in text form. If you can't do this (for example
-it is a pre-compiled binary) you can use the errstr utility on the error
-code itself (the hex digits after the second colon).
-
-
-* Why do I get errors about unknown algorithms?
-
-The cause is forgetting to load OpenSSL's table of algorithms with
-OpenSSL_add_all_algorithms(). See the manual page for more information. This
-can cause several problems such as being unable to read in an encrypted
-PEM file, unable to decrypt a PKCS#12 file or signature failure when
-verifying certificates.
-
-* Why can't the OpenSSH configure script detect OpenSSL?
-
-Several reasons for problems with the automatic detection exist.
-OpenSSH requires at least version 0.9.5a of the OpenSSL libraries.
-Sometimes the distribution has installed an older version in the system
-locations that is detected instead of a new one installed. The OpenSSL
-library might have been compiled for another CPU or another mode (32/64 bits).
-Permissions might be wrong.
-
-The general answer is to check the config.log file generated when running
-the OpenSSH configure script. It should contain the detailed information
-on why the OpenSSL library was not detected or considered incompatible.
-
-
-* Can I use OpenSSL's SSL library with non-blocking I/O?
-
-Yes; make sure to read the SSL_get_error(3) manual page!
-
-A pitfall to avoid: Don't assume that SSL_read() will just read from
-the underlying transport or that SSL_write() will just write to it --
-it is also possible that SSL_write() cannot do any useful work until
-there is data to read, or that SSL_read() cannot do anything until it
-is possible to send data. One reason for this is that the peer may
-request a new TLS/SSL handshake at any time during the protocol,
-requiring a bi-directional message exchange; both SSL_read() and
-SSL_write() will try to continue any pending handshake.
-
-
-* Why doesn't my server application receive a client certificate?
-
-Due to the TLS protocol definition, a client will only send a certificate,
-if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the
-SSL_CTX_set_verify() function to enable the use of client certificates.
-
-
-* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier?
-
-For OpenSSL 0.9.7 the OID table was extended and corrected. In earlier
-versions, uniqueIdentifier was incorrectly used for X.509 certificates.
-The correct name according to RFC2256 (LDAP) is x500UniqueIdentifier.
-Change your code to use the new name when compiling against OpenSSL 0.9.7.
-
-
-* I think I've detected a memory leak, is this a bug?
-
-In most cases the cause of an apparent memory leak is an OpenSSL internal table
-that is allocated when an application starts up. Since such tables do not grow
-in size over time they are harmless.
-
-These internal tables can be freed up when an application closes using various
-functions. Currently these include following:
-
-Thread-local cleanup functions:
-
- ERR_remove_state()
-
-Application-global cleanup functions that are aware of usage (and therefore
-thread-safe):
-
- ENGINE_cleanup() and CONF_modules_unload()
-
-"Brutal" (thread-unsafe) Application-global cleanup functions:
-
- ERR_free_strings(), EVP_cleanup() and CRYPTO_cleanup_all_ex_data().
-
-
-* Why does Valgrind complain about the use of uninitialized data?
-
-When OpenSSL's PRNG routines are called to generate random numbers the supplied
-buffer contents are mixed into the entropy pool: so it technically does not
-matter whether the buffer is initialized at this point or not. Valgrind (and
-other test tools) will complain about this. When using Valgrind, make sure the
-OpenSSL library has been compiled with the PURIFY macro defined (-DPURIFY)
-to get rid of these warnings.
-
-
-* Why doesn't a memory BIO work when a file does?
-
-This can occur in several cases for example reading an S/MIME email message.
-The reason is that a memory BIO can do one of two things when all the data
-has been read from it.
-
-The default behaviour is to indicate that no more data is available and that
-the call should be retried, this is to allow the application to fill up the BIO
-again if necessary.
-
-Alternatively it can indicate that no more data is available and that EOF has
-been reached.
-
-If a memory BIO is to behave in the same way as a file this second behaviour
-is needed. This must be done by calling:
-
- BIO_set_mem_eof_return(bio, 0);
-
-See the manual pages for more details.
-
-
-* Where are the declarations and implementations of d2i_X509() etc?
-
-These are defined and implemented by macros of the form:
-
-
- DECLARE_ASN1_FUNCTIONS(X509) and IMPLEMENT_ASN1_FUNCTIONS(X509)
-
-The implementation passes an ASN1 "template" defining the structure into an
-ASN1 interpreter using generalised functions such as ASN1_item_d2i().
-
-
-===============================================================================
+The FAQ is now maintained on the web:
+ https://www.openssl.org/docs/faq.html
diff --git a/crypto/openssl/Makefile b/crypto/openssl/Makefile
index f361472..e2bbb47 100644
--- a/crypto/openssl/Makefile
+++ b/crypto/openssl/Makefile
@@ -4,7 +4,7 @@
## Makefile for OpenSSL
##
-VERSION=1.0.2d
+VERSION=1.0.2e
MAJOR=1
MINOR=0.2
SHLIB_VERSION_NUMBER=1.0.0
@@ -205,7 +205,9 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
-BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
+# LC_ALL=C ensures that error [and other] messages are delivered in
+# same language for uniform treatment.
+BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
CC='$(CC)' CFLAG='$(CFLAG)' \
AS='$(CC)' ASFLAG='$(CFLAG) -c' \
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
@@ -499,25 +501,28 @@ TABLE: Configure
# would occur. Therefore the list of files is temporarily stored into a file
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option.
-tar:
+TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
+ --owner openssl:0 --group openssl:0 \
+ --transform 's|^|openssl-$(VERSION)/|' \
+ -cvf -
+
+../$(TARFILE).list:
+ find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
+ \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
+ \! -name '*test' \! -name '.#*' \! -name '*~' \
+ | sort > ../$(TARFILE).list
+
+tar: ../$(TARFILE).list
find . -type d -print | xargs chmod 755
find . -type f -print | xargs chmod a+r
find . -type f -perm -0100 -print | xargs chmod a+x
- find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
- $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
- tardy --user_number=0 --user_name=openssl \
- --group_number=0 --group_name=openssl \
- --prefix=openssl-$(VERSION) - |\
- gzip --best >../$(TARFILE).gz; \
- rm -f ../$(TARFILE).list; \
+ $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
+ rm -f ../$(TARFILE).list
ls -l ../$(TARFILE).gz
-tar-snap:
- @$(TAR) $(TARFLAGS) -cvf - \
- `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
- tardy --user_number=0 --user_name=openssl \
- --group_number=0 --group_name=openssl \
- --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
+tar-snap: ../$(TARFILE).list
+ $(TAR_COMMAND) > ../$(TARFILE)
+ rm -f ../$(TARFILE).list
ls -l ../$(TARFILE)
dist:
diff --git a/crypto/openssl/Makefile.org b/crypto/openssl/Makefile.org
index 8d6a2a0..f16770d 100644
--- a/crypto/openssl/Makefile.org
+++ b/crypto/openssl/Makefile.org
@@ -203,7 +203,9 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
-BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
+# LC_ALL=C ensures that error [and other] messages are delivered in
+# same language for uniform treatment.
+BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
CC='$(CC)' CFLAG='$(CFLAG)' \
AS='$(CC)' ASFLAG='$(CFLAG) -c' \
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
@@ -497,25 +499,28 @@ TABLE: Configure
# would occur. Therefore the list of files is temporarily stored into a file
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option.
-tar:
+TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
+ --owner openssl:0 --group openssl:0 \
+ --transform 's|^|openssl-$(VERSION)/|' \
+ -cvf -
+
+../$(TARFILE).list:
+ find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
+ \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
+ \! -name '*test' \! -name '.#*' \! -name '*~' \
+ | sort > ../$(TARFILE).list
+
+tar: ../$(TARFILE).list
find . -type d -print | xargs chmod 755
find . -type f -print | xargs chmod a+r
find . -type f -perm -0100 -print | xargs chmod a+x
- find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
- $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
- tardy --user_number=0 --user_name=openssl \
- --group_number=0 --group_name=openssl \
- --prefix=openssl-$(VERSION) - |\
- gzip --best >../$(TARFILE).gz; \
- rm -f ../$(TARFILE).list; \
+ $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
+ rm -f ../$(TARFILE).list
ls -l ../$(TARFILE).gz
-tar-snap:
- @$(TAR) $(TARFLAGS) -cvf - \
- `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
- tardy --user_number=0 --user_name=openssl \
- --group_number=0 --group_name=openssl \
- --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
+tar-snap: ../$(TARFILE).list
+ $(TAR_COMMAND) > ../$(TARFILE)
+ rm -f ../$(TARFILE).list
ls -l ../$(TARFILE)
dist:
diff --git a/crypto/openssl/NEWS b/crypto/openssl/NEWS
index 29e4805..e1c78f8 100644
--- a/crypto/openssl/NEWS
+++ b/crypto/openssl/NEWS
@@ -5,9 +5,19 @@
This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file.
+ Major changes between OpenSSL 1.0.2d and OpenSSL 1.0.2e [3 Dec 2015]
+
+ o BN_mod_exp may produce incorrect results on x86_64 (CVE-2015-3193)
+ o Certificate verify crash with missing PSS parameter (CVE-2015-3194)
+ o X509_ATTRIBUTE memory leak (CVE-2015-3195)
+ o Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs
+ o In DSA_generate_parameters_ex, if the provided seed is too short,
+ return an error
+
Major changes between OpenSSL 1.0.2c and OpenSSL 1.0.2d [9 Jul 2015]
o Alternate chains certificate forgery (CVE-2015-1793)
+ o Race condition handling PSK identify hint (CVE-2015-3196)
Major changes between OpenSSL 1.0.2b and OpenSSL 1.0.2c [12 Jun 2015]
diff --git a/crypto/openssl/README b/crypto/openssl/README
index 493141b..49c4c9f 100644
--- a/crypto/openssl/README
+++ b/crypto/openssl/README
@@ -1,7 +1,7 @@
- OpenSSL 1.0.2d 9 Jul 2015
+ OpenSSL 1.0.2e 3 Dec 2015
- Copyright (c) 1998-2011 The OpenSSL Project
+ Copyright (c) 1998-2015 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
All rights reserved.
@@ -10,17 +10,17 @@
The OpenSSL Project is a collaborative effort to develop a robust,
commercial-grade, fully featured, and Open Source toolkit implementing the
- Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
- protocols as well as a full-strength general purpose cryptography library.
- The project is managed by a worldwide community of volunteers that use the
- Internet to communicate, plan, and develop the OpenSSL toolkit and its
- related documentation.
+ Secure Sockets Layer (SSLv3) and Transport Layer Security (TLS) protocols as
+ well as a full-strength general purpose cryptograpic library. The project is
+ managed by a worldwide community of volunteers that use the Internet to
+ communicate, plan, and develop the OpenSSL toolkit and its related
+ documentation.
- OpenSSL is based on the excellent SSLeay library developed from Eric A. Young
+ OpenSSL is descended from the SSLeay library developed by Eric A. Young
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
- OpenSSL license plus the SSLeay license) situation, which basically means
- that you are free to get and use it for commercial and non-commercial
- purposes as long as you fulfill the conditions of both licenses.
+ OpenSSL license plus the SSLeay license), which means that you are free to
+ get and use it for commercial and non-commercial purposes as long as you
+ fulfill the conditions of both licenses.
OVERVIEW
--------
@@ -28,90 +28,39 @@
The OpenSSL toolkit includes:
libssl.a:
- Implementation of SSLv2, SSLv3, TLSv1 and the required code to support
- both SSLv2, SSLv3 and TLSv1 in the one server and client.
+ Provides the client and server-side implementations for SSLv3 and TLS.
libcrypto.a:
- General encryption and X.509 v1/v3 stuff needed by SSL/TLS but not
- actually logically part of it. It includes routines for the following:
-
- Ciphers
- libdes - EAY's libdes DES encryption package which was floating
- around the net for a few years, and was then relicensed by
- him as part of SSLeay. It includes 15 'modes/variations'
- of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb;
- pcbc and a more general form of cfb and ofb) including desx
- in cbc mode, a fast crypt(3), and routines to read
- passwords from the keyboard.
- RC4 encryption,
- RC2 encryption - 4 different modes, ecb, cbc, cfb and ofb.
- Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb.
- IDEA encryption - 4 different modes, ecb, cbc, cfb and ofb.
-
- Digests
- MD5 and MD2 message digest algorithms, fast implementations,
- SHA (SHA-0) and SHA-1 message digest algorithms,
- MDC2 message digest. A DES based hash that is popular on smart cards.
-
- Public Key
- RSA encryption/decryption/generation.
- There is no limit on the number of bits.
- DSA encryption/decryption/generation.
- There is no limit on the number of bits.
- Diffie-Hellman key-exchange/key generation.
- There is no limit on the number of bits.
-
- X.509v3 certificates
- X509 encoding/decoding into/from binary ASN1 and a PEM
- based ASCII-binary encoding which supports encryption with a
- private key. Program to generate RSA and DSA certificate
- requests and to generate RSA and DSA certificates.
-
- Systems
- The normal digital envelope routines and base64 encoding. Higher
- level access to ciphers and digests by name. New ciphers can be
- loaded at run time. The BIO io system which is a simple non-blocking
- IO abstraction. Current methods supported are file descriptors,
- sockets, socket accept, socket connect, memory buffer, buffering, SSL
- client/server, file pointer, encryption, digest, non-blocking testing
- and null.
-
- Data structures
- A dynamically growing hashing system
- A simple stack.
- A Configuration loader that uses a format similar to MS .ini files.
+ Provides general cryptographic and X.509 support needed by SSL/TLS but
+ not logically part of it.
openssl:
A command line tool that can be used for:
- Creation of RSA, DH and DSA key parameters
+ Creation of key parameters
Creation of X.509 certificates, CSRs and CRLs
- Calculation of Message Digests
- Encryption and Decryption with Ciphers
- SSL/TLS Client and Server Tests
+ Calculation of message digests
+ Encryption and decryption
+ SSL/TLS client and server tests
Handling of S/MIME signed or encrypted mail
+ And more...
INSTALLATION
------------
- To install this package under a Unix derivative, read the INSTALL file. For
- a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read
- INSTALL.VMS.
-
- Read the documentation in the doc/ directory. It is quite rough, but it
- lists the functions; you will probably have to look at the code to work out
- how to use them. Look at the example programs.
-
- PROBLEMS
- --------
-
- For some platforms, there are some known problems that may affect the user
- or application author. We try to collect those in doc/PROBLEMS, with current
- thoughts on how they should be solved in a future of OpenSSL.
+ See the appropriate file:
+ INSTALL Linux, Unix, etc.
+ INSTALL.DJGPP DOS platform with DJGPP
+ INSTALL.NW Netware
+ INSTALL.OS2 OS/2
+ INSTALL.VMS VMS
+ INSTALL.W32 Windows (32bit)
+ INSTALL.W64 Windows (64bit)
+ INSTALL.WCE Windows CE
SUPPORT
-------
- See the OpenSSL website www.openssl.org for details of how to obtain
+ See the OpenSSL website www.openssl.org for details on how to obtain
commercial technical support.
If you have any problems with OpenSSL then please take the following steps
@@ -137,56 +86,33 @@
Email the report to:
- openssl-bugs@openssl.org
+ rt@openssl.org
+
+ In order to avoid spam, this is a moderated mailing list, and it might
+ take a day for the ticket to show up. (We also scan posts to make sure
+ that security disclosures aren't publically posted by mistake.) Mail to
+ this address is recorded in the public RT (request tracker) database (see
+ https://www.openssl.org/support/rt.html for details) and also forwarded
+ the public openssl-dev mailing list. Confidential mail may be sent to
+ openssl-security@openssl.org (PGP key available from the key servers).
- Note that the request tracker should NOT be used for general assistance
- or support queries. Just because something doesn't work the way you expect
- does not mean it is necessarily a bug in OpenSSL.
+ Please do NOT use this for general assistance or support queries.
+ Just because something doesn't work the way you expect does not mean it
+ is necessarily a bug in OpenSSL.
- Note that mail to openssl-bugs@openssl.org is recorded in the public
- request tracker database (see https://www.openssl.org/support/rt.html
- for details) and also forwarded to a public mailing list. Confidential
- mail may be sent to openssl-security@openssl.org (PGP key available from
- the key servers).
+ You can also make GitHub pull requests. If you do this, please also send
+ mail to rt@openssl.org with a link to the PR so that we can more easily
+ keep track of it.
HOW TO CONTRIBUTE TO OpenSSL
----------------------------
- Development is coordinated on the openssl-dev mailing list (see
- http://www.openssl.org for information on subscribing). If you
- would like to submit a patch, send it to openssl-bugs@openssl.org with
- the string "[PATCH]" in the subject. Please be sure to include a
- textual explanation of what your patch does.
-
- If you are unsure as to whether a feature will be useful for the general
- OpenSSL community please discuss it on the openssl-dev mailing list first.
- Someone may be already working on the same thing or there may be a good
- reason as to why that feature isn't implemented.
-
- Patches should be as up to date as possible, preferably relative to the
- current Git or the last snapshot. They should follow the coding style of
- OpenSSL and compile without warnings. Some of the core team developer targets
- can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
- compiles on many varied platforms: try to ensure you only use portable
- features.
-
- Note: For legal reasons, contributions from the US can be accepted only
- if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
- (formerly BXA) with a copy to the ENC Encryption Request Coordinator;
- please take some time to look at
- http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
- and
- http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e))
- for the details. If "your encryption source code is too large to serve as
- an email attachment", they are glad to receive it by fax instead; hope you
- have a cheap long-distance plan.
-
- Our preferred format for changes is "diff -u" output. You might
- generate it like this:
-
- # cd openssl-work
- # [your changes]
- # ./Configure dist; make clean
- # cd ..
- # diff -ur openssl-orig openssl-work > mydiffs.patch
+ See CONTRIBUTING
+
+ LEGALITIES
+ ----------
+ A number of nations, in particular the U.S., restrict the use or export
+ of cryptography. If you are potentially subject to such restrictions
+ you should seek competent professional legal advice before attempting to
+ develop or distribute cryptographic code.
diff --git a/crypto/openssl/apps/Makefile b/crypto/openssl/apps/Makefile
index cafe554..8c3297e 100644
--- a/crypto/openssl/apps/Makefile
+++ b/crypto/openssl/apps/Makefile
@@ -135,7 +135,7 @@ update: openssl-vms.cnf local_depend
depend: local_depend
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
local_depend:
- @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \
+ @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
diff --git a/crypto/openssl/apps/app_rand.c b/crypto/openssl/apps/app_rand.c
index 595fc78..7f40bba 100644
--- a/crypto/openssl/apps/app_rand.c
+++ b/crypto/openssl/apps/app_rand.c
@@ -124,10 +124,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
char buffer[200];
#ifdef OPENSSL_SYS_WINDOWS
- BIO_printf(bio_e, "Loading 'screen' into random state -");
- BIO_flush(bio_e);
RAND_screen();
- BIO_printf(bio_e, " done\n");
#endif
if (file == NULL)
diff --git a/crypto/openssl/apps/apps.c b/crypto/openssl/apps/apps.c
index 7478fc3..2e77805 100644
--- a/crypto/openssl/apps/apps.c
+++ b/crypto/openssl/apps/apps.c
@@ -119,9 +119,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB)
-# include <strings.h>
-#endif
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
@@ -1352,7 +1349,11 @@ int set_name_ex(unsigned long *flags, const char *arg)
{"ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
{NULL, 0, 0}
};
- return set_multi_opts(flags, arg, ex_tbl);
+ if (set_multi_opts(flags, arg, ex_tbl) == 0)
+ return 0;
+ if ((*flags & XN_FLAG_SEP_MASK) == 0)
+ *flags |= XN_FLAG_SEP_CPLUS_SPC;
+ return 1;
}
int set_ext_copy(int *copy_type, const char *arg)
diff --git a/crypto/openssl/apps/asn1pars.c b/crypto/openssl/apps/asn1pars.c
index 11b0787..0a6b990 100644
--- a/crypto/openssl/apps/asn1pars.c
+++ b/crypto/openssl/apps/asn1pars.c
@@ -313,9 +313,9 @@ int MAIN(int argc, char **argv)
}
typ = ASN1_TYPE_get(at);
if ((typ == V_ASN1_OBJECT)
+ || (typ == V_ASN1_BOOLEAN)
|| (typ == V_ASN1_NULL)) {
- BIO_printf(bio_err, "Can't parse %s type\n",
- typ == V_ASN1_NULL ? "NULL" : "OBJECT");
+ BIO_printf(bio_err, "Can't parse %s type\n", ASN1_tag2str(typ));
ERR_print_errors(bio_err);
goto end;
}
diff --git a/crypto/openssl/apps/ca.c b/crypto/openssl/apps/ca.c
index 3b7336c..0b66095 100644
--- a/crypto/openssl/apps/ca.c
+++ b/crypto/openssl/apps/ca.c
@@ -99,25 +99,19 @@
#undef PROG
#define PROG ca_main
-#define BASE_SECTION "ca"
-#define CONFIG_FILE "openssl.cnf"
+#define BASE_SECTION "ca"
+#define CONFIG_FILE "openssl.cnf"
#define ENV_DEFAULT_CA "default_ca"
-#define STRING_MASK "string_mask"
+#define STRING_MASK "string_mask"
#define UTF8_IN "utf8"
-#define ENV_DIR "dir"
-#define ENV_CERTS "certs"
-#define ENV_CRL_DIR "crl_dir"
-#define ENV_CA_DB "CA_DB"
#define ENV_NEW_CERTS_DIR "new_certs_dir"
#define ENV_CERTIFICATE "certificate"
#define ENV_SERIAL "serial"
#define ENV_CRLNUMBER "crlnumber"
-#define ENV_CRL "crl"
#define ENV_PRIVATE_KEY "private_key"
-#define ENV_RANDFILE "RANDFILE"
#define ENV_DEFAULT_DAYS "default_days"
#define ENV_DEFAULT_STARTDATE "default_startdate"
#define ENV_DEFAULT_ENDDATE "default_enddate"
@@ -2538,6 +2532,8 @@ static int do_updatedb(CA_DB *db)
char **rrow, *a_tm_s;
a_tm = ASN1_UTCTIME_new();
+ if (a_tm == NULL)
+ return -1;
/* get actual time and make a string */
a_tm = X509_gmtime_adj(a_tm, 0);
diff --git a/crypto/openssl/apps/ecparam.c b/crypto/openssl/apps/ecparam.c
index 06ac77b..71b67f4 100644
--- a/crypto/openssl/apps/ecparam.c
+++ b/crypto/openssl/apps/ecparam.c
@@ -416,14 +416,13 @@ int MAIN(int argc, char **argv)
}
if (check) {
- if (group == NULL)
- BIO_printf(bio_err, "no elliptic curve parameters\n");
BIO_printf(bio_err, "checking elliptic curve parameters: ");
if (!EC_GROUP_check(group, NULL)) {
BIO_printf(bio_err, "failed\n");
ERR_print_errors(bio_err);
- } else
- BIO_printf(bio_err, "ok\n");
+ goto end;
+ }
+ BIO_printf(bio_err, "ok\n");
}
diff --git a/crypto/openssl/apps/engine.c b/crypto/openssl/apps/engine.c
index 3d70cac..460ec60 100644
--- a/crypto/openssl/apps/engine.c
+++ b/crypto/openssl/apps/engine.c
@@ -99,8 +99,6 @@ static void identity(char *ptr)
static int append_buf(char **buf, const char *s, int *size, int step)
{
- int l = strlen(s);
-
if (*buf == NULL) {
*size = step;
*buf = OPENSSL_malloc(*size);
@@ -109,9 +107,6 @@ static int append_buf(char **buf, const char *s, int *size, int step)
**buf = '\0';
}
- if (**buf != '\0')
- l += 2; /* ", " */
-
if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
*size += step;
*buf = OPENSSL_realloc(*buf, *size);
diff --git a/crypto/openssl/apps/ocsp.c b/crypto/openssl/apps/ocsp.c
index 926083d..6ed255d 100644
--- a/crypto/openssl/apps/ocsp.c
+++ b/crypto/openssl/apps/ocsp.c
@@ -1261,8 +1261,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path,
return NULL;
}
- if (BIO_get_fd(cbio, &fd) <= 0) {
- BIO_puts(err, "Can't get connection fd\n");
+ if (BIO_get_fd(cbio, &fd) < 0) {
+ BIO_puts(bio_err, "Can't get connection fd\n");
goto err;
}
diff --git a/crypto/openssl/apps/pkcs12.c b/crypto/openssl/apps/pkcs12.c
index 4ff6449..e41b445 100644
--- a/crypto/openssl/apps/pkcs12.c
+++ b/crypto/openssl/apps/pkcs12.c
@@ -134,13 +134,6 @@ int MAIN(int argc, char **argv)
apps_startup();
-# ifdef OPENSSL_FIPS
- if (FIPS_mode())
- cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
- else
-# endif
- cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
-
enc = EVP_des_ede3_cbc();
if (bio_err == NULL)
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
@@ -148,6 +141,13 @@ int MAIN(int argc, char **argv)
if (!load_config(bio_err, NULL))
goto end;
+# ifdef OPENSSL_FIPS
+ if (FIPS_mode())
+ cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
+ else
+# endif
+ cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
+
args = argv + 1;
while (*args) {
diff --git a/crypto/openssl/apps/s_cb.c b/crypto/openssl/apps/s_cb.c
index dd3aa74..5b5e711 100644
--- a/crypto/openssl/apps/s_cb.c
+++ b/crypto/openssl/apps/s_cb.c
@@ -981,6 +981,11 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
extname = "next protocol";
break;
#endif
+#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
+ case TLSEXT_TYPE_application_layer_protocol_negotiation:
+ extname = "application layer protocol negotiation";
+ break;
+#endif
case TLSEXT_TYPE_padding:
extname = "TLS padding";
diff --git a/crypto/openssl/apps/s_client.c b/crypto/openssl/apps/s_client.c
index e55f2c5..f80711f 100644
--- a/crypto/openssl/apps/s_client.c
+++ b/crypto/openssl/apps/s_client.c
@@ -424,6 +424,14 @@ static void sc_usage(void)
" -no_ticket - disable use of RFC4507bis session tickets\n");
BIO_printf(bio_err,
" -serverinfo types - send empty ClientHello extensions (comma-separated numbers)\n");
+ BIO_printf(bio_err,
+ " -curves arg - Elliptic curves to advertise (colon-separated list)\n");
+ BIO_printf(bio_err,
+ " -sigalgs arg - Signature algorithms to support (colon-separated list)\n");
+ BIO_printf(bio_err,
+ " -client_sigalgs arg - Signature algorithms to support for client\n");
+ BIO_printf(bio_err,
+ " certificate authentication (colon-separated list)\n");
#endif
#ifndef OPENSSL_NO_NEXTPROTONEG
BIO_printf(bio_err,
@@ -2065,6 +2073,9 @@ int MAIN(int argc, char **argv)
sk_X509_pop_free(chain, X509_free);
if (pass)
OPENSSL_free(pass);
+#ifndef OPENSSL_NO_SRP
+ OPENSSL_free(srp_arg.srppassin);
+#endif
if (vpm)
X509_VERIFY_PARAM_free(vpm);
ssl_excert_free(exc);
diff --git a/crypto/openssl/apps/s_server.c b/crypto/openssl/apps/s_server.c
index acef382..f19532b 100644
--- a/crypto/openssl/apps/s_server.c
+++ b/crypto/openssl/apps/s_server.c
@@ -652,6 +652,12 @@ static void sv_usage(void)
" -no_ticket - disable use of RFC4507bis session tickets\n");
BIO_printf(bio_err,
" -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
+ BIO_printf(bio_err,
+ " -sigalgs arg - Signature algorithms to support (colon-separated list)\n");
+ BIO_printf(bio_err,
+ " -client_sigalgs arg - Signature algorithms to support for client \n");
+ BIO_printf(bio_err,
+ " certificate authentication (colon-separated list)\n");
# ifndef OPENSSL_NO_NEXTPROTONEG
BIO_printf(bio_err,
" -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n");
@@ -2881,6 +2887,21 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context)
goto err;
} else {
BIO_printf(bio_s_out, "read R BLOCK\n");
+#ifndef OPENSSL_NO_SRP
+ if (BIO_should_io_special(io)
+ && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
+ BIO_printf(bio_s_out, "LOOKUP renego during read\n");
+ srp_callback_parm.user =
+ SRP_VBASE_get_by_user(srp_callback_parm.vb,
+ srp_callback_parm.login);
+ if (srp_callback_parm.user)
+ BIO_printf(bio_s_out, "LOOKUP done %s\n",
+ srp_callback_parm.user->info);
+ else
+ BIO_printf(bio_s_out, "LOOKUP not successful\n");
+ continue;
+ }
+#endif
#if defined(OPENSSL_SYS_NETWARE)
delay(1000);
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
@@ -3211,6 +3232,21 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context)
ERR_print_errors(bio_err);
goto end;
}
+#ifndef OPENSSL_NO_SRP
+ if (BIO_should_io_special(io)
+ && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
+ BIO_printf(bio_s_out, "LOOKUP renego during accept\n");
+ srp_callback_parm.user =
+ SRP_VBASE_get_by_user(srp_callback_parm.vb,
+ srp_callback_parm.login);
+ if (srp_callback_parm.user)
+ BIO_printf(bio_s_out, "LOOKUP done %s\n",
+ srp_callback_parm.user->info);
+ else
+ BIO_printf(bio_s_out, "LOOKUP not successful\n");
+ continue;
+ }
+#endif
}
BIO_printf(bio_err, "CONNECTION ESTABLISHED\n");
print_ssl_summary(bio_err, con);
@@ -3224,6 +3260,21 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context)
goto err;
} else {
BIO_printf(bio_s_out, "read R BLOCK\n");
+#ifndef OPENSSL_NO_SRP
+ if (BIO_should_io_special(io)
+ && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
+ BIO_printf(bio_s_out, "LOOKUP renego during read\n");
+ srp_callback_parm.user =
+ SRP_VBASE_get_by_user(srp_callback_parm.vb,
+ srp_callback_parm.login);
+ if (srp_callback_parm.user)
+ BIO_printf(bio_s_out, "LOOKUP done %s\n",
+ srp_callback_parm.user->info);
+ else
+ BIO_printf(bio_s_out, "LOOKUP not successful\n");
+ continue;
+ }
+#endif
#if defined(OPENSSL_SYS_NETWARE)
delay(1000);
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
diff --git a/crypto/openssl/appveyor.yml b/crypto/openssl/appveyor.yml
new file mode 100644
index 0000000..8695359
--- /dev/null
+++ b/crypto/openssl/appveyor.yml
@@ -0,0 +1,60 @@
+platform:
+ - x86
+ - x64
+
+environment:
+ matrix:
+ - VSVER: 9
+ - VSVER: 10
+ - VSVER: 11
+ - VSVER: 12
+ - VSVER: 14
+
+configuration:
+ - plain
+ - shared
+
+matrix:
+ allow_failures:
+ - platform: x64
+ VSVER: 9
+ - platform: x64
+ VSVER: 10
+ - platform: x64
+ VSVER: 11
+
+before_build:
+ - ps: >-
+ If ($env:Platform -Match "x86") {
+ $env:VCVARS_PLATFORM="x86"
+ $env:TARGET="VC-WIN32"
+ $env:DO="do_ms"
+ } Else {
+ $env:VCVARS_PLATFORM="amd64"
+ $env:TARGET="VC-WIN64A"
+ $env:DO="do_win64a"
+ }
+ - ps: >-
+ If ($env:Configuration -Like "*shared*") {
+ $env:MAK="ntdll.mak"
+ } Else {
+ $env:MAK="nt.mak"
+ }
+ - ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
+ - call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
+ - perl Configure %TARGET% no-asm
+ - call ms\%DO%
+
+build_script:
+ - nmake /f ms\%MAK%
+
+test_script:
+ - nmake /f ms\%MAK% test
+
+notifications:
+ - provider: Email
+ to:
+ - openssl-commits@openssl.org
+ on_build_success: false
+ on_build_failure: true
+ on_build_status_changed: true
diff --git a/crypto/openssl/crypto/aes/asm/aes-586.pl b/crypto/openssl/crypto/aes/asm/aes-586.pl
index 451d0e0..60286ecb 100755
--- a/crypto/openssl/crypto/aes/asm/aes-586.pl
+++ b/crypto/openssl/crypto/aes/asm/aes-586.pl
@@ -45,7 +45,7 @@
# the undertaken effort was that it appeared that in tight IA-32
# register window little-endian flavor could achieve slightly higher
# Instruction Level Parallelism, and it indeed resulted in up to 15%
-# better performance on most recent µ-archs...
+# better performance on most recent µ-archs...
#
# Third version adds AES_cbc_encrypt implementation, which resulted in
# up to 40% performance imrovement of CBC benchmark results. 40% was
@@ -224,7 +224,7 @@ sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
$speed_limit=512; # chunks smaller than $speed_limit are
# processed with compact routine in CBC mode
$small_footprint=1; # $small_footprint=1 code is ~5% slower [on
- # recent µ-archs], but ~5 times smaller!
+ # recent µ-archs], but ~5 times smaller!
# I favor compact code to minimize cache
# contention and in hope to "collect" 5% back
# in real-life applications...
@@ -565,7 +565,7 @@ sub enctransform()
# Performance is not actually extraordinary in comparison to pure
# x86 code. In particular encrypt performance is virtually the same.
# Decrypt performance on the other hand is 15-20% better on newer
-# µ-archs [but we're thankful for *any* improvement here], and ~50%
+# µ-archs [but we're thankful for *any* improvement here], and ~50%
# better on PIII:-) And additionally on the pros side this code
# eliminates redundant references to stack and thus relieves/
# minimizes the pressure on the memory bus.
diff --git a/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl b/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl
index 33b1aed..5a100fa 100755
--- a/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl
+++ b/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl
@@ -63,7 +63,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
diff --git a/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl b/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
index 97992ad..c803cde 100755
--- a/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
+++ b/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
@@ -94,7 +94,7 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
$avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
`ml64 2>&1` =~ /Version ([0-9]+)\./ &&
$1>=10);
-$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
+$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
$shaext=1; ### set to zero if compiling for 1.0.1
diff --git a/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl b/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
index 19b0433..bfe2926 100755
--- a/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
+++ b/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
@@ -59,7 +59,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=12);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
@@ -139,11 +139,8 @@ $code.=<<___ if ($avx>1);
je ${func}_avx2
___
$code.=<<___;
- and \$`1<<30`,%eax # mask "Intel CPU" bit
- and \$`1<<28|1<<9`,%r10d # mask AVX+SSSE3 bits
- or %eax,%r10d
- cmp \$`1<<28|1<<9|1<<30`,%r10d
- je ${func}_avx
+ and \$`1<<28`,%r10d # check for AVX
+ jnz ${func}_avx
ud2
___
}
diff --git a/crypto/openssl/crypto/aes/asm/aesni-x86.pl b/crypto/openssl/crypto/aes/asm/aesni-x86.pl
index f67df8c..9b2e37a 100755
--- a/crypto/openssl/crypto/aes/asm/aesni-x86.pl
+++ b/crypto/openssl/crypto/aes/asm/aesni-x86.pl
@@ -88,7 +88,7 @@ $inout3="xmm5"; $in1="xmm5";
$inout4="xmm6"; $in0="xmm6";
$inout5="xmm7"; $ivec="xmm7";
-# AESNI extenstion
+# AESNI extension
sub aeskeygenassist
{ my($dst,$src,$imm)=@_;
if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/)
diff --git a/crypto/openssl/crypto/aes/asm/vpaes-ppc.pl b/crypto/openssl/crypto/aes/asm/vpaes-ppc.pl
index 7fda60e..1759ae9 100755
--- a/crypto/openssl/crypto/aes/asm/vpaes-ppc.pl
+++ b/crypto/openssl/crypto/aes/asm/vpaes-ppc.pl
@@ -337,24 +337,27 @@ Lenc_entry:
addi $inp, $inp, 15 # 15 is not a typo
?lvsr $outperm, 0, $out
?lvsl $keyperm, 0, $key # prepare for unaligned access
- vnor $outmask, v7, v7 # 0xff..ff
lvx $inptail, 0, $inp # redundant in aligned case
- ?vperm $outmask, v7, $outmask, $outperm
- lvx $outhead, 0, $out
?vperm v0, v0, $inptail, $inpperm
bl _vpaes_encrypt_core
+ andi. r8, $out, 15
+ li r9, 16
+ beq Lenc_out_aligned
+
vperm v0, v0, v0, $outperm # rotate right/left
- vsel v1, $outhead, v0, $outmask
- vmr $outhead, v0
- stvx v1, 0, $out
- addi $out, $out, 15 # 15 is not a typo
- ########
+ mtctr r9
+Lenc_out_unaligned:
+ stvebx v0, 0, $out
+ addi $out, $out, 1
+ bdnz Lenc_out_unaligned
+ b Lenc_done
- lvx v1, 0, $out # redundant in aligned case
- vsel v1, $outhead, v1, $outmask
- stvx v1, 0, $out
+.align 4
+Lenc_out_aligned:
+ stvx v0, 0, $out
+Lenc_done:
li r10,`15+6*$SIZE_T`
li r11,`31+6*$SIZE_T`
@@ -566,24 +569,27 @@ Ldec_entry:
addi $inp, $inp, 15 # 15 is not a typo
?lvsr $outperm, 0, $out
?lvsl $keyperm, 0, $key
- vnor $outmask, v7, v7 # 0xff..ff
lvx $inptail, 0, $inp # redundant in aligned case
- ?vperm $outmask, v7, $outmask, $outperm
- lvx $outhead, 0, $out
?vperm v0, v0, $inptail, $inpperm
bl _vpaes_decrypt_core
+ andi. r8, $out, 15
+ li r9, 16
+ beq Ldec_out_aligned
+
vperm v0, v0, v0, $outperm # rotate right/left
- vsel v1, $outhead, v0, $outmask
- vmr $outhead, v0
- stvx v1, 0, $out
- addi $out, $out, 15 # 15 is not a typo
- ########
+ mtctr r9
+Ldec_out_unaligned:
+ stvebx v0, 0, $out
+ addi $out, $out, 1
+ bdnz Ldec_out_unaligned
+ b Ldec_done
- lvx v1, 0, $out # redundant in aligned case
- vsel v1, $outhead, v1, $outmask
- stvx v1, 0, $out
+.align 4
+Ldec_out_aligned:
+ stvx v0, 0, $out
+Ldec_done:
li r10,`15+6*$SIZE_T`
li r11,`31+6*$SIZE_T`
@@ -658,11 +664,11 @@ Ldec_entry:
$PUSH r0, `$FRAME+$SIZE_T*2+$LRSAVE`($sp)
and r30, r5, r9 # copy length&-16
+ andi. r9, $out, 15 # is $out aligned?
mr r5, r6 # copy pointer to key
mr r31, r7 # copy pointer to iv
- blt Lcbc_abort
- cmpwi r8, 0 # test direction
li r6, -1
+ mcrf cr1, cr0 # put aside $out alignment flag
mr r7, r12 # copy vrsave
mtspr 256, r6 # preserve all AltiVec registers
@@ -672,6 +678,7 @@ Ldec_entry:
lvx v25, r9, r31
?vperm v24, v24, v25, $inpperm
+ cmpwi r8, 0 # test direction
neg r8, $inp # prepare for unaligned access
vxor v7, v7, v7
?lvsl $keyperm, 0, $key
@@ -681,13 +688,37 @@ Ldec_entry:
lvx $inptail, 0, $inp
?vperm $outmask, v7, $outmask, $outperm
addi $inp, $inp, 15 # 15 is not a typo
- lvx $outhead, 0, $out
beq Lcbc_decrypt
bl _vpaes_encrypt_preheat
li r0, 16
+ beq cr1, Lcbc_enc_loop # $out is aligned
+
+ vmr v0, $inptail
+ lvx $inptail, 0, $inp
+ addi $inp, $inp, 16
+ ?vperm v0, v0, $inptail, $inpperm
+ vxor v0, v0, v24 # ^= iv
+
+ bl _vpaes_encrypt_core
+
+ andi. r8, $out, 15
+ vmr v24, v0 # put aside iv
+ sub r9, $out, r8
+ vperm $outhead, v0, v0, $outperm # rotate right/left
+
+Lcbc_enc_head:
+ stvebx $outhead, r8, r9
+ cmpwi r8, 15
+ addi r8, r8, 1
+ bne Lcbc_enc_head
+
+ sub. r30, r30, r0 # len -= 16
+ addi $out, $out, 16
+ beq Lcbc_unaligned_done
+
Lcbc_enc_loop:
vmr v0, $inptail
lvx $inptail, 0, $inp
@@ -713,6 +744,32 @@ Lcbc_decrypt:
bl _vpaes_decrypt_preheat
li r0, 16
+ beq cr1, Lcbc_dec_loop # $out is aligned
+
+ vmr v0, $inptail
+ lvx $inptail, 0, $inp
+ addi $inp, $inp, 16
+ ?vperm v0, v0, $inptail, $inpperm
+ vmr v25, v0 # put aside input
+
+ bl _vpaes_decrypt_core
+
+ andi. r8, $out, 15
+ vxor v0, v0, v24 # ^= iv
+ vmr v24, v25
+ sub r9, $out, r8
+ vperm $outhead, v0, v0, $outperm # rotate right/left
+
+Lcbc_dec_head:
+ stvebx $outhead, r8, r9
+ cmpwi r8, 15
+ addi r8, r8, 1
+ bne Lcbc_dec_head
+
+ sub. r30, r30, r0 # len -= 16
+ addi $out, $out, 16
+ beq Lcbc_unaligned_done
+
Lcbc_dec_loop:
vmr v0, $inptail
lvx $inptail, 0, $inp
@@ -733,23 +790,29 @@ Lcbc_dec_loop:
bne Lcbc_dec_loop
Lcbc_done:
- addi $out, $out, -1
- lvx v1, 0, $out # redundant in aligned case
- vsel v1, $outhead, v1, $outmask
- stvx v1, 0, $out
-
+ beq cr1, Lcbc_write_iv # $out is aligned
+
+Lcbc_unaligned_done:
+ andi. r8, $out, 15
+ sub $out, $out, r8
+ li r9, 0
+Lcbc_tail:
+ stvebx $outhead, r9, $out
+ addi r9, r9, 1
+ cmpw r9, r8
+ bne Lcbc_tail
+
+Lcbc_write_iv:
neg r8, r31 # write [potentially unaligned] iv
+ li r10, 4
?lvsl $outperm, 0, r8
- li r6, 15
- vnor $outmask, v7, v7 # 0xff..ff
- ?vperm $outmask, v7, $outmask, $outperm
- lvx $outhead, 0, r31
+ li r11, 8
+ li r12, 12
vperm v24, v24, v24, $outperm # rotate right/left
- vsel v0, $outhead, v24, $outmask
- lvx v1, r6, r31
- stvx v0, 0, r31
- vsel v1, v24, v1, $outmask
- stvx v1, r6, r31
+ stvewx v24, 0, r31 # ivp is at least 32-bit aligned
+ stvewx v24, r10, r31
+ stvewx v24, r11, r31
+ stvewx v24, r12, r31
mtspr 256, r7 # restore vrsave
li r10,`15+6*$SIZE_T`
@@ -872,18 +935,21 @@ _vpaes_schedule_core:
# encrypting, output zeroth round key after transform
li r8, 0x30 # mov \$0x30,%r8d
- addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
+ li r9, 4
+ li r10, 8
+ li r11, 12
?lvsr $outperm, 0, $out # prepare for unaligned access
vnor $outmask, v9, v9 # 0xff..ff
- lvx $outhead, 0, $out
?vperm $outmask, v9, $outmask, $outperm
#stvx v0, 0, $out # vmovdqu %xmm0, (%rdx)
- vperm v1, v0, v0, $outperm # rotate right/left
- vsel v2, $outhead, v1, $outmask
- vmr $outhead, v1
- stvx v2, 0, $out
+ vperm $outhead, v0, v0, $outperm # rotate right/left
+ stvewx $outhead, 0, $out # some are superfluous
+ stvewx $outhead, r9, $out
+ stvewx $outhead, r10, $out
+ addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
+ stvewx $outhead, r11, $out
b Lschedule_go
Lschedule_am_decrypting:
@@ -893,20 +959,24 @@ Lschedule_am_decrypting:
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
# decrypting, output zeroth round key after shiftrows
lvx v1, r8, r10 # vmovdqa (%r8,%r10), %xmm1
+ li r9, 4
+ li r10, 8
+ li r11, 12
vperm v4, v3, v3, v1 # vpshufb %xmm1, %xmm3, %xmm3
neg r0, $out # prepare for unaligned access
?lvsl $outperm, 0, r0
- addi $out, $out, 15 # 15 is not typo
vnor $outmask, v9, v9 # 0xff..ff
- lvx $outhead, 0, $out
?vperm $outmask, $outmask, v9, $outperm
#stvx v4, 0, $out # vmovdqu %xmm3, (%rdx)
- vperm v4, v4, v4, $outperm # rotate right/left
- vsel v2, $outhead, v4, $outmask
- vmr $outhead, v4
- stvx v2, 0, $out
+ vperm $outhead, v4, v4, $outperm # rotate right/left
+ stvewx $outhead, 0, $out # some are superfluous
+ stvewx $outhead, r9, $out
+ stvewx $outhead, r10, $out
+ addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
+ stvewx $outhead, r11, $out
+ addi $out, $out, 15 # 15 is not typo
xori r8, r8, 0x30 # xor \$0x30, %r8
Lschedule_go:
@@ -1038,14 +1108,15 @@ Lschedule_mangle_last:
#stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key
vperm v0, v0, v0, $outperm # rotate right/left
+ li r10, 4
vsel v2, $outhead, v0, $outmask
- vmr $outhead, v0
+ li r11, 8
stvx v2, 0, $out
-
- addi $out, $out, 15 # 15 is not typo
- lvx v1, 0, $out # redundant in aligned case
- vsel v1, $outhead, v1, $outmask
- stvx v1, 0, $out
+ li r12, 12
+ stvewx v0, 0, $out # some (or all) are redundant
+ stvewx v0, r10, $out
+ stvewx v0, r11, $out
+ stvewx v0, r12, $out
b Lschedule_mangle_done
.align 4
@@ -1057,15 +1128,18 @@ Lschedule_mangle_last_dec:
bl _vpaes_schedule_transform # output transform
#stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key
+ addi r9, $out, -15 # -15 is not typo
vperm v0, v0, v0, $outperm # rotate right/left
+ li r10, 4
vsel v2, $outhead, v0, $outmask
- vmr $outhead, v0
+ li r11, 8
stvx v2, 0, $out
+ li r12, 12
+ stvewx v0, 0, r9 # some (or all) are redundant
+ stvewx v0, r10, r9
+ stvewx v0, r11, r9
+ stvewx v0, r12, r9
- addi $out, $out, -15 # -15 is not typo
- lvx v1, 0, $out # redundant in aligned case
- vsel v1, $outhead, v1, $outmask
- stvx v1, 0, $out
Lschedule_mangle_done:
mtlr r7
diff --git a/crypto/openssl/crypto/asn1/asn1_par.c b/crypto/openssl/crypto/asn1/asn1_par.c
index a5d2da1..0ca985a 100644
--- a/crypto/openssl/crypto/asn1/asn1_par.c
+++ b/crypto/openssl/crypto/asn1/asn1_par.c
@@ -62,6 +62,10 @@
#include <openssl/objects.h>
#include <openssl/asn1.h>
+#ifndef ASN1_PARSE_MAXDEPTH
+#define ASN1_PARSE_MAXDEPTH 128
+#endif
+
static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
int indent);
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
@@ -128,6 +132,12 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
#else
dump_indent = 6; /* Because we know BIO_dump_indent() */
#endif
+
+ if (depth > ASN1_PARSE_MAXDEPTH) {
+ BIO_puts(bp, "BAD RECURSION DEPTH\n");
+ return 0;
+ }
+
p = *pp;
tot = p + length;
op = p - 1;
diff --git a/crypto/openssl/crypto/asn1/d2i_pr.c b/crypto/openssl/crypto/asn1/d2i_pr.c
index c96da09..d21829a 100644
--- a/crypto/openssl/crypto/asn1/d2i_pr.c
+++ b/crypto/openssl/crypto/asn1/d2i_pr.c
@@ -72,6 +72,7 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
long length)
{
EVP_PKEY *ret;
+ const unsigned char *p = *pp;
if ((a == NULL) || (*a == NULL)) {
if ((ret = EVP_PKEY_new()) == NULL) {
@@ -94,21 +95,23 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
}
if (!ret->ameth->old_priv_decode ||
- !ret->ameth->old_priv_decode(ret, pp, length)) {
+ !ret->ameth->old_priv_decode(ret, &p, length)) {
if (ret->ameth->priv_decode) {
PKCS8_PRIV_KEY_INFO *p8 = NULL;
- p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length);
+ p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
if (!p8)
goto err;
EVP_PKEY_free(ret);
ret = EVP_PKCS82PKEY(p8);
PKCS8_PRIV_KEY_INFO_free(p8);
-
+ if (ret == NULL)
+ goto err;
} else {
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
goto err;
}
}
+ *pp = p;
if (a != NULL)
(*a) = ret;
return (ret);
@@ -136,6 +139,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
* input is surrounded by an ASN1 SEQUENCE.
*/
inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length);
+ p = *pp;
/*
* Since we only need to discern "traditional format" RSA and DSA keys we
* can just count the elements.
@@ -146,7 +150,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
keytype = EVP_PKEY_EC;
else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not
* traditional format */
- PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length);
+ PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
EVP_PKEY *ret;
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
@@ -157,6 +161,9 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
}
ret = EVP_PKCS82PKEY(p8);
PKCS8_PRIV_KEY_INFO_free(p8);
+ if (ret == NULL)
+ return NULL;
+ *pp = p;
if (a) {
*a = ret;
}
diff --git a/crypto/openssl/crypto/asn1/tasn_dec.c b/crypto/openssl/crypto/asn1/tasn_dec.c
index 7fd336a..9256049 100644
--- a/crypto/openssl/crypto/asn1/tasn_dec.c
+++ b/crypto/openssl/crypto/asn1/tasn_dec.c
@@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
int otag;
int ret = 0;
ASN1_VALUE **pchptr, *ptmpval;
+ int combine = aclass & ASN1_TFLG_COMBINE;
+ aclass &= ~ASN1_TFLG_COMBINE;
if (!pval)
return 0;
if (aux && aux->asn1_cb)
@@ -350,9 +352,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
}
asn1_set_choice_selector(pval, i, it);
- *in = p;
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
goto auxerr;
+ *in = p;
return 1;
case ASN1_ITYPE_NDEF_SEQUENCE:
@@ -489,9 +491,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
/* Save encoding */
if (!asn1_enc_save(pval, *in, p - *in, it))
goto auxerr;
- *in = p;
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
goto auxerr;
+ *in = p;
return 1;
default:
@@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
auxerr:
ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR);
err:
- ASN1_item_ex_free(pval, it);
+ if (combine == 0)
+ ASN1_item_ex_free(pval, it);
if (errtt)
ERR_add_error_data(4, "Field=", errtt->field_name,
", Type=", it->sname);
@@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
} else {
/* Nothing special */
ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
- -1, 0, opt, ctx);
+ -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx);
if (!ret) {
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR);
goto err;
diff --git a/crypto/openssl/crypto/asn1/x_bignum.c b/crypto/openssl/crypto/asn1/x_bignum.c
index a5a403c..eaf0466 100644
--- a/crypto/openssl/crypto/asn1/x_bignum.c
+++ b/crypto/openssl/crypto/asn1/x_bignum.c
@@ -141,8 +141,9 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
int utype, char *free_cont, const ASN1_ITEM *it)
{
BIGNUM *bn;
- if (!*pval)
- bn_new(pval, it);
+
+ if (*pval == NULL && !bn_new(pval, it))
+ return 0;
bn = (BIGNUM *)*pval;
if (!BN_bin2bn(cont, len, bn)) {
bn_free(pval, it);
diff --git a/crypto/openssl/crypto/asn1/x_pubkey.c b/crypto/openssl/crypto/asn1/x_pubkey.c
index 4b68201..6c57a79 100644
--- a/crypto/openssl/crypto/asn1/x_pubkey.c
+++ b/crypto/openssl/crypto/asn1/x_pubkey.c
@@ -188,13 +188,16 @@ EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length)
{
X509_PUBKEY *xpk;
EVP_PKEY *pktmp;
- xpk = d2i_X509_PUBKEY(NULL, pp, length);
+ const unsigned char *q;
+ q = *pp;
+ xpk = d2i_X509_PUBKEY(NULL, &q, length);
if (!xpk)
return NULL;
pktmp = X509_PUBKEY_get(xpk);
X509_PUBKEY_free(xpk);
if (!pktmp)
return NULL;
+ *pp = q;
if (a) {
EVP_PKEY_free(*a);
*a = pktmp;
diff --git a/crypto/openssl/crypto/asn1/x_x509.c b/crypto/openssl/crypto/asn1/x_x509.c
index 5f266a2..e2cac83 100644
--- a/crypto/openssl/crypto/asn1/x_x509.c
+++ b/crypto/openssl/crypto/asn1/x_x509.c
@@ -180,16 +180,15 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
if (!a || *a == NULL) {
freeret = 1;
}
- ret = d2i_X509(a, pp, length);
+ ret = d2i_X509(a, &q, length);
/* If certificate unreadable then forget it */
if (!ret)
return NULL;
/* update length */
- length -= *pp - q;
- if (!length)
- return ret;
- if (!d2i_X509_CERT_AUX(&ret->aux, pp, length))
+ length -= q - *pp;
+ if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length))
goto err;
+ *pp = q;
return ret;
err:
if (freeret) {
diff --git a/crypto/openssl/crypto/asn1/x_x509a.c b/crypto/openssl/crypto/asn1/x_x509a.c
index 76bbc13..ad93592 100644
--- a/crypto/openssl/crypto/asn1/x_x509a.c
+++ b/crypto/openssl/crypto/asn1/x_x509a.c
@@ -163,10 +163,13 @@ int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj)
if (!(objtmp = OBJ_dup(obj)))
return 0;
if (!(aux = aux_get(x)))
- return 0;
+ goto err;
if (!aux->reject && !(aux->reject = sk_ASN1_OBJECT_new_null()))
- return 0;
+ goto err;
return sk_ASN1_OBJECT_push(aux->reject, objtmp);
+ err:
+ ASN1_OBJECT_free(objtmp);
+ return 0;
}
void X509_trust_clear(X509 *x)
diff --git a/crypto/openssl/crypto/bio/b_dump.c b/crypto/openssl/crypto/bio/b_dump.c
index ed8e521..ccf0e28 100644
--- a/crypto/openssl/crypto/bio/b_dump.c
+++ b/crypto/openssl/crypto/bio/b_dump.c
@@ -104,7 +104,6 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
if ((rows * dump_width) < len)
rows++;
for (i = 0; i < rows; i++) {
- buf[0] = '\0'; /* start with empty string */
BUF_strlcpy(buf, str, sizeof buf);
BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
BUF_strlcat(buf, tmp, sizeof buf);
diff --git a/crypto/openssl/crypto/bio/bss_file.c b/crypto/openssl/crypto/bio/bss_file.c
index d7f15b0..bfba93e 100644
--- a/crypto/openssl/crypto/bio/bss_file.c
+++ b/crypto/openssl/crypto/bio/bss_file.c
@@ -115,9 +115,8 @@ static BIO_METHOD methods_filep = {
NULL,
};
-BIO *BIO_new_file(const char *filename, const char *mode)
+static FILE *file_fopen(const char *filename, const char *mode)
{
- BIO *ret;
FILE *file = NULL;
# if defined(_WIN32) && defined(CP_UTF8)
@@ -164,6 +163,14 @@ BIO *BIO_new_file(const char *filename, const char *mode)
# else
file = fopen(filename, mode);
# endif
+ return (file);
+}
+
+BIO *BIO_new_file(const char *filename, const char *mode)
+{
+ BIO *ret;
+ FILE *file = file_fopen(filename, mode);
+
if (file == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
@@ -386,7 +393,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
else
strcat(p, "t");
# endif
- fp = fopen(ptr, p);
+ fp = file_fopen(ptr, p);
if (fp == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");
diff --git a/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl b/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl
index 8f529c9..72381a7 100755
--- a/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl
+++ b/crypto/openssl/crypto/bn/asm/armv4-gf2m.pl
@@ -27,7 +27,7 @@
# referred below, which improves ECDH and ECDSA verify benchmarks
# by 18-40%.
#
-# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software
+# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software
# Polynomial Multiplication on ARM Processors using the NEON Engine.
#
# http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf
@@ -136,7 +136,7 @@ ___
################
# void bn_GF2m_mul_2x2(BN_ULONG *r,
# BN_ULONG a1,BN_ULONG a0,
-# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0·b1b0
+# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0·b1b0
{
$code.=<<___;
.global bn_GF2m_mul_2x2
@@ -159,7 +159,7 @@ $code.=<<___;
mov $mask,#7<<2
sub sp,sp,#32 @ allocate tab[8]
- bl mul_1x1_ialu @ a1·b1
+ bl mul_1x1_ialu @ a1·b1
str $lo,[$ret,#8]
str $hi,[$ret,#12]
@@ -169,13 +169,13 @@ $code.=<<___;
eor r2,r2,$a
eor $b,$b,r3
eor $a,$a,r2
- bl mul_1x1_ialu @ a0·b0
+ bl mul_1x1_ialu @ a0·b0
str $lo,[$ret]
str $hi,[$ret,#4]
eor $a,$a,r2
eor $b,$b,r3
- bl mul_1x1_ialu @ (a1+a0)·(b1+b0)
+ bl mul_1x1_ialu @ (a1+a0)·(b1+b0)
___
@r=map("r$_",(6..9));
$code.=<<___;
diff --git a/crypto/openssl/crypto/bn/asm/ia64.S b/crypto/openssl/crypto/bn/asm/ia64.S
index 951abc5..a9a42ab 100644
--- a/crypto/openssl/crypto/bn/asm/ia64.S
+++ b/crypto/openssl/crypto/bn/asm/ia64.S
@@ -422,7 +422,7 @@ bn_mul_add_words:
// This loop spins in 3*(n+10) ticks on Itanium and in 2*(n+10) on
// Itanium 2. Yes, unlike previous versions it scales:-) Previous
-// version was peforming *all* additions in IALU and was starving
+// version was performing *all* additions in IALU and was starving
// for those even on Itanium 2. In this version one addition is
// moved to FPU and is folded with multiplication. This is at cost
// of propogating the result from previous call to this subroutine
@@ -568,7 +568,7 @@ bn_sqr_comba8:
// I've estimated this routine to run in ~120 ticks, but in reality
// (i.e. according to ar.itc) it takes ~160 ticks. Are those extra
// cycles consumed for instructions fetch? Or did I misinterpret some
-// clause in Itanium µ-architecture manual? Comments are welcomed and
+// clause in Itanium µ-architecture manual? Comments are welcomed and
// highly appreciated.
//
// On Itanium 2 it takes ~190 ticks. This is because of stalls on
diff --git a/crypto/openssl/crypto/bn/asm/ppc64-mont.pl b/crypto/openssl/crypto/bn/asm/ppc64-mont.pl
index 68e3733..9e3c12d 100755
--- a/crypto/openssl/crypto/bn/asm/ppc64-mont.pl
+++ b/crypto/openssl/crypto/bn/asm/ppc64-mont.pl
@@ -94,6 +94,8 @@ if ($flavour =~ /32/) {
$POP= "ld";
} else { die "nonsense $flavour"; }
+$LITTLE_ENDIAN = ($flavour=~/le$/) ? 4 : 0;
+
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
@@ -294,12 +296,12 @@ $code.=<<___ if ($SIZE_T==8);
extrdi $t0,$a0,32,32 ; lwz $t0,4($ap)
extrdi $t1,$a0,32,0 ; lwz $t1,0($ap)
- lwz $t2,12($ap) ; load a[1] as 32-bit word pair
- lwz $t3,8($ap)
- lwz $t4,4($np) ; load n[0] as 32-bit word pair
- lwz $t5,0($np)
- lwz $t6,12($np) ; load n[1] as 32-bit word pair
- lwz $t7,8($np)
+ lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[1] as 32-bit word pair
+ lwz $t3,`8^$LITTLE_ENDIAN`($ap)
+ lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[0] as 32-bit word pair
+ lwz $t5,`0^$LITTLE_ENDIAN`($np)
+ lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[1] as 32-bit word pair
+ lwz $t7,`8^$LITTLE_ENDIAN`($np)
___
$code.=<<___ if ($SIZE_T==4);
lwz $a0,0($ap) ; pull ap[0,1] value
@@ -463,14 +465,14 @@ $code.=<<___;
L1st:
___
$code.=<<___ if ($SIZE_T==8);
- lwz $t0,4($ap) ; load a[j] as 32-bit word pair
- lwz $t1,0($ap)
- lwz $t2,12($ap) ; load a[j+1] as 32-bit word pair
- lwz $t3,8($ap)
- lwz $t4,4($np) ; load n[j] as 32-bit word pair
- lwz $t5,0($np)
- lwz $t6,12($np) ; load n[j+1] as 32-bit word pair
- lwz $t7,8($np)
+ lwz $t0,`4^$LITTLE_ENDIAN`($ap) ; load a[j] as 32-bit word pair
+ lwz $t1,`0^$LITTLE_ENDIAN`($ap)
+ lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[j+1] as 32-bit word pair
+ lwz $t3,`8^$LITTLE_ENDIAN`($ap)
+ lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[j] as 32-bit word pair
+ lwz $t5,`0^$LITTLE_ENDIAN`($np)
+ lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[j+1] as 32-bit word pair
+ lwz $t7,`8^$LITTLE_ENDIAN`($np)
___
$code.=<<___ if ($SIZE_T==4);
lwz $t0,0($ap) ; load a[j..j+3] as 32-bit word pairs
@@ -505,14 +507,14 @@ $code.=<<___;
___
} else {
$code.=<<___;
- lwz $t1,`$FRAME+0`($sp)
- lwz $t0,`$FRAME+4`($sp)
- lwz $t3,`$FRAME+8`($sp)
- lwz $t2,`$FRAME+12`($sp)
- lwz $t5,`$FRAME+16`($sp)
- lwz $t4,`$FRAME+20`($sp)
- lwz $t7,`$FRAME+24`($sp)
- lwz $t6,`$FRAME+28`($sp)
+ lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
+ lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
+ lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
+ lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
+ lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
+ lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
+ lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
+ lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
___
}
$code.=<<___;
@@ -651,8 +653,8 @@ $code.=<<___;
fmadd $T1a,$N1,$na,$T1a
fmadd $T1b,$N1,$nb,$T1b
- lwz $t3,`$FRAME+32`($sp) ; permuted $t1
- lwz $t2,`$FRAME+36`($sp) ; permuted $t0
+ lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
+ lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
addc $t4,$t4,$carry
adde $t5,$t5,$c1
srwi $carry,$t4,16
@@ -673,8 +675,8 @@ $code.=<<___;
fmadd $T1a,$N0,$nc,$T1a
fmadd $T1b,$N0,$nd,$T1b
- lwz $t7,`$FRAME+40`($sp) ; permuted $t3
- lwz $t6,`$FRAME+44`($sp) ; permuted $t2
+ lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
+ lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
addc $t2,$t2,$carry
adde $t3,$t3,$c1
srwi $carry,$t2,16
@@ -686,8 +688,8 @@ $code.=<<___;
insrwi $carry,$t3,16,0
fmadd $T3a,$N2,$nc,$T3a
fmadd $T3b,$N2,$nd,$T3b
- lwz $t1,`$FRAME+48`($sp) ; permuted $t5
- lwz $t0,`$FRAME+52`($sp) ; permuted $t4
+ lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
+ lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
addc $t6,$t6,$carry
adde $t7,$t7,$c1
srwi $carry,$t6,16
@@ -699,8 +701,8 @@ $code.=<<___;
fctid $T0a,$T0a
fctid $T0b,$T0b
- lwz $t5,`$FRAME+56`($sp) ; permuted $t7
- lwz $t4,`$FRAME+60`($sp) ; permuted $t6
+ lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
+ lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
addc $t0,$t0,$carry
adde $t1,$t1,$c1
srwi $carry,$t0,16
@@ -787,14 +789,14 @@ $code.=<<___;
___
} else {
$code.=<<___;
- lwz $t1,`$FRAME+0`($sp)
- lwz $t0,`$FRAME+4`($sp)
- lwz $t3,`$FRAME+8`($sp)
- lwz $t2,`$FRAME+12`($sp)
- lwz $t5,`$FRAME+16`($sp)
- lwz $t4,`$FRAME+20`($sp)
- lwz $t7,`$FRAME+24`($sp)
- lwz $t6,`$FRAME+28`($sp)
+ lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
+ lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
+ lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
+ lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
+ lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
+ lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
+ lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
+ lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
stfd $dota,`$FRAME+64`($sp)
stfd $dotb,`$FRAME+72`($sp)
@@ -823,14 +825,14 @@ $code.=<<___;
stw $t0,12($tp) ; tp[j-1]
stw $t4,8($tp)
- lwz $t3,`$FRAME+32`($sp) ; permuted $t1
- lwz $t2,`$FRAME+36`($sp) ; permuted $t0
- lwz $t7,`$FRAME+40`($sp) ; permuted $t3
- lwz $t6,`$FRAME+44`($sp) ; permuted $t2
- lwz $t1,`$FRAME+48`($sp) ; permuted $t5
- lwz $t0,`$FRAME+52`($sp) ; permuted $t4
- lwz $t5,`$FRAME+56`($sp) ; permuted $t7
- lwz $t4,`$FRAME+60`($sp) ; permuted $t6
+ lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
+ lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
+ lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
+ lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
+ lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
+ lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
+ lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
+ lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
addc $t2,$t2,$carry
adde $t3,$t3,$c1
@@ -857,10 +859,10 @@ $code.=<<___;
stw $t2,20($tp) ; tp[j]
stwu $t0,16($tp)
- lwz $t7,`$FRAME+64`($sp)
- lwz $t6,`$FRAME+68`($sp)
- lwz $t5,`$FRAME+72`($sp)
- lwz $t4,`$FRAME+76`($sp)
+ lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp)
+ lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp)
+ lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp)
+ lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp)
addc $t6,$t6,$carry
adde $t7,$t7,$c1
@@ -1165,23 +1167,23 @@ ___
$code.=<<___;
fmadd $T1a,$N1,$na,$T1a
fmadd $T1b,$N1,$nb,$T1b
- lwz $t1,`$FRAME+0`($sp)
- lwz $t0,`$FRAME+4`($sp)
+ lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
+ lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
fmadd $T2a,$N2,$na,$T2a
fmadd $T2b,$N2,$nb,$T2b
- lwz $t3,`$FRAME+8`($sp)
- lwz $t2,`$FRAME+12`($sp)
+ lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
+ lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
fmadd $T3a,$N3,$na,$T3a
fmadd $T3b,$N3,$nb,$T3b
- lwz $t5,`$FRAME+16`($sp)
- lwz $t4,`$FRAME+20`($sp)
+ lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
+ lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
addc $t0,$t0,$carry
adde $t1,$t1,$c1
srwi $carry,$t0,16
fmadd $T0a,$N0,$na,$T0a
fmadd $T0b,$N0,$nb,$T0b
- lwz $t7,`$FRAME+24`($sp)
- lwz $t6,`$FRAME+28`($sp)
+ lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
+ lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
srwi $c1,$t1,16
insrwi $carry,$t1,16,0
@@ -1218,8 +1220,8 @@ $code.=<<___;
fctid $T1a,$T1a
addc $t0,$t0,$t2
adde $t4,$t4,$t3
- lwz $t3,`$FRAME+32`($sp) ; permuted $t1
- lwz $t2,`$FRAME+36`($sp) ; permuted $t0
+ lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
+ lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
fctid $T1b,$T1b
addze $carry,$carry
addze $c1,$c1
@@ -1229,19 +1231,19 @@ $code.=<<___;
addc $t2,$t2,$carry
adde $t3,$t3,$c1
srwi $carry,$t2,16
- lwz $t7,`$FRAME+40`($sp) ; permuted $t3
- lwz $t6,`$FRAME+44`($sp) ; permuted $t2
+ lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
+ lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
fctid $T2b,$T2b
srwi $c1,$t3,16
insrwi $carry,$t3,16,0
- lwz $t1,`$FRAME+48`($sp) ; permuted $t5
- lwz $t0,`$FRAME+52`($sp) ; permuted $t4
+ lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
+ lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
fctid $T3a,$T3a
addc $t6,$t6,$carry
adde $t7,$t7,$c1
srwi $carry,$t6,16
- lwz $t5,`$FRAME+56`($sp) ; permuted $t7
- lwz $t4,`$FRAME+60`($sp) ; permuted $t6
+ lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
+ lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
fctid $T3b,$T3b
insrwi $t2,$t6,16,0 ; 64..95 bits
@@ -1354,14 +1356,14 @@ $code.=<<___;
___
} else {
$code.=<<___;
- lwz $t1,`$FRAME+0`($sp)
- lwz $t0,`$FRAME+4`($sp)
- lwz $t3,`$FRAME+8`($sp)
- lwz $t2,`$FRAME+12`($sp)
- lwz $t5,`$FRAME+16`($sp)
- lwz $t4,`$FRAME+20`($sp)
- lwz $t7,`$FRAME+24`($sp)
- lwz $t6,`$FRAME+28`($sp)
+ lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
+ lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
+ lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
+ lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
+ lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
+ lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
+ lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
+ lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
stfd $dota,`$FRAME+64`($sp)
stfd $dotb,`$FRAME+72`($sp)
@@ -1397,14 +1399,14 @@ $code.=<<___;
stw $t0,4($tp) ; tp[j-1]
stw $t4,0($tp)
- lwz $t3,`$FRAME+32`($sp) ; permuted $t1
- lwz $t2,`$FRAME+36`($sp) ; permuted $t0
- lwz $t7,`$FRAME+40`($sp) ; permuted $t3
- lwz $t6,`$FRAME+44`($sp) ; permuted $t2
- lwz $t1,`$FRAME+48`($sp) ; permuted $t5
- lwz $t0,`$FRAME+52`($sp) ; permuted $t4
- lwz $t5,`$FRAME+56`($sp) ; permuted $t7
- lwz $t4,`$FRAME+60`($sp) ; permuted $t6
+ lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
+ lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
+ lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
+ lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
+ lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
+ lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
+ lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
+ lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
addc $t2,$t2,$carry
adde $t3,$t3,$c1
@@ -1433,12 +1435,12 @@ $code.=<<___;
addc $t2,$t2,$t6
adde $t0,$t0,$t7
- lwz $t7,`$FRAME+64`($sp)
- lwz $t6,`$FRAME+68`($sp)
+ lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp)
+ lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp)
addze $carry,$carry
addze $c1,$c1
- lwz $t5,`$FRAME+72`($sp)
- lwz $t4,`$FRAME+76`($sp)
+ lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp)
+ lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp)
addc $t6,$t6,$carry
adde $t7,$t7,$c1
diff --git a/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl b/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl
index 3bd45db..12b571c 100755
--- a/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl
+++ b/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl
@@ -113,7 +113,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=12);
}
-if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
+if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
$addx = ($ver>=3.03);
}
diff --git a/crypto/openssl/crypto/bn/asm/s390x-gf2m.pl b/crypto/openssl/crypto/bn/asm/s390x-gf2m.pl
index cd9f13e..9d18d40 100755
--- a/crypto/openssl/crypto/bn/asm/s390x-gf2m.pl
+++ b/crypto/openssl/crypto/bn/asm/s390x-gf2m.pl
@@ -172,19 +172,19 @@ ___
if ($SIZE_T==8) {
my @r=map("%r$_",(6..9));
$code.=<<___;
- bras $ra,_mul_1x1 # a1·b1
+ bras $ra,_mul_1x1 # a1·b1
stmg $lo,$hi,16($rp)
lg $a,`$stdframe+128+4*$SIZE_T`($sp)
lg $b,`$stdframe+128+6*$SIZE_T`($sp)
- bras $ra,_mul_1x1 # a0·b0
+ bras $ra,_mul_1x1 # a0·b0
stmg $lo,$hi,0($rp)
lg $a,`$stdframe+128+3*$SIZE_T`($sp)
lg $b,`$stdframe+128+5*$SIZE_T`($sp)
xg $a,`$stdframe+128+4*$SIZE_T`($sp)
xg $b,`$stdframe+128+6*$SIZE_T`($sp)
- bras $ra,_mul_1x1 # (a0+a1)·(b0+b1)
+ bras $ra,_mul_1x1 # (a0+a1)·(b0+b1)
lmg @r[0],@r[3],0($rp)
xgr $lo,$hi
diff --git a/crypto/openssl/crypto/bn/asm/s390x.S b/crypto/openssl/crypto/bn/asm/s390x.S
index 43fcb79..f5eebe4 100644
--- a/crypto/openssl/crypto/bn/asm/s390x.S
+++ b/crypto/openssl/crypto/bn/asm/s390x.S
@@ -18,71 +18,106 @@
.align 4
bn_mul_add_words:
lghi zero,0 // zero = 0
- la %r1,0(%r2) // put rp aside
- lghi %r2,0 // i=0;
+ la %r1,0(%r2) // put rp aside [to give way to]
+ lghi %r2,0 // return value
ltgfr %r4,%r4
bler %r14 // if (len<=0) return 0;
- stmg %r6,%r10,48(%r15)
- lghi %r10,3
- lghi %r8,0 // carry = 0
- nr %r10,%r4 // len%4
+ stmg %r6,%r13,48(%r15)
+ lghi %r2,3
+ lghi %r12,0 // carry = 0
+ slgr %r1,%r3 // rp-=ap
+ nr %r2,%r4 // len%4
sra %r4,2 // cnt=len/4
jz .Loop1_madd // carry is incidentally cleared if branch taken
algr zero,zero // clear carry
-.Loop4_madd:
- lg %r7,0(%r2,%r3) // ap[i]
+ lg %r7,0(%r3) // ap[0]
+ lg %r9,8(%r3) // ap[1]
mlgr %r6,%r5 // *=w
- alcgr %r7,%r8 // +=carry
- alcgr %r6,zero
- alg %r7,0(%r2,%r1) // +=rp[i]
- stg %r7,0(%r2,%r1) // rp[i]=
+ brct %r4,.Loop4_madd
+ j .Loop4_madd_tail
- lg %r9,8(%r2,%r3)
+.Loop4_madd:
mlgr %r8,%r5
+ lg %r11,16(%r3) // ap[i+2]
+ alcgr %r7,%r12 // +=carry
+ alcgr %r6,zero
+ alg %r7,0(%r3,%r1) // +=rp[i]
+ stg %r7,0(%r3,%r1) // rp[i]=
+
+ mlgr %r10,%r5
+ lg %r13,24(%r3)
alcgr %r9,%r6
alcgr %r8,zero
- alg %r9,8(%r2,%r1)
- stg %r9,8(%r2,%r1)
+ alg %r9,8(%r3,%r1)
+ stg %r9,8(%r3,%r1)
+
+ mlgr %r12,%r5
+ lg %r7,32(%r3)
+ alcgr %r11,%r8
+ alcgr %r10,zero
+ alg %r11,16(%r3,%r1)
+ stg %r11,16(%r3,%r1)
- lg %r7,16(%r2,%r3)
mlgr %r6,%r5
- alcgr %r7,%r8
- alcgr %r6,zero
- alg %r7,16(%r2,%r1)
- stg %r7,16(%r2,%r1)
+ lg %r9,40(%r3)
+ alcgr %r13,%r10
+ alcgr %r12,zero
+ alg %r13,24(%r3,%r1)
+ stg %r13,24(%r3,%r1)
- lg %r9,24(%r2,%r3)
+ la %r3,32(%r3) // i+=4
+ brct %r4,.Loop4_madd
+
+.Loop4_madd_tail:
mlgr %r8,%r5
+ lg %r11,16(%r3)
+ alcgr %r7,%r12 // +=carry
+ alcgr %r6,zero
+ alg %r7,0(%r3,%r1) // +=rp[i]
+ stg %r7,0(%r3,%r1) // rp[i]=
+
+ mlgr %r10,%r5
+ lg %r13,24(%r3)
alcgr %r9,%r6
alcgr %r8,zero
- alg %r9,24(%r2,%r1)
- stg %r9,24(%r2,%r1)
+ alg %r9,8(%r3,%r1)
+ stg %r9,8(%r3,%r1)
- la %r2,32(%r2) // i+=4
- brct %r4,.Loop4_madd
+ mlgr %r12,%r5
+ alcgr %r11,%r8
+ alcgr %r10,zero
+ alg %r11,16(%r3,%r1)
+ stg %r11,16(%r3,%r1)
- la %r10,1(%r10) // see if len%4 is zero ...
- brct %r10,.Loop1_madd // without touching condition code:-)
+ alcgr %r13,%r10
+ alcgr %r12,zero
+ alg %r13,24(%r3,%r1)
+ stg %r13,24(%r3,%r1)
+
+ la %r3,32(%r3) // i+=4
+
+ la %r2,1(%r2) // see if len%4 is zero ...
+ brct %r2,.Loop1_madd // without touching condition code:-)
.Lend_madd:
- alcgr %r8,zero // collect carry bit
- lgr %r2,%r8
- lmg %r6,%r10,48(%r15)
+ lgr %r2,zero // return value
+ alcgr %r2,%r12 // collect even carry bit
+ lmg %r6,%r13,48(%r15)
br %r14
.Loop1_madd:
- lg %r7,0(%r2,%r3) // ap[i]
+ lg %r7,0(%r3) // ap[i]
mlgr %r6,%r5 // *=w
- alcgr %r7,%r8 // +=carry
+ alcgr %r7,%r12 // +=carry
alcgr %r6,zero
- alg %r7,0(%r2,%r1) // +=rp[i]
- stg %r7,0(%r2,%r1) // rp[i]=
+ alg %r7,0(%r3,%r1) // +=rp[i]
+ stg %r7,0(%r3,%r1) // rp[i]=
- lgr %r8,%r6
- la %r2,8(%r2) // i++
- brct %r10,.Loop1_madd
+ lgr %r12,%r6
+ la %r3,8(%r3) // i++
+ brct %r2,.Loop1_madd
j .Lend_madd
.size bn_mul_add_words,.-bn_mul_add_words
diff --git a/crypto/openssl/crypto/bn/asm/x86-gf2m.pl b/crypto/openssl/crypto/bn/asm/x86-gf2m.pl
index 808a1e5..b579530 100755
--- a/crypto/openssl/crypto/bn/asm/x86-gf2m.pl
+++ b/crypto/openssl/crypto/bn/asm/x86-gf2m.pl
@@ -14,7 +14,7 @@
# the time being... Except that it has three code paths: pure integer
# code suitable for any x86 CPU, MMX code suitable for PIII and later
# and PCLMULQDQ suitable for Westmere and later. Improvement varies
-# from one benchmark and µ-arch to another. Below are interval values
+# from one benchmark and µ-arch to another. Below are interval values
# for 163- and 571-bit ECDH benchmarks relative to compiler-generated
# code:
#
@@ -226,22 +226,22 @@ if ($sse2) {
&push ("edi");
&mov ($a,&wparam(1));
&mov ($b,&wparam(3));
- &call ("_mul_1x1_mmx"); # a1·b1
+ &call ("_mul_1x1_mmx"); # a1·b1
&movq ("mm7",$R);
&mov ($a,&wparam(2));
&mov ($b,&wparam(4));
- &call ("_mul_1x1_mmx"); # a0·b0
+ &call ("_mul_1x1_mmx"); # a0·b0
&movq ("mm6",$R);
&mov ($a,&wparam(1));
&mov ($b,&wparam(3));
&xor ($a,&wparam(2));
&xor ($b,&wparam(4));
- &call ("_mul_1x1_mmx"); # (a0+a1)·(b0+b1)
+ &call ("_mul_1x1_mmx"); # (a0+a1)·(b0+b1)
&pxor ($R,"mm7");
&mov ($a,&wparam(0));
- &pxor ($R,"mm6"); # (a0+a1)·(b0+b1)-a1·b1-a0·b0
+ &pxor ($R,"mm6"); # (a0+a1)·(b0+b1)-a1·b1-a0·b0
&movq ($A,$R);
&psllq ($R,32);
@@ -266,13 +266,13 @@ if ($sse2) {
&mov ($a,&wparam(1));
&mov ($b,&wparam(3));
- &call ("_mul_1x1_ialu"); # a1·b1
+ &call ("_mul_1x1_ialu"); # a1·b1
&mov (&DWP(8,"esp"),$lo);
&mov (&DWP(12,"esp"),$hi);
&mov ($a,&wparam(2));
&mov ($b,&wparam(4));
- &call ("_mul_1x1_ialu"); # a0·b0
+ &call ("_mul_1x1_ialu"); # a0·b0
&mov (&DWP(0,"esp"),$lo);
&mov (&DWP(4,"esp"),$hi);
@@ -280,7 +280,7 @@ if ($sse2) {
&mov ($b,&wparam(3));
&xor ($a,&wparam(2));
&xor ($b,&wparam(4));
- &call ("_mul_1x1_ialu"); # (a0+a1)·(b0+b1)
+ &call ("_mul_1x1_ialu"); # (a0+a1)·(b0+b1)
&mov ("ebp",&wparam(0));
@r=("ebx","ecx","edi","esi");
diff --git a/crypto/openssl/crypto/bn/asm/x86_64-gcc.c b/crypto/openssl/crypto/bn/asm/x86_64-gcc.c
index d548886..d77dc43 100644
--- a/crypto/openssl/crypto/bn/asm/x86_64-gcc.c
+++ b/crypto/openssl/crypto/bn/asm/x86_64-gcc.c
@@ -65,7 +65,7 @@
# undef mul_add
/*-
- * "m"(a), "+m"(r) is the way to favor DirectPath µ-code;
+ * "m"(a), "+m"(r) is the way to favor DirectPath µ-code;
* "g"(0) let the compiler to decide where does it
* want to keep the value of zero;
*/
diff --git a/crypto/openssl/crypto/bn/asm/x86_64-gf2m.pl b/crypto/openssl/crypto/bn/asm/x86_64-gf2m.pl
index 226c66c..42bbec2 100755
--- a/crypto/openssl/crypto/bn/asm/x86_64-gf2m.pl
+++ b/crypto/openssl/crypto/bn/asm/x86_64-gf2m.pl
@@ -13,7 +13,7 @@
# in bn_gf2m.c. It's kind of low-hanging mechanical port from C for
# the time being... Except that it has two code paths: code suitable
# for any x86_64 CPU and PCLMULQDQ one suitable for Westmere and
-# later. Improvement varies from one benchmark and µ-arch to another.
+# later. Improvement varies from one benchmark and µ-arch to another.
# Vanilla code path is at most 20% faster than compiler-generated code
# [not very impressive], while PCLMULQDQ - whole 85%-160% better on
# 163- and 571-bit ECDH benchmarks on Intel CPUs. Keep in mind that
@@ -184,13 +184,13 @@ ___
$code.=<<___;
movdqa %xmm0,%xmm4
movdqa %xmm1,%xmm5
- pclmulqdq \$0,%xmm1,%xmm0 # a1·b1
+ pclmulqdq \$0,%xmm1,%xmm0 # a1·b1
pxor %xmm2,%xmm4
pxor %xmm3,%xmm5
- pclmulqdq \$0,%xmm3,%xmm2 # a0·b0
- pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)·(b0+b1)
+ pclmulqdq \$0,%xmm3,%xmm2 # a0·b0
+ pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)·(b0+b1)
xorps %xmm0,%xmm4
- xorps %xmm2,%xmm4 # (a0+a1)·(b0+b1)-a0·b0-a1·b1
+ xorps %xmm2,%xmm4 # (a0+a1)·(b0+b1)-a0·b0-a1·b1
movdqa %xmm4,%xmm5
pslldq \$8,%xmm4
psrldq \$8,%xmm5
@@ -225,13 +225,13 @@ $code.=<<___;
mov \$0xf,$mask
mov $a1,$a
mov $b1,$b
- call _mul_1x1 # a1·b1
+ call _mul_1x1 # a1·b1
mov $lo,16(%rsp)
mov $hi,24(%rsp)
mov 48(%rsp),$a
mov 64(%rsp),$b
- call _mul_1x1 # a0·b0
+ call _mul_1x1 # a0·b0
mov $lo,0(%rsp)
mov $hi,8(%rsp)
@@ -239,7 +239,7 @@ $code.=<<___;
mov 56(%rsp),$b
xor 48(%rsp),$a
xor 64(%rsp),$b
- call _mul_1x1 # (a0+a1)·(b0+b1)
+ call _mul_1x1 # (a0+a1)·(b0+b1)
___
@r=("%rbx","%rcx","%rdi","%rsi");
$code.=<<___;
diff --git a/crypto/openssl/crypto/bn/asm/x86_64-mont.pl b/crypto/openssl/crypto/bn/asm/x86_64-mont.pl
index 2989b58..725833d 100755
--- a/crypto/openssl/crypto/bn/asm/x86_64-mont.pl
+++ b/crypto/openssl/crypto/bn/asm/x86_64-mont.pl
@@ -68,6 +68,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=12);
}
+if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
+ my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
+ $addx = ($ver>=3.03);
+}
+
# int bn_mul_mont(
$rp="%rdi"; # BN_ULONG *rp,
$ap="%rsi"; # const BN_ULONG *ap,
diff --git a/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl b/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl
index 820de3d..64e668f 100755
--- a/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl
+++ b/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl
@@ -53,6 +53,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=12);
}
+if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
+ my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
+ $addx = ($ver>=3.03);
+}
+
# int bn_mul_mont_gather5(
$rp="%rdi"; # BN_ULONG *rp,
$ap="%rsi"; # const BN_ULONG *ap,
@@ -1779,6 +1784,15 @@ sqr8x_reduction:
.align 32
.L8x_tail_done:
add (%rdx),%r8 # can this overflow?
+ adc \$0,%r9
+ adc \$0,%r10
+ adc \$0,%r11
+ adc \$0,%r12
+ adc \$0,%r13
+ adc \$0,%r14
+ adc \$0,%r15 # can't overflow, because we
+ # started with "overhung" part
+ # of multiplication
xor %rax,%rax
neg $carry
@@ -3125,6 +3139,15 @@ sqrx8x_reduction:
.align 32
.Lsqrx8x_tail_done:
add 24+8(%rsp),%r8 # can this overflow?
+ adc \$0,%r9
+ adc \$0,%r10
+ adc \$0,%r11
+ adc \$0,%r12
+ adc \$0,%r13
+ adc \$0,%r14
+ adc \$0,%r15 # can't overflow, because we
+ # started with "overhung" part
+ # of multiplication
mov $carry,%rax # xor %rax,%rax
sub 16+8(%rsp),$carry # mov 16(%rsp),%cf
@@ -3168,13 +3191,11 @@ my ($rptr,$nptr)=("%rdx","%rbp");
my @ri=map("%r$_",(10..13));
my @ni=map("%r$_",(14..15));
$code.=<<___;
- xor %rbx,%rbx
+ xor %ebx,%ebx
sub %r15,%rsi # compare top-most words
adc %rbx,%rbx
mov %rcx,%r10 # -$num
- .byte 0x67
or %rbx,%rax
- .byte 0x67
mov %rcx,%r9 # -$num
xor \$1,%rax
sar \$3+2,%rcx # cf=0
diff --git a/crypto/openssl/crypto/bn/bn_exp.c b/crypto/openssl/crypto/bn/bn_exp.c
index 24afdd6..50cf323 100644
--- a/crypto/openssl/crypto/bn/bn_exp.c
+++ b/crypto/openssl/crypto/bn/bn_exp.c
@@ -662,12 +662,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
bn_check_top(p);
bn_check_top(m);
- top = m->top;
-
- if (!(m->d[0] & 1)) {
+ if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
return (0);
}
+
+ top = m->top;
+
bits = BN_num_bits(p);
if (bits == 0) {
ret = BN_one(rr);
diff --git a/crypto/openssl/crypto/bn/bn_gcd.c b/crypto/openssl/crypto/bn/bn_gcd.c
index 97c55ab..ce59fe7 100644
--- a/crypto/openssl/crypto/bn/bn_gcd.c
+++ b/crypto/openssl/crypto/bn/bn_gcd.c
@@ -583,6 +583,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
* BN_div_no_branch will be called eventually.
*/
pB = &local_B;
+ local_B.flags = 0;
BN_with_flags(pB, B, BN_FLG_CONSTTIME);
if (!BN_nnmod(B, pB, A, ctx))
goto err;
@@ -610,6 +611,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
* BN_div_no_branch will be called eventually.
*/
pA = &local_A;
+ local_A.flags = 0;
BN_with_flags(pA, A, BN_FLG_CONSTTIME);
/* (D, M) := (A/B, A%B) ... */
diff --git a/crypto/openssl/crypto/bn/bn_gf2m.c b/crypto/openssl/crypto/bn/bn_gf2m.c
index cfa1c7c..2c61da1 100644
--- a/crypto/openssl/crypto/bn/bn_gf2m.c
+++ b/crypto/openssl/crypto/bn/bn_gf2m.c
@@ -575,7 +575,7 @@ int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
bn_check_top(a);
BN_CTX_start(ctx);
if ((s = BN_CTX_get(ctx)) == NULL)
- return 0;
+ goto err;
if (!bn_wexpand(s, 2 * a->top))
goto err;
@@ -699,18 +699,21 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
int top = p->top;
BN_ULONG *udp, *bdp, *vdp, *cdp;
- bn_wexpand(u, top);
+ if (!bn_wexpand(u, top))
+ goto err;
udp = u->d;
for (i = u->top; i < top; i++)
udp[i] = 0;
u->top = top;
- bn_wexpand(b, top);
+ if (!bn_wexpand(b, top))
+ goto err;
bdp = b->d;
bdp[0] = 1;
for (i = 1; i < top; i++)
bdp[i] = 0;
b->top = top;
- bn_wexpand(c, top);
+ if (!bn_wexpand(c, top))
+ goto err;
cdp = c->d;
for (i = 0; i < top; i++)
cdp[i] = 0;
diff --git a/crypto/openssl/crypto/bn/bn_mont.c b/crypto/openssl/crypto/bn/bn_mont.c
index aadd5db..be95bd55 100644
--- a/crypto/openssl/crypto/bn/bn_mont.c
+++ b/crypto/openssl/crypto/bn/bn_mont.c
@@ -361,9 +361,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont)
if (mont == NULL)
return;
- BN_free(&(mont->RR));
- BN_free(&(mont->N));
- BN_free(&(mont->Ni));
+ BN_clear_free(&(mont->RR));
+ BN_clear_free(&(mont->N));
+ BN_clear_free(&(mont->Ni));
if (mont->flags & BN_FLG_MALLOCED)
OPENSSL_free(mont);
}
@@ -373,6 +373,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
int ret = 0;
BIGNUM *Ri, *R;
+ if (BN_is_zero(mod))
+ return 0;
+
BN_CTX_start(ctx);
if ((Ri = BN_CTX_get(ctx)) == NULL)
goto err;
diff --git a/crypto/openssl/crypto/bn/bn_recp.c b/crypto/openssl/crypto/bn/bn_recp.c
index 6826f93..7497ac6 100644
--- a/crypto/openssl/crypto/bn/bn_recp.c
+++ b/crypto/openssl/crypto/bn/bn_recp.c
@@ -152,8 +152,10 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
if (BN_ucmp(m, &(recp->N)) < 0) {
BN_zero(d);
- if (!BN_copy(r, m))
+ if (!BN_copy(r, m)) {
+ BN_CTX_end(ctx);
return 0;
+ }
BN_CTX_end(ctx);
return (1);
}
diff --git a/crypto/openssl/crypto/bn/bn_x931p.c b/crypto/openssl/crypto/bn/bn_x931p.c
index 6d76b12..efa48bd 100644
--- a/crypto/openssl/crypto/bn/bn_x931p.c
+++ b/crypto/openssl/crypto/bn/bn_x931p.c
@@ -213,14 +213,14 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
* exceeded.
*/
if (!BN_rand(Xp, nbits, 1, 0))
- return 0;
+ goto err;
BN_CTX_start(ctx);
t = BN_CTX_get(ctx);
for (i = 0; i < 1000; i++) {
if (!BN_rand(Xq, nbits, 1, 0))
- return 0;
+ goto err;
/* Check that |Xp - Xq| > 2^(nbits - 100) */
BN_sub(t, Xp, Xq);
if (BN_num_bits(t) > (nbits - 100))
@@ -234,6 +234,9 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
return 0;
+ err:
+ BN_CTX_end(ctx);
+ return 0;
}
/*
diff --git a/crypto/openssl/crypto/bn/bntest.c b/crypto/openssl/crypto/bn/bntest.c
index 470d5da..1e35988 100644
--- a/crypto/openssl/crypto/bn/bntest.c
+++ b/crypto/openssl/crypto/bn/bntest.c
@@ -441,6 +441,14 @@ int test_div(BIO *bp, BN_CTX *ctx)
BN_init(&d);
BN_init(&e);
+ BN_one(&a);
+ BN_zero(&b);
+
+ if (BN_div(&d, &c, &a, &b, ctx)) {
+ fprintf(stderr, "Division by zero succeeded!\n");
+ return 0;
+ }
+
for (i = 0; i < num0 + num1; i++) {
if (i < num1) {
BN_bntest_rand(&a, 400, 0, 0);
@@ -516,9 +524,9 @@ int test_div_word(BIO *bp)
do {
BN_bntest_rand(&a, 512, -1, 0);
BN_bntest_rand(&b, BN_BITS2, -1, 0);
- s = b.d[0];
- } while (!s);
+ } while (BN_is_zero(&b));
+ s = b.d[0];
BN_copy(&b, &a);
r = BN_div_word(&b, s);
@@ -781,6 +789,18 @@ int test_mont(BIO *bp, BN_CTX *ctx)
if (mont == NULL)
return 0;
+ BN_zero(&n);
+ if (BN_MONT_CTX_set(mont, &n, ctx)) {
+ fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
+ return 0;
+ }
+
+ BN_set_word(&n, 16);
+ if (BN_MONT_CTX_set(mont, &n, ctx)) {
+ fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n");
+ return 0;
+ }
+
BN_bntest_rand(&a, 100, 0, 0);
BN_bntest_rand(&b, 100, 0, 0);
for (i = 0; i < num2; i++) {
@@ -887,6 +907,14 @@ int test_mod_mul(BIO *bp, BN_CTX *ctx)
d = BN_new();
e = BN_new();
+ BN_one(a);
+ BN_one(b);
+ BN_zero(c);
+ if (BN_mod_mul(e, a, b, c, ctx)) {
+ fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n");
+ return 0;
+ }
+
for (j = 0; j < 3; j++) {
BN_bntest_rand(c, 1024, 0, 0);
for (i = 0; i < num0; i++) {
@@ -952,6 +980,14 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
d = BN_new();
e = BN_new();
+ BN_one(a);
+ BN_one(b);
+ BN_zero(c);
+ if (BN_mod_exp(d, a, b, c, ctx)) {
+ fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n");
+ return 0;
+ }
+
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
for (i = 0; i < num2; i++) {
BN_bntest_rand(a, 20 + i * 5, 0, 0);
@@ -980,6 +1016,24 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
return 0;
}
}
+
+ /* Regression test for carry propagation bug in sqr8x_reduction */
+ BN_hex2bn(&a, "050505050505");
+ BN_hex2bn(&b, "02");
+ BN_hex2bn(&c,
+ "4141414141414141414141274141414141414141414141414141414141414141"
+ "4141414141414141414141414141414141414141414141414141414141414141"
+ "4141414141414141414141800000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000001");
+ BN_mod_exp(d, a, b, c, ctx);
+ BN_mul(e, a, a, ctx);
+ if (BN_cmp(d, e)) {
+ fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n");
+ return 0;
+ }
+
BN_free(a);
BN_free(b);
BN_free(c);
@@ -999,6 +1053,22 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
d = BN_new();
e = BN_new();
+ BN_one(a);
+ BN_one(b);
+ BN_zero(c);
+ if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
+ fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
+ "succeeded\n");
+ return 0;
+ }
+
+ BN_set_word(c, 16);
+ if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
+ fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
+ "succeeded\n");
+ return 0;
+ }
+
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
for (i = 0; i < num2; i++) {
BN_bntest_rand(a, 20 + i * 5, 0, 0);
diff --git a/crypto/openssl/crypto/bn/rsaz_exp.h b/crypto/openssl/crypto/bn/rsaz_exp.h
index 33361de..229e181 100644
--- a/crypto/openssl/crypto/bn/rsaz_exp.h
+++ b/crypto/openssl/crypto/bn/rsaz_exp.h
@@ -1,32 +1,44 @@
-/******************************************************************************
-* Copyright(c) 2012, Intel Corp.
-* Developers and authors:
-* Shay Gueron (1, 2), and Vlad Krasnov (1)
-* (1) Intel Corporation, Israel Development Center, Haifa, Israel
-* (2) University of Haifa, Israel
+/*****************************************************************************
+* *
+* Copyright (c) 2012, Intel Corporation *
+* *
+* All rights reserved. *
+* *
+* Redistribution and use in source and binary forms, with or without *
+* modification, are permitted provided that the following conditions are *
+* met: *
+* *
+* * Redistributions of source code must retain the above copyright *
+* notice, this list of conditions and the following disclaimer. *
+* *
+* * 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. *
+* *
+* * Neither the name of the Intel Corporation nor the names of its *
+* contributors may be used to endorse or promote products derived from *
+* this software without specific prior written permission. *
+* *
+* *
+* THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""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 INTEL CORPORATION 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. *
+* *
******************************************************************************
-* LICENSE:
-* This submission to OpenSSL is to be made available under the OpenSSL
-* license, and only to the OpenSSL project, in order to allow integration
-* into the publicly distributed code.
-* The use of this code, or portions of this code, or concepts embedded in
-* this code, or modification of this code and/or algorithm(s) in it, or the
-* use of this code for any other purpose than stated above, requires special
-* licensing.
-******************************************************************************
-* DISCLAIMER:
-* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS AND THE COPYRIGHT OWNERS
-* ``AS IS''. ANY EXPRESSED 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 CONTRIBUTORS OR THE COPYRIGHT
-* OWNERS 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.
-******************************************************************************/
+* Developers and authors: *
+* Shay Gueron (1, 2), and Vlad Krasnov (1) *
+* (1) Intel Corporation, Israel Development Center, Haifa, Israel *
+* (2) University of Haifa, Israel *
+*****************************************************************************/
#ifndef RSAZ_EXP_H
# define RSAZ_EXP_H
diff --git a/crypto/openssl/crypto/buffer/buf_str.c b/crypto/openssl/crypto/buffer/buf_str.c
index ebc5ab4..fa0d608 100644
--- a/crypto/openssl/crypto/buffer/buf_str.c
+++ b/crypto/openssl/crypto/buffer/buf_str.c
@@ -58,6 +58,7 @@
#include <stdio.h>
#include "cryptlib.h"
+#include <limits.h>
#include <openssl/buffer.h>
size_t BUF_strnlen(const char *str, size_t maxlen)
@@ -72,7 +73,7 @@ size_t BUF_strnlen(const char *str, size_t maxlen)
char *BUF_strdup(const char *str)
{
if (str == NULL)
- return (NULL);
+ return NULL;
return BUF_strndup(str, strlen(str));
}
@@ -81,16 +82,22 @@ char *BUF_strndup(const char *str, size_t siz)
char *ret;
if (str == NULL)
- return (NULL);
+ return NULL;
siz = BUF_strnlen(str, siz);
+ if (siz >= INT_MAX)
+ return NULL;
+
ret = OPENSSL_malloc(siz + 1);
if (ret == NULL) {
BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE);
- return (NULL);
+ return NULL;
}
- BUF_strlcpy(ret, str, siz + 1);
+
+ memcpy(ret, str, siz);
+ ret[siz] = '\0';
+
return (ret);
}
@@ -98,13 +105,13 @@ void *BUF_memdup(const void *data, size_t siz)
{
void *ret;
- if (data == NULL)
- return (NULL);
+ if (data == NULL || siz >= INT_MAX)
+ return NULL;
ret = OPENSSL_malloc(siz);
if (ret == NULL) {
BUFerr(BUF_F_BUF_MEMDUP, ERR_R_MALLOC_FAILURE);
- return (NULL);
+ return NULL;
}
return memcpy(ret, data, siz);
}
diff --git a/crypto/openssl/crypto/buffer/buffer.h b/crypto/openssl/crypto/buffer/buffer.h
index c343dd7..efd240a 100644
--- a/crypto/openssl/crypto/buffer/buffer.h
+++ b/crypto/openssl/crypto/buffer/buffer.h
@@ -86,7 +86,13 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len);
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
size_t BUF_strnlen(const char *str, size_t maxlen);
char *BUF_strdup(const char *str);
+
+/*
+ * Like strndup, but in addition, explicitly guarantees to never read past the
+ * first |siz| bytes of |str|.
+ */
char *BUF_strndup(const char *str, size_t siz);
+
void *BUF_memdup(const void *data, size_t siz);
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
diff --git a/crypto/openssl/crypto/cms/cms_enc.c b/crypto/openssl/crypto/cms/cms_enc.c
index 85ae928..b14b4b6 100644
--- a/crypto/openssl/crypto/cms/cms_enc.c
+++ b/crypto/openssl/crypto/cms/cms_enc.c
@@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
ok = 1;
err:
- if (ec->key && !keep_key) {
+ if (ec->key && (!keep_key || !ok)) {
OPENSSL_cleanse(ec->key, ec->keylen);
OPENSSL_free(ec->key);
ec->key = NULL;
diff --git a/crypto/openssl/crypto/cms/cms_pwri.c b/crypto/openssl/crypto/cms/cms_pwri.c
index a8322dc..b91c016 100644
--- a/crypto/openssl/crypto/cms/cms_pwri.c
+++ b/crypto/openssl/crypto/cms/cms_pwri.c
@@ -121,6 +121,9 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
/* Setup algorithm identifier for cipher */
encalg = X509_ALGOR_new();
+ if (encalg == NULL) {
+ goto merr;
+ }
EVP_CIPHER_CTX_init(&ctx);
if (EVP_EncryptInit_ex(&ctx, kekciph, NULL, NULL, NULL) <= 0) {
diff --git a/crypto/openssl/crypto/cms/cms_sd.c b/crypto/openssl/crypto/cms/cms_sd.c
index 721ffd5..a41aca8 100644
--- a/crypto/openssl/crypto/cms/cms_sd.c
+++ b/crypto/openssl/crypto/cms/cms_sd.c
@@ -857,6 +857,8 @@ int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain)
} else {
const EVP_MD *md = EVP_MD_CTX_md(&mctx);
pkctx = EVP_PKEY_CTX_new(si->pkey, NULL);
+ if (pkctx == NULL)
+ goto err;
if (EVP_PKEY_verify_init(pkctx) <= 0)
goto err;
if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0)
diff --git a/crypto/openssl/crypto/cms/cms_smime.c b/crypto/openssl/crypto/cms/cms_smime.c
index 5522a37..07e3472 100644
--- a/crypto/openssl/crypto/cms/cms_smime.c
+++ b/crypto/openssl/crypto/cms/cms_smime.c
@@ -754,7 +754,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)
BIO *cmsbio;
int ret = 0;
if (!(cmsbio = CMS_dataInit(cms, dcont))) {
- CMSerr(CMS_F_CMS_FINAL, ERR_R_MALLOC_FAILURE);
+ CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB);
return 0;
}
diff --git a/crypto/openssl/crypto/comp/c_zlib.c b/crypto/openssl/crypto/comp/c_zlib.c
index 6731af8..9c32614 100644
--- a/crypto/openssl/crypto/comp/c_zlib.c
+++ b/crypto/openssl/crypto/comp/c_zlib.c
@@ -404,8 +404,9 @@ COMP_METHOD *COMP_zlib(void)
void COMP_zlib_cleanup(void)
{
#ifdef ZLIB_SHARED
- if (zlib_dso)
+ if (zlib_dso != NULL)
DSO_free(zlib_dso);
+ zlib_dso = NULL;
#endif
}
diff --git a/crypto/openssl/crypto/conf/conf_def.c b/crypto/openssl/crypto/conf/conf_def.c
index faca9ae..68c77ce 100644
--- a/crypto/openssl/crypto/conf/conf_def.c
+++ b/crypto/openssl/crypto/conf/conf_def.c
@@ -225,12 +225,11 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
goto err;
}
- section = (char *)OPENSSL_malloc(10);
+ section = BUF_strdup("default");
if (section == NULL) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
goto err;
}
- BUF_strlcpy(section, "default", 10);
if (_CONF_new_data(conf) == 0) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
diff --git a/crypto/openssl/crypto/conf/conf_sap.c b/crypto/openssl/crypto/conf/conf_sap.c
index 544fe97..c042cf2 100644
--- a/crypto/openssl/crypto/conf/conf_sap.c
+++ b/crypto/openssl/crypto/conf/conf_sap.c
@@ -90,6 +90,7 @@ void OPENSSL_config(const char *config_name)
CONF_modules_load_file(NULL, config_name,
CONF_MFLAGS_DEFAULT_SECTION |
CONF_MFLAGS_IGNORE_MISSING_FILE);
+ openssl_configured = 1;
}
void OPENSSL_no_config()
diff --git a/crypto/openssl/crypto/cryptlib.c b/crypto/openssl/crypto/cryptlib.c
index ca0e3cc..c9f674b 100644
--- a/crypto/openssl/crypto/cryptlib.c
+++ b/crypto/openssl/crypto/cryptlib.c
@@ -953,13 +953,29 @@ void OPENSSL_showfatal(const char *fmta, ...)
# if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
/* this -------------v--- guards NT-specific calls */
if (check_winnt() && OPENSSL_isservice() > 0) {
- HANDLE h = RegisterEventSource(0, _T("OPENSSL"));
- const TCHAR *pmsg = buf;
- ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 0, 0, 1, 0, &pmsg, 0);
- DeregisterEventSource(h);
+ HANDLE hEventLog = RegisterEventSource(NULL, _T("OpenSSL"));
+
+ if (hEventLog != NULL) {
+ const TCHAR *pmsg = buf;
+
+ if (!ReportEvent(hEventLog, EVENTLOG_ERROR_TYPE, 0, 0, NULL,
+ 1, 0, &pmsg, NULL)) {
+#if defined(DEBUG)
+ /*
+ * We are in a situation where we tried to report a critical
+ * error and this failed for some reason. As a last resort,
+ * in debug builds, send output to the debugger or any other
+ * tool like DebugView which can monitor the output.
+ */
+ OutputDebugString(pmsg);
+#endif
+ }
+
+ (void)DeregisterEventSource(hEventLog);
+ }
} else
# endif
- MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONSTOP);
+ MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONERROR);
}
#else
void OPENSSL_showfatal(const char *fmta, ...)
diff --git a/crypto/openssl/crypto/dh/dh.h b/crypto/openssl/crypto/dh/dh.h
index 0502f1a..b177673 100644
--- a/crypto/openssl/crypto/dh/dh.h
+++ b/crypto/openssl/crypto/dh/dh.h
@@ -142,7 +142,7 @@ struct dh_st {
BIGNUM *p;
BIGNUM *g;
long length; /* optional */
- BIGNUM *pub_key; /* g^x */
+ BIGNUM *pub_key; /* g^x % p */
BIGNUM *priv_key; /* x */
int flags;
BN_MONT_CTX *method_mont_p;
diff --git a/crypto/openssl/crypto/dh/dhtest.c b/crypto/openssl/crypto/dh/dhtest.c
index c9dd76b..6fe8ff4 100644
--- a/crypto/openssl/crypto/dh/dhtest.c
+++ b/crypto/openssl/crypto/dh/dhtest.c
@@ -533,9 +533,9 @@ static int run_rfc5114_tests(void)
* Work out shared secrets using both sides and compare with expected
* values.
*/
- if (!DH_compute_key(Z1, dhB->pub_key, dhA))
+ if (DH_compute_key(Z1, dhB->pub_key, dhA) == -1)
goto bad_err;
- if (!DH_compute_key(Z2, dhA->pub_key, dhB))
+ if (DH_compute_key(Z2, dhA->pub_key, dhB) == -1)
goto bad_err;
if (memcmp(Z1, td->Z, td->Z_len))
diff --git a/crypto/openssl/crypto/dsa/dsa_ameth.c b/crypto/openssl/crypto/dsa/dsa_ameth.c
index 2a5cd71..c40e177 100644
--- a/crypto/openssl/crypto/dsa/dsa_ameth.c
+++ b/crypto/openssl/crypto/dsa/dsa_ameth.c
@@ -318,6 +318,7 @@ static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
dplen = i2d_ASN1_INTEGER(prkey, &dp);
ASN1_STRING_clear_free(prkey);
+ prkey = NULL;
if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_dsa), 0,
V_ASN1_SEQUENCE, params, dp, dplen))
diff --git a/crypto/openssl/crypto/dsa/dsa_gen.c b/crypto/openssl/crypto/dsa/dsa_gen.c
index 5a328aaa..15f3bb4 100644
--- a/crypto/openssl/crypto/dsa/dsa_gen.c
+++ b/crypto/openssl/crypto/dsa/dsa_gen.c
@@ -114,16 +114,8 @@ int DSA_generate_parameters_ex(DSA *ret, int bits,
}
# endif
else {
- const EVP_MD *evpmd;
- size_t qbits = bits >= 2048 ? 256 : 160;
-
- if (bits >= 2048) {
- qbits = 256;
- evpmd = EVP_sha256();
- } else {
- qbits = 160;
- evpmd = EVP_sha1();
- }
+ const EVP_MD *evpmd = bits >= 2048 ? EVP_sha256() : EVP_sha1();
+ size_t qbits = EVP_MD_size(evpmd) * 8;
return dsa_builtin_paramgen(ret, bits, qbits, evpmd,
seed_in, seed_len, NULL, counter_ret,
@@ -176,13 +168,14 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
if (seed_in != NULL)
memcpy(seed, seed_in, seed_len);
- if ((ctx = BN_CTX_new()) == NULL)
+ if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
- if ((mont = BN_MONT_CTX_new()) == NULL)
+ if ((ctx = BN_CTX_new()) == NULL)
goto err;
BN_CTX_start(ctx);
+
r0 = BN_CTX_get(ctx);
g = BN_CTX_get(ctx);
W = BN_CTX_get(ctx);
@@ -203,7 +196,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
if (!BN_GENCB_call(cb, 0, m++))
goto err;
- if (!seed_len) {
+ if (!seed_len || !seed_in) {
if (RAND_pseudo_bytes(seed, qsize) < 0)
goto err;
seed_is_random = 1;
diff --git a/crypto/openssl/crypto/ec/Makefile b/crypto/openssl/crypto/ec/Makefile
index 359ef4e..8949145 100644
--- a/crypto/openssl/crypto/ec/Makefile
+++ b/crypto/openssl/crypto/ec/Makefile
@@ -89,7 +89,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+ rm -f *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl b/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl
index 84379fc..648c969 100755
--- a/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl
+++ b/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl
@@ -81,7 +81,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=12);
}
-if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
+if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
$avx = ($ver>=3.0) + ($ver>=3.01);
$addx = ($ver>=3.03);
diff --git a/crypto/openssl/crypto/ec/ec.h b/crypto/openssl/crypto/ec/ec.h
index 6d3178f..81e6faf 100644
--- a/crypto/openssl/crypto/ec/ec.h
+++ b/crypto/openssl/crypto/ec/ec.h
@@ -106,7 +106,7 @@ typedef enum {
/** the point is encoded as z||x, where the octet z specifies
* which solution of the quadratic equation y is */
POINT_CONVERSION_COMPRESSED = 2,
- /** the point is encoded as z||x||y, where z is the octet 0x02 */
+ /** the point is encoded as z||x||y, where z is the octet 0x04 */
POINT_CONVERSION_UNCOMPRESSED = 4,
/** the point is encoded as z||x||y, where the octet z specifies
* which solution of the quadratic equation y is */
diff --git a/crypto/openssl/crypto/ec/ec_asn1.c b/crypto/openssl/crypto/ec/ec_asn1.c
index 4ad8494..33abf61 100644
--- a/crypto/openssl/crypto/ec/ec_asn1.c
+++ b/crypto/openssl/crypto/ec/ec_asn1.c
@@ -970,8 +970,9 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)
{
EC_GROUP *group = NULL;
ECPKPARAMETERS *params = NULL;
+ const unsigned char *p = *in;
- if ((params = d2i_ECPKPARAMETERS(NULL, in, len)) == NULL) {
+ if ((params = d2i_ECPKPARAMETERS(NULL, &p, len)) == NULL) {
ECerr(EC_F_D2I_ECPKPARAMETERS, EC_R_D2I_ECPKPARAMETERS_FAILURE);
ECPKPARAMETERS_free(params);
return NULL;
@@ -989,6 +990,7 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)
*a = group;
ECPKPARAMETERS_free(params);
+ *in = p;
return (group);
}
@@ -1016,8 +1018,9 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
int ok = 0;
EC_KEY *ret = NULL;
EC_PRIVATEKEY *priv_key = NULL;
+ const unsigned char *p = *in;
- if ((priv_key = d2i_EC_PRIVATEKEY(NULL, in, len)) == NULL) {
+ if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) {
ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB);
return NULL;
}
@@ -1096,6 +1099,7 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
if (a)
*a = ret;
+ *in = p;
ok = 1;
err:
if (!ok) {
diff --git a/crypto/openssl/crypto/ec/ec_key.c b/crypto/openssl/crypto/ec/ec_key.c
index 55ce3fe..c784b6f 100644
--- a/crypto/openssl/crypto/ec/ec_key.c
+++ b/crypto/openssl/crypto/ec/ec_key.c
@@ -366,7 +366,10 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
BN_CTX *ctx = NULL;
BIGNUM *tx, *ty;
EC_POINT *point = NULL;
- int ok = 0, tmp_nid, is_char_two = 0;
+ int ok = 0;
+#ifndef OPENSSL_NO_EC2M
+ int tmp_nid, is_char_two = 0;
+#endif
if (!key || !key->group || !x || !y) {
ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES,
@@ -382,14 +385,15 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
if (!point)
goto err;
+ tx = BN_CTX_get(ctx);
+ ty = BN_CTX_get(ctx);
+
+#ifndef OPENSSL_NO_EC2M
tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group));
if (tmp_nid == NID_X9_62_characteristic_two_field)
is_char_two = 1;
- tx = BN_CTX_get(ctx);
- ty = BN_CTX_get(ctx);
-#ifndef OPENSSL_NO_EC2M
if (is_char_two) {
if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point,
x, y, ctx))
diff --git a/crypto/openssl/crypto/ecdsa/ecdsa.h b/crypto/openssl/crypto/ecdsa/ecdsa.h
index c4016ac..a6f0930 100644
--- a/crypto/openssl/crypto/ecdsa/ecdsa.h
+++ b/crypto/openssl/crypto/ecdsa/ecdsa.h
@@ -233,7 +233,7 @@ void *ECDSA_get_ex_data(EC_KEY *d, int idx);
* \return pointer to a ECDSA_METHOD structure or NULL if an error occurred
*/
-ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method);
+ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method);
/** frees a ECDSA_METHOD structure
* \param ecdsa_method pointer to the ECDSA_METHOD structure
diff --git a/crypto/openssl/crypto/ecdsa/ecs_lib.c b/crypto/openssl/crypto/ecdsa/ecs_lib.c
index 1c02310..8dc1dda 100644
--- a/crypto/openssl/crypto/ecdsa/ecs_lib.c
+++ b/crypto/openssl/crypto/ecdsa/ecs_lib.c
@@ -276,7 +276,7 @@ void *ECDSA_get_ex_data(EC_KEY *d, int idx)
return (CRYPTO_get_ex_data(&ecdsa->ex_data, idx));
}
-ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_meth)
+ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_meth)
{
ECDSA_METHOD *ret;
diff --git a/crypto/openssl/crypto/engine/eng_cryptodev.c b/crypto/openssl/crypto/engine/eng_cryptodev.c
index 926d95c..8fb9c33 100644
--- a/crypto/openssl/crypto/engine/eng_cryptodev.c
+++ b/crypto/openssl/crypto/engine/eng_cryptodev.c
@@ -1292,15 +1292,18 @@ static DSA_SIG *cryptodev_dsa_do_sign(const unsigned char *dgst, int dlen,
if (cryptodev_asym(&kop, BN_num_bytes(dsa->q), r,
BN_num_bytes(dsa->q), s) == 0) {
dsaret = DSA_SIG_new();
+ if (dsaret == NULL)
+ goto err;
dsaret->r = r;
dsaret->s = s;
+ r = s = NULL;
} else {
const DSA_METHOD *meth = DSA_OpenSSL();
- BN_free(r);
- BN_free(s);
dsaret = (meth->dsa_do_sign) (dgst, dlen, dsa);
}
err:
+ BN_free(r);
+ BN_free(s);
kop.crk_param[0].crp_p = NULL;
zapparams(&kop);
return (dsaret);
diff --git a/crypto/openssl/crypto/engine/eng_list.c b/crypto/openssl/crypto/engine/eng_list.c
index 3384e31..83c95d5 100644
--- a/crypto/openssl/crypto/engine/eng_list.c
+++ b/crypto/openssl/crypto/engine/eng_list.c
@@ -260,6 +260,7 @@ int ENGINE_add(ENGINE *e)
}
if ((e->id == NULL) || (e->name == NULL)) {
ENGINEerr(ENGINE_F_ENGINE_ADD, ENGINE_R_ID_OR_NAME_MISSING);
+ return 0;
}
CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
if (!engine_list_add(e)) {
diff --git a/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
index b1c586e..3780021 100644
--- a/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
+++ b/crypto/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c
@@ -498,7 +498,18 @@ static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx,
iv = AES_BLOCK_SIZE;
# if defined(STITCHED_CALL)
+ /*
+ * Assembly stitch handles AVX-capable processors, but its
+ * performance is not optimal on AMD Jaguar, ~40% worse, for
+ * unknown reasons. Incidentally processor in question supports
+ * AVX, but not AMD-specific XOP extension, which can be used
+ * to identify it and avoid stitch invocation. So that after we
+ * establish that current CPU supports AVX, we even see if it's
+ * either even XOP-capable Bulldozer-based or GenuineIntel one.
+ */
if (OPENSSL_ia32cap_P[1] & (1 << (60 - 32)) && /* AVX? */
+ ((OPENSSL_ia32cap_P[1] & (1 << (43 - 32))) /* XOP? */
+ | (OPENSSL_ia32cap_P[0] & (1<<30))) && /* "Intel CPU"? */
plen > (sha_off + iv) &&
(blocks = (plen - (sha_off + iv)) / SHA256_CBLOCK)) {
SHA256_Update(&key->md, in + iv, sha_off);
@@ -816,8 +827,6 @@ static int aesni_cbc_hmac_sha256_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
if (arg != EVP_AEAD_TLS1_AAD_LEN)
return -1;
- len = p[arg - 2] << 8 | p[arg - 1];
-
if (ctx->encrypt) {
key->payload_length = len;
if ((key->aux.tls_ver =
diff --git a/crypto/openssl/crypto/evp/e_des3.c b/crypto/openssl/crypto/evp/e_des3.c
index 96f272e..bf6c1d2 100644
--- a/crypto/openssl/crypto/evp/e_des3.c
+++ b/crypto/openssl/crypto/evp/e_des3.c
@@ -289,7 +289,7 @@ static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
# endif
# ifdef EVP_CHECK_DES_KEY
if (DES_set_key_checked(&deskey[0], &dat->ks1)
- ! !DES_set_key_checked(&deskey[1], &dat->ks2))
+ || DES_set_key_checked(&deskey[1], &dat->ks2))
return 0;
# else
DES_set_key_unchecked(&deskey[0], &dat->ks1);
diff --git a/crypto/openssl/crypto/evp/encode.c b/crypto/openssl/crypto/evp/encode.c
index c361d1f..c6abc4a 100644
--- a/crypto/openssl/crypto/evp/encode.c
+++ b/crypto/openssl/crypto/evp/encode.c
@@ -60,9 +60,9 @@
#include "cryptlib.h"
#include <openssl/evp.h>
+static unsigned char conv_ascii2bin(unsigned char a);
#ifndef CHARSET_EBCDIC
# define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
-# define conv_ascii2bin(a) (data_ascii2bin[(a)&0x7f])
#else
/*
* We assume that PEM encoded files are EBCDIC files (i.e., printable text
@@ -71,7 +71,6 @@
* as the underlying textstring data_bin2ascii[] is already EBCDIC)
*/
# define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
-# define conv_ascii2bin(a) (data_ascii2bin[os_toascii[a]&0x7f])
#endif
/*-
@@ -103,6 +102,7 @@ abcdefghijklmnopqrstuvwxyz0123456789+/";
#define B64_WS 0xE0
#define B64_ERROR 0xFF
#define B64_NOT_BASE64(a) (((a)|0x13) == 0xF3)
+#define B64_BASE64(a) !B64_NOT_BASE64(a)
static const unsigned char data_ascii2bin[128] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@@ -123,6 +123,23 @@ static const unsigned char data_ascii2bin[128] = {
0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
+#ifndef CHARSET_EBCDIC
+static unsigned char conv_ascii2bin(unsigned char a)
+{
+ if (a & 0x80)
+ return B64_ERROR;
+ return data_ascii2bin[a];
+}
+#else
+static unsigned char conv_ascii2bin(unsigned char a)
+{
+ a = os_toascii[a];
+ if (a & 0x80)
+ return B64_ERROR;
+ return data_ascii2bin[a];
+}
+#endif
+
void EVP_EncodeInit(EVP_ENCODE_CTX *ctx)
{
ctx->length = 48;
@@ -218,8 +235,9 @@ int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)
void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
{
- ctx->length = 30;
+ /* Only ctx->num is used during decoding. */
ctx->num = 0;
+ ctx->length = 0;
ctx->line_num = 0;
ctx->expect_nl = 0;
}
@@ -228,139 +246,123 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx)
* -1 for error
* 0 for last line
* 1 for full line
+ *
+ * Note: even though EVP_DecodeUpdate attempts to detect and report end of
+ * content, the context doesn't currently remember it and will accept more data
+ * in the next call. Therefore, the caller is responsible for checking and
+ * rejecting a 0 return value in the middle of content.
+ *
+ * Note: even though EVP_DecodeUpdate has historically tried to detect end of
+ * content based on line length, this has never worked properly. Therefore,
+ * we now return 0 when one of the following is true:
+ * - Padding or B64_EOF was detected and the last block is complete.
+ * - Input has zero-length.
+ * -1 is returned if:
+ * - Invalid characters are detected.
+ * - There is extra trailing padding, or data after padding.
+ * - B64_EOF is detected after an incomplete base64 block.
*/
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
const unsigned char *in, int inl)
{
- int seof = -1, eof = 0, rv = -1, ret = 0, i, v, tmp, n, ln, exp_nl;
+ int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;
unsigned char *d;
n = ctx->num;
d = ctx->enc_data;
- ln = ctx->line_num;
- exp_nl = ctx->expect_nl;
- /* last line of input. */
- if ((inl == 0) || ((n == 0) && (conv_ascii2bin(in[0]) == B64_EOF))) {
+ if (n > 0 && d[n - 1] == '=') {
+ eof++;
+ if (n > 1 && d[n - 2] == '=')
+ eof++;
+ }
+
+ /* Legacy behaviour: an empty input chunk signals end of input. */
+ if (inl == 0) {
rv = 0;
goto end;
}
- /* We parse the input data */
for (i = 0; i < inl; i++) {
- /* If the current line is > 80 characters, scream a lot */
- if (ln >= 80) {
- rv = -1;
- goto end;
- }
-
- /* Get char and put it into the buffer */
tmp = *(in++);
v = conv_ascii2bin(tmp);
- /* only save the good data :-) */
- if (!B64_NOT_BASE64(v)) {
- OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
- d[n++] = tmp;
- ln++;
- } else if (v == B64_ERROR) {
+ if (v == B64_ERROR) {
rv = -1;
goto end;
}
- /*
- * have we seen a '=' which is 'definitly' the last input line. seof
- * will point to the character that holds it. and eof will hold how
- * many characters to chop off.
- */
if (tmp == '=') {
- if (seof == -1)
- seof = n;
eof++;
+ } else if (eof > 0 && B64_BASE64(v)) {
+ /* More data after padding. */
+ rv = -1;
+ goto end;
}
- if (v == B64_CR) {
- ln = 0;
- if (exp_nl)
- continue;
+ if (eof > 2) {
+ rv = -1;
+ goto end;
}
- /* eoln */
- if (v == B64_EOLN) {
- ln = 0;
- if (exp_nl) {
- exp_nl = 0;
- continue;
- }
- }
- exp_nl = 0;
-
- /*
- * If we are at the end of input and it looks like a line, process
- * it.
- */
- if (((i + 1) == inl) && (((n & 3) == 0) || eof)) {
- v = B64_EOF;
- /*
- * In case things were given us in really small records (so two
- * '=' were given in separate updates), eof may contain the
- * incorrect number of ending bytes to skip, so let's redo the
- * count
- */
- eof = 0;
- if (d[n - 1] == '=')
- eof++;
- if (d[n - 2] == '=')
- eof++;
- /* There will never be more than two '=' */
+ if (v == B64_EOF) {
+ seof = 1;
+ goto tail;
}
- if ((v == B64_EOF && (n & 3) == 0) || (n >= 64)) {
- /*
- * This is needed to work correctly on 64 byte input lines. We
- * process the line and then need to accept the '\n'
- */
- if ((v != B64_EOF) && (n >= 64))
- exp_nl = 1;
- if (n > 0) {
- v = EVP_DecodeBlock(out, d, n);
- n = 0;
- if (v < 0) {
- rv = 0;
- goto end;
- }
- if (eof > v) {
- rv = -1;
- goto end;
- }
- ret += (v - eof);
- } else {
- eof = 1;
- v = 0;
+ /* Only save valid base64 characters. */
+ if (B64_BASE64(v)) {
+ if (n >= 64) {
+ /*
+ * We increment n once per loop, and empty the buffer as soon as
+ * we reach 64 characters, so this can only happen if someone's
+ * manually messed with the ctx. Refuse to write any more data.
+ */
+ rv = -1;
+ goto end;
}
+ OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
+ d[n++] = tmp;
+ }
- /*
- * This is the case where we have had a short but valid input
- * line
- */
- if ((v < ctx->length) && eof) {
- rv = 0;
+ if (n == 64) {
+ decoded_len = EVP_DecodeBlock(out, d, n);
+ n = 0;
+ if (decoded_len < 0 || eof > decoded_len) {
+ rv = -1;
goto end;
- } else
- ctx->length = v;
+ }
+ ret += decoded_len - eof;
+ out += decoded_len - eof;
+ }
+ }
- if (seof >= 0) {
- rv = 0;
+ /*
+ * Legacy behaviour: if the current line is a full base64-block (i.e., has
+ * 0 mod 4 base64 characters), it is processed immediately. We keep this
+ * behaviour as applications may not be calling EVP_DecodeFinal properly.
+ */
+tail:
+ if (n > 0) {
+ if ((n & 3) == 0) {
+ decoded_len = EVP_DecodeBlock(out, d, n);
+ n = 0;
+ if (decoded_len < 0 || eof > decoded_len) {
+ rv = -1;
goto end;
}
- out += v;
+ ret += (decoded_len - eof);
+ } else if (seof) {
+ /* EOF in the middle of a base64 block. */
+ rv = -1;
+ goto end;
}
}
- rv = 1;
- end:
+
+ rv = seof || (n == 0 && eof) ? 0 : 1;
+end:
+ /* Legacy behaviour. This should probably rather be zeroed on error. */
*outl = ret;
ctx->num = n;
- ctx->line_num = ln;
- ctx->expect_nl = exp_nl;
return (rv);
}
diff --git a/crypto/openssl/crypto/evp/evp_key.c b/crypto/openssl/crypto/evp/evp_key.c
index 71fa627..5be9e33 100644
--- a/crypto/openssl/crypto/evp/evp_key.c
+++ b/crypto/openssl/crypto/evp/evp_key.c
@@ -104,6 +104,8 @@ int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt,
if ((prompt == NULL) && (prompt_string[0] != '\0'))
prompt = prompt_string;
ui = UI_new();
+ if (ui == NULL)
+ return -1;
UI_add_input_string(ui, prompt, 0, buf, min,
(len >= BUFSIZ) ? BUFSIZ - 1 : len);
if (verify)
@@ -137,7 +139,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
EVP_MD_CTX_init(&c);
for (;;) {
if (!EVP_DigestInit_ex(&c, md, NULL))
- return 0;
+ goto err;
if (addmd++)
if (!EVP_DigestUpdate(&c, &(md_buf[0]), mds))
goto err;
@@ -188,6 +190,6 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
rv = type->key_len;
err:
EVP_MD_CTX_cleanup(&c);
- OPENSSL_cleanse(&(md_buf[0]), EVP_MAX_MD_SIZE);
+ OPENSSL_cleanse(md_buf, sizeof(md_buf));
return rv;
}
diff --git a/crypto/openssl/crypto/evp/evp_lib.c b/crypto/openssl/crypto/evp/evp_lib.c
index a53a27c..7e0bab9 100644
--- a/crypto/openssl/crypto/evp/evp_lib.c
+++ b/crypto/openssl/crypto/evp/evp_lib.c
@@ -72,11 +72,22 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
if (c->cipher->set_asn1_parameters != NULL)
ret = c->cipher->set_asn1_parameters(c, type);
else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) {
- if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE) {
- ASN1_TYPE_set(type, V_ASN1_NULL, NULL);
+ switch (EVP_CIPHER_CTX_mode(c)) {
+ case EVP_CIPH_WRAP_MODE:
+ if (EVP_CIPHER_CTX_nid(c) == NID_id_smime_alg_CMS3DESwrap)
+ ASN1_TYPE_set(type, V_ASN1_NULL, NULL);
ret = 1;
- } else
+ break;
+
+ case EVP_CIPH_GCM_MODE:
+ case EVP_CIPH_CCM_MODE:
+ case EVP_CIPH_XTS_MODE:
+ ret = -1;
+ break;
+
+ default:
ret = EVP_CIPHER_set_asn1_iv(c, type);
+ }
} else
ret = -1;
return (ret);
@@ -89,9 +100,22 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
if (c->cipher->get_asn1_parameters != NULL)
ret = c->cipher->get_asn1_parameters(c, type);
else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) {
- if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE)
- return 1;
- ret = EVP_CIPHER_get_asn1_iv(c, type);
+ switch (EVP_CIPHER_CTX_mode(c)) {
+
+ case EVP_CIPH_WRAP_MODE:
+ ret = 1;
+ break;
+
+ case EVP_CIPH_GCM_MODE:
+ case EVP_CIPH_CCM_MODE:
+ case EVP_CIPH_XTS_MODE:
+ ret = -1;
+ break;
+
+ default:
+ ret = EVP_CIPHER_get_asn1_iv(c, type);
+ break;
+ }
} else
ret = -1;
return (ret);
diff --git a/crypto/openssl/crypto/evp/evp_pbe.c b/crypto/openssl/crypto/evp/evp_pbe.c
index e3fa95d..7934c95 100644
--- a/crypto/openssl/crypto/evp/evp_pbe.c
+++ b/crypto/openssl/crypto/evp/evp_pbe.c
@@ -228,12 +228,16 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
int md_nid, EVP_PBE_KEYGEN *keygen)
{
EVP_PBE_CTL *pbe_tmp;
- if (!pbe_algs)
+
+ if (pbe_algs == NULL) {
pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
- if (!(pbe_tmp = (EVP_PBE_CTL *)OPENSSL_malloc(sizeof(EVP_PBE_CTL)))) {
- EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE);
- return 0;
+ if (pbe_algs == NULL)
+ goto err;
}
+
+ if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL)
+ goto err;
+
pbe_tmp->pbe_type = pbe_type;
pbe_tmp->pbe_nid = pbe_nid;
pbe_tmp->cipher_nid = cipher_nid;
@@ -242,6 +246,10 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp);
return 1;
+
+ err:
+ EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE);
+ return 0;
}
int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
diff --git a/crypto/openssl/crypto/evp/p_lib.c b/crypto/openssl/crypto/evp/p_lib.c
index 1171d30..c017124 100644
--- a/crypto/openssl/crypto/evp/p_lib.c
+++ b/crypto/openssl/crypto/evp/p_lib.c
@@ -253,7 +253,7 @@ int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len)
int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key)
{
- if (!EVP_PKEY_set_type(pkey, type))
+ if (pkey == NULL || !EVP_PKEY_set_type(pkey, type))
return 0;
pkey->pkey.ptr = key;
return (key != NULL);
diff --git a/crypto/openssl/crypto/evp/pmeth_gn.c b/crypto/openssl/crypto/evp/pmeth_gn.c
index 59f8134..6435f1b 100644
--- a/crypto/openssl/crypto/evp/pmeth_gn.c
+++ b/crypto/openssl/crypto/evp/pmeth_gn.c
@@ -96,12 +96,17 @@ int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
return -1;
}
- if (!ppkey)
+ if (ppkey == NULL)
return -1;
- if (!*ppkey)
+ if (*ppkey == NULL)
*ppkey = EVP_PKEY_new();
+ if (*ppkey == NULL) {
+ EVPerr(EVP_F_EVP_PKEY_PARAMGEN, ERR_R_MALLOC_FAILURE);
+ return -1;
+ }
+
ret = ctx->pmeth->paramgen(ctx, *ppkey);
if (ret <= 0) {
EVP_PKEY_free(*ppkey);
diff --git a/crypto/openssl/crypto/hmac/hm_ameth.c b/crypto/openssl/crypto/hmac/hm_ameth.c
index 29b2b5d..944c6c8 100644
--- a/crypto/openssl/crypto/hmac/hm_ameth.c
+++ b/crypto/openssl/crypto/hmac/hm_ameth.c
@@ -108,9 +108,14 @@ static int old_hmac_decode(EVP_PKEY *pkey,
ASN1_OCTET_STRING *os;
os = ASN1_OCTET_STRING_new();
if (!os || !ASN1_OCTET_STRING_set(os, *pder, derlen))
- return 0;
- EVP_PKEY_assign(pkey, EVP_PKEY_HMAC, os);
+ goto err;
+ if (!EVP_PKEY_assign(pkey, EVP_PKEY_HMAC, os))
+ goto err;
return 1;
+
+ err:
+ ASN1_OCTET_STRING_free(os);
+ return 0;
}
static int old_hmac_encode(const EVP_PKEY *pkey, unsigned char **pder)
diff --git a/crypto/openssl/crypto/jpake/jpake.c b/crypto/openssl/crypto/jpake/jpake.c
index 8c38727..ebc0975 100644
--- a/crypto/openssl/crypto/jpake/jpake.c
+++ b/crypto/openssl/crypto/jpake/jpake.c
@@ -219,6 +219,9 @@ static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg,
BIGNUM *t3 = BN_new();
int ret = 0;
+ if (h == NULL || t1 == NULL || t2 == NULL || t3 == NULL)
+ goto end;
+
zkp_hash(h, zkpg, p, ctx->p.peer_name);
/* t1 = g^b */
@@ -234,6 +237,7 @@ static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg,
else
JPAKEerr(JPAKE_F_VERIFY_ZKP, JPAKE_R_ZKP_VERIFY_FAILED);
+end:
/* cleanup */
BN_free(t3);
BN_free(t2);
diff --git a/crypto/openssl/crypto/mem_clr.c b/crypto/openssl/crypto/mem_clr.c
index 3df1f39..1a06636 100644
--- a/crypto/openssl/crypto/mem_clr.c
+++ b/crypto/openssl/crypto/mem_clr.c
@@ -66,6 +66,10 @@ void OPENSSL_cleanse(void *ptr, size_t len)
{
unsigned char *p = ptr;
size_t loop = len, ctr = cleanse_ctr;
+
+ if (ptr == NULL)
+ return;
+
while (loop--) {
*(p++) = (unsigned char)ctr;
ctr += (17 + ((size_t)p & 0xF));
diff --git a/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl b/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl
index 7e4e04e..4be2557 100755
--- a/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl
+++ b/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl
@@ -56,7 +56,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
diff --git a/crypto/openssl/crypto/modes/asm/ghash-armv4.pl b/crypto/openssl/crypto/modes/asm/ghash-armv4.pl
index 77fbf34..8ccc963 100755
--- a/crypto/openssl/crypto/modes/asm/ghash-armv4.pl
+++ b/crypto/openssl/crypto/modes/asm/ghash-armv4.pl
@@ -45,7 +45,7 @@
# processes one byte in 8.45 cycles, A9 - in 10.2, Snapdragon S4 -
# in 9.33.
#
-# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software
+# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software
# Polynomial Multiplication on ARM Processors using the NEON Engine.
#
# http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf
@@ -126,6 +126,11 @@ $code=<<___;
.text
.code 32
+#ifdef __clang__
+#define ldrplb ldrbpl
+#define ldrneb ldrbne
+#endif
+
.type rem_4bit,%object
.align 5
rem_4bit:
@@ -432,12 +437,12 @@ gcm_ghash_neon:
veor $IN,$Xl @ inp^=Xi
.Lgmult_neon:
___
- &clmul64x64 ($Xl,$Hlo,"$IN#lo"); # H.lo·Xi.lo
+ &clmul64x64 ($Xl,$Hlo,"$IN#lo"); # H.lo·Xi.lo
$code.=<<___;
veor $IN#lo,$IN#lo,$IN#hi @ Karatsuba pre-processing
___
- &clmul64x64 ($Xm,$Hhl,"$IN#lo"); # (H.lo+H.hi)·(Xi.lo+Xi.hi)
- &clmul64x64 ($Xh,$Hhi,"$IN#hi"); # H.hi·Xi.hi
+ &clmul64x64 ($Xm,$Hhl,"$IN#lo"); # (H.lo+H.hi)·(Xi.lo+Xi.hi)
+ &clmul64x64 ($Xh,$Hhi,"$IN#hi"); # H.hi·Xi.hi
$code.=<<___;
veor $Xm,$Xm,$Xl @ Karatsuba post-processing
veor $Xm,$Xm,$Xh
diff --git a/crypto/openssl/crypto/modes/asm/ghash-sparcv9.pl b/crypto/openssl/crypto/modes/asm/ghash-sparcv9.pl
index 0365e0f..5bc2870 100755
--- a/crypto/openssl/crypto/modes/asm/ghash-sparcv9.pl
+++ b/crypto/openssl/crypto/modes/asm/ghash-sparcv9.pl
@@ -379,7 +379,7 @@ gcm_init_vis3:
or $V,%lo(0xA0406080),$V
or %l0,%lo(0x20C0E000),%l0
sllx $V,32,$V
- or %l0,$V,$V ! (0xE0·i)&0xff=0xA040608020C0E000
+ or %l0,$V,$V ! (0xE0·i)&0xff=0xA040608020C0E000
stx $V,[%i0+16]
ret
@@ -399,7 +399,7 @@ gcm_gmult_vis3:
mov 0xE1,%l7
sllx %l7,57,$xE1 ! 57 is not a typo
- ldx [$Htable+16],$V ! (0xE0·i)&0xff=0xA040608020C0E000
+ ldx [$Htable+16],$V ! (0xE0·i)&0xff=0xA040608020C0E000
xor $Hhi,$Hlo,$Hhl ! Karatsuba pre-processing
xmulx $Xlo,$Hlo,$C0
@@ -411,9 +411,9 @@ gcm_gmult_vis3:
xmulx $Xhi,$Hhi,$Xhi
sll $C0,3,$sqr
- srlx $V,$sqr,$sqr ! ·0xE0 [implicit &(7<<3)]
+ srlx $V,$sqr,$sqr ! ·0xE0 [implicit &(7<<3)]
xor $C0,$sqr,$sqr
- sllx $sqr,57,$sqr ! ($C0·0xE1)<<1<<56 [implicit &0x7f]
+ sllx $sqr,57,$sqr ! ($C0·0xE1)<<1<<56 [implicit &0x7f]
xor $C0,$C1,$C1 ! Karatsuba post-processing
xor $Xlo,$C2,$C2
@@ -423,7 +423,7 @@ gcm_gmult_vis3:
xor $Xhi,$C2,$C2
xor $Xhi,$C1,$C1
- xmulxhi $C0,$xE1,$Xlo ! ·0xE1<<1<<56
+ xmulxhi $C0,$xE1,$Xlo ! ·0xE1<<1<<56
xor $C0,$C2,$C2
xmulx $C1,$xE1,$C0
xor $C1,$C3,$C3
@@ -453,7 +453,7 @@ gcm_ghash_vis3:
mov 0xE1,%l7
sllx %l7,57,$xE1 ! 57 is not a typo
- ldx [$Htable+16],$V ! (0xE0·i)&0xff=0xA040608020C0E000
+ ldx [$Htable+16],$V ! (0xE0·i)&0xff=0xA040608020C0E000
and $inp,7,$shl
andn $inp,7,$inp
@@ -490,9 +490,9 @@ gcm_ghash_vis3:
xmulx $Xhi,$Hhi,$Xhi
sll $C0,3,$sqr
- srlx $V,$sqr,$sqr ! ·0xE0 [implicit &(7<<3)]
+ srlx $V,$sqr,$sqr ! ·0xE0 [implicit &(7<<3)]
xor $C0,$sqr,$sqr
- sllx $sqr,57,$sqr ! ($C0·0xE1)<<1<<56 [implicit &0x7f]
+ sllx $sqr,57,$sqr ! ($C0·0xE1)<<1<<56 [implicit &0x7f]
xor $C0,$C1,$C1 ! Karatsuba post-processing
xor $Xlo,$C2,$C2
@@ -502,7 +502,7 @@ gcm_ghash_vis3:
xor $Xhi,$C2,$C2
xor $Xhi,$C1,$C1
- xmulxhi $C0,$xE1,$Xlo ! ·0xE1<<1<<56
+ xmulxhi $C0,$xE1,$Xlo ! ·0xE1<<1<<56
xor $C0,$C2,$C2
xmulx $C1,$xE1,$C0
xor $C1,$C3,$C3
diff --git a/crypto/openssl/crypto/modes/asm/ghash-x86.pl b/crypto/openssl/crypto/modes/asm/ghash-x86.pl
index 23a5527..0269169 100755
--- a/crypto/openssl/crypto/modes/asm/ghash-x86.pl
+++ b/crypto/openssl/crypto/modes/asm/ghash-x86.pl
@@ -358,7 +358,7 @@ $S=12; # shift factor for rem_4bit
# effective address calculation and finally merge of value to Z.hi.
# Reference to rem_4bit is scheduled so late that I had to >>4
# rem_4bit elements. This resulted in 20-45% procent improvement
-# on contemporary µ-archs.
+# on contemporary µ-archs.
{
my $cnt;
my $rem_4bit = "eax";
diff --git a/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl b/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl
index 6e656ca..0bcb6d4 100755
--- a/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl
+++ b/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl
@@ -105,7 +105,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
@@ -576,15 +576,15 @@ $code.=<<___ if (0 || (&reduction_alg9($Xhi,$Xi)&&0));
# experimental alternative. special thing about is that there
# no dependency between the two multiplications...
mov \$`0xE1<<1`,%eax
- mov \$0xA040608020C0E000,%r10 # ((7..0)·0xE0)&0xff
+ mov \$0xA040608020C0E000,%r10 # ((7..0)·0xE0)&0xff
mov \$0x07,%r11d
movq %rax,$T1
movq %r10,$T2
movq %r11,$T3 # borrow $T3
pand $Xi,$T3
- pshufb $T3,$T2 # ($Xi&7)·0xE0
+ pshufb $T3,$T2 # ($Xi&7)·0xE0
movq %rax,$T3
- pclmulqdq \$0x00,$Xi,$T1 # ·(0xE1<<1)
+ pclmulqdq \$0x00,$Xi,$T1 # ·(0xE1<<1)
pxor $Xi,$T2
pslldq \$15,$T2
paddd $T2,$T2 # <<(64+56+1)
@@ -657,7 +657,7 @@ $code.=<<___;
je .Lskip4x
sub \$0x30,$len
- mov \$0xA040608020C0E000,%rax # ((7..0)·0xE0)&0xff
+ mov \$0xA040608020C0E000,%rax # ((7..0)·0xE0)&0xff
movdqu 0x30($Htbl),$Hkey3
movdqu 0x40($Htbl),$Hkey4
diff --git a/crypto/openssl/crypto/modes/asm/ghashp8-ppc.pl b/crypto/openssl/crypto/modes/asm/ghashp8-ppc.pl
index e76a58c..71457cf 100755
--- a/crypto/openssl/crypto/modes/asm/ghashp8-ppc.pl
+++ b/crypto/openssl/crypto/modes/asm/ghashp8-ppc.pl
@@ -118,9 +118,9 @@ $code=<<___;
le?vperm $IN,$IN,$IN,$lemask
vxor $zero,$zero,$zero
- vpmsumd $Xl,$IN,$Hl # H.lo·Xi.lo
- vpmsumd $Xm,$IN,$H # H.hi·Xi.lo+H.lo·Xi.hi
- vpmsumd $Xh,$IN,$Hh # H.hi·Xi.hi
+ vpmsumd $Xl,$IN,$Hl # H.lo·Xi.lo
+ vpmsumd $Xm,$IN,$H # H.hi·Xi.lo+H.lo·Xi.hi
+ vpmsumd $Xh,$IN,$Hh # H.hi·Xi.hi
vpmsumd $t2,$Xl,$xC2 # 1st phase
@@ -178,11 +178,11 @@ $code=<<___;
.align 5
Loop:
subic $len,$len,16
- vpmsumd $Xl,$IN,$Hl # H.lo·Xi.lo
+ vpmsumd $Xl,$IN,$Hl # H.lo·Xi.lo
subfe. r0,r0,r0 # borrow?-1:0
- vpmsumd $Xm,$IN,$H # H.hi·Xi.lo+H.lo·Xi.hi
+ vpmsumd $Xm,$IN,$H # H.hi·Xi.lo+H.lo·Xi.hi
and r0,r0,$len
- vpmsumd $Xh,$IN,$Hh # H.hi·Xi.hi
+ vpmsumd $Xh,$IN,$Hh # H.hi·Xi.hi
add $inp,$inp,r0
vpmsumd $t2,$Xl,$xC2 # 1st phase
diff --git a/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl b/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl
index 0b9cd73..0886d21 100755
--- a/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl
+++ b/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl
@@ -135,10 +135,10 @@ gcm_gmult_v8:
#endif
vext.8 $IN,$t1,$t1,#8
- vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo
+ vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo
veor $t1,$t1,$IN @ Karatsuba pre-processing
- vpmull2.p64 $Xh,$H,$IN @ H.hi·Xi.hi
- vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
+ vpmull2.p64 $Xh,$H,$IN @ H.hi·Xi.hi
+ vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
vext.8 $t1,$Xl,$Xh,#8 @ Karatsuba post-processing
veor $t2,$Xl,$Xh
@@ -226,7 +226,7 @@ $code.=<<___;
#endif
vext.8 $In,$t1,$t1,#8
veor $IN,$IN,$Xl @ I[i]^=Xi
- vpmull.p64 $Xln,$H,$In @ H·Ii+1
+ vpmull.p64 $Xln,$H,$In @ H·Ii+1
veor $t1,$t1,$In @ Karatsuba pre-processing
vpmull2.p64 $Xhn,$H,$In
b .Loop_mod2x_v8
@@ -235,14 +235,14 @@ $code.=<<___;
.Loop_mod2x_v8:
vext.8 $t2,$IN,$IN,#8
subs $len,$len,#32 @ is there more data?
- vpmull.p64 $Xl,$H2,$IN @ H^2.lo·Xi.lo
+ vpmull.p64 $Xl,$H2,$IN @ H^2.lo·Xi.lo
cclr $inc,lo @ is it time to zero $inc?
vpmull.p64 $Xmn,$Hhl,$t1
veor $t2,$t2,$IN @ Karatsuba pre-processing
- vpmull2.p64 $Xh,$H2,$IN @ H^2.hi·Xi.hi
+ vpmull2.p64 $Xh,$H2,$IN @ H^2.hi·Xi.hi
veor $Xl,$Xl,$Xln @ accumulate
- vpmull2.p64 $Xm,$Hhl,$t2 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
+ vpmull2.p64 $Xm,$Hhl,$t2 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
vld1.64 {$t0},[$inp],$inc @ load [rotated] I[i+2]
veor $Xh,$Xh,$Xhn
@@ -267,7 +267,7 @@ $code.=<<___;
vext.8 $In,$t1,$t1,#8
vext.8 $IN,$t0,$t0,#8
veor $Xl,$Xm,$t2
- vpmull.p64 $Xln,$H,$In @ H·Ii+1
+ vpmull.p64 $Xln,$H,$In @ H·Ii+1
veor $IN,$IN,$Xh @ accumulate $IN early
vext.8 $t2,$Xl,$Xl,#8 @ 2nd phase of reduction
@@ -291,10 +291,10 @@ $code.=<<___;
veor $IN,$IN,$Xl @ inp^=Xi
veor $t1,$t0,$t2 @ $t1 is rotated inp^Xi
- vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo
+ vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo
veor $t1,$t1,$IN @ Karatsuba pre-processing
- vpmull2.p64 $Xh,$H,$IN @ H.hi·Xi.hi
- vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
+ vpmull2.p64 $Xh,$H,$IN @ H.hi·Xi.hi
+ vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
vext.8 $t1,$Xl,$Xh,#8 @ Karatsuba post-processing
veor $t2,$Xl,$Xh
diff --git a/crypto/openssl/crypto/modes/wrap128.c b/crypto/openssl/crypto/modes/wrap128.c
index 4dcaf03..3849783 100644
--- a/crypto/openssl/crypto/modes/wrap128.c
+++ b/crypto/openssl/crypto/modes/wrap128.c
@@ -76,7 +76,7 @@ size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
return 0;
A = B;
t = 1;
- memcpy(out + 8, in, inlen);
+ memmove(out + 8, in, inlen);
if (!iv)
iv = default_iv;
@@ -113,7 +113,7 @@ size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
A = B;
t = 6 * (inlen >> 3);
memcpy(A, in, 8);
- memcpy(out, in + 8, inlen);
+ memmove(out, in + 8, inlen);
for (j = 0; j < 6; j++) {
R = out + inlen - 8;
for (i = 0; i < inlen; i += 8, t--, R -= 8) {
diff --git a/crypto/openssl/crypto/ocsp/ocsp_lib.c b/crypto/openssl/crypto/ocsp/ocsp_lib.c
index 442a5b6..cabf539 100644
--- a/crypto/openssl/crypto/ocsp/ocsp_lib.c
+++ b/crypto/openssl/crypto/ocsp/ocsp_lib.c
@@ -246,12 +246,6 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
if ((p = strchr(p, ':'))) {
*p = 0;
port = p + 1;
- } else {
- /* Not found: set default port */
- if (*pssl)
- port = "443";
- else
- port = "80";
}
*pport = BUF_strdup(port);
diff --git a/crypto/openssl/crypto/ocsp/ocsp_prn.c b/crypto/openssl/crypto/ocsp/ocsp_prn.c
index 1834256..47d5f83 100644
--- a/crypto/openssl/crypto/ocsp/ocsp_prn.c
+++ b/crypto/openssl/crypto/ocsp/ocsp_prn.c
@@ -212,8 +212,7 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags)
return 1;
}
- i = ASN1_STRING_length(rb->response);
- if (!(br = OCSP_response_get1_basic(o)))
+ if ((br = OCSP_response_get1_basic(o)) == NULL)
goto err;
rd = br->tbsResponseData;
l = ASN1_INTEGER_get(rd->version);
diff --git a/crypto/openssl/crypto/opensslconf.h b/crypto/openssl/crypto/opensslconf.h
index 15487c9..b4d522e 100644
--- a/crypto/openssl/crypto/opensslconf.h
+++ b/crypto/openssl/crypto/opensslconf.h
@@ -216,7 +216,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-#if defined( sun ) /* Newer Sparc's */
+#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
diff --git a/crypto/openssl/crypto/opensslconf.h.in b/crypto/openssl/crypto/opensslconf.h.in
index 814309b..7a1c85d 100644
--- a/crypto/openssl/crypto/opensslconf.h.in
+++ b/crypto/openssl/crypto/opensslconf.h.in
@@ -120,7 +120,7 @@
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
-#if defined( sun ) /* Newer Sparc's */
+#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
diff --git a/crypto/openssl/crypto/opensslv.h b/crypto/openssl/crypto/opensslv.h
index edef989..5b9d7183 100644
--- a/crypto/openssl/crypto/opensslv.h
+++ b/crypto/openssl/crypto/opensslv.h
@@ -30,11 +30,11 @@ extern "C" {
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
-# define OPENSSL_VERSION_NUMBER 0x1000204fL
+# define OPENSSL_VERSION_NUMBER 0x1000205fL
# ifdef OPENSSL_FIPS
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-fips 9 Jul 2015"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2e-fips 3 Dec 2015"
# else
-# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-freebsd 9 Jul 2015"
+# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2e-freebsd 3 Dec 2015"
# endif
# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
diff --git a/crypto/openssl/crypto/pem/pem_info.c b/crypto/openssl/crypto/pem/pem_info.c
index 68747d1..4d736a1 100644
--- a/crypto/openssl/crypto/pem/pem_info.c
+++ b/crypto/openssl/crypto/pem/pem_info.c
@@ -172,6 +172,8 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
xi->enc_len = 0;
xi->x_pkey = X509_PKEY_new();
+ if (xi->x_pkey == NULL)
+ goto err;
ptype = EVP_PKEY_RSA;
pp = &xi->x_pkey->dec_pkey;
if ((int)strlen(header) > 10) /* assume encrypted */
@@ -193,6 +195,8 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
xi->enc_len = 0;
xi->x_pkey = X509_PKEY_new();
+ if (xi->x_pkey == NULL)
+ goto err;
ptype = EVP_PKEY_DSA;
pp = &xi->x_pkey->dec_pkey;
if ((int)strlen(header) > 10) /* assume encrypted */
@@ -214,6 +218,8 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
xi->enc_len = 0;
xi->x_pkey = X509_PKEY_new();
+ if (xi->x_pkey == NULL)
+ goto err;
ptype = EVP_PKEY_EC;
pp = &xi->x_pkey->dec_pkey;
if ((int)strlen(header) > 10) /* assume encrypted */
diff --git a/crypto/openssl/crypto/pem/pvkfmt.c b/crypto/openssl/crypto/pem/pvkfmt.c
index ee4b6a8..82d4527 100644
--- a/crypto/openssl/crypto/pem/pvkfmt.c
+++ b/crypto/openssl/crypto/pem/pvkfmt.c
@@ -624,13 +624,11 @@ static int do_PVK_header(const unsigned char **in, unsigned int length,
PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_PVK_TOO_SHORT);
return 0;
}
- length -= 20;
} else {
if (length < 24) {
PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_PVK_TOO_SHORT);
return 0;
}
- length -= 24;
pvk_magic = read_ledword(&p);
if (pvk_magic != MS_PVKMAGIC) {
PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_BAD_MAGIC_NUMBER);
@@ -692,23 +690,23 @@ static EVP_PKEY *do_PVK_body(const unsigned char **in,
inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u);
if (inlen <= 0) {
PEMerr(PEM_F_DO_PVK_BODY, PEM_R_BAD_PASSWORD_READ);
- return NULL;
+ goto err;
}
enctmp = OPENSSL_malloc(keylen + 8);
if (!enctmp) {
PEMerr(PEM_F_DO_PVK_BODY, ERR_R_MALLOC_FAILURE);
- return NULL;
+ goto err;
}
if (!derive_pvk_key(keybuf, p, saltlen,
(unsigned char *)psbuf, inlen))
- return NULL;
+ goto err;
p += saltlen;
/* Copy BLOBHEADER across, decrypt rest */
memcpy(enctmp, p, 8);
p += 8;
if (keylen < 8) {
PEMerr(PEM_F_DO_PVK_BODY, PEM_R_PVK_TOO_SHORT);
- return NULL;
+ goto err;
}
inlen = keylen - 8;
q = enctmp + 8;
diff --git a/crypto/openssl/crypto/perlasm/ppc-xlate.pl b/crypto/openssl/crypto/perlasm/ppc-xlate.pl
index f89e814..0f46cf0 100755
--- a/crypto/openssl/crypto/perlasm/ppc-xlate.pl
+++ b/crypto/openssl/crypto/perlasm/ppc-xlate.pl
@@ -151,6 +151,26 @@ my $vmr = sub {
" vor $vx,$vy,$vy";
};
+# Some ABIs specify vrsave, special-purpose register #256, as reserved
+# for system use.
+my $no_vrsave = ($flavour =~ /aix|linux64le/);
+my $mtspr = sub {
+ my ($f,$idx,$ra) = @_;
+ if ($idx == 256 && $no_vrsave) {
+ " or $ra,$ra,$ra";
+ } else {
+ " mtspr $idx,$ra";
+ }
+};
+my $mfspr = sub {
+ my ($f,$rd,$idx) = @_;
+ if ($idx == 256 && $no_vrsave) {
+ " li $rd,-1";
+ } else {
+ " mfspr $rd,$idx";
+ }
+};
+
# PowerISA 2.06 stuff
sub vsxmem_op {
my ($f, $vrt, $ra, $rb, $op) = @_;
diff --git a/crypto/openssl/crypto/pkcs12/p12_add.c b/crypto/openssl/crypto/pkcs12/p12_add.c
index 982805d..d9f03a3 100644
--- a/crypto/openssl/crypto/pkcs12/p12_add.c
+++ b/crypto/openssl/crypto/pkcs12/p12_add.c
@@ -75,15 +75,19 @@ PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,
bag->type = OBJ_nid2obj(nid1);
if (!ASN1_item_pack(obj, it, &bag->value.octet)) {
PKCS12err(PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE);
- return NULL;
+ goto err;
}
if (!(safebag = PKCS12_SAFEBAG_new())) {
PKCS12err(PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE);
- return NULL;
+ goto err;
}
safebag->value.bag = bag;
safebag->type = OBJ_nid2obj(nid2);
return safebag;
+
+ err:
+ PKCS12_BAGS_free(bag);
+ return NULL;
}
/* Turn PKCS8 object into a keybag */
@@ -127,6 +131,7 @@ PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
PKCS8_encrypt(pbe_nid, pbe_ciph, pass, passlen, salt, saltlen, iter,
p8))) {
PKCS12err(PKCS12_F_PKCS12_MAKE_SHKEYBAG, ERR_R_MALLOC_FAILURE);
+ PKCS12_SAFEBAG_free(bag);
return NULL;
}
@@ -144,14 +149,18 @@ PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk)
p7->type = OBJ_nid2obj(NID_pkcs7_data);
if (!(p7->d.data = M_ASN1_OCTET_STRING_new())) {
PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, ERR_R_MALLOC_FAILURE);
- return NULL;
+ goto err;
}
if (!ASN1_item_pack(sk, ASN1_ITEM_rptr(PKCS12_SAFEBAGS), &p7->d.data)) {
PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, PKCS12_R_CANT_PACK_STRUCTURE);
- return NULL;
+ goto err;
}
return p7;
+
+ err:
+ PKCS7_free(p7);
+ return NULL;
}
/* Unpack SAFEBAGS from PKCS#7 data ContentInfo */
@@ -181,7 +190,7 @@ PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
if (!PKCS7_set_type(p7, NID_pkcs7_encrypted)) {
PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA,
PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE);
- return NULL;
+ goto err;
}
pbe_ciph = EVP_get_cipherbynid(pbe_nid);
@@ -193,7 +202,7 @@ PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
if (!pbe) {
PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE);
- return NULL;
+ goto err;
}
X509_ALGOR_free(p7->d.encrypted->enc_data->algorithm);
p7->d.encrypted->enc_data->algorithm = pbe;
@@ -202,10 +211,14 @@ PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
PKCS12_item_i2d_encrypt(pbe, ASN1_ITEM_rptr(PKCS12_SAFEBAGS), pass,
passlen, bags, 1))) {
PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, PKCS12_R_ENCRYPT_ERROR);
- return NULL;
+ goto err;
}
return p7;
+
+ err:
+ PKCS7_free(p7);
+ return NULL;
}
STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,
diff --git a/crypto/openssl/crypto/pkcs12/p12_crpt.c b/crypto/openssl/crypto/pkcs12/p12_crpt.c
index 3a166e6..9c2dcab 100644
--- a/crypto/openssl/crypto/pkcs12/p12_crpt.c
+++ b/crypto/openssl/crypto/pkcs12/p12_crpt.c
@@ -77,6 +77,9 @@ int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
const unsigned char *pbuf;
unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
+ if (cipher == NULL)
+ return 0;
+
/* Extract useful info from parameter */
if (param == NULL || param->type != V_ASN1_SEQUENCE ||
param->value.sequence == NULL) {
diff --git a/crypto/openssl/crypto/pkcs12/p12_mutl.c b/crypto/openssl/crypto/pkcs12/p12_mutl.c
index 5ab4bf2..a927782 100644
--- a/crypto/openssl/crypto/pkcs12/p12_mutl.c
+++ b/crypto/openssl/crypto/pkcs12/p12_mutl.c
@@ -173,11 +173,11 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen,
}
if (!saltlen)
saltlen = PKCS12_SALT_LEN;
- p12->mac->salt->length = saltlen;
- if (!(p12->mac->salt->data = OPENSSL_malloc(saltlen))) {
+ if ((p12->mac->salt->data = OPENSSL_malloc(saltlen)) == NULL) {
PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE);
return 0;
}
+ p12->mac->salt->length = saltlen;
if (!salt) {
if (RAND_pseudo_bytes(p12->mac->salt->data, saltlen) < 0)
return 0;
diff --git a/crypto/openssl/crypto/pkcs7/pk7_doit.c b/crypto/openssl/crypto/pkcs7/pk7_doit.c
index c8d7db0..946aaa6 100644
--- a/crypto/openssl/crypto/pkcs7/pk7_doit.c
+++ b/crypto/openssl/crypto/pkcs7/pk7_doit.c
@@ -656,6 +656,8 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
bio = BIO_new_mem_buf(data_body->data, data_body->length);
else {
bio = BIO_new(BIO_s_mem());
+ if (bio == NULL)
+ goto err;
BIO_set_mem_eof_return(bio, 0);
}
if (bio == NULL)
@@ -1156,7 +1158,6 @@ PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
rsk = p7->d.signed_and_enveloped->recipientinfo;
if (rsk == NULL)
return NULL;
- ri = sk_PKCS7_RECIP_INFO_value(rsk, 0);
if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
return (NULL);
ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
diff --git a/crypto/openssl/crypto/pkcs7/pk7_smime.c b/crypto/openssl/crypto/pkcs7/pk7_smime.c
index dbd4100..c4d3724 100644
--- a/crypto/openssl/crypto/pkcs7/pk7_smime.c
+++ b/crypto/openssl/crypto/pkcs7/pk7_smime.c
@@ -256,8 +256,8 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
X509_STORE_CTX cert_ctx;
char buf[4096];
int i, j = 0, k, ret = 0;
- BIO *p7bio;
- BIO *tmpin, *tmpout;
+ BIO *p7bio = NULL;
+ BIO *tmpin = NULL, *tmpout = NULL;
if (!p7) {
PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_INVALID_NULL_POINTER);
@@ -274,18 +274,12 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_NO_CONTENT);
return 0;
}
-#if 0
- /*
- * NB: this test commented out because some versions of Netscape
- * illegally include zero length content when signing data.
- */
/* Check for data and content: two sets of data */
if (!PKCS7_get_detached(p7) && indata) {
PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_CONTENT_AND_DATA_PRESENT);
return 0;
}
-#endif
sinfos = PKCS7_get_signer_info(p7);
@@ -295,7 +289,6 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
}
signers = PKCS7_get0_signers(p7, certs, flags);
-
if (!signers)
return 0;
@@ -308,14 +301,12 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
if (!X509_STORE_CTX_init(&cert_ctx, store, signer,
p7->d.sign->cert)) {
PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_X509_LIB);
- sk_X509_free(signers);
- return 0;
+ goto err;
}
X509_STORE_CTX_set_default(&cert_ctx, "smime_sign");
} else if (!X509_STORE_CTX_init(&cert_ctx, store, signer, NULL)) {
PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_X509_LIB);
- sk_X509_free(signers);
- return 0;
+ goto err;
}
if (!(flags & PKCS7_NOCRL))
X509_STORE_CTX_set0_crls(&cert_ctx, p7->d.sign->crl);
@@ -328,8 +319,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
PKCS7_R_CERTIFICATE_VERIFY_ERROR);
ERR_add_error_data(2, "Verify error:",
X509_verify_cert_error_string(j));
- sk_X509_free(signers);
- return 0;
+ goto err;
}
/* Check for revocation status here */
}
@@ -348,7 +338,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
tmpin = BIO_new_mem_buf(ptr, len);
if (tmpin == NULL) {
PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_MALLOC_FAILURE);
- return 0;
+ goto err;
}
} else
tmpin = indata;
@@ -398,15 +388,12 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
ret = 1;
err:
-
if (tmpin == indata) {
if (indata)
BIO_pop(p7bio);
}
BIO_free_all(p7bio);
-
sk_X509_free(signers);
-
return ret;
}
diff --git a/crypto/openssl/crypto/ppccap.c b/crypto/openssl/crypto/ppccap.c
index 2b7f704..74af473 100644
--- a/crypto/openssl/crypto/ppccap.c
+++ b/crypto/openssl/crypto/ppccap.c
@@ -7,7 +7,7 @@
#if defined(__linux) || defined(_AIX)
# include <sys/utsname.h>
#endif
-#include <crypto.h>
+#include <openssl/crypto.h>
#include <openssl/bn.h>
#include "ppc_arch.h"
diff --git a/crypto/openssl/crypto/rc4/asm/rc4-x86_64.pl b/crypto/openssl/crypto/rc4/asm/rc4-x86_64.pl
index 75750db..20722d3 100755
--- a/crypto/openssl/crypto/rc4/asm/rc4-x86_64.pl
+++ b/crypto/openssl/crypto/rc4/asm/rc4-x86_64.pl
@@ -56,7 +56,7 @@
# achieves respectful 432MBps on 2.8GHz processor now. For reference.
# If executed on Xeon, current RC4_CHAR code-path is 2.7x faster than
# RC4_INT code-path. While if executed on Opteron, it's only 25%
-# slower than the RC4_INT one [meaning that if CPU µ-arch detection
+# slower than the RC4_INT one [meaning that if CPU µ-arch detection
# is not implemented, then this final RC4_CHAR code-path should be
# preferred, as it provides better *all-round* performance].
diff --git a/crypto/openssl/crypto/rsa/rsa_ameth.c b/crypto/openssl/crypto/rsa/rsa_ameth.c
index ca3922e..4e06218 100644
--- a/crypto/openssl/crypto/rsa/rsa_ameth.c
+++ b/crypto/openssl/crypto/rsa/rsa_ameth.c
@@ -268,7 +268,7 @@ static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg)
{
const unsigned char *p;
int plen;
- if (alg == NULL)
+ if (alg == NULL || alg->parameter == NULL)
return NULL;
if (OBJ_obj2nid(alg->algorithm) != NID_mgf1)
return NULL;
diff --git a/crypto/openssl/crypto/rsa/rsa_gen.c b/crypto/openssl/crypto/rsa/rsa_gen.c
index 2465fbd..7f7dca3 100644
--- a/crypto/openssl/crypto/rsa/rsa_gen.c
+++ b/crypto/openssl/crypto/rsa/rsa_gen.c
@@ -69,6 +69,8 @@
#include <openssl/rsa.h>
#ifdef OPENSSL_FIPS
# include <openssl/fips.h>
+extern int FIPS_rsa_x931_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
+ BN_GENCB *cb);
#endif
static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
@@ -94,7 +96,7 @@ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb)
return rsa->meth->rsa_keygen(rsa, bits, e_value, cb);
#ifdef OPENSSL_FIPS
if (FIPS_mode())
- return FIPS_rsa_generate_key_ex(rsa, bits, e_value, cb);
+ return FIPS_rsa_x931_generate_key_ex(rsa, bits, e_value, cb);
#endif
return rsa_builtin_keygen(rsa, bits, e_value, cb);
}
diff --git a/crypto/openssl/crypto/rsa/rsa_sign.c b/crypto/openssl/crypto/rsa/rsa_sign.c
index 19461c6..82ca832 100644
--- a/crypto/openssl/crypto/rsa/rsa_sign.c
+++ b/crypto/openssl/crypto/rsa/rsa_sign.c
@@ -218,14 +218,13 @@ int int_rsa_verify(int dtype, const unsigned char *m,
memcpy(rm, s + 2, 16);
*prm_len = 16;
ret = 1;
- } else if (memcmp(m, s + 2, 16))
+ } else if (memcmp(m, s + 2, 16)) {
RSAerr(RSA_F_INT_RSA_VERIFY, RSA_R_BAD_SIGNATURE);
- else
+ } else {
ret = 1;
- }
-
- /* Special case: SSL signature */
- if (dtype == NID_md5_sha1) {
+ }
+ } else if (dtype == NID_md5_sha1) {
+ /* Special case: SSL signature */
if ((i != SSL_SIG_LENGTH) || memcmp(s, m, SSL_SIG_LENGTH))
RSAerr(RSA_F_INT_RSA_VERIFY, RSA_R_BAD_SIGNATURE);
else
diff --git a/crypto/openssl/crypto/rsa/rsa_test.c b/crypto/openssl/crypto/rsa/rsa_test.c
index e971295..85c7440 100644
--- a/crypto/openssl/crypto/rsa/rsa_test.c
+++ b/crypto/openssl/crypto/rsa/rsa_test.c
@@ -297,22 +297,30 @@ int main(int argc, char *argv[])
} else
printf("OAEP encryption/decryption ok\n");
- /* Try decrypting corrupted ciphertexts */
+ /* Try decrypting corrupted ciphertexts. */
for (n = 0; n < clen; ++n) {
- int b;
- unsigned char saved = ctext[n];
- for (b = 0; b < 256; ++b) {
- if (b == saved)
- continue;
- ctext[n] = b;
- num = RSA_private_decrypt(num, ctext, ptext, key,
+ ctext[n] ^= 1;
+ num = RSA_private_decrypt(clen, ctext, ptext, key,
RSA_PKCS1_OAEP_PADDING);
- if (num > 0) {
- printf("Corrupt data decrypted!\n");
- err = 1;
- }
+ if (num > 0) {
+ printf("Corrupt data decrypted!\n");
+ err = 1;
+ break;
}
+ ctext[n] ^= 1;
}
+
+ /* Test truncated ciphertexts, as well as negative length. */
+ for (n = -1; n < clen; ++n) {
+ num = RSA_private_decrypt(n, ctext, ptext, key,
+ RSA_PKCS1_OAEP_PADDING);
+ if (num > 0) {
+ printf("Truncated data decrypted!\n");
+ err = 1;
+ break;
+ }
+ }
+
next:
RSA_free(key);
}
diff --git a/crypto/openssl/crypto/sha/asm/sha1-586.pl b/crypto/openssl/crypto/sha/asm/sha1-586.pl
index 4895eb3..e0b5d83 100644
--- a/crypto/openssl/crypto/sha/asm/sha1-586.pl
+++ b/crypto/openssl/crypto/sha/asm/sha1-586.pl
@@ -66,9 +66,9 @@
# switch to AVX alone improves performance by as little as 4% in
# comparison to SSSE3 code path. But below result doesn't look like
# 4% improvement... Trouble is that Sandy Bridge decodes 'ro[rl]' as
-# pair of µ-ops, and it's the additional µ-ops, two per round, that
+# pair of µ-ops, and it's the additional µ-ops, two per round, that
# make it run slower than Core2 and Westmere. But 'sh[rl]d' is decoded
-# as single µ-op by Sandy Bridge and it's replacing 'ro[rl]' with
+# as single µ-op by Sandy Bridge and it's replacing 'ro[rl]' with
# equivalent 'sh[rl]d' that is responsible for the impressive 5.1
# cycles per processed byte. But 'sh[rl]d' is not something that used
# to be fast, nor does it appear to be fast in upcoming Bulldozer
diff --git a/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl b/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl
index a8ee075..f856bb8 100755
--- a/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl
+++ b/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl
@@ -58,7 +58,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
diff --git a/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl b/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl
index 9bb6b49..9a6acc3 100755
--- a/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl
+++ b/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl
@@ -107,7 +107,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([2-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([2-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
diff --git a/crypto/openssl/crypto/sha/asm/sha256-586.pl b/crypto/openssl/crypto/sha/asm/sha256-586.pl
index 6462e45b..e907714 100755
--- a/crypto/openssl/crypto/sha/asm/sha256-586.pl
+++ b/crypto/openssl/crypto/sha/asm/sha256-586.pl
@@ -10,7 +10,7 @@
# SHA256 block transform for x86. September 2007.
#
# Performance improvement over compiler generated code varies from
-# 10% to 40% [see below]. Not very impressive on some µ-archs, but
+# 10% to 40% [see below]. Not very impressive on some µ-archs, but
# it's 5 times smaller and optimizies amount of writes.
#
# May 2012.
diff --git a/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl b/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl
index adf2ddc..3d37ae3 100755
--- a/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl
+++ b/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl
@@ -59,7 +59,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
diff --git a/crypto/openssl/crypto/sha/asm/sha512-586.pl b/crypto/openssl/crypto/sha/asm/sha512-586.pl
index e96ec00..2f6a202 100755
--- a/crypto/openssl/crypto/sha/asm/sha512-586.pl
+++ b/crypto/openssl/crypto/sha/asm/sha512-586.pl
@@ -37,7 +37,7 @@
#
# IALU code-path is optimized for elder Pentiums. On vanilla Pentium
# performance improvement over compiler generated code reaches ~60%,
-# while on PIII - ~35%. On newer µ-archs improvement varies from 15%
+# while on PIII - ~35%. On newer µ-archs improvement varies from 15%
# to 50%, but it's less important as they are expected to execute SSE2
# code-path, which is commonly ~2-3x faster [than compiler generated
# code]. SSE2 code-path is as fast as original sha512-sse2.pl, even
diff --git a/crypto/openssl/crypto/sha/asm/sha512-parisc.pl b/crypto/openssl/crypto/sha/asm/sha512-parisc.pl
index fc0e15b..6cad72e 100755
--- a/crypto/openssl/crypto/sha/asm/sha512-parisc.pl
+++ b/crypto/openssl/crypto/sha/asm/sha512-parisc.pl
@@ -19,7 +19,7 @@
# SHA512 performance is >2.9x better than gcc 3.2 generated code on
# PA-7100LC, PA-RISC 1.1 processor. Then implementation detects if the
# code is executed on PA-RISC 2.0 processor and switches to 64-bit
-# code path delivering adequate peformance even in "blended" 32-bit
+# code path delivering adequate performance even in "blended" 32-bit
# build. Though 64-bit code is not any faster than code generated by
# vendor compiler on PA-8600...
#
diff --git a/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl b/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl
index b7b44b4..5866566 100755
--- a/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl
+++ b/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl
@@ -124,7 +124,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
diff --git a/crypto/openssl/crypto/sparccpuid.S b/crypto/openssl/crypto/sparccpuid.S
index eea2006f..7b12ec2 100644
--- a/crypto/openssl/crypto/sparccpuid.S
+++ b/crypto/openssl/crypto/sparccpuid.S
@@ -123,7 +123,7 @@ OPENSSL_wipe_cpu:
fmovs %f1,%f3
fmovs %f0,%f2
- add %fp,BIAS,%i0 ! return pointer to caller´s top of stack
+ add %fp,BIAS,%i0 ! return pointer to caller´s top of stack
ret
restore
diff --git a/crypto/openssl/crypto/sparcv9cap.c b/crypto/openssl/crypto/sparcv9cap.c
index 8bf2846..a36e461 100644
--- a/crypto/openssl/crypto/sparcv9cap.c
+++ b/crypto/openssl/crypto/sparcv9cap.c
@@ -237,6 +237,17 @@ static void common_handler(int sig)
siglongjmp(common_jmp, sig);
}
+#if defined(__sun) && defined(__SVR4)
+# if defined(__GNUC__) && __GNUC__>=2
+extern unsigned int getisax(unsigned int vec[], unsigned int sz) __attribute__ ((weak));
+# elif defined(__SUNPRO_C)
+#pragma weak getisax
+extern unsigned int getisax(unsigned int vec[], unsigned int sz);
+# else
+static unsigned int (*getisax) (unsigned int vec[], unsigned int sz) = NULL;
+# endif
+#endif
+
void OPENSSL_cpuid_setup(void)
{
char *e;
@@ -255,6 +266,42 @@ void OPENSSL_cpuid_setup(void)
return;
}
+#if defined(__sun) && defined(__SVR4)
+ if (getisax != NULL) {
+ unsigned int vec[1];
+
+ if (getisax (vec,1)) {
+ if (vec[0]&0x0020) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1;
+ if (vec[0]&0x0040) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2;
+ if (vec[0]&0x0080) OPENSSL_sparcv9cap_P[0] |= SPARCV9_BLK;
+ if (vec[0]&0x0100) OPENSSL_sparcv9cap_P[0] |= SPARCV9_FMADD;
+ if (vec[0]&0x0400) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3;
+
+ /* reconstruct %cfr copy */
+ OPENSSL_sparcv9cap_P[1] = (vec[0]>>17)&0x3ff;
+ OPENSSL_sparcv9cap_P[1] |= (OPENSSL_sparcv9cap_P[1]&CFR_MONTMUL)<<1;
+ if (vec[0]&0x20000000) OPENSSL_sparcv9cap_P[1] |= CFR_CRC32C;
+
+ /* Some heuristics */
+ /* all known VIS2-capable CPUs have unprivileged tick counter */
+ if (OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS2)
+ OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED;
+
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_PREFER_FPU;
+
+ /* detect UltraSPARC-Tx, see sparccpud.S for details... */
+ if ((OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS1) &&
+ _sparcv9_vis1_instrument() >= 12)
+ OPENSSL_sparcv9cap_P[0] &= ~(SPARCV9_VIS1 | SPARCV9_PREFER_FPU);
+ }
+
+ if (sizeof(size_t) == 8)
+ OPENSSL_sparcv9cap_P[0] |= SPARCV9_64BIT_STACK;
+
+ return;
+ }
+#endif
+
/* Initial value, fits UltraSPARC-I&II... */
OPENSSL_sparcv9cap_P[0] = SPARCV9_PREFER_FPU | SPARCV9_TICK_PRIVILEGED;
diff --git a/crypto/openssl/crypto/srp/srp_vfy.c b/crypto/openssl/crypto/srp/srp_vfy.c
index 50f75d7..a3f1a8a 100644
--- a/crypto/openssl/crypto/srp/srp_vfy.c
+++ b/crypto/openssl/crypto/srp/srp_vfy.c
@@ -521,12 +521,12 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g)
{
int len;
- char *result = NULL;
- char *vf;
+ char *result = NULL, *vf = NULL;
BIGNUM *N_bn = NULL, *g_bn = NULL, *s = NULL, *v = NULL;
unsigned char tmp[MAX_LEN];
unsigned char tmp2[MAX_LEN];
char *defgNid = NULL;
+ int vfsize = 0;
if ((user == NULL) ||
(pass == NULL) || (salt == NULL) || (verifier == NULL))
@@ -564,22 +564,23 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt,
goto err;
BN_bn2bin(v, tmp);
- if (((vf = OPENSSL_malloc(BN_num_bytes(v) * 2)) == NULL))
+ vfsize = BN_num_bytes(v) * 2;
+ if (((vf = OPENSSL_malloc(vfsize)) == NULL))
goto err;
t_tob64(vf, tmp, BN_num_bytes(v));
- *verifier = vf;
if (*salt == NULL) {
char *tmp_salt;
if ((tmp_salt = OPENSSL_malloc(SRP_RANDOM_SALT_LEN * 2)) == NULL) {
- OPENSSL_free(vf);
goto err;
}
t_tob64(tmp_salt, tmp2, SRP_RANDOM_SALT_LEN);
*salt = tmp_salt;
}
+ *verifier = vf;
+ vf = NULL;
result = defgNid;
err:
@@ -587,11 +588,21 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt,
BN_free(N_bn);
BN_free(g_bn);
}
+ OPENSSL_cleanse(vf, vfsize);
+ OPENSSL_free(vf);
+ BN_clear_free(s);
+ BN_clear_free(v);
return result;
}
/*
- * create a verifier (*salt,*verifier,g and N are BIGNUMs)
+ * create a verifier (*salt,*verifier,g and N are BIGNUMs). If *salt != NULL
+ * then the provided salt will be used. On successful exit *verifier will point
+ * to a newly allocated BIGNUM containing the verifier and (if a salt was not
+ * provided) *salt will be populated with a newly allocated BIGNUM containing a
+ * random salt.
+ * The caller is responsible for freeing the allocated *salt and *verifier
+ * BIGNUMS.
*/
int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, BIGNUM *N, BIGNUM *g)
@@ -600,6 +611,7 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
BIGNUM *x = NULL;
BN_CTX *bn_ctx = BN_CTX_new();
unsigned char tmp2[MAX_LEN];
+ BIGNUM *salttmp = NULL;
if ((user == NULL) ||
(pass == NULL) ||
@@ -614,10 +626,12 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0)
goto err;
- *salt = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL);
+ salttmp = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL);
+ } else {
+ salttmp = *salt;
}
- x = SRP_Calc_x(*salt, user, pass);
+ x = SRP_Calc_x(salttmp, user, pass);
*verifier = BN_new();
if (*verifier == NULL)
@@ -631,9 +645,11 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
srp_bn_print(*verifier);
result = 1;
+ *salt = salttmp;
err:
-
+ if (*salt != salttmp)
+ BN_clear_free(salttmp);
BN_clear_free(x);
BN_CTX_free(bn_ctx);
return result;
diff --git a/crypto/openssl/crypto/ts/ts_rsp_verify.c b/crypto/openssl/crypto/ts/ts_rsp_verify.c
index 3ce765d..da89911 100644
--- a/crypto/openssl/crypto/ts/ts_rsp_verify.c
+++ b/crypto/openssl/crypto/ts/ts_rsp_verify.c
@@ -522,7 +522,7 @@ static int TS_check_status_info(TS_RESP *response)
if (ASN1_BIT_STRING_get_bit(info->failure_info,
TS_failure_info[i].code)) {
if (!first)
- strcpy(failure_text, ",");
+ strcat(failure_text, ",");
else
first = 0;
strcat(failure_text, TS_failure_info[i].text);
diff --git a/crypto/openssl/crypto/whrlpool/asm/wp-mmx.pl b/crypto/openssl/crypto/whrlpool/asm/wp-mmx.pl
index c584e5b..7725951 100755
--- a/crypto/openssl/crypto/whrlpool/asm/wp-mmx.pl
+++ b/crypto/openssl/crypto/whrlpool/asm/wp-mmx.pl
@@ -16,7 +16,7 @@
# table]. I stick to value of 2 for two reasons: 1. smaller table
# minimizes cache trashing and thus mitigates the hazard of side-
# channel leakage similar to AES cache-timing one; 2. performance
-# gap among different µ-archs is smaller.
+# gap among different µ-archs is smaller.
#
# Performance table lists rounded amounts of CPU cycles spent by
# whirlpool_block_mmx routine on single 64 byte input block, i.e.
diff --git a/crypto/openssl/crypto/x509/x509_lu.c b/crypto/openssl/crypto/x509/x509_lu.c
index b0d6539..50120a4 100644
--- a/crypto/openssl/crypto/x509/x509_lu.c
+++ b/crypto/openssl/crypto/x509/x509_lu.c
@@ -536,8 +536,6 @@ STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm)
X509_OBJECT *obj, xobj;
sk = sk_X509_CRL_new_null();
CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
- /* Check cache first */
- idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt);
/*
* Always do lookup to possibly add new CRLs to cache
diff --git a/crypto/openssl/crypto/x509/x509_vfy.c b/crypto/openssl/crypto/x509/x509_vfy.c
index a2f1dbe..ab94948 100644
--- a/crypto/openssl/crypto/x509/x509_vfy.c
+++ b/crypto/openssl/crypto/x509/x509_vfy.c
@@ -249,7 +249,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
if (ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) {
ok = ctx->get_issuer(&xtmp, ctx, x);
if (ok < 0)
- return ok;
+ goto end;
/*
* If successful for now free up cert so it will be picked up
* again later.
@@ -347,14 +347,15 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
ok = ctx->get_issuer(&xtmp, ctx, x);
if (ok < 0)
- return ok;
+ goto end;
if (ok == 0)
break;
x = xtmp;
if (!sk_X509_push(ctx->chain, x)) {
X509_free(xtmp);
X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
- return 0;
+ ok = 0;
+ goto end;
}
num++;
}
@@ -752,6 +753,10 @@ static int check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id)
int n = sk_OPENSSL_STRING_num(id->hosts);
char *name;
+ if (id->peername != NULL) {
+ OPENSSL_free(id->peername);
+ id->peername = NULL;
+ }
for (i = 0; i < n; ++i) {
name = sk_OPENSSL_STRING_value(id->hosts, i);
if (X509_check_host(x, name, 0, id->hostflags, &id->peername) > 0)
diff --git a/crypto/openssl/crypto/x509/x509_vpm.c b/crypto/openssl/crypto/x509/x509_vpm.c
index 1ea0c69..592a8a5 100644
--- a/crypto/openssl/crypto/x509/x509_vpm.c
+++ b/crypto/openssl/crypto/x509/x509_vpm.c
@@ -155,6 +155,7 @@ static void x509_verify_param_zero(X509_VERIFY_PARAM *param)
}
if (paramid->peername)
OPENSSL_free(paramid->peername);
+ paramid->peername = NULL;
if (paramid->email) {
OPENSSL_free(paramid->email);
paramid->email = NULL;
@@ -165,7 +166,6 @@ static void x509_verify_param_zero(X509_VERIFY_PARAM *param)
paramid->ip = NULL;
paramid->iplen = 0;
}
-
}
X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
@@ -176,13 +176,20 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
param = OPENSSL_malloc(sizeof *param);
if (!param)
return NULL;
- paramid = OPENSSL_malloc(sizeof *paramid);
+ memset(param, 0, sizeof(*param));
+
+ paramid = OPENSSL_malloc(sizeof(*paramid));
if (!paramid) {
OPENSSL_free(param);
return NULL;
}
- memset(param, 0, sizeof *param);
- memset(paramid, 0, sizeof *paramid);
+ memset(paramid, 0, sizeof(*paramid));
+ /* Exotic platforms may have non-zero bit representation of NULL */
+ paramid->hosts = NULL;
+ paramid->peername = NULL;
+ paramid->email = NULL;
+ paramid->ip = NULL;
+
param->id = paramid;
x509_verify_param_zero(param);
return param;
diff --git a/crypto/openssl/crypto/x509v3/v3_cpols.c b/crypto/openssl/crypto/x509v3/v3_cpols.c
index 0febc1b..d97f622 100644
--- a/crypto/openssl/crypto/x509v3/v3_cpols.c
+++ b/crypto/openssl/crypto/x509v3/v3_cpols.c
@@ -186,6 +186,10 @@ static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method,
goto err;
}
pol = POLICYINFO_new();
+ if (pol == NULL) {
+ X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
pol->policyid = pobj;
}
if (!sk_POLICYINFO_push(pols, pol)) {
diff --git a/crypto/openssl/crypto/x509v3/v3_ncons.c b/crypto/openssl/crypto/x509v3/v3_ncons.c
index b97ed27..2855269 100644
--- a/crypto/openssl/crypto/x509v3/v3_ncons.c
+++ b/crypto/openssl/crypto/x509v3/v3_ncons.c
@@ -132,6 +132,8 @@ static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
}
tval.value = val->value;
sub = GENERAL_SUBTREE_new();
+ if (sub == NULL)
+ goto memerr;
if (!v2i_GENERAL_NAME_ex(sub->base, method, ctx, &tval, 1))
goto err;
if (!*ptree)
diff --git a/crypto/openssl/crypto/x509v3/v3_pci.c b/crypto/openssl/crypto/x509v3/v3_pci.c
index fe0d806..48ac095 100644
--- a/crypto/openssl/crypto/x509v3/v3_pci.c
+++ b/crypto/openssl/crypto/x509v3/v3_pci.c
@@ -3,7 +3,7 @@
* Contributed to the OpenSSL Project 2004 by Richard Levitte
* (richard@levitte.org)
*/
-/* Copyright (c) 2004 Kungliga Tekniska Högskolan
+/* Copyright (c) 2004 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
diff --git a/crypto/openssl/crypto/x509v3/v3_pcia.c b/crypto/openssl/crypto/x509v3/v3_pcia.c
index 350b398..43fd362 100644
--- a/crypto/openssl/crypto/x509v3/v3_pcia.c
+++ b/crypto/openssl/crypto/x509v3/v3_pcia.c
@@ -3,7 +3,7 @@
* Contributed to the OpenSSL Project 2004 by Richard Levitte
* (richard@levitte.org)
*/
-/* Copyright (c) 2004 Kungliga Tekniska Högskolan
+/* Copyright (c) 2004 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
diff --git a/crypto/openssl/crypto/x509v3/v3_purp.c b/crypto/openssl/crypto/x509v3/v3_purp.c
index 36b0d87..845be67 100644
--- a/crypto/openssl/crypto/x509v3/v3_purp.c
+++ b/crypto/openssl/crypto/x509v3/v3_purp.c
@@ -380,6 +380,14 @@ static void setup_crldp(X509 *x)
setup_dp(x, sk_DIST_POINT_value(x->crldp, i));
}
+#define V1_ROOT (EXFLAG_V1|EXFLAG_SS)
+#define ku_reject(x, usage) \
+ (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage)))
+#define xku_reject(x, usage) \
+ (((x)->ex_flags & EXFLAG_XKUSAGE) && !((x)->ex_xkusage & (usage)))
+#define ns_reject(x, usage) \
+ (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage)))
+
static void x509v3_cache_extensions(X509 *x)
{
BASIC_CONSTRAINTS *bs;
@@ -499,7 +507,8 @@ static void x509v3_cache_extensions(X509 *x)
if (!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x))) {
x->ex_flags |= EXFLAG_SI;
/* If SKID matches AKID also indicate self signed */
- if (X509_check_akid(x, x->akid) == X509_V_OK)
+ if (X509_check_akid(x, x->akid) == X509_V_OK &&
+ !ku_reject(x, KU_KEY_CERT_SIGN))
x->ex_flags |= EXFLAG_SS;
}
x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
@@ -538,14 +547,6 @@ static void x509v3_cache_extensions(X509 *x)
* 4 basicConstraints absent but keyUsage present and keyCertSign asserted.
*/
-#define V1_ROOT (EXFLAG_V1|EXFLAG_SS)
-#define ku_reject(x, usage) \
- (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage)))
-#define xku_reject(x, usage) \
- (((x)->ex_flags & EXFLAG_XKUSAGE) && !((x)->ex_xkusage & (usage)))
-#define ns_reject(x, usage) \
- (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage)))
-
static int check_ca(const X509 *x)
{
/* keyUsage if present should allow cert signing */
diff --git a/crypto/openssl/crypto/x509v3/v3_scts.c b/crypto/openssl/crypto/x509v3/v3_scts.c
index 6e0b8d6..0b7c681 100644
--- a/crypto/openssl/crypto/x509v3/v3_scts.c
+++ b/crypto/openssl/crypto/x509v3/v3_scts.c
@@ -190,8 +190,9 @@ static STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a,
SCT *sct;
unsigned char *p, *p2;
unsigned short listlen, sctlen = 0, fieldlen;
+ const unsigned char *q = *pp;
- if (d2i_ASN1_OCTET_STRING(&oct, pp, length) == NULL)
+ if (d2i_ASN1_OCTET_STRING(&oct, &q, length) == NULL)
return NULL;
if (oct->length < 2)
goto done;
@@ -279,6 +280,7 @@ static STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a,
done:
ASN1_OCTET_STRING_free(oct);
+ *pp = q;
return sk;
err:
diff --git a/crypto/openssl/crypto/x509v3/v3_utl.c b/crypto/openssl/crypto/x509v3/v3_utl.c
index bdd7b95..4d1ecc5 100644
--- a/crypto/openssl/crypto/x509v3/v3_utl.c
+++ b/crypto/openssl/crypto/x509v3/v3_utl.c
@@ -926,7 +926,7 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
GENERAL_NAMES *gens = NULL;
X509_NAME *name = NULL;
int i;
- int cnid;
+ int cnid = NID_undef;
int alt_type;
int san_present = 0;
int rv = 0;
@@ -949,7 +949,6 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
else
equal = equal_wildcard;
} else {
- cnid = 0;
alt_type = V_ASN1_OCTET_STRING;
equal = equal_case;
}
@@ -980,11 +979,16 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen,
GENERAL_NAMES_free(gens);
if (rv != 0)
return rv;
- if (!cnid
+ if (cnid == NID_undef
|| (san_present
&& !(flags & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT)))
return 0;
}
+
+ /* We're done if CN-ID is not pertinent */
+ if (cnid == NID_undef)
+ return 0;
+
i = -1;
name = X509_get_subject_name(x);
while ((i = X509_NAME_get_index_by_NID(name, cnid, i)) >= 0) {
diff --git a/crypto/openssl/doc/HOWTO/keys.txt b/crypto/openssl/doc/HOWTO/keys.txt
index 7ae2a3a..ba0314f 100644
--- a/crypto/openssl/doc/HOWTO/keys.txt
+++ b/crypto/openssl/doc/HOWTO/keys.txt
@@ -40,9 +40,8 @@ consider insecure or to be insecure pretty soon.
3. To generate a DSA key
-A DSA key can be used for signing only. This is important to keep
-in mind to know what kind of purposes a certificate request with a
-DSA key can really be used for.
+A DSA key can be used for signing only. It is important to
+know what a certificate request with a DSA key can really be used for.
Generating a key for the DSA algorithm is a two-step process. First,
you have to generate parameters from which to generate the key:
diff --git a/crypto/openssl/doc/README b/crypto/openssl/doc/README
index 6ecc14d..cc76040 100644
--- a/crypto/openssl/doc/README
+++ b/crypto/openssl/doc/README
@@ -1,12 +1,21 @@
- apps/openssl.pod .... Documentation of OpenSSL `openssl' command
- crypto/crypto.pod ... Documentation of OpenSSL crypto.h+libcrypto.a
- ssl/ssl.pod ......... Documentation of OpenSSL ssl.h+libssl.a
- openssl.txt ......... Assembled documentation files for OpenSSL [not final]
- ssleay.txt .......... Assembled documentation of ancestor SSLeay [obsolete]
- standards.txt ....... Assembled pointers to standards, RFCs or internet drafts
- that are related to OpenSSL.
+README This file
- An archive of HTML documents for the SSLeay library is available from
- http://www.columbia.edu/~ariel/ssleay/
+fingerprints.txt
+ PGP fingerprints of authoried release signers
+standards.txt
+ Pointers to standards, RFC's and IETF Drafts that are
+ related to OpenSSL. Incomplete.
+
+HOWTO/
+ A few how-to documents; not necessarily up-to-date
+apps/
+ The openssl command-line tools; start with openssl.pod
+ssl/
+ The SSL library; start with ssl.pod
+crypto/
+ The cryptographic library; start with crypto.pod
+
+Formatted versions of the manpages (apps,ssl,crypto) can be found at
+ https://www.openssl.org/docs/manpages.html
diff --git a/crypto/openssl/doc/apps/dgst.pod b/crypto/openssl/doc/apps/dgst.pod
index 405847a..9d2bf21 100644
--- a/crypto/openssl/doc/apps/dgst.pod
+++ b/crypto/openssl/doc/apps/dgst.pod
@@ -13,7 +13,6 @@ B<openssl> B<dgst>
[B<-hex>]
[B<-binary>]
[B<-r>]
-[B<-hmac arg>]
[B<-non-fips-allow>]
[B<-out filename>]
[B<-sign filename>]
@@ -64,10 +63,6 @@ output the digest or signature in binary form.
output the digest in the "coreutils" format used by programs like B<sha1sum>.
-=item B<-hmac arg>
-
-set the HMAC key to "arg".
-
=item B<-non-fips-allow>
Allow use of non FIPS digest when in FIPS mode. This has no effect when not in
diff --git a/crypto/openssl/doc/apps/genrsa.pod b/crypto/openssl/doc/apps/genrsa.pod
index cb03d09..3dc9870 100644
--- a/crypto/openssl/doc/apps/genrsa.pod
+++ b/crypto/openssl/doc/apps/genrsa.pod
@@ -10,12 +10,6 @@ B<openssl> B<genrsa>
[B<-out filename>]
[B<-passout arg>]
[B<-aes128>]
-[B<-aes128>]
-[B<-aes192>]
-[B<-aes256>]
-[B<-camellia128>]
-[B<-camellia192>]
-[B<-camellia256>]
[B<-aes192>]
[B<-aes256>]
[B<-camellia128>]
diff --git a/crypto/openssl/doc/apps/pkcs12.pod b/crypto/openssl/doc/apps/pkcs12.pod
index 8e0d917..7449848 100644
--- a/crypto/openssl/doc/apps/pkcs12.pod
+++ b/crypto/openssl/doc/apps/pkcs12.pod
@@ -216,7 +216,7 @@ key is encrypted using triple DES and the certificate using 40 bit RC2.
these options allow the algorithm used to encrypt the private key and
certificates to be selected. Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name
-can be used (see B<NOTES> section for more information). If a a cipher name
+can be used (see B<NOTES> section for more information). If a cipher name
(as output by the B<list-cipher-algorithms> command is specified then it
is used with PKCS#5 v2.0. For interoperability reasons it is advisable to only
use PKCS#12 algorithms.
diff --git a/crypto/openssl/doc/apps/req.pod b/crypto/openssl/doc/apps/req.pod
index df68cb0..54a4d39 100644
--- a/crypto/openssl/doc/apps/req.pod
+++ b/crypto/openssl/doc/apps/req.pod
@@ -30,7 +30,6 @@ B<openssl> B<req>
[B<-keygen_engine id>]
[B<-[digest]>]
[B<-config filename>]
-[B<-subj arg>]
[B<-multivalue-rdn>]
[B<-x509>]
[B<-days n>]
@@ -490,7 +489,7 @@ be input by calling it "1.organizationName".
The actual permitted field names are any object identifier short or
long names. These are compiled into OpenSSL and include the usual
values such as commonName, countryName, localityName, organizationName,
-organizationUnitName, stateOrProvinceName. Additionally emailAddress
+organizationalUnitName, stateOrProvinceName. Additionally emailAddress
is include as well as name, surname, givenName initials and dnQualifier.
Additional object identifiers can be defined with the B<oid_file> or
@@ -506,16 +505,16 @@ Examine and verify certificate request:
Create a private key and then generate a certificate request from it:
- openssl genrsa -out key.pem 1024
+ openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out req.pem
The same but just using req:
- openssl req -newkey rsa:1024 -keyout key.pem -out req.pem
+ openssl req -newkey rsa:2048 -keyout key.pem -out req.pem
Generate a self signed root certificate:
- openssl req -x509 -newkey rsa:1024 -keyout key.pem -out req.pem
+ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out req.pem
Example of a file pointed to by the B<oid_file> option:
@@ -531,7 +530,7 @@ expansion:
Sample configuration file prompting for field values:
[ req ]
- default_bits = 1024
+ default_bits = 2048
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
@@ -572,7 +571,7 @@ Sample configuration containing all field values:
RANDFILE = $ENV::HOME/.rnd
[ req ]
- default_bits = 1024
+ default_bits = 2048
default_keyfile = keyfile.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
diff --git a/crypto/openssl/doc/apps/x509.pod b/crypto/openssl/doc/apps/x509.pod
index c83c0f6..f72e978 100644
--- a/crypto/openssl/doc/apps/x509.pod
+++ b/crypto/openssl/doc/apps/x509.pod
@@ -539,7 +539,8 @@ very rare and their use is discouraged). The options ending in
"space" additionally place a space after the separator to make it
more readable. The B<sep_multiline> uses a linefeed character for
the RDN separator and a spaced B<+> for the AVA separator. It also
-indents the fields by four characters.
+indents the fields by four characters. If no field separator is specified
+then B<sep_comma_plus_space> is used by default.
=item B<dn_rev>
diff --git a/crypto/openssl/doc/crypto/BIO_read.pod b/crypto/openssl/doc/crypto/BIO_read.pod
index b345281..2c177f0 100644
--- a/crypto/openssl/doc/crypto/BIO_read.pod
+++ b/crypto/openssl/doc/crypto/BIO_read.pod
@@ -9,9 +9,9 @@ BIO_read, BIO_write, BIO_gets, BIO_puts - BIO I/O functions
#include <openssl/bio.h>
int BIO_read(BIO *b, void *buf, int len);
- int BIO_gets(BIO *b,char *buf, int size);
+ int BIO_gets(BIO *b, char *buf, int size);
int BIO_write(BIO *b, const void *buf, int len);
- int BIO_puts(BIO *b,const char *buf);
+ int BIO_puts(BIO *b, const char *buf);
=head1 DESCRIPTION
@@ -26,7 +26,7 @@ return the digest and other BIOs may not support BIO_gets() at all.
BIO_write() attempts to write B<len> bytes from B<buf> to BIO B<b>.
-BIO_puts() attempts to write a null terminated string B<buf> to BIO B<b>
+BIO_puts() attempts to write a null terminated string B<buf> to BIO B<b>.
=head1 RETURN VALUES
diff --git a/crypto/openssl/doc/crypto/BN_rand.pod b/crypto/openssl/doc/crypto/BN_rand.pod
index bd6bc86..e8cbf65 100644
--- a/crypto/openssl/doc/crypto/BN_rand.pod
+++ b/crypto/openssl/doc/crypto/BN_rand.pod
@@ -19,7 +19,7 @@ BN_rand, BN_pseudo_rand, BN_rand_range, BN_pseudo_rand_range - generate pseudo-r
=head1 DESCRIPTION
BN_rand() generates a cryptographically strong pseudo-random number of
-B<bits> bits in length and stores it in B<rnd>. If B<top> is -1, the
+B<bits> in length and stores it in B<rnd>. If B<top> is -1, the
most significant bit of the random number can be zero. If B<top> is 0,
it is set to 1, and if B<top> is 1, the two most significant bits of
the number will be set to 1, so that the product of two such random
@@ -33,7 +33,7 @@ non-cryptographic purposes and for certain purposes in cryptographic
protocols, but usually not for key generation etc.
BN_rand_range() generates a cryptographically strong pseudo-random
-number B<rnd> in the range 0 <lt>= B<rnd> E<lt> B<range>.
+number B<rnd> in the range 0 E<lt>= B<rnd> E<lt> B<range>.
BN_pseudo_rand_range() does the same, but is based on BN_pseudo_rand(),
and hence numbers generated by it are not necessarily unpredictable.
diff --git a/crypto/openssl/doc/crypto/DSA_generate_parameters.pod b/crypto/openssl/doc/crypto/DSA_generate_parameters.pod
index 16a67f2..b1a4d20 100644
--- a/crypto/openssl/doc/crypto/DSA_generate_parameters.pod
+++ b/crypto/openssl/doc/crypto/DSA_generate_parameters.pod
@@ -29,7 +29,7 @@ maximum of 1024 bits.
If B<seed> is B<NULL> or B<seed_len> E<lt> 20, the primes will be
generated at random. Otherwise, the seed is used to generate
them. If the given seed does not yield a prime q, a new random
-seed is chosen and placed at B<seed>.
+seed is chosen.
DSA_generate_parameters_ex() places the iteration count in
*B<counter_ret> and a counter used for finding a generator in
diff --git a/crypto/openssl/doc/crypto/EC_KEY_new.pod b/crypto/openssl/doc/crypto/EC_KEY_new.pod
index e859689..0fa2de1 100644
--- a/crypto/openssl/doc/crypto/EC_KEY_new.pod
+++ b/crypto/openssl/doc/crypto/EC_KEY_new.pod
@@ -70,8 +70,8 @@ The functions EC_KEY_get0_group, EC_KEY_set_group, EC_KEY_get0_private_key, EC_K
The functions EC_KEY_get_conv_form and EC_KEY_set_conv_form get and set the point_conversion_form for the B<key>. For a description
of point_conversion_forms please refer to L<EC_POINT_new(3)|EC_POINT_new(3)>.
-EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitary additional data specific to the
-elliptic curve scheme being used with the EC_KEY object. This data is treated as a "black box" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the B<data> parameter, which must have have associated functions for duplicating, freeing and "clear_freeing" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and "clear_freeing" the data item must be provided again, and they must be the same as they were when the data item was inserted.
+EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitrary additional data specific to the
+elliptic curve scheme being used with the EC_KEY object. This data is treated as a "black box" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the B<data> parameter, which must have associated functions for duplicating, freeing and "clear_freeing" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and "clear_freeing" the data item must be provided again, and they must be the same as they were when the data item was inserted.
EC_KEY_set_flags sets the flags in the B<flags> parameter on the EC_KEY object. Any flags that are already set are left set. The currently defined standard flags are EC_FLAG_NON_FIPS_ALLOW and EC_FLAG_FIPS_CHECKED. In addition there is the flag EC_FLAG_COFACTOR_ECDH which is specific to ECDH and is defined in ecdh.h. EC_KEY_get_flags returns the current flags that are set for this EC_KEY. EC_KEY_clear_flags clears the flags indicated by the B<flags> parameter. All other flags are left in their existing state.
diff --git a/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod b/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod
index e0217e4..0ead2d2 100644
--- a/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod
+++ b/crypto/openssl/doc/crypto/EVP_DigestVerifyInit.pod
@@ -37,10 +37,11 @@ EVP_DigestVerifyInit() and EVP_DigestVerifyUpdate() return 1 for success and 0
or a negative value for failure. In particular a return value of -2 indicates
the operation is not supported by the public key algorithm.
-Unlike other functions the return value 0 from EVP_DigestVerifyFinal() only
-indicates that the signature did not verify successfully (that is tbs did
-not match the original data or the signature was of invalid form) it is not an
-indication of a more serious error.
+EVP_DigestVerifyFinal() returns 1 for success; any other value indicates
+failure. A return value of zero indicates that the signature did not verify
+successfully (that is, tbs did not match the original data or the signature had
+an invalid form), while other values indicate a more serious error (and
+sometimes also indicate an invalid signature form).
The error codes can be obtained from L<ERR_get_error(3)|ERR_get_error(3)>.
diff --git a/crypto/openssl/doc/crypto/EVP_EncryptInit.pod b/crypto/openssl/doc/crypto/EVP_EncryptInit.pod
index f02895c..9696fd8 100644
--- a/crypto/openssl/doc/crypto/EVP_EncryptInit.pod
+++ b/crypto/openssl/doc/crypto/EVP_EncryptInit.pod
@@ -111,7 +111,7 @@ EVP_CIPHER_CTX_init() initializes cipher contex B<ctx>.
EVP_EncryptInit_ex() sets up cipher context B<ctx> for encryption
with cipher B<type> from ENGINE B<impl>. B<ctx> must be initialized
before calling this function. B<type> is normally supplied
-by a function such as EVP_des_cbc(). If B<impl> is NULL then the
+by a function such as EVP_aes_256_cbc(). If B<impl> is NULL then the
default implementation is used. B<key> is the symmetric key to use
and B<iv> is the IV to use (if necessary), the actual number of bytes
used for the key and IV depends on the cipher. It is possible to set
diff --git a/crypto/openssl/doc/crypto/EVP_SealInit.pod b/crypto/openssl/doc/crypto/EVP_SealInit.pod
index 7d793e1..19112a5 100644
--- a/crypto/openssl/doc/crypto/EVP_SealInit.pod
+++ b/crypto/openssl/doc/crypto/EVP_SealInit.pod
@@ -25,7 +25,7 @@ encrypted using this key.
EVP_SealInit() initializes a cipher context B<ctx> for encryption
with cipher B<type> using a random secret key and IV. B<type> is normally
-supplied by a function such as EVP_des_cbc(). The secret key is encrypted
+supplied by a function such as EVP_aes_256_cbc(). The secret key is encrypted
using one or more public keys, this allows the same encrypted data to be
decrypted using any of the corresponding private keys. B<ek> is an array of
buffers where the public key encrypted secret key will be written, each buffer
diff --git a/crypto/openssl/doc/crypto/EVP_SignInit.pod b/crypto/openssl/doc/crypto/EVP_SignInit.pod
index 14ecc77..c63d6b3 100644
--- a/crypto/openssl/doc/crypto/EVP_SignInit.pod
+++ b/crypto/openssl/doc/crypto/EVP_SignInit.pod
@@ -2,7 +2,8 @@
=head1 NAME
-EVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions
+EVP_SignInit, EVP_SignInit_ex, EVP_SignUpdate, EVP_SignFinal - EVP signing
+functions
=head1 SYNOPSIS
diff --git a/crypto/openssl/doc/crypto/X509_check_host.pod b/crypto/openssl/doc/crypto/X509_check_host.pod
index 0def17a..521b9f5 100644
--- a/crypto/openssl/doc/crypto/X509_check_host.pod
+++ b/crypto/openssl/doc/crypto/X509_check_host.pod
@@ -135,6 +135,6 @@ L<X509_VERIFY_PARAM_set1_ipasc(3)|X509_VERIFY_PARAM_set1_ipasc(3)>
=head1 HISTORY
-These functions were added in OpenSSL 1.1.0.
+These functions were added in OpenSSL 1.0.2.
=cut
diff --git a/crypto/openssl/doc/crypto/buffer.pod b/crypto/openssl/doc/crypto/buffer.pod
index 781f5b1..52c5c84 100644
--- a/crypto/openssl/doc/crypto/buffer.pod
+++ b/crypto/openssl/doc/crypto/buffer.pod
@@ -2,8 +2,11 @@
=head1 NAME
-BUF_MEM_new, BUF_MEM_free, BUF_MEM_grow, BUF_strdup - simple
-character arrays structure
+BUF_MEM_new, BUF_MEM_new_ex, BUF_MEM_free, BUF_MEM_grow - simple
+character array structure
+
+BUF_strdup, BUF_strndup, BUF_memdup, BUF_strlcpy, BUF_strlcat -
+standard C library equivalents
=head1 SYNOPSIS
@@ -15,25 +18,22 @@ character arrays structure
int BUF_MEM_grow(BUF_MEM *str, int len);
- char * BUF_strdup(const char *str);
+ char *BUF_strdup(const char *str);
-=head1 DESCRIPTION
+ char *BUF_strndup(const char *str, size_t siz);
-The buffer library handles simple character arrays. Buffers are used for
-various purposes in the library, most notably memory BIOs.
+ void *BUF_memdup(const void *data, size_t siz);
+
+ size_t BUF_strlcpy(char *dst, const char *src, size_t size);
-The library uses the BUF_MEM structure defined in buffer.h:
+ size_t BUF_strlcat(char *dst, const char *src, size_t size);
- typedef struct buf_mem_st
- {
- int length; /* current number of bytes */
- char *data;
- int max; /* size of buffer */
- } BUF_MEM;
+ size_t BUF_strnlen(const char *str, size_t maxlen);
-B<length> is the current size of the buffer in bytes, B<max> is the amount of
-memory allocated to the buffer. There are three functions which handle these
-and one "miscellaneous" function.
+=head1 DESCRIPTION
+
+The buffer library handles simple character arrays. Buffers are used for
+various purposes in the library, most notably memory BIOs.
BUF_MEM_new() allocates a new buffer of zero size.
@@ -44,14 +44,17 @@ BUF_MEM_grow() changes the size of an already existing buffer to
B<len>. Any data already in the buffer is preserved if it increases in
size.
-BUF_strdup() copies a null terminated string into a block of allocated
-memory and returns a pointer to the allocated block.
-Unlike the standard C library strdup() this function uses OPENSSL_malloc() and so
-should be used in preference to the standard library strdup() because it can
-be used for memory leak checking or replacing the malloc() function.
+BUF_strdup(), BUF_strndup(), BUF_memdup(), BUF_strlcpy(),
+BUF_strlcat() and BUF_strnlen are equivalents of the standard C
+library functions. The dup() functions use OPENSSL_malloc() underneath
+and so should be used in preference to the standard library for memory
+leak checking or replacing the malloc() function.
+
+Memory allocated from these functions should be freed up using the
+OPENSSL_free() function.
-The memory allocated from BUF_strdup() should be freed up using the OPENSSL_free()
-function.
+BUF_strndup makes the explicit guarantee that it will never read past
+the first B<siz> bytes of B<str>.
=head1 RETURN VALUES
diff --git a/crypto/openssl/doc/crypto/d2i_X509_NAME.pod b/crypto/openssl/doc/crypto/d2i_X509_NAME.pod
index 343ffe1..b025de7 100644
--- a/crypto/openssl/doc/crypto/d2i_X509_NAME.pod
+++ b/crypto/openssl/doc/crypto/d2i_X509_NAME.pod
@@ -14,7 +14,7 @@ d2i_X509_NAME, i2d_X509_NAME - X509_NAME encoding functions
=head1 DESCRIPTION
These functions decode and encode an B<X509_NAME> structure which is the
-the same as the B<Name> type defined in RFC2459 (and elsewhere) and used
+same as the B<Name> type defined in RFC2459 (and elsewhere) and used
for example in certificate subject and issuer names.
Othewise the functions behave in a similar way to d2i_X509() and i2d_X509()
diff --git a/crypto/openssl/doc/crypto/engine.pod b/crypto/openssl/doc/crypto/engine.pod
index 8435d6b..24c815a 100644
--- a/crypto/openssl/doc/crypto/engine.pod
+++ b/crypto/openssl/doc/crypto/engine.pod
@@ -192,7 +192,7 @@ to use the pointer value at all, as this kind of reference is a guarantee
that the structure can not be deallocated until the reference is released.
However, a structural reference provides no guarantee that the ENGINE is
-initiliased and able to use any of its cryptographic
+initialised and able to use any of its cryptographic
implementations. Indeed it's quite possible that most ENGINEs will not
initialise at all in typical environments, as ENGINEs are typically used to
support specialised hardware. To use an ENGINE's functionality, you need a
@@ -201,8 +201,8 @@ specialised form of structural reference, because each functional reference
implicitly contains a structural reference as well - however to avoid
difficult-to-find programming bugs, it is recommended to treat the two
kinds of reference independently. If you have a functional reference to an
-ENGINE, you have a guarantee that the ENGINE has been initialised ready to
-perform cryptographic operations and will remain uninitialised
+ENGINE, you have a guarantee that the ENGINE has been initialised and
+is ready to perform cryptographic operations, and will remain initialised
until after you have released your reference.
I<Structural references>
@@ -370,7 +370,7 @@ I<Using a specific ENGINE implementation>
Here we'll assume an application has been configured by its user or admin
to want to use the "ACME" ENGINE if it is available in the version of
OpenSSL the application was compiled with. If it is available, it should be
-used by default for all RSA, DSA, and symmetric cipher operation, otherwise
+used by default for all RSA, DSA, and symmetric cipher operations, otherwise
OpenSSL should use its builtin software as per usual. The following code
illustrates how to approach this;
@@ -401,7 +401,7 @@ I<Automatically using builtin ENGINE implementations>
Here we'll assume we want to load and register all ENGINE implementations
bundled with OpenSSL, such that for any cryptographic algorithm required by
-OpenSSL - if there is an ENGINE that implements it and can be initialise,
+OpenSSL - if there is an ENGINE that implements it and can be initialised,
it should be used. The following code illustrates how this can work;
/* Load all bundled ENGINEs into memory and make them visible */
diff --git a/crypto/openssl/doc/dir-locals.example.el b/crypto/openssl/doc/dir-locals.example.el
new file mode 100644
index 0000000..79d0b011
--- /dev/null
+++ b/crypto/openssl/doc/dir-locals.example.el
@@ -0,0 +1,15 @@
+;;; This is an example of what a .dir-locals.el suitable for OpenSSL
+;;; development could look like.
+;;;
+;;; Apart from setting the CC mode style to "OpenSSL-II", it also
+;;; makes sure that tabs are never used for indentation in any file,
+;;; and that the fill column is 78.
+;;;
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil
+ (indent-tabs-mode . nil)
+ (fill-column . 78)
+ )
+ (c-mode
+ (c-file-style . "OpenSSL-II")))
diff --git a/crypto/openssl/doc/openssl-c-indent.el b/crypto/openssl/doc/openssl-c-indent.el
new file mode 100644
index 0000000..144a915
--- /dev/null
+++ b/crypto/openssl/doc/openssl-c-indent.el
@@ -0,0 +1,62 @@
+;;; This Emacs Lisp file defines a C indentation style for OpenSSL.
+;;;
+;;; This definition is for the "CC mode" package, which is the default
+;;; mode for editing C source files in Emacs 20, not for the older
+;;; c-mode.el (which was the default in less recent releaes of Emacs 19).
+;;;
+;;; Recommended use is to add this line in your .emacs:
+;;;
+;;; (load (expand-file-name "~/PATH/TO/openssl-c-indent.el"))
+;;;
+;;; To activate this indentation style, visit a C file, type
+;;; M-x c-set-style <RET> (or C-c . for short), and enter "eay".
+;;; To toggle the auto-newline feature of CC mode, type C-c C-a.
+;;;
+;;; If you're a OpenSSL developer, you might find it more comfortable
+;;; to have this style be permanent in your OpenSSL development
+;;; directory. To have that, please perform this:
+;;;
+;;; M-x add-dir-local-variable <RET> c-mode <RET> c-file-style <RET>
+;;; "OpenSSL-II" <RET>
+;;;
+;;; A new buffer with .dir-locals.el will appear. Save it (C-x C-s).
+;;;
+;;; Alternatively, have a look at dir-locals.example.el
+
+;;; For suggesting improvements, please send e-mail to levitte@openssl.org.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Note, it could be easy to inherit from the "gnu" style... however,
+;; one never knows if that style will change somewhere in the future,
+;; so I've chosen to copy the "gnu" style values explicitely instead
+;; and mark them with a comment. // RLevitte 2015-08-31
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(c-add-style "OpenSSL-II"
+ '((c-basic-offset . 4)
+ (indent-tabs-mode . nil)
+ (fill-column . 78)
+ (comment-column . 33)
+ (c-comment-only-line-offset 0 . 0) ; From "gnu" style
+ (c-hanging-braces-alist ; From "gnu" style
+ (substatement-open before after) ; From "gnu" style
+ (arglist-cont-nonempty)) ; From "gnu" style
+ (c-offsets-alist
+ (statement-block-intro . +) ; From "gnu" style
+ (knr-argdecl-intro . 0)
+ (knr-argdecl . 0)
+ (substatement-open . +) ; From "gnu" style
+ (substatement-label . 0) ; From "gnu" style
+ (label . 1)
+ (statement-case-open . +) ; From "gnu" style
+ (statement-cont . +) ; From "gnu" style
+ (arglist-intro . c-lineup-arglist-intro-after-paren) ; From "gnu" style
+ (arglist-close . c-lineup-arglist) ; From "gnu" style
+ (inline-open . 0) ; From "gnu" style
+ (brace-list-open . +) ; From "gnu" style
+ (topmost-intro-cont first c-lineup-topmost-intro-cont
+ c-lineup-gnu-DEFUN-intro-cont) ; From "gnu" style
+ )
+ (c-special-indent-hook . c-gnu-impose-minimum) ; From "gnu" style
+ (c-block-comment-prefix . "* ")
+ ))
diff --git a/crypto/openssl/doc/openssl_button.gif b/crypto/openssl/doc/openssl_button.gif
deleted file mode 100644
index 3d3c90c..0000000
--- a/crypto/openssl/doc/openssl_button.gif
+++ /dev/null
Binary files differ
diff --git a/crypto/openssl/doc/openssl_button.html b/crypto/openssl/doc/openssl_button.html
deleted file mode 100644
index 44c91bd..0000000
--- a/crypto/openssl/doc/openssl_button.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-<!-- the `Includes OpenSSL Cryptogaphy Software' button -->
-<!-- freely usable by any application linked against OpenSSL -->
-<a href="http://www.openssl.org/">
-<img src="openssl_button.gif"
- width=102 height=47 border=0></a>
-
diff --git a/crypto/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod b/crypto/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod
index 8e832a5..04300fb 100644
--- a/crypto/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod
+++ b/crypto/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod
@@ -2,29 +2,39 @@
=head1 NAME
-SSL_CTX_add_extra_chain_cert - add certificate to chain
+SSL_CTX_add_extra_chain_cert, SSL_CTX_clear_extra_chain_certs - add or clear
+extra chain certificates
=head1 SYNOPSIS
#include <openssl/ssl.h>
- long SSL_CTX_add_extra_chain_cert(SSL_CTX ctx, X509 *x509)
+ long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509);
+ long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx);
=head1 DESCRIPTION
-SSL_CTX_add_extra_chain_cert() adds the certificate B<x509> to the certificate
-chain presented together with the certificate. Several certificates
-can be added one after the other.
+SSL_CTX_add_extra_chain_cert() adds the certificate B<x509> to the extra chain
+certificates associated with B<ctx>. Several certificates can be added one
+after another.
+
+SSL_CTX_clear_extra_chain_certs() clears all extra chain certificates
+associated with B<ctx>.
+
+These functions are implemented as macros.
=head1 NOTES
-When constructing the certificate chain, the chain will be formed from
-these certificates explicitly specified. If no chain is specified,
-the library will try to complete the chain from the available CA
-certificates in the trusted CA storage, see
+When sending a certificate chain, extra chain certificates are sent in order
+following the end entity certificate.
+
+If no chain is specified, the library will try to complete the chain from the
+available CA certificates in the trusted CA storage, see
L<SSL_CTX_load_verify_locations(3)|SSL_CTX_load_verify_locations(3)>.
-The B<x509> certificate provided to SSL_CTX_add_extra_chain_cert() will be freed by the library when the B<SSL_CTX> is destroyed. An application B<should not> free the B<x509> object.
+The B<x509> certificate provided to SSL_CTX_add_extra_chain_cert() will be
+freed by the library when the B<SSL_CTX> is destroyed. An application
+B<should not> free the B<x509> object.
=head1 RESTRICTIONS
@@ -37,8 +47,9 @@ be used instead.
=head1 RETURN VALUES
-SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the
-error stack to find out the reason for failure otherwise.
+SSL_CTX_add_extra_chain_cert() and SSL_CTX_clear_extra_chain_certs() return
+1 on success and 0 for failure. Check out the error stack to find out the
+reason for failure.
=head1 SEE ALSO
diff --git a/crypto/openssl/doc/ssl/SSL_CTX_get0_param.pod b/crypto/openssl/doc/ssl/SSL_CTX_get0_param.pod
index 332f181..ba16b50 100644
--- a/crypto/openssl/doc/ssl/SSL_CTX_get0_param.pod
+++ b/crypto/openssl/doc/ssl/SSL_CTX_get0_param.pod
@@ -34,7 +34,7 @@ them to suit its needs: for example to add a hostname check.
Check hostname matches "www.foo.com" in peer certificate:
X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
- X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com");
+ X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
=head1 RETURN VALUES
diff --git a/crypto/openssl/doc/ssl/SSL_check_chain.pod b/crypto/openssl/doc/ssl/SSL_check_chain.pod
new file mode 100644
index 0000000..d3b7601
--- /dev/null
+++ b/crypto/openssl/doc/ssl/SSL_check_chain.pod
@@ -0,0 +1,85 @@
+=pod
+
+=head1 NAME
+
+SSL_check_chain - check certificate chain suitability
+
+=head1 SYNOPSIS
+
+ #include <openssl/ssl.h>
+
+ int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);
+
+=head1 DESCRIPTION
+
+SSL_check_chain() checks whether certificate B<x>, private key B<pk> and
+certificate chain B<chain> is suitable for use with the current session
+B<s>.
+
+=head1 RETURN VALUES
+
+SSL_check_chain() returns a bitmap of flags indicating the validity of the
+chain.
+
+B<CERT_PKEY_VALID>: the chain can be used with the current session.
+If this flag is B<not> set then the certificate will never be used even
+if the application tries to set it because it is inconsistent with the
+peer preferences.
+
+B<CERT_PKEY_SIGN>: the EE key can be used for signing.
+
+B<CERT_PKEY_EE_SIGNATURE>: the signature algorithm of the EE certificate is
+acceptable.
+
+B<CERT_PKEY_CA_SIGNATURE>: the signature algorithms of all CA certificates
+are acceptable.
+
+B<CERT_PKEY_EE_PARAM>: the parameters of the end entity certificate are
+acceptable (e.g. it is a supported curve).
+
+B<CERT_PKEY_CA_PARAM>: the parameters of all CA certificates are acceptable.
+
+B<CERT_PKEY_EXPLICIT_SIGN>: the end entity certificate algorithm
+can be used explicitly for signing (i.e. it is mentioned in the signature
+algorithms extension).
+
+B<CERT_PKEY_ISSUER_NAME>: the issuer name is acceptable. This is only
+meaningful for client authentication.
+
+B<CERT_PKEY_CERT_TYPE>: the certificate type is acceptable. Only meaningful
+for client authentication.
+
+B<CERT_PKEY_SUITEB>: chain is suitable for Suite B use.
+
+=head1 NOTES
+
+SSL_check_chain() must be called in servers after a client hello message or in
+clients after a certificate request message. It will typically be called
+in the certificate callback.
+
+An application wishing to support multiple certificate chains may call this
+function on each chain in turn: starting with the one it considers the
+most secure. It could then use the chain of the first set which returns
+suitable flags.
+
+As a minimum the flag B<CERT_PKEY_VALID> must be set for a chain to be
+usable. An application supporting multiple chains with different CA signature
+algorithms may also wish to check B<CERT_PKEY_CA_SIGNATURE> too. If no
+chain is suitable a server should fall back to the most secure chain which
+sets B<CERT_PKEY_VALID>.
+
+The validity of a chain is determined by checking if it matches a supported
+signature algorithm, supported curves and in the case of client authentication
+certificate types and issuer names.
+
+Since the supported signature algorithms extension is only used in TLS 1.2
+and DTLS 1.2 the results for earlier versions of TLS and DTLS may not be
+very useful. Applications may wish to specify a different "legacy" chain
+for earlier versions of TLS or DTLS.
+
+=head1 SEE ALSO
+
+L<SSL_CTX_set_cert_cb(3)|SSL_CTX_set_cert_cb(3)>,
+L<ssl(3)|ssl(3)>
+
+=cut
diff --git a/crypto/openssl/e_os.h b/crypto/openssl/e_os.h
index 45fef69..1fa36c1 100644
--- a/crypto/openssl/e_os.h
+++ b/crypto/openssl/e_os.h
@@ -619,7 +619,7 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# include <sys/select.h>
# endif
-# if defined(sun)
+# if defined(__sun) || defined(sun)
# include <sys/filio.h>
# else
# ifndef VMS
@@ -661,7 +661,7 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# endif
-# if defined(sun) && !defined(__svr4__) && !defined(__SVR4)
+# if (defined(__sun) || defined(sun)) && !defined(__svr4__) && !defined(__SVR4)
/* include headers first, so our defines don't break it */
# include <stdlib.h>
# include <string.h>
diff --git a/crypto/openssl/engines/e_chil.c b/crypto/openssl/engines/e_chil.c
index 69d49d7..72d14fe 100644
--- a/crypto/openssl/engines/e_chil.c
+++ b/crypto/openssl/engines/e_chil.c
@@ -839,6 +839,10 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id,
bn_fix_top(rtmp->n);
res = EVP_PKEY_new();
+ if (res == NULL) {
+ HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, HWCRHK_R_CHIL_ERROR);
+ goto err;
+ }
EVP_PKEY_assign_RSA(res, rtmp);
# endif
diff --git a/crypto/openssl/ssl/Makefile b/crypto/openssl/ssl/Makefile
index 42f1af5..7b90fb0 100644
--- a/crypto/openssl/ssl/Makefile
+++ b/crypto/openssl/ssl/Makefile
@@ -15,7 +15,7 @@ KRB5_INCLUDES=
CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile README ssl-lib.com install.com
-TEST=ssltest.c heartbeat_test.c
+TEST=ssltest.c heartbeat_test.c clienthellotest.c
APPS=
LIB=$(TOP)/libssl.a
diff --git a/crypto/openssl/ssl/bio_ssl.c b/crypto/openssl/ssl/bio_ssl.c
index a0c583e..d2d4d2e 100644
--- a/crypto/openssl/ssl/bio_ssl.c
+++ b/crypto/openssl/ssl/bio_ssl.c
@@ -419,6 +419,10 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
BIO_set_flags(b, BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY);
b->retry_reason = b->next_bio->retry_reason;
break;
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ BIO_set_retry_special(b);
+ b->retry_reason = BIO_RR_SSL_X509_LOOKUP;
+ break;
default:
break;
}
diff --git a/crypto/openssl/ssl/clienthellotest.c b/crypto/openssl/ssl/clienthellotest.c
new file mode 100644
index 0000000..77517c6
--- /dev/null
+++ b/crypto/openssl/ssl/clienthellotest.c
@@ -0,0 +1,219 @@
+/* Written by Matt Caswell for the OpenSSL Project */
+/* ====================================================================
+ * Copyright (c) 1998-2015 The OpenSSL 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.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED 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 OpenSSL PROJECT OR
+ * ITS 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.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+#include <string.h>
+
+#include <openssl/bio.h>
+#include <openssl/crypto.h>
+#include <openssl/evp.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+
+
+#define CLIENT_VERSION_LEN 2
+#define SESSION_ID_LEN_LEN 1
+#define CIPHERS_LEN_LEN 2
+#define COMPRESSION_LEN_LEN 1
+#define EXTENSIONS_LEN_LEN 2
+#define EXTENSION_TYPE_LEN 2
+#define EXTENSION_SIZE_LEN 2
+
+
+#define TOTAL_NUM_TESTS 2
+
+/*
+ * Test that explicitly setting ticket data results in it appearing in the
+ * ClientHello for TLS1.2
+ */
+#define TEST_SET_SESSION_TICK_DATA_TLS_1_2 0
+
+/*
+ * Test that explicitly setting ticket data results in it appearing in the
+ * ClientHello for a negotiated SSL/TLS version
+ */
+#define TEST_SET_SESSION_TICK_DATA_VER_NEG 1
+
+int main(int argc, char *argv[])
+{
+ SSL_CTX *ctx;
+ SSL *con;
+ BIO *rbio;
+ BIO *wbio;
+ BIO *err;
+ long len;
+ unsigned char *data;
+ unsigned char *dataend;
+ char *dummytick = "Hello World!";
+ unsigned int tmplen;
+ unsigned int type;
+ unsigned int size;
+ int testresult = 0;
+ int currtest = 0;
+
+ SSL_library_init();
+ SSL_load_error_strings();
+
+ err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
+
+ CRYPTO_malloc_debug_init();
+ CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL);
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
+
+ /*
+ * For each test set up an SSL_CTX and SSL and see what ClientHello gets
+ * produced when we try to connect
+ */
+ for (; currtest < TOTAL_NUM_TESTS; currtest++) {
+ testresult = 0;
+ if (currtest == TEST_SET_SESSION_TICK_DATA_TLS_1_2) {
+ ctx = SSL_CTX_new(TLSv1_2_method());
+ } else {
+ ctx = SSL_CTX_new(SSLv23_method());
+ }
+ con = SSL_new(ctx);
+
+ rbio = BIO_new(BIO_s_mem());
+ wbio = BIO_new(BIO_s_mem());
+ SSL_set_bio(con, rbio, wbio);
+ SSL_set_connect_state(con);
+
+ if (currtest == TEST_SET_SESSION_TICK_DATA_TLS_1_2
+ || currtest == TEST_SET_SESSION_TICK_DATA_VER_NEG) {
+ if (!SSL_set_session_ticket_ext(con, dummytick, strlen(dummytick)))
+ goto end;
+ }
+
+ if (SSL_connect(con) > 0) {
+ /* This shouldn't succeed because we don't have a server! */
+ goto end;
+ }
+
+ len = BIO_get_mem_data(wbio, (char **)&data);
+ dataend = data + len;
+
+ /* Skip the record header */
+ data += SSL3_RT_HEADER_LENGTH;
+ /* Skip the handshake message header */
+ data += SSL3_HM_HEADER_LENGTH;
+ /* Skip client version and random */
+ data += CLIENT_VERSION_LEN + SSL3_RANDOM_SIZE;
+ if (data + SESSION_ID_LEN_LEN > dataend)
+ goto end;
+ /* Skip session id */
+ tmplen = *data;
+ data += SESSION_ID_LEN_LEN + tmplen;
+ if (data + CIPHERS_LEN_LEN > dataend)
+ goto end;
+ /* Skip ciphers */
+ tmplen = ((*data) << 8) | *(data + 1);
+ data += CIPHERS_LEN_LEN + tmplen;
+ if (data + COMPRESSION_LEN_LEN > dataend)
+ goto end;
+ /* Skip compression */
+ tmplen = *data;
+ data += COMPRESSION_LEN_LEN + tmplen;
+ if (data + EXTENSIONS_LEN_LEN > dataend)
+ goto end;
+ /* Extensions len */
+ tmplen = ((*data) << 8) | *(data + 1);
+ data += EXTENSIONS_LEN_LEN;
+ if (data + tmplen > dataend)
+ goto end;
+
+ /* Loop through all extensions */
+ while (tmplen > EXTENSION_TYPE_LEN + EXTENSION_SIZE_LEN) {
+ type = ((*data) << 8) | *(data + 1);
+ data += EXTENSION_TYPE_LEN;
+ size = ((*data) << 8) | *(data + 1);
+ data += EXTENSION_SIZE_LEN;
+ if (data + size > dataend)
+ goto end;
+
+ if (type == TLSEXT_TYPE_session_ticket) {
+ if (currtest == TEST_SET_SESSION_TICK_DATA_TLS_1_2
+ || currtest == TEST_SET_SESSION_TICK_DATA_VER_NEG) {
+ if (size == strlen(dummytick)
+ && memcmp(data, dummytick, size) == 0) {
+ /* Ticket data is as we expected */
+ testresult = 1;
+ } else {
+ printf("Received session ticket is not as expected\n");
+ }
+ break;
+ }
+ }
+
+ tmplen -= EXTENSION_TYPE_LEN + EXTENSION_SIZE_LEN + size;
+ data += size;
+ }
+
+ end:
+ SSL_free(con);
+ SSL_CTX_free(ctx);
+ if (!testresult) {
+ printf("ClientHello test: FAILED (Test %d)\n", currtest);
+ break;
+ }
+ }
+
+ ERR_free_strings();
+ ERR_remove_thread_state(NULL);
+ EVP_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+ CRYPTO_mem_leaks(err);
+ BIO_free(err);
+
+ return testresult?0:1;
+}
diff --git a/crypto/openssl/ssl/d1_both.c b/crypto/openssl/ssl/d1_both.c
index b4ee7ab..c2c8d57 100644
--- a/crypto/openssl/ssl/d1_both.c
+++ b/crypto/openssl/ssl/d1_both.c
@@ -1370,9 +1370,12 @@ int dtls1_shutdown(SSL *s)
{
int ret;
#ifndef OPENSSL_NO_SCTP
- if (BIO_dgram_is_sctp(SSL_get_wbio(s)) &&
+ BIO *wbio;
+
+ wbio = SSL_get_wbio(s);
+ if (wbio != NULL && BIO_dgram_is_sctp(wbio) &&
!(s->shutdown & SSL_SENT_SHUTDOWN)) {
- ret = BIO_dgram_sctp_wait_for_dry(SSL_get_wbio(s));
+ ret = BIO_dgram_sctp_wait_for_dry(wbio);
if (ret < 0)
return -1;
diff --git a/crypto/openssl/ssl/d1_clnt.c b/crypto/openssl/ssl/d1_clnt.c
index 4c2ccbf..3ddfa7b 100644
--- a/crypto/openssl/ssl/d1_clnt.c
+++ b/crypto/openssl/ssl/d1_clnt.c
@@ -133,12 +133,14 @@ static int dtls1_get_hello_verify(SSL *s);
static const SSL_METHOD *dtls1_get_client_method(int ver)
{
- if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER)
- return (DTLSv1_client_method());
+ if (ver == DTLS_ANY_VERSION)
+ return DTLS_client_method();
+ else if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER)
+ return DTLSv1_client_method();
else if (ver == DTLS1_2_VERSION)
- return (DTLSv1_2_client_method());
+ return DTLSv1_2_client_method();
else
- return (NULL);
+ return NULL;
}
IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
@@ -147,13 +149,13 @@ IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
dtls1_connect,
dtls1_get_client_method, DTLSv1_enc_data)
- IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
DTLSv1_2_client_method,
ssl_undefined_function,
dtls1_connect,
dtls1_get_client_method, DTLSv1_2_enc_data)
- IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
DTLS_client_method,
ssl_undefined_function,
dtls1_connect,
@@ -315,13 +317,12 @@ int dtls1_connect(SSL *s)
#endif
case SSL3_ST_CW_CLNT_HELLO_A:
- case SSL3_ST_CW_CLNT_HELLO_B:
-
s->shutdown = 0;
/* every DTLS ClientHello resets Finished MAC */
ssl3_init_finished_mac(s);
+ case SSL3_ST_CW_CLNT_HELLO_B:
dtls1_start_timer(s);
ret = ssl3_client_hello(s);
if (ret <= 0)
@@ -366,11 +367,15 @@ int dtls1_connect(SSL *s)
sizeof(DTLS1_SCTP_AUTH_LABEL),
DTLS1_SCTP_AUTH_LABEL);
- SSL_export_keying_material(s, sctpauthkey,
+ if (SSL_export_keying_material(s, sctpauthkey,
sizeof(sctpauthkey),
labelbuffer,
sizeof(labelbuffer), NULL, 0,
- 0);
+ 0) <= 0) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
BIO_ctrl(SSL_get_wbio(s),
BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
@@ -378,6 +383,10 @@ int dtls1_connect(SSL *s)
#endif
s->state = SSL3_ST_CR_FINISHED_A;
+ if (s->tlsext_ticket_expected) {
+ /* receive renewed session ticket */
+ s->state = SSL3_ST_CR_SESSION_TICKET_A;
+ }
} else
s->state = DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A;
}
@@ -500,9 +509,13 @@ int dtls1_connect(SSL *s)
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
DTLS1_SCTP_AUTH_LABEL);
- SSL_export_keying_material(s, sctpauthkey,
+ if (SSL_export_keying_material(s, sctpauthkey,
sizeof(sctpauthkey), labelbuffer,
- sizeof(labelbuffer), NULL, 0, 0);
+ sizeof(labelbuffer), NULL, 0, 0) <= 0) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
sizeof(sctpauthkey), sctpauthkey);
diff --git a/crypto/openssl/ssl/d1_meth.c b/crypto/openssl/ssl/d1_meth.c
index 7340774..899010e 100644
--- a/crypto/openssl/ssl/d1_meth.c
+++ b/crypto/openssl/ssl/d1_meth.c
@@ -64,12 +64,14 @@
static const SSL_METHOD *dtls1_get_method(int ver);
static const SSL_METHOD *dtls1_get_method(int ver)
{
- if (ver == DTLS1_VERSION)
- return (DTLSv1_method());
+ if (ver == DTLS_ANY_VERSION)
+ return DTLS_method();
+ else if (ver == DTLS1_VERSION)
+ return DTLSv1_method();
else if (ver == DTLS1_2_VERSION)
- return (DTLSv1_2_method());
+ return DTLSv1_2_method();
else
- return (NULL);
+ return NULL;
}
IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
@@ -77,12 +79,12 @@ IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
dtls1_accept,
dtls1_connect, dtls1_get_method, DTLSv1_enc_data)
- IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
DTLSv1_2_method,
dtls1_accept,
dtls1_connect, dtls1_get_method, DTLSv1_2_enc_data)
- IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
DTLS_method,
dtls1_accept,
dtls1_connect, dtls1_get_method, DTLSv1_2_enc_data)
diff --git a/crypto/openssl/ssl/d1_srvr.c b/crypto/openssl/ssl/d1_srvr.c
index 655333a..e677d88 100644
--- a/crypto/openssl/ssl/d1_srvr.c
+++ b/crypto/openssl/ssl/d1_srvr.c
@@ -131,12 +131,14 @@ static int dtls1_send_hello_verify_request(SSL *s);
static const SSL_METHOD *dtls1_get_server_method(int ver)
{
- if (ver == DTLS1_VERSION)
- return (DTLSv1_server_method());
+ if (ver == DTLS_ANY_VERSION)
+ return DTLS_server_method();
+ else if (ver == DTLS1_VERSION)
+ return DTLSv1_server_method();
else if (ver == DTLS1_2_VERSION)
- return (DTLSv1_2_server_method());
+ return DTLSv1_2_server_method();
else
- return (NULL);
+ return NULL;
}
IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
@@ -145,13 +147,13 @@ IMPLEMENT_dtls1_meth_func(DTLS1_VERSION,
ssl_undefined_function,
dtls1_get_server_method, DTLSv1_enc_data)
- IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION,
DTLSv1_2_server_method,
dtls1_accept,
ssl_undefined_function,
dtls1_get_server_method, DTLSv1_2_enc_data)
- IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
+IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION,
DTLS_server_method,
dtls1_accept,
ssl_undefined_function,
@@ -283,6 +285,19 @@ int dtls1_accept(SSL *s)
ssl3_init_finished_mac(s);
s->state = SSL3_ST_SR_CLNT_HELLO_A;
s->ctx->stats.sess_accept++;
+ } else if (!s->s3->send_connection_binding &&
+ !(s->options &
+ SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) {
+ /*
+ * Server attempting to renegotiate with client that doesn't
+ * support secure renegotiation.
+ */
+ SSLerr(SSL_F_DTLS1_ACCEPT,
+ SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED);
+ ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE);
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
} else {
/*
* s->state == SSL_ST_RENEGOTIATE, we will just send a
@@ -421,9 +436,13 @@ int dtls1_accept(SSL *s)
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
DTLS1_SCTP_AUTH_LABEL);
- SSL_export_keying_material(s, sctpauthkey,
- sizeof(sctpauthkey), labelbuffer,
- sizeof(labelbuffer), NULL, 0, 0);
+ if (SSL_export_keying_material(s, sctpauthkey,
+ sizeof(sctpauthkey), labelbuffer,
+ sizeof(labelbuffer), NULL, 0, 0) <= 0) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
sizeof(sctpauthkey), sctpauthkey);
@@ -635,9 +654,13 @@ int dtls1_accept(SSL *s)
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL),
DTLS1_SCTP_AUTH_LABEL);
- SSL_export_keying_material(s, sctpauthkey,
+ if (SSL_export_keying_material(s, sctpauthkey,
sizeof(sctpauthkey), labelbuffer,
- sizeof(labelbuffer), NULL, 0, 0);
+ sizeof(labelbuffer), NULL, 0, 0) <= 0) {
+ ret = -1;
+ s->state = SSL_ST_ERR;
+ goto end;
+ }
BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY,
sizeof(sctpauthkey), sctpauthkey);
diff --git a/crypto/openssl/ssl/s23_clnt.c b/crypto/openssl/ssl/s23_clnt.c
index e4e707c..f782010 100644
--- a/crypto/openssl/ssl/s23_clnt.c
+++ b/crypto/openssl/ssl/s23_clnt.c
@@ -375,12 +375,13 @@ static int ssl23_client_hello(SSL *s)
buf = (unsigned char *)s->init_buf->data;
if (s->state == SSL23_ST_CW_CLNT_HELLO_A) {
-#if 0
- /* don't reuse session-id's */
+ /*
+ * Since we're sending s23 client hello, we're not reusing a session, as
+ * we'd be using the method from the saved session instead
+ */
if (!ssl_get_new_session(s, 0)) {
- return (-1);
+ return -1;
}
-#endif
p = s->s3->client_random;
if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0)
@@ -445,9 +446,6 @@ static int ssl23_client_hello(SSL *s)
/*
* put in the session-id length (zero since there is no reuse)
*/
-#if 0
- s->session->session_id_length = 0;
-#endif
s2n(0, d);
if (s->options & SSL_OP_NETSCAPE_CHALLENGE_BUG)
@@ -738,6 +736,8 @@ static int ssl23_get_server_hello(SSL *s)
goto err;
}
+ s->session->ssl_version = s->version;
+
/* ensure that TLS_MAX_VERSION is up-to-date */
OPENSSL_assert(s->version <= TLS_MAX_VERSION);
@@ -796,13 +796,6 @@ static int ssl23_get_server_hello(SSL *s)
}
s->init_num = 0;
- /*
- * Since, if we are sending a ssl23 client hello, we are not reusing a
- * session-id
- */
- if (!ssl_get_new_session(s, 0))
- goto err;
-
return (SSL_connect(s));
err:
return (-1);
diff --git a/crypto/openssl/ssl/s3_both.c b/crypto/openssl/ssl/s3_both.c
index 019e21c..09d0661 100644
--- a/crypto/openssl/ssl/s3_both.c
+++ b/crypto/openssl/ssl/s3_both.c
@@ -648,7 +648,7 @@ int ssl3_setup_read_buffer(SSL *s)
unsigned char *p;
size_t len, align = 0, headerlen;
- if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER)
+ if (SSL_IS_DTLS(s))
headerlen = DTLS1_RT_HEADER_LENGTH;
else
headerlen = SSL3_RT_HEADER_LENGTH;
@@ -687,7 +687,7 @@ int ssl3_setup_write_buffer(SSL *s)
unsigned char *p;
size_t len, align = 0, headerlen;
- if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER)
+ if (SSL_IS_DTLS(s))
headerlen = DTLS1_RT_HEADER_LENGTH + 1;
else
headerlen = SSL3_RT_HEADER_LENGTH;
diff --git a/crypto/openssl/ssl/s3_cbc.c b/crypto/openssl/ssl/s3_cbc.c
index a0edcef..557622f 100644
--- a/crypto/openssl/ssl/s3_cbc.c
+++ b/crypto/openssl/ssl/s3_cbc.c
@@ -411,8 +411,9 @@ char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx)
* functions, above, we know that data_plus_mac_size is large enough to contain
* a padding byte and MAC. (If the padding was invalid, it might contain the
* padding too. )
+ * Returns 1 on success or 0 on error
*/
-void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
+int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
unsigned char *md_out,
size_t *md_out_size,
const unsigned char header[13],
@@ -455,7 +456,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
switch (EVP_MD_CTX_type(ctx)) {
case NID_md5:
- MD5_Init((MD5_CTX *)md_state.c);
+ if (MD5_Init((MD5_CTX *)md_state.c) <= 0)
+ return 0;
md_final_raw = tls1_md5_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))MD5_Transform;
@@ -464,7 +466,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
length_is_big_endian = 0;
break;
case NID_sha1:
- SHA1_Init((SHA_CTX *)md_state.c);
+ if (SHA1_Init((SHA_CTX *)md_state.c) <= 0)
+ return 0;
md_final_raw = tls1_sha1_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA1_Transform;
@@ -472,14 +475,16 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
break;
#ifndef OPENSSL_NO_SHA256
case NID_sha224:
- SHA224_Init((SHA256_CTX *)md_state.c);
+ if (SHA224_Init((SHA256_CTX *)md_state.c) <= 0)
+ return 0;
md_final_raw = tls1_sha256_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA256_Transform;
md_size = 224 / 8;
break;
case NID_sha256:
- SHA256_Init((SHA256_CTX *)md_state.c);
+ if (SHA256_Init((SHA256_CTX *)md_state.c) <= 0)
+ return 0;
md_final_raw = tls1_sha256_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA256_Transform;
@@ -488,7 +493,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
#endif
#ifndef OPENSSL_NO_SHA512
case NID_sha384:
- SHA384_Init((SHA512_CTX *)md_state.c);
+ if (SHA384_Init((SHA512_CTX *)md_state.c) <= 0)
+ return 0;
md_final_raw = tls1_sha512_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA512_Transform;
@@ -497,7 +503,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
md_length_size = 16;
break;
case NID_sha512:
- SHA512_Init((SHA512_CTX *)md_state.c);
+ if (SHA512_Init((SHA512_CTX *)md_state.c) <= 0)
+ return 0;
md_final_raw = tls1_sha512_final_raw;
md_transform =
(void (*)(void *ctx, const unsigned char *block))SHA512_Transform;
@@ -513,8 +520,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
*/
OPENSSL_assert(0);
if (md_out_size)
- *md_out_size = -1;
- return;
+ *md_out_size = 0;
+ return 0;
}
OPENSSL_assert(md_length_size <= MAX_HASH_BIT_COUNT_BYTES);
@@ -652,7 +659,7 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
*/
if (header_length <= md_block_size) {
/* Should never happen */
- return;
+ return 0;
}
overhang = header_length - md_block_size;
md_transform(md_state.c, header);
@@ -733,26 +740,34 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
}
EVP_MD_CTX_init(&md_ctx);
- EVP_DigestInit_ex(&md_ctx, ctx->digest, NULL /* engine */ );
+ if (EVP_DigestInit_ex(&md_ctx, ctx->digest, NULL /* engine */ ) <= 0)
+ goto err;
if (is_sslv3) {
/* We repurpose |hmac_pad| to contain the SSLv3 pad2 block. */
memset(hmac_pad, 0x5c, sslv3_pad_length);
- EVP_DigestUpdate(&md_ctx, mac_secret, mac_secret_length);
- EVP_DigestUpdate(&md_ctx, hmac_pad, sslv3_pad_length);
- EVP_DigestUpdate(&md_ctx, mac_out, md_size);
+ if (EVP_DigestUpdate(&md_ctx, mac_secret, mac_secret_length) <= 0
+ || EVP_DigestUpdate(&md_ctx, hmac_pad, sslv3_pad_length) <= 0
+ || EVP_DigestUpdate(&md_ctx, mac_out, md_size) <= 0)
+ goto err;
} else {
/* Complete the HMAC in the standard manner. */
for (i = 0; i < md_block_size; i++)
hmac_pad[i] ^= 0x6a;
- EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size);
- EVP_DigestUpdate(&md_ctx, mac_out, md_size);
+ if (EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size) <= 0
+ || EVP_DigestUpdate(&md_ctx, mac_out, md_size) <= 0)
+ goto err;
}
EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u);
if (md_out_size)
*md_out_size = md_out_size_u;
EVP_MD_CTX_cleanup(&md_ctx);
+
+ return 1;
+err:
+ EVP_MD_CTX_cleanup(&md_ctx);
+ return 0;
}
#ifdef OPENSSL_FIPS
diff --git a/crypto/openssl/ssl/s3_clnt.c b/crypto/openssl/ssl/s3_clnt.c
index 6af145a..bc5254c 100644
--- a/crypto/openssl/ssl/s3_clnt.c
+++ b/crypto/openssl/ssl/s3_clnt.c
@@ -1050,6 +1050,11 @@ int ssl3_get_server_hello(SSL *s)
SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, SSL_R_UNKNOWN_CIPHER_RETURNED);
goto f_err;
}
+ /* Set version disabled mask now we know version */
+ if (!SSL_USE_TLS1_2_CIPHERS(s))
+ ct->mask_ssl = SSL_TLSV1_2;
+ else
+ ct->mask_ssl = 0;
/*
* If it is a disabled cipher we didn't send it in client hello, so
* return an error.
@@ -1699,6 +1704,12 @@ int ssl3_get_key_exchange(SSL *s)
}
p += i;
+ if (BN_is_zero(dh->p)) {
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_P_VALUE);
+ goto f_err;
+ }
+
+
if (2 > n - param_len) {
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -1719,6 +1730,11 @@ int ssl3_get_key_exchange(SSL *s)
}
p += i;
+ if (BN_is_zero(dh->g)) {
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE);
+ goto f_err;
+ }
+
if (2 > n - param_len) {
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT);
goto f_err;
@@ -1740,6 +1756,11 @@ int ssl3_get_key_exchange(SSL *s)
p += i;
n -= param_len;
+ if (BN_is_zero(dh->pub_key)) {
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_PUB_KEY_VALUE);
+ goto f_err;
+ }
+
# ifndef OPENSSL_NO_RSA
if (alg_a & SSL_aRSA)
pkey =
@@ -1935,14 +1956,20 @@ int ssl3_get_key_exchange(SSL *s)
q = md_buf;
for (num = 2; num > 0; num--) {
EVP_MD_CTX_set_flags(&md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
- EVP_DigestInit_ex(&md_ctx, (num == 2)
- ? s->ctx->md5 : s->ctx->sha1, NULL);
- EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&md_ctx, param, param_len);
- EVP_DigestFinal_ex(&md_ctx, q, &size);
+ if (EVP_DigestInit_ex(&md_ctx,
+ (num == 2) ? s->ctx->md5 : s->ctx->sha1,
+ NULL) <= 0
+ || EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestUpdate(&md_ctx, param, param_len) <= 0
+ || EVP_DigestFinal_ex(&md_ctx, q, &size) <= 0) {
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,
+ ERR_R_INTERNAL_ERROR);
+ al = SSL_AD_INTERNAL_ERROR;
+ goto f_err;
+ }
q += size;
j += size;
}
@@ -1961,12 +1988,16 @@ int ssl3_get_key_exchange(SSL *s)
} else
#endif
{
- EVP_VerifyInit_ex(&md_ctx, md, NULL);
- EVP_VerifyUpdate(&md_ctx, &(s->s3->client_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_VerifyUpdate(&md_ctx, &(s->s3->server_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_VerifyUpdate(&md_ctx, param, param_len);
+ if (EVP_VerifyInit_ex(&md_ctx, md, NULL) <= 0
+ || EVP_VerifyUpdate(&md_ctx, &(s->s3->client_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_VerifyUpdate(&md_ctx, &(s->s3->server_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_VerifyUpdate(&md_ctx, param, param_len) <= 0) {
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_EVP_LIB);
+ goto f_err;
+ }
if (EVP_VerifyFinal(&md_ctx, p, (int)n, pkey) <= 0) {
/* bad signature */
al = SSL_AD_DECRYPT_ERROR;
@@ -2208,6 +2239,7 @@ int ssl3_get_new_session_ticket(SSL *s)
long n;
const unsigned char *p;
unsigned char *d;
+ unsigned long ticket_lifetime_hint;
n = s->method->ssl_get_message(s,
SSL3_ST_CR_SESSION_TICKET_A,
@@ -2226,6 +2258,19 @@ int ssl3_get_new_session_ticket(SSL *s)
p = d = (unsigned char *)s->init_msg;
+ n2l(p, ticket_lifetime_hint);
+ n2s(p, ticklen);
+ /* ticket_lifetime_hint + ticket_length + ticket */
+ if (ticklen + 6 != n) {
+ al = SSL_AD_DECODE_ERROR;
+ SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH);
+ goto f_err;
+ }
+
+ /* Server is allowed to change its mind and send an empty ticket. */
+ if (ticklen == 0)
+ return 1;
+
if (s->session->session_id_length > 0) {
int i = s->session_ctx->session_cache_mode;
SSL_SESSION *new_sess;
@@ -2257,14 +2302,6 @@ int ssl3_get_new_session_ticket(SSL *s)
s->session = new_sess;
}
- n2l(p, s->session->tlsext_tick_lifetime_hint);
- n2s(p, ticklen);
- /* ticket_lifetime_hint + ticket_length + ticket */
- if (ticklen + 6 != n) {
- al = SSL_AD_DECODE_ERROR;
- SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH);
- goto f_err;
- }
if (s->session->tlsext_tick) {
OPENSSL_free(s->session->tlsext_tick);
s->session->tlsext_ticklen = 0;
@@ -2275,6 +2312,7 @@ int ssl3_get_new_session_ticket(SSL *s)
goto err;
}
memcpy(s->session->tlsext_tick, p, ticklen);
+ s->session->tlsext_tick_lifetime_hint = ticket_lifetime_hint;
s->session->tlsext_ticklen = ticklen;
/*
* There are two ways to detect a resumed ticket session. One is to set
@@ -2462,6 +2500,7 @@ int ssl3_send_client_key_exchange(SSL *s)
|| (pkey->pkey.rsa == NULL)) {
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
ERR_R_INTERNAL_ERROR);
+ EVP_PKEY_free(pkey);
goto err;
}
rsa = pkey->pkey.rsa;
@@ -2927,6 +2966,11 @@ int ssl3_send_client_key_exchange(SSL *s)
pkey_ctx = EVP_PKEY_CTX_new(pub_key =
X509_get_pubkey(peer_cert), NULL);
+ if (pkey_ctx == NULL) {
+ SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
+ ERR_R_MALLOC_FAILURE);
+ goto err;
+ }
/*
* If we have send a certificate, and certificate key
*
@@ -2936,10 +2980,13 @@ int ssl3_send_client_key_exchange(SSL *s)
/* Otherwise, generate ephemeral key pair */
- EVP_PKEY_encrypt_init(pkey_ctx);
- /* Generate session key */
- if (RAND_bytes(premaster_secret, 32) <= 0) {
+ if (pkey_ctx == NULL
+ || EVP_PKEY_encrypt_init(pkey_ctx) <= 0
+ /* Generate session key */
+ || RAND_bytes(premaster_secret, 32) <= 0) {
EVP_PKEY_CTX_free(pkey_ctx);
+ SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
+ ERR_R_INTERNAL_ERROR);
goto err;
}
/*
@@ -2960,13 +3007,18 @@ int ssl3_send_client_key_exchange(SSL *s)
* data
*/
ukm_hash = EVP_MD_CTX_create();
- EVP_DigestInit(ukm_hash,
- EVP_get_digestbynid(NID_id_GostR3411_94));
- EVP_DigestUpdate(ukm_hash, s->s3->client_random,
- SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(ukm_hash, s->s3->server_random,
- SSL3_RANDOM_SIZE);
- EVP_DigestFinal_ex(ukm_hash, shared_ukm, &md_len);
+ if (EVP_DigestInit(ukm_hash,
+ EVP_get_digestbynid(NID_id_GostR3411_94)) <= 0
+ || EVP_DigestUpdate(ukm_hash, s->s3->client_random,
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestUpdate(ukm_hash, s->s3->server_random,
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestFinal_ex(ukm_hash, shared_ukm, &md_len) <= 0) {
+ EVP_MD_CTX_destroy(ukm_hash);
+ SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
+ ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
EVP_MD_CTX_destroy(ukm_hash);
if (EVP_PKEY_CTX_ctrl
(pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT, EVP_PKEY_CTRL_SET_IV, 8,
@@ -2982,7 +3034,7 @@ int ssl3_send_client_key_exchange(SSL *s)
*(p++) = V_ASN1_SEQUENCE | V_ASN1_CONSTRUCTED;
msglen = 255;
if (EVP_PKEY_encrypt(pkey_ctx, tmp, &msglen, premaster_secret, 32)
- < 0) {
+ <= 0) {
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
SSL_R_LIBRARY_BUG);
goto err;
@@ -3177,7 +3229,10 @@ int ssl3_send_client_verify(SSL *s)
pkey = s->cert->key->privatekey;
/* Create context from key and test if sha1 is allowed as digest */
pctx = EVP_PKEY_CTX_new(pkey, NULL);
- EVP_PKEY_sign_init(pctx);
+ if (pctx == NULL || EVP_PKEY_sign_init(pctx) <= 0) {
+ SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto err;
+ }
if (EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha1()) > 0) {
if (!SSL_USE_SIGALGS(s))
s->method->ssl3_enc->cert_verify_mac(s,
@@ -3365,7 +3420,6 @@ int ssl3_send_client_certificate(SSL *s)
* If we get an error, we need to ssl->rwstate=SSL_X509_LOOKUP;
* return(-1); We then get retied later
*/
- i = 0;
i = ssl_do_client_cert_cb(s, &x509, &pkey);
if (i < 0) {
s->rwstate = SSL_X509_LOOKUP;
diff --git a/crypto/openssl/ssl/s3_enc.c b/crypto/openssl/ssl/s3_enc.c
index cda2d8c..47a0ec9 100644
--- a/crypto/openssl/ssl/s3_enc.c
+++ b/crypto/openssl/ssl/s3_enc.c
@@ -253,7 +253,10 @@ int ssl3_change_cipher_state(SSL *s, int which)
EVP_CIPHER_CTX_init(s->enc_read_ctx);
dd = s->enc_read_ctx;
- ssl_replace_hash(&s->read_hash, m);
+ if (ssl_replace_hash(&s->read_hash, m) == NULL) {
+ SSLerr(SSL_F_SSL3_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR);
+ goto err2;
+ }
#ifndef OPENSSL_NO_COMP
/* COMPRESS */
if (s->expand != NULL) {
@@ -288,7 +291,10 @@ int ssl3_change_cipher_state(SSL *s, int which)
*/
EVP_CIPHER_CTX_init(s->enc_write_ctx);
dd = s->enc_write_ctx;
- ssl_replace_hash(&s->write_hash, m);
+ if (ssl_replace_hash(&s->write_hash, m) == NULL) {
+ SSLerr(SSL_F_SSL3_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR);
+ goto err2;
+ }
#ifndef OPENSSL_NO_COMP
/* COMPRESS */
if (s->compress != NULL) {
@@ -691,19 +697,21 @@ static int ssl3_handshake_mac(SSL *s, int md_nid,
return 0;
npad = (48 / n) * n;
- if (sender != NULL)
- EVP_DigestUpdate(&ctx, sender, len);
- EVP_DigestUpdate(&ctx, s->session->master_key,
- s->session->master_key_length);
- EVP_DigestUpdate(&ctx, ssl3_pad_1, npad);
- EVP_DigestFinal_ex(&ctx, md_buf, &i);
-
- EVP_DigestInit_ex(&ctx, EVP_MD_CTX_md(&ctx), NULL);
- EVP_DigestUpdate(&ctx, s->session->master_key,
- s->session->master_key_length);
- EVP_DigestUpdate(&ctx, ssl3_pad_2, npad);
- EVP_DigestUpdate(&ctx, md_buf, i);
- EVP_DigestFinal_ex(&ctx, p, &ret);
+ if ((sender != NULL && EVP_DigestUpdate(&ctx, sender, len) <= 0)
+ || EVP_DigestUpdate(&ctx, s->session->master_key,
+ s->session->master_key_length) <= 0
+ || EVP_DigestUpdate(&ctx, ssl3_pad_1, npad) <= 0
+ || EVP_DigestFinal_ex(&ctx, md_buf, &i) <= 0
+
+ || EVP_DigestInit_ex(&ctx, EVP_MD_CTX_md(&ctx), NULL) <= 0
+ || EVP_DigestUpdate(&ctx, s->session->master_key,
+ s->session->master_key_length) <= 0
+ || EVP_DigestUpdate(&ctx, ssl3_pad_2, npad) <= 0
+ || EVP_DigestUpdate(&ctx, md_buf, i) <= 0
+ || EVP_DigestFinal_ex(&ctx, p, &ret) <= 0) {
+ SSLerr(SSL_F_SSL3_HANDSHAKE_MAC, ERR_R_INTERNAL_ERROR);
+ ret = 0;
+ }
EVP_MD_CTX_cleanup(&ctx);
@@ -775,33 +783,36 @@ int n_ssl3_mac(SSL *ssl, unsigned char *md, int send)
header[j++] = rec->length & 0xff;
/* Final param == is SSLv3 */
- ssl3_cbc_digest_record(hash,
- md, &md_size,
- header, rec->input,
- rec->length + md_size, orig_len,
- mac_sec, md_size, 1);
+ if (ssl3_cbc_digest_record(hash,
+ md, &md_size,
+ header, rec->input,
+ rec->length + md_size, orig_len,
+ mac_sec, md_size, 1) <= 0)
+ return -1;
} else {
unsigned int md_size_u;
/* Chop the digest off the end :-) */
EVP_MD_CTX_init(&md_ctx);
- EVP_MD_CTX_copy_ex(&md_ctx, hash);
- EVP_DigestUpdate(&md_ctx, mac_sec, md_size);
- EVP_DigestUpdate(&md_ctx, ssl3_pad_1, npad);
- EVP_DigestUpdate(&md_ctx, seq, 8);
rec_char = rec->type;
- EVP_DigestUpdate(&md_ctx, &rec_char, 1);
p = md;
s2n(rec->length, p);
- EVP_DigestUpdate(&md_ctx, md, 2);
- EVP_DigestUpdate(&md_ctx, rec->input, rec->length);
- EVP_DigestFinal_ex(&md_ctx, md, NULL);
-
- EVP_MD_CTX_copy_ex(&md_ctx, hash);
- EVP_DigestUpdate(&md_ctx, mac_sec, md_size);
- EVP_DigestUpdate(&md_ctx, ssl3_pad_2, npad);
- EVP_DigestUpdate(&md_ctx, md, md_size);
- EVP_DigestFinal_ex(&md_ctx, md, &md_size_u);
+ if (EVP_MD_CTX_copy_ex(&md_ctx, hash) <= 0
+ || EVP_DigestUpdate(&md_ctx, mac_sec, md_size) <= 0
+ || EVP_DigestUpdate(&md_ctx, ssl3_pad_1, npad) <= 0
+ || EVP_DigestUpdate(&md_ctx, seq, 8) <= 0
+ || EVP_DigestUpdate(&md_ctx, &rec_char, 1) <= 0
+ || EVP_DigestUpdate(&md_ctx, md, 2) <= 0
+ || EVP_DigestUpdate(&md_ctx, rec->input, rec->length) <= 0
+ || EVP_DigestFinal_ex(&md_ctx, md, NULL) <= 0
+ || EVP_MD_CTX_copy_ex(&md_ctx, hash) <= 0
+ || EVP_DigestUpdate(&md_ctx, mac_sec, md_size) <= 0
+ || EVP_DigestUpdate(&md_ctx, ssl3_pad_2, npad) <= 0
+ || EVP_DigestUpdate(&md_ctx, md, md_size) <= 0
+ || EVP_DigestFinal_ex(&md_ctx, md, &md_size_u) <= 0) {
+ EVP_MD_CTX_cleanup(&md_ctx);
+ return -1;
+ }
md_size = md_size_u;
EVP_MD_CTX_cleanup(&md_ctx);
@@ -846,24 +857,31 @@ int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
EVP_MD_CTX_init(&ctx);
for (i = 0; i < 3; i++) {
- EVP_DigestInit_ex(&ctx, s->ctx->sha1, NULL);
- EVP_DigestUpdate(&ctx, salt[i], strlen((const char *)salt[i]));
- EVP_DigestUpdate(&ctx, p, len);
- EVP_DigestUpdate(&ctx, &(s->s3->client_random[0]), SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&ctx, &(s->s3->server_random[0]), SSL3_RANDOM_SIZE);
- EVP_DigestFinal_ex(&ctx, buf, &n);
-
- EVP_DigestInit_ex(&ctx, s->ctx->md5, NULL);
- EVP_DigestUpdate(&ctx, p, len);
- EVP_DigestUpdate(&ctx, buf, n);
- EVP_DigestFinal_ex(&ctx, out, &n);
+ if (EVP_DigestInit_ex(&ctx, s->ctx->sha1, NULL) <= 0
+ || EVP_DigestUpdate(&ctx, salt[i],
+ strlen((const char *)salt[i])) <= 0
+ || EVP_DigestUpdate(&ctx, p, len) <= 0
+ || EVP_DigestUpdate(&ctx, &(s->s3->client_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestUpdate(&ctx, &(s->s3->server_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestFinal_ex(&ctx, buf, &n) <= 0
+
+ || EVP_DigestInit_ex(&ctx, s->ctx->md5, NULL) <= 0
+ || EVP_DigestUpdate(&ctx, p, len) <= 0
+ || EVP_DigestUpdate(&ctx, buf, n) <= 0
+ || EVP_DigestFinal_ex(&ctx, out, &n) <= 0) {
+ SSLerr(SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_INTERNAL_ERROR);
+ ret = 0;
+ break;
+ }
out += n;
ret += n;
}
EVP_MD_CTX_cleanup(&ctx);
#ifdef OPENSSL_SSL_TRACE_CRYPTO
- if (s->msg_callback) {
+ if (ret > 0 && s->msg_callback) {
s->msg_callback(2, s->version, TLS1_RT_CRYPTO_PREMASTER,
p, len, s, s->msg_callback_arg);
s->msg_callback(2, s->version, TLS1_RT_CRYPTO_CLIENT_RANDOM,
diff --git a/crypto/openssl/ssl/s3_lib.c b/crypto/openssl/ssl/s3_lib.c
index ad9eeb6..64793d6 100644
--- a/crypto/openssl/ssl/s3_lib.c
+++ b/crypto/openssl/ssl/s3_lib.c
@@ -2983,7 +2983,7 @@ int ssl3_new(SSL *s)
void ssl3_free(SSL *s)
{
- if (s == NULL)
+ if (s == NULL || s->s3 == NULL)
return;
#ifdef TLSEXT_TYPE_opaque_prf_input
diff --git a/crypto/openssl/ssl/s3_pkt.c b/crypto/openssl/ssl/s3_pkt.c
index 603c285..3798902 100644
--- a/crypto/openssl/ssl/s3_pkt.c
+++ b/crypto/openssl/ssl/s3_pkt.c
@@ -1115,7 +1115,7 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
s->rwstate = SSL_NOTHING;
return (s->s3->wpend_ret);
} else if (i <= 0) {
- if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) {
+ if (SSL_IS_DTLS(s)) {
/*
* For DTLS, just drop it. That's kind of the whole point in
* using a datagram service
diff --git a/crypto/openssl/ssl/s3_srvr.c b/crypto/openssl/ssl/s3_srvr.c
index acd3b9e..ee83105 100644
--- a/crypto/openssl/ssl/s3_srvr.c
+++ b/crypto/openssl/ssl/s3_srvr.c
@@ -383,7 +383,6 @@ int ssl3_accept(SSL *s)
*/
if (al != TLS1_AD_UNKNOWN_PSK_IDENTITY)
SSLerr(SSL_F_SSL3_ACCEPT, SSL_R_CLIENTHELLO_TLSEXT);
- ret = SSL_TLSEXT_ERR_ALERT_FATAL;
ret = -1;
s->state = SSL_ST_ERR;
goto end;
@@ -902,7 +901,7 @@ int ssl3_send_hello_request(SSL *s)
int ssl3_get_client_hello(SSL *s)
{
- int i, j, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1;
+ int i, j, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1, cookie_valid = 0;
unsigned int cookie_len;
long n;
unsigned long id;
@@ -1095,8 +1094,7 @@ int ssl3_get_client_hello(SSL *s)
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_COOKIE_MISMATCH);
goto f_err;
}
- /* Set to -2 so if successful we return 2 */
- ret = -2;
+ cookie_valid = 1;
}
p += cookie_len;
@@ -1231,7 +1229,7 @@ int ssl3_get_client_hello(SSL *s)
#ifndef OPENSSL_NO_TLSEXT
/* TLS extensions */
if (s->version >= SSL3_VERSION) {
- if (!ssl_parse_clienthello_tlsext(s, &p, d, n)) {
+ if (!ssl_parse_clienthello_tlsext(s, &p, d + n)) {
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_PARSE_TLSEXT);
goto err;
}
@@ -1466,8 +1464,7 @@ int ssl3_get_client_hello(SSL *s)
}
}
- if (ret < 0)
- ret = -ret;
+ ret = cookie_valid ? 2 : 1;
if (0) {
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
@@ -1477,7 +1474,7 @@ int ssl3_get_client_hello(SSL *s)
if (ciphers != NULL)
sk_SSL_CIPHER_free(ciphers);
- return ret < 0 ? -1 : ret;
+ return ret;
}
int ssl3_send_server_hello(SSL *s)
@@ -1950,14 +1947,22 @@ int ssl3_send_server_key_exchange(SSL *s)
for (num = 2; num > 0; num--) {
EVP_MD_CTX_set_flags(&md_ctx,
EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
- EVP_DigestInit_ex(&md_ctx, (num == 2)
- ? s->ctx->md5 : s->ctx->sha1, NULL);
- EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&md_ctx, d, n);
- EVP_DigestFinal_ex(&md_ctx, q, (unsigned int *)&i);
+ if (EVP_DigestInit_ex(&md_ctx,
+ (num == 2) ? s->ctx->md5
+ : s->ctx->sha1,
+ NULL) <= 0
+ || EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_DigestUpdate(&md_ctx, d, n) <= 0
+ || EVP_DigestFinal_ex(&md_ctx, q,
+ (unsigned int *)&i) <= 0) {
+ SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,
+ ERR_LIB_EVP);
+ al = SSL_AD_INTERNAL_ERROR;
+ goto f_err;
+ }
q += i;
j += i;
}
@@ -1985,16 +1990,17 @@ int ssl3_send_server_key_exchange(SSL *s)
#ifdef SSL_DEBUG
fprintf(stderr, "Using hash %s\n", EVP_MD_name(md));
#endif
- EVP_SignInit_ex(&md_ctx, md, NULL);
- EVP_SignUpdate(&md_ctx, &(s->s3->client_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_SignUpdate(&md_ctx, &(s->s3->server_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_SignUpdate(&md_ctx, d, n);
- if (!EVP_SignFinal(&md_ctx, &(p[2]),
- (unsigned int *)&i, pkey)) {
+ if (EVP_SignInit_ex(&md_ctx, md, NULL) <= 0
+ || EVP_SignUpdate(&md_ctx, &(s->s3->client_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_SignUpdate(&md_ctx, &(s->s3->server_random[0]),
+ SSL3_RANDOM_SIZE) <= 0
+ || EVP_SignUpdate(&md_ctx, d, n) <= 0
+ || EVP_SignFinal(&md_ctx, &(p[2]),
+ (unsigned int *)&i, pkey) <= 0) {
SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_LIB_EVP);
- goto err;
+ al = SSL_AD_INTERNAL_ERROR;
+ goto f_err;
}
s2n(i, p);
n += i + 2;
@@ -2867,7 +2873,15 @@ int ssl3_get_client_key_exchange(SSL *s)
pk = s->cert->pkeys[SSL_PKEY_GOST01].privatekey;
pkey_ctx = EVP_PKEY_CTX_new(pk, NULL);
- EVP_PKEY_decrypt_init(pkey_ctx);
+ if (pkey_ctx == NULL) {
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE);
+ goto f_err;
+ }
+ if (EVP_PKEY_decrypt_init(pkey_ctx) <= 0) {
+ SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR);
+ goto gerr;
+ }
/*
* If client certificate is present and is of the same type, maybe
* use it for key exchange. Don't mind errors from
@@ -3099,7 +3113,17 @@ int ssl3_get_cert_verify(SSL *s)
unsigned char signature[64];
int idx;
EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL);
- EVP_PKEY_verify_init(pctx);
+ if (pctx == NULL) {
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_MALLOC_FAILURE);
+ goto f_err;
+ }
+ if (EVP_PKEY_verify_init(pctx) <= 0) {
+ EVP_PKEY_CTX_free(pctx);
+ al = SSL_AD_INTERNAL_ERROR;
+ SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR);
+ goto f_err;
+ }
if (i != 64) {
fprintf(stderr, "GOST signature length is %d", i);
}
diff --git a/crypto/openssl/ssl/ssl.h b/crypto/openssl/ssl/ssl.h
index 6fe1a24..afec1f5 100644
--- a/crypto/openssl/ssl/ssl.h
+++ b/crypto/openssl/ssl/ssl.h
@@ -2681,6 +2681,7 @@ void ERR_load_SSL_strings(void);
# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292
# define SSL_F_SSL3_ENC 134
# define SSL_F_SSL3_GENERATE_KEY_BLOCK 238
+# define SSL_F_SSL3_GENERATE_MASTER_SECRET 388
# define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135
# define SSL_F_SSL3_GET_CERT_STATUS 289
# define SSL_F_SSL3_GET_CERT_VERIFY 136
@@ -2846,8 +2847,11 @@ void ERR_load_SSL_strings(void);
# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106
# define SSL_R_BAD_DECOMPRESSION 107
# define SSL_R_BAD_DH_G_LENGTH 108
+# define SSL_R_BAD_DH_G_VALUE 375
# define SSL_R_BAD_DH_PUB_KEY_LENGTH 109
+# define SSL_R_BAD_DH_PUB_KEY_VALUE 393
# define SSL_R_BAD_DH_P_LENGTH 110
+# define SSL_R_BAD_DH_P_VALUE 395
# define SSL_R_BAD_DIGEST_LENGTH 111
# define SSL_R_BAD_DSA_SIGNATURE 112
# define SSL_R_BAD_ECC_CERT 304
diff --git a/crypto/openssl/ssl/ssl_asn1.c b/crypto/openssl/ssl/ssl_asn1.c
index 39d48ea..35cc27c 100644
--- a/crypto/openssl/ssl/ssl_asn1.c
+++ b/crypto/openssl/ssl/ssl_asn1.c
@@ -121,13 +121,16 @@ typedef struct ssl_session_asn1_st {
int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
{
#define LSIZE2 (sizeof(long)*2)
- int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0, v7 = 0, v8 = 0;
+ int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0;
unsigned char buf[4], ibuf1[LSIZE2], ibuf2[LSIZE2];
unsigned char ibuf3[LSIZE2], ibuf4[LSIZE2], ibuf5[LSIZE2];
#ifndef OPENSSL_NO_TLSEXT
int v6 = 0, v9 = 0, v10 = 0;
unsigned char ibuf6[LSIZE2];
#endif
+#ifndef OPENSSL_NO_PSK
+ int v7 = 0, v8 = 0;
+#endif
#ifndef OPENSSL_NO_COMP
unsigned char cbuf;
int v11 = 0;
diff --git a/crypto/openssl/ssl/ssl_cert.c b/crypto/openssl/ssl/ssl_cert.c
index 93a1eb9..a73f866 100644
--- a/crypto/openssl/ssl/ssl_cert.c
+++ b/crypto/openssl/ssl/ssl_cert.c
@@ -227,6 +227,7 @@ CERT *ssl_cert_dup(CERT *cert)
memset(ret, 0, sizeof(CERT));
+ ret->references = 1;
ret->key = &ret->pkeys[cert->key - &cert->pkeys[0]];
/*
* or ret->key = ret->pkeys + (cert->key - cert->pkeys), if you find that
@@ -325,7 +326,6 @@ CERT *ssl_cert_dup(CERT *cert)
#endif
}
- ret->references = 1;
/*
* Set digests to defaults. NB: we don't copy existing values as they
* will be set during handshake.
diff --git a/crypto/openssl/ssl/ssl_ciph.c b/crypto/openssl/ssl/ssl_ciph.c
index 2cc9a4a..6957bda 100644
--- a/crypto/openssl/ssl/ssl_ciph.c
+++ b/crypto/openssl/ssl/ssl_ciph.c
@@ -376,10 +376,11 @@ static int get_optional_pkey_id(const char *pkey_name)
const EVP_PKEY_ASN1_METHOD *ameth;
int pkey_id = 0;
ameth = EVP_PKEY_asn1_find_str(NULL, pkey_name, -1);
- if (ameth) {
- EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
+ if (ameth && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL,
+ ameth) > 0) {
+ return pkey_id;
}
- return pkey_id;
+ return 0;
}
#else
@@ -391,7 +392,9 @@ static int get_optional_pkey_id(const char *pkey_name)
int pkey_id = 0;
ameth = EVP_PKEY_asn1_find_str(&tmpeng, pkey_name, -1);
if (ameth) {
- EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth);
+ if (EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL,
+ ameth) <= 0)
+ pkey_id = 0;
}
if (tmpeng)
ENGINE_finish(tmpeng);
@@ -1404,15 +1407,16 @@ static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
const char **prule_str)
{
unsigned int suiteb_flags = 0, suiteb_comb2 = 0;
- if (!strcmp(*prule_str, "SUITEB128"))
- suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
- else if (!strcmp(*prule_str, "SUITEB128ONLY"))
+ if (strncmp(*prule_str, "SUITEB128ONLY", 13) == 0) {
suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS_ONLY;
- else if (!strcmp(*prule_str, "SUITEB128C2")) {
+ } else if (strncmp(*prule_str, "SUITEB128C2", 11) == 0) {
suiteb_comb2 = 1;
suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
- } else if (!strcmp(*prule_str, "SUITEB192"))
+ } else if (strncmp(*prule_str, "SUITEB128", 9) == 0) {
+ suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS;
+ } else if (strncmp(*prule_str, "SUITEB192", 9) == 0) {
suiteb_flags = SSL_CERT_FLAG_SUITEB_192_LOS;
+ }
if (suiteb_flags) {
c->cert_flags &= ~SSL_CERT_FLAG_SUITEB_128_LOS;
diff --git a/crypto/openssl/ssl/ssl_err.c b/crypto/openssl/ssl/ssl_err.c
index 1a6030e..6d1366f 100644
--- a/crypto/openssl/ssl/ssl_err.c
+++ b/crypto/openssl/ssl/ssl_err.c
@@ -163,6 +163,8 @@ static ERR_STRING_DATA SSL_str_functs[] = {
"ssl3_do_change_cipher_spec"},
{ERR_FUNC(SSL_F_SSL3_ENC), "ssl3_enc"},
{ERR_FUNC(SSL_F_SSL3_GENERATE_KEY_BLOCK), "SSL3_GENERATE_KEY_BLOCK"},
+ {ERR_FUNC(SSL_F_SSL3_GENERATE_MASTER_SECRET),
+ "ssl3_generate_master_secret"},
{ERR_FUNC(SSL_F_SSL3_GET_CERTIFICATE_REQUEST),
"ssl3_get_certificate_request"},
{ERR_FUNC(SSL_F_SSL3_GET_CERT_STATUS), "ssl3_get_cert_status"},
@@ -386,8 +388,11 @@ static ERR_STRING_DATA SSL_str_reasons[] = {
"bad data returned by callback"},
{ERR_REASON(SSL_R_BAD_DECOMPRESSION), "bad decompression"},
{ERR_REASON(SSL_R_BAD_DH_G_LENGTH), "bad dh g length"},
+ {ERR_REASON(SSL_R_BAD_DH_G_VALUE), "bad dh g value"},
{ERR_REASON(SSL_R_BAD_DH_PUB_KEY_LENGTH), "bad dh pub key length"},
+ {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_VALUE), "bad dh pub key value"},
{ERR_REASON(SSL_R_BAD_DH_P_LENGTH), "bad dh p length"},
+ {ERR_REASON(SSL_R_BAD_DH_P_VALUE), "bad dh p value"},
{ERR_REASON(SSL_R_BAD_DIGEST_LENGTH), "bad digest length"},
{ERR_REASON(SSL_R_BAD_DSA_SIGNATURE), "bad dsa signature"},
{ERR_REASON(SSL_R_BAD_ECC_CERT), "bad ecc cert"},
diff --git a/crypto/openssl/ssl/ssl_lib.c b/crypto/openssl/ssl/ssl_lib.c
index c0931e7..f2071db 100644
--- a/crypto/openssl/ssl/ssl_lib.c
+++ b/crypto/openssl/ssl/ssl_lib.c
@@ -307,6 +307,7 @@ SSL *SSL_new(SSL_CTX *ctx)
s->options = ctx->options;
s->mode = ctx->mode;
s->max_cert_list = ctx->max_cert_list;
+ s->references = 1;
if (ctx->cert != NULL) {
/*
@@ -405,7 +406,6 @@ SSL *SSL_new(SSL_CTX *ctx)
if (!s->method->ssl_new(s))
goto err;
- s->references = 1;
s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1;
SSL_clear(s);
@@ -1980,7 +1980,7 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth)
ret->extra_certs = NULL;
/* No compression for DTLS */
- if (meth->version != DTLS1_VERSION)
+ if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS))
ret->comp_methods = SSL_COMP_get_compression_methods();
ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH;
@@ -3507,8 +3507,11 @@ EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md)
{
ssl_clear_hash_ctx(hash);
*hash = EVP_MD_CTX_create();
- if (md)
- EVP_DigestInit_ex(*hash, md, NULL);
+ if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) {
+ EVP_MD_CTX_destroy(*hash);
+ *hash = NULL;
+ return NULL;
+ }
return *hash;
}
diff --git a/crypto/openssl/ssl/ssl_locl.h b/crypto/openssl/ssl/ssl_locl.h
index 6c2c551..a8e4efc 100644
--- a/crypto/openssl/ssl/ssl_locl.h
+++ b/crypto/openssl/ssl/ssl_locl.h
@@ -1366,7 +1366,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf,
unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
unsigned char *limit, int *al);
int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **data,
- unsigned char *d, int n);
+ unsigned char *limit);
int tls1_set_server_sigalgs(SSL *s);
int ssl_check_clienthello_tlsext_late(SSL *s);
int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **data,
@@ -1439,15 +1439,15 @@ int tls1_cbc_remove_padding(const SSL *s,
SSL3_RECORD *rec,
unsigned block_size, unsigned mac_size);
char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx);
-void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
- unsigned char *md_out,
- size_t *md_out_size,
- const unsigned char header[13],
- const unsigned char *data,
- size_t data_plus_mac_size,
- size_t data_plus_mac_plus_padding_size,
- const unsigned char *mac_secret,
- unsigned mac_secret_length, char is_sslv3);
+int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx,
+ unsigned char *md_out,
+ size_t *md_out_size,
+ const unsigned char header[13],
+ const unsigned char *data,
+ size_t data_plus_mac_size,
+ size_t data_plus_mac_plus_padding_size,
+ const unsigned char *mac_secret,
+ unsigned mac_secret_length, char is_sslv3);
void tls_fips_digest_extra(const EVP_CIPHER_CTX *cipher_ctx,
EVP_MD_CTX *mac_ctx, const unsigned char *data,
diff --git a/crypto/openssl/ssl/ssl_rsa.c b/crypto/openssl/ssl/ssl_rsa.c
index b1b2318..b0f75c9 100644
--- a/crypto/openssl/ssl/ssl_rsa.c
+++ b/crypto/openssl/ssl/ssl_rsa.c
@@ -160,7 +160,10 @@ int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
}
RSA_up_ref(rsa);
- EVP_PKEY_assign_RSA(pkey, rsa);
+ if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) {
+ RSA_free(rsa);
+ return 0;
+ }
ret = ssl_set_pkey(ssl->cert, pkey);
EVP_PKEY_free(pkey);
@@ -195,6 +198,15 @@ static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
if (c->pkeys[i].x509 != NULL) {
EVP_PKEY *pktmp;
pktmp = X509_get_pubkey(c->pkeys[i].x509);
+ if (pktmp == NULL) {
+ SSLerr(SSL_F_SSL_SET_PKEY, ERR_R_MALLOC_FAILURE);
+ EVP_PKEY_free(pktmp);
+ return 0;
+ }
+ /*
+ * The return code from EVP_PKEY_copy_parameters is deliberately
+ * ignored. Some EVP_PKEY types cannot do this.
+ */
EVP_PKEY_copy_parameters(pktmp, pkey);
EVP_PKEY_free(pktmp);
ERR_clear_error();
@@ -396,6 +408,10 @@ static int ssl_set_cert(CERT *c, X509 *x)
}
if (c->pkeys[i].privatekey != NULL) {
+ /*
+ * The return code from EVP_PKEY_copy_parameters is deliberately
+ * ignored. Some EVP_PKEY types cannot do this.
+ */
EVP_PKEY_copy_parameters(pkey, c->pkeys[i].privatekey);
ERR_clear_error();
@@ -516,7 +532,10 @@ int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa)
}
RSA_up_ref(rsa);
- EVP_PKEY_assign_RSA(pkey, rsa);
+ if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) {
+ RSA_free(rsa);
+ return 0;
+ }
ret = ssl_set_pkey(ctx->cert, pkey);
EVP_PKEY_free(pkey);
@@ -750,31 +769,31 @@ static int serverinfo_find_extension(const unsigned char *serverinfo,
*extension_data = NULL;
*extension_length = 0;
if (serverinfo == NULL || serverinfo_length == 0)
- return 0;
+ return -1;
for (;;) {
unsigned int type = 0;
size_t len = 0;
/* end of serverinfo */
if (serverinfo_length == 0)
- return -1; /* Extension not found */
+ return 0; /* Extension not found */
/* read 2-byte type field */
if (serverinfo_length < 2)
- return 0; /* Error */
+ return -1; /* Error */
type = (serverinfo[0] << 8) + serverinfo[1];
serverinfo += 2;
serverinfo_length -= 2;
/* read 2-byte len field */
if (serverinfo_length < 2)
- return 0; /* Error */
+ return -1; /* Error */
len = (serverinfo[0] << 8) + serverinfo[1];
serverinfo += 2;
serverinfo_length -= 2;
if (len > serverinfo_length)
- return 0; /* Error */
+ return -1; /* Error */
if (type == extension_type) {
*extension_data = serverinfo;
@@ -814,10 +833,12 @@ static int serverinfo_srv_add_cb(SSL *s, unsigned int ext_type,
/* Find the relevant extension from the serverinfo */
int retval = serverinfo_find_extension(serverinfo, serverinfo_length,
ext_type, out, outlen);
+ if (retval == -1) {
+ *al = SSL_AD_DECODE_ERROR;
+ return -1; /* Error */
+ }
if (retval == 0)
- return 0; /* Error */
- if (retval == -1)
- return -1; /* No extension found, don't send extension */
+ return 0; /* No extension found, don't send extension */
return 1; /* Send extension */
}
return -1; /* No serverinfo data found, don't send
diff --git a/crypto/openssl/ssl/ssl_sess.c b/crypto/openssl/ssl/ssl_sess.c
index 07e7379..68390d3 100644
--- a/crypto/openssl/ssl/ssl_sess.c
+++ b/crypto/openssl/ssl/ssl_sess.c
@@ -256,8 +256,8 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket)
dest->tlsext_ecpointformatlist = NULL;
dest->tlsext_ellipticcurvelist = NULL;
# endif
-#endif
dest->tlsext_tick = NULL;
+#endif
#ifndef OPENSSL_NO_SRP
dest->srp_username = NULL;
#endif
@@ -324,7 +324,6 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket)
goto err;
}
# endif
-#endif
if (ticket != 0) {
dest->tlsext_tick = BUF_memdup(src->tlsext_tick, src->tlsext_ticklen);
@@ -334,6 +333,7 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket)
dest->tlsext_tick_lifetime_hint = 0;
dest->tlsext_ticklen = 0;
}
+#endif
#ifndef OPENSSL_NO_SRP
if (src->srp_username) {
diff --git a/crypto/openssl/ssl/ssltest.c b/crypto/openssl/ssl/ssltest.c
index 6737adf..aaf6c6b 100644
--- a/crypto/openssl/ssl/ssltest.c
+++ b/crypto/openssl/ssl/ssltest.c
@@ -142,6 +142,7 @@
/* Or gethostname won't be declared properly on Linux and GNU platforms. */
#define _BSD_SOURCE 1
+#define _DEFAULT_SOURCE 1
#include <assert.h>
#include <errno.h>
diff --git a/crypto/openssl/ssl/t1_enc.c b/crypto/openssl/ssl/t1_enc.c
index e2a8f86..f46544b 100644
--- a/crypto/openssl/ssl/t1_enc.c
+++ b/crypto/openssl/ssl/t1_enc.c
@@ -384,6 +384,8 @@ int tls1_change_cipher_state(SSL *s, int which)
EVP_CIPHER_CTX_init(s->enc_read_ctx);
dd = s->enc_read_ctx;
mac_ctx = ssl_replace_hash(&s->read_hash, NULL);
+ if (mac_ctx == NULL)
+ goto err;
#ifndef OPENSSL_NO_COMP
if (s->expand != NULL) {
COMP_CTX_free(s->expand);
@@ -422,11 +424,14 @@ int tls1_change_cipher_state(SSL *s, int which)
dd = s->enc_write_ctx;
if (SSL_IS_DTLS(s)) {
mac_ctx = EVP_MD_CTX_create();
- if (!mac_ctx)
+ if (mac_ctx == NULL)
goto err;
s->write_hash = mac_ctx;
- } else
+ } else {
mac_ctx = ssl_replace_hash(&s->write_hash, NULL);
+ if (mac_ctx == NULL)
+ goto err;
+ }
#ifndef OPENSSL_NO_COMP
if (s->compress != NULL) {
COMP_CTX_free(s->compress);
@@ -499,7 +504,12 @@ int tls1_change_cipher_state(SSL *s, int which)
if (!(EVP_CIPHER_flags(c) & EVP_CIPH_FLAG_AEAD_CIPHER)) {
mac_key = EVP_PKEY_new_mac_key(mac_type, NULL,
mac_secret, *mac_secret_size);
- EVP_DigestSignInit(mac_ctx, NULL, m, NULL, mac_key);
+ if (mac_key == NULL
+ || EVP_DigestSignInit(mac_ctx, NULL, m, NULL, mac_key) <= 0) {
+ EVP_PKEY_free(mac_key);
+ SSLerr(SSL_F_TLS1_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR);
+ goto err2;
+ }
EVP_PKEY_free(mac_key);
}
#ifdef TLS_DEBUG
@@ -931,8 +941,9 @@ int tls1_cert_verify_mac(SSL *s, int md_nid, unsigned char *out)
}
EVP_MD_CTX_init(&ctx);
- EVP_MD_CTX_copy_ex(&ctx, d);
- EVP_DigestFinal_ex(&ctx, out, &ret);
+ if (EVP_MD_CTX_copy_ex(&ctx, d) <=0
+ || EVP_DigestFinal_ex(&ctx, out, &ret) <= 0)
+ ret = 0;
EVP_MD_CTX_cleanup(&ctx);
return ((int)ret);
}
@@ -1059,17 +1070,24 @@ int tls1_mac(SSL *ssl, unsigned char *md, int send)
* are hashing because that gives an attacker a timing-oracle.
*/
/* Final param == not SSLv3 */
- ssl3_cbc_digest_record(mac_ctx,
- md, &md_size,
- header, rec->input,
- rec->length + md_size, orig_len,
- ssl->s3->read_mac_secret,
- ssl->s3->read_mac_secret_size, 0);
+ if (ssl3_cbc_digest_record(mac_ctx,
+ md, &md_size,
+ header, rec->input,
+ rec->length + md_size, orig_len,
+ ssl->s3->read_mac_secret,
+ ssl->s3->read_mac_secret_size, 0) <= 0) {
+ if (!stream_mac)
+ EVP_MD_CTX_cleanup(&hmac);
+ return -1;
+ }
} else {
- EVP_DigestSignUpdate(mac_ctx, header, sizeof(header));
- EVP_DigestSignUpdate(mac_ctx, rec->input, rec->length);
- t = EVP_DigestSignFinal(mac_ctx, md, &md_size);
- OPENSSL_assert(t > 0);
+ if (EVP_DigestSignUpdate(mac_ctx, header, sizeof(header)) <= 0
+ || EVP_DigestSignUpdate(mac_ctx, rec->input, rec->length) <= 0
+ || EVP_DigestSignFinal(mac_ctx, md, &md_size) <= 0) {
+ if (!stream_mac)
+ EVP_MD_CTX_cleanup(&hmac);
+ return -1;
+ }
#ifdef OPENSSL_FIPS
if (!send && FIPS_mode())
tls_fips_digest_extra(ssl->enc_read_ctx,
diff --git a/crypto/openssl/ssl/t1_lib.c b/crypto/openssl/ssl/t1_lib.c
index 210a5e8..3176d1e 100644
--- a/crypto/openssl/ssl/t1_lib.c
+++ b/crypto/openssl/ssl/t1_lib.c
@@ -497,7 +497,7 @@ static int tls1_get_curvelist(SSL *s, int sess,
} else
# endif
{
- if (!s->server || (s->cert && s->cert->ecdh_tmp_auto)) {
+ if (!s->server || s->cert->ecdh_tmp_auto) {
*pcurves = eccurves_auto;
pcurveslen = sizeof(eccurves_auto);
} else {
@@ -1837,7 +1837,7 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf,
* 10.8..10.8.3 (which don't work).
*/
static void ssl_check_for_safari(SSL *s, const unsigned char *data,
- const unsigned char *d, int n)
+ const unsigned char *limit)
{
unsigned short type, size;
static const unsigned char kSafariExtensionsBlock[] = {
@@ -1866,11 +1866,11 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
0x02, 0x03, /* SHA-1/ECDSA */
};
- if (data >= (d + n - 2))
+ if (data >= (limit - 2))
return;
data += 2;
- if (data > (d + n - 4))
+ if (data > (limit - 4))
return;
n2s(data, type);
n2s(data, size);
@@ -1878,7 +1878,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
if (type != TLSEXT_TYPE_server_name)
return;
- if (data + size > d + n)
+ if (data + size > limit)
return;
data += size;
@@ -1886,7 +1886,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
const size_t len1 = sizeof(kSafariExtensionsBlock);
const size_t len2 = sizeof(kSafariTLS12ExtensionsBlock);
- if (data + len1 + len2 != d + n)
+ if (data + len1 + len2 != limit)
return;
if (memcmp(data, kSafariExtensionsBlock, len1) != 0)
return;
@@ -1895,7 +1895,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data,
} else {
const size_t len = sizeof(kSafariExtensionsBlock);
- if (data + len != d + n)
+ if (data + len != limit)
return;
if (memcmp(data, kSafariExtensionsBlock, len) != 0)
return;
@@ -1974,7 +1974,7 @@ static int tls1_alpn_handle_client_hello(SSL *s, const unsigned char *data,
}
static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
- unsigned char *d, int n, int *al)
+ unsigned char *limit, int *al)
{
unsigned short type;
unsigned short size;
@@ -1999,7 +1999,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
# ifndef OPENSSL_NO_EC
if (s->options & SSL_OP_SAFARI_ECDHE_ECDSA_BUG)
- ssl_check_for_safari(s, data, d, n);
+ ssl_check_for_safari(s, data, limit);
# endif /* !OPENSSL_NO_EC */
/* Clear any signature algorithms extension received */
@@ -2016,22 +2016,22 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
s->srtp_profile = NULL;
- if (data == d + n)
+ if (data == limit)
goto ri_check;
- if (data > (d + n - 2))
+ if (data > (limit - 2))
goto err;
n2s(data, len);
- if (data > (d + n - len))
+ if (data + len != limit)
goto err;
- while (data <= (d + n - 4)) {
+ while (data <= (limit - 4)) {
n2s(data, type);
n2s(data, size);
- if (data + size > (d + n))
+ if (data + size > (limit))
goto err;
# if 0
fprintf(stderr, "Received extension type %d size %d\n", type, size);
@@ -2405,7 +2405,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p,
}
/* Spurious data on the end */
- if (data != d + n)
+ if (data != limit)
goto err;
*p = data;
@@ -2465,8 +2465,8 @@ static int ssl_scan_clienthello_custom_tlsext(SSL *s,
return 1;
}
-int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
- int n)
+int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p,
+ unsigned char *limit)
{
int al = -1;
unsigned char *ptmp = *p;
@@ -2476,7 +2476,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
* switch the parent context using SSL_set_SSL_CTX and custom extensions
* need to be handled by the new SSL_CTX structure.
*/
- if (ssl_scan_clienthello_tlsext(s, p, d, n, &al) <= 0) {
+ if (ssl_scan_clienthello_tlsext(s, p, limit, &al) <= 0) {
ssl3_send_alert(s, SSL3_AL_FATAL, al);
return 0;
}
@@ -2487,7 +2487,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
}
custom_ext_init(&s->cert->srv_ext);
- if (ssl_scan_clienthello_custom_tlsext(s, ptmp, d + n, &al) <= 0) {
+ if (ssl_scan_clienthello_custom_tlsext(s, ptmp, limit, &al) <= 0) {
ssl3_send_alert(s, SSL3_AL_FATAL, al);
return 0;
}
@@ -3385,10 +3385,13 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
/* Check key name matches */
if (memcmp(etick, tctx->tlsext_tick_key_name, 16))
return 2;
- HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16,
- tlsext_tick_md(), NULL);
- EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
- tctx->tlsext_tick_aes_key, etick + 16);
+ if (HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16,
+ tlsext_tick_md(), NULL) <= 0
+ || EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL,
+ tctx->tlsext_tick_aes_key,
+ etick + 16) <= 0) {
+ goto err;
+ }
}
/*
* Attempt to process session ticket, first conduct sanity and integrity
@@ -3396,13 +3399,14 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
*/
mlen = HMAC_size(&hctx);
if (mlen < 0) {
- EVP_CIPHER_CTX_cleanup(&ctx);
- return -1;
+ goto err;
}
eticklen -= mlen;
/* Check HMAC of encrypted ticket */
- HMAC_Update(&hctx, etick, eticklen);
- HMAC_Final(&hctx, tick_hmac, NULL);
+ if (HMAC_Update(&hctx, etick, eticklen) <= 0
+ || HMAC_Final(&hctx, tick_hmac, NULL) <= 0) {
+ goto err;
+ }
HMAC_CTX_cleanup(&hctx);
if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen)) {
EVP_CIPHER_CTX_cleanup(&ctx);
@@ -3413,11 +3417,10 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx);
eticklen -= 16 + EVP_CIPHER_CTX_iv_length(&ctx);
sdec = OPENSSL_malloc(eticklen);
- if (!sdec) {
+ if (!sdec || EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen) <= 0) {
EVP_CIPHER_CTX_cleanup(&ctx);
return -1;
}
- EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen);
if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) {
EVP_CIPHER_CTX_cleanup(&ctx);
OPENSSL_free(sdec);
@@ -3450,6 +3453,10 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
* For session parse failure, indicate that we need to send a new ticket.
*/
return 2;
+err:
+ EVP_CIPHER_CTX_cleanup(&ctx);
+ HMAC_CTX_cleanup(&hctx);
+ return -1;
}
/* Tables to translate from NIDs to TLS v1.2 ids */
diff --git a/crypto/openssl/ssl/tls1.h b/crypto/openssl/ssl/tls1.h
index 5929607..7e237d0 100644
--- a/crypto/openssl/ssl/tls1.h
+++ b/crypto/openssl/ssl/tls1.h
@@ -231,13 +231,12 @@ extern "C" {
/* ExtensionType value from RFC5620 */
# define TLSEXT_TYPE_heartbeat 15
-/* ExtensionType value from draft-ietf-tls-applayerprotoneg-00 */
+/* ExtensionType value from RFC7301 */
# define TLSEXT_TYPE_application_layer_protocol_negotiation 16
/*
* ExtensionType value for TLS padding extension.
- * http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
- * http://tools.ietf.org/html/draft-agl-tls-padding-03
+ * http://tools.ietf.org/html/draft-agl-tls-padding
*/
# define TLSEXT_TYPE_padding 21
@@ -262,20 +261,19 @@ extern "C" {
# define TLSEXT_TYPE_next_proto_neg 13172
# endif
-/* NameType value from RFC 3546 */
+/* NameType value from RFC3546 */
# define TLSEXT_NAMETYPE_host_name 0
-/* status request value from RFC 3546 */
+/* status request value from RFC3546 */
# define TLSEXT_STATUSTYPE_ocsp 1
-/* ECPointFormat values from draft-ietf-tls-ecc-12 */
+/* ECPointFormat values from RFC4492 */
# define TLSEXT_ECPOINTFORMAT_first 0
# define TLSEXT_ECPOINTFORMAT_uncompressed 0
# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1
# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2
# define TLSEXT_ECPOINTFORMAT_last 2
-/* Signature and hash algorithms from RFC 5246 */
-
+/* Signature and hash algorithms from RFC5246 */
# define TLSEXT_signature_anonymous 0
# define TLSEXT_signature_rsa 1
# define TLSEXT_signature_dsa 2
@@ -430,7 +428,6 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
# define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066
/* AES ciphersuites from RFC3268 */
-
# define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F
# define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030
# define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031
@@ -595,7 +592,7 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA"
# define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA"
-/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */
+/* ECC ciphersuites from RFC4492 */
# define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA"
# define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA"
# define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA"
diff --git a/crypto/openssl/util/domd b/crypto/openssl/util/domd
index bab48cb..6a628c7 100755
--- a/crypto/openssl/util/domd
+++ b/crypto/openssl/util/domd
@@ -14,7 +14,8 @@ if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
cp Makefile Makefile.save
# fake the presence of Kerberos
touch $TOP/krb5.h
-if expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then
+if ${MAKEDEPEND} --version 2>&1 | grep -q "clang" ||
+ echo $MAKEDEPEND | grep -q "gcc"; then
args=""
while [ $# -gt 0 ]; do
if [ "$1" != "--" ]; then args="$args $1"; fi
diff --git a/crypto/openssl/util/indent.pro b/crypto/openssl/util/indent.pro
index e871431..4dcda5d 100644
--- a/crypto/openssl/util/indent.pro
+++ b/crypto/openssl/util/indent.pro
@@ -749,3 +749,19 @@
-T ssl_trace_tbl
-T _stdcall
-T tls12_lookup
+-T OPTIONS
+-T OPT_PAIR
+-T uint64_t
+-T int64_t
+-T uint32_t
+-T int32_t
+-T uint16_t
+-T int16_t
+-T uint8_t
+-T int8_t
+-T STRINT_PAIR
+-T felem
+-T felem_bytearray
+-T SH_LIST
+-T PACKET
+-T RECORD_LAYER
diff --git a/crypto/openssl/util/mk1mf.pl b/crypto/openssl/util/mk1mf.pl
index 9b8abc0..99652af 100755
--- a/crypto/openssl/util/mk1mf.pl
+++ b/crypto/openssl/util/mk1mf.pl
@@ -447,7 +447,7 @@ $defs= <<"EOF";
# N.B. You MUST use -j on FreeBSD.
# This makefile has been automatically generated from the OpenSSL distribution.
# This single makefile will build the complete OpenSSL distribution and
-# by default leave the 'intertesting' output files in .${o}out and the stuff
+# by default leave the 'interesting' output files in .${o}out and the stuff
# that needs deleting in .${o}tmp.
# The file was generated by running 'make makefile.one', which
# does a 'make files', which writes all the environment variables from all
diff --git a/crypto/openssl/util/mkrc.pl b/crypto/openssl/util/mkrc.pl
index 0ceadcf..83ee6a4 100755
--- a/crypto/openssl/util/mkrc.pl
+++ b/crypto/openssl/util/mkrc.pl
@@ -57,7 +57,7 @@ BEGIN
VALUE "ProductVersion", "$version\\0"
// Optional:
//VALUE "Comments", "\\0"
- VALUE "LegalCopyright", "Copyright © 1998-2006 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
+ VALUE "LegalCopyright", "Copyright © 1998-2006 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
//VALUE "LegalTrademarks", "\\0"
//VALUE "PrivateBuild", "\\0"
//VALUE "SpecialBuild", "\\0"
diff --git a/crypto/openssl/util/mkstack.pl b/crypto/openssl/util/mkstack.pl
index 2bd96cd..f4520d4 100755
--- a/crypto/openssl/util/mkstack.pl
+++ b/crypto/openssl/util/mkstack.pl
@@ -98,7 +98,7 @@ while(<IN>) {
EOF
}
- foreach $type_thing (sort @sstacklst) {
+ foreach $type_thing (sort { $a->[0] cmp $b->[0]} @sstacklst) {
my $t1 = $type_thing->[0];
my $t2 = $type_thing->[1];
$new_stackfile .= <<EOF;
diff --git a/crypto/openssl/util/pl/VC-32.pl b/crypto/openssl/util/pl/VC-32.pl
index da05e9d..284fe03 100644
--- a/crypto/openssl/util/pl/VC-32.pl
+++ b/crypto/openssl/util/pl/VC-32.pl
@@ -358,15 +358,17 @@ sub do_link_rule
local($ret,$_);
$file =~ s/\//$o/g if $o ne '/';
$n=&bname($target);
- $ret.="$target: $files $dep_libs\n";
+ $ret.="$target: $files $dep_libs";
if ($standalone == 1)
{
+ $ret.=" \$(OBJ_D)${o}applink.obj\n";
$ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n\t";
- $ret.= "\$(EX_LIBS) " if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild);
+ $ret.= "\$(EX_LIBS) \$(OBJ_D)${o}applink.obj " if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild);
$ret.="$files $libs\n<<\n";
}
elsif ($standalone == 2)
{
+ $ret.="\n";
$ret.="\tSET FIPS_LINK=\$(LINK)\n";
$ret.="\tSET FIPS_CC=\$(CC)\n";
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
@@ -379,6 +381,7 @@ sub do_link_rule
}
else
{
+ $ret.="\n";
$ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n";
$ret.="\t\$(APP_EX_OBJ) $files $libs\n<<\n";
}
diff --git a/crypto/openssl/util/pod2mantest b/crypto/openssl/util/pod2mantest
deleted file mode 100755
index 384e683..0000000
--- a/crypto/openssl/util/pod2mantest
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-# This script is used by test/Makefile to check whether a sane 'pod2man'
-# is installed.
-# ('make install' should not try to run 'pod2man' if it does not exist or if
-# it is a broken 'pod2man' version that is known to cause trouble. if we find
-# the system 'pod2man' to be broken, we use our own copy instead)
-#
-# In any case, output an appropriate command line for running (or not
-# running) pod2man.
-
-
-IFS=:
-if test "$OSTYPE" = "msdosdjgpp"; then IFS=";"; fi
-
-try_without_dir=true
-# First we try "pod2man", then "$dir/pod2man" for each item in $PATH.
-for dir in dummy${IFS}$PATH; do
- if [ "$try_without_dir" = true ]; then
- # first iteration
- pod2man=pod2man
- try_without_dir=false
- else
- # second and later iterations
- pod2man="$dir/pod2man"
- if [ ! -f "$pod2man" ]; then # '-x' is not available on Ultrix
- pod2man=''
- fi
- fi
-
- if [ ! "$pod2man" = '' ]; then
- failure=none
-
- if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | fgrep OpenSSL >/dev/null; then
- :
- else
- failure=BasicTest
- fi
-
- if [ "$failure" = none ]; then
- if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | grep '^MARKER - ' >/dev/null; then
- failure=MultilineTest
- fi
- fi
-
-
- if [ "$failure" = none ]; then
- echo "$pod2man"
- exit 0
- fi
-
- echo "$pod2man does not work properly ('$failure' failed). Looking for another pod2man ..." >&2
- fi
-done
-
-echo "No working pod2man found. Consider installing a new version." >&2
-echo "As a workaround, we'll use a bundled old copy of pod2man.pl." >&2
-echo "$1 ../../util/pod2man.pl"
diff --git a/crypto/openssl/util/selftest.pl b/crypto/openssl/util/selftest.pl
index 7b32e9f..59842ef 100644
--- a/crypto/openssl/util/selftest.pl
+++ b/crypto/openssl/util/selftest.pl
@@ -199,3 +199,4 @@ while (<IN>) {
}
print "\nTest report in file $report\n";
+die if $ok != 2;
diff --git a/crypto/openssl/util/toutf8.sh b/crypto/openssl/util/toutf8.sh
new file mode 100755
index 0000000..8a4254b
--- /dev/null
+++ b/crypto/openssl/util/toutf8.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+#
+# Very simple script to detect and convert files that we want to re-encode to UTF8
+
+git ls-tree -r --name-only HEAD | \
+ while read F; do
+ charset=`file -bi "$F" | sed -e 's|.*charset=||'`
+ if [ "$charset" != "utf-8" -a "$charset" != "binary" -a "$charset" != "us-ascii" ]; then
+ iconv -f ISO-8859-1 -t UTF8 < "$F" > "$F.utf8" && \
+ ( cmp -s "$F" "$F.utf8" || \
+ ( echo "$F"
+ mv "$F" "$F.iso-8859-1"
+ mv "$F.utf8" "$F"
+ )
+ )
+ fi
+ done
diff --git a/etc/Makefile b/etc/Makefile
index ddb7769..cf97988 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -408,7 +408,7 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
${METALOG.add} ; \
done; true
.endif
- ${INSTALL_SYMLINK} ${SRCTOP:C/^\///}/sys ${DESTDIR}/sys
+ ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
.if ${MK_MAN} != "no"
cd ${DESTDIR}${SHAREDIR}/man; \
for mandir in man*; do \
diff --git a/etc/Makefile.depend b/etc/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/etc/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 4c0e899..31a106a 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -326,6 +326,7 @@ nfs_client_enable="NO" # This host is an NFS client (or NO).
nfs_access_cache="60" # Client cache timeout in seconds
nfs_server_enable="NO" # This host is an NFS server (or NO).
nfs_server_flags="-u -t" # Flags to nfsd (if enabled).
+nfs_server_managegids="NO" # The NFS server maps gids for AUTH_SYS (or NO).
mountd_enable="NO" # Run mountd (or NO).
mountd_flags="-r" # Flags to mountd (if NFS server enabled).
weak_mountd_authentication="NO" # Allow non-root mount requests to be served.
diff --git a/etc/devd/usb.conf b/etc/devd/usb.conf
index 4f1d92f..56f1a5f 100644
--- a/etc/devd/usb.conf
+++ b/etc/devd/usb.conf
@@ -169,7 +169,23 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0409";
- match "product" "(0x00d5|0x00d6|0x00d7|0x8024|0x8025)";
+ match "product" "(0x00d5|0x00d6|0x00d7)";
+ action "kldload -n uipaq";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0409";
+ match "product" "0x0249";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0409";
+ match "product" "(0x8024|0x8025)";
action "kldload -n uipaq";
};
@@ -521,6 +537,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x04bb";
+ match "product" "0x093f";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x04bb";
match "product" "(0x0944|0x0945|0x0947|0x0948)";
action "kldload -n if_run";
};
@@ -1064,6 +1088,14 @@ nomatch 32 {
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+ match "vendor" "0x057c";
+ match "product" "0x8401";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
match "vendor" "0x0584";
match "product" "0xb000";
action "kldload -n uplcom";
@@ -1089,7 +1121,23 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0586";
- match "product" "(0x3416|0x341a|0x341e)";
+ match "product" "0x3416";
+ action "kldload -n if_run";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0586";
+ match "product" "0x3417";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0586";
+ match "product" "(0x341a|0x341e)";
action "kldload -n if_run";
};
@@ -1153,7 +1201,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
- match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0290|0x0291|0x0292)";
+ match "product" "(0x0230|0x0231|0x0232|0x0236|0x0237|0x0238|0x023f|0x0240|0x0241|0x0242|0x0243|0x0244|0x0245|0x0246|0x0247|0x0249|0x024a|0x024b|0x024c|0x024d|0x024e|0x0252|0x0253|0x0254|0x0259|0x025a|0x025b|0x0262|0x0263|0x0264|0x0272|0x0273|0x0274|0x0290|0x0291|0x0292)";
action "kldload -n wsp";
};
@@ -1721,6 +1769,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x07d1";
+ match "product" "0x3a09";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x07d1";
match "product" "0x3a0c";
action "kldload -n if_uath";
};
@@ -1729,6 +1785,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x07d1";
+ match "product" "0x3a0f";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x07d1";
match "product" "(0x3c03|0x3c04|0x3c06|0x3c07)";
action "kldload -n if_rum";
};
@@ -1737,7 +1801,23 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x07d1";
- match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f|0x3c11|0x3c13|0x3c15|0x3c16)";
+ match "product" "(0x3c09|0x3c0a|0x3c0b|0x3c0d|0x3c0e|0x3c0f)";
+ action "kldload -n if_run";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x07d1";
+ match "product" "0x3c10";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x07d1";
+ match "product" "(0x3c11|0x3c13|0x3c15|0x3c16)";
action "kldload -n if_run";
};
@@ -1848,6 +1928,14 @@ nomatch 32 {
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+ match "vendor" "0x083a";
+ match "product" "0xf522";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
match "vendor" "0x0841";
match "product" "0x0001";
action "kldload -n urio";
@@ -1921,7 +2009,39 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0846";
- match "product" "(0x9021|0x9041)";
+ match "product" "(0x9001|0x9010)";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0846";
+ match "product" "0x9012";
+ action "kldload -n if_run";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0846";
+ match "product" "0x9021";
+ action "kldload -n if_urtwn";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0846";
+ match "product" "0x9040";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0846";
+ match "product" "0x9041";
action "kldload -n if_urtwn";
};
@@ -2184,6 +2304,14 @@ nomatch 32 {
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+ match "vendor" "0x0ace";
+ match "product" "0x1221";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
match "vendor" "0x0af0";
match "product" "(0x5000|0x6000|0x6050|0x6100|0x6150|0x6200|0x6250|0x6300|0x6350|0x6500|0x6501|0x6600|0x6601|0x6701)";
action "kldload -n u3g";
@@ -2545,6 +2673,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0bda";
+ match "product" "0x8152";
+ action "kldload -n if_ure";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0bda";
match "product" "0x8170";
action "kldload -n if_urtwn";
};
@@ -2793,13 +2929,37 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0cde";
- match "product" "(0x0022|0x0025)";
+ match "product" "0x0022";
action "kldload -n if_run";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+ match "vendor" "0x0cde";
+ match "product" "0x0023";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0cde";
+ match "product" "0x0025";
+ action "kldload -n if_run";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0cde";
+ match "product" "0x0026";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
match "vendor" "0x0cf3";
match "product" "(0x0001|0x0003|0x0005)";
action "kldload -n if_uath";
@@ -2809,7 +2969,31 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x0cf3";
- match "product" "(0x3002|0x3004|0x311d|0xe004|0xe019)";
+ match "product" "(0x1001|0x1002|0x1010|0x1011)";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0cf3";
+ match "product" "(0x3002|0x3004|0x311d)";
+ action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0cf3";
+ match "product" "0x9170";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x0cf3";
+ match "product" "(0xe004|0xe019)";
action "kldload -n ng_ubt";
};
@@ -3529,7 +3713,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x1199";
- match "product" "(0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)";
+ match "product" "(0x6802|0x6803|0x6804|0x6805|0x6808|0x6809|0x6812|0x6813|0x6815|0x6816|0x6820|0x6821|0x6822|0x6832|0x6833|0x6834|0x6835|0x6838|0x6839|0x683a|0x683b|0x683c|0x683d|0x683e|0x6850|0x6851|0x6852|0x6853|0x6855|0x6856|0x6859|0x685a|0x6880|0x6890|0x6891|0x6892|0x6893|0x68a3)";
action "kldload -n u3g";
};
@@ -3545,7 +3729,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x1199";
- match "product" "0x68aa";
+ match "product" "(0x68aa|0x68c0|0x9041)";
action "kldload -n u3g";
};
@@ -3657,7 +3841,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x12d1";
- match "product" "(0x1803|0x1c05|0x1c0b)";
+ match "product" "(0x1573|0x1803|0x1c05|0x1c0b)";
action "kldload -n u3g";
};
@@ -3849,6 +4033,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x1435";
+ match "product" "0x0326";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x1435";
match "product" "0x0427";
action "kldload -n if_upgt";
};
@@ -3865,6 +4057,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x1435";
+ match "product" "0x0804";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x1435";
match "product" "(0x0826|0x082a)";
action "kldload -n if_uath";
};
@@ -4529,7 +4729,7 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x19d2";
- match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0117|0x1179|0x1181|0x1420|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)";
+ match "product" "(0x0001|0x0002|0x0003|0x0004|0x0005|0x0006|0x0007|0x0008|0x0009|0x000a|0x000b|0x000c|0x000d|0x000e|0x000f|0x0010|0x0011|0x0012|0x0013|0x0014|0x0015|0x0016|0x0017|0x0018|0x0019|0x0020|0x0021|0x0022|0x0023|0x0024|0x0025|0x0026|0x0027|0x0028|0x0029|0x0030|0x0031|0x0032|0x0033|0x0037|0x0039|0x0042|0x0043|0x0048|0x0049|0x0051|0x0052|0x0053|0x0054|0x0055|0x0057|0x0058|0x0059|0x0060|0x0061|0x0062|0x0063|0x0064|0x0066|0x0069|0x0070|0x0073|0x0076|0x0078|0x0082|0x0086|0x0103|0x0117|0x1179|0x1181|0x1420|0x1514|0x1516|0x2000|0x2002|0x2003|0xffdd|0xffde|0xfff1|0xfff5|0xfffe)";
action "kldload -n u3g";
};
@@ -4841,6 +5041,14 @@ nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x2019";
+ match "product" "0x5304";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
+ match "vendor" "0x2019";
match "product" "0xab01";
action "kldload -n if_rum";
};
@@ -5312,6 +5520,14 @@ nomatch 32 {
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
+ match "vendor" "0xcace";
+ match "product" "0x0300";
+ action "kldload -n if_otus";
+};
+
+nomatch 32 {
+ match "bus" "uhub[0-9]+";
+ match "mode" "host";
match "vendor" "0xdaae";
match "product" "0xead6";
action "kldload -n uslcom";
@@ -5585,5 +5801,5 @@ nomatch 32 {
action "kldload -n umass";
};
-# 2688 USB entries processed
+# 2719 USB entries processed
diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist
index 48ec8b4..bb0b26d 100644
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -241,6 +241,8 @@
..
krb5
..
+ lib80211
+ ..
libmilter
..
libxo
diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist
index 3fced30..3a00a90 100644
--- a/etc/mtree/BSD.usr.dist
+++ b/etc/mtree/BSD.usr.dist
@@ -21,6 +21,8 @@
clang
3.7.0
include
+ sanitizer
+ ..
..
lib
freebsd
diff --git a/etc/newsyslog.conf.d/Makefile.depend b/etc/newsyslog.conf.d/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/etc/newsyslog.conf.d/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/etc/rc.d/local_unbound b/etc/rc.d/local_unbound
index 4bb1a0c..0cd1ff3 100755
--- a/etc/rc.d/local_unbound
+++ b/etc/rc.d/local_unbound
@@ -24,6 +24,8 @@ configtest_cmd="local_unbound_configtest"
setup_cmd="local_unbound_setup"
pidfile="/var/run/${name}.pid"
+load_rc_config $name
+
: ${local_unbound_workdir:=/var/unbound}
: ${local_unbound_config:=${local_unbound_workdir}/unbound.conf}
: ${local_unbound_flags:="-c ${local_unbound_config}"}
@@ -32,8 +34,6 @@ pidfile="/var/run/${name}.pid"
: ${local_unbound_anchor:=${local_unbound_workdir}/root.key}
: ${local_unbound_forwarders:=}
-load_rc_config $name
-
do_as_unbound()
{
echo "$@" | su -m unbound
diff --git a/etc/rc.d/nfsd b/etc/rc.d/nfsd
index 8c67308..fefe390 100755
--- a/etc/rc.d/nfsd
+++ b/etc/rc.d/nfsd
@@ -32,9 +32,13 @@ nfsd_precmd()
sysctl vfs.nfsd.nfs_privport=0 > /dev/null
fi
+ if checkyesno nfsv4_server_enable || \
+ checkyesno nfs_server_managegids; then
+ force_depend nfsuserd || err 1 "Cannot run nfsuserd"
+ fi
+
if checkyesno nfsv4_server_enable; then
sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null
- force_depend nfsuserd || err 1 "Cannot run nfsuserd"
else
echo 'NFSv4 is disabled'
sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null
diff --git a/etc/rc.d/nfsuserd b/etc/rc.d/nfsuserd
index 52246bb..d98d16e 100755
--- a/etc/rc.d/nfsuserd
+++ b/etc/rc.d/nfsuserd
@@ -15,5 +15,14 @@ command="/usr/sbin/${name}"
sig_stop="USR1"
load_rc_config $name
+start_precmd="nfsuserd_precmd"
+
+nfsuserd_precmd()
+{
+ if checkyesno nfs_server_managegids; then
+ rc_flags="-manage-gids ${nfsuserd_flags}"
+ fi
+ return 0
+}
run_rc_command "$1"
diff --git a/etc/rc.d/rctl b/etc/rc.d/rctl
index 93b200d..85c0c20 100755
--- a/etc/rc.d/rctl
+++ b/etc/rc.d/rctl
@@ -23,10 +23,10 @@ rctl_start()
\#*|'')
;;
*)
- rctl -a "${var}"
+ echo "${var}"
;;
esac
- done < ${rctl_rules}
+ done < ${rctl_rules} | xargs rctl -a
fi
}
diff --git a/etc/rc.subr b/etc/rc.subr
index 904a5bd..a6de452 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -976,6 +976,14 @@ run_rc_command()
fi
fi
+ if [ $rc_arg = "start" -a -z "$rc_fast" -a -n "$rc_pid" ]; then
+ if [ -z "$rc_quiet" ]; then
+ echo 1>&2 "${name} already running? " \
+ "(pid=$rc_pid)."
+ fi
+ return 1
+ fi
+
# if there's a custom ${XXX_cmd},
# run that instead of the default
#
@@ -1004,14 +1012,6 @@ run_rc_command()
;;
start)
- if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
- if [ -z "$rc_quiet" ]; then
- echo 1>&2 "${name} already running? " \
- "(pid=$rc_pid)."
- fi
- return 1
- fi
-
if [ ! -x "${_chroot}${_chroot:+/}${command}" ]; then
warn "run_rc_command: cannot run $command"
return 1
diff --git a/gnu/lib/libssp/Makefile.depend b/gnu/lib/libssp/Makefile.depend
index 79eb58b..3646e2e 100644
--- a/gnu/lib/libssp/Makefile.depend
+++ b/gnu/lib/libssp/Makefile.depend
@@ -2,11 +2,13 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
.include <dirdeps.mk>
diff --git a/gnu/usr.bin/diff/Makefile.depend b/gnu/usr.bin/diff/Makefile.depend
index 6029d00..1cce740 100644
--- a/gnu/usr.bin/diff/Makefile.depend
+++ b/gnu/usr.bin/diff/Makefile.depend
@@ -2,20 +2,18 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
gnu/lib/libregex \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-context.o: context.c
-context.po: context.c
-diff.o: diff.c
-diff.po: diff.c
.endif
diff --git a/gnu/usr.bin/dtc/Makefile b/gnu/usr.bin/dtc/Makefile
index 7bf8fd5..cdbbf4b 100644
--- a/gnu/usr.bin/dtc/Makefile
+++ b/gnu/usr.bin/dtc/Makefile
@@ -3,8 +3,8 @@
.include <bsd.own.mk>
DTCDIR= ${.CURDIR}/../../../contrib/dtc
-LIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt
-.PATH: ${DTCDIR} ${LIBFDTDIR}
+_LIBFDTDIR= ${.CURDIR}/../../../sys/contrib/libfdt
+.PATH: ${DTCDIR} ${_LIBFDTDIR}
PROG= dtc
@@ -14,7 +14,7 @@ SRCS= dtc.c checks.c fstree.c livetree.c treesource.c data.c \
fdt_sw.c fdt_wip.c ${DTCVERSIONFILE}
WARNS?= 2
-CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${LIBFDTDIR}
+CFLAGS+= -I. -I${.CURDIR} -I${DTCDIR} -I${_LIBFDTDIR}
VERSIONMAJ!= awk '/^VERSION =/ { print $$3 }' ${DTCDIR}/Makefile
VERSIONMIN!= awk '/^PATCHLEVEL =/ { print $$3 }' ${DTCDIR}/Makefile
diff --git a/gnu/usr.bin/dtc/Makefile.depend b/gnu/usr.bin/dtc/Makefile.depend
index 01e6ecb..93a3a02 100644
--- a/gnu/usr.bin/dtc/Makefile.depend
+++ b/gnu/usr.bin/dtc/Makefile.depend
@@ -2,11 +2,14 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/yacc.host \
.include <dirdeps.mk>
@@ -19,6 +22,6 @@ dtc-lexer.lex.po: dtc-lexer.lex.c
dtc-lexer.lex.po: dtc-parser.tab.h
dtc-parser.tab.o: dtc-parser.tab.c
dtc-parser.tab.po: dtc-parser.tab.c
-dtc.o: version_gen.h
-dtc.po: version_gen.h
+util.o: version_gen.h
+util.po: version_gen.h
.endif
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile
index 8af2e18..5867f7a 100644
--- a/gnu/usr.bin/gdb/kgdb/Makefile
+++ b/gnu/usr.bin/gdb/kgdb/Makefile
@@ -8,12 +8,8 @@ BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
${OBJ_BU}/libiberty/libiberty.a
GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
-DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM}
-LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX}
-LIBADD+= m readline ncursesw gnuregex
-
-.if defined(GDB_CROSS_DEBUGGER)
-CFLAGS+= -Wl,-export-dynamic
-.endif
+DPADD= ${GDBLIBS} ${BULIBS}
+LDADD= ${GDBLIBS} ${BULIBS}
+LIBADD+= m readline ncursesw gnuregex kvm
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64 b/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64
index f675e83..3c60b31 100644
--- a/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64
+++ b/gnu/usr.bin/gdb/kgdb/Makefile.depend.amd64
@@ -15,6 +15,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
lib/msun \
lib/ncurses/ncursesw \
diff --git a/gnu/usr.bin/gdb/kgdb/main.c b/gnu/usr.bin/gdb/kgdb/main.c
index 19246c0..aa062a2 100644
--- a/gnu/usr.bin/gdb/kgdb/main.c
+++ b/gnu/usr.bin/gdb/kgdb/main.c
@@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$");
#include <kvm.h>
#include <limits.h>
#include <paths.h>
-#ifdef CROSS_DEBUGGER
-#include <proc_service.h>
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -81,24 +78,6 @@ static struct ui_file *parse_gdberr;
static void (*kgdb_new_objfile_chain)(struct objfile * objfile);
-#ifdef CROSS_DEBUGGER
-ps_err_e
-ps_pglobal_lookup(struct ps_prochandle *ph, const char *obj, const char *name,
- psaddr_t *sym_addr)
-{
- struct minimal_symbol *ms;
- CORE_ADDR addr;
-
- ms = lookup_minimal_symbol (name, NULL, NULL);
- if (ms == NULL)
- return PS_NOSYM;
-
- addr = SYMBOL_VALUE_ADDRESS (ms);
- store_typed_address(sym_addr, builtin_type_void_data_ptr, addr);
- return PS_OK;
-}
-#endif
-
static void
usage(void)
{
diff --git a/gnu/usr.bin/gdb/kgdb/trgt.c b/gnu/usr.bin/gdb/kgdb/trgt.c
index c75edf0..0cf8361 100644
--- a/gnu/usr.bin/gdb/kgdb/trgt.c
+++ b/gnu/usr.bin/gdb/kgdb/trgt.c
@@ -78,6 +78,19 @@ static char kvm_err[_POSIX2_LINE_MAX];
#define KERNOFF (kgdb_kernbase ())
#define PINKERNEL(x) ((x) >= KERNOFF)
+static int
+kgdb_resolve_symbol(const char *name, kvaddr_t *kva)
+{
+ struct minimal_symbol *ms;
+
+ ms = lookup_minimal_symbol (name, NULL, NULL);
+ if (ms == NULL)
+ return (1);
+
+ *kva = SYMBOL_VALUE_ADDRESS (ms);
+ return (0);
+}
+
static CORE_ADDR
kgdb_kernbase (void)
{
@@ -120,8 +133,8 @@ kgdb_trgt_open(char *filename, int from_tty)
old_chain = make_cleanup (xfree, filename);
- nkvm = kvm_openfiles(bfd_get_filename(exec_bfd), filename, NULL,
- write_files ? O_RDWR : O_RDONLY, kvm_err);
+ nkvm = kvm_open2(bfd_get_filename(exec_bfd), filename,
+ write_files ? O_RDWR : O_RDONLY, kvm_err, kgdb_resolve_symbol);
if (nkvm == NULL)
error ("Failed to open vmcore: %s", kvm_err);
@@ -254,7 +267,7 @@ kgdb_trgt_xfer_memory(CORE_ADDR memaddr, char *myaddr, int len, int write,
if (len == 0)
return (0);
if (!write)
- return (kvm_read(kvm, memaddr, myaddr, len));
+ return (kvm_read2(kvm, memaddr, myaddr, len));
else
return (kvm_write(kvm, memaddr, myaddr, len));
}
diff --git a/gnu/usr.bin/gperf/Makefile.depend b/gnu/usr.bin/gperf/Makefile.depend
index 8c58c1e..b602708 100644
--- a/gnu/usr.bin/gperf/Makefile.depend
+++ b/gnu/usr.bin/gperf/Makefile.depend
@@ -2,12 +2,15 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
- gnu/lib/libstdc++ \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libc++ \
+ lib/libcompiler_rt \
+ lib/libcxxrt \
lib/msun \
diff --git a/gnu/usr.bin/grep/Makefile.depend b/gnu/usr.bin/grep/Makefile.depend
index a5d26c4..676126d 100644
--- a/gnu/usr.bin/grep/Makefile.depend
+++ b/gnu/usr.bin/grep/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
gnu/lib/libregex \
include \
@@ -9,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libbz2 \
lib/libc \
+ lib/libcompiler_rt \
lib/libz \
diff --git a/gnu/usr.bin/groff/src/devices/grodvi/Makefile b/gnu/usr.bin/groff/src/devices/grodvi/Makefile
index 3745440..948e9fa 100644
--- a/gnu/usr.bin/groff/src/devices/grodvi/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grodvi/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grodvi
SRCS= dvi.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grohtml/Makefile b/gnu/usr.bin/groff/src/devices/grohtml/Makefile
index 321f1c8..5b55436 100644
--- a/gnu/usr.bin/groff/src/devices/grohtml/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grohtml/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= post-grohtml
SRCS= post-html.cpp html-table.cpp html-text.cpp output.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
MAN=
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grolbp/Makefile b/gnu/usr.bin/groff/src/devices/grolbp/Makefile
index 85a41c1..23a3161 100644
--- a/gnu/usr.bin/groff/src/devices/grolbp/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grolbp/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grolbp
SRCS= lbp.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grolj4/Makefile b/gnu/usr.bin/groff/src/devices/grolj4/Makefile
index bb3f9e4..eeaeca9 100644
--- a/gnu/usr.bin/groff/src/devices/grolj4/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grolj4/Makefile
@@ -3,8 +3,9 @@
PROG_CXX= grolj4
MAN= grolj4.1 lj4_font.5
SRCS= lj4.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grops/Makefile b/gnu/usr.bin/groff/src/devices/grops/Makefile
index 4511f69..8c83acd 100644
--- a/gnu/usr.bin/groff/src/devices/grops/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grops/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grops
SRCS= ps.cpp psrm.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/devices/grotty/Makefile b/gnu/usr.bin/groff/src/devices/grotty/Makefile
index d15ee8b..c4de8f4 100644
--- a/gnu/usr.bin/groff/src/devices/grotty/Makefile
+++ b/gnu/usr.bin/groff/src/devices/grotty/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grotty
SRCS= tty.cpp
-DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBDRIVER} ${LIBGROFF} -lm
+DPADD= ${LIBDRIVER} ${LIBGROFF}
+LDADD= ${LIBDRIVER} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/preproc/grn/Makefile b/gnu/usr.bin/groff/src/preproc/grn/Makefile
index 58309d2..7f2e301 100644
--- a/gnu/usr.bin/groff/src/preproc/grn/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/grn/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= grn
SRCS= hdb.cpp hpoint.cpp hgraph.cpp main.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/preproc/pic/Makefile b/gnu/usr.bin/groff/src/preproc/pic/Makefile
index 3b5939c..18a2cd91 100644
--- a/gnu/usr.bin/groff/src/preproc/pic/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/pic/Makefile
@@ -4,8 +4,9 @@ PROG_CXX= pic
SRCS= lex.cpp main.cpp object.cpp pic.cpp pic_tab.h \
common.cpp troff.cpp tex.cpp
CFLAGS+= -I${DIST_DIR} -I.
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN} pic.cpp pic_tab.h y.tab.c y.tab.h
pic_tab.h: pic.cpp
diff --git a/gnu/usr.bin/groff/src/preproc/refer/Makefile b/gnu/usr.bin/groff/src/preproc/refer/Makefile
index 8a18f6f..78fc96b 100644
--- a/gnu/usr.bin/groff/src/preproc/refer/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/refer/Makefile
@@ -3,8 +3,9 @@
PROG_CXX= refer
SRCS= command.cpp label.cpp ref.cpp refer.cpp token.cpp
CFLAGS+= -I${DIST_DIR}
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= label.cpp label_tab.h ${MAN} y.tab.c y.tab.h
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/preproc/tbl/Makefile b/gnu/usr.bin/groff/src/preproc/tbl/Makefile
index 29e7ac2..5bf1980 100644
--- a/gnu/usr.bin/groff/src/preproc/tbl/Makefile
+++ b/gnu/usr.bin/groff/src/preproc/tbl/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= tbl
SRCS= main.cpp table.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/roff/groff/Makefile b/gnu/usr.bin/groff/src/roff/groff/Makefile
index 2ae541b..54d8010 100644
--- a/gnu/usr.bin/groff/src/roff/groff/Makefile
+++ b/gnu/usr.bin/groff/src/roff/groff/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= groff
SRCS= groff.cpp pipeline.c
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/roff/troff/Makefile b/gnu/usr.bin/groff/src/roff/troff/Makefile
index 802af2b..9108ab4 100644
--- a/gnu/usr.bin/groff/src/roff/troff/Makefile
+++ b/gnu/usr.bin/groff/src/roff/troff/Makefile
@@ -3,8 +3,9 @@
PROG_CXX= troff
SRCS= dictionary.cpp div.cpp env.cpp input.cpp \
majorminor.cpp mtsm.cpp node.cpp number.cpp reg.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= majorminor.cpp ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile
index 1376702..d3ca4f5 100644
--- a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile
+++ b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= hpftodit
SRCS= hpftodit.cpp hpuni.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/indxbib/Makefile b/gnu/usr.bin/groff/src/utils/indxbib/Makefile
index 048fed0..b9667fd 100644
--- a/gnu/usr.bin/groff/src/utils/indxbib/Makefile
+++ b/gnu/usr.bin/groff/src/utils/indxbib/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= indxbib
SRCS= indxbib.cpp signal.c
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
FILES= ${DIST_DIR}/eign
FILESDIR= ${SHAREDIR}/dict/
diff --git a/gnu/usr.bin/groff/src/utils/lkbib/Makefile b/gnu/usr.bin/groff/src/utils/lkbib/Makefile
index f30dc56..3a95268 100644
--- a/gnu/usr.bin/groff/src/utils/lkbib/Makefile
+++ b/gnu/usr.bin/groff/src/utils/lkbib/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= lkbib
SRCS= lkbib.cpp
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/lookbib/Makefile b/gnu/usr.bin/groff/src/utils/lookbib/Makefile
index 18834a7..b12f7b7 100644
--- a/gnu/usr.bin/groff/src/utils/lookbib/Makefile
+++ b/gnu/usr.bin/groff/src/utils/lookbib/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= lookbib
SRCS= lookbib.cpp
-DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM}
-LDADD= ${LIBBIB} ${LIBGROFF} -lm
+DPADD= ${LIBBIB} ${LIBGROFF}
+LDADD= ${LIBBIB} ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile
index ba3bbc5..03f51bd 100644
--- a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile
+++ b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile
@@ -2,8 +2,9 @@
PROG_CXX= tfmtodit
SRCS= tfmtodit.cpp
-DPADD= ${LIBGROFF} ${LIBM}
-LDADD= ${LIBGROFF} -lm
+DPADD= ${LIBGROFF}
+LDADD= ${LIBGROFF}
+LIBADD= m
CLEANFILES= ${MAN}
.include <bsd.prog.mk>
diff --git a/include/Makefile b/include/Makefile
index 332b661..c75de6e 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -104,6 +104,8 @@ NEWVERS_SH= ${SYSDIR}/conf/newvers.sh
PARAM_H= ${SYSDIR}/sys/param.h
MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh
+SYMLINKS+= ${INCLUDEDIR} ${LIBDIR}/include
+
osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \
sh ${MK_OSRELDATE_SH}
@@ -260,81 +262,81 @@ symlinks:
.for i in ${LDIRS}
cd ${.CURDIR}/../sys/$i; \
for h in *.h; do \
- ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
+ ${INSTALL_SYMLINK} ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
done
.endfor
.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci}
cd ${.CURDIR}/../sys/$i; \
for h in *.h; do \
- ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
+ ${INSTALL_SYMLINK} ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
done
.endfor
cd ${.CURDIR}/../sys/dev/acpica; \
for h in acpiio.h acpi_hpet.h; do \
- ln -fs ../../../../sys/dev/acpica/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/dev/acpica/$$h \
${DESTDIR}${INCLUDEDIR}/dev/acpica; \
done
cd ${.CURDIR}/../sys/dev/agp; \
for h in agpreg.h; do \
- ln -fs ../../../../sys/dev/agp/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/dev/agp/$$h \
${DESTDIR}${INCLUDEDIR}/dev/agp; \
done
cd ${.CURDIR}/../sys/dev/bktr; \
for h in ioctl_*.h; do \
- ln -fs ../../../../sys/dev/bktr/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/dev/bktr/$$h \
${DESTDIR}${INCLUDEDIR}/dev/bktr; \
done
.if ${MK_NAND} != "no"
cd ${.CURDIR}/../sys/dev/nand; \
for h in nandsim.h nand_dev.h; do \
- ln -fs ../../../../sys/dev/nand/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/dev/nand/$$h \
${DESTDIR}${INCLUDEDIR}/dev/nand; \
done
.endif
cd ${.CURDIR}/../sys/dev/pci; \
for h in pcireg.h; do \
- ln -fs ../../../../sys/dev/pci/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/dev/pci/$$h \
${DESTDIR}${INCLUDEDIR}/dev/pci; \
done
.for i in ${LSUBSUBDIRS}
cd ${.CURDIR}/../sys/$i; \
for h in *.h; do \
- ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
+ ${INSTALL_SYMLINK} ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \
done
.endfor
.if ${MK_IPFILTER} != "no"
cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
for h in *.h; do \
- ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \
+ ${INSTALL_SYMLINK} ../../../sys/contrib/ipfilter/netinet/$$h \
${DESTDIR}${INCLUDEDIR}/netinet; \
done
.endif
.if ${MK_PF} != "no"
cd ${.CURDIR}/../sys/netpfil/pf; \
for h in *.h; do \
- ln -fs ../../../../sys/netpfil/pf/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/netpfil/pf/$$h \
${DESTDIR}${INCLUDEDIR}/netpfil/pf; \
done
.endif
cd ${.CURDIR}/../sys/crypto; \
for h in rijndael/rijndael.h; do \
- ln -fs ../../../sys/crypto/$$h \
+ ${INSTALL_SYMLINK} ../../../sys/crypto/$$h \
${DESTDIR}${INCLUDEDIR}/crypto; \
done
cd ${.CURDIR}/../sys/opencrypto; \
for h in *.h; do \
- ln -fs ../../../sys/opencrypto/$$h \
+ ${INSTALL_SYMLINK} ../../../sys/opencrypto/$$h \
${DESTDIR}${INCLUDEDIR}/crypto; \
done
cd ${.CURDIR}/../sys/${MACHINE}/include; \
for h in *.h; do \
- ln -fs ../../../sys/${MACHINE}/include/$$h \
+ ${INSTALL_SYMLINK} ../../../sys/${MACHINE}/include/$$h \
${DESTDIR}${INCLUDEDIR}/machine; \
done
.if exists(${.CURDIR}/../sys/${MACHINE}/include/pc)
cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \
for h in *.h; do \
- ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/${MACHINE}/include/pc/$$h \
${DESTDIR}${INCLUDEDIR}/machine/pc; \
done
.endif
@@ -344,7 +346,7 @@ symlinks:
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
cd ${.CURDIR}/../sys/${_MARCH}/include; \
for h in *.h; do \
- ln -fs ../../../sys/${_MARCH}/include/$$h \
+ ${INSTALL_SYMLINK} ../../../sys/${_MARCH}/include/$$h \
${DESTDIR}${INCLUDEDIR}/${_MARCH}; \
done
.if exists(${.CURDIR}/../sys/${_MARCH}/include/pc)
@@ -352,7 +354,7 @@ symlinks:
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \
for h in *.h; do \
- ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/${_MARCH}/include/pc/$$h \
${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
done
.endif
@@ -360,12 +362,12 @@ symlinks:
.endfor
cd ${.CURDIR}/../sys/fs/cd9660; \
for h in *.h; do \
- ln -fs ../../../../sys/fs/cd9660/$$h \
+ ${INSTALL_SYMLINK} ../../../../sys/fs/cd9660/$$h \
${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
done
cd ${.CURDIR}/../sys/rpc; \
for h in types.h; do \
- ln -fs ../../../sys/rpc/$$h \
+ ${INSTALL_SYMLINK} ../../../sys/rpc/$$h \
${DESTDIR}${INCLUDEDIR}/rpc; \
done
.if ${MK_DIRDEPS_BUILD} == "yes"
diff --git a/lib/Makefile b/lib/Makefile
index 4277d4e..e1ee9a9 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -71,6 +71,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
${_libmp} \
libmt \
${_libnandfs} \
+ lib80211 \
libnetbsd \
${_libnetgraph} \
${_libngatm} \
@@ -313,11 +314,6 @@ _libusbhid= libusbhid
_libusb= libusb
.endif
-.if !defined(LIBRARIES_ONLY)
-afterinstall:
- ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include
-.endif
-
.if !make(install)
SUBDIR_PARALLEL=
.endif
diff --git a/lib/clang/Makefile b/lib/clang/Makefile
index 88bc3b1..905346a 100644
--- a/lib/clang/Makefile
+++ b/lib/clang/Makefile
@@ -41,12 +41,10 @@ SUBDIR= libclanganalysis \
libllvmipa \
libllvmipo \
libllvmirreader \
- libllvmlibdriver \
libllvmlinker \
libllvmmc \
libllvmmcdisassembler \
libllvmmcparser \
- libllvmmirparser \
libllvmobjcarcopts \
libllvmobject \
libllvmoption \
@@ -97,7 +95,9 @@ SUBDIR= libclanganalysis \
.if ${MK_CLANG_EXTRAS} != "no"
SUBDIR+=libllvmdebuginfodwarf \
libllvmdebuginfopdb \
+ libllvmlibdriver \
libllvmlto \
+ libllvmmirparser \
libllvmorcjit \
libllvmpasses
.endif # MK_CLANG_EXTRAS
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index 735e5b9..e90bd3f 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -39,26 +39,6 @@ CXXFLAGS.clang+= -stdlib=libc++
.PATH: ${LLVM_SRCS}/${SRCDIR}
-.if ${MK_META_MODE} == "yes"
-.if empty(TOOLSDIR) || !exists(${TOOLSDIR}/usr/bin/clang-tblgen)
-.if ${MACHINE} == "host" && defined(BOOTSTRAPPING_TOOLS)
-.if !empty(LEGACY_TOOLS) && exists(${LEGACY_TOOLS}/usr/bin/tblgen)
-TOOLSDIR= ${LEGACY_TOOLS}
-.endif
-.endif
-.if ${MK_STAGING} == "yes" && exists(${STAGE_HOST_OBJTOP:Uno}/usr/bin/tblgen)
-TOOLSDIR= ${STAGE_HOST_OBJTOP}
-.endif
-.if exists(${LEGACY_TOOLS:Uno}/usr/bin/tblgen)
-TOOLSDIR= ${LEGACY_TOOLS}
-.endif
-.endif
-TOOLSDIR?=
-.if !empty(TOOLSDIR) && exists(${TOOLSDIR}/usr/bin/clang-tblgen)
-TBLGEN= ${TOOLSDIR}/usr/bin/tblgen
-CLANG_TBLGEN= ${TOOLSDIR}/usr/bin/clang-tblgen
-.endif
-.endif # ${MK_META_MODE} == "yes"
TBLGEN?= tblgen
CLANG_TBLGEN?= clang-tblgen
diff --git a/lib/clang/include/Makefile b/lib/clang/include/Makefile
index 1cea2e2..bd68591 100644
--- a/lib/clang/include/Makefile
+++ b/lib/clang/include/Makefile
@@ -67,7 +67,4 @@ INCS= __stddef_max_align_t.h \
GENINCS= arm_neon.h
CLEANFILES= ${GENINCS} ${GENINCS:C/\.h$/.d/}
-# avoid a circular dependency
-GENDIRDEPS_FILTER+= Nusr.bin/clang/clang-tblgen.host
-
.include <bsd.prog.mk>
diff --git a/lib/clang/include/Makefile.depend b/lib/clang/include/Makefile.depend
index f80275d..47d4983 100644
--- a/lib/clang/include/Makefile.depend
+++ b/lib/clang/include/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ usr.bin/clang/clang-tblgen.host \
.include <dirdeps.mk>
diff --git a/lib/clang/libclanganalysis/Makefile.depend b/lib/clang/libclanganalysis/Makefile.depend
index 5c5da718..a3f2b86 100644
--- a/lib/clang/libclanganalysis/Makefile.depend
+++ b/lib/clang/libclanganalysis/Makefile.depend
@@ -169,12 +169,6 @@ ThreadSafetyCommon.po: Attrs.inc.h
ThreadSafetyCommon.po: DeclNodes.inc.h
ThreadSafetyCommon.po: DiagnosticCommonKinds.inc.h
ThreadSafetyCommon.po: StmtNodes.inc.h
-ThreadSafetyLogical.o: DeclNodes.inc.h
-ThreadSafetyLogical.o: DiagnosticCommonKinds.inc.h
-ThreadSafetyLogical.o: StmtNodes.inc.h
-ThreadSafetyLogical.po: DeclNodes.inc.h
-ThreadSafetyLogical.po: DiagnosticCommonKinds.inc.h
-ThreadSafetyLogical.po: StmtNodes.inc.h
ThreadSafetyTIL.o: DeclNodes.inc.h
ThreadSafetyTIL.o: DiagnosticCommonKinds.inc.h
ThreadSafetyTIL.o: StmtNodes.inc.h
diff --git a/lib/clang/libclangast/Makefile.depend b/lib/clang/libclangast/Makefile.depend
index 89d2a29..01a929b 100644
--- a/lib/clang/libclangast/Makefile.depend
+++ b/lib/clang/libclangast/Makefile.depend
@@ -611,12 +611,14 @@ VTableBuilder.o: AttrList.inc.h
VTableBuilder.o: Attrs.inc.h
VTableBuilder.o: CommentCommandList.inc.h
VTableBuilder.o: DeclNodes.inc.h
+VTableBuilder.o: DiagnosticASTKinds.inc.h
VTableBuilder.o: DiagnosticCommonKinds.inc.h
VTableBuilder.o: StmtNodes.inc.h
VTableBuilder.po: AttrList.inc.h
VTableBuilder.po: Attrs.inc.h
VTableBuilder.po: CommentCommandList.inc.h
VTableBuilder.po: DeclNodes.inc.h
+VTableBuilder.po: DiagnosticASTKinds.inc.h
VTableBuilder.po: DiagnosticCommonKinds.inc.h
VTableBuilder.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/libclangbasic/Makefile.depend b/lib/clang/libclangbasic/Makefile.depend
index ea23a70..1b845df 100644
--- a/lib/clang/libclangbasic/Makefile.depend
+++ b/lib/clang/libclangbasic/Makefile.depend
@@ -4,7 +4,6 @@
DIRDEPS = \
include \
include/xlocale \
- lib/clang/include.host \
lib/libc++ \
lib/msun \
usr.bin/clang/clang-tblgen.host \
diff --git a/lib/clang/libclangcodegen/Makefile.depend b/lib/clang/libclangcodegen/Makefile.depend
index bb7fc0e..1a535fb 100644
--- a/lib/clang/libclangcodegen/Makefile.depend
+++ b/lib/clang/libclangcodegen/Makefile.depend
@@ -16,8 +16,10 @@ DIRDEPS = \
# local dependencies - needed for -jN in clean tree
BackendUtil.o: DiagnosticCommonKinds.inc.h
BackendUtil.o: DiagnosticFrontendKinds.inc.h
+BackendUtil.o: Intrinsics.inc.h
BackendUtil.po: DiagnosticCommonKinds.inc.h
BackendUtil.po: DiagnosticFrontendKinds.inc.h
+BackendUtil.po: Intrinsics.inc.h
CGAtomic.o: AttrList.inc.h
CGAtomic.o: Attrs.inc.h
CGAtomic.o: CommentCommandList.inc.h
@@ -127,6 +129,7 @@ CGClass.o: Attrs.inc.h
CGClass.o: CommentCommandList.inc.h
CGClass.o: DeclNodes.inc.h
CGClass.o: DiagnosticCommonKinds.inc.h
+CGClass.o: Intrinsics.inc.h
CGClass.o: StmtNodes.inc.h
CGClass.o: arm_neon.inc.h
CGClass.po: AttrList.inc.h
@@ -134,6 +137,7 @@ CGClass.po: Attrs.inc.h
CGClass.po: CommentCommandList.inc.h
CGClass.po: DeclNodes.inc.h
CGClass.po: DiagnosticCommonKinds.inc.h
+CGClass.po: Intrinsics.inc.h
CGClass.po: StmtNodes.inc.h
CGClass.po: arm_neon.inc.h
CGCleanup.o: AttrList.inc.h
@@ -197,6 +201,7 @@ CGException.o: DeclNodes.inc.h
CGException.o: DiagnosticCommonKinds.inc.h
CGException.o: Intrinsics.inc.h
CGException.o: StmtNodes.inc.h
+CGException.o: arm_neon.inc.h
CGException.po: AttrList.inc.h
CGException.po: Attrs.inc.h
CGException.po: CommentCommandList.inc.h
@@ -204,6 +209,7 @@ CGException.po: DeclNodes.inc.h
CGException.po: DiagnosticCommonKinds.inc.h
CGException.po: Intrinsics.inc.h
CGException.po: StmtNodes.inc.h
+CGException.po: arm_neon.inc.h
CGExpr.o: AttrList.inc.h
CGExpr.o: Attrs.inc.h
CGExpr.o: CommentCommandList.inc.h
@@ -284,6 +290,18 @@ CGExprScalar.po: DeclNodes.inc.h
CGExprScalar.po: DiagnosticCommonKinds.inc.h
CGExprScalar.po: Intrinsics.inc.h
CGExprScalar.po: StmtNodes.inc.h
+CGLoopInfo.o: AttrList.inc.h
+CGLoopInfo.o: AttrParsedAttrList.inc.h
+CGLoopInfo.o: Attrs.inc.h
+CGLoopInfo.o: DeclNodes.inc.h
+CGLoopInfo.o: DiagnosticCommonKinds.inc.h
+CGLoopInfo.o: StmtNodes.inc.h
+CGLoopInfo.po: AttrList.inc.h
+CGLoopInfo.po: AttrParsedAttrList.inc.h
+CGLoopInfo.po: Attrs.inc.h
+CGLoopInfo.po: DeclNodes.inc.h
+CGLoopInfo.po: DiagnosticCommonKinds.inc.h
+CGLoopInfo.po: StmtNodes.inc.h
CGObjC.o: AttrList.inc.h
CGObjC.o: Attrs.inc.h
CGObjC.o: CommentCommandList.inc.h
@@ -555,12 +573,14 @@ MicrosoftCXXABI.o: Attrs.inc.h
MicrosoftCXXABI.o: CommentCommandList.inc.h
MicrosoftCXXABI.o: DeclNodes.inc.h
MicrosoftCXXABI.o: DiagnosticCommonKinds.inc.h
+MicrosoftCXXABI.o: Intrinsics.inc.h
MicrosoftCXXABI.o: StmtNodes.inc.h
MicrosoftCXXABI.po: AttrList.inc.h
MicrosoftCXXABI.po: Attrs.inc.h
MicrosoftCXXABI.po: CommentCommandList.inc.h
MicrosoftCXXABI.po: DeclNodes.inc.h
MicrosoftCXXABI.po: DiagnosticCommonKinds.inc.h
+MicrosoftCXXABI.po: Intrinsics.inc.h
MicrosoftCXXABI.po: StmtNodes.inc.h
ModuleBuilder.o: AttrList.inc.h
ModuleBuilder.o: Attrs.inc.h
@@ -574,6 +594,20 @@ ModuleBuilder.po: CommentCommandList.inc.h
ModuleBuilder.po: DeclNodes.inc.h
ModuleBuilder.po: DiagnosticCommonKinds.inc.h
ModuleBuilder.po: StmtNodes.inc.h
+ObjectFilePCHContainerOperations.o: AttrList.inc.h
+ObjectFilePCHContainerOperations.o: AttrVisitor.inc.h
+ObjectFilePCHContainerOperations.o: Attrs.inc.h
+ObjectFilePCHContainerOperations.o: CommentCommandList.inc.h
+ObjectFilePCHContainerOperations.o: DeclNodes.inc.h
+ObjectFilePCHContainerOperations.o: DiagnosticCommonKinds.inc.h
+ObjectFilePCHContainerOperations.o: StmtNodes.inc.h
+ObjectFilePCHContainerOperations.po: AttrList.inc.h
+ObjectFilePCHContainerOperations.po: AttrVisitor.inc.h
+ObjectFilePCHContainerOperations.po: Attrs.inc.h
+ObjectFilePCHContainerOperations.po: CommentCommandList.inc.h
+ObjectFilePCHContainerOperations.po: DeclNodes.inc.h
+ObjectFilePCHContainerOperations.po: DiagnosticCommonKinds.inc.h
+ObjectFilePCHContainerOperations.po: StmtNodes.inc.h
SanitizerMetadata.o: AttrList.inc.h
SanitizerMetadata.o: Attrs.inc.h
SanitizerMetadata.o: CommentCommandList.inc.h
diff --git a/lib/clang/libclangdriver/Makefile.depend b/lib/clang/libclangdriver/Makefile.depend
index 24c1e09..5aa7286 100644
--- a/lib/clang/libclangdriver/Makefile.depend
+++ b/lib/clang/libclangdriver/Makefile.depend
@@ -42,6 +42,10 @@ MSVCToolChain.o: Options.inc.h
MSVCToolChain.po: DiagnosticCommonKinds.inc.h
MSVCToolChain.po: DiagnosticDriverKinds.inc.h
MSVCToolChain.po: Options.inc.h
+MinGWToolChain.o: DiagnosticCommonKinds.inc.h
+MinGWToolChain.o: Options.inc.h
+MinGWToolChain.po: DiagnosticCommonKinds.inc.h
+MinGWToolChain.po: Options.inc.h
Multilib.o: Options.inc.h
Multilib.po: Options.inc.h
SanitizerArgs.o: DiagnosticCommonKinds.inc.h
diff --git a/lib/clang/libclanglex/Makefile.depend b/lib/clang/libclanglex/Makefile.depend
index ae88032..be86cb7 100644
--- a/lib/clang/libclanglex/Makefile.depend
+++ b/lib/clang/libclanglex/Makefile.depend
@@ -4,7 +4,6 @@
DIRDEPS = \
include \
include/xlocale \
- lib/clang/include.host \
lib/libc++ \
lib/msun \
usr.bin/clang/clang-tblgen.host \
diff --git a/lib/clang/libclangparse/Makefile.depend b/lib/clang/libclangparse/Makefile.depend
index 52a5e4e..9c2e889 100644
--- a/lib/clang/libclangparse/Makefile.depend
+++ b/lib/clang/libclangparse/Makefile.depend
@@ -128,6 +128,7 @@ ParseInit.po: StmtNodes.inc.h
ParseObjc.o: AttrList.inc.h
ParseObjc.o: AttrParsedAttrList.inc.h
ParseObjc.o: Attrs.inc.h
+ParseObjc.o: CommentCommandList.inc.h
ParseObjc.o: DeclNodes.inc.h
ParseObjc.o: DiagnosticCommonKinds.inc.h
ParseObjc.o: DiagnosticParseKinds.inc.h
@@ -135,6 +136,7 @@ ParseObjc.o: StmtNodes.inc.h
ParseObjc.po: AttrList.inc.h
ParseObjc.po: AttrParsedAttrList.inc.h
ParseObjc.po: Attrs.inc.h
+ParseObjc.po: CommentCommandList.inc.h
ParseObjc.po: DeclNodes.inc.h
ParseObjc.po: DiagnosticCommonKinds.inc.h
ParseObjc.po: DiagnosticParseKinds.inc.h
@@ -206,6 +208,7 @@ ParseStmtAsm.po: StmtNodes.inc.h
ParseTemplate.o: AttrList.inc.h
ParseTemplate.o: AttrParsedAttrList.inc.h
ParseTemplate.o: Attrs.inc.h
+ParseTemplate.o: CommentCommandList.inc.h
ParseTemplate.o: DeclNodes.inc.h
ParseTemplate.o: DiagnosticCommonKinds.inc.h
ParseTemplate.o: DiagnosticParseKinds.inc.h
@@ -213,6 +216,7 @@ ParseTemplate.o: StmtNodes.inc.h
ParseTemplate.po: AttrList.inc.h
ParseTemplate.po: AttrParsedAttrList.inc.h
ParseTemplate.po: Attrs.inc.h
+ParseTemplate.po: CommentCommandList.inc.h
ParseTemplate.po: DeclNodes.inc.h
ParseTemplate.po: DiagnosticCommonKinds.inc.h
ParseTemplate.po: DiagnosticParseKinds.inc.h
diff --git a/lib/clang/libclangstaticanalyzercheckers/Makefile.depend b/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
index 6d91abe..cdb2b7a 100644
--- a/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
+++ b/lib/clang/libclangstaticanalyzercheckers/Makefile.depend
@@ -175,16 +175,6 @@ CheckSizeofPointer.po: CommentCommandList.inc.h
CheckSizeofPointer.po: DeclNodes.inc.h
CheckSizeofPointer.po: DiagnosticCommonKinds.inc.h
CheckSizeofPointer.po: StmtNodes.inc.h
-CheckerDocumentation.o: Checkers.inc.h
-CheckerDocumentation.o: CommentCommandList.inc.h
-CheckerDocumentation.o: DeclNodes.inc.h
-CheckerDocumentation.o: DiagnosticCommonKinds.inc.h
-CheckerDocumentation.o: StmtNodes.inc.h
-CheckerDocumentation.po: Checkers.inc.h
-CheckerDocumentation.po: CommentCommandList.inc.h
-CheckerDocumentation.po: DeclNodes.inc.h
-CheckerDocumentation.po: DiagnosticCommonKinds.inc.h
-CheckerDocumentation.po: StmtNodes.inc.h
ChrootChecker.o: Checkers.inc.h
ChrootChecker.o: CommentCommandList.inc.h
ChrootChecker.o: DeclNodes.inc.h
diff --git a/lib/clang/libclangstaticanalyzercore/Makefile.depend b/lib/clang/libclangstaticanalyzercore/Makefile.depend
index 7a1f856..5dfb2ffb 100644
--- a/lib/clang/libclangstaticanalyzercore/Makefile.depend
+++ b/lib/clang/libclangstaticanalyzercore/Makefile.depend
@@ -21,6 +21,14 @@ AnalysisManager.po: CommentCommandList.inc.h
AnalysisManager.po: DeclNodes.inc.h
AnalysisManager.po: DiagnosticCommonKinds.inc.h
AnalysisManager.po: StmtNodes.inc.h
+AnalyzerOptions.o: CommentCommandList.inc.h
+AnalyzerOptions.o: DeclNodes.inc.h
+AnalyzerOptions.o: DiagnosticCommonKinds.inc.h
+AnalyzerOptions.o: StmtNodes.inc.h
+AnalyzerOptions.po: CommentCommandList.inc.h
+AnalyzerOptions.po: DeclNodes.inc.h
+AnalyzerOptions.po: DiagnosticCommonKinds.inc.h
+AnalyzerOptions.po: StmtNodes.inc.h
BasicValueFactory.o: CommentCommandList.inc.h
BasicValueFactory.o: DeclNodes.inc.h
BasicValueFactory.o: DiagnosticCommonKinds.inc.h
@@ -98,10 +106,12 @@ CheckerManager.po: StmtNodes.inc.h
CheckerRegistry.o: CommentCommandList.inc.h
CheckerRegistry.o: DeclNodes.inc.h
CheckerRegistry.o: DiagnosticCommonKinds.inc.h
+CheckerRegistry.o: DiagnosticFrontendKinds.inc.h
CheckerRegistry.o: StmtNodes.inc.h
CheckerRegistry.po: CommentCommandList.inc.h
CheckerRegistry.po: DeclNodes.inc.h
CheckerRegistry.po: DiagnosticCommonKinds.inc.h
+CheckerRegistry.po: DiagnosticFrontendKinds.inc.h
CheckerRegistry.po: StmtNodes.inc.h
ConstraintManager.o: CommentCommandList.inc.h
ConstraintManager.o: DeclNodes.inc.h
diff --git a/lib/clang/liblldb/Makefile.depend b/lib/clang/liblldb/Makefile.depend
index 9e9f114..260fd9c 100644
--- a/lib/clang/liblldb/Makefile.depend
+++ b/lib/clang/liblldb/Makefile.depend
@@ -5,7 +5,6 @@ DIRDEPS = \
include \
include/xlocale \
lib/libc++ \
- lib/msun \
usr.bin/clang/clang-tblgen.host \
@@ -13,16 +12,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-lldb.o: AttrList.inc.h
-lldb.o: Attrs.inc.h
-lldb.o: CommentCommandList.inc.h
-lldb.o: DeclNodes.inc.h
-lldb.o: DiagnosticCommonKinds.inc.h
-lldb.o: StmtNodes.inc.h
-lldb.po: AttrList.inc.h
-lldb.po: Attrs.inc.h
-lldb.po: CommentCommandList.inc.h
-lldb.po: DeclNodes.inc.h
-lldb.po: DiagnosticCommonKinds.inc.h
-lldb.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbAPI/Makefile.depend b/lib/clang/liblldbAPI/Makefile.depend
index 8c55ae9..b2cd7b6 100644
--- a/lib/clang/liblldbAPI/Makefile.depend
+++ b/lib/clang/liblldbAPI/Makefile.depend
@@ -13,60 +13,10 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-SBAddress.o: CommentCommandList.inc.h
-SBAddress.o: DeclNodes.inc.h
-SBAddress.o: DiagnosticCommonKinds.inc.h
-SBAddress.o: StmtNodes.inc.h
-SBAddress.po: CommentCommandList.inc.h
-SBAddress.po: DeclNodes.inc.h
-SBAddress.po: DiagnosticCommonKinds.inc.h
-SBAddress.po: StmtNodes.inc.h
SBBlock.o: DiagnosticCommonKinds.inc.h
SBBlock.po: DiagnosticCommonKinds.inc.h
-SBBreakpoint.o: AttrList.inc.h
-SBBreakpoint.o: Attrs.inc.h
-SBBreakpoint.o: CommentCommandList.inc.h
-SBBreakpoint.o: DeclNodes.inc.h
-SBBreakpoint.o: DiagnosticCommonKinds.inc.h
-SBBreakpoint.o: StmtNodes.inc.h
-SBBreakpoint.po: AttrList.inc.h
-SBBreakpoint.po: Attrs.inc.h
-SBBreakpoint.po: CommentCommandList.inc.h
-SBBreakpoint.po: DeclNodes.inc.h
-SBBreakpoint.po: DiagnosticCommonKinds.inc.h
-SBBreakpoint.po: StmtNodes.inc.h
-SBBreakpointLocation.o: AttrList.inc.h
-SBBreakpointLocation.o: Attrs.inc.h
-SBBreakpointLocation.o: CommentCommandList.inc.h
-SBBreakpointLocation.o: DeclNodes.inc.h
-SBBreakpointLocation.o: DiagnosticCommonKinds.inc.h
-SBBreakpointLocation.o: StmtNodes.inc.h
-SBBreakpointLocation.po: AttrList.inc.h
-SBBreakpointLocation.po: Attrs.inc.h
-SBBreakpointLocation.po: CommentCommandList.inc.h
-SBBreakpointLocation.po: DeclNodes.inc.h
-SBBreakpointLocation.po: DiagnosticCommonKinds.inc.h
-SBBreakpointLocation.po: StmtNodes.inc.h
-SBCommandInterpreter.o: AttrList.inc.h
-SBCommandInterpreter.o: Attrs.inc.h
-SBCommandInterpreter.o: CommentCommandList.inc.h
-SBCommandInterpreter.o: DeclNodes.inc.h
-SBCommandInterpreter.o: DiagnosticCommonKinds.inc.h
-SBCommandInterpreter.o: StmtNodes.inc.h
-SBCommandInterpreter.po: AttrList.inc.h
-SBCommandInterpreter.po: Attrs.inc.h
-SBCommandInterpreter.po: CommentCommandList.inc.h
-SBCommandInterpreter.po: DeclNodes.inc.h
-SBCommandInterpreter.po: DiagnosticCommonKinds.inc.h
-SBCommandInterpreter.po: StmtNodes.inc.h
-SBCompileUnit.o: CommentCommandList.inc.h
-SBCompileUnit.o: DeclNodes.inc.h
SBCompileUnit.o: DiagnosticCommonKinds.inc.h
-SBCompileUnit.o: StmtNodes.inc.h
-SBCompileUnit.po: CommentCommandList.inc.h
-SBCompileUnit.po: DeclNodes.inc.h
SBCompileUnit.po: DiagnosticCommonKinds.inc.h
-SBCompileUnit.po: StmtNodes.inc.h
SBDebugger.o: AttrList.inc.h
SBDebugger.o: Attrs.inc.h
SBDebugger.o: CommentCommandList.inc.h
@@ -79,58 +29,12 @@ SBDebugger.po: CommentCommandList.inc.h
SBDebugger.po: DeclNodes.inc.h
SBDebugger.po: DiagnosticCommonKinds.inc.h
SBDebugger.po: StmtNodes.inc.h
-SBEvent.o: AttrList.inc.h
-SBEvent.o: Attrs.inc.h
-SBEvent.o: CommentCommandList.inc.h
-SBEvent.o: DeclNodes.inc.h
-SBEvent.o: DiagnosticCommonKinds.inc.h
-SBEvent.o: StmtNodes.inc.h
-SBEvent.po: AttrList.inc.h
-SBEvent.po: Attrs.inc.h
-SBEvent.po: CommentCommandList.inc.h
-SBEvent.po: DeclNodes.inc.h
-SBEvent.po: DiagnosticCommonKinds.inc.h
-SBEvent.po: StmtNodes.inc.h
-SBExpressionOptions.o: DiagnosticCommonKinds.inc.h
-SBExpressionOptions.po: DiagnosticCommonKinds.inc.h
SBFrame.o: DiagnosticCommonKinds.inc.h
SBFrame.po: DiagnosticCommonKinds.inc.h
-SBFunction.o: CommentCommandList.inc.h
-SBFunction.o: DeclNodes.inc.h
SBFunction.o: DiagnosticCommonKinds.inc.h
-SBFunction.o: StmtNodes.inc.h
-SBFunction.po: CommentCommandList.inc.h
-SBFunction.po: DeclNodes.inc.h
SBFunction.po: DiagnosticCommonKinds.inc.h
-SBFunction.po: StmtNodes.inc.h
-SBInstruction.o: CommentCommandList.inc.h
-SBInstruction.o: DeclNodes.inc.h
-SBInstruction.o: DiagnosticCommonKinds.inc.h
-SBInstruction.o: StmtNodes.inc.h
-SBInstruction.po: CommentCommandList.inc.h
-SBInstruction.po: DeclNodes.inc.h
-SBInstruction.po: DiagnosticCommonKinds.inc.h
-SBInstruction.po: StmtNodes.inc.h
-SBInstructionList.o: CommentCommandList.inc.h
-SBInstructionList.o: DeclNodes.inc.h
-SBInstructionList.o: DiagnosticCommonKinds.inc.h
-SBInstructionList.o: StmtNodes.inc.h
-SBInstructionList.po: CommentCommandList.inc.h
-SBInstructionList.po: DeclNodes.inc.h
-SBInstructionList.po: DiagnosticCommonKinds.inc.h
-SBInstructionList.po: StmtNodes.inc.h
-SBListener.o: AttrList.inc.h
-SBListener.o: Attrs.inc.h
-SBListener.o: CommentCommandList.inc.h
-SBListener.o: DeclNodes.inc.h
-SBListener.o: DiagnosticCommonKinds.inc.h
-SBListener.o: StmtNodes.inc.h
-SBListener.po: AttrList.inc.h
-SBListener.po: Attrs.inc.h
-SBListener.po: CommentCommandList.inc.h
-SBListener.po: DeclNodes.inc.h
-SBListener.po: DiagnosticCommonKinds.inc.h
-SBListener.po: StmtNodes.inc.h
+SBLanguageRuntime.o: DiagnosticCommonKinds.inc.h
+SBLanguageRuntime.po: DiagnosticCommonKinds.inc.h
SBModule.o: CommentCommandList.inc.h
SBModule.o: DeclNodes.inc.h
SBModule.o: DiagnosticCommonKinds.inc.h
@@ -139,104 +43,20 @@ SBModule.po: CommentCommandList.inc.h
SBModule.po: DeclNodes.inc.h
SBModule.po: DiagnosticCommonKinds.inc.h
SBModule.po: StmtNodes.inc.h
-SBModuleSpec.o: CommentCommandList.inc.h
-SBModuleSpec.o: DeclNodes.inc.h
-SBModuleSpec.o: DiagnosticCommonKinds.inc.h
-SBModuleSpec.o: StmtNodes.inc.h
-SBModuleSpec.po: CommentCommandList.inc.h
-SBModuleSpec.po: DeclNodes.inc.h
-SBModuleSpec.po: DiagnosticCommonKinds.inc.h
-SBModuleSpec.po: StmtNodes.inc.h
-SBPlatform.o: DiagnosticCommonKinds.inc.h
-SBPlatform.po: DiagnosticCommonKinds.inc.h
-SBProcess.o: AttrList.inc.h
-SBProcess.o: Attrs.inc.h
-SBProcess.o: CommentCommandList.inc.h
-SBProcess.o: DeclNodes.inc.h
-SBProcess.o: DiagnosticCommonKinds.inc.h
-SBProcess.o: StmtNodes.inc.h
-SBProcess.po: AttrList.inc.h
-SBProcess.po: Attrs.inc.h
-SBProcess.po: CommentCommandList.inc.h
-SBProcess.po: DeclNodes.inc.h
-SBProcess.po: DiagnosticCommonKinds.inc.h
-SBProcess.po: StmtNodes.inc.h
-SBQueue.o: DiagnosticCommonKinds.inc.h
-SBQueue.po: DiagnosticCommonKinds.inc.h
-SBQueueItem.o: DiagnosticCommonKinds.inc.h
-SBQueueItem.po: DiagnosticCommonKinds.inc.h
-SBSection.o: CommentCommandList.inc.h
-SBSection.o: DeclNodes.inc.h
-SBSection.o: DiagnosticCommonKinds.inc.h
-SBSection.o: StmtNodes.inc.h
-SBSection.po: CommentCommandList.inc.h
-SBSection.po: DeclNodes.inc.h
-SBSection.po: DiagnosticCommonKinds.inc.h
-SBSection.po: StmtNodes.inc.h
-SBSourceManager.o: AttrList.inc.h
-SBSourceManager.o: Attrs.inc.h
-SBSourceManager.o: CommentCommandList.inc.h
-SBSourceManager.o: DeclNodes.inc.h
-SBSourceManager.o: DiagnosticCommonKinds.inc.h
-SBSourceManager.o: StmtNodes.inc.h
-SBSourceManager.po: AttrList.inc.h
-SBSourceManager.po: Attrs.inc.h
-SBSourceManager.po: CommentCommandList.inc.h
-SBSourceManager.po: DeclNodes.inc.h
-SBSourceManager.po: DiagnosticCommonKinds.inc.h
-SBSourceManager.po: StmtNodes.inc.h
-SBSymbol.o: CommentCommandList.inc.h
-SBSymbol.o: DeclNodes.inc.h
-SBSymbol.o: DiagnosticCommonKinds.inc.h
-SBSymbol.o: StmtNodes.inc.h
-SBSymbol.po: CommentCommandList.inc.h
-SBSymbol.po: DeclNodes.inc.h
-SBSymbol.po: DiagnosticCommonKinds.inc.h
-SBSymbol.po: StmtNodes.inc.h
-SBSymbolContext.o: CommentCommandList.inc.h
-SBSymbolContext.o: DeclNodes.inc.h
SBSymbolContext.o: DiagnosticCommonKinds.inc.h
-SBSymbolContext.o: StmtNodes.inc.h
-SBSymbolContext.po: CommentCommandList.inc.h
-SBSymbolContext.po: DeclNodes.inc.h
SBSymbolContext.po: DiagnosticCommonKinds.inc.h
-SBSymbolContext.po: StmtNodes.inc.h
-SBTarget.o: AttrList.inc.h
-SBTarget.o: Attrs.inc.h
SBTarget.o: CommentCommandList.inc.h
SBTarget.o: DeclNodes.inc.h
SBTarget.o: DiagnosticCommonKinds.inc.h
SBTarget.o: StmtNodes.inc.h
-SBTarget.po: AttrList.inc.h
-SBTarget.po: Attrs.inc.h
SBTarget.po: CommentCommandList.inc.h
SBTarget.po: DeclNodes.inc.h
SBTarget.po: DiagnosticCommonKinds.inc.h
SBTarget.po: StmtNodes.inc.h
-SBThread.o: AttrList.inc.h
-SBThread.o: Attrs.inc.h
-SBThread.o: CommentCommandList.inc.h
-SBThread.o: DeclNodes.inc.h
SBThread.o: DiagnosticCommonKinds.inc.h
-SBThread.o: StmtNodes.inc.h
-SBThread.po: AttrList.inc.h
-SBThread.po: Attrs.inc.h
-SBThread.po: CommentCommandList.inc.h
-SBThread.po: DeclNodes.inc.h
SBThread.po: DiagnosticCommonKinds.inc.h
-SBThread.po: StmtNodes.inc.h
-SBThreadPlan.o: AttrList.inc.h
-SBThreadPlan.o: Attrs.inc.h
-SBThreadPlan.o: CommentCommandList.inc.h
-SBThreadPlan.o: DeclNodes.inc.h
SBThreadPlan.o: DiagnosticCommonKinds.inc.h
-SBThreadPlan.o: StmtNodes.inc.h
-SBThreadPlan.po: AttrList.inc.h
-SBThreadPlan.po: Attrs.inc.h
-SBThreadPlan.po: CommentCommandList.inc.h
-SBThreadPlan.po: DeclNodes.inc.h
SBThreadPlan.po: DiagnosticCommonKinds.inc.h
-SBThreadPlan.po: StmtNodes.inc.h
SBType.o: CommentCommandList.inc.h
SBType.o: DeclNodes.inc.h
SBType.o: DiagnosticCommonKinds.inc.h
@@ -319,8 +139,6 @@ SBTypeSynthetic.po: CommentCommandList.inc.h
SBTypeSynthetic.po: DeclNodes.inc.h
SBTypeSynthetic.po: DiagnosticCommonKinds.inc.h
SBTypeSynthetic.po: StmtNodes.inc.h
-SBUnixSignals.o: DiagnosticCommonKinds.inc.h
-SBUnixSignals.po: DiagnosticCommonKinds.inc.h
SBValue.o: AttrList.inc.h
SBValue.o: Attrs.inc.h
SBValue.o: CommentCommandList.inc.h
@@ -335,4 +153,12 @@ SBValue.po: DiagnosticCommonKinds.inc.h
SBValue.po: StmtNodes.inc.h
SBWatchpoint.o: DiagnosticCommonKinds.inc.h
SBWatchpoint.po: DiagnosticCommonKinds.inc.h
+SystemInitializerFull.o: CommentCommandList.inc.h
+SystemInitializerFull.o: DeclNodes.inc.h
+SystemInitializerFull.o: DiagnosticCommonKinds.inc.h
+SystemInitializerFull.o: StmtNodes.inc.h
+SystemInitializerFull.po: CommentCommandList.inc.h
+SystemInitializerFull.po: DeclNodes.inc.h
+SystemInitializerFull.po: DiagnosticCommonKinds.inc.h
+SystemInitializerFull.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbBreakpoint/Makefile.depend b/lib/clang/liblldbBreakpoint/Makefile.depend
index 12728ea..2dfc006 100644
--- a/lib/clang/liblldbBreakpoint/Makefile.depend
+++ b/lib/clang/liblldbBreakpoint/Makefile.depend
@@ -13,66 +13,20 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-Breakpoint.o: CommentCommandList.inc.h
-Breakpoint.o: DeclNodes.inc.h
Breakpoint.o: DiagnosticCommonKinds.inc.h
-Breakpoint.o: StmtNodes.inc.h
-Breakpoint.po: CommentCommandList.inc.h
-Breakpoint.po: DeclNodes.inc.h
Breakpoint.po: DiagnosticCommonKinds.inc.h
-Breakpoint.po: StmtNodes.inc.h
-BreakpointIDList.o: DiagnosticCommonKinds.inc.h
-BreakpointIDList.po: DiagnosticCommonKinds.inc.h
-BreakpointList.o: DiagnosticCommonKinds.inc.h
-BreakpointList.po: DiagnosticCommonKinds.inc.h
-BreakpointLocation.o: AttrList.inc.h
-BreakpointLocation.o: Attrs.inc.h
-BreakpointLocation.o: CommentCommandList.inc.h
-BreakpointLocation.o: DeclNodes.inc.h
BreakpointLocation.o: DiagnosticCommonKinds.inc.h
-BreakpointLocation.o: StmtNodes.inc.h
-BreakpointLocation.po: AttrList.inc.h
-BreakpointLocation.po: Attrs.inc.h
-BreakpointLocation.po: CommentCommandList.inc.h
-BreakpointLocation.po: DeclNodes.inc.h
BreakpointLocation.po: DiagnosticCommonKinds.inc.h
-BreakpointLocation.po: StmtNodes.inc.h
-BreakpointLocationCollection.o: DiagnosticCommonKinds.inc.h
-BreakpointLocationCollection.po: DiagnosticCommonKinds.inc.h
-BreakpointLocationList.o: CommentCommandList.inc.h
-BreakpointLocationList.o: DeclNodes.inc.h
-BreakpointLocationList.o: DiagnosticCommonKinds.inc.h
-BreakpointLocationList.o: StmtNodes.inc.h
-BreakpointLocationList.po: CommentCommandList.inc.h
-BreakpointLocationList.po: DeclNodes.inc.h
-BreakpointLocationList.po: DiagnosticCommonKinds.inc.h
-BreakpointLocationList.po: StmtNodes.inc.h
BreakpointOptions.o: DiagnosticCommonKinds.inc.h
BreakpointOptions.po: DiagnosticCommonKinds.inc.h
BreakpointResolver.o: DiagnosticCommonKinds.inc.h
BreakpointResolver.po: DiagnosticCommonKinds.inc.h
-BreakpointResolverAddress.o: DiagnosticCommonKinds.inc.h
-BreakpointResolverAddress.po: DiagnosticCommonKinds.inc.h
-BreakpointResolverFileLine.o: CommentCommandList.inc.h
-BreakpointResolverFileLine.o: DeclNodes.inc.h
BreakpointResolverFileLine.o: DiagnosticCommonKinds.inc.h
-BreakpointResolverFileLine.o: StmtNodes.inc.h
-BreakpointResolverFileLine.po: CommentCommandList.inc.h
-BreakpointResolverFileLine.po: DeclNodes.inc.h
BreakpointResolverFileLine.po: DiagnosticCommonKinds.inc.h
-BreakpointResolverFileLine.po: StmtNodes.inc.h
BreakpointResolverFileRegex.o: DiagnosticCommonKinds.inc.h
BreakpointResolverFileRegex.po: DiagnosticCommonKinds.inc.h
-BreakpointResolverName.o: CommentCommandList.inc.h
-BreakpointResolverName.o: DeclNodes.inc.h
BreakpointResolverName.o: DiagnosticCommonKinds.inc.h
-BreakpointResolverName.o: StmtNodes.inc.h
-BreakpointResolverName.po: CommentCommandList.inc.h
-BreakpointResolverName.po: DeclNodes.inc.h
BreakpointResolverName.po: DiagnosticCommonKinds.inc.h
-BreakpointResolverName.po: StmtNodes.inc.h
-BreakpointSite.o: DiagnosticCommonKinds.inc.h
-BreakpointSite.po: DiagnosticCommonKinds.inc.h
Watchpoint.o: CommentCommandList.inc.h
Watchpoint.o: DeclNodes.inc.h
Watchpoint.o: DiagnosticCommonKinds.inc.h
diff --git a/lib/clang/liblldbCommands/Makefile.depend b/lib/clang/liblldbCommands/Makefile.depend
index a854483..e1d128a 100644
--- a/lib/clang/liblldbCommands/Makefile.depend
+++ b/lib/clang/liblldbCommands/Makefile.depend
@@ -13,102 +13,22 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-CommandCompletions.o: AttrList.inc.h
-CommandCompletions.o: Attrs.inc.h
-CommandCompletions.o: CommentCommandList.inc.h
-CommandCompletions.o: DeclNodes.inc.h
CommandCompletions.o: DiagnosticCommonKinds.inc.h
-CommandCompletions.o: StmtNodes.inc.h
-CommandCompletions.po: AttrList.inc.h
-CommandCompletions.po: Attrs.inc.h
-CommandCompletions.po: CommentCommandList.inc.h
-CommandCompletions.po: DeclNodes.inc.h
CommandCompletions.po: DiagnosticCommonKinds.inc.h
-CommandCompletions.po: StmtNodes.inc.h
-CommandObjectApropos.o: AttrList.inc.h
-CommandObjectApropos.o: Attrs.inc.h
-CommandObjectApropos.o: CommentCommandList.inc.h
-CommandObjectApropos.o: DeclNodes.inc.h
-CommandObjectApropos.o: DiagnosticCommonKinds.inc.h
-CommandObjectApropos.o: StmtNodes.inc.h
-CommandObjectApropos.po: AttrList.inc.h
-CommandObjectApropos.po: Attrs.inc.h
-CommandObjectApropos.po: CommentCommandList.inc.h
-CommandObjectApropos.po: DeclNodes.inc.h
-CommandObjectApropos.po: DiagnosticCommonKinds.inc.h
-CommandObjectApropos.po: StmtNodes.inc.h
-CommandObjectArgs.o: AttrList.inc.h
-CommandObjectArgs.o: Attrs.inc.h
CommandObjectArgs.o: CommentCommandList.inc.h
CommandObjectArgs.o: DeclNodes.inc.h
CommandObjectArgs.o: DiagnosticCommonKinds.inc.h
CommandObjectArgs.o: StmtNodes.inc.h
-CommandObjectArgs.po: AttrList.inc.h
-CommandObjectArgs.po: Attrs.inc.h
CommandObjectArgs.po: CommentCommandList.inc.h
CommandObjectArgs.po: DeclNodes.inc.h
CommandObjectArgs.po: DiagnosticCommonKinds.inc.h
CommandObjectArgs.po: StmtNodes.inc.h
-CommandObjectBreakpoint.o: AttrList.inc.h
-CommandObjectBreakpoint.o: Attrs.inc.h
-CommandObjectBreakpoint.o: CommentCommandList.inc.h
-CommandObjectBreakpoint.o: DeclNodes.inc.h
CommandObjectBreakpoint.o: DiagnosticCommonKinds.inc.h
-CommandObjectBreakpoint.o: StmtNodes.inc.h
-CommandObjectBreakpoint.po: AttrList.inc.h
-CommandObjectBreakpoint.po: Attrs.inc.h
-CommandObjectBreakpoint.po: CommentCommandList.inc.h
-CommandObjectBreakpoint.po: DeclNodes.inc.h
CommandObjectBreakpoint.po: DiagnosticCommonKinds.inc.h
-CommandObjectBreakpoint.po: StmtNodes.inc.h
-CommandObjectBreakpointCommand.o: AttrList.inc.h
-CommandObjectBreakpointCommand.o: Attrs.inc.h
-CommandObjectBreakpointCommand.o: CommentCommandList.inc.h
-CommandObjectBreakpointCommand.o: DeclNodes.inc.h
-CommandObjectBreakpointCommand.o: DiagnosticCommonKinds.inc.h
-CommandObjectBreakpointCommand.o: StmtNodes.inc.h
-CommandObjectBreakpointCommand.po: AttrList.inc.h
-CommandObjectBreakpointCommand.po: Attrs.inc.h
-CommandObjectBreakpointCommand.po: CommentCommandList.inc.h
-CommandObjectBreakpointCommand.po: DeclNodes.inc.h
-CommandObjectBreakpointCommand.po: DiagnosticCommonKinds.inc.h
-CommandObjectBreakpointCommand.po: StmtNodes.inc.h
-CommandObjectCommands.o: AttrList.inc.h
-CommandObjectCommands.o: Attrs.inc.h
-CommandObjectCommands.o: CommentCommandList.inc.h
-CommandObjectCommands.o: DeclNodes.inc.h
-CommandObjectCommands.o: DiagnosticCommonKinds.inc.h
-CommandObjectCommands.o: StmtNodes.inc.h
-CommandObjectCommands.po: AttrList.inc.h
-CommandObjectCommands.po: Attrs.inc.h
-CommandObjectCommands.po: CommentCommandList.inc.h
-CommandObjectCommands.po: DeclNodes.inc.h
-CommandObjectCommands.po: DiagnosticCommonKinds.inc.h
-CommandObjectCommands.po: StmtNodes.inc.h
-CommandObjectDisassemble.o: AttrList.inc.h
-CommandObjectDisassemble.o: Attrs.inc.h
-CommandObjectDisassemble.o: CommentCommandList.inc.h
-CommandObjectDisassemble.o: DeclNodes.inc.h
CommandObjectDisassemble.o: DiagnosticCommonKinds.inc.h
-CommandObjectDisassemble.o: StmtNodes.inc.h
-CommandObjectDisassemble.po: AttrList.inc.h
-CommandObjectDisassemble.po: Attrs.inc.h
-CommandObjectDisassemble.po: CommentCommandList.inc.h
-CommandObjectDisassemble.po: DeclNodes.inc.h
CommandObjectDisassemble.po: DiagnosticCommonKinds.inc.h
-CommandObjectDisassemble.po: StmtNodes.inc.h
-CommandObjectExpression.o: AttrList.inc.h
-CommandObjectExpression.o: Attrs.inc.h
-CommandObjectExpression.o: CommentCommandList.inc.h
-CommandObjectExpression.o: DeclNodes.inc.h
CommandObjectExpression.o: DiagnosticCommonKinds.inc.h
-CommandObjectExpression.o: StmtNodes.inc.h
-CommandObjectExpression.po: AttrList.inc.h
-CommandObjectExpression.po: Attrs.inc.h
-CommandObjectExpression.po: CommentCommandList.inc.h
-CommandObjectExpression.po: DeclNodes.inc.h
CommandObjectExpression.po: DiagnosticCommonKinds.inc.h
-CommandObjectExpression.po: StmtNodes.inc.h
CommandObjectFrame.o: AttrList.inc.h
CommandObjectFrame.o: Attrs.inc.h
CommandObjectFrame.o: CommentCommandList.inc.h
@@ -121,186 +41,20 @@ CommandObjectFrame.po: CommentCommandList.inc.h
CommandObjectFrame.po: DeclNodes.inc.h
CommandObjectFrame.po: DiagnosticCommonKinds.inc.h
CommandObjectFrame.po: StmtNodes.inc.h
-CommandObjectGUI.o: AttrList.inc.h
-CommandObjectGUI.o: Attrs.inc.h
-CommandObjectGUI.o: CommentCommandList.inc.h
-CommandObjectGUI.o: DeclNodes.inc.h
-CommandObjectGUI.o: DiagnosticCommonKinds.inc.h
-CommandObjectGUI.o: StmtNodes.inc.h
-CommandObjectGUI.po: AttrList.inc.h
-CommandObjectGUI.po: Attrs.inc.h
-CommandObjectGUI.po: CommentCommandList.inc.h
-CommandObjectGUI.po: DeclNodes.inc.h
-CommandObjectGUI.po: DiagnosticCommonKinds.inc.h
-CommandObjectGUI.po: StmtNodes.inc.h
-CommandObjectHelp.o: AttrList.inc.h
-CommandObjectHelp.o: Attrs.inc.h
-CommandObjectHelp.o: CommentCommandList.inc.h
-CommandObjectHelp.o: DeclNodes.inc.h
-CommandObjectHelp.o: DiagnosticCommonKinds.inc.h
-CommandObjectHelp.o: StmtNodes.inc.h
-CommandObjectHelp.po: AttrList.inc.h
-CommandObjectHelp.po: Attrs.inc.h
-CommandObjectHelp.po: CommentCommandList.inc.h
-CommandObjectHelp.po: DeclNodes.inc.h
-CommandObjectHelp.po: DiagnosticCommonKinds.inc.h
-CommandObjectHelp.po: StmtNodes.inc.h
-CommandObjectLog.o: AttrList.inc.h
-CommandObjectLog.o: Attrs.inc.h
-CommandObjectLog.o: CommentCommandList.inc.h
-CommandObjectLog.o: DeclNodes.inc.h
+CommandObjectLanguage.o: DiagnosticCommonKinds.inc.h
+CommandObjectLanguage.po: DiagnosticCommonKinds.inc.h
CommandObjectLog.o: DiagnosticCommonKinds.inc.h
-CommandObjectLog.o: StmtNodes.inc.h
-CommandObjectLog.po: AttrList.inc.h
-CommandObjectLog.po: Attrs.inc.h
-CommandObjectLog.po: CommentCommandList.inc.h
-CommandObjectLog.po: DeclNodes.inc.h
CommandObjectLog.po: DiagnosticCommonKinds.inc.h
-CommandObjectLog.po: StmtNodes.inc.h
-CommandObjectMemory.o: AttrList.inc.h
-CommandObjectMemory.o: Attrs.inc.h
-CommandObjectMemory.o: CommentCommandList.inc.h
CommandObjectMemory.o: DeclNodes.inc.h
CommandObjectMemory.o: DiagnosticCommonKinds.inc.h
-CommandObjectMemory.o: StmtNodes.inc.h
-CommandObjectMemory.po: AttrList.inc.h
-CommandObjectMemory.po: Attrs.inc.h
-CommandObjectMemory.po: CommentCommandList.inc.h
CommandObjectMemory.po: DeclNodes.inc.h
CommandObjectMemory.po: DiagnosticCommonKinds.inc.h
-CommandObjectMemory.po: StmtNodes.inc.h
-CommandObjectMultiword.o: AttrList.inc.h
-CommandObjectMultiword.o: Attrs.inc.h
-CommandObjectMultiword.o: CommentCommandList.inc.h
-CommandObjectMultiword.o: DeclNodes.inc.h
-CommandObjectMultiword.o: DiagnosticCommonKinds.inc.h
-CommandObjectMultiword.o: StmtNodes.inc.h
-CommandObjectMultiword.po: AttrList.inc.h
-CommandObjectMultiword.po: Attrs.inc.h
-CommandObjectMultiword.po: CommentCommandList.inc.h
-CommandObjectMultiword.po: DeclNodes.inc.h
-CommandObjectMultiword.po: DiagnosticCommonKinds.inc.h
-CommandObjectMultiword.po: StmtNodes.inc.h
-CommandObjectPlatform.o: AttrList.inc.h
-CommandObjectPlatform.o: Attrs.inc.h
-CommandObjectPlatform.o: CommentCommandList.inc.h
-CommandObjectPlatform.o: DeclNodes.inc.h
-CommandObjectPlatform.o: DiagnosticCommonKinds.inc.h
-CommandObjectPlatform.o: StmtNodes.inc.h
-CommandObjectPlatform.po: AttrList.inc.h
-CommandObjectPlatform.po: Attrs.inc.h
-CommandObjectPlatform.po: CommentCommandList.inc.h
-CommandObjectPlatform.po: DeclNodes.inc.h
-CommandObjectPlatform.po: DiagnosticCommonKinds.inc.h
-CommandObjectPlatform.po: StmtNodes.inc.h
-CommandObjectPlugin.o: AttrList.inc.h
-CommandObjectPlugin.o: Attrs.inc.h
-CommandObjectPlugin.o: CommentCommandList.inc.h
-CommandObjectPlugin.o: DeclNodes.inc.h
-CommandObjectPlugin.o: DiagnosticCommonKinds.inc.h
-CommandObjectPlugin.o: StmtNodes.inc.h
-CommandObjectPlugin.po: AttrList.inc.h
-CommandObjectPlugin.po: Attrs.inc.h
-CommandObjectPlugin.po: CommentCommandList.inc.h
-CommandObjectPlugin.po: DeclNodes.inc.h
-CommandObjectPlugin.po: DiagnosticCommonKinds.inc.h
-CommandObjectPlugin.po: StmtNodes.inc.h
-CommandObjectProcess.o: AttrList.inc.h
-CommandObjectProcess.o: Attrs.inc.h
-CommandObjectProcess.o: CommentCommandList.inc.h
-CommandObjectProcess.o: DeclNodes.inc.h
-CommandObjectProcess.o: DiagnosticCommonKinds.inc.h
-CommandObjectProcess.o: StmtNodes.inc.h
-CommandObjectProcess.po: AttrList.inc.h
-CommandObjectProcess.po: Attrs.inc.h
-CommandObjectProcess.po: CommentCommandList.inc.h
-CommandObjectProcess.po: DeclNodes.inc.h
-CommandObjectProcess.po: DiagnosticCommonKinds.inc.h
-CommandObjectProcess.po: StmtNodes.inc.h
-CommandObjectQuit.o: AttrList.inc.h
-CommandObjectQuit.o: Attrs.inc.h
-CommandObjectQuit.o: CommentCommandList.inc.h
-CommandObjectQuit.o: DeclNodes.inc.h
-CommandObjectQuit.o: DiagnosticCommonKinds.inc.h
-CommandObjectQuit.o: StmtNodes.inc.h
-CommandObjectQuit.po: AttrList.inc.h
-CommandObjectQuit.po: Attrs.inc.h
-CommandObjectQuit.po: CommentCommandList.inc.h
-CommandObjectQuit.po: DeclNodes.inc.h
-CommandObjectQuit.po: DiagnosticCommonKinds.inc.h
-CommandObjectQuit.po: StmtNodes.inc.h
-CommandObjectRegister.o: AttrList.inc.h
-CommandObjectRegister.o: Attrs.inc.h
-CommandObjectRegister.o: CommentCommandList.inc.h
-CommandObjectRegister.o: DeclNodes.inc.h
-CommandObjectRegister.o: DiagnosticCommonKinds.inc.h
-CommandObjectRegister.o: StmtNodes.inc.h
-CommandObjectRegister.po: AttrList.inc.h
-CommandObjectRegister.po: Attrs.inc.h
-CommandObjectRegister.po: CommentCommandList.inc.h
-CommandObjectRegister.po: DeclNodes.inc.h
-CommandObjectRegister.po: DiagnosticCommonKinds.inc.h
-CommandObjectRegister.po: StmtNodes.inc.h
-CommandObjectSettings.o: AttrList.inc.h
-CommandObjectSettings.o: Attrs.inc.h
-CommandObjectSettings.o: CommentCommandList.inc.h
-CommandObjectSettings.o: DeclNodes.inc.h
-CommandObjectSettings.o: DiagnosticCommonKinds.inc.h
-CommandObjectSettings.o: StmtNodes.inc.h
-CommandObjectSettings.po: AttrList.inc.h
-CommandObjectSettings.po: Attrs.inc.h
-CommandObjectSettings.po: CommentCommandList.inc.h
-CommandObjectSettings.po: DeclNodes.inc.h
-CommandObjectSettings.po: DiagnosticCommonKinds.inc.h
-CommandObjectSettings.po: StmtNodes.inc.h
-CommandObjectSource.o: AttrList.inc.h
-CommandObjectSource.o: Attrs.inc.h
-CommandObjectSource.o: CommentCommandList.inc.h
-CommandObjectSource.o: DeclNodes.inc.h
CommandObjectSource.o: DiagnosticCommonKinds.inc.h
-CommandObjectSource.o: StmtNodes.inc.h
-CommandObjectSource.po: AttrList.inc.h
-CommandObjectSource.po: Attrs.inc.h
-CommandObjectSource.po: CommentCommandList.inc.h
-CommandObjectSource.po: DeclNodes.inc.h
CommandObjectSource.po: DiagnosticCommonKinds.inc.h
-CommandObjectSource.po: StmtNodes.inc.h
-CommandObjectSyntax.o: AttrList.inc.h
-CommandObjectSyntax.o: Attrs.inc.h
-CommandObjectSyntax.o: CommentCommandList.inc.h
-CommandObjectSyntax.o: DeclNodes.inc.h
-CommandObjectSyntax.o: DiagnosticCommonKinds.inc.h
-CommandObjectSyntax.o: StmtNodes.inc.h
-CommandObjectSyntax.po: AttrList.inc.h
-CommandObjectSyntax.po: Attrs.inc.h
-CommandObjectSyntax.po: CommentCommandList.inc.h
-CommandObjectSyntax.po: DeclNodes.inc.h
-CommandObjectSyntax.po: DiagnosticCommonKinds.inc.h
-CommandObjectSyntax.po: StmtNodes.inc.h
-CommandObjectTarget.o: AttrList.inc.h
-CommandObjectTarget.o: Attrs.inc.h
-CommandObjectTarget.o: CommentCommandList.inc.h
-CommandObjectTarget.o: DeclNodes.inc.h
CommandObjectTarget.o: DiagnosticCommonKinds.inc.h
-CommandObjectTarget.o: StmtNodes.inc.h
-CommandObjectTarget.po: AttrList.inc.h
-CommandObjectTarget.po: Attrs.inc.h
-CommandObjectTarget.po: CommentCommandList.inc.h
-CommandObjectTarget.po: DeclNodes.inc.h
CommandObjectTarget.po: DiagnosticCommonKinds.inc.h
-CommandObjectTarget.po: StmtNodes.inc.h
-CommandObjectThread.o: AttrList.inc.h
-CommandObjectThread.o: Attrs.inc.h
-CommandObjectThread.o: CommentCommandList.inc.h
-CommandObjectThread.o: DeclNodes.inc.h
CommandObjectThread.o: DiagnosticCommonKinds.inc.h
-CommandObjectThread.o: StmtNodes.inc.h
-CommandObjectThread.po: AttrList.inc.h
-CommandObjectThread.po: Attrs.inc.h
-CommandObjectThread.po: CommentCommandList.inc.h
-CommandObjectThread.po: DeclNodes.inc.h
CommandObjectThread.po: DiagnosticCommonKinds.inc.h
-CommandObjectThread.po: StmtNodes.inc.h
CommandObjectType.o: AttrList.inc.h
CommandObjectType.o: Attrs.inc.h
CommandObjectType.o: CommentCommandList.inc.h
@@ -313,40 +67,8 @@ CommandObjectType.po: CommentCommandList.inc.h
CommandObjectType.po: DeclNodes.inc.h
CommandObjectType.po: DiagnosticCommonKinds.inc.h
CommandObjectType.po: StmtNodes.inc.h
-CommandObjectVersion.o: AttrList.inc.h
-CommandObjectVersion.o: Attrs.inc.h
-CommandObjectVersion.o: CommentCommandList.inc.h
-CommandObjectVersion.o: DeclNodes.inc.h
-CommandObjectVersion.o: DiagnosticCommonKinds.inc.h
-CommandObjectVersion.o: StmtNodes.inc.h
-CommandObjectVersion.po: AttrList.inc.h
-CommandObjectVersion.po: Attrs.inc.h
-CommandObjectVersion.po: CommentCommandList.inc.h
-CommandObjectVersion.po: DeclNodes.inc.h
-CommandObjectVersion.po: DiagnosticCommonKinds.inc.h
-CommandObjectVersion.po: StmtNodes.inc.h
-CommandObjectWatchpoint.o: AttrList.inc.h
-CommandObjectWatchpoint.o: Attrs.inc.h
-CommandObjectWatchpoint.o: CommentCommandList.inc.h
-CommandObjectWatchpoint.o: DeclNodes.inc.h
CommandObjectWatchpoint.o: DiagnosticCommonKinds.inc.h
-CommandObjectWatchpoint.o: StmtNodes.inc.h
-CommandObjectWatchpoint.po: AttrList.inc.h
-CommandObjectWatchpoint.po: Attrs.inc.h
-CommandObjectWatchpoint.po: CommentCommandList.inc.h
-CommandObjectWatchpoint.po: DeclNodes.inc.h
CommandObjectWatchpoint.po: DiagnosticCommonKinds.inc.h
-CommandObjectWatchpoint.po: StmtNodes.inc.h
-CommandObjectWatchpointCommand.o: AttrList.inc.h
-CommandObjectWatchpointCommand.o: Attrs.inc.h
-CommandObjectWatchpointCommand.o: CommentCommandList.inc.h
-CommandObjectWatchpointCommand.o: DeclNodes.inc.h
CommandObjectWatchpointCommand.o: DiagnosticCommonKinds.inc.h
-CommandObjectWatchpointCommand.o: StmtNodes.inc.h
-CommandObjectWatchpointCommand.po: AttrList.inc.h
-CommandObjectWatchpointCommand.po: Attrs.inc.h
-CommandObjectWatchpointCommand.po: CommentCommandList.inc.h
-CommandObjectWatchpointCommand.po: DeclNodes.inc.h
CommandObjectWatchpointCommand.po: DiagnosticCommonKinds.inc.h
-CommandObjectWatchpointCommand.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbCore/Makefile.depend b/lib/clang/liblldbCore/Makefile.depend
index 865dfa0..f48a002 100644
--- a/lib/clang/liblldbCore/Makefile.depend
+++ b/lib/clang/liblldbCore/Makefile.depend
@@ -16,36 +16,12 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-Address.o: CommentCommandList.inc.h
-Address.o: DeclNodes.inc.h
Address.o: DiagnosticCommonKinds.inc.h
-Address.o: StmtNodes.inc.h
-Address.po: CommentCommandList.inc.h
-Address.po: DeclNodes.inc.h
Address.po: DiagnosticCommonKinds.inc.h
-Address.po: StmtNodes.inc.h
-AddressRange.o: CommentCommandList.inc.h
-AddressRange.o: DeclNodes.inc.h
-AddressRange.o: DiagnosticCommonKinds.inc.h
-AddressRange.o: StmtNodes.inc.h
-AddressRange.po: CommentCommandList.inc.h
-AddressRange.po: DeclNodes.inc.h
-AddressRange.po: DiagnosticCommonKinds.inc.h
-AddressRange.po: StmtNodes.inc.h
-AddressResolver.o: DiagnosticCommonKinds.inc.h
-AddressResolver.po: DiagnosticCommonKinds.inc.h
AddressResolverFileLine.o: DiagnosticCommonKinds.inc.h
AddressResolverFileLine.po: DiagnosticCommonKinds.inc.h
-AddressResolverName.o: CommentCommandList.inc.h
-AddressResolverName.o: DeclNodes.inc.h
AddressResolverName.o: DiagnosticCommonKinds.inc.h
-AddressResolverName.o: StmtNodes.inc.h
-AddressResolverName.po: CommentCommandList.inc.h
-AddressResolverName.po: DeclNodes.inc.h
AddressResolverName.po: DiagnosticCommonKinds.inc.h
-AddressResolverName.po: StmtNodes.inc.h
-ArchSpec.o: DiagnosticCommonKinds.inc.h
-ArchSpec.po: DiagnosticCommonKinds.inc.h
DataExtractor.o: CommentCommandList.inc.h
DataExtractor.o: DeclNodes.inc.h
DataExtractor.o: DiagnosticCommonKinds.inc.h
@@ -66,130 +42,38 @@ Debugger.po: CommentCommandList.inc.h
Debugger.po: DeclNodes.inc.h
Debugger.po: DiagnosticCommonKinds.inc.h
Debugger.po: StmtNodes.inc.h
-Disassembler.o: AttrList.inc.h
-Disassembler.o: Attrs.inc.h
-Disassembler.o: CommentCommandList.inc.h
-Disassembler.o: DeclNodes.inc.h
Disassembler.o: DiagnosticCommonKinds.inc.h
-Disassembler.o: StmtNodes.inc.h
-Disassembler.po: AttrList.inc.h
-Disassembler.po: Attrs.inc.h
-Disassembler.po: CommentCommandList.inc.h
-Disassembler.po: DeclNodes.inc.h
Disassembler.po: DiagnosticCommonKinds.inc.h
-Disassembler.po: StmtNodes.inc.h
-DynamicLoader.o: CommentCommandList.inc.h
-DynamicLoader.o: DeclNodes.inc.h
-DynamicLoader.o: DiagnosticCommonKinds.inc.h
-DynamicLoader.o: StmtNodes.inc.h
-DynamicLoader.po: CommentCommandList.inc.h
-DynamicLoader.po: DeclNodes.inc.h
-DynamicLoader.po: DiagnosticCommonKinds.inc.h
-DynamicLoader.po: StmtNodes.inc.h
-EmulateInstruction.o: DiagnosticCommonKinds.inc.h
-EmulateInstruction.po: DiagnosticCommonKinds.inc.h
-Event.o: DiagnosticCommonKinds.inc.h
-Event.po: DiagnosticCommonKinds.inc.h
FileLineResolver.o: DiagnosticCommonKinds.inc.h
FileLineResolver.po: DiagnosticCommonKinds.inc.h
-IOHandler.o: AttrList.inc.h
-IOHandler.o: Attrs.inc.h
-IOHandler.o: CommentCommandList.inc.h
-IOHandler.o: DeclNodes.inc.h
+FormatEntity.o: AttrList.inc.h
+FormatEntity.o: Attrs.inc.h
+FormatEntity.o: CommentCommandList.inc.h
+FormatEntity.o: DeclNodes.inc.h
+FormatEntity.o: DiagnosticCommonKinds.inc.h
+FormatEntity.o: StmtNodes.inc.h
+FormatEntity.po: AttrList.inc.h
+FormatEntity.po: Attrs.inc.h
+FormatEntity.po: CommentCommandList.inc.h
+FormatEntity.po: DeclNodes.inc.h
+FormatEntity.po: DiagnosticCommonKinds.inc.h
+FormatEntity.po: StmtNodes.inc.h
IOHandler.o: DiagnosticCommonKinds.inc.h
-IOHandler.o: StmtNodes.inc.h
-IOHandler.po: AttrList.inc.h
-IOHandler.po: Attrs.inc.h
-IOHandler.po: CommentCommandList.inc.h
-IOHandler.po: DeclNodes.inc.h
IOHandler.po: DiagnosticCommonKinds.inc.h
-IOHandler.po: StmtNodes.inc.h
-Log.o: AttrList.inc.h
-Log.o: Attrs.inc.h
-Log.o: CommentCommandList.inc.h
-Log.o: DeclNodes.inc.h
-Log.o: DiagnosticCommonKinds.inc.h
-Log.o: StmtNodes.inc.h
-Log.po: AttrList.inc.h
-Log.po: Attrs.inc.h
-Log.po: CommentCommandList.inc.h
-Log.po: DeclNodes.inc.h
-Log.po: DiagnosticCommonKinds.inc.h
-Log.po: StmtNodes.inc.h
Mangled.o: DiagnosticCommonKinds.inc.h
Mangled.po: DiagnosticCommonKinds.inc.h
-Module.o: AttrList.inc.h
-Module.o: Attrs.inc.h
Module.o: CommentCommandList.inc.h
Module.o: DeclNodes.inc.h
Module.o: DiagnosticCommonKinds.inc.h
Module.o: StmtNodes.inc.h
-Module.po: AttrList.inc.h
-Module.po: Attrs.inc.h
Module.po: CommentCommandList.inc.h
Module.po: DeclNodes.inc.h
Module.po: DiagnosticCommonKinds.inc.h
Module.po: StmtNodes.inc.h
-ModuleList.o: CommentCommandList.inc.h
-ModuleList.o: DeclNodes.inc.h
-ModuleList.o: DiagnosticCommonKinds.inc.h
-ModuleList.o: StmtNodes.inc.h
-ModuleList.po: CommentCommandList.inc.h
-ModuleList.po: DeclNodes.inc.h
-ModuleList.po: DiagnosticCommonKinds.inc.h
-ModuleList.po: StmtNodes.inc.h
-PluginManager.o: AttrList.inc.h
-PluginManager.o: Attrs.inc.h
-PluginManager.o: CommentCommandList.inc.h
-PluginManager.o: DeclNodes.inc.h
-PluginManager.o: DiagnosticCommonKinds.inc.h
-PluginManager.o: StmtNodes.inc.h
-PluginManager.po: AttrList.inc.h
-PluginManager.po: Attrs.inc.h
-PluginManager.po: CommentCommandList.inc.h
-PluginManager.po: DeclNodes.inc.h
-PluginManager.po: DiagnosticCommonKinds.inc.h
-PluginManager.po: StmtNodes.inc.h
-SearchFilter.o: CommentCommandList.inc.h
-SearchFilter.o: DeclNodes.inc.h
SearchFilter.o: DiagnosticCommonKinds.inc.h
-SearchFilter.o: StmtNodes.inc.h
-SearchFilter.po: CommentCommandList.inc.h
-SearchFilter.po: DeclNodes.inc.h
SearchFilter.po: DiagnosticCommonKinds.inc.h
-SearchFilter.po: StmtNodes.inc.h
-Section.o: CommentCommandList.inc.h
-Section.o: DeclNodes.inc.h
-Section.o: DiagnosticCommonKinds.inc.h
-Section.o: StmtNodes.inc.h
-Section.po: CommentCommandList.inc.h
-Section.po: DeclNodes.inc.h
-Section.po: DiagnosticCommonKinds.inc.h
-Section.po: StmtNodes.inc.h
-SourceManager.o: AttrList.inc.h
-SourceManager.o: Attrs.inc.h
-SourceManager.o: CommentCommandList.inc.h
-SourceManager.o: DeclNodes.inc.h
SourceManager.o: DiagnosticCommonKinds.inc.h
-SourceManager.o: StmtNodes.inc.h
-SourceManager.po: AttrList.inc.h
-SourceManager.po: Attrs.inc.h
-SourceManager.po: CommentCommandList.inc.h
-SourceManager.po: DeclNodes.inc.h
SourceManager.po: DiagnosticCommonKinds.inc.h
-SourceManager.po: StmtNodes.inc.h
-UserSettingsController.o: AttrList.inc.h
-UserSettingsController.o: Attrs.inc.h
-UserSettingsController.o: CommentCommandList.inc.h
-UserSettingsController.o: DeclNodes.inc.h
-UserSettingsController.o: DiagnosticCommonKinds.inc.h
-UserSettingsController.o: StmtNodes.inc.h
-UserSettingsController.po: AttrList.inc.h
-UserSettingsController.po: Attrs.inc.h
-UserSettingsController.po: CommentCommandList.inc.h
-UserSettingsController.po: DeclNodes.inc.h
-UserSettingsController.po: DiagnosticCommonKinds.inc.h
-UserSettingsController.po: StmtNodes.inc.h
Value.o: CommentCommandList.inc.h
Value.o: DeclNodes.inc.h
Value.o: DiagnosticCommonKinds.inc.h
@@ -210,30 +94,12 @@ ValueObject.po: CommentCommandList.inc.h
ValueObject.po: DeclNodes.inc.h
ValueObject.po: DiagnosticCommonKinds.inc.h
ValueObject.po: StmtNodes.inc.h
-ValueObjectCast.o: CommentCommandList.inc.h
-ValueObjectCast.o: DeclNodes.inc.h
ValueObjectCast.o: DiagnosticCommonKinds.inc.h
-ValueObjectCast.o: StmtNodes.inc.h
-ValueObjectCast.po: CommentCommandList.inc.h
-ValueObjectCast.po: DeclNodes.inc.h
ValueObjectCast.po: DiagnosticCommonKinds.inc.h
-ValueObjectCast.po: StmtNodes.inc.h
-ValueObjectChild.o: CommentCommandList.inc.h
-ValueObjectChild.o: DeclNodes.inc.h
ValueObjectChild.o: DiagnosticCommonKinds.inc.h
-ValueObjectChild.o: StmtNodes.inc.h
-ValueObjectChild.po: CommentCommandList.inc.h
-ValueObjectChild.po: DeclNodes.inc.h
ValueObjectChild.po: DiagnosticCommonKinds.inc.h
-ValueObjectChild.po: StmtNodes.inc.h
-ValueObjectConstResult.o: CommentCommandList.inc.h
-ValueObjectConstResult.o: DeclNodes.inc.h
ValueObjectConstResult.o: DiagnosticCommonKinds.inc.h
-ValueObjectConstResult.o: StmtNodes.inc.h
-ValueObjectConstResult.po: CommentCommandList.inc.h
-ValueObjectConstResult.po: DeclNodes.inc.h
ValueObjectConstResult.po: DiagnosticCommonKinds.inc.h
-ValueObjectConstResult.po: StmtNodes.inc.h
ValueObjectConstResultChild.o: CommentCommandList.inc.h
ValueObjectConstResultChild.o: DeclNodes.inc.h
ValueObjectConstResultChild.o: DiagnosticCommonKinds.inc.h
@@ -242,32 +108,14 @@ ValueObjectConstResultChild.po: CommentCommandList.inc.h
ValueObjectConstResultChild.po: DeclNodes.inc.h
ValueObjectConstResultChild.po: DiagnosticCommonKinds.inc.h
ValueObjectConstResultChild.po: StmtNodes.inc.h
-ValueObjectConstResultImpl.o: CommentCommandList.inc.h
-ValueObjectConstResultImpl.o: DeclNodes.inc.h
ValueObjectConstResultImpl.o: DiagnosticCommonKinds.inc.h
-ValueObjectConstResultImpl.o: StmtNodes.inc.h
-ValueObjectConstResultImpl.po: CommentCommandList.inc.h
-ValueObjectConstResultImpl.po: DeclNodes.inc.h
ValueObjectConstResultImpl.po: DiagnosticCommonKinds.inc.h
-ValueObjectConstResultImpl.po: StmtNodes.inc.h
-ValueObjectDynamicValue.o: CommentCommandList.inc.h
-ValueObjectDynamicValue.o: DeclNodes.inc.h
ValueObjectDynamicValue.o: DiagnosticCommonKinds.inc.h
-ValueObjectDynamicValue.o: StmtNodes.inc.h
-ValueObjectDynamicValue.po: CommentCommandList.inc.h
-ValueObjectDynamicValue.po: DeclNodes.inc.h
ValueObjectDynamicValue.po: DiagnosticCommonKinds.inc.h
-ValueObjectDynamicValue.po: StmtNodes.inc.h
ValueObjectList.o: DiagnosticCommonKinds.inc.h
ValueObjectList.po: DiagnosticCommonKinds.inc.h
-ValueObjectMemory.o: CommentCommandList.inc.h
-ValueObjectMemory.o: DeclNodes.inc.h
ValueObjectMemory.o: DiagnosticCommonKinds.inc.h
-ValueObjectMemory.o: StmtNodes.inc.h
-ValueObjectMemory.po: CommentCommandList.inc.h
-ValueObjectMemory.po: DeclNodes.inc.h
ValueObjectMemory.po: DiagnosticCommonKinds.inc.h
-ValueObjectMemory.po: StmtNodes.inc.h
ValueObjectRegister.o: CommentCommandList.inc.h
ValueObjectRegister.o: DeclNodes.inc.h
ValueObjectRegister.o: DiagnosticCommonKinds.inc.h
@@ -278,12 +126,6 @@ ValueObjectRegister.po: DiagnosticCommonKinds.inc.h
ValueObjectRegister.po: StmtNodes.inc.h
ValueObjectSyntheticFilter.o: DiagnosticCommonKinds.inc.h
ValueObjectSyntheticFilter.po: DiagnosticCommonKinds.inc.h
-ValueObjectVariable.o: CommentCommandList.inc.h
-ValueObjectVariable.o: DeclNodes.inc.h
ValueObjectVariable.o: DiagnosticCommonKinds.inc.h
-ValueObjectVariable.o: StmtNodes.inc.h
-ValueObjectVariable.po: CommentCommandList.inc.h
-ValueObjectVariable.po: DeclNodes.inc.h
ValueObjectVariable.po: DiagnosticCommonKinds.inc.h
-ValueObjectVariable.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbDataFormatters/Makefile.depend b/lib/clang/liblldbDataFormatters/Makefile.depend
index e35e5d7..951ee74 100644
--- a/lib/clang/liblldbDataFormatters/Makefile.depend
+++ b/lib/clang/liblldbDataFormatters/Makefile.depend
@@ -65,14 +65,10 @@ FormatManager.po: CommentCommandList.inc.h
FormatManager.po: DeclNodes.inc.h
FormatManager.po: DiagnosticCommonKinds.inc.h
FormatManager.po: StmtNodes.inc.h
-LibCxx.o: AttrList.inc.h
-LibCxx.o: Attrs.inc.h
LibCxx.o: CommentCommandList.inc.h
LibCxx.o: DeclNodes.inc.h
LibCxx.o: DiagnosticCommonKinds.inc.h
LibCxx.o: StmtNodes.inc.h
-LibCxx.po: AttrList.inc.h
-LibCxx.po: Attrs.inc.h
LibCxx.po: CommentCommandList.inc.h
LibCxx.po: DeclNodes.inc.h
LibCxx.po: DiagnosticCommonKinds.inc.h
@@ -161,18 +157,8 @@ NSSet.po: CommentCommandList.inc.h
NSSet.po: DeclNodes.inc.h
NSSet.po: DiagnosticCommonKinds.inc.h
NSSet.po: StmtNodes.inc.h
-StringPrinter.o: AttrList.inc.h
-StringPrinter.o: Attrs.inc.h
-StringPrinter.o: CommentCommandList.inc.h
-StringPrinter.o: DeclNodes.inc.h
StringPrinter.o: DiagnosticCommonKinds.inc.h
-StringPrinter.o: StmtNodes.inc.h
-StringPrinter.po: AttrList.inc.h
-StringPrinter.po: Attrs.inc.h
-StringPrinter.po: CommentCommandList.inc.h
-StringPrinter.po: DeclNodes.inc.h
StringPrinter.po: DiagnosticCommonKinds.inc.h
-StringPrinter.po: StmtNodes.inc.h
TypeCategory.o: AttrList.inc.h
TypeCategory.o: Attrs.inc.h
TypeCategory.o: CommentCommandList.inc.h
@@ -209,30 +195,10 @@ TypeFormat.po: CommentCommandList.inc.h
TypeFormat.po: DeclNodes.inc.h
TypeFormat.po: DiagnosticCommonKinds.inc.h
TypeFormat.po: StmtNodes.inc.h
-TypeSummary.o: AttrList.inc.h
-TypeSummary.o: Attrs.inc.h
-TypeSummary.o: CommentCommandList.inc.h
-TypeSummary.o: DeclNodes.inc.h
TypeSummary.o: DiagnosticCommonKinds.inc.h
-TypeSummary.o: StmtNodes.inc.h
-TypeSummary.po: AttrList.inc.h
-TypeSummary.po: Attrs.inc.h
-TypeSummary.po: CommentCommandList.inc.h
-TypeSummary.po: DeclNodes.inc.h
TypeSummary.po: DiagnosticCommonKinds.inc.h
-TypeSummary.po: StmtNodes.inc.h
-TypeSynthetic.o: AttrList.inc.h
-TypeSynthetic.o: Attrs.inc.h
-TypeSynthetic.o: CommentCommandList.inc.h
-TypeSynthetic.o: DeclNodes.inc.h
TypeSynthetic.o: DiagnosticCommonKinds.inc.h
-TypeSynthetic.o: StmtNodes.inc.h
-TypeSynthetic.po: AttrList.inc.h
-TypeSynthetic.po: Attrs.inc.h
-TypeSynthetic.po: CommentCommandList.inc.h
-TypeSynthetic.po: DeclNodes.inc.h
TypeSynthetic.po: DiagnosticCommonKinds.inc.h
-TypeSynthetic.po: StmtNodes.inc.h
ValueObjectPrinter.o: AttrList.inc.h
ValueObjectPrinter.o: Attrs.inc.h
ValueObjectPrinter.o: CommentCommandList.inc.h
@@ -245,4 +211,12 @@ ValueObjectPrinter.po: CommentCommandList.inc.h
ValueObjectPrinter.po: DeclNodes.inc.h
ValueObjectPrinter.po: DiagnosticCommonKinds.inc.h
ValueObjectPrinter.po: StmtNodes.inc.h
+VectorType.o: CommentCommandList.inc.h
+VectorType.o: DeclNodes.inc.h
+VectorType.o: DiagnosticCommonKinds.inc.h
+VectorType.o: StmtNodes.inc.h
+VectorType.po: CommentCommandList.inc.h
+VectorType.po: DeclNodes.inc.h
+VectorType.po: DiagnosticCommonKinds.inc.h
+VectorType.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbExpression/Makefile.depend b/lib/clang/liblldbExpression/Makefile.depend
index e7aa336..097e8f7 100644
--- a/lib/clang/liblldbExpression/Makefile.depend
+++ b/lib/clang/liblldbExpression/Makefile.depend
@@ -78,15 +78,11 @@ ClangExpressionDeclMap.po: CommentCommandList.inc.h
ClangExpressionDeclMap.po: DeclNodes.inc.h
ClangExpressionDeclMap.po: DiagnosticCommonKinds.inc.h
ClangExpressionDeclMap.po: StmtNodes.inc.h
-ClangExpressionParser.o: AttrList.inc.h
-ClangExpressionParser.o: Attrs.inc.h
ClangExpressionParser.o: CommentCommandList.inc.h
ClangExpressionParser.o: DeclNodes.inc.h
ClangExpressionParser.o: DiagnosticCommonKinds.inc.h
ClangExpressionParser.o: DiagnosticFrontendKinds.inc.h
ClangExpressionParser.o: StmtNodes.inc.h
-ClangExpressionParser.po: AttrList.inc.h
-ClangExpressionParser.po: Attrs.inc.h
ClangExpressionParser.po: CommentCommandList.inc.h
ClangExpressionParser.po: DeclNodes.inc.h
ClangExpressionParser.po: DiagnosticCommonKinds.inc.h
@@ -140,14 +136,10 @@ ClangUserExpression.po: CommentCommandList.inc.h
ClangUserExpression.po: DeclNodes.inc.h
ClangUserExpression.po: DiagnosticCommonKinds.inc.h
ClangUserExpression.po: StmtNodes.inc.h
-ClangUtilityFunction.o: CommentCommandList.inc.h
ClangUtilityFunction.o: DeclNodes.inc.h
ClangUtilityFunction.o: DiagnosticCommonKinds.inc.h
-ClangUtilityFunction.o: StmtNodes.inc.h
-ClangUtilityFunction.po: CommentCommandList.inc.h
ClangUtilityFunction.po: DeclNodes.inc.h
ClangUtilityFunction.po: DiagnosticCommonKinds.inc.h
-ClangUtilityFunction.po: StmtNodes.inc.h
DWARFExpression.o: DeclNodes.inc.h
DWARFExpression.o: DiagnosticCommonKinds.inc.h
DWARFExpression.po: DeclNodes.inc.h
@@ -156,18 +148,8 @@ ExpressionSourceCode.o: DiagnosticCommonKinds.inc.h
ExpressionSourceCode.po: DiagnosticCommonKinds.inc.h
IRDynamicChecks.o: DiagnosticCommonKinds.inc.h
IRDynamicChecks.po: DiagnosticCommonKinds.inc.h
-IRExecutionUnit.o: AttrList.inc.h
-IRExecutionUnit.o: Attrs.inc.h
-IRExecutionUnit.o: CommentCommandList.inc.h
-IRExecutionUnit.o: DeclNodes.inc.h
IRExecutionUnit.o: DiagnosticCommonKinds.inc.h
-IRExecutionUnit.o: StmtNodes.inc.h
-IRExecutionUnit.po: AttrList.inc.h
-IRExecutionUnit.po: Attrs.inc.h
-IRExecutionUnit.po: CommentCommandList.inc.h
-IRExecutionUnit.po: DeclNodes.inc.h
IRExecutionUnit.po: DiagnosticCommonKinds.inc.h
-IRExecutionUnit.po: StmtNodes.inc.h
IRForTarget.o: CommentCommandList.inc.h
IRForTarget.o: DeclNodes.inc.h
IRForTarget.o: DiagnosticCommonKinds.inc.h
@@ -182,8 +164,6 @@ IRInterpreter.o: DiagnosticCommonKinds.inc.h
IRInterpreter.o: Intrinsics.inc.h
IRInterpreter.po: DiagnosticCommonKinds.inc.h
IRInterpreter.po: Intrinsics.inc.h
-IRMemoryMap.o: DiagnosticCommonKinds.inc.h
-IRMemoryMap.po: DiagnosticCommonKinds.inc.h
Materializer.o: CommentCommandList.inc.h
Materializer.o: DeclNodes.inc.h
Materializer.o: DiagnosticCommonKinds.inc.h
diff --git a/lib/clang/liblldbHostCommon/Makefile.depend b/lib/clang/liblldbHostCommon/Makefile.depend
index 4ad7db2..62a1e0a 100644
--- a/lib/clang/liblldbHostCommon/Makefile.depend
+++ b/lib/clang/liblldbHostCommon/Makefile.depend
@@ -15,32 +15,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-Host.o: AttrList.inc.h
-Host.o: Attrs.inc.h
-Host.o: CommentCommandList.inc.h
-Host.o: DeclNodes.inc.h
-Host.o: DiagnosticCommonKinds.inc.h
-Host.o: StmtNodes.inc.h
-Host.po: AttrList.inc.h
-Host.po: Attrs.inc.h
-Host.po: CommentCommandList.inc.h
-Host.po: DeclNodes.inc.h
-Host.po: DiagnosticCommonKinds.inc.h
-Host.po: StmtNodes.inc.h
-MonitoringProcessLauncher.o: CommentCommandList.inc.h
-MonitoringProcessLauncher.o: DeclNodes.inc.h
-MonitoringProcessLauncher.o: DiagnosticCommonKinds.inc.h
-MonitoringProcessLauncher.o: StmtNodes.inc.h
-MonitoringProcessLauncher.po: CommentCommandList.inc.h
-MonitoringProcessLauncher.po: DeclNodes.inc.h
-MonitoringProcessLauncher.po: DiagnosticCommonKinds.inc.h
-MonitoringProcessLauncher.po: StmtNodes.inc.h
-Symbols.o: CommentCommandList.inc.h
-Symbols.o: DeclNodes.inc.h
-Symbols.o: DiagnosticCommonKinds.inc.h
-Symbols.o: StmtNodes.inc.h
-Symbols.po: CommentCommandList.inc.h
-Symbols.po: DeclNodes.inc.h
-Symbols.po: DiagnosticCommonKinds.inc.h
-Symbols.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbHostFreeBSD/Makefile.depend b/lib/clang/liblldbHostFreeBSD/Makefile.depend
index 5bd9586..1b6ca89 100644
--- a/lib/clang/liblldbHostFreeBSD/Makefile.depend
+++ b/lib/clang/liblldbHostFreeBSD/Makefile.depend
@@ -14,12 +14,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-Host.o: CommentCommandList.inc.h
-Host.o: DeclNodes.inc.h
-Host.o: DiagnosticCommonKinds.inc.h
-Host.o: StmtNodes.inc.h
-Host.po: CommentCommandList.inc.h
-Host.po: DeclNodes.inc.h
-Host.po: DiagnosticCommonKinds.inc.h
-Host.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbInitialization/Makefile.depend b/lib/clang/liblldbInitialization/Makefile.depend
new file mode 100644
index 0000000..3e7f3f5
--- /dev/null
+++ b/lib/clang/liblldbInitialization/Makefile.depend
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/liblldbInterpreter/Makefile.depend b/lib/clang/liblldbInterpreter/Makefile.depend
index 528ca90..c780fa8 100644
--- a/lib/clang/liblldbInterpreter/Makefile.depend
+++ b/lib/clang/liblldbInterpreter/Makefile.depend
@@ -26,18 +26,8 @@ Args.po: CommentCommandList.inc.h
Args.po: DeclNodes.inc.h
Args.po: DiagnosticCommonKinds.inc.h
Args.po: StmtNodes.inc.h
-CommandInterpreter.o: AttrList.inc.h
-CommandInterpreter.o: Attrs.inc.h
-CommandInterpreter.o: CommentCommandList.inc.h
-CommandInterpreter.o: DeclNodes.inc.h
CommandInterpreter.o: DiagnosticCommonKinds.inc.h
-CommandInterpreter.o: StmtNodes.inc.h
-CommandInterpreter.po: AttrList.inc.h
-CommandInterpreter.po: Attrs.inc.h
-CommandInterpreter.po: CommentCommandList.inc.h
-CommandInterpreter.po: DeclNodes.inc.h
CommandInterpreter.po: DiagnosticCommonKinds.inc.h
-CommandInterpreter.po: StmtNodes.inc.h
CommandObject.o: AttrList.inc.h
CommandObject.o: Attrs.inc.h
CommandObject.o: CommentCommandList.inc.h
@@ -50,18 +40,6 @@ CommandObject.po: CommentCommandList.inc.h
CommandObject.po: DeclNodes.inc.h
CommandObject.po: DiagnosticCommonKinds.inc.h
CommandObject.po: StmtNodes.inc.h
-CommandObjectRegexCommand.o: AttrList.inc.h
-CommandObjectRegexCommand.o: Attrs.inc.h
-CommandObjectRegexCommand.o: CommentCommandList.inc.h
-CommandObjectRegexCommand.o: DeclNodes.inc.h
-CommandObjectRegexCommand.o: DiagnosticCommonKinds.inc.h
-CommandObjectRegexCommand.o: StmtNodes.inc.h
-CommandObjectRegexCommand.po: AttrList.inc.h
-CommandObjectRegexCommand.po: Attrs.inc.h
-CommandObjectRegexCommand.po: CommentCommandList.inc.h
-CommandObjectRegexCommand.po: DeclNodes.inc.h
-CommandObjectRegexCommand.po: DiagnosticCommonKinds.inc.h
-CommandObjectRegexCommand.po: StmtNodes.inc.h
CommandObjectScript.o: AttrList.inc.h
CommandObjectScript.o: Attrs.inc.h
CommandObjectScript.o: CommentCommandList.inc.h
@@ -74,54 +52,8 @@ CommandObjectScript.po: CommentCommandList.inc.h
CommandObjectScript.po: DeclNodes.inc.h
CommandObjectScript.po: DiagnosticCommonKinds.inc.h
CommandObjectScript.po: StmtNodes.inc.h
-CommandOptionValidators.o: AttrList.inc.h
-CommandOptionValidators.o: Attrs.inc.h
-CommandOptionValidators.o: CommentCommandList.inc.h
-CommandOptionValidators.o: DeclNodes.inc.h
-CommandOptionValidators.o: DiagnosticCommonKinds.inc.h
-CommandOptionValidators.o: StmtNodes.inc.h
-CommandOptionValidators.po: AttrList.inc.h
-CommandOptionValidators.po: Attrs.inc.h
-CommandOptionValidators.po: CommentCommandList.inc.h
-CommandOptionValidators.po: DeclNodes.inc.h
-CommandOptionValidators.po: DiagnosticCommonKinds.inc.h
-CommandOptionValidators.po: StmtNodes.inc.h
-OptionGroupFormat.o: AttrList.inc.h
-OptionGroupFormat.o: Attrs.inc.h
-OptionGroupFormat.o: CommentCommandList.inc.h
-OptionGroupFormat.o: DeclNodes.inc.h
-OptionGroupFormat.o: DiagnosticCommonKinds.inc.h
-OptionGroupFormat.o: StmtNodes.inc.h
-OptionGroupFormat.po: AttrList.inc.h
-OptionGroupFormat.po: Attrs.inc.h
-OptionGroupFormat.po: CommentCommandList.inc.h
-OptionGroupFormat.po: DeclNodes.inc.h
-OptionGroupFormat.po: DiagnosticCommonKinds.inc.h
-OptionGroupFormat.po: StmtNodes.inc.h
-OptionGroupPlatform.o: AttrList.inc.h
-OptionGroupPlatform.o: Attrs.inc.h
-OptionGroupPlatform.o: CommentCommandList.inc.h
-OptionGroupPlatform.o: DeclNodes.inc.h
-OptionGroupPlatform.o: DiagnosticCommonKinds.inc.h
-OptionGroupPlatform.o: StmtNodes.inc.h
-OptionGroupPlatform.po: AttrList.inc.h
-OptionGroupPlatform.po: Attrs.inc.h
-OptionGroupPlatform.po: CommentCommandList.inc.h
-OptionGroupPlatform.po: DeclNodes.inc.h
-OptionGroupPlatform.po: DiagnosticCommonKinds.inc.h
-OptionGroupPlatform.po: StmtNodes.inc.h
-OptionGroupValueObjectDisplay.o: AttrList.inc.h
-OptionGroupValueObjectDisplay.o: Attrs.inc.h
-OptionGroupValueObjectDisplay.o: CommentCommandList.inc.h
-OptionGroupValueObjectDisplay.o: DeclNodes.inc.h
OptionGroupValueObjectDisplay.o: DiagnosticCommonKinds.inc.h
-OptionGroupValueObjectDisplay.o: StmtNodes.inc.h
-OptionGroupValueObjectDisplay.po: AttrList.inc.h
-OptionGroupValueObjectDisplay.po: Attrs.inc.h
-OptionGroupValueObjectDisplay.po: CommentCommandList.inc.h
-OptionGroupValueObjectDisplay.po: DeclNodes.inc.h
OptionGroupValueObjectDisplay.po: DiagnosticCommonKinds.inc.h
-OptionGroupValueObjectDisplay.po: StmtNodes.inc.h
OptionGroupVariable.o: AttrList.inc.h
OptionGroupVariable.o: Attrs.inc.h
OptionGroupVariable.o: CommentCommandList.inc.h
@@ -182,52 +114,18 @@ OptionValueFormat.po: CommentCommandList.inc.h
OptionValueFormat.po: DeclNodes.inc.h
OptionValueFormat.po: DiagnosticCommonKinds.inc.h
OptionValueFormat.po: StmtNodes.inc.h
-OptionValueUUID.o: AttrList.inc.h
-OptionValueUUID.o: Attrs.inc.h
-OptionValueUUID.o: CommentCommandList.inc.h
-OptionValueUUID.o: DeclNodes.inc.h
-OptionValueUUID.o: DiagnosticCommonKinds.inc.h
-OptionValueUUID.o: StmtNodes.inc.h
-OptionValueUUID.po: AttrList.inc.h
-OptionValueUUID.po: Attrs.inc.h
-OptionValueUUID.po: CommentCommandList.inc.h
-OptionValueUUID.po: DeclNodes.inc.h
-OptionValueUUID.po: DiagnosticCommonKinds.inc.h
-OptionValueUUID.po: StmtNodes.inc.h
-Options.o: AttrList.inc.h
-Options.o: Attrs.inc.h
-Options.o: CommentCommandList.inc.h
-Options.o: DeclNodes.inc.h
-Options.o: DiagnosticCommonKinds.inc.h
-Options.o: StmtNodes.inc.h
-Options.po: AttrList.inc.h
-Options.po: Attrs.inc.h
-Options.po: CommentCommandList.inc.h
-Options.po: DeclNodes.inc.h
-Options.po: DiagnosticCommonKinds.inc.h
-Options.po: StmtNodes.inc.h
-Property.o: AttrList.inc.h
-Property.o: Attrs.inc.h
-Property.o: CommentCommandList.inc.h
-Property.o: DeclNodes.inc.h
+OptionValueLanguage.o: AttrList.inc.h
+OptionValueLanguage.o: Attrs.inc.h
+OptionValueLanguage.o: CommentCommandList.inc.h
+OptionValueLanguage.o: DeclNodes.inc.h
+OptionValueLanguage.o: DiagnosticCommonKinds.inc.h
+OptionValueLanguage.o: StmtNodes.inc.h
+OptionValueLanguage.po: AttrList.inc.h
+OptionValueLanguage.po: Attrs.inc.h
+OptionValueLanguage.po: CommentCommandList.inc.h
+OptionValueLanguage.po: DeclNodes.inc.h
+OptionValueLanguage.po: DiagnosticCommonKinds.inc.h
+OptionValueLanguage.po: StmtNodes.inc.h
Property.o: DiagnosticCommonKinds.inc.h
-Property.o: StmtNodes.inc.h
-Property.po: AttrList.inc.h
-Property.po: Attrs.inc.h
-Property.po: CommentCommandList.inc.h
-Property.po: DeclNodes.inc.h
Property.po: DiagnosticCommonKinds.inc.h
-Property.po: StmtNodes.inc.h
-ScriptInterpreterNone.o: AttrList.inc.h
-ScriptInterpreterNone.o: Attrs.inc.h
-ScriptInterpreterNone.o: CommentCommandList.inc.h
-ScriptInterpreterNone.o: DeclNodes.inc.h
-ScriptInterpreterNone.o: DiagnosticCommonKinds.inc.h
-ScriptInterpreterNone.o: StmtNodes.inc.h
-ScriptInterpreterNone.po: AttrList.inc.h
-ScriptInterpreterNone.po: Attrs.inc.h
-ScriptInterpreterNone.po: CommentCommandList.inc.h
-ScriptInterpreterNone.po: DeclNodes.inc.h
-ScriptInterpreterNone.po: DiagnosticCommonKinds.inc.h
-ScriptInterpreterNone.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginABISysV_arm/Makefile.depend b/lib/clang/liblldbPluginABISysV_arm/Makefile.depend
new file mode 100644
index 0000000..a5e736f
--- /dev/null
+++ b/lib/clang/liblldbPluginABISysV_arm/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ABISysV_arm.o: CommentCommandList.inc.h
+ABISysV_arm.o: DeclNodes.inc.h
+ABISysV_arm.o: DiagnosticCommonKinds.inc.h
+ABISysV_arm.o: StmtNodes.inc.h
+ABISysV_arm.po: CommentCommandList.inc.h
+ABISysV_arm.po: DeclNodes.inc.h
+ABISysV_arm.po: DiagnosticCommonKinds.inc.h
+ABISysV_arm.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/liblldbPluginABISysV_arm64/Makefile.depend b/lib/clang/liblldbPluginABISysV_arm64/Makefile.depend
new file mode 100644
index 0000000..90d6b63
--- /dev/null
+++ b/lib/clang/liblldbPluginABISysV_arm64/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ABISysV_arm64.o: CommentCommandList.inc.h
+ABISysV_arm64.o: DeclNodes.inc.h
+ABISysV_arm64.o: DiagnosticCommonKinds.inc.h
+ABISysV_arm64.o: StmtNodes.inc.h
+ABISysV_arm64.po: CommentCommandList.inc.h
+ABISysV_arm64.po: DeclNodes.inc.h
+ABISysV_arm64.po: DiagnosticCommonKinds.inc.h
+ABISysV_arm64.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/liblldbPluginABISysV_i386/Makefile.depend b/lib/clang/liblldbPluginABISysV_i386/Makefile.depend
new file mode 100644
index 0000000..c7685d3
--- /dev/null
+++ b/lib/clang/liblldbPluginABISysV_i386/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ABISysV_i386.o: CommentCommandList.inc.h
+ABISysV_i386.o: DeclNodes.inc.h
+ABISysV_i386.o: DiagnosticCommonKinds.inc.h
+ABISysV_i386.o: StmtNodes.inc.h
+ABISysV_i386.po: CommentCommandList.inc.h
+ABISysV_i386.po: DeclNodes.inc.h
+ABISysV_i386.po: DiagnosticCommonKinds.inc.h
+ABISysV_i386.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/liblldbPluginABISysV_mips/Makefile.depend b/lib/clang/liblldbPluginABISysV_mips/Makefile.depend
new file mode 100644
index 0000000..00072db
--- /dev/null
+++ b/lib/clang/liblldbPluginABISysV_mips/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ABISysV_mips.o: CommentCommandList.inc.h
+ABISysV_mips.o: DeclNodes.inc.h
+ABISysV_mips.o: DiagnosticCommonKinds.inc.h
+ABISysV_mips.o: StmtNodes.inc.h
+ABISysV_mips.po: CommentCommandList.inc.h
+ABISysV_mips.po: DeclNodes.inc.h
+ABISysV_mips.po: DiagnosticCommonKinds.inc.h
+ABISysV_mips.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/liblldbPluginABISysV_mips64/Makefile.depend b/lib/clang/liblldbPluginABISysV_mips64/Makefile.depend
new file mode 100644
index 0000000..49c95aa
--- /dev/null
+++ b/lib/clang/liblldbPluginABISysV_mips64/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+ABISysV_mips64.o: CommentCommandList.inc.h
+ABISysV_mips64.o: DeclNodes.inc.h
+ABISysV_mips64.o: DiagnosticCommonKinds.inc.h
+ABISysV_mips64.o: StmtNodes.inc.h
+ABISysV_mips64.po: CommentCommandList.inc.h
+ABISysV_mips64.po: DeclNodes.inc.h
+ABISysV_mips64.po: DiagnosticCommonKinds.inc.h
+ABISysV_mips64.po: StmtNodes.inc.h
+.endif
diff --git a/lib/clang/liblldbPluginDisassemblerLLVM/Makefile.depend b/lib/clang/liblldbPluginDisassemblerLLVM/Makefile.depend
index 7e043ab..264ede1 100644
--- a/lib/clang/liblldbPluginDisassemblerLLVM/Makefile.depend
+++ b/lib/clang/liblldbPluginDisassemblerLLVM/Makefile.depend
@@ -13,12 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-DisassemblerLLVMC.o: CommentCommandList.inc.h
-DisassemblerLLVMC.o: DeclNodes.inc.h
-DisassemblerLLVMC.o: DiagnosticCommonKinds.inc.h
-DisassemblerLLVMC.o: StmtNodes.inc.h
-DisassemblerLLVMC.po: CommentCommandList.inc.h
-DisassemblerLLVMC.po: DeclNodes.inc.h
-DisassemblerLLVMC.po: DiagnosticCommonKinds.inc.h
-DisassemblerLLVMC.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginDynamicLoaderPosixDYLD/Makefile.depend b/lib/clang/liblldbPluginDynamicLoaderPosixDYLD/Makefile.depend
index 1f641be..b3a3a61 100644
--- a/lib/clang/liblldbPluginDynamicLoaderPosixDYLD/Makefile.depend
+++ b/lib/clang/liblldbPluginDynamicLoaderPosixDYLD/Makefile.depend
@@ -13,22 +13,6 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-AuxVector.o: DiagnosticCommonKinds.inc.h
-AuxVector.po: DiagnosticCommonKinds.inc.h
-DYLDRendezvous.o: CommentCommandList.inc.h
-DYLDRendezvous.o: DeclNodes.inc.h
-DYLDRendezvous.o: DiagnosticCommonKinds.inc.h
-DYLDRendezvous.o: StmtNodes.inc.h
-DYLDRendezvous.po: CommentCommandList.inc.h
-DYLDRendezvous.po: DeclNodes.inc.h
-DYLDRendezvous.po: DiagnosticCommonKinds.inc.h
-DYLDRendezvous.po: StmtNodes.inc.h
-DynamicLoaderPOSIXDYLD.o: CommentCommandList.inc.h
-DynamicLoaderPOSIXDYLD.o: DeclNodes.inc.h
DynamicLoaderPOSIXDYLD.o: DiagnosticCommonKinds.inc.h
-DynamicLoaderPOSIXDYLD.o: StmtNodes.inc.h
-DynamicLoaderPOSIXDYLD.po: CommentCommandList.inc.h
-DynamicLoaderPOSIXDYLD.po: DeclNodes.inc.h
DynamicLoaderPOSIXDYLD.po: DiagnosticCommonKinds.inc.h
-DynamicLoaderPOSIXDYLD.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginDynamicLoaderStatic/Makefile.depend b/lib/clang/liblldbPluginDynamicLoaderStatic/Makefile.depend
index 74529c2..264ede1 100644
--- a/lib/clang/liblldbPluginDynamicLoaderStatic/Makefile.depend
+++ b/lib/clang/liblldbPluginDynamicLoaderStatic/Makefile.depend
@@ -13,12 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-DynamicLoaderStatic.o: CommentCommandList.inc.h
-DynamicLoaderStatic.o: DeclNodes.inc.h
-DynamicLoaderStatic.o: DiagnosticCommonKinds.inc.h
-DynamicLoaderStatic.o: StmtNodes.inc.h
-DynamicLoaderStatic.po: CommentCommandList.inc.h
-DynamicLoaderStatic.po: DeclNodes.inc.h
-DynamicLoaderStatic.po: DiagnosticCommonKinds.inc.h
-DynamicLoaderStatic.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginInstructionMIPS/Makefile.depend b/lib/clang/liblldbPluginInstructionMIPS/Makefile.depend
new file mode 100644
index 0000000..264ede1
--- /dev/null
+++ b/lib/clang/liblldbPluginInstructionMIPS/Makefile.depend
@@ -0,0 +1,16 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/liblldbPluginInstructionMIPS64/Makefile.depend b/lib/clang/liblldbPluginInstructionMIPS64/Makefile.depend
new file mode 100644
index 0000000..264ede1
--- /dev/null
+++ b/lib/clang/liblldbPluginInstructionMIPS64/Makefile.depend
@@ -0,0 +1,16 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libc++ \
+ lib/msun \
+ usr.bin/clang/clang-tblgen.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile.depend b/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile.depend
index 12b075f..627c2cc 100644
--- a/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile.depend
+++ b/lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer/Makefile.depend
@@ -13,16 +13,6 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-AddressSanitizerRuntime.o: AttrList.inc.h
-AddressSanitizerRuntime.o: Attrs.inc.h
-AddressSanitizerRuntime.o: CommentCommandList.inc.h
-AddressSanitizerRuntime.o: DeclNodes.inc.h
AddressSanitizerRuntime.o: DiagnosticCommonKinds.inc.h
-AddressSanitizerRuntime.o: StmtNodes.inc.h
-AddressSanitizerRuntime.po: AttrList.inc.h
-AddressSanitizerRuntime.po: Attrs.inc.h
-AddressSanitizerRuntime.po: CommentCommandList.inc.h
-AddressSanitizerRuntime.po: DeclNodes.inc.h
AddressSanitizerRuntime.po: DiagnosticCommonKinds.inc.h
-AddressSanitizerRuntime.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginJITLoaderGDB/Makefile.depend b/lib/clang/liblldbPluginJITLoaderGDB/Makefile.depend
index fafe676..fc64e4a 100644
--- a/lib/clang/liblldbPluginJITLoaderGDB/Makefile.depend
+++ b/lib/clang/liblldbPluginJITLoaderGDB/Makefile.depend
@@ -13,12 +13,6 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-JITLoaderGDB.o: CommentCommandList.inc.h
-JITLoaderGDB.o: DeclNodes.inc.h
JITLoaderGDB.o: DiagnosticCommonKinds.inc.h
-JITLoaderGDB.o: StmtNodes.inc.h
-JITLoaderGDB.po: CommentCommandList.inc.h
-JITLoaderGDB.po: DeclNodes.inc.h
JITLoaderGDB.po: DiagnosticCommonKinds.inc.h
-JITLoaderGDB.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginMemoryHistoryASan/Makefile.depend b/lib/clang/liblldbPluginMemoryHistoryASan/Makefile.depend
index 19db265..c514f27 100644
--- a/lib/clang/liblldbPluginMemoryHistoryASan/Makefile.depend
+++ b/lib/clang/liblldbPluginMemoryHistoryASan/Makefile.depend
@@ -13,12 +13,6 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-MemoryHistoryASan.o: CommentCommandList.inc.h
-MemoryHistoryASan.o: DeclNodes.inc.h
MemoryHistoryASan.o: DiagnosticCommonKinds.inc.h
-MemoryHistoryASan.o: StmtNodes.inc.h
-MemoryHistoryASan.po: CommentCommandList.inc.h
-MemoryHistoryASan.po: DeclNodes.inc.h
MemoryHistoryASan.po: DiagnosticCommonKinds.inc.h
-MemoryHistoryASan.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginObjectContainerBSDArchive/Makefile.depend b/lib/clang/liblldbPluginObjectContainerBSDArchive/Makefile.depend
index 0f05ea5..264ede1 100644
--- a/lib/clang/liblldbPluginObjectContainerBSDArchive/Makefile.depend
+++ b/lib/clang/liblldbPluginObjectContainerBSDArchive/Makefile.depend
@@ -13,12 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-ObjectContainerBSDArchive.o: CommentCommandList.inc.h
-ObjectContainerBSDArchive.o: DeclNodes.inc.h
-ObjectContainerBSDArchive.o: DiagnosticCommonKinds.inc.h
-ObjectContainerBSDArchive.o: StmtNodes.inc.h
-ObjectContainerBSDArchive.po: CommentCommandList.inc.h
-ObjectContainerBSDArchive.po: DeclNodes.inc.h
-ObjectContainerBSDArchive.po: DiagnosticCommonKinds.inc.h
-ObjectContainerBSDArchive.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginObjectFileELF/Makefile.depend b/lib/clang/liblldbPluginObjectFileELF/Makefile.depend
index 6690c9f..264ede1 100644
--- a/lib/clang/liblldbPluginObjectFileELF/Makefile.depend
+++ b/lib/clang/liblldbPluginObjectFileELF/Makefile.depend
@@ -13,12 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-ObjectFileELF.o: CommentCommandList.inc.h
-ObjectFileELF.o: DeclNodes.inc.h
-ObjectFileELF.o: DiagnosticCommonKinds.inc.h
-ObjectFileELF.o: StmtNodes.inc.h
-ObjectFileELF.po: CommentCommandList.inc.h
-ObjectFileELF.po: DeclNodes.inc.h
-ObjectFileELF.po: DiagnosticCommonKinds.inc.h
-ObjectFileELF.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginObjectFileJIT/Makefile.depend b/lib/clang/liblldbPluginObjectFileJIT/Makefile.depend
index d5e55b1..264ede1 100644
--- a/lib/clang/liblldbPluginObjectFileJIT/Makefile.depend
+++ b/lib/clang/liblldbPluginObjectFileJIT/Makefile.depend
@@ -13,16 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-ObjectFileJIT.o: AttrList.inc.h
-ObjectFileJIT.o: Attrs.inc.h
-ObjectFileJIT.o: CommentCommandList.inc.h
-ObjectFileJIT.o: DeclNodes.inc.h
-ObjectFileJIT.o: DiagnosticCommonKinds.inc.h
-ObjectFileJIT.o: StmtNodes.inc.h
-ObjectFileJIT.po: AttrList.inc.h
-ObjectFileJIT.po: Attrs.inc.h
-ObjectFileJIT.po: CommentCommandList.inc.h
-ObjectFileJIT.po: DeclNodes.inc.h
-ObjectFileJIT.po: DiagnosticCommonKinds.inc.h
-ObjectFileJIT.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginPlatformFreeBSD/Makefile.depend b/lib/clang/liblldbPluginPlatformFreeBSD/Makefile.depend
index e4c467b..264ede1 100644
--- a/lib/clang/liblldbPluginPlatformFreeBSD/Makefile.depend
+++ b/lib/clang/liblldbPluginPlatformFreeBSD/Makefile.depend
@@ -13,16 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-PlatformFreeBSD.o: AttrList.inc.h
-PlatformFreeBSD.o: Attrs.inc.h
-PlatformFreeBSD.o: CommentCommandList.inc.h
-PlatformFreeBSD.o: DeclNodes.inc.h
-PlatformFreeBSD.o: DiagnosticCommonKinds.inc.h
-PlatformFreeBSD.o: StmtNodes.inc.h
-PlatformFreeBSD.po: AttrList.inc.h
-PlatformFreeBSD.po: Attrs.inc.h
-PlatformFreeBSD.po: CommentCommandList.inc.h
-PlatformFreeBSD.po: DeclNodes.inc.h
-PlatformFreeBSD.po: DiagnosticCommonKinds.inc.h
-PlatformFreeBSD.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginPlatformGDB/Makefile.depend b/lib/clang/liblldbPluginPlatformGDB/Makefile.depend
index 114af26..264ede1 100644
--- a/lib/clang/liblldbPluginPlatformGDB/Makefile.depend
+++ b/lib/clang/liblldbPluginPlatformGDB/Makefile.depend
@@ -13,16 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-PlatformRemoteGDBServer.o: AttrList.inc.h
-PlatformRemoteGDBServer.o: Attrs.inc.h
-PlatformRemoteGDBServer.o: CommentCommandList.inc.h
-PlatformRemoteGDBServer.o: DeclNodes.inc.h
-PlatformRemoteGDBServer.o: DiagnosticCommonKinds.inc.h
-PlatformRemoteGDBServer.o: StmtNodes.inc.h
-PlatformRemoteGDBServer.po: AttrList.inc.h
-PlatformRemoteGDBServer.po: Attrs.inc.h
-PlatformRemoteGDBServer.po: CommentCommandList.inc.h
-PlatformRemoteGDBServer.po: DeclNodes.inc.h
-PlatformRemoteGDBServer.po: DiagnosticCommonKinds.inc.h
-PlatformRemoteGDBServer.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginProcessElfCore/Makefile.depend b/lib/clang/liblldbPluginProcessElfCore/Makefile.depend
index 3714330..264ede1 100644
--- a/lib/clang/liblldbPluginProcessElfCore/Makefile.depend
+++ b/lib/clang/liblldbPluginProcessElfCore/Makefile.depend
@@ -13,14 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-ProcessElfCore.o: CommentCommandList.inc.h
-ProcessElfCore.o: DeclNodes.inc.h
-ProcessElfCore.o: DiagnosticCommonKinds.inc.h
-ProcessElfCore.o: StmtNodes.inc.h
-ProcessElfCore.po: CommentCommandList.inc.h
-ProcessElfCore.po: DeclNodes.inc.h
-ProcessElfCore.po: DiagnosticCommonKinds.inc.h
-ProcessElfCore.po: StmtNodes.inc.h
-ThreadElfCore.o: DiagnosticCommonKinds.inc.h
-ThreadElfCore.po: DiagnosticCommonKinds.inc.h
.endif
diff --git a/lib/clang/liblldbPluginProcessFreeBSD/Makefile.depend b/lib/clang/liblldbPluginProcessFreeBSD/Makefile.depend
index 4b79ea4..a384d93 100644
--- a/lib/clang/liblldbPluginProcessFreeBSD/Makefile.depend
+++ b/lib/clang/liblldbPluginProcessFreeBSD/Makefile.depend
@@ -13,10 +13,8 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-FreeBSDThread.o: DiagnosticCommonKinds.inc.h
-FreeBSDThread.po: DiagnosticCommonKinds.inc.h
-ProcessFreeBSD.o: DiagnosticCommonKinds.inc.h
-ProcessFreeBSD.po: DiagnosticCommonKinds.inc.h
-ProcessMonitor.o: DiagnosticCommonKinds.inc.h
-ProcessMonitor.po: DiagnosticCommonKinds.inc.h
+POSIXThread.o: DiagnosticCommonKinds.inc.h
+POSIXThread.po: DiagnosticCommonKinds.inc.h
+ProcessPOSIX.o: DiagnosticCommonKinds.inc.h
+ProcessPOSIX.po: DiagnosticCommonKinds.inc.h
.endif
diff --git a/lib/clang/liblldbPluginProcessGDBRemote/Makefile.depend b/lib/clang/liblldbPluginProcessGDBRemote/Makefile.depend
index a8571b4..10a0dc2 100644
--- a/lib/clang/liblldbPluginProcessGDBRemote/Makefile.depend
+++ b/lib/clang/liblldbPluginProcessGDBRemote/Makefile.depend
@@ -13,24 +13,6 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-GDBRemoteCommunication.o: DiagnosticCommonKinds.inc.h
-GDBRemoteCommunication.po: DiagnosticCommonKinds.inc.h
-GDBRemoteCommunicationClient.o: DiagnosticCommonKinds.inc.h
-GDBRemoteCommunicationClient.po: DiagnosticCommonKinds.inc.h
-GDBRemoteCommunicationServer.o: AttrList.inc.h
-GDBRemoteCommunicationServer.o: Attrs.inc.h
-GDBRemoteCommunicationServer.o: CommentCommandList.inc.h
-GDBRemoteCommunicationServer.o: DeclNodes.inc.h
-GDBRemoteCommunicationServer.o: DiagnosticCommonKinds.inc.h
-GDBRemoteCommunicationServer.o: StmtNodes.inc.h
-GDBRemoteCommunicationServer.po: AttrList.inc.h
-GDBRemoteCommunicationServer.po: Attrs.inc.h
-GDBRemoteCommunicationServer.po: CommentCommandList.inc.h
-GDBRemoteCommunicationServer.po: DeclNodes.inc.h
-GDBRemoteCommunicationServer.po: DiagnosticCommonKinds.inc.h
-GDBRemoteCommunicationServer.po: StmtNodes.inc.h
-GDBRemoteRegisterContext.o: DiagnosticCommonKinds.inc.h
-GDBRemoteRegisterContext.po: DiagnosticCommonKinds.inc.h
ProcessGDBRemote.o: AttrList.inc.h
ProcessGDBRemote.o: Attrs.inc.h
ProcessGDBRemote.o: CommentCommandList.inc.h
@@ -43,8 +25,6 @@ ProcessGDBRemote.po: CommentCommandList.inc.h
ProcessGDBRemote.po: DeclNodes.inc.h
ProcessGDBRemote.po: DiagnosticCommonKinds.inc.h
ProcessGDBRemote.po: StmtNodes.inc.h
-ProcessGDBRemoteLog.o: DiagnosticCommonKinds.inc.h
-ProcessGDBRemoteLog.po: DiagnosticCommonKinds.inc.h
ThreadGDBRemote.o: DiagnosticCommonKinds.inc.h
ThreadGDBRemote.po: DiagnosticCommonKinds.inc.h
.endif
diff --git a/lib/clang/liblldbPluginProcessPOSIX/Makefile.depend b/lib/clang/liblldbPluginProcessPOSIX/Makefile.depend
index 6a083b8..264ede1 100644
--- a/lib/clang/liblldbPluginProcessPOSIX/Makefile.depend
+++ b/lib/clang/liblldbPluginProcessPOSIX/Makefile.depend
@@ -13,36 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-POSIXStopInfo.o: DiagnosticCommonKinds.inc.h
-POSIXStopInfo.po: DiagnosticCommonKinds.inc.h
-POSIXThread.o: AttrList.inc.h
-POSIXThread.o: Attrs.inc.h
-POSIXThread.o: CommentCommandList.inc.h
-POSIXThread.o: DeclNodes.inc.h
-POSIXThread.o: DiagnosticCommonKinds.inc.h
-POSIXThread.o: StmtNodes.inc.h
-POSIXThread.po: AttrList.inc.h
-POSIXThread.po: Attrs.inc.h
-POSIXThread.po: CommentCommandList.inc.h
-POSIXThread.po: DeclNodes.inc.h
-POSIXThread.po: DiagnosticCommonKinds.inc.h
-POSIXThread.po: StmtNodes.inc.h
-ProcessPOSIX.o: CommentCommandList.inc.h
-ProcessPOSIX.o: DeclNodes.inc.h
-ProcessPOSIX.o: DiagnosticCommonKinds.inc.h
-ProcessPOSIX.o: StmtNodes.inc.h
-ProcessPOSIX.po: CommentCommandList.inc.h
-ProcessPOSIX.po: DeclNodes.inc.h
-ProcessPOSIX.po: DiagnosticCommonKinds.inc.h
-ProcessPOSIX.po: StmtNodes.inc.h
-ProcessPOSIXLog.o: DiagnosticCommonKinds.inc.h
-ProcessPOSIXLog.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_arm64.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_arm64.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_mips64.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_mips64.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_powerpc.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_powerpc.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_x86.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIXProcessMonitor_x86.po: DiagnosticCommonKinds.inc.h
.endif
diff --git a/lib/clang/liblldbPluginProcessUtility/Makefile.depend b/lib/clang/liblldbPluginProcessUtility/Makefile.depend
index e9bd3c9..06a1433 100644
--- a/lib/clang/liblldbPluginProcessUtility/Makefile.depend
+++ b/lib/clang/liblldbPluginProcessUtility/Makefile.depend
@@ -25,10 +25,6 @@ DynamicRegisterInfo.po: CommentCommandList.inc.h
DynamicRegisterInfo.po: DeclNodes.inc.h
DynamicRegisterInfo.po: DiagnosticCommonKinds.inc.h
DynamicRegisterInfo.po: StmtNodes.inc.h
-HistoryThread.o: DiagnosticCommonKinds.inc.h
-HistoryThread.po: DiagnosticCommonKinds.inc.h
-HistoryUnwind.o: DiagnosticCommonKinds.inc.h
-HistoryUnwind.po: DiagnosticCommonKinds.inc.h
InferiorCallPOSIX.o: CommentCommandList.inc.h
InferiorCallPOSIX.o: DeclNodes.inc.h
InferiorCallPOSIX.o: DiagnosticCommonKinds.inc.h
@@ -37,54 +33,16 @@ InferiorCallPOSIX.po: CommentCommandList.inc.h
InferiorCallPOSIX.po: DeclNodes.inc.h
InferiorCallPOSIX.po: DiagnosticCommonKinds.inc.h
InferiorCallPOSIX.po: StmtNodes.inc.h
-RegisterContextDummy.o: CommentCommandList.inc.h
-RegisterContextDummy.o: DeclNodes.inc.h
RegisterContextDummy.o: DiagnosticCommonKinds.inc.h
-RegisterContextDummy.o: StmtNodes.inc.h
-RegisterContextDummy.po: CommentCommandList.inc.h
-RegisterContextDummy.po: DeclNodes.inc.h
RegisterContextDummy.po: DiagnosticCommonKinds.inc.h
-RegisterContextDummy.po: StmtNodes.inc.h
-RegisterContextHistory.o: CommentCommandList.inc.h
-RegisterContextHistory.o: DeclNodes.inc.h
RegisterContextHistory.o: DiagnosticCommonKinds.inc.h
-RegisterContextHistory.o: StmtNodes.inc.h
-RegisterContextHistory.po: CommentCommandList.inc.h
-RegisterContextHistory.po: DeclNodes.inc.h
RegisterContextHistory.po: DiagnosticCommonKinds.inc.h
-RegisterContextHistory.po: StmtNodes.inc.h
-RegisterContextLLDB.o: CommentCommandList.inc.h
-RegisterContextLLDB.o: DeclNodes.inc.h
RegisterContextLLDB.o: DiagnosticCommonKinds.inc.h
-RegisterContextLLDB.o: StmtNodes.inc.h
-RegisterContextLLDB.po: CommentCommandList.inc.h
-RegisterContextLLDB.po: DeclNodes.inc.h
RegisterContextLLDB.po: DiagnosticCommonKinds.inc.h
-RegisterContextLLDB.po: StmtNodes.inc.h
-RegisterContextMemory.o: DiagnosticCommonKinds.inc.h
-RegisterContextMemory.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_arm64.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_arm64.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_mips64.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_mips64.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_powerpc.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_powerpc.po: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_x86.o: DiagnosticCommonKinds.inc.h
-RegisterContextPOSIX_x86.po: DiagnosticCommonKinds.inc.h
-RegisterContextThreadMemory.o: DiagnosticCommonKinds.inc.h
-RegisterContextThreadMemory.po: DiagnosticCommonKinds.inc.h
StopInfoMachException.o: DiagnosticCommonKinds.inc.h
StopInfoMachException.po: DiagnosticCommonKinds.inc.h
-ThreadMemory.o: DiagnosticCommonKinds.inc.h
-ThreadMemory.po: DiagnosticCommonKinds.inc.h
-UnwindLLDB.o: CommentCommandList.inc.h
-UnwindLLDB.o: DeclNodes.inc.h
UnwindLLDB.o: DiagnosticCommonKinds.inc.h
-UnwindLLDB.o: StmtNodes.inc.h
-UnwindLLDB.po: CommentCommandList.inc.h
-UnwindLLDB.po: DeclNodes.inc.h
UnwindLLDB.po: DiagnosticCommonKinds.inc.h
-UnwindLLDB.po: StmtNodes.inc.h
UnwindMacOSXFrameBackchain.o: DiagnosticCommonKinds.inc.h
UnwindMacOSXFrameBackchain.po: DiagnosticCommonKinds.inc.h
.endif
diff --git a/lib/clang/liblldbPluginSymbolFileSymtab/Makefile.depend b/lib/clang/liblldbPluginSymbolFileSymtab/Makefile.depend
index f23a43d..4231228 100644
--- a/lib/clang/liblldbPluginSymbolFileSymtab/Makefile.depend
+++ b/lib/clang/liblldbPluginSymbolFileSymtab/Makefile.depend
@@ -13,12 +13,8 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-SymbolFileSymtab.o: CommentCommandList.inc.h
SymbolFileSymtab.o: DeclNodes.inc.h
SymbolFileSymtab.o: DiagnosticCommonKinds.inc.h
-SymbolFileSymtab.o: StmtNodes.inc.h
-SymbolFileSymtab.po: CommentCommandList.inc.h
SymbolFileSymtab.po: DeclNodes.inc.h
SymbolFileSymtab.po: DiagnosticCommonKinds.inc.h
-SymbolFileSymtab.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginSymbolVendorELF/Makefile.depend b/lib/clang/liblldbPluginSymbolVendorELF/Makefile.depend
index 9871a5f..810f65c 100644
--- a/lib/clang/liblldbPluginSymbolVendorELF/Makefile.depend
+++ b/lib/clang/liblldbPluginSymbolVendorELF/Makefile.depend
@@ -13,12 +13,6 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-SymbolVendorELF.o: CommentCommandList.inc.h
-SymbolVendorELF.o: DeclNodes.inc.h
SymbolVendorELF.o: DiagnosticCommonKinds.inc.h
-SymbolVendorELF.o: StmtNodes.inc.h
-SymbolVendorELF.po: CommentCommandList.inc.h
-SymbolVendorELF.po: DeclNodes.inc.h
SymbolVendorELF.po: DiagnosticCommonKinds.inc.h
-SymbolVendorELF.po: StmtNodes.inc.h
.endif
diff --git a/lib/clang/liblldbPluginUnwindAssemblyInstEmulation/Makefile.depend b/lib/clang/liblldbPluginUnwindAssemblyInstEmulation/Makefile.depend
index b8b6989..264ede1 100644
--- a/lib/clang/liblldbPluginUnwindAssemblyInstEmulation/Makefile.depend
+++ b/lib/clang/liblldbPluginUnwindAssemblyInstEmulation/Makefile.depend
@@ -13,6 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-UnwindAssemblyInstEmulation.o: DiagnosticCommonKinds.inc.h
-UnwindAssemblyInstEmulation.po: DiagnosticCommonKinds.inc.h
.endif
diff --git a/lib/clang/liblldbPluginUnwindAssemblyX86/Makefile.depend b/lib/clang/liblldbPluginUnwindAssemblyX86/Makefile.depend
index d01a053..264ede1 100644
--- a/lib/clang/liblldbPluginUnwindAssemblyX86/Makefile.depend
+++ b/lib/clang/liblldbPluginUnwindAssemblyX86/Makefile.depend
@@ -13,6 +13,4 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-UnwindAssembly-x86.o: DiagnosticCommonKinds.inc.h
-UnwindAssembly-x86.po: DiagnosticCommonKinds.inc.h
.endif
diff --git a/lib/clang/liblldbSymbol/Makefile.depend b/lib/clang/liblldbSymbol/Makefile.depend
index 486a3ae..aa337b3 100644
--- a/lib/clang/liblldbSymbol/Makefile.depend
+++ b/lib/clang/liblldbSymbol/Makefile.depend
@@ -13,14 +13,8 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-Block.o: CommentCommandList.inc.h
-Block.o: DeclNodes.inc.h
Block.o: DiagnosticCommonKinds.inc.h
-Block.o: StmtNodes.inc.h
-Block.po: CommentCommandList.inc.h
-Block.po: DeclNodes.inc.h
Block.po: DiagnosticCommonKinds.inc.h
-Block.po: StmtNodes.inc.h
ClangASTContext.o: AttrList.inc.h
ClangASTContext.o: Attrs.inc.h
ClangASTContext.o: CommentCommandList.inc.h
@@ -69,66 +63,18 @@ ClangNamespaceDecl.o: DeclNodes.inc.h
ClangNamespaceDecl.o: DiagnosticCommonKinds.inc.h
ClangNamespaceDecl.po: DeclNodes.inc.h
ClangNamespaceDecl.po: DiagnosticCommonKinds.inc.h
-CompactUnwindInfo.o: CommentCommandList.inc.h
-CompactUnwindInfo.o: DeclNodes.inc.h
-CompactUnwindInfo.o: DiagnosticCommonKinds.inc.h
-CompactUnwindInfo.o: StmtNodes.inc.h
-CompactUnwindInfo.po: CommentCommandList.inc.h
-CompactUnwindInfo.po: DeclNodes.inc.h
-CompactUnwindInfo.po: DiagnosticCommonKinds.inc.h
-CompactUnwindInfo.po: StmtNodes.inc.h
-CompileUnit.o: CommentCommandList.inc.h
-CompileUnit.o: DeclNodes.inc.h
CompileUnit.o: DiagnosticCommonKinds.inc.h
-CompileUnit.o: StmtNodes.inc.h
-CompileUnit.po: CommentCommandList.inc.h
-CompileUnit.po: DeclNodes.inc.h
CompileUnit.po: DiagnosticCommonKinds.inc.h
-CompileUnit.po: StmtNodes.inc.h
-DWARFCallFrameInfo.o: CommentCommandList.inc.h
-DWARFCallFrameInfo.o: DeclNodes.inc.h
-DWARFCallFrameInfo.o: DiagnosticCommonKinds.inc.h
-DWARFCallFrameInfo.o: StmtNodes.inc.h
-DWARFCallFrameInfo.po: CommentCommandList.inc.h
-DWARFCallFrameInfo.po: DeclNodes.inc.h
-DWARFCallFrameInfo.po: DiagnosticCommonKinds.inc.h
-DWARFCallFrameInfo.po: StmtNodes.inc.h
-FuncUnwinders.o: DiagnosticCommonKinds.inc.h
-FuncUnwinders.po: DiagnosticCommonKinds.inc.h
-Function.o: CommentCommandList.inc.h
-Function.o: DeclNodes.inc.h
Function.o: DiagnosticCommonKinds.inc.h
-Function.o: StmtNodes.inc.h
-Function.po: CommentCommandList.inc.h
-Function.po: DeclNodes.inc.h
Function.po: DiagnosticCommonKinds.inc.h
-Function.po: StmtNodes.inc.h
LineEntry.o: DiagnosticCommonKinds.inc.h
LineEntry.po: DiagnosticCommonKinds.inc.h
-LineTable.o: CommentCommandList.inc.h
-LineTable.o: DeclNodes.inc.h
LineTable.o: DiagnosticCommonKinds.inc.h
-LineTable.o: StmtNodes.inc.h
-LineTable.po: CommentCommandList.inc.h
-LineTable.po: DeclNodes.inc.h
LineTable.po: DiagnosticCommonKinds.inc.h
-LineTable.po: StmtNodes.inc.h
-ObjectFile.o: CommentCommandList.inc.h
-ObjectFile.o: DeclNodes.inc.h
ObjectFile.o: DiagnosticCommonKinds.inc.h
-ObjectFile.o: StmtNodes.inc.h
-ObjectFile.po: CommentCommandList.inc.h
-ObjectFile.po: DeclNodes.inc.h
ObjectFile.po: DiagnosticCommonKinds.inc.h
-ObjectFile.po: StmtNodes.inc.h
-Symbol.o: CommentCommandList.inc.h
-Symbol.o: DeclNodes.inc.h
Symbol.o: DiagnosticCommonKinds.inc.h
-Symbol.o: StmtNodes.inc.h
-Symbol.po: CommentCommandList.inc.h
-Symbol.po: DeclNodes.inc.h
Symbol.po: DiagnosticCommonKinds.inc.h
-Symbol.po: StmtNodes.inc.h
SymbolContext.o: CommentCommandList.inc.h
SymbolContext.o: DeclNodes.inc.h
SymbolContext.o: DiagnosticCommonKinds.inc.h
@@ -137,30 +83,12 @@ SymbolContext.po: CommentCommandList.inc.h
SymbolContext.po: DeclNodes.inc.h
SymbolContext.po: DiagnosticCommonKinds.inc.h
SymbolContext.po: StmtNodes.inc.h
-SymbolFile.o: CommentCommandList.inc.h
-SymbolFile.o: DeclNodes.inc.h
SymbolFile.o: DiagnosticCommonKinds.inc.h
-SymbolFile.o: StmtNodes.inc.h
-SymbolFile.po: CommentCommandList.inc.h
-SymbolFile.po: DeclNodes.inc.h
SymbolFile.po: DiagnosticCommonKinds.inc.h
-SymbolFile.po: StmtNodes.inc.h
-SymbolVendor.o: CommentCommandList.inc.h
-SymbolVendor.o: DeclNodes.inc.h
SymbolVendor.o: DiagnosticCommonKinds.inc.h
-SymbolVendor.o: StmtNodes.inc.h
-SymbolVendor.po: CommentCommandList.inc.h
-SymbolVendor.po: DeclNodes.inc.h
SymbolVendor.po: DiagnosticCommonKinds.inc.h
-SymbolVendor.po: StmtNodes.inc.h
-Symtab.o: CommentCommandList.inc.h
-Symtab.o: DeclNodes.inc.h
Symtab.o: DiagnosticCommonKinds.inc.h
-Symtab.o: StmtNodes.inc.h
-Symtab.po: CommentCommandList.inc.h
-Symtab.po: DeclNodes.inc.h
Symtab.po: DiagnosticCommonKinds.inc.h
-Symtab.po: StmtNodes.inc.h
Type.o: CommentCommandList.inc.h
Type.o: DeclNodes.inc.h
Type.o: DiagnosticCommonKinds.inc.h
@@ -181,24 +109,8 @@ TypeList.po: CommentCommandList.inc.h
TypeList.po: DeclNodes.inc.h
TypeList.po: DiagnosticCommonKinds.inc.h
TypeList.po: StmtNodes.inc.h
-UnwindPlan.o: DiagnosticCommonKinds.inc.h
-UnwindPlan.po: DiagnosticCommonKinds.inc.h
-UnwindTable.o: CommentCommandList.inc.h
-UnwindTable.o: DeclNodes.inc.h
-UnwindTable.o: DiagnosticCommonKinds.inc.h
-UnwindTable.o: StmtNodes.inc.h
-UnwindTable.po: CommentCommandList.inc.h
-UnwindTable.po: DeclNodes.inc.h
-UnwindTable.po: DiagnosticCommonKinds.inc.h
-UnwindTable.po: StmtNodes.inc.h
-Variable.o: CommentCommandList.inc.h
-Variable.o: DeclNodes.inc.h
Variable.o: DiagnosticCommonKinds.inc.h
-Variable.o: StmtNodes.inc.h
-Variable.po: CommentCommandList.inc.h
-Variable.po: DeclNodes.inc.h
Variable.po: DiagnosticCommonKinds.inc.h
-Variable.po: StmtNodes.inc.h
VariableList.o: DiagnosticCommonKinds.inc.h
VariableList.po: DiagnosticCommonKinds.inc.h
VerifyDecl.o: DeclNodes.inc.h
diff --git a/lib/clang/liblldbTarget/Makefile.depend b/lib/clang/liblldbTarget/Makefile.depend
index e9ffeed..811b401 100644
--- a/lib/clang/liblldbTarget/Makefile.depend
+++ b/lib/clang/liblldbTarget/Makefile.depend
@@ -17,18 +17,8 @@ ABI.o: DiagnosticCommonKinds.inc.h
ABI.po: DiagnosticCommonKinds.inc.h
CPPLanguageRuntime.o: DiagnosticCommonKinds.inc.h
CPPLanguageRuntime.po: DiagnosticCommonKinds.inc.h
-ExecutionContext.o: DiagnosticCommonKinds.inc.h
-ExecutionContext.po: DiagnosticCommonKinds.inc.h
-InstrumentationRuntime.o: DiagnosticCommonKinds.inc.h
-InstrumentationRuntime.po: DiagnosticCommonKinds.inc.h
-InstrumentationRuntimeStopInfo.o: DiagnosticCommonKinds.inc.h
-InstrumentationRuntimeStopInfo.po: DiagnosticCommonKinds.inc.h
-JITLoader.o: DiagnosticCommonKinds.inc.h
-JITLoader.po: DiagnosticCommonKinds.inc.h
LanguageRuntime.o: DiagnosticCommonKinds.inc.h
LanguageRuntime.po: DiagnosticCommonKinds.inc.h
-Memory.o: DiagnosticCommonKinds.inc.h
-Memory.po: DiagnosticCommonKinds.inc.h
ObjCLanguageRuntime.o: CommentCommandList.inc.h
ObjCLanguageRuntime.o: DeclNodes.inc.h
ObjCLanguageRuntime.o: DiagnosticCommonKinds.inc.h
@@ -37,164 +27,48 @@ ObjCLanguageRuntime.po: CommentCommandList.inc.h
ObjCLanguageRuntime.po: DeclNodes.inc.h
ObjCLanguageRuntime.po: DiagnosticCommonKinds.inc.h
ObjCLanguageRuntime.po: StmtNodes.inc.h
-Platform.o: DiagnosticCommonKinds.inc.h
-Platform.po: DiagnosticCommonKinds.inc.h
-Process.o: AttrList.inc.h
-Process.o: Attrs.inc.h
-Process.o: CommentCommandList.inc.h
-Process.o: DeclNodes.inc.h
Process.o: DiagnosticCommonKinds.inc.h
-Process.o: StmtNodes.inc.h
-Process.po: AttrList.inc.h
-Process.po: Attrs.inc.h
-Process.po: CommentCommandList.inc.h
-Process.po: DeclNodes.inc.h
Process.po: DiagnosticCommonKinds.inc.h
-Process.po: StmtNodes.inc.h
-ProcessLaunchInfo.o: AttrList.inc.h
-ProcessLaunchInfo.o: Attrs.inc.h
-ProcessLaunchInfo.o: CommentCommandList.inc.h
-ProcessLaunchInfo.o: DeclNodes.inc.h
-ProcessLaunchInfo.o: DiagnosticCommonKinds.inc.h
-ProcessLaunchInfo.o: StmtNodes.inc.h
-ProcessLaunchInfo.po: AttrList.inc.h
-ProcessLaunchInfo.po: Attrs.inc.h
-ProcessLaunchInfo.po: CommentCommandList.inc.h
-ProcessLaunchInfo.po: DeclNodes.inc.h
-ProcessLaunchInfo.po: DiagnosticCommonKinds.inc.h
-ProcessLaunchInfo.po: StmtNodes.inc.h
-Queue.o: DiagnosticCommonKinds.inc.h
-Queue.po: DiagnosticCommonKinds.inc.h
-QueueItem.o: DiagnosticCommonKinds.inc.h
-QueueItem.po: DiagnosticCommonKinds.inc.h
-QueueList.o: DiagnosticCommonKinds.inc.h
-QueueList.po: DiagnosticCommonKinds.inc.h
-RegisterContext.o: DiagnosticCommonKinds.inc.h
-RegisterContext.po: DiagnosticCommonKinds.inc.h
-SectionLoadList.o: CommentCommandList.inc.h
-SectionLoadList.o: DeclNodes.inc.h
SectionLoadList.o: DiagnosticCommonKinds.inc.h
-SectionLoadList.o: StmtNodes.inc.h
-SectionLoadList.po: CommentCommandList.inc.h
-SectionLoadList.po: DeclNodes.inc.h
SectionLoadList.po: DiagnosticCommonKinds.inc.h
-SectionLoadList.po: StmtNodes.inc.h
-StackFrame.o: AttrList.inc.h
-StackFrame.o: Attrs.inc.h
-StackFrame.o: CommentCommandList.inc.h
-StackFrame.o: DeclNodes.inc.h
StackFrame.o: DiagnosticCommonKinds.inc.h
-StackFrame.o: StmtNodes.inc.h
-StackFrame.po: AttrList.inc.h
-StackFrame.po: Attrs.inc.h
-StackFrame.po: CommentCommandList.inc.h
-StackFrame.po: DeclNodes.inc.h
StackFrame.po: DiagnosticCommonKinds.inc.h
-StackFrame.po: StmtNodes.inc.h
StackFrameList.o: DiagnosticCommonKinds.inc.h
StackFrameList.po: DiagnosticCommonKinds.inc.h
StackID.o: DiagnosticCommonKinds.inc.h
StackID.po: DiagnosticCommonKinds.inc.h
-StopInfo.o: AttrList.inc.h
-StopInfo.o: Attrs.inc.h
-StopInfo.o: CommentCommandList.inc.h
-StopInfo.o: DeclNodes.inc.h
StopInfo.o: DiagnosticCommonKinds.inc.h
-StopInfo.o: StmtNodes.inc.h
-StopInfo.po: AttrList.inc.h
-StopInfo.po: Attrs.inc.h
-StopInfo.po: CommentCommandList.inc.h
-StopInfo.po: DeclNodes.inc.h
StopInfo.po: DiagnosticCommonKinds.inc.h
-StopInfo.po: StmtNodes.inc.h
-SystemRuntime.o: DiagnosticCommonKinds.inc.h
-SystemRuntime.po: DiagnosticCommonKinds.inc.h
-Target.o: AttrList.inc.h
-Target.o: Attrs.inc.h
Target.o: CommentCommandList.inc.h
Target.o: DeclNodes.inc.h
Target.o: DiagnosticCommonKinds.inc.h
Target.o: StmtNodes.inc.h
-Target.po: AttrList.inc.h
-Target.po: Attrs.inc.h
Target.po: CommentCommandList.inc.h
Target.po: DeclNodes.inc.h
Target.po: DiagnosticCommonKinds.inc.h
Target.po: StmtNodes.inc.h
-TargetList.o: AttrList.inc.h
-TargetList.o: Attrs.inc.h
-TargetList.o: CommentCommandList.inc.h
-TargetList.o: DeclNodes.inc.h
-TargetList.o: DiagnosticCommonKinds.inc.h
-TargetList.o: StmtNodes.inc.h
-TargetList.po: AttrList.inc.h
-TargetList.po: Attrs.inc.h
-TargetList.po: CommentCommandList.inc.h
-TargetList.po: DeclNodes.inc.h
-TargetList.po: DiagnosticCommonKinds.inc.h
-TargetList.po: StmtNodes.inc.h
-Thread.o: AttrList.inc.h
-Thread.o: Attrs.inc.h
-Thread.o: CommentCommandList.inc.h
-Thread.o: DeclNodes.inc.h
Thread.o: DiagnosticCommonKinds.inc.h
-Thread.o: StmtNodes.inc.h
-Thread.po: AttrList.inc.h
-Thread.po: Attrs.inc.h
-Thread.po: CommentCommandList.inc.h
-Thread.po: DeclNodes.inc.h
Thread.po: DiagnosticCommonKinds.inc.h
-Thread.po: StmtNodes.inc.h
ThreadList.o: DiagnosticCommonKinds.inc.h
ThreadList.po: DiagnosticCommonKinds.inc.h
-ThreadPlan.o: AttrList.inc.h
-ThreadPlan.o: Attrs.inc.h
-ThreadPlan.o: CommentCommandList.inc.h
-ThreadPlan.o: DeclNodes.inc.h
ThreadPlan.o: DiagnosticCommonKinds.inc.h
-ThreadPlan.o: StmtNodes.inc.h
-ThreadPlan.po: AttrList.inc.h
-ThreadPlan.po: Attrs.inc.h
-ThreadPlan.po: CommentCommandList.inc.h
-ThreadPlan.po: DeclNodes.inc.h
ThreadPlan.po: DiagnosticCommonKinds.inc.h
-ThreadPlan.po: StmtNodes.inc.h
ThreadPlanBase.o: DiagnosticCommonKinds.inc.h
ThreadPlanBase.po: DiagnosticCommonKinds.inc.h
-ThreadPlanCallFunction.o: CommentCommandList.inc.h
-ThreadPlanCallFunction.o: DeclNodes.inc.h
ThreadPlanCallFunction.o: DiagnosticCommonKinds.inc.h
-ThreadPlanCallFunction.o: StmtNodes.inc.h
-ThreadPlanCallFunction.po: CommentCommandList.inc.h
-ThreadPlanCallFunction.po: DeclNodes.inc.h
ThreadPlanCallFunction.po: DiagnosticCommonKinds.inc.h
-ThreadPlanCallFunction.po: StmtNodes.inc.h
+ThreadPlanCallFunctionUsingABI.o: DiagnosticCommonKinds.inc.h
+ThreadPlanCallFunctionUsingABI.po: DiagnosticCommonKinds.inc.h
ThreadPlanCallUserExpression.o: DiagnosticCommonKinds.inc.h
ThreadPlanCallUserExpression.po: DiagnosticCommonKinds.inc.h
-ThreadPlanPython.o: AttrList.inc.h
-ThreadPlanPython.o: Attrs.inc.h
-ThreadPlanPython.o: CommentCommandList.inc.h
-ThreadPlanPython.o: DeclNodes.inc.h
ThreadPlanPython.o: DiagnosticCommonKinds.inc.h
-ThreadPlanPython.o: StmtNodes.inc.h
-ThreadPlanPython.po: AttrList.inc.h
-ThreadPlanPython.po: Attrs.inc.h
-ThreadPlanPython.po: CommentCommandList.inc.h
-ThreadPlanPython.po: DeclNodes.inc.h
ThreadPlanPython.po: DiagnosticCommonKinds.inc.h
-ThreadPlanPython.po: StmtNodes.inc.h
ThreadPlanRunToAddress.o: DiagnosticCommonKinds.inc.h
ThreadPlanRunToAddress.po: DiagnosticCommonKinds.inc.h
ThreadPlanShouldStopHere.o: DiagnosticCommonKinds.inc.h
ThreadPlanShouldStopHere.po: DiagnosticCommonKinds.inc.h
-ThreadPlanStepInRange.o: CommentCommandList.inc.h
-ThreadPlanStepInRange.o: DeclNodes.inc.h
ThreadPlanStepInRange.o: DiagnosticCommonKinds.inc.h
-ThreadPlanStepInRange.o: StmtNodes.inc.h
-ThreadPlanStepInRange.po: CommentCommandList.inc.h
-ThreadPlanStepInRange.po: DeclNodes.inc.h
ThreadPlanStepInRange.po: DiagnosticCommonKinds.inc.h
-ThreadPlanStepInRange.po: StmtNodes.inc.h
ThreadPlanStepInstruction.o: DiagnosticCommonKinds.inc.h
ThreadPlanStepInstruction.po: DiagnosticCommonKinds.inc.h
ThreadPlanStepOut.o: DiagnosticCommonKinds.inc.h
@@ -209,14 +83,10 @@ ThreadPlanStepThrough.o: DiagnosticCommonKinds.inc.h
ThreadPlanStepThrough.po: DiagnosticCommonKinds.inc.h
ThreadPlanStepUntil.o: DiagnosticCommonKinds.inc.h
ThreadPlanStepUntil.po: DiagnosticCommonKinds.inc.h
-ThreadPlanTracer.o: AttrList.inc.h
-ThreadPlanTracer.o: Attrs.inc.h
ThreadPlanTracer.o: CommentCommandList.inc.h
ThreadPlanTracer.o: DeclNodes.inc.h
ThreadPlanTracer.o: DiagnosticCommonKinds.inc.h
ThreadPlanTracer.o: StmtNodes.inc.h
-ThreadPlanTracer.po: AttrList.inc.h
-ThreadPlanTracer.po: Attrs.inc.h
ThreadPlanTracer.po: CommentCommandList.inc.h
ThreadPlanTracer.po: DeclNodes.inc.h
ThreadPlanTracer.po: DiagnosticCommonKinds.inc.h
diff --git a/lib/clang/libllvmaarch64codegen/Makefile.depend b/lib/clang/libllvmaarch64codegen/Makefile.depend
index e6dc7bf..56b7560 100644
--- a/lib/clang/libllvmaarch64codegen/Makefile.depend
+++ b/lib/clang/libllvmaarch64codegen/Makefile.depend
@@ -184,9 +184,11 @@ AArch64Subtarget.po: AArch64GenSubtargetInfo.inc.h
AArch64TargetMachine.o: AArch64GenInstrInfo.inc.h
AArch64TargetMachine.o: AArch64GenRegisterInfo.inc.h
AArch64TargetMachine.o: AArch64GenSubtargetInfo.inc.h
+AArch64TargetMachine.o: Intrinsics.inc.h
AArch64TargetMachine.po: AArch64GenInstrInfo.inc.h
AArch64TargetMachine.po: AArch64GenRegisterInfo.inc.h
AArch64TargetMachine.po: AArch64GenSubtargetInfo.inc.h
+AArch64TargetMachine.po: Intrinsics.inc.h
AArch64TargetObjectFile.o: AArch64GenInstrInfo.inc.h
AArch64TargetObjectFile.o: AArch64GenRegisterInfo.inc.h
AArch64TargetObjectFile.o: AArch64GenSubtargetInfo.inc.h
diff --git a/lib/clang/libllvmaarch64disassembler/Makefile.depend b/lib/clang/libllvmaarch64disassembler/Makefile.depend
index 7c5f0d9..bbe0f2e 100644
--- a/lib/clang/libllvmaarch64disassembler/Makefile.depend
+++ b/lib/clang/libllvmaarch64disassembler/Makefile.depend
@@ -21,4 +21,10 @@ AArch64Disassembler.po: AArch64GenDisassemblerTables.inc.h
AArch64Disassembler.po: AArch64GenInstrInfo.inc.h
AArch64Disassembler.po: AArch64GenRegisterInfo.inc.h
AArch64Disassembler.po: AArch64GenSubtargetInfo.inc.h
+AArch64ExternalSymbolizer.o: AArch64GenInstrInfo.inc.h
+AArch64ExternalSymbolizer.o: AArch64GenRegisterInfo.inc.h
+AArch64ExternalSymbolizer.o: AArch64GenSubtargetInfo.inc.h
+AArch64ExternalSymbolizer.po: AArch64GenInstrInfo.inc.h
+AArch64ExternalSymbolizer.po: AArch64GenRegisterInfo.inc.h
+AArch64ExternalSymbolizer.po: AArch64GenSubtargetInfo.inc.h
.endif
diff --git a/lib/clang/libllvmanalysis/Makefile.depend b/lib/clang/libllvmanalysis/Makefile.depend
index 274e6ed..6c96816 100644
--- a/lib/clang/libllvmanalysis/Makefile.depend
+++ b/lib/clang/libllvmanalysis/Makefile.depend
@@ -29,8 +29,8 @@ ConstantFolding.o: Intrinsics.inc.h
ConstantFolding.po: Intrinsics.inc.h
CostModel.o: Intrinsics.inc.h
CostModel.po: Intrinsics.inc.h
-FunctionTargetTransformInfo.o: Intrinsics.inc.h
-FunctionTargetTransformInfo.po: Intrinsics.inc.h
+DivergenceAnalysis.o: Intrinsics.inc.h
+DivergenceAnalysis.po: Intrinsics.inc.h
InstCount.o: Intrinsics.inc.h
InstCount.po: Intrinsics.inc.h
InstructionSimplify.o: Intrinsics.inc.h
@@ -43,10 +43,14 @@ Lint.o: Intrinsics.inc.h
Lint.po: Intrinsics.inc.h
Loads.o: Intrinsics.inc.h
Loads.po: Intrinsics.inc.h
+LoopAccessAnalysis.o: Intrinsics.inc.h
+LoopAccessAnalysis.po: Intrinsics.inc.h
MemoryBuiltins.o: Intrinsics.inc.h
MemoryBuiltins.po: Intrinsics.inc.h
MemoryDependenceAnalysis.o: Intrinsics.inc.h
MemoryDependenceAnalysis.po: Intrinsics.inc.h
+MemoryLocation.o: Intrinsics.inc.h
+MemoryLocation.po: Intrinsics.inc.h
PtrUseVisitor.o: Intrinsics.inc.h
PtrUseVisitor.po: Intrinsics.inc.h
ScalarEvolutionExpander.o: Intrinsics.inc.h
@@ -55,4 +59,6 @@ TargetTransformInfo.o: Intrinsics.inc.h
TargetTransformInfo.po: Intrinsics.inc.h
ValueTracking.o: Intrinsics.inc.h
ValueTracking.po: Intrinsics.inc.h
+VectorUtils.o: Intrinsics.inc.h
+VectorUtils.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvmarmcodegen/Makefile.depend b/lib/clang/libllvmarmcodegen/Makefile.depend
index deda9fb..9819e3b 100644
--- a/lib/clang/libllvmarmcodegen/Makefile.depend
+++ b/lib/clang/libllvmarmcodegen/Makefile.depend
@@ -146,9 +146,11 @@ ARMSubtarget.po: ARMGenSubtargetInfo.inc.h
ARMTargetMachine.o: ARMGenInstrInfo.inc.h
ARMTargetMachine.o: ARMGenRegisterInfo.inc.h
ARMTargetMachine.o: ARMGenSubtargetInfo.inc.h
+ARMTargetMachine.o: Intrinsics.inc.h
ARMTargetMachine.po: ARMGenInstrInfo.inc.h
ARMTargetMachine.po: ARMGenRegisterInfo.inc.h
ARMTargetMachine.po: ARMGenSubtargetInfo.inc.h
+ARMTargetMachine.po: Intrinsics.inc.h
ARMTargetObjectFile.o: ARMGenInstrInfo.inc.h
ARMTargetObjectFile.o: ARMGenRegisterInfo.inc.h
ARMTargetObjectFile.o: ARMGenSubtargetInfo.inc.h
@@ -181,12 +183,6 @@ Thumb1InstrInfo.o: ARMGenSubtargetInfo.inc.h
Thumb1InstrInfo.po: ARMGenInstrInfo.inc.h
Thumb1InstrInfo.po: ARMGenRegisterInfo.inc.h
Thumb1InstrInfo.po: ARMGenSubtargetInfo.inc.h
-Thumb1RegisterInfo.o: ARMGenInstrInfo.inc.h
-Thumb1RegisterInfo.o: ARMGenRegisterInfo.inc.h
-Thumb1RegisterInfo.o: ARMGenSubtargetInfo.inc.h
-Thumb1RegisterInfo.po: ARMGenInstrInfo.inc.h
-Thumb1RegisterInfo.po: ARMGenRegisterInfo.inc.h
-Thumb1RegisterInfo.po: ARMGenSubtargetInfo.inc.h
Thumb2ITBlockPass.o: ARMGenInstrInfo.inc.h
Thumb2ITBlockPass.o: ARMGenRegisterInfo.inc.h
Thumb2ITBlockPass.o: ARMGenSubtargetInfo.inc.h
@@ -199,16 +195,16 @@ Thumb2InstrInfo.o: ARMGenSubtargetInfo.inc.h
Thumb2InstrInfo.po: ARMGenInstrInfo.inc.h
Thumb2InstrInfo.po: ARMGenRegisterInfo.inc.h
Thumb2InstrInfo.po: ARMGenSubtargetInfo.inc.h
-Thumb2RegisterInfo.o: ARMGenInstrInfo.inc.h
-Thumb2RegisterInfo.o: ARMGenRegisterInfo.inc.h
-Thumb2RegisterInfo.o: ARMGenSubtargetInfo.inc.h
-Thumb2RegisterInfo.po: ARMGenInstrInfo.inc.h
-Thumb2RegisterInfo.po: ARMGenRegisterInfo.inc.h
-Thumb2RegisterInfo.po: ARMGenSubtargetInfo.inc.h
Thumb2SizeReduction.o: ARMGenInstrInfo.inc.h
Thumb2SizeReduction.o: ARMGenRegisterInfo.inc.h
Thumb2SizeReduction.o: ARMGenSubtargetInfo.inc.h
Thumb2SizeReduction.po: ARMGenInstrInfo.inc.h
Thumb2SizeReduction.po: ARMGenRegisterInfo.inc.h
Thumb2SizeReduction.po: ARMGenSubtargetInfo.inc.h
+ThumbRegisterInfo.o: ARMGenInstrInfo.inc.h
+ThumbRegisterInfo.o: ARMGenRegisterInfo.inc.h
+ThumbRegisterInfo.o: ARMGenSubtargetInfo.inc.h
+ThumbRegisterInfo.po: ARMGenInstrInfo.inc.h
+ThumbRegisterInfo.po: ARMGenRegisterInfo.inc.h
+ThumbRegisterInfo.po: ARMGenSubtargetInfo.inc.h
.endif
diff --git a/lib/clang/libllvmcodegen/Makefile.depend b/lib/clang/libllvmcodegen/Makefile.depend
index 98484cb..888f72f 100644
--- a/lib/clang/libllvmcodegen/Makefile.depend
+++ b/lib/clang/libllvmcodegen/Makefile.depend
@@ -23,18 +23,24 @@ CodeGenPrepare.o: Intrinsics.inc.h
CodeGenPrepare.po: Intrinsics.inc.h
DwarfEHPrepare.o: Intrinsics.inc.h
DwarfEHPrepare.po: Intrinsics.inc.h
-GCStrategy.o: Intrinsics.inc.h
-GCStrategy.po: Intrinsics.inc.h
+GCRootLowering.o: Intrinsics.inc.h
+GCRootLowering.po: Intrinsics.inc.h
GlobalMerge.o: Intrinsics.inc.h
GlobalMerge.po: Intrinsics.inc.h
IntrinsicLowering.o: Intrinsics.inc.h
IntrinsicLowering.po: Intrinsics.inc.h
+LLVMTargetMachine.o: Intrinsics.inc.h
+LLVMTargetMachine.po: Intrinsics.inc.h
LocalStackSlotAllocation.o: Intrinsics.inc.h
LocalStackSlotAllocation.po: Intrinsics.inc.h
ShadowStackGC.o: Intrinsics.inc.h
ShadowStackGC.po: Intrinsics.inc.h
+ShadowStackGCLowering.o: Intrinsics.inc.h
+ShadowStackGCLowering.po: Intrinsics.inc.h
SjLjEHPrepare.o: Intrinsics.inc.h
SjLjEHPrepare.po: Intrinsics.inc.h
StackProtector.o: Intrinsics.inc.h
StackProtector.po: Intrinsics.inc.h
+WinEHPrepare.o: Intrinsics.inc.h
+WinEHPrepare.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvmcore/Makefile.depend b/lib/clang/libllvmcore/Makefile.depend
index 212908d..7393881 100644
--- a/lib/clang/libllvmcore/Makefile.depend
+++ b/lib/clang/libllvmcore/Makefile.depend
@@ -35,6 +35,8 @@ IntrinsicInst.o: Intrinsics.inc.h
IntrinsicInst.po: Intrinsics.inc.h
Statepoint.o: Intrinsics.inc.h
Statepoint.po: Intrinsics.inc.h
+Value.o: Intrinsics.inc.h
+Value.po: Intrinsics.inc.h
Verifier.o: Intrinsics.inc.h
Verifier.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvminstrumentation/Makefile.depend b/lib/clang/libllvminstrumentation/Makefile.depend
index 625288d..2718ddd 100644
--- a/lib/clang/libllvminstrumentation/Makefile.depend
+++ b/lib/clang/libllvminstrumentation/Makefile.depend
@@ -25,6 +25,8 @@ InstrProfiling.o: Intrinsics.inc.h
InstrProfiling.po: Intrinsics.inc.h
MemorySanitizer.o: Intrinsics.inc.h
MemorySanitizer.po: Intrinsics.inc.h
+SafeStack.o: Intrinsics.inc.h
+SafeStack.po: Intrinsics.inc.h
ThreadSanitizer.o: Intrinsics.inc.h
ThreadSanitizer.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvmipa/Makefile.depend b/lib/clang/libllvmipa/Makefile.depend
index cc9dba5..b534e62 100644
--- a/lib/clang/libllvmipa/Makefile.depend
+++ b/lib/clang/libllvmipa/Makefile.depend
@@ -17,6 +17,8 @@ CallGraph.o: Intrinsics.inc.h
CallGraph.po: Intrinsics.inc.h
CallGraphSCCPass.o: Intrinsics.inc.h
CallGraphSCCPass.po: Intrinsics.inc.h
+CallPrinter.o: Intrinsics.inc.h
+CallPrinter.po: Intrinsics.inc.h
GlobalsModRef.o: Intrinsics.inc.h
GlobalsModRef.po: Intrinsics.inc.h
InlineCost.o: Intrinsics.inc.h
diff --git a/lib/clang/libllvmipo/Makefile.depend b/lib/clang/libllvmipo/Makefile.depend
index 39715a7..84342a0 100644
--- a/lib/clang/libllvmipo/Makefile.depend
+++ b/lib/clang/libllvmipo/Makefile.depend
@@ -13,6 +13,8 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
+ArgumentPromotion.o: Intrinsics.inc.h
+ArgumentPromotion.po: Intrinsics.inc.h
DeadArgumentElimination.o: Intrinsics.inc.h
DeadArgumentElimination.po: Intrinsics.inc.h
FunctionAttrs.o: Intrinsics.inc.h
@@ -25,6 +27,10 @@ InlineSimple.o: Intrinsics.inc.h
InlineSimple.po: Intrinsics.inc.h
Inliner.o: Intrinsics.inc.h
Inliner.po: Intrinsics.inc.h
+Internalize.o: Intrinsics.inc.h
+Internalize.po: Intrinsics.inc.h
+LowerBitSets.o: Intrinsics.inc.h
+LowerBitSets.po: Intrinsics.inc.h
PruneEH.o: Intrinsics.inc.h
PruneEH.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvmmipscodegen/Makefile.depend b/lib/clang/libllvmmipscodegen/Makefile.depend
index a4cd81a..30c9f8f 100644
--- a/lib/clang/libllvmmipscodegen/Makefile.depend
+++ b/lib/clang/libllvmmipscodegen/Makefile.depend
@@ -19,9 +19,11 @@ Mips16FrameLowering.o: MipsGenSubtargetInfo.inc.h
Mips16FrameLowering.po: MipsGenInstrInfo.inc.h
Mips16FrameLowering.po: MipsGenRegisterInfo.inc.h
Mips16FrameLowering.po: MipsGenSubtargetInfo.inc.h
+Mips16HardFloat.o: Intrinsics.inc.h
Mips16HardFloat.o: MipsGenInstrInfo.inc.h
Mips16HardFloat.o: MipsGenRegisterInfo.inc.h
Mips16HardFloat.o: MipsGenSubtargetInfo.inc.h
+Mips16HardFloat.po: Intrinsics.inc.h
Mips16HardFloat.po: MipsGenInstrInfo.inc.h
Mips16HardFloat.po: MipsGenRegisterInfo.inc.h
Mips16HardFloat.po: MipsGenSubtargetInfo.inc.h
@@ -35,15 +37,19 @@ Mips16ISelDAGToDAG.po: MipsGenDAGISel.inc.h
Mips16ISelDAGToDAG.po: MipsGenInstrInfo.inc.h
Mips16ISelDAGToDAG.po: MipsGenRegisterInfo.inc.h
Mips16ISelDAGToDAG.po: MipsGenSubtargetInfo.inc.h
+Mips16ISelLowering.o: Intrinsics.inc.h
Mips16ISelLowering.o: MipsGenInstrInfo.inc.h
Mips16ISelLowering.o: MipsGenRegisterInfo.inc.h
Mips16ISelLowering.o: MipsGenSubtargetInfo.inc.h
+Mips16ISelLowering.po: Intrinsics.inc.h
Mips16ISelLowering.po: MipsGenInstrInfo.inc.h
Mips16ISelLowering.po: MipsGenRegisterInfo.inc.h
Mips16ISelLowering.po: MipsGenSubtargetInfo.inc.h
+Mips16InstrInfo.o: Intrinsics.inc.h
Mips16InstrInfo.o: MipsGenInstrInfo.inc.h
Mips16InstrInfo.o: MipsGenRegisterInfo.inc.h
Mips16InstrInfo.o: MipsGenSubtargetInfo.inc.h
+Mips16InstrInfo.po: Intrinsics.inc.h
Mips16InstrInfo.po: MipsGenInstrInfo.inc.h
Mips16InstrInfo.po: MipsGenRegisterInfo.inc.h
Mips16InstrInfo.po: MipsGenSubtargetInfo.inc.h
@@ -59,10 +65,12 @@ MipsAnalyzeImmediate.o: MipsGenSubtargetInfo.inc.h
MipsAnalyzeImmediate.po: MipsGenInstrInfo.inc.h
MipsAnalyzeImmediate.po: MipsGenRegisterInfo.inc.h
MipsAnalyzeImmediate.po: MipsGenSubtargetInfo.inc.h
+MipsAsmPrinter.o: Intrinsics.inc.h
MipsAsmPrinter.o: MipsGenInstrInfo.inc.h
MipsAsmPrinter.o: MipsGenMCPseudoLowering.inc.h
MipsAsmPrinter.o: MipsGenRegisterInfo.inc.h
MipsAsmPrinter.o: MipsGenSubtargetInfo.inc.h
+MipsAsmPrinter.po: Intrinsics.inc.h
MipsAsmPrinter.po: MipsGenInstrInfo.inc.h
MipsAsmPrinter.po: MipsGenMCPseudoLowering.inc.h
MipsAsmPrinter.po: MipsGenRegisterInfo.inc.h
@@ -73,15 +81,19 @@ MipsCCState.o: MipsGenSubtargetInfo.inc.h
MipsCCState.po: MipsGenInstrInfo.inc.h
MipsCCState.po: MipsGenRegisterInfo.inc.h
MipsCCState.po: MipsGenSubtargetInfo.inc.h
+MipsConstantIslandPass.o: Intrinsics.inc.h
MipsConstantIslandPass.o: MipsGenInstrInfo.inc.h
MipsConstantIslandPass.o: MipsGenRegisterInfo.inc.h
MipsConstantIslandPass.o: MipsGenSubtargetInfo.inc.h
+MipsConstantIslandPass.po: Intrinsics.inc.h
MipsConstantIslandPass.po: MipsGenInstrInfo.inc.h
MipsConstantIslandPass.po: MipsGenRegisterInfo.inc.h
MipsConstantIslandPass.po: MipsGenSubtargetInfo.inc.h
+MipsDelaySlotFiller.o: Intrinsics.inc.h
MipsDelaySlotFiller.o: MipsGenInstrInfo.inc.h
MipsDelaySlotFiller.o: MipsGenRegisterInfo.inc.h
MipsDelaySlotFiller.o: MipsGenSubtargetInfo.inc.h
+MipsDelaySlotFiller.po: Intrinsics.inc.h
MipsDelaySlotFiller.po: MipsGenInstrInfo.inc.h
MipsDelaySlotFiller.po: MipsGenRegisterInfo.inc.h
MipsDelaySlotFiller.po: MipsGenSubtargetInfo.inc.h
@@ -97,9 +109,11 @@ MipsFastISel.po: MipsGenFastISel.inc.h
MipsFastISel.po: MipsGenInstrInfo.inc.h
MipsFastISel.po: MipsGenRegisterInfo.inc.h
MipsFastISel.po: MipsGenSubtargetInfo.inc.h
+MipsFrameLowering.o: Intrinsics.inc.h
MipsFrameLowering.o: MipsGenInstrInfo.inc.h
MipsFrameLowering.o: MipsGenRegisterInfo.inc.h
MipsFrameLowering.o: MipsGenSubtargetInfo.inc.h
+MipsFrameLowering.po: Intrinsics.inc.h
MipsFrameLowering.po: MipsGenInstrInfo.inc.h
MipsFrameLowering.po: MipsGenRegisterInfo.inc.h
MipsFrameLowering.po: MipsGenSubtargetInfo.inc.h
@@ -113,10 +127,12 @@ MipsISelDAGToDAG.po: MipsGenDAGISel.inc.h
MipsISelDAGToDAG.po: MipsGenInstrInfo.inc.h
MipsISelDAGToDAG.po: MipsGenRegisterInfo.inc.h
MipsISelDAGToDAG.po: MipsGenSubtargetInfo.inc.h
+MipsISelLowering.o: Intrinsics.inc.h
MipsISelLowering.o: MipsGenCallingConv.inc.h
MipsISelLowering.o: MipsGenInstrInfo.inc.h
MipsISelLowering.o: MipsGenRegisterInfo.inc.h
MipsISelLowering.o: MipsGenSubtargetInfo.inc.h
+MipsISelLowering.po: Intrinsics.inc.h
MipsISelLowering.po: MipsGenCallingConv.inc.h
MipsISelLowering.po: MipsGenInstrInfo.inc.h
MipsISelLowering.po: MipsGenRegisterInfo.inc.h
@@ -127,9 +143,11 @@ MipsInstrInfo.o: MipsGenSubtargetInfo.inc.h
MipsInstrInfo.po: MipsGenInstrInfo.inc.h
MipsInstrInfo.po: MipsGenRegisterInfo.inc.h
MipsInstrInfo.po: MipsGenSubtargetInfo.inc.h
+MipsLongBranch.o: Intrinsics.inc.h
MipsLongBranch.o: MipsGenInstrInfo.inc.h
MipsLongBranch.o: MipsGenRegisterInfo.inc.h
MipsLongBranch.o: MipsGenSubtargetInfo.inc.h
+MipsLongBranch.po: Intrinsics.inc.h
MipsLongBranch.po: MipsGenInstrInfo.inc.h
MipsLongBranch.po: MipsGenRegisterInfo.inc.h
MipsLongBranch.po: MipsGenSubtargetInfo.inc.h
@@ -139,23 +157,27 @@ MipsMCInstLower.o: MipsGenSubtargetInfo.inc.h
MipsMCInstLower.po: MipsGenInstrInfo.inc.h
MipsMCInstLower.po: MipsGenRegisterInfo.inc.h
MipsMCInstLower.po: MipsGenSubtargetInfo.inc.h
+MipsMachineFunction.o: Intrinsics.inc.h
MipsMachineFunction.o: MipsGenInstrInfo.inc.h
MipsMachineFunction.o: MipsGenRegisterInfo.inc.h
MipsMachineFunction.o: MipsGenSubtargetInfo.inc.h
+MipsMachineFunction.po: Intrinsics.inc.h
MipsMachineFunction.po: MipsGenInstrInfo.inc.h
MipsMachineFunction.po: MipsGenRegisterInfo.inc.h
MipsMachineFunction.po: MipsGenSubtargetInfo.inc.h
-MipsModuleISelDAGToDAG.o: MipsGenDAGISel.inc.h
+MipsModuleISelDAGToDAG.o: Intrinsics.inc.h
MipsModuleISelDAGToDAG.o: MipsGenInstrInfo.inc.h
MipsModuleISelDAGToDAG.o: MipsGenRegisterInfo.inc.h
MipsModuleISelDAGToDAG.o: MipsGenSubtargetInfo.inc.h
-MipsModuleISelDAGToDAG.po: MipsGenDAGISel.inc.h
+MipsModuleISelDAGToDAG.po: Intrinsics.inc.h
MipsModuleISelDAGToDAG.po: MipsGenInstrInfo.inc.h
MipsModuleISelDAGToDAG.po: MipsGenRegisterInfo.inc.h
MipsModuleISelDAGToDAG.po: MipsGenSubtargetInfo.inc.h
+MipsOptimizePICCall.o: Intrinsics.inc.h
MipsOptimizePICCall.o: MipsGenInstrInfo.inc.h
MipsOptimizePICCall.o: MipsGenRegisterInfo.inc.h
MipsOptimizePICCall.o: MipsGenSubtargetInfo.inc.h
+MipsOptimizePICCall.po: Intrinsics.inc.h
MipsOptimizePICCall.po: MipsGenInstrInfo.inc.h
MipsOptimizePICCall.po: MipsGenRegisterInfo.inc.h
MipsOptimizePICCall.po: MipsGenSubtargetInfo.inc.h
@@ -165,9 +187,11 @@ MipsOs16.o: MipsGenSubtargetInfo.inc.h
MipsOs16.po: MipsGenInstrInfo.inc.h
MipsOs16.po: MipsGenRegisterInfo.inc.h
MipsOs16.po: MipsGenSubtargetInfo.inc.h
+MipsRegisterInfo.o: Intrinsics.inc.h
MipsRegisterInfo.o: MipsGenInstrInfo.inc.h
MipsRegisterInfo.o: MipsGenRegisterInfo.inc.h
MipsRegisterInfo.o: MipsGenSubtargetInfo.inc.h
+MipsRegisterInfo.po: Intrinsics.inc.h
MipsRegisterInfo.po: MipsGenInstrInfo.inc.h
MipsRegisterInfo.po: MipsGenRegisterInfo.inc.h
MipsRegisterInfo.po: MipsGenSubtargetInfo.inc.h
@@ -195,27 +219,27 @@ MipsSEISelLowering.po: Intrinsics.inc.h
MipsSEISelLowering.po: MipsGenInstrInfo.inc.h
MipsSEISelLowering.po: MipsGenRegisterInfo.inc.h
MipsSEISelLowering.po: MipsGenSubtargetInfo.inc.h
+MipsSEInstrInfo.o: Intrinsics.inc.h
MipsSEInstrInfo.o: MipsGenInstrInfo.inc.h
MipsSEInstrInfo.o: MipsGenRegisterInfo.inc.h
MipsSEInstrInfo.o: MipsGenSubtargetInfo.inc.h
+MipsSEInstrInfo.po: Intrinsics.inc.h
MipsSEInstrInfo.po: MipsGenInstrInfo.inc.h
MipsSEInstrInfo.po: MipsGenRegisterInfo.inc.h
MipsSEInstrInfo.po: MipsGenSubtargetInfo.inc.h
+MipsSERegisterInfo.o: Intrinsics.inc.h
MipsSERegisterInfo.o: MipsGenInstrInfo.inc.h
MipsSERegisterInfo.o: MipsGenRegisterInfo.inc.h
MipsSERegisterInfo.o: MipsGenSubtargetInfo.inc.h
+MipsSERegisterInfo.po: Intrinsics.inc.h
MipsSERegisterInfo.po: MipsGenInstrInfo.inc.h
MipsSERegisterInfo.po: MipsGenRegisterInfo.inc.h
MipsSERegisterInfo.po: MipsGenSubtargetInfo.inc.h
-MipsSelectionDAGInfo.o: MipsGenInstrInfo.inc.h
-MipsSelectionDAGInfo.o: MipsGenRegisterInfo.inc.h
-MipsSelectionDAGInfo.o: MipsGenSubtargetInfo.inc.h
-MipsSelectionDAGInfo.po: MipsGenInstrInfo.inc.h
-MipsSelectionDAGInfo.po: MipsGenRegisterInfo.inc.h
-MipsSelectionDAGInfo.po: MipsGenSubtargetInfo.inc.h
+MipsSubtarget.o: Intrinsics.inc.h
MipsSubtarget.o: MipsGenInstrInfo.inc.h
MipsSubtarget.o: MipsGenRegisterInfo.inc.h
MipsSubtarget.o: MipsGenSubtargetInfo.inc.h
+MipsSubtarget.po: Intrinsics.inc.h
MipsSubtarget.po: MipsGenInstrInfo.inc.h
MipsSubtarget.po: MipsGenRegisterInfo.inc.h
MipsSubtarget.po: MipsGenSubtargetInfo.inc.h
@@ -229,9 +253,11 @@ MipsTargetMachine.po: MipsGenDAGISel.inc.h
MipsTargetMachine.po: MipsGenInstrInfo.inc.h
MipsTargetMachine.po: MipsGenRegisterInfo.inc.h
MipsTargetMachine.po: MipsGenSubtargetInfo.inc.h
+MipsTargetObjectFile.o: Intrinsics.inc.h
MipsTargetObjectFile.o: MipsGenInstrInfo.inc.h
MipsTargetObjectFile.o: MipsGenRegisterInfo.inc.h
MipsTargetObjectFile.o: MipsGenSubtargetInfo.inc.h
+MipsTargetObjectFile.po: Intrinsics.inc.h
MipsTargetObjectFile.po: MipsGenInstrInfo.inc.h
MipsTargetObjectFile.po: MipsGenRegisterInfo.inc.h
MipsTargetObjectFile.po: MipsGenSubtargetInfo.inc.h
diff --git a/lib/clang/libllvmobjcarcopts/Makefile.depend b/lib/clang/libllvmobjcarcopts/Makefile.depend
index dc5c465..d71c7bc 100644
--- a/lib/clang/libllvmobjcarcopts/Makefile.depend
+++ b/lib/clang/libllvmobjcarcopts/Makefile.depend
@@ -13,6 +13,6 @@ DIRDEPS = \
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
-ObjCARCUtil.o: Intrinsics.inc.h
-ObjCARCUtil.po: Intrinsics.inc.h
+ARCInstKind.o: Intrinsics.inc.h
+ARCInstKind.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvmpowerpccodegen/Makefile.depend b/lib/clang/libllvmpowerpccodegen/Makefile.depend
index d7ad295..6b3e1d6 100644
--- a/lib/clang/libllvmpowerpccodegen/Makefile.depend
+++ b/lib/clang/libllvmpowerpccodegen/Makefile.depend
@@ -33,6 +33,12 @@ PPCCTRLoops.po: Intrinsics.inc.h
PPCCTRLoops.po: PPCGenInstrInfo.inc.h
PPCCTRLoops.po: PPCGenRegisterInfo.inc.h
PPCCTRLoops.po: PPCGenSubtargetInfo.inc.h
+PPCEarlyReturn.o: PPCGenInstrInfo.inc.h
+PPCEarlyReturn.o: PPCGenRegisterInfo.inc.h
+PPCEarlyReturn.o: PPCGenSubtargetInfo.inc.h
+PPCEarlyReturn.po: PPCGenInstrInfo.inc.h
+PPCEarlyReturn.po: PPCGenRegisterInfo.inc.h
+PPCEarlyReturn.po: PPCGenSubtargetInfo.inc.h
PPCFastISel.o: Intrinsics.inc.h
PPCFastISel.o: PPCGenCallingConv.inc.h
PPCFastISel.o: PPCGenFastISel.inc.h
@@ -83,6 +89,22 @@ PPCInstrInfo.o: PPCGenSubtargetInfo.inc.h
PPCInstrInfo.po: PPCGenInstrInfo.inc.h
PPCInstrInfo.po: PPCGenRegisterInfo.inc.h
PPCInstrInfo.po: PPCGenSubtargetInfo.inc.h
+PPCLoopDataPrefetch.o: Intrinsics.inc.h
+PPCLoopDataPrefetch.o: PPCGenInstrInfo.inc.h
+PPCLoopDataPrefetch.o: PPCGenRegisterInfo.inc.h
+PPCLoopDataPrefetch.o: PPCGenSubtargetInfo.inc.h
+PPCLoopDataPrefetch.po: Intrinsics.inc.h
+PPCLoopDataPrefetch.po: PPCGenInstrInfo.inc.h
+PPCLoopDataPrefetch.po: PPCGenRegisterInfo.inc.h
+PPCLoopDataPrefetch.po: PPCGenSubtargetInfo.inc.h
+PPCLoopPreIncPrep.o: Intrinsics.inc.h
+PPCLoopPreIncPrep.o: PPCGenInstrInfo.inc.h
+PPCLoopPreIncPrep.o: PPCGenRegisterInfo.inc.h
+PPCLoopPreIncPrep.o: PPCGenSubtargetInfo.inc.h
+PPCLoopPreIncPrep.po: Intrinsics.inc.h
+PPCLoopPreIncPrep.po: PPCGenInstrInfo.inc.h
+PPCLoopPreIncPrep.po: PPCGenRegisterInfo.inc.h
+PPCLoopPreIncPrep.po: PPCGenSubtargetInfo.inc.h
PPCMCInstLower.o: PPCGenInstrInfo.inc.h
PPCMCInstLower.o: PPCGenRegisterInfo.inc.h
PPCMCInstLower.o: PPCGenSubtargetInfo.inc.h
@@ -95,21 +117,29 @@ PPCRegisterInfo.o: PPCGenSubtargetInfo.inc.h
PPCRegisterInfo.po: PPCGenInstrInfo.inc.h
PPCRegisterInfo.po: PPCGenRegisterInfo.inc.h
PPCRegisterInfo.po: PPCGenSubtargetInfo.inc.h
-PPCSelectionDAGInfo.o: PPCGenInstrInfo.inc.h
-PPCSelectionDAGInfo.o: PPCGenRegisterInfo.inc.h
-PPCSelectionDAGInfo.o: PPCGenSubtargetInfo.inc.h
-PPCSelectionDAGInfo.po: PPCGenInstrInfo.inc.h
-PPCSelectionDAGInfo.po: PPCGenRegisterInfo.inc.h
-PPCSelectionDAGInfo.po: PPCGenSubtargetInfo.inc.h
PPCSubtarget.o: PPCGenInstrInfo.inc.h
PPCSubtarget.o: PPCGenRegisterInfo.inc.h
PPCSubtarget.o: PPCGenSubtargetInfo.inc.h
PPCSubtarget.po: PPCGenInstrInfo.inc.h
PPCSubtarget.po: PPCGenRegisterInfo.inc.h
PPCSubtarget.po: PPCGenSubtargetInfo.inc.h
+PPCTLSDynamicCall.o: PPCGenInstrInfo.inc.h
+PPCTLSDynamicCall.o: PPCGenRegisterInfo.inc.h
+PPCTLSDynamicCall.o: PPCGenSubtargetInfo.inc.h
+PPCTLSDynamicCall.po: PPCGenInstrInfo.inc.h
+PPCTLSDynamicCall.po: PPCGenRegisterInfo.inc.h
+PPCTLSDynamicCall.po: PPCGenSubtargetInfo.inc.h
+PPCTOCRegDeps.o: PPCGenInstrInfo.inc.h
+PPCTOCRegDeps.o: PPCGenRegisterInfo.inc.h
+PPCTOCRegDeps.o: PPCGenSubtargetInfo.inc.h
+PPCTOCRegDeps.po: PPCGenInstrInfo.inc.h
+PPCTOCRegDeps.po: PPCGenRegisterInfo.inc.h
+PPCTOCRegDeps.po: PPCGenSubtargetInfo.inc.h
+PPCTargetMachine.o: Intrinsics.inc.h
PPCTargetMachine.o: PPCGenInstrInfo.inc.h
PPCTargetMachine.o: PPCGenRegisterInfo.inc.h
PPCTargetMachine.o: PPCGenSubtargetInfo.inc.h
+PPCTargetMachine.po: Intrinsics.inc.h
PPCTargetMachine.po: PPCGenInstrInfo.inc.h
PPCTargetMachine.po: PPCGenRegisterInfo.inc.h
PPCTargetMachine.po: PPCGenSubtargetInfo.inc.h
@@ -121,4 +151,22 @@ PPCTargetTransformInfo.po: Intrinsics.inc.h
PPCTargetTransformInfo.po: PPCGenInstrInfo.inc.h
PPCTargetTransformInfo.po: PPCGenRegisterInfo.inc.h
PPCTargetTransformInfo.po: PPCGenSubtargetInfo.inc.h
+PPCVSXCopy.o: PPCGenInstrInfo.inc.h
+PPCVSXCopy.o: PPCGenRegisterInfo.inc.h
+PPCVSXCopy.o: PPCGenSubtargetInfo.inc.h
+PPCVSXCopy.po: PPCGenInstrInfo.inc.h
+PPCVSXCopy.po: PPCGenRegisterInfo.inc.h
+PPCVSXCopy.po: PPCGenSubtargetInfo.inc.h
+PPCVSXFMAMutate.o: PPCGenInstrInfo.inc.h
+PPCVSXFMAMutate.o: PPCGenRegisterInfo.inc.h
+PPCVSXFMAMutate.o: PPCGenSubtargetInfo.inc.h
+PPCVSXFMAMutate.po: PPCGenInstrInfo.inc.h
+PPCVSXFMAMutate.po: PPCGenRegisterInfo.inc.h
+PPCVSXFMAMutate.po: PPCGenSubtargetInfo.inc.h
+PPCVSXSwapRemoval.o: PPCGenInstrInfo.inc.h
+PPCVSXSwapRemoval.o: PPCGenRegisterInfo.inc.h
+PPCVSXSwapRemoval.o: PPCGenSubtargetInfo.inc.h
+PPCVSXSwapRemoval.po: PPCGenInstrInfo.inc.h
+PPCVSXSwapRemoval.po: PPCGenRegisterInfo.inc.h
+PPCVSXSwapRemoval.po: PPCGenSubtargetInfo.inc.h
.endif
diff --git a/lib/clang/libllvmscalaropts/Makefile.depend b/lib/clang/libllvmscalaropts/Makefile.depend
index c33d392..3c665f0 100644
--- a/lib/clang/libllvmscalaropts/Makefile.depend
+++ b/lib/clang/libllvmscalaropts/Makefile.depend
@@ -17,6 +17,8 @@ ADCE.o: Intrinsics.inc.h
ADCE.po: Intrinsics.inc.h
AlignmentFromAssumptions.o: Intrinsics.inc.h
AlignmentFromAssumptions.po: Intrinsics.inc.h
+BDCE.o: Intrinsics.inc.h
+BDCE.po: Intrinsics.inc.h
ConstantHoisting.o: Intrinsics.inc.h
ConstantHoisting.po: Intrinsics.inc.h
DeadStoreElimination.o: Intrinsics.inc.h
@@ -27,12 +29,16 @@ GVN.o: Intrinsics.inc.h
GVN.po: Intrinsics.inc.h
IndVarSimplify.o: Intrinsics.inc.h
IndVarSimplify.po: Intrinsics.inc.h
+InductiveRangeCheckElimination.o: Intrinsics.inc.h
+InductiveRangeCheckElimination.po: Intrinsics.inc.h
JumpThreading.o: Intrinsics.inc.h
JumpThreading.po: Intrinsics.inc.h
LICM.o: Intrinsics.inc.h
LICM.po: Intrinsics.inc.h
LoopIdiomRecognize.o: Intrinsics.inc.h
LoopIdiomRecognize.po: Intrinsics.inc.h
+LoopInterchange.o: Intrinsics.inc.h
+LoopInterchange.po: Intrinsics.inc.h
LoopRerollPass.o: Intrinsics.inc.h
LoopRerollPass.po: Intrinsics.inc.h
LoopRotation.o: Intrinsics.inc.h
@@ -45,14 +51,22 @@ LoopUnswitch.o: Intrinsics.inc.h
LoopUnswitch.po: Intrinsics.inc.h
LowerAtomic.o: Intrinsics.inc.h
LowerAtomic.po: Intrinsics.inc.h
+LowerExpectIntrinsic.o: Intrinsics.inc.h
+LowerExpectIntrinsic.po: Intrinsics.inc.h
MemCpyOptimizer.o: Intrinsics.inc.h
MemCpyOptimizer.po: Intrinsics.inc.h
MergedLoadStoreMotion.o: Intrinsics.inc.h
MergedLoadStoreMotion.po: Intrinsics.inc.h
+NaryReassociate.o: Intrinsics.inc.h
+NaryReassociate.po: Intrinsics.inc.h
PartiallyInlineLibCalls.o: Intrinsics.inc.h
PartiallyInlineLibCalls.po: Intrinsics.inc.h
+PlaceSafepoints.o: Intrinsics.inc.h
+PlaceSafepoints.po: Intrinsics.inc.h
Reassociate.o: Intrinsics.inc.h
Reassociate.po: Intrinsics.inc.h
+RewriteStatepointsForGC.o: Intrinsics.inc.h
+RewriteStatepointsForGC.po: Intrinsics.inc.h
SCCP.o: Intrinsics.inc.h
SCCP.po: Intrinsics.inc.h
SROA.o: Intrinsics.inc.h
@@ -67,6 +81,10 @@ SimplifyCFGPass.o: Intrinsics.inc.h
SimplifyCFGPass.po: Intrinsics.inc.h
Sink.o: Intrinsics.inc.h
Sink.po: Intrinsics.inc.h
+SpeculativeExecution.o: Intrinsics.inc.h
+SpeculativeExecution.po: Intrinsics.inc.h
+StraightLineStrengthReduce.o: Intrinsics.inc.h
+StraightLineStrengthReduce.po: Intrinsics.inc.h
StructurizeCFG.o: Intrinsics.inc.h
StructurizeCFG.po: Intrinsics.inc.h
TailRecursionElimination.o: Intrinsics.inc.h
diff --git a/lib/clang/libllvmtarget/Makefile.depend b/lib/clang/libllvmtarget/Makefile.depend
index 3e7f3f5..afcaff0 100644
--- a/lib/clang/libllvmtarget/Makefile.depend
+++ b/lib/clang/libllvmtarget/Makefile.depend
@@ -6,10 +6,15 @@ DIRDEPS = \
include/xlocale \
lib/libc++ \
lib/msun \
+ usr.bin/clang/tblgen.host \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
+TargetMachine.o: Intrinsics.inc.h
+TargetMachine.po: Intrinsics.inc.h
+TargetMachineC.o: Intrinsics.inc.h
+TargetMachineC.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvmtransformutils/Makefile.depend b/lib/clang/libllvmtransformutils/Makefile.depend
index f3a7d48..7d4d09d 100644
--- a/lib/clang/libllvmtransformutils/Makefile.depend
+++ b/lib/clang/libllvmtransformutils/Makefile.depend
@@ -31,8 +31,8 @@ Local.o: Intrinsics.inc.h
Local.po: Intrinsics.inc.h
LoopSimplify.o: Intrinsics.inc.h
LoopSimplify.po: Intrinsics.inc.h
-LowerExpectIntrinsic.o: Intrinsics.inc.h
-LowerExpectIntrinsic.po: Intrinsics.inc.h
+LoopUtils.o: Intrinsics.inc.h
+LoopUtils.po: Intrinsics.inc.h
PromoteMemoryToRegister.o: Intrinsics.inc.h
PromoteMemoryToRegister.po: Intrinsics.inc.h
SSAUpdater.o: Intrinsics.inc.h
diff --git a/lib/clang/libllvmx86codegen/Makefile.depend b/lib/clang/libllvmx86codegen/Makefile.depend
index 889d747..ad7daaf 100644
--- a/lib/clang/libllvmx86codegen/Makefile.depend
+++ b/lib/clang/libllvmx86codegen/Makefile.depend
@@ -25,6 +25,12 @@ X86CallFrameOptimization.o: X86GenSubtargetInfo.inc.h
X86CallFrameOptimization.po: X86GenInstrInfo.inc.h
X86CallFrameOptimization.po: X86GenRegisterInfo.inc.h
X86CallFrameOptimization.po: X86GenSubtargetInfo.inc.h
+X86ExpandPseudo.o: X86GenInstrInfo.inc.h
+X86ExpandPseudo.o: X86GenRegisterInfo.inc.h
+X86ExpandPseudo.o: X86GenSubtargetInfo.inc.h
+X86ExpandPseudo.po: X86GenInstrInfo.inc.h
+X86ExpandPseudo.po: X86GenRegisterInfo.inc.h
+X86ExpandPseudo.po: X86GenSubtargetInfo.inc.h
X86FastISel.o: Intrinsics.inc.h
X86FastISel.o: X86GenCallingConv.inc.h
X86FastISel.o: X86GenFastISel.inc.h
@@ -113,9 +119,11 @@ X86Subtarget.o: X86GenSubtargetInfo.inc.h
X86Subtarget.po: X86GenInstrInfo.inc.h
X86Subtarget.po: X86GenRegisterInfo.inc.h
X86Subtarget.po: X86GenSubtargetInfo.inc.h
+X86TargetMachine.o: Intrinsics.inc.h
X86TargetMachine.o: X86GenInstrInfo.inc.h
X86TargetMachine.o: X86GenRegisterInfo.inc.h
X86TargetMachine.o: X86GenSubtargetInfo.inc.h
+X86TargetMachine.po: Intrinsics.inc.h
X86TargetMachine.po: X86GenInstrInfo.inc.h
X86TargetMachine.po: X86GenRegisterInfo.inc.h
X86TargetMachine.po: X86GenSubtargetInfo.inc.h
@@ -133,4 +141,6 @@ X86VZeroUpper.o: X86GenSubtargetInfo.inc.h
X86VZeroUpper.po: X86GenInstrInfo.inc.h
X86VZeroUpper.po: X86GenRegisterInfo.inc.h
X86VZeroUpper.po: X86GenSubtargetInfo.inc.h
+X86WinEHState.o: Intrinsics.inc.h
+X86WinEHState.po: Intrinsics.inc.h
.endif
diff --git a/lib/clang/libllvmx86disassembler/Makefile.depend b/lib/clang/libllvmx86disassembler/Makefile.depend
index e463379..6f0ac76 100644
--- a/lib/clang/libllvmx86disassembler/Makefile.depend
+++ b/lib/clang/libllvmx86disassembler/Makefile.depend
@@ -19,4 +19,6 @@ X86Disassembler.o: X86GenSubtargetInfo.inc.h
X86Disassembler.po: X86GenInstrInfo.inc.h
X86Disassembler.po: X86GenRegisterInfo.inc.h
X86Disassembler.po: X86GenSubtargetInfo.inc.h
+X86DisassemblerDecoder.o: X86GenDisassemblerTables.inc.h
+X86DisassemblerDecoder.po: X86GenDisassemblerTables.inc.h
.endif
diff --git a/lib/csu/powerpc64/crti.S b/lib/csu/powerpc64/crti.S
index 767d920..00a1242 100644
--- a/lib/csu/powerpc64/crti.S
+++ b/lib/csu/powerpc64/crti.S
@@ -26,34 +26,59 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
+#ifdef _CALL_ELF
+.abiversion _CALL_ELF
+#endif
+
.section .init,"ax",@progbits
- .align 2
+ .p2align 2
.globl _init
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
.section ".opd","aw"
- .align 3
+ .p2align 3
_init:
.quad .L._init,.TOC.@tocbase,0
.previous
.type _init,@function
- .align 4
+ .p2align 4
.L._init:
+#else
+ .p2align 4
+ .globl _init
+ .type _init,@function
+_init:
+ addis %r2, %r12, (.TOC.-_init)@ha
+ addi %r2, %r2, (.TOC.-_init)@l
+ .localentry _init, .-_init
+#endif
stdu 1,-48(1)
mflr 0
std 0,64(1)
+/* Fini */
.section .fini,"ax",@progbits
- .align 2
+ .p2align 2
.globl _fini
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
.section ".opd","aw"
- .align 3
+ .p2align 3
_fini:
.quad .L._fini,.TOC.@tocbase,0
.previous
.type _fini,@function
- .align 4
+ .p2align 4
.L._fini:
+#else
+ .p2align 4
+ .globl _fini
+ .type _fini,@function
+_fini:
+ addis %r2, %r12, (.TOC.-_fini)@ha
+ addi %r2, %r2, (.TOC.-_fini)@l
+ .localentry _fini, .-_fini
+#endif
stdu 1,-48(1)
mflr 0
std 0,64(1)
diff --git a/lib/lib80211/Makefile b/lib/lib80211/Makefile
new file mode 100644
index 0000000..e00017e
--- /dev/null
+++ b/lib/lib80211/Makefile
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+LIB= 80211
+SHLIBDIR?= /lib
+SHLIB_MAJOR= 1
+SRCS= lib80211_regdomain.c lib80211_ioctl.c
+
+INCSDIR= ${INCLUDEDIR}/lib80211
+INCS= lib80211_regdomain.h lib80211_ioctl.h
+
+LIBADD= sbuf bsdxml
+
+MAN= lib80211.3
+
+CFLAGS+=-I${.CURDIR}
+
+.include <bsd.lib.mk>
diff --git a/lib/lib80211/Makefile.depend b/lib/lib80211/Makefile.depend
new file mode 100644
index 0000000..806b5fd
--- /dev/null
+++ b/lib/lib80211/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/lib80211/lib80211.3 b/lib/lib80211/lib80211.3
new file mode 100644
index 0000000..46022b5
--- /dev/null
+++ b/lib/lib80211/lib80211.3
@@ -0,0 +1,118 @@
+.\" Copyright (c) 2015 Adrian Chadd.
+.\" 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$
+.\"
+.Dd November 24, 2015
+.Dt 80211 3
+.Os
+.Sh NAME
+.Nm lib80211_alloc_regdata ,
+.Nm lib80211_free_regdata ,
+.Nm lib80211_regdomain_readconfig ,
+.Nm lib80211_regdomain_cleanup ,
+.Nm lib80211_regdomain_findbysku ,
+.Nm lib80211_regdomain_findbyname ,
+.Nm lib80211_country_findbycc ,
+.Nm lib80211_country_findbyname
+.Nd manage net80211 configuration and regulatory database.
+.Sh LIBRARY
+.Lb lib80211
+.Sh SYNOPSIS
+.In lib80211/lib80211_regdomain.h
+.In lib80211/lib80211_ioctl.h
+.Ft struct regdata *
+.Fn lib80211_alloc_regdata void
+.Ft void
+.Fn lib80211_free_regdata "struct regdata *reg"
+.Ft int
+.Fn lib80211_regdomain_readconfig "struct regdata *reg" "const void *config" "size_t size"
+.Ft void
+.Fn lib80211_regdomain_cleanup "struct regdata *reg"
+.Ft const struct regdomain *
+.Fn lib80211_regdomain_findbysku "const struct regdata *reg" "enumRegDomainCode"
+.Ft const struct regdomain *
+.Fn lib80211_regdomain_findbyname "const struct regdata *reg" "const char *sku"
+.Ft const struct country *
+.Fn lib80211_country_findbycc "const struct regdata *reg" "enum ISOCountryCode"
+.Ft const struct country *
+.Fn lib80211_country_findbyname "const struct regdata *reg" "const char *cc"
+.Sh DESCRIPTION
+The
+.Nm lib80211
+library is an interface to the
+.Xr net80211 4
+infrastructure.
+It implements wrappers around the
+.Xr net80211 4
+ioctl command, as well as providing a convenient API to access the regulatory
+database.
+.Pp
+The
+.Fn lib80211_alloc_regdata
+and
+.Fn lib80211_free_regdata
+function allocates / frees a regdata structure to store regulatory domain
+information in.
+.Pp
+The
+.Fn lib80211_regdomain_readconfig
+and
+.Fn lib80211_regdomain_cleanup
+functions read in the regulatory database XML configuration and free it when
+finished.
+.Pp
+The
+.Fn lib80211_regdomain_findbysku
+and
+.Fn lib80211_regdomain_findbyname
+functions lookup a regulatory domain entry by SKU enum and SKU name
+respectively.
+.Pp
+The
+.Fn lib80211_country_findbycc
+and
+.Fn lib80211_country_findbyname
+functions lookup a country information entry by ISO country enum and
+ISO country code string respectively.
+.Sh RETURN VALUES
+The
+.Fn lib80211_alloc_regdata ,
+.Fn lib80211_regdomain_readconfig ,
+.Fn lib80211_regdomain_findbysku ,
+.Fn lib80211_regdomain_findbyname ,
+.Fn lib80211_country_findbycc ,
+.Fn lib80211_country_findbyname
+return NULL upon error.
+
+.Sh SEE ALSO
+.Xr ifconfig 8 ,
+.Xr net80211 4
+.Sh HISTORY
+The
+.Nm lib80211
+library first appeared in
+.Fx 11.0 .
+.Sh AUTHORS
+.An Adrian Chadd
diff --git a/lib/lib80211/lib80211_ioctl.c b/lib/lib80211/lib80211_ioctl.c
new file mode 100644
index 0000000..616b4c0
--- /dev/null
+++ b/lib/lib80211/lib80211_ioctl.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2001 The Aerospace Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of The Aerospace Corporation may not be used to endorse or
+ * promote products derived from this software.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AEROSPACE CORPORATION ``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 AEROSPACE CORPORATION 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$
+ */
+
+/*-
+ * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/time.h>
+
+#include <net/ethernet.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_media.h>
+#include <net/route.h>
+
+#include <net80211/ieee80211_ioctl.h>
+#include <net80211/ieee80211_freebsd.h>
+#include <net80211/ieee80211_superg.h>
+#include <net80211/ieee80211_tdma.h>
+#include <net80211/ieee80211_mesh.h>
+
+#include <assert.h>
+#include <ctype.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <stddef.h> /* NB: for offsetof */
+
+#include "lib80211_ioctl.h"
+
+/*
+ * These implement basic net80211 accessor methods to wrap the IOCTL
+ * calls.
+ */
+
+int
+lib80211_get80211(int s, const char *name, int type, void *data, int len)
+{
+ struct ieee80211req ireq;
+
+ (void) memset(&ireq, 0, sizeof(ireq));
+ (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
+ ireq.i_type = type;
+ ireq.i_data = data;
+ ireq.i_len = len;
+ return ioctl(s, SIOCG80211, &ireq);
+}
+
+int
+lib80211_get80211len(int s, const char *name, int type, void *data, int len, int *plen)
+{
+ struct ieee80211req ireq;
+
+ (void) memset(&ireq, 0, sizeof(ireq));
+ (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
+ ireq.i_type = type;
+ ireq.i_len = len;
+ assert(ireq.i_len == len); /* NB: check for 16-bit truncation */
+ ireq.i_data = data;
+ if (ioctl(s, SIOCG80211, &ireq) < 0)
+ return -1;
+ *plen = ireq.i_len;
+ return 0;
+}
+
+int
+lib80211_get80211val(int s, const char *name, int type, int *val)
+{
+ struct ieee80211req ireq;
+
+ (void) memset(&ireq, 0, sizeof(ireq));
+ (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
+ ireq.i_type = type;
+ if (ioctl(s, SIOCG80211, &ireq) < 0)
+ return -1;
+ *val = ireq.i_val;
+ return 0;
+}
+
+int
+lib80211_set80211(int s, const char *name, int type, int val, int len, void *data)
+{
+ struct ieee80211req ireq;
+
+ (void) memset(&ireq, 0, sizeof(ireq));
+ (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
+ ireq.i_type = type;
+ ireq.i_val = val;
+ ireq.i_len = len;
+ assert(ireq.i_len == len); /* NB: check for 16-bit truncation */
+ ireq.i_data = data;
+ if (ioctl(s, SIOCS80211, &ireq) < 0)
+ return (-1);
+ return (0);
+}
+
diff --git a/lib/lib80211/lib80211_ioctl.h b/lib/lib80211/lib80211_ioctl.h
new file mode 100644
index 0000000..f890a32
--- /dev/null
+++ b/lib/lib80211/lib80211_ioctl.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2001 The Aerospace Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of The Aerospace Corporation may not be used to endorse or
+ * promote products derived from this software.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AEROSPACE CORPORATION ``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 AEROSPACE CORPORATION 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$
+ */
+
+/*-
+ * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __LIB80211_IOCTL_H__
+#define __LIB80211_IOCTL_H__
+
+extern int lib80211_get80211(int s, const char *name, int type, void *data,
+ int len);
+extern int lib80211_get80211len(int s, const char *name, int type, void *data,
+ int len, int *plen);
+extern int lib80211_get80211val(int s, const char *name, int type, int *val);
+extern int lib80211_set80211(int s, const char *name, int type, int val,
+ int len, void *data);
+
+#endif /* __LIB80211_IOCTL_H__ */
diff --git a/sbin/ifconfig/regdomain.c b/lib/lib80211/lib80211_regdomain.c
index 4140289..32901a6 100644
--- a/sbin/ifconfig/regdomain.c
+++ b/lib/lib80211/lib80211_regdomain.c
@@ -28,6 +28,7 @@ static const char rcsid[] = "$FreeBSD$";
#include <sys/types.h>
#include <sys/errno.h>
+#include <sys/param.h>
#include <sys/mman.h>
#include <sys/sbuf.h>
#include <sys/stat.h>
@@ -41,7 +42,7 @@ static const char rcsid[] = "$FreeBSD$";
#include <bsdxml.h>
-#include "regdomain.h"
+#include "lib80211_regdomain.h"
#include <net80211/_ieee80211.h>
@@ -212,9 +213,9 @@ decode_flag(struct mystate *mt, const char *p, int len)
{ "INDOOR", 6, REQ_INDOOR },
{ "OUTDOOR", 7, REQ_OUTDOOR },
};
- int i;
+ unsigned int i;
- for (i = 0; i < sizeof(flags)/sizeof(flags[0]); i++)
+ for (i = 0; i < nitems(flags); i++)
if (len == flags[i].len && iseq(p, flags[i].name))
return flags[i].value;
warnx("unknown flag \"%.*s\" at line %ld ignored",
@@ -347,7 +348,8 @@ end_element(void *data, const char *name)
}
/* </country> */
if (iseq(name, "country") && mt->country != NULL) {
- if (mt->country->code == NO_COUNTRY) {
+ /* XXX NO_COUNTRY should be in the net80211 country enum */
+ if ((int) mt->country->code == NO_COUNTRY) {
warnx("no ISO cc for country at line %ld",
XML_GetCurrentLineNumber(mt->parser));
}
@@ -392,7 +394,7 @@ findid(struct regdata *rdp, const void *id, int type)
struct ident *ip;
for (ip = rdp->ident; ip->id != NULL; ip++)
- if (ip->type == type && strcasecmp(ip->id, id) == 0)
+ if ((int) ip->type == type && strcasecmp(ip->id, id) == 0)
return ip->p;
return NULL;
}
diff --git a/sbin/ifconfig/regdomain.h b/lib/lib80211/lib80211_regdomain.h
index cfc2be0..d1803c2 100644
--- a/sbin/ifconfig/regdomain.h
+++ b/lib/lib80211/lib80211_regdomain.h
@@ -24,8 +24,8 @@
*
* $FreeBSD$
*/
-#ifndef _LIB80211_H_
-#define _LIB80211_H_
+#ifndef _LIB80211_REGDOMAIN_H_
+#define _LIB80211_REGDOMAIN_H_
#include <sys/cdefs.h>
#include <sys/queue.h>
@@ -118,4 +118,4 @@ const struct country *lib80211_country_findbyname(const struct regdata *,
__END_DECLS
-#endif /* _LIB80211_H_ */
+#endif /* _LIB80211_REGDOMAIN_H_ */
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index 55c4408..93749b9 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
.include <src.opts.mk>
-LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
+_LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
LIB= archive
@@ -37,7 +37,7 @@ CFLAGS+= -DPPMD_32BIT
.endif
NO_WCAST_ALIGN.clang=
-.PATH: ${LIBARCHIVEDIR}/libarchive
+.PATH: ${_LIBARCHIVEDIR}/libarchive
# Headers to be installed in /usr/include
INCS= archive.h archive_entry.h
diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile
index a7de76b..73ded3d 100644
--- a/lib/libarchive/tests/Makefile
+++ b/lib/libarchive/tests/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
+_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
ATF_TESTS_SH+= functional_test
@@ -9,14 +9,14 @@ BINDIR= ${TESTSDIR}
PROGS+= libarchive_test
CFLAGS+= -I${.CURDIR:H} -I${.OBJDIR}
-CFLAGS+= -I${LIBARCHIVEDIR}/libarchive -I${LIBARCHIVEDIR}/test_utils
+CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/test_utils
CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
# Uncomment to link against dmalloc
#LDADD+= -L/usr/local/lib -ldmalloc
#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
-.PATH: ${LIBARCHIVEDIR}/libarchive/test
+.PATH: ${_LIBARCHIVEDIR}/libarchive/test
TESTS_SRCS= \
test_acl_freebsd_nfs4.c \
test_acl_freebsd_posix1e.c \
@@ -249,12 +249,12 @@ SRCS.libarchive_test= \
LIBADD.libarchive_test= archive
-.PATH: ${LIBARCHIVEDIR}/test_utils
+.PATH: ${_LIBARCHIVEDIR}/test_utils
SRCS.libarchive_test+= test_utils.c
# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines
list.h: ${TESTS_SRCS} Makefile
- @(cd ${LIBARCHIVEDIR}/libarchive/test && \
+ @(cd ${_LIBARCHIVEDIR}/libarchive/test && \
grep -h DEFINE_TEST ${.ALLSRC:N*Makefile} | \
egrep -v '${BROKEN_TESTS:tW:C/ /|/g}') > ${.TARGET}.tmp
@mv ${.TARGET}.tmp ${.TARGET}
diff --git a/lib/libauditd/Makefile b/lib/libauditd/Makefile
index cee1850..10039e9 100644
--- a/lib/libauditd/Makefile
+++ b/lib/libauditd/Makefile
@@ -3,19 +3,19 @@
#
OPENBSMDIR= ${.CURDIR}/../../contrib/openbsm
-LIBAUDITDDIR= ${OPENBSMDIR}/libauditd
-LIBBSMDIR= ${OPENBSMDIR}/libbsm
+_LIBAUDITDDIR= ${OPENBSMDIR}/libauditd
+_LIBBSMDIR= ${OPENBSMDIR}/libbsm
LIB= auditd
-.PATH: ${LIBAUDITDDIR}
+.PATH: ${_LIBAUDITDDIR}
SRCS= auditd_lib.c
#
# Must use BSM include files from within the contrib area, not the system.
#
-CFLAGS+= -I${OPENBSMDIR} -I${LIBBSMDIR}
+CFLAGS+= -I${OPENBSMDIR} -I${_LIBBSMDIR}
WARNS?= 3
diff --git a/usr.bin/vgrind/RETEST/Makefile.depend b/lib/libbsdstat/Makefile.depend
index 79eb58b..3646e2e 100644
--- a/usr.bin/vgrind/RETEST/Makefile.depend
+++ b/lib/libbsdstat/Makefile.depend
@@ -2,11 +2,13 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
.include <dirdeps.mk>
diff --git a/lib/libbsm/Makefile b/lib/libbsm/Makefile
index eec2c40..488cbe6 100644
--- a/lib/libbsm/Makefile
+++ b/lib/libbsm/Makefile
@@ -3,12 +3,12 @@
#
OPENBSMDIR= ${.CURDIR}/../../contrib/openbsm
-LIBBSMDIR= ${OPENBSMDIR}/libbsm
+_LIBBSMDIR= ${OPENBSMDIR}/libbsm
LIB= bsm
SHLIB_MAJOR= 3
-.PATH: ${LIBBSMDIR}
+.PATH: ${_LIBBSMDIR}
.PATH: ${OPENBSMDIR}/bsm
.PATH: ${OPENBSMDIR}/man
@@ -31,7 +31,7 @@ SRCS= bsm_audit.c \
#
# Must use BSM include files from within the contrib area, not the system.
#
-CFLAGS+= -I${OPENBSMDIR} -I${LIBBSMDIR}
+CFLAGS+= -I${OPENBSMDIR} -I${_LIBBSMDIR}
WARNS?= 1
diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile
index d9b0360..d81710e 100644
--- a/lib/libc++/Makefile
+++ b/lib/libc++/Makefile
@@ -2,7 +2,7 @@
.include <src.opts.mk>
-LIBCXXRTDIR= ${.CURDIR}/../../contrib/libcxxrt
+_LIBCXXRTDIR= ${.CURDIR}/../../contrib/libcxxrt
HDRDIR= ${.CURDIR}/../../contrib/libc++/include
SRCDIR= ${.CURDIR}/../../contrib/libc++/src
CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR}
@@ -52,12 +52,12 @@ CXXRT_SRCS+= libelftc_dem_gnu3.c\
.for _S in ${CXXRT_SRCS}
STATICOBJS+= cxxrt_${_S:R}.o
-cxxrt_${_S}: ${LIBCXXRTDIR}/${_S} .NOMETA
+cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
.endfor
WARNS= 0
-CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT
+CFLAGS+= -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdlib -DLIBCXXRT
.if empty(CXXFLAGS:M-std=*)
CXXFLAGS+= -std=c++11
.endif
@@ -172,7 +172,7 @@ STD+= ${HDRDIR}/${hdr}
INCSLINKS+= ${CXXINCLUDEDIR}/${hdr} ${CXXINCLUDEDIR}/tr1/${hdr}
.endfor
.for hdr in ${RT_HEADERS}
-STD+= ${LIBCXXRTDIR}/${hdr}
+STD+= ${_LIBCXXRTDIR}/${hdr}
.endfor
STDDIR= ${CXXINCLUDEDIR}
@@ -206,14 +206,10 @@ EXTDIR= ${CXXINCLUDEDIR}/ext
CLEANFILES+= libstdc++.so libstdc++.a
afterinstall:
- ln -sf ${DESTDIR}${LIBDIR}/lib${LIB}.so \
+ ${INSTALL_SYMLINK} ${DESTDIR}${LIBDIR}/lib${LIB}.so \
${.OBJDIR}/libstdc++.so
- ln -sf ${DESTDIR}${LIBDIR}/lib${LIB}.a \
+ ${INSTALL_SYMLINK} ${DESTDIR}${LIBDIR}/lib${LIB}.a \
${.OBJDIR}/libstdc++.a
.endif
-# avoid cyclic dependency
-CFLAGS+= -I${LIBCXXRTDIR}
-GENDIRDEPS_FILTER= N*/libcxxrt
-
.include <bsd.lib.mk>
diff --git a/lib/libc++/Makefile.depend b/lib/libc++/Makefile.depend
index cb81639..39735a8 100644
--- a/lib/libc++/Makefile.depend
+++ b/lib/libc++/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libcxxrt \
lib/msun \
diff --git a/lib/libc/regex/grot/Makefile b/lib/libc/regex/grot/Makefile
index 3e41724..e715dd8 100644
--- a/lib/libc/regex/grot/Makefile
+++ b/lib/libc/regex/grot/Makefile
@@ -62,7 +62,8 @@ regexec.o: engine.c engine.ih
regerror.o: regerror.ih
regerror.o: utils.h
debug.o: debug.ih
-main.o: main.ih
+main.o: debug.ih main.ih split.ih
+split.o: split.ih
r: re tests
./re <tests
diff --git a/lib/libc/regex/grot/debug.c b/lib/libc/regex/grot/debug.c
index caa2ca3..af8e4f5 100644
--- a/lib/libc/regex/grot/debug.c
+++ b/lib/libc/regex/grot/debug.c
@@ -186,7 +186,7 @@ FILE *d;
fprintf(d, ">");
break;
default:
- fprintf(d, "!%d(%d)!", OP(*s), opnd);
+ fprintf(d, "!%ld(%ld)!", OP(*s), (long)opnd);
break;
}
if (!done)
diff --git a/lib/libc/regex/grot/main.c b/lib/libc/regex/grot/main.c
index 9563de4..eee541b 100644
--- a/lib/libc/regex/grot/main.c
+++ b/lib/libc/regex/grot/main.c
@@ -1,13 +1,17 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <stdio.h>
-#include <string.h>
#include <sys/types.h>
-#include <regex.h>
#include <assert.h>
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "debug.ih"
#include "main.ih"
+#include "split.ih"
char *progname;
int debug = 0;
@@ -20,15 +24,11 @@ regoff_t startoff = 0;
regoff_t endoff = 0;
-extern int split();
-extern void regprint();
-
/*
- main - do the simple case, hand off to regress() for regression
*/
-main(argc, argv)
-int argc;
-char *argv[];
+int
+main(int argc, char **argv)
{
regex_t re;
# define NS 10
@@ -80,43 +80,43 @@ char *argv[];
err = regcomp(&re, argv[optind++], copts);
if (err) {
len = regerror(err, &re, erbuf, sizeof(erbuf));
- fprintf(stderr, "error %s, %d/%d `%s'\n",
- eprint(err), len, sizeof(erbuf), erbuf);
+ fprintf(stderr, "error %s, %zu/%zu `%s'\n",
+ eprint(err), len, sizeof(erbuf), erbuf);
exit(status);
}
- regprint(&re, stdout);
+ regprint(&re, stdout);
if (optind >= argc) {
regfree(&re);
exit(status);
}
- if (eopts&REG_STARTEND) {
+ if ((eopts & REG_STARTEND) != 0) {
subs[0].rm_so = startoff;
subs[0].rm_eo = strlen(argv[optind]) - endoff;
}
err = regexec(&re, argv[optind], (size_t)NS, subs, eopts);
if (err) {
len = regerror(err, &re, erbuf, sizeof(erbuf));
- fprintf(stderr, "error %s, %d/%d `%s'\n",
- eprint(err), len, sizeof(erbuf), erbuf);
+ fprintf(stderr, "error %s, %zu/%zu `%s'\n",
+ eprint(err), len, sizeof(erbuf), erbuf);
exit(status);
}
- if (!(copts&REG_NOSUB)) {
+ if ((copts & REG_NOSUB) == 0) {
len = (int)(subs[0].rm_eo - subs[0].rm_so);
if (subs[0].rm_so != -1) {
if (len != 0)
- printf("match `%.*s'\n", len,
- argv[optind] + subs[0].rm_so);
+ printf("match `%.*s'\n", (int)len,
+ argv[optind] + subs[0].rm_so);
else
printf("match `'@%.1s\n",
- argv[optind] + subs[0].rm_so);
+ argv[optind] + subs[0].rm_so);
}
for (i = 1; i < NS; i++)
if (subs[i].rm_so != -1)
printf("(%d) `%.*s'\n", i,
- (int)(subs[i].rm_eo - subs[i].rm_so),
- argv[optind] + subs[i].rm_so);
+ (int)(subs[i].rm_eo - subs[i].rm_so),
+ argv[optind] + subs[i].rm_so);
}
exit(status);
}
@@ -126,8 +126,7 @@ char *argv[];
== void regress(FILE *in);
*/
void
-regress(in)
-FILE *in;
+regress(FILE *in)
{
char inbuf[1000];
# define MAXF 10
@@ -174,13 +173,13 @@ FILE *in;
}
ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT);
if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' ||
- ne != strlen(badpat)+1) {
+ ne != strlen(badpat)+1) {
fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n",
erbuf, SHORT-1, badpat);
status = 1;
}
ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, sizeof(erbuf));
- if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) {
+ if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname) + 1) {
fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n",
erbuf, bpname);
status = 1;
@@ -191,7 +190,7 @@ FILE *in;
fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n",
erbuf, (long)REG_BADPAT);
status = 1;
- } else if (ne != strlen(erbuf)+1) {
+ } else if (ne != strlen(erbuf) + 1) {
fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n",
erbuf, (long)REG_BADPAT);
status = 1;
@@ -201,28 +200,21 @@ FILE *in;
/*
- try - try it, and report on problems
== void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts);
+ - opts: may not match f1
*/
void
-try(f0, f1, f2, f3, f4, opts)
-char *f0;
-char *f1;
-char *f2;
-char *f3;
-char *f4;
-int opts; /* may not match f1 */
+try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts)
{
regex_t re;
# define NSUBS 10
regmatch_t subs[NSUBS];
# define NSHOULD 15
char *should[NSHOULD];
- int nshould;
char erbuf[100];
- int err;
- int len;
- char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE";
- int i;
+ size_t len;
+ int err, i, nshould;
char *grump;
+ char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE";
char f0copy[1000];
char f2copy[1000];
@@ -233,9 +225,8 @@ int opts; /* may not match f1 */
if (err != 0 && (!opt('C', f1) || err != efind(f2))) {
/* unexpected error or wrong error */
len = regerror(err, &re, erbuf, sizeof(erbuf));
- fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n",
- line, type, eprint(err), len,
- sizeof(erbuf), erbuf);
+ fprintf(stderr, "%d: %s error %s, %zu/%zu `%s'\n",
+ line, type, eprint(err), len, sizeof(erbuf), erbuf);
status = 1;
} else if (err == 0 && opt('C', f1)) {
/* unexpected success */
@@ -264,16 +255,15 @@ int opts; /* may not match f1 */
if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) {
/* unexpected error or wrong error */
len = regerror(err, &re, erbuf, sizeof(erbuf));
- fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n",
- line, type, eprint(err), len,
- sizeof(erbuf), erbuf);
+ fprintf(stderr, "%d: %s exec error %s, %zu/%zu `%s'\n",
+ line, type, eprint(err), len, sizeof(erbuf), erbuf);
status = 1;
} else if (err != 0) {
/* nothing more to check */
} else if (f3 == NULL) {
/* unexpected success */
fprintf(stderr, "%d: %s exec should have failed\n",
- line, type);
+ line, type);
status = 1;
err = 1; /* just on principle */
} else if (opts&REG_NOSUB) {
@@ -300,7 +290,7 @@ int opts; /* may not match f1 */
grump = check(f2, subs[i], should[i]);
if (grump != NULL) {
fprintf(stderr, "%d: %s $%d %s\n", line,
- type, i, grump);
+ type, i, grump);
status = 1;
err = 1;
}
@@ -311,12 +301,11 @@ int opts; /* may not match f1 */
/*
- options - pick options out of a regression-test string
+ - type: 'c' - compile, 'e' - exec
== int options(int type, char *s);
*/
int
-options(type, s)
-int type; /* 'c' compile, 'e' exec */
-char *s;
+options(int type, char *s)
{
char *p;
int o = (type == 'c') ? copts : eopts;
@@ -371,9 +360,7 @@ char *s;
== int opt(int c, char *s);
*/
int /* predicate */
-opt(c, s)
-int c;
-char *s;
+opt(int c, char *s)
{
return(strchr(s, c) != NULL);
}
@@ -383,8 +370,7 @@ char *s;
== void fixstr(char *p);
*/
void
-fixstr(p)
-char *p;
+fixstr(char *p)
{
if (p == NULL)
return;
@@ -405,10 +391,7 @@ char *p;
== char *check(char *str, regmatch_t sub, char *should);
*/
char * /* NULL or complaint */
-check(str, sub, should)
-char *str;
-regmatch_t sub;
-char *should;
+check(char *str, regmatch_t sub, char *should)
{
int len;
int shlen;
@@ -442,7 +425,7 @@ char *should;
/* check for in range */
if (sub.rm_eo > strlen(str)) {
sprintf(grump, "start %ld end %ld, past end of string",
- (long)sub.rm_so, (long)sub.rm_eo);
+ (long)sub.rm_so, (long)sub.rm_eo);
return(grump);
}
@@ -482,8 +465,7 @@ char *should;
== static char *eprint(int err);
*/
static char *
-eprint(err)
-int err;
+eprint(int err)
{
static char epbuf[100];
size_t len;
@@ -498,8 +480,7 @@ int err;
== static int efind(char *name);
*/
static int
-efind(name)
-char *name;
+efind(char *name)
{
static char efbuf[100];
size_t n;
diff --git a/lib/libc/regex/grot/split.c b/lib/libc/regex/grot/split.c
index 70e0ec5..c5d5264 100644
--- a/lib/libc/regex/grot/split.c
+++ b/lib/libc/regex/grot/split.c
@@ -4,16 +4,17 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <string.h>
+#include "split.ih"
+
/*
- split - divide a string into fields, like awk split()
- = int split(char *string, char *fields[], int nfields, char *sep);
+ == int split(char *string, char *fields[], int nfields, char *sep);
+ - fields: list is not NULL-terminated
+ - nfields: number of entries available in fields[]
+ - sep: "" white, "c" single char, "ab" [ab]+
*/
int /* number of fields, including overflow */
-split(string, fields, nfields, sep)
-char *string;
-char *fields[]; /* list is not NULL-terminated */
-int nfields; /* number of entries available in fields[] */
-char *sep; /* "" white, "c" single char, "ab" [ab]+ */
+split(char *string, char *fields[], int nfields, char *sep)
{
char *p = string;
char c; /* latest character */
@@ -151,9 +152,7 @@ char *sep; /* "" white, "c" single char, "ab" [ab]+ */
* pgm str sep n splits str by sep n times
*/
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
char buf[512];
int n;
@@ -182,9 +181,8 @@ char *argv[];
exit(0);
}
-dosplit(string, seps)
-char *string;
-char *seps;
+void
+dosplit(char *string, char *seps)
{
# define NF 5
char *fields[NF];
@@ -194,10 +192,8 @@ char *seps;
print(nf, NF, fields);
}
-print(nf, nfp, fields)
-int nf;
-int nfp;
-char *fields[];
+void
+print(int nf, int nfp, char *fields[])
{
int fn;
int bound;
@@ -277,7 +273,8 @@ struct {
NULL, NULL, 0, { NULL },
};
-regress()
+void
+regress(void)
{
char buf[512];
int n;
diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile
index 476b5b7..b700312 100644
--- a/lib/libc/tests/gen/Makefile
+++ b/lib/libc/tests/gen/Makefile
@@ -45,20 +45,14 @@ NETBSD_ATF_TESTS_C+= vis_test
.include "../Makefile.netbsd-tests"
-LDADD.humanize_number_test+= -lutil
-DPADD.humanize_number_test+= ${LIBUTIL}
+LIBADD.humanize_number_test+= util
-LDADD.fpclassify_test+= -lm
-DPADD.fpclassify_test+= ${LIBM}
-LDADD.fpsetround_test+= -lm
-DPADD.fpsetround_test+= ${LIBM}
-LDADD.siginfo_test+= -lm
-DPADD.siginfo_test+= ${LIBM}
+LIBADD.fpclassify_test+=m
+LIBADD.fpsetround_test+=m
+LIBADD.siginfo_test+= m
-LDADD.nice_test+= -lpthread
-DPADD.nice_test+= ${LIBPTHREAD}
-LDADD.syslog_test+= -lpthread
-DPADD.syslog_test+= ${LIBPTHREAD}
+LIBADD.nice_test+= pthread
+LIBADD.syslog_test+= pthread
CFLAGS+= -I${.CURDIR}
diff --git a/lib/libc/tests/hash/Makefile b/lib/libc/tests/hash/Makefile
index 6887253..6facb5a 100644
--- a/lib/libc/tests/hash/Makefile
+++ b/lib/libc/tests/hash/Makefile
@@ -22,10 +22,8 @@ FILES+= data/sha1test-in
FILES+= data/sha1test-out
FILES+= data/sha1test2-out
-DPADD+= ${LIBMD}
-LDADD+= -lmd
-DPADD.sha2_test+= ${LIBCRYPTO}
-LDADD.sha2_test+= -lcrypto
+LIBADD+= md
+LIBADD.sha2_test+= crypto
CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh/openbsd-compat
CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh
diff --git a/lib/libc/tests/net/Makefile b/lib/libc/tests/net/Makefile
index 3e437a0..e126848 100644
--- a/lib/libc/tests/net/Makefile
+++ b/lib/libc/tests/net/Makefile
@@ -23,8 +23,7 @@ PROGS+= h_protoent
PROGS+= h_servent
PROGS+= h_dns_server
-DPADD.h_nsd_recurse+= ${LIBPTHREAD}
-LDADD.h_nsd_recurse+= -lpthread
+LIBADD.h_nsd_recurse+= pthread
CLEANFILES+= aton_ether_subr.c
aton_ether_subr.c: gen_ether_subr ${SRCTOP}/sys/net/if_ethersubr.c
diff --git a/lib/libc/tests/regex/Makefile b/lib/libc/tests/regex/Makefile
index fa60f6e..946bc44 100644
--- a/lib/libc/tests/regex/Makefile
+++ b/lib/libc/tests/regex/Makefile
@@ -51,7 +51,6 @@ CFLAGS.$t+= -I${TESTSRC} ${IMPLEMENTATION}
.include "../Makefile.netbsd-tests"
-DPADD.regex_att_test+= ${LIBUTIL}
-LDADD.regex_att_test+= -lutil
+LIBADD.regex_att_test+= util
.include <bsd.test.mk>
diff --git a/lib/libc/tests/rpc/Makefile b/lib/libc/tests/rpc/Makefile
index f9819d3..d7780ef 100644
--- a/lib/libc/tests/rpc/Makefile
+++ b/lib/libc/tests/rpc/Makefile
@@ -18,8 +18,7 @@ h_testbits_xdr.c: ${RPCSRC} h_testbits.h
CLEANFILES+= ${RPCSRC:.x=.h} ${RPCSRC:.x=.c} h_testbits_xdr.c
CFLAGS+= -I${.OBJDIR}
-LDADD+= -lrpcsvc -lutil
-DPADD+= ${LIBRPCSVC} ${LIBUTIL}
+LIBADD+= rpcsvc util
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/setjmp/Makefile b/lib/libc/tests/setjmp/Makefile
index ac962c2..39b0a96 100644
--- a/lib/libc/tests/setjmp/Makefile
+++ b/lib/libc/tests/setjmp/Makefile
@@ -3,8 +3,7 @@
NETBSD_ATF_TESTS_C= setjmp_test
NETBSD_ATF_TESTS_C+= threadjmp_test
-DPADD.threadjmp_test+= ${LIBPTHREAD}
-LDADD.threadjmp_test+= -lpthread
+LIBADD.t_threadjmp+= pthread
WARNS?= 4
diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile
index dff1578..61caced 100644
--- a/lib/libc/tests/ssp/Makefile
+++ b/lib/libc/tests/ssp/Makefile
@@ -10,8 +10,7 @@ CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector
CFLAGS.h_raw+= -fsanitize=bounds
.elif ${COMPILER_TYPE} == "gcc"
CFLAGS.h_raw+= --param ssp-buffer-size=1
-DPADD+= ${LIBSSP}
-LDADD+= -lssp
+LDADD+= -lssp
.endif
NETBSD_ATF_TESTS_SH= ssp_test
diff --git a/lib/libc/tests/stdio/Makefile b/lib/libc/tests/stdio/Makefile
index 7896422..72685e0 100644
--- a/lib/libc/tests/stdio/Makefile
+++ b/lib/libc/tests/stdio/Makefile
@@ -28,11 +28,8 @@ NETBSD_ATF_TESTS_C+= popen_test
NETBSD_ATF_TESTS_C+= printf_test
NETBSD_ATF_TESTS_C+= scanf_test
-DPADD.printfloat_test+= ${LIBM}
-LDADD.printfloat_test+= -lm
-
-DPADD.scanfloat_test+= ${LIBM}
-LDADD.scanfloat_test+= -lm
+LIBADD.printfloat_test+= m
+LIBADD.scanfloat_test+= m
.if ${COMPILER_TYPE} == "gcc"
# 90: use of assignment suppression and length modifier together in scanf format
diff --git a/lib/libc/tests/stdio/getdelim_test.c b/lib/libc/tests/stdio/getdelim_test.c
index ffc6810..b7596b3 100644
--- a/lib/libc/tests/stdio/getdelim_test.c
+++ b/lib/libc/tests/stdio/getdelim_test.c
@@ -177,6 +177,7 @@ ATF_TC_BODY(nul, tc)
char *line;
size_t linecap, n;
+ errno = 0;
line = NULL;
linecap = 0;
/* Make sure a NUL delimiter works. */
diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile
index cd2c06e..4bc1354 100644
--- a/lib/libc/tests/stdlib/Makefile
+++ b/lib/libc/tests/stdlib/Makefile
@@ -36,11 +36,9 @@ CFLAGS+= -I${.CURDIR}
CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests
LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR}
-DPADD.$t+= ${LIBNETBSD} ${LIBUTIL}
-LDADD.$t+= -lnetbsd -lutil
+LIBADD.${t}+= netbsd util
.endfor
-DPADD.strtod_test+= ${LIBM}
-LDADD.strtod_test+= -lm
+LIBADD.strtod_test+= m
.include <bsd.test.mk>
diff --git a/lib/libc/tests/string/Makefile b/lib/libc/tests/string/Makefile
index 14044f4..9c677b7 100644
--- a/lib/libc/tests/string/Makefile
+++ b/lib/libc/tests/string/Makefile
@@ -27,10 +27,7 @@ SRCS.strerror2_test= strerror_test.c
.include "../Makefile.netbsd-tests"
-LDADD.memchr_test+= -lmd
-DPADD.memchr_test+= ${LIBMD}
-
-LDADD.memcpy_test+= -lmd
-DPADD.memcpy_test+= ${LIBMD}
+LIBADD.memchr_test+= md
+LIBADD.memcpy_test+= md
.include <bsd.test.mk>
diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile
index 816b962..efc892c 100644
--- a/lib/libc/tests/sys/Makefile
+++ b/lib/libc/tests/sys/Makefile
@@ -57,10 +57,8 @@ NETBSD_ATF_TESTS_C+= umask_test
NETBSD_ATF_TESTS_C+= unlink_test
NETBSD_ATF_TESTS_C+= write_test
-DPADD.getpid_test+= ${LIBPTHREAD}
-LDADD.getpid_test+= -lpthread
-DPADD.timer_create_test+= ${LIBRT}
-LDADD.timer_create_test+= -lrt
+LIBADD.getpid_test+= pthread
+LIBADD.timer_create_test+= rt
.include "../Makefile.netbsd-tests"
diff --git a/lib/libc/tests/tls/Makefile b/lib/libc/tests/tls/Makefile
index b6b6719..cbf441d 100644
--- a/lib/libc/tests/tls/Makefile
+++ b/lib/libc/tests/tls/Makefile
@@ -18,17 +18,16 @@ NETBSD_ATF_TESTS_C+= tls_dynamic_test
DSODIR= ${.OBJDIR}/../tls_dso
-DPADD.tls_static_test+= ${LIBPTHREAD}
-LDADD.tls_static_test+= -lpthread
+LIBADD.tls_static_test+= pthread
LDFLAGS.tls_static_test+= -static
SRCS.tls_static_test= t_tls_static.c t_tls_static_helper.c
-DPADD.tls_dynamic_test+= ${LIBPTHREAD} ${DSODIR}/libh_tls_dynamic.so
-LDADD.tls_dynamic_test+= -lpthread -lh_tls_dynamic
+DPADD.tls_dynamic_test+= ${DSODIR}/libh_tls_dynamic.so
+LDADD.tls_dynamic_test+= -lh_tls_dynamic
LDFLAGS.tls_dynamic_test+= -Wl,-rpath,${TESTSDIR} -L${DSODIR}
+LIBADD.tls_dynamic_test+= pthread
-DPADD.tls_dlopen_test+= ${LIBPTHREAD}
-LDADD.tls_dlopen_test+= -lpthread
+LIBADD.tls_dlopen_test+= pthread
LDFLAGS.tls_dlopen_test+= -Wl,-rpath,${TESTSDIR} -Wl,-export-dynamic
.include <bsd.test.mk>
diff --git a/lib/libc/tests/ttyio/Makefile b/lib/libc/tests/ttyio/Makefile
index 242f332..d5b8f01 100644
--- a/lib/libc/tests/ttyio/Makefile
+++ b/lib/libc/tests/ttyio/Makefile
@@ -5,8 +5,7 @@
# TODO: ptm_test
NETBSD_ATF_TESTS_C= ttyio_test
-DPADD.ttyio_test+= ${LIBUTIL}
-LDADD.ttyio_test+= -lutil
+LIBADD.ttyio_test+= util
.include "../Makefile.netbsd-tests"
diff --git a/lib/libcasper/Makefile.depend b/lib/libcasper/Makefile.depend
new file mode 100644
index 0000000..529a2cf
--- /dev/null
+++ b/lib/libcasper/Makefile.depend
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libpjdlog \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/Makefile b/lib/libclang_rt/Makefile
index 18ad0d4..ce86dc1 100644
--- a/lib/libclang_rt/Makefile
+++ b/lib/libclang_rt/Makefile
@@ -3,7 +3,8 @@
.include <src.opts.mk>
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-SUBDIR+= asan\
+SUBDIR+= include\
+ asan\
asan-preinit\
asan_cxx\
safestack\
diff --git a/lib/libclang_rt/Makefile.inc b/lib/libclang_rt/Makefile.inc
index ef381c9..f9bd454 100644
--- a/lib/libclang_rt/Makefile.inc
+++ b/lib/libclang_rt/Makefile.inc
@@ -5,7 +5,8 @@
CRTARCH=${MACHINE_CPUARCH:C/amd64/x86_64/}
CRTSRC=${.CURDIR}/../../../contrib/compiler-rt
-LIBDIR=/usr/lib/clang/3.7.0/lib/freebsd
+CLANGDIR=/usr/lib/clang/3.7.0
+LIBDIR=${CLANGDIR}/lib/freebsd
NO_PIC=
MK_PROFILE=no
diff --git a/lib/libclang_rt/asan-preinit/Makefile.depend b/lib/libclang_rt/asan-preinit/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/lib/libclang_rt/asan-preinit/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/asan/Makefile.depend b/lib/libclang_rt/asan/Makefile.depend
new file mode 100644
index 0000000..1df7d33
--- /dev/null
+++ b/lib/libclang_rt/asan/Makefile.depend
@@ -0,0 +1,16 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/libc++ \
+ lib/ncurses/ncursesw \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/asan_cxx/Makefile.depend b/lib/libclang_rt/asan_cxx/Makefile.depend
new file mode 100644
index 0000000..79506ce
--- /dev/null
+++ b/lib/libclang_rt/asan_cxx/Makefile.depend
@@ -0,0 +1,12 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/include/Makefile b/lib/libclang_rt/include/Makefile
new file mode 100644
index 0000000..5638d4f
--- /dev/null
+++ b/lib/libclang_rt/include/Makefile
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+.include <bsd.init.mk>
+
+.PATH: ${CRTSRC}/include/sanitizer
+
+INCSDIR=${CLANGDIR}/include/sanitizer
+
+INCS= allocator_interface.h\
+ asan_interface.h\
+ common_interface_defs.h\
+ coverage_interface.h\
+ dfsan_interface.h\
+ linux_syscall_hooks.h\
+ lsan_interface.h\
+ msan_interface.h\
+ tsan_interface_atomic.h
+
+.include <bsd.prog.mk>
diff --git a/lib/libclang_rt/include/Makefile.depend b/lib/libclang_rt/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/lib/libclang_rt/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/profile/Makefile.depend b/lib/libclang_rt/profile/Makefile.depend
new file mode 100644
index 0000000..18be76b
--- /dev/null
+++ b/lib/libclang_rt/profile/Makefile.depend
@@ -0,0 +1,13 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/safestack/Makefile.depend b/lib/libclang_rt/safestack/Makefile.depend
new file mode 100644
index 0000000..082e283
--- /dev/null
+++ b/lib/libclang_rt/safestack/Makefile.depend
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/ncurses/ncursesw \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/ubsan_standalone/Makefile.depend b/lib/libclang_rt/ubsan_standalone/Makefile.depend
new file mode 100644
index 0000000..1df7d33
--- /dev/null
+++ b/lib/libclang_rt/ubsan_standalone/Makefile.depend
@@ -0,0 +1,16 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/libc++ \
+ lib/ncurses/ncursesw \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libclang_rt/ubsan_standalone_cxx/Makefile.depend b/lib/libclang_rt/ubsan_standalone_cxx/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/lib/libclang_rt/ubsan_standalone_cxx/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcrypt/tests/Makefile b/lib/libcrypt/tests/Makefile
index 7be335f..15798b2 100644
--- a/lib/libcrypt/tests/Makefile
+++ b/lib/libcrypt/tests/Makefile
@@ -1,12 +1,12 @@
# $FreeBSD$
-#ATF_TESTS_C+= crypt_tests
-#
-#NETBSD_ATF_TESTS_C+= crypt_test
-#
-#CFLAGS+= -I${.CURDIR:H}
-#LIBADD= crypt
-#
+ATF_TESTS_C+= crypt_tests
+
+NETBSD_ATF_TESTS_C+= crypt_test
+
+CFLAGS+= -I${.CURDIR:H}
+LIBADD= crypt
+
.include <netbsd-tests.test.mk>
.include <bsd.test.mk>
diff --git a/lib/libdevctl/Makefile.depend b/lib/libdevctl/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/lib/libdevctl/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile
index b8aa4df..f622921 100644
--- a/lib/libelf/Makefile
+++ b/lib/libelf/Makefile
@@ -1,4 +1,7 @@
# $FreeBSD$
+
+SHLIBDIR?= /lib
+
.include <bsd.own.mk>
TOP= ${.CURDIR}/../../contrib/elftoolchain
diff --git a/lib/libevent/Makefile.depend b/lib/libevent/Makefile.depend
index 18be76b..3646e2e 100644
--- a/lib/libevent/Makefile.depend
+++ b/lib/libevent/Makefile.depend
@@ -2,8 +2,13 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
include \
include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
.include <dirdeps.mk>
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3
index 53a4e42..0ad9166 100644
--- a/lib/libfetch/fetch.3
+++ b/lib/libfetch/fetch.3
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 25, 2015
+.Dd November 29, 2015
.Dt FETCH 3
.Os
.Sh NAME
@@ -631,11 +631,11 @@ If defined but empty, no User-Agent header is sent.
.It Ev NETRC
Specifies a file to use instead of
.Pa ~/.netrc
-to look up login names and passwords for FTP sites.
+to look up login names and passwords for FTP and HTTP sites as well as
+HTTP proxies.
See
.Xr ftp 1
for a description of the file format.
-This feature is experimental.
.It Ev NO_PROXY
Either a single asterisk, which disables the use of proxies
altogether, or a comma- or whitespace-separated list of hosts for
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index f6a7454..51cac70 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -1658,6 +1658,9 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us,
http_seterr(HTTP_NEED_PROXY_AUTH);
goto ouch;
}
+ } else if (fetch_netrc_auth(purl) == 0) {
+ aparams.user = strdup(purl->user);
+ aparams.password = strdup(purl->pwd);
}
http_authorize(conn, "Proxy-Authorization",
&proxy_challenges, &aparams, url);
@@ -1685,6 +1688,9 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us,
http_seterr(HTTP_NEED_AUTH);
goto ouch;
}
+ } else if (fetch_netrc_auth(url) == 0) {
+ aparams.user = strdup(url->user);
+ aparams.password = strdup(url->pwd);
} else if (fetchAuthMethod &&
fetchAuthMethod(url) == 0) {
aparams.user = strdup(url->user);
diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile
index 4608254..33f8e5b 100644
--- a/lib/libkvm/Makefile
+++ b/lib/libkvm/Makefile
@@ -1,50 +1,38 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-.if defined(TARGET_ARCH) && !defined(COMPAT_32BIT)
-KVM_XARCH=${TARGET_ARCH}
-KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/}
-.else
-KVM_XARCH=${MACHINE_ARCH}
-KVM_XCPUARCH=${MACHINE_CPUARCH}
-.endif
-
-.if ${KVM_XARCH} != ${MACHINE_ARCH}
-LIB= kvm-${KVM_XARCH}
-CFLAGS+=-DCROSS_LIBKVM
-.else
LIB= kvm
-.endif
SHLIBDIR?= /lib
SHLIB_MAJOR= 6
CFLAGS+=-DLIBC_SCCS -I${.CURDIR}
-.if exists(${.CURDIR}/kvm_${KVM_XARCH}.c)
-KVM_ARCH=${KVM_XARCH}
-.else
-KVM_ARCH=${KVM_XCPUARCH}
-.endif
-
WARNS?= 3
-SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \
- kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c
-.if exists(${.CURDIR}/kvm_minidump_${KVM_ARCH}.c)
-SRCS+= kvm_minidump_${KVM_ARCH}.c
-.endif
+SRCS= kvm.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \
+ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c \
+ kvm_minidump_aarch64.c \
+ kvm_amd64.c kvm_minidump_amd64.c \
+ kvm_arm.c kvm_minidump_arm.c \
+ kvm_i386.c kvm_minidump_i386.c \
+ kvm_minidump_mips.c \
+ kvm_powerpc.c kvm_powerpc64.c \
+ kvm_sparc64.c
INCS= kvm.h
+LIBADD= elf
+
MAN= kvm.3 kvm_getcptime.3 kvm_geterr.3 kvm_getfiles.3 kvm_getloadavg.3 \
- kvm_getpcpu.3 kvm_getprocs.3 kvm_getswapinfo.3 kvm_nlist.3 kvm_open.3 \
- kvm_read.3
+ kvm_getpcpu.3 kvm_getprocs.3 kvm_getswapinfo.3 kvm_native.3 \
+ kvm_nlist.3 kvm_open.3 kvm_read.3
MLINKS+=kvm_getpcpu.3 kvm_getmaxcpu.3 \
kvm_getpcpu.3 kvm_dpcpu_setcpu.3 \
kvm_getpcpu.3 kvm_read_zpcpu.3 \
kvm_getpcpu.3 kvm_counter_u64_fetch.3
MLINKS+=kvm_getprocs.3 kvm_getargv.3 kvm_getprocs.3 kvm_getenvv.3
-MLINKS+=kvm_open.3 kvm_close.3 kvm_open.3 kvm_openfiles.3
-MLINKS+=kvm_read.3 kvm_write.3
+MLINKS+=kvm_nlist.3 kvm_nlist2.3
+MLINKS+=kvm_open.3 kvm_close.3 kvm_open.3 kvm_open2.3 kvm_open.3 kvm_openfiles.3
+MLINKS+=kvm_read.3 kvm_read2.3 kvm_read.3 kvm_write.3
.include <bsd.lib.mk>
diff --git a/lib/libkvm/Makefile.depend b/lib/libkvm/Makefile.depend
index 3646e2e..b767569 100644
--- a/lib/libkvm/Makefile.depend
+++ b/lib/libkvm/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
.include <dirdeps.mk>
diff --git a/lib/libkvm/kvm.3 b/lib/libkvm/kvm.3
index 9dcd772..3838177 100644
--- a/lib/libkvm/kvm.3
+++ b/lib/libkvm/kvm.3
@@ -32,7 +32,7 @@
.\" @(#)kvm.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd April 25, 2010
+.Dd November 27, 2015
.Dt KVM 3
.Os
.Sh NAME
@@ -101,6 +101,44 @@ routine,
to return (not print out) the error message
corresponding to the most recent error condition on the
given descriptor.
+.Sh CROSS DEBUGGING
+The
+.Nm
+library supports inspection of crash dumps from non-native kernels.
+Only a limited subset of the kvm interface is supported for these dumps.
+To inspect a crash dump of a non-native kernel,
+the caller must provide a
+.Fa resolver
+function when opening a descriptor via
+.Fn kvm_open2 .
+In addition,
+the kvm interface defines an integer type
+.Pq Vt kvaddr_t
+that is large enough to hold all valid addresses of all supported
+architectures.
+The interface also defines a new namelist structure type
+.Pq Vt "struct kvm_nlist"
+for use with
+.Fn kvm_nlist2 .
+To avoid address truncation issues,
+the caller should use
+.Fn kvm_nlist2
+and
+.Fn kvm_read2
+in place of
+.Fn kvm_nlist
+and
+.Fn kvm_read ,
+respectively.
+Finally, only a limited subset of operations are supported for non-native
+crash dumps:
+.Fn kvm_close ,
+.Fn kvm_geterr
+.Fn kvm_open2 ,
+.Fn kvm_native ,
+.Fn kvm_nlist2 ,
+and
+.Fn kvm_read2 .
.Sh SEE ALSO
.Xr kvm_close 3 ,
.Xr kvm_getargv 3 ,
@@ -110,10 +148,14 @@ given descriptor.
.Xr kvm_getloadavg 3 ,
.Xr kvm_getprocs 3 ,
.Xr kvm_getswapinfo 3 ,
+.Xr kvm_native 3 ,
.Xr kvm_nlist 3 ,
+.Xr kvm_nlist2 3 ,
.Xr kvm_open 3 ,
+.Xr kvm_open2 3 ,
.Xr kvm_openfiles 3 ,
.Xr kvm_read 3 ,
+.Xr kvm_read2 3 ,
.Xr kvm_write 3 ,
.Xr sysctl 3 ,
.Xr kmem 4 ,
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c
index 4ff62c9..4cbda47 100644
--- a/lib/libkvm/kvm.c
+++ b/lib/libkvm/kvm.c
@@ -41,62 +41,63 @@ static char sccsid[] = "@(#)kvm.c 8.2 (Berkeley) 2/13/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
+#include <sys/fnv_hash.h>
#define _WANT_VNET
#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
#include <sys/linker.h>
#include <sys/pcpu.h>
+#include <sys/stat.h>
#include <net/vnet.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-
-#include <machine/vmparam.h>
-
-#include <ctype.h>
#include <fcntl.h>
#include <kvm.h>
#include <limits.h>
-#include <nlist.h>
#include <paths.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <strings.h>
#include <unistd.h>
#include "kvm_private.h"
-#ifndef CROSS_LIBKVM
+SET_DECLARE(kvm_arch, struct kvm_arch);
/* from src/lib/libc/gen/nlist.c */
int __fdnlist(int, struct nlist *);
-#define kvm_fdnlist __fdnlist
-
-#else
-
-#include <proc_service.h>
-
static int
-kvm_fdnlist(int fd, struct nlist *list)
+kvm_fdnlist(kvm_t *kd, struct kvm_nlist *list)
{
- psaddr_t addr;
- ps_err_e pserr;
- int nfail;
+ kvaddr_t addr;
+ int error, nfail;
+
+ if (kd->resolve_symbol == NULL) {
+ struct nlist *nl;
+ int count, i;
+
+ for (count = 0; list[count].n_name != NULL &&
+ list[count].n_name[0] != '\0'; count++)
+ ;
+ nl = calloc(count + 1, sizeof(*nl));
+ for (i = 0; i < count; i++)
+ nl[i].n_name = list[i].n_name;
+ nfail = __fdnlist(kd->nlfd, nl);
+ for (i = 0; i < count; i++) {
+ list[i].n_type = nl[i].n_type;
+ list[i].n_value = nl[i].n_value;
+ }
+ free(nl);
+ return (nfail);
+ }
- nfail = 0;
+ nfail = 0;
while (list->n_name != NULL && list->n_name[0] != '\0') {
- list->n_other = 0;
- list->n_desc = 0;
- pserr = ps_pglobal_lookup(NULL, NULL, list->n_name, &addr);
- if (pserr != PS_OK) {
+ error = kd->resolve_symbol(list->n_name, &addr);
+ if (error != 0) {
nfail++;
list->n_value = 0;
list->n_type = 0;
@@ -109,8 +110,6 @@ kvm_fdnlist(int fd, struct nlist *list)
return (nfail);
}
-#endif /* CROSS_LIBKVM */
-
char *
kvm_geterr(kvm_t *kd)
{
@@ -175,9 +174,206 @@ _kvm_malloc(kvm_t *kd, size_t n)
return (p);
}
+static int
+_kvm_read_kernel_ehdr(kvm_t *kd)
+{
+ Elf *elf;
+
+ if (elf_version(EV_CURRENT) == EV_NONE) {
+ _kvm_err(kd, kd->program, "Unsupported libelf");
+ return (-1);
+ }
+ elf = elf_begin(kd->nlfd, ELF_C_READ, NULL);
+ if (elf == NULL) {
+ _kvm_err(kd, kd->program, "%s", elf_errmsg(0));
+ return (-1);
+ }
+ if (elf_kind(elf) != ELF_K_ELF) {
+ _kvm_err(kd, kd->program, "kernel is not an ELF file");
+ return (-1);
+ }
+ if (gelf_getehdr(elf, &kd->nlehdr) == NULL) {
+ _kvm_err(kd, kd->program, "%s", elf_errmsg(0));
+ elf_end(elf);
+ return (-1);
+ }
+ elf_end(elf);
+
+ switch (kd->nlehdr.e_ident[EI_DATA]) {
+ case ELFDATA2LSB:
+ case ELFDATA2MSB:
+ return (0);
+ default:
+ _kvm_err(kd, kd->program,
+ "unsupported ELF data encoding for kernel");
+ return (-1);
+ }
+}
+
+int
+_kvm_probe_elf_kernel(kvm_t *kd, int class, int machine)
+{
+
+ return (kd->nlehdr.e_ident[EI_CLASS] == class &&
+ kd->nlehdr.e_type == ET_EXEC &&
+ kd->nlehdr.e_machine == machine);
+}
+
+int
+_kvm_is_minidump(kvm_t *kd)
+{
+ char minihdr[8];
+
+ if (kd->rawdump)
+ return (0);
+ if (pread(kd->pmfd, &minihdr, 8, 0) == 8 &&
+ memcmp(&minihdr, "minidump", 8) == 0)
+ return (1);
+ return (0);
+}
+
+/*
+ * The powerpc backend has a hack to strip a leading kerneldump
+ * header from the core before treating it as an ELF header.
+ *
+ * We can add that here if we can get a change to libelf to support
+ * an inital offset into the file. Alternatively we could patch
+ * savecore to extract cores from a regular file instead.
+ */
+int
+_kvm_read_core_phdrs(kvm_t *kd, size_t *phnump, GElf_Phdr **phdrp)
+{
+ GElf_Ehdr ehdr;
+ GElf_Phdr *phdr;
+ Elf *elf;
+ size_t i, phnum;
+
+ elf = elf_begin(kd->pmfd, ELF_C_READ, NULL);
+ if (elf == NULL) {
+ _kvm_err(kd, kd->program, "%s", elf_errmsg(0));
+ return (-1);
+ }
+ if (elf_kind(elf) != ELF_K_ELF) {
+ _kvm_err(kd, kd->program, "invalid core");
+ goto bad;
+ }
+ if (gelf_getclass(elf) != kd->nlehdr.e_ident[EI_CLASS]) {
+ _kvm_err(kd, kd->program, "invalid core");
+ goto bad;
+ }
+ if (gelf_getehdr(elf, &ehdr) == NULL) {
+ _kvm_err(kd, kd->program, "%s", elf_errmsg(0));
+ goto bad;
+ }
+ if (ehdr.e_type != ET_CORE) {
+ _kvm_err(kd, kd->program, "invalid core");
+ goto bad;
+ }
+ if (ehdr.e_machine != kd->nlehdr.e_machine) {
+ _kvm_err(kd, kd->program, "invalid core");
+ goto bad;
+ }
+
+ if (elf_getphdrnum(elf, &phnum) == -1) {
+ _kvm_err(kd, kd->program, "%s", elf_errmsg(0));
+ goto bad;
+ }
+
+ phdr = calloc(phnum, sizeof(*phdr));
+ if (phdr == NULL) {
+ _kvm_err(kd, kd->program, "failed to allocate phdrs");
+ goto bad;
+ }
+
+ for (i = 0; i < phnum; i++) {
+ if (gelf_getphdr(elf, i, &phdr[i]) == NULL) {
+ _kvm_err(kd, kd->program, "%s", elf_errmsg(0));
+ goto bad;
+ }
+ }
+ elf_end(elf);
+ *phnump = phnum;
+ *phdrp = phdr;
+ return (0);
+
+bad:
+ elf_end(elf);
+ return (-1);
+}
+
+static void
+_kvm_hpt_insert(struct hpt *hpt, uint64_t pa, off_t off)
+{
+ struct hpte *hpte;
+ uint32_t fnv = FNV1_32_INIT;
+
+ fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
+ fnv &= (HPT_SIZE - 1);
+ hpte = malloc(sizeof(*hpte));
+ hpte->pa = pa;
+ hpte->off = off;
+ hpte->next = hpt->hpt_head[fnv];
+ hpt->hpt_head[fnv] = hpte;
+}
+
+void
+_kvm_hpt_init(kvm_t *kd, struct hpt *hpt, void *base, size_t len, off_t off,
+ int page_size, int word_size)
+{
+ uint64_t bits, idx, pa;
+ uint64_t *base64;
+ uint32_t *base32;
+
+ base64 = base;
+ base32 = base;
+ for (idx = 0; idx < len / word_size; idx++) {
+ if (word_size == sizeof(uint64_t))
+ bits = _kvm64toh(kd, base64[idx]);
+ else
+ bits = _kvm32toh(kd, base32[idx]);
+ pa = idx * word_size * NBBY * page_size;
+ for (; bits != 0; bits >>= 1, pa += page_size) {
+ if ((bits & 1) == 0)
+ continue;
+ _kvm_hpt_insert(hpt, pa, off);
+ off += page_size;
+ }
+ }
+}
+
+off_t
+_kvm_hpt_find(struct hpt *hpt, uint64_t pa)
+{
+ struct hpte *hpte;
+ uint32_t fnv = FNV1_32_INIT;
+
+ fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
+ fnv &= (HPT_SIZE - 1);
+ for (hpte = hpt->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) {
+ if (pa == hpte->pa)
+ return (hpte->off);
+ }
+ return (-1);
+}
+
+void
+_kvm_hpt_free(struct hpt *hpt)
+{
+ struct hpte *hpte, *next;
+ int i;
+
+ for (i = 0; i < HPT_SIZE; i++) {
+ for (hpte = hpt->hpt_head[i]; hpte != NULL; hpte = next) {
+ next = hpte->next;
+ free(hpte);
+ }
+ }
+}
+
static kvm_t *
_kvm_open(kvm_t *kd, const char *uf, const char *mf, int flag, char *errout)
{
+ struct kvm_arch **parch;
struct stat st;
kd->vmfd = -1;
@@ -235,16 +431,40 @@ _kvm_open(kvm_t *kd, const char *uf, const char *mf, int flag, char *errout)
}
/*
* This is a crash dump.
- * Initialize the virtual address translation machinery,
- * but first setup the namelist fd.
+ * Open the namelist fd and determine the architecture.
*/
if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) {
_kvm_syserr(kd, kd->program, "%s", uf);
goto failed;
}
+ if (_kvm_read_kernel_ehdr(kd) < 0)
+ goto failed;
if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0)
kd->rawdump = 1;
- if (_kvm_initvtop(kd) < 0)
+ SET_FOREACH(parch, kvm_arch) {
+ if ((*parch)->ka_probe(kd)) {
+ kd->arch = *parch;
+ break;
+ }
+ }
+ if (kd->arch == NULL) {
+ _kvm_err(kd, kd->program, "unsupported architecture");
+ goto failed;
+ }
+
+ /*
+ * Non-native kernels require a symbol resolver.
+ */
+ if (!kd->arch->ka_native(kd) && kd->resolve_symbol == NULL) {
+ _kvm_err(kd, kd->program,
+ "non-native kernel requires a symbol resolver");
+ goto failed;
+ }
+
+ /*
+ * Initialize the virtual address translation machinery.
+ */
+ if (kd->arch->ka_initvtop(kd) < 0)
goto failed;
return (kd);
failed:
@@ -267,7 +487,6 @@ kvm_openfiles(const char *uf, const char *mf, const char *sf __unused, int flag,
(void)strlcpy(errout, strerror(errno), _POSIX2_LINE_MAX);
return (0);
}
- kd->program = 0;
return (_kvm_open(kd, uf, mf, flag, errout));
}
@@ -287,19 +506,33 @@ kvm_open(const char *uf, const char *mf, const char *sf __unused, int flag,
return (_kvm_open(kd, uf, mf, flag, NULL));
}
+kvm_t *
+kvm_open2(const char *uf, const char *mf, int flag, char *errout,
+ int (*resolver)(const char *, kvaddr_t *))
+{
+ kvm_t *kd;
+
+ if ((kd = calloc(1, sizeof(*kd))) == NULL) {
+ (void)strlcpy(errout, strerror(errno), _POSIX2_LINE_MAX);
+ return (0);
+ }
+ kd->resolve_symbol = resolver;
+ return (_kvm_open(kd, uf, mf, flag, errout));
+}
+
int
kvm_close(kvm_t *kd)
{
int error = 0;
+ if (kd->vmst != NULL)
+ kd->arch->ka_freevtop(kd);
if (kd->pmfd >= 0)
error |= close(kd->pmfd);
if (kd->vmfd >= 0)
error |= close(kd->vmfd);
if (kd->nlfd >= 0)
error |= close(kd->nlfd);
- if (kd->vmst)
- _kvm_freevtop(kd);
if (kd->procbase != 0)
free((void *)kd->procbase);
if (kd->argbuf != 0)
@@ -318,10 +551,10 @@ kvm_close(kvm_t *kd)
* symbol names, try again, and merge back what we could resolve.
*/
static int
-kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix,
- uintptr_t (*validate_fn)(kvm_t *, uintptr_t))
+kvm_fdnlist_prefix(kvm_t *kd, struct kvm_nlist *nl, int missing,
+ const char *prefix, kvaddr_t (*validate_fn)(kvm_t *, kvaddr_t))
{
- struct nlist *n, *np, *p;
+ struct kvm_nlist *n, *np, *p;
char *cp, *ce;
const char *ccp;
size_t len;
@@ -337,14 +570,14 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix,
for (p = nl; p->n_name && p->n_name[0]; ++p) {
if (p->n_type != N_UNDF)
continue;
- len += sizeof(struct nlist) + strlen(prefix) +
+ len += sizeof(struct kvm_nlist) + strlen(prefix) +
2 * (strlen(p->n_name) + 1);
unresolved++;
}
if (unresolved == 0)
return (unresolved);
/* Add space for the terminating nlist entry. */
- len += sizeof(struct nlist);
+ len += sizeof(struct kvm_nlist);
unresolved++;
/* Alloc one chunk for (nlist, [names]) and setup pointers. */
@@ -353,7 +586,7 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix,
if (n == NULL)
return (missing);
cp = ce = (char *)np;
- cp += unresolved * sizeof(struct nlist);
+ cp += unresolved * sizeof(struct kvm_nlist);
ce += len;
/* Generate shortened nlist with special prefix. */
@@ -361,7 +594,7 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix,
for (p = nl; p->n_name && p->n_name[0]; ++p) {
if (p->n_type != N_UNDF)
continue;
- bcopy(p, np, sizeof(struct nlist));
+ *np = *p;
/* Save the new\0orig. name so we can later match it again. */
slen = snprintf(cp, ce - cp, "%s%s%c%s", prefix,
(prefix[0] != '\0' && p->n_name[0] == '_') ?
@@ -376,7 +609,7 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix,
/* Do lookup on the reduced list. */
np = n;
- unresolved = kvm_fdnlist(kd->nlfd, np);
+ unresolved = kvm_fdnlist(kd, np);
/* Check if we could resolve further symbols and update the list. */
if (unresolved >= 0 && unresolved < missing) {
@@ -398,8 +631,6 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix,
continue;
/* Update nlist with new, translated results. */
p->n_type = np->n_type;
- p->n_other = np->n_other;
- p->n_desc = np->n_desc;
if (validate_fn)
p->n_value = (*validate_fn)(kd, np->n_value);
else
@@ -418,9 +649,9 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nlist *nl, int missing, const char *prefix,
}
int
-_kvm_nlist(kvm_t *kd, struct nlist *nl, int initialize)
+_kvm_nlist(kvm_t *kd, struct kvm_nlist *nl, int initialize)
{
- struct nlist *p;
+ struct kvm_nlist *p;
int nvalid;
struct kld_sym_lookup lookup;
int error;
@@ -433,7 +664,7 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int initialize)
* slow library call.
*/
if (!ISALIVE(kd)) {
- error = kvm_fdnlist(kd->nlfd, nl);
+ error = kvm_fdnlist(kd, nl);
if (error <= 0) /* Hard error or success. */
return (error);
@@ -475,8 +706,6 @@ again:
if (kldsym(0, KLDSYM_LOOKUP, &lookup) != -1) {
p->n_type = N_TEXT;
- p->n_other = 0;
- p->n_desc = 0;
if (_kvm_vnet_initialized(kd, initialize) &&
strcmp(prefix, VNET_SYMPREFIX) == 0)
p->n_value =
@@ -519,7 +748,7 @@ again:
}
int
-kvm_nlist(kvm_t *kd, struct nlist *nl)
+kvm_nlist2(kvm_t *kd, struct kvm_nlist *nl)
{
/*
@@ -529,9 +758,49 @@ kvm_nlist(kvm_t *kd, struct nlist *nl)
return (_kvm_nlist(kd, nl, 1));
}
+int
+kvm_nlist(kvm_t *kd, struct nlist *nl)
+{
+ struct kvm_nlist *kl;
+ int count, i, nfail;
+
+ /*
+ * Avoid reporting truncated addresses by failing for non-native
+ * cores.
+ */
+ if (!kvm_native(kd)) {
+ _kvm_err(kd, kd->program, "kvm_nlist of non-native vmcore");
+ return (-1);
+ }
+
+ for (count = 0; nl[count].n_name != NULL && nl[count].n_name[0] != '\0';
+ count++)
+ ;
+ if (count == 0)
+ return (0);
+ kl = calloc(count + 1, sizeof(*kl));
+ for (i = 0; i < count; i++)
+ kl[i].n_name = nl[i].n_name;
+ nfail = kvm_nlist2(kd, kl);
+ for (i = 0; i < count; i++) {
+ nl[i].n_type = kl[i].n_type;
+ nl[i].n_other = 0;
+ nl[i].n_desc = 0;
+ nl[i].n_value = kl[i].n_value;
+ }
+ return (nfail);
+}
+
ssize_t
kvm_read(kvm_t *kd, u_long kva, void *buf, size_t len)
{
+
+ return (kvm_read2(kd, kva, buf, len));
+}
+
+ssize_t
+kvm_read2(kvm_t *kd, kvaddr_t kva, void *buf, size_t len)
+{
int cc;
ssize_t cr;
off_t pa;
@@ -544,7 +813,8 @@ kvm_read(kvm_t *kd, u_long kva, void *buf, size_t len)
*/
errno = 0;
if (lseek(kd->vmfd, (off_t)kva, 0) == -1 && errno != 0) {
- _kvm_err(kd, 0, "invalid address (%lx)", kva);
+ _kvm_err(kd, 0, "invalid address (0x%jx)",
+ (uintmax_t)kva);
return (-1);
}
cr = read(kd->vmfd, buf, len);
@@ -558,7 +828,7 @@ kvm_read(kvm_t *kd, u_long kva, void *buf, size_t len)
cp = buf;
while (len > 0) {
- cc = _kvm_kvatop(kd, kva, &pa);
+ cc = kd->arch->ka_kvatop(kd, kva, &pa);
if (cc == 0)
return (-1);
if (cc > (ssize_t)len)
@@ -574,7 +844,7 @@ kvm_read(kvm_t *kd, u_long kva, void *buf, size_t len)
break;
}
/*
- * If kvm_kvatop returns a bogus value or our core file is
+ * If ka_kvatop returns a bogus value or our core file is
* truncated, we might wind up seeking beyond the end of the
* core file in which case the read will return 0 (EOF).
*/
@@ -616,3 +886,12 @@ kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len)
}
/* NOTREACHED */
}
+
+int
+kvm_native(kvm_t *kd)
+{
+
+ if (ISALIVE(kd))
+ return (1);
+ return (kd->arch->ka_native(kd));
+}
diff --git a/lib/libkvm/kvm.h b/lib/libkvm/kvm.h
index d697795..a3d1364 100644
--- a/lib/libkvm/kvm.h
+++ b/lib/libkvm/kvm.h
@@ -51,6 +51,14 @@ typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
+typedef uint64_t kvaddr_t; /* An address in a target image. */
+
+struct kvm_nlist {
+ const char *n_name;
+ unsigned char n_type;
+ kvaddr_t n_value;
+};
+
typedef struct __kvm kvm_t;
struct kinfo_proc;
@@ -83,13 +91,19 @@ uint64_t kvm_counter_u64_fetch(kvm_t *, u_long);
struct kinfo_proc *
kvm_getprocs(kvm_t *, int, int, int *);
int kvm_getswapinfo(kvm_t *, struct kvm_swap *, int, int);
+int kvm_native(kvm_t *);
int kvm_nlist(kvm_t *, struct nlist *);
+int kvm_nlist2(kvm_t *, struct kvm_nlist *);
kvm_t *kvm_open
(const char *, const char *, const char *, int, const char *);
kvm_t *kvm_openfiles
(const char *, const char *, const char *, int, char *);
+kvm_t *kvm_open2
+ (const char *, const char *, int, char *,
+ int (*)(const char *, kvaddr_t *));
ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t);
ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int);
+ssize_t kvm_read2(kvm_t *, kvaddr_t, void *, size_t);
ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t);
__END_DECLS
diff --git a/lib/libkvm/kvm_aarch64.h b/lib/libkvm/kvm_aarch64.h
new file mode 100644
index 0000000..c125d3c
--- /dev/null
+++ b/lib/libkvm/kvm_aarch64.h
@@ -0,0 +1,61 @@
+/*-
+ * Copyright (c) 2015 John H. Baldwin <jhb@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __KVM_AARCH64_H__
+#define __KVM_AARCH64_H__
+
+#ifdef __aarch64__
+#include <machine/pte.h>
+#endif
+
+typedef uint64_t aarch64_physaddr_t;
+typedef uint64_t aarch64_pte_t;
+
+#define AARCH64_PAGE_SHIFT 12
+#define AARCH64_PAGE_SIZE (1 << AARCH64_PAGE_SHIFT)
+#define AARCH64_PAGE_MASK (AARCH64_PAGE_SIZE - 1)
+
+#define AARCH64_ATTR_MASK 0xfff0000000000fff
+
+#define AARCH64_ATTR_DESCR_MASK 3
+
+#define AARCH64_L3_SHIFT 12
+#define AARCH64_L3_PAGE 0x3
+
+#ifdef __aarch64__
+_Static_assert(PAGE_SHIFT == AARCH64_PAGE_SHIFT, "PAGE_SHIFT mismatch");
+_Static_assert(PAGE_SIZE == AARCH64_PAGE_SIZE, "PAGE_SIZE mismatch");
+_Static_assert(PAGE_MASK == AARCH64_PAGE_MASK, "PAGE_MASK mismatch");
+_Static_assert(ATTR_MASK == AARCH64_ATTR_MASK, "ATTR_MASK mismatch");
+_Static_assert(ATTR_DESCR_MASK == AARCH64_ATTR_DESCR_MASK,
+ "ATTR_DESCR_MASK mismatch");
+_Static_assert(L3_SHIFT == AARCH64_L3_SHIFT, "L3_SHIFT mismatch");
+_Static_assert(L3_PAGE == AARCH64_L3_PAGE, "L3_PAGE mismatch");
+#endif
+
+#endif /* !__KVM_AARCH64_H__ */
diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c
index 9a5ec64..1ba17f1 100644
--- a/lib/libkvm/kvm_amd64.c
+++ b/lib/libkvm/kvm_amd64.c
@@ -46,117 +46,76 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
*/
#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
+#include <sys/endian.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <nlist.h>
#include <kvm.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-
-#include <machine/elf.h>
-
#include <limits.h>
#include "kvm_private.h"
+#include "kvm_amd64.h"
-#ifndef btop
-#define btop(x) (amd64_btop(x))
-#define ptob(x) (amd64_ptob(x))
-#endif
-
-/* minidump must be the first item! */
struct vmstate {
- int minidump; /* 1 = minidump mode */
- void *mmapbase;
- size_t mmapsize;
- pml4_entry_t *PML4;
+ size_t phnum;
+ GElf_Phdr *phdr;
+ amd64_pml4e_t *PML4;
};
/*
- * Map the ELF headers into the process' address space. We do this in two
- * steps: first the ELF header itself and using that information the whole
- * set of headers.
- */
-static int
-_kvm_maphdrs(kvm_t *kd, size_t sz)
-{
- struct vmstate *vm = kd->vmst;
-
- /* munmap() previous mmap(). */
- if (vm->mmapbase != NULL) {
- munmap(vm->mmapbase, vm->mmapsize);
- vm->mmapbase = NULL;
- }
-
- vm->mmapsize = sz;
- vm->mmapbase = mmap(NULL, sz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
- if (vm->mmapbase == MAP_FAILED) {
- _kvm_err(kd, kd->program, "cannot mmap corefile");
- return (-1);
- }
- return (0);
-}
-
-/*
* Translate a physical memory address to a file-offset in the crash-dump.
*/
static size_t
_kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs)
{
- Elf_Ehdr *e = kd->vmst->mmapbase;
- Elf_Phdr *p;
- int n;
+ struct vmstate *vm = kd->vmst;
+ GElf_Phdr *p;
+ size_t n;
if (kd->rawdump) {
*ofs = pa;
- return (PAGE_SIZE - ((size_t)pa & PAGE_MASK));
+ return (AMD64_PAGE_SIZE - (pa & AMD64_PAGE_MASK));
}
- p = (Elf_Phdr*)((char*)e + e->e_phoff);
- n = e->e_phnum;
+ p = vm->phdr;
+ n = vm->phnum;
while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz))
p++, n--;
if (n == 0)
return (0);
*ofs = (pa - p->p_paddr) + p->p_offset;
- return (PAGE_SIZE - ((size_t)pa & PAGE_MASK));
+ return (AMD64_PAGE_SIZE - (pa & AMD64_PAGE_MASK));
}
-void
-_kvm_freevtop(kvm_t *kd)
+static void
+_amd64_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (kd->vmst->minidump)
- return (_kvm_minidump_freevtop(kd));
- if (vm->mmapbase != NULL)
- munmap(vm->mmapbase, vm->mmapsize);
if (vm->PML4)
free(vm->PML4);
+ free(vm->phdr);
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_initvtop(kvm_t *kd)
+static int
+_amd64_probe(kvm_t *kd)
+{
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_X86_64) &&
+ !_kvm_is_minidump(kd));
+}
+
+static int
+_amd64_initvtop(kvm_t *kd)
{
- struct nlist nl[2];
- u_long pa;
- u_long kernbase;
- pml4_entry_t *PML4;
- Elf_Ehdr *ehdr;
- size_t hdrsz;
- char minihdr[8];
-
- if (!kd->rawdump && pread(kd->pmfd, &minihdr, 8, 0) == 8)
- if (memcmp(&minihdr, "minidump", 8) == 0)
- return (_kvm_minidump_initvtop(kd));
+ struct kvm_nlist nl[2];
+ amd64_physaddr_t pa;
+ kvaddr_t kernbase;
+ amd64_pml4e_t *PML4;
kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst));
if (kd->vmst == 0) {
@@ -166,19 +125,15 @@ _kvm_initvtop(kvm_t *kd)
kd->vmst->PML4 = 0;
if (kd->rawdump == 0) {
- if (_kvm_maphdrs(kd, sizeof(Elf_Ehdr)) == -1)
- return (-1);
-
- ehdr = kd->vmst->mmapbase;
- hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum;
- if (_kvm_maphdrs(kd, hdrsz) == -1)
+ if (_kvm_read_core_phdrs(kd, &kd->vmst->phnum,
+ &kd->vmst->phdr) == -1)
return (-1);
}
nl[0].n_name = "kernbase";
nl[1].n_name = 0;
- if (kvm_nlist(kd, nl) != 0) {
+ if (kvm_nlist2(kd, nl) != 0) {
_kvm_err(kd, kd->program, "bad namelist - no kernbase");
return (-1);
}
@@ -187,17 +142,18 @@ _kvm_initvtop(kvm_t *kd)
nl[0].n_name = "KPML4phys";
nl[1].n_name = 0;
- if (kvm_nlist(kd, nl) != 0) {
+ if (kvm_nlist2(kd, nl) != 0) {
_kvm_err(kd, kd->program, "bad namelist - no KPML4phys");
return (-1);
}
- if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) !=
+ if (kvm_read2(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) !=
sizeof(pa)) {
_kvm_err(kd, kd->program, "cannot read KPML4phys");
return (-1);
}
- PML4 = _kvm_malloc(kd, PAGE_SIZE);
- if (kvm_read(kd, pa, PML4, PAGE_SIZE) != PAGE_SIZE) {
+ pa = le64toh(pa);
+ PML4 = _kvm_malloc(kd, AMD64_PAGE_SIZE);
+ if (kvm_read2(kd, pa, PML4, AMD64_PAGE_SIZE) != AMD64_PAGE_SIZE) {
_kvm_err(kd, kd->program, "cannot read KPML4phys");
return (-1);
}
@@ -206,27 +162,27 @@ _kvm_initvtop(kvm_t *kd)
}
static int
-_kvm_vatop(kvm_t *kd, u_long va, off_t *pa)
+_amd64_vatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- u_long offset;
- u_long pdpe_pa;
- u_long pde_pa;
- u_long pte_pa;
- pml4_entry_t pml4e;
- pdp_entry_t pdpe;
- pd_entry_t pde;
- pt_entry_t pte;
- u_long pml4eindex;
- u_long pdpeindex;
- u_long pdeindex;
- u_long pteindex;
- u_long a;
+ amd64_physaddr_t offset;
+ amd64_physaddr_t pdpe_pa;
+ amd64_physaddr_t pde_pa;
+ amd64_physaddr_t pte_pa;
+ amd64_pml4e_t pml4e;
+ amd64_pdpe_t pdpe;
+ amd64_pde_t pde;
+ amd64_pte_t pte;
+ kvaddr_t pml4eindex;
+ kvaddr_t pdpeindex;
+ kvaddr_t pdeindex;
+ kvaddr_t pteindex;
+ amd64_physaddr_t a;
off_t ofs;
size_t s;
vm = kd->vmst;
- offset = va & (PAGE_SIZE - 1);
+ offset = va & AMD64_PAGE_MASK;
/*
* If we are initializing (kernel page table descriptor pointer
@@ -236,121 +192,141 @@ _kvm_vatop(kvm_t *kd, u_long va, off_t *pa)
s = _kvm_pa2off(kd, va, pa);
if (s == 0) {
_kvm_err(kd, kd->program,
- "_kvm_vatop: bootstrap data not in dump");
+ "_amd64_vatop: bootstrap data not in dump");
goto invalid;
} else
- return (PAGE_SIZE - offset);
+ return (AMD64_PAGE_SIZE - offset);
}
- pml4eindex = (va >> PML4SHIFT) & (NPML4EPG - 1);
- pml4e = vm->PML4[pml4eindex];
- if (((u_long)pml4e & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pml4e not valid");
+ pml4eindex = (va >> AMD64_PML4SHIFT) & (AMD64_NPML4EPG - 1);
+ pml4e = le64toh(vm->PML4[pml4eindex]);
+ if ((pml4e & AMD64_PG_V) == 0) {
+ _kvm_err(kd, kd->program, "_amd64_vatop: pml4e not valid");
goto invalid;
}
- pdpeindex = (va >> PDPSHIFT) & (NPDPEPG-1);
- pdpe_pa = ((u_long)pml4e & PG_FRAME) +
- (pdpeindex * sizeof(pdp_entry_t));
+ pdpeindex = (va >> AMD64_PDPSHIFT) & (AMD64_NPDPEPG - 1);
+ pdpe_pa = (pml4e & AMD64_PG_FRAME) + (pdpeindex * sizeof(amd64_pdpe_t));
s = _kvm_pa2off(kd, pdpe_pa, &ofs);
- if (s < sizeof pdpe) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pdpe_pa not found");
+ if (s < sizeof(pdpe)) {
+ _kvm_err(kd, kd->program, "_amd64_vatop: pdpe_pa not found");
goto invalid;
}
- if (lseek(kd->pmfd, ofs, 0) == -1) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: lseek pdpe_pa");
+ if (pread(kd->pmfd, &pdpe, sizeof(pdpe), ofs) != sizeof(pdpe)) {
+ _kvm_syserr(kd, kd->program, "_amd64_vatop: read pdpe");
goto invalid;
}
- if (read(kd->pmfd, &pdpe, sizeof pdpe) != sizeof pdpe) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: read pdpe");
+ pdpe = le64toh(pdpe);
+ if ((pdpe & AMD64_PG_V) == 0) {
+ _kvm_err(kd, kd->program, "_amd64_vatop: pdpe not valid");
goto invalid;
}
- if (((u_long)pdpe & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pdpe not valid");
- goto invalid;
+
+ if (pdpe & AMD64_PG_PS) {
+ /*
+ * No next-level page table; pdpe describes one 1GB page.
+ */
+ a = (pde & AMD64_PG_1GB_FRAME) + (va & AMD64_PDPMASK);
+ s = _kvm_pa2off(kd, a, pa);
+ if (s == 0) {
+ _kvm_err(kd, kd->program,
+ "_amd64_vatop: 1GB page address not in dump");
+ goto invalid;
+ } else
+ return (AMD64_NBPDP - (va & AMD64_PDPMASK));
}
- pdeindex = (va >> PDRSHIFT) & (NPDEPG-1);
- pde_pa = ((u_long)pdpe & PG_FRAME) + (pdeindex * sizeof(pd_entry_t));
+ pdeindex = (va >> AMD64_PDRSHIFT) & (AMD64_NPDEPG - 1);
+ pde_pa = (pdpe & AMD64_PG_FRAME) + (pdeindex * sizeof(amd64_pde_t));
s = _kvm_pa2off(kd, pde_pa, &ofs);
- if (s < sizeof pde) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: pde_pa not found");
- goto invalid;
- }
- if (lseek(kd->pmfd, ofs, 0) == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: lseek pde_pa");
+ if (s < sizeof(pde)) {
+ _kvm_syserr(kd, kd->program, "_amd64_vatop: pde_pa not found");
goto invalid;
}
- if (read(kd->pmfd, &pde, sizeof pde) != sizeof pde) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: read pde");
+ if (pread(kd->pmfd, &pde, sizeof(pde), ofs) != sizeof(pde)) {
+ _kvm_syserr(kd, kd->program, "_amd64_vatop: read pde");
goto invalid;
}
- if (((u_long)pde & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid");
+ pde = le64toh(pde);
+ if ((pde & AMD64_PG_V) == 0) {
+ _kvm_err(kd, kd->program, "_amd64_vatop: pde not valid");
goto invalid;
}
- if ((u_long)pde & PG_PS) {
- /*
- * No final-level page table; ptd describes one 2MB page.
- */
-#define PAGE2M_MASK (NBPDR - 1)
-#define PG_FRAME2M (~PAGE2M_MASK)
- a = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK);
+ if (pde & AMD64_PG_PS) {
+ /*
+ * No final-level page table; pde describes one 2MB page.
+ */
+ a = (pde & AMD64_PG_PS_FRAME) + (va & AMD64_PDRMASK);
s = _kvm_pa2off(kd, a, pa);
if (s == 0) {
_kvm_err(kd, kd->program,
- "_kvm_vatop: 2MB page address not in dump");
+ "_amd64_vatop: 2MB page address not in dump");
goto invalid;
} else
- return (NBPDR - (va & PAGE2M_MASK));
+ return (AMD64_NBPDR - (va & AMD64_PDRMASK));
}
- pteindex = (va >> PAGE_SHIFT) & (NPTEPG-1);
- pte_pa = ((u_long)pde & PG_FRAME) + (pteindex * sizeof(pt_entry_t));
+ pteindex = (va >> AMD64_PAGE_SHIFT) & (AMD64_NPTEPG - 1);
+ pte_pa = (pde & AMD64_PG_FRAME) + (pteindex * sizeof(amd64_pte_t));
s = _kvm_pa2off(kd, pte_pa, &ofs);
- if (s < sizeof pte) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte_pa not found");
- goto invalid;
- }
- if (lseek(kd->pmfd, ofs, 0) == -1) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: lseek");
+ if (s < sizeof(pte)) {
+ _kvm_err(kd, kd->program, "_amd64_vatop: pte_pa not found");
goto invalid;
}
- if (read(kd->pmfd, &pte, sizeof pte) != sizeof pte) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: read");
+ if (pread(kd->pmfd, &pte, sizeof(pte), ofs) != sizeof(pte)) {
+ _kvm_syserr(kd, kd->program, "_amd64_vatop: read");
goto invalid;
}
- if (((u_long)pte & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
+ if ((pte & AMD64_PG_V) == 0) {
+ _kvm_err(kd, kd->program, "_amd64_vatop: pte not valid");
goto invalid;
}
- a = ((u_long)pte & PG_FRAME) + offset;
+ a = (pte & AMD64_PG_FRAME) + offset;
s = _kvm_pa2off(kd, a, pa);
if (s == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: address not in dump");
+ _kvm_err(kd, kd->program, "_amd64_vatop: address not in dump");
goto invalid;
} else
- return (PAGE_SIZE - offset);
+ return (AMD64_PAGE_SIZE - offset);
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_amd64_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
- if (kd->vmst->minidump)
- return (_kvm_minidump_kvatop(kd, va, pa));
if (ISALIVE(kd)) {
_kvm_err(kd, 0, "kvm_kvatop called in live kernel!");
return (0);
}
- return (_kvm_vatop(kd, va, pa));
+ return (_amd64_vatop(kd, va, pa));
+}
+
+int
+_amd64_native(kvm_t *kd)
+{
+
+#ifdef __amd64__
+ return (1);
+#else
+ return (0);
+#endif
}
+
+struct kvm_arch kvm_amd64 = {
+ .ka_probe = _amd64_probe,
+ .ka_initvtop = _amd64_initvtop,
+ .ka_freevtop = _amd64_freevtop,
+ .ka_kvatop = _amd64_kvatop,
+ .ka_native = _amd64_native,
+};
+
+KVM_ARCH(kvm_amd64);
diff --git a/lib/libkvm/kvm_amd64.h b/lib/libkvm/kvm_amd64.h
new file mode 100644
index 0000000..49a72e4
--- /dev/null
+++ b/lib/libkvm/kvm_amd64.h
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 2015 John H. Baldwin <jhb@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __KVM_AMD64_H__
+#define __KVM_AMD64_H__
+
+#ifdef __amd64__
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#endif
+
+typedef uint64_t amd64_physaddr_t;
+typedef uint64_t amd64_pte_t;
+typedef uint64_t amd64_pde_t;
+typedef uint64_t amd64_pdpe_t;
+typedef uint64_t amd64_pml4e_t;
+
+#define AMD64_NPTEPG (AMD64_PAGE_SIZE / sizeof(amd64_pte_t))
+#define AMD64_PAGE_SHIFT 12
+#define AMD64_PAGE_SIZE (1 << AMD64_PAGE_SHIFT)
+#define AMD64_PAGE_MASK (AMD64_PAGE_SIZE - 1)
+#define AMD64_NPDEPG (AMD64_PAGE_SIZE / sizeof(amd64_pde_t))
+#define AMD64_PDRSHIFT 21
+#define AMD64_NBPDR (1 << AMD64_PDRSHIFT)
+#define AMD64_PDRMASK (AMD64_NBPDR - 1)
+#define AMD64_NPDPEPG (AMD64_PAGE_SIZE / sizeof(amd64_pdpe_t))
+#define AMD64_PDPSHIFT 30
+#define AMD64_NBPDP (1 << AMD64_PDPSHIFT)
+#define AMD64_PDPMASK (AMD64_NBPDP - 1)
+#define AMD64_NPML4EPG (AMD64_PAGE_SIZE / sizeof(amd64_pml4e_t))
+#define AMD64_PML4SHIFT 39
+
+#define AMD64_PG_V 0x001
+#define AMD64_PG_PS 0x080
+#define AMD64_PG_FRAME (0x000ffffffffff000)
+#define AMD64_PG_PS_FRAME (0x000fffffffe00000)
+#define AMD64_PG_1GB_FRAME (0x000fffffc0000000)
+
+#ifdef __amd64__
+_Static_assert(NPTEPG == AMD64_NPTEPG, "NPTEPG mismatch");
+_Static_assert(PAGE_SHIFT == AMD64_PAGE_SHIFT, "PAGE_SHIFT mismatch");
+_Static_assert(PAGE_SIZE == AMD64_PAGE_SIZE, "PAGE_SIZE mismatch");
+_Static_assert(PAGE_MASK == AMD64_PAGE_MASK, "PAGE_MASK mismatch");
+_Static_assert(NPDEPG == AMD64_NPDEPG, "NPDEPG mismatch");
+_Static_assert(PDRSHIFT == AMD64_PDRSHIFT, "PDRSHIFT mismatch");
+_Static_assert(NBPDR == AMD64_NBPDR, "NBPDR mismatch");
+_Static_assert(PDRMASK == AMD64_PDRMASK, "PDRMASK mismatch");
+_Static_assert(NPDPEPG == AMD64_NPDPEPG, "NPDPEPG mismatch");
+_Static_assert(PDPSHIFT == AMD64_PDPSHIFT, "PDPSHIFT mismatch");
+_Static_assert(NBPDP == AMD64_NBPDP, "NBPDP mismatch");
+_Static_assert(PDPMASK == AMD64_PDPMASK, "PDPMASK mismatch");
+_Static_assert(NPML4EPG == AMD64_NPML4EPG, "NPML4EPG mismatch");
+_Static_assert(PML4SHIFT == AMD64_PML4SHIFT, "PML4SHIFT mismatch");
+
+_Static_assert(PG_V == AMD64_PG_V, "PG_V mismatch");
+_Static_assert(PG_PS == AMD64_PG_PS, "PG_PS mismatch");
+_Static_assert(PG_FRAME == AMD64_PG_FRAME, "PG_FRAME mismatch");
+_Static_assert(PG_PS_FRAME == AMD64_PG_PS_FRAME, "PG_PS_FRAME mismatch");
+#endif
+
+int _amd64_native(kvm_t *);
+
+#endif /* !__KVM_AMD64_H__ */
diff --git a/lib/libkvm/kvm_arm.c b/lib/libkvm/kvm_arm.c
index cc808e3..bbead35 100644
--- a/lib/libkvm/kvm_arm.c
+++ b/lib/libkvm/kvm_arm.c
@@ -39,67 +39,38 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
-#include <sys/elf32.h>
-#include <sys/mman.h>
-
-#ifndef CROSS_LIBKVM
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
-#include <machine/pmap.h>
-#else
-#include "../../sys/arm/include/pte.h"
-#include "../../sys/arm/include/vmparam.h"
-#endif
-
-#include <db.h>
-#include <limits.h>
+#include <sys/endian.h>
#include <kvm.h>
+#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
+#ifdef __arm__
+#include <machine/vmparam.h>
+#endif
+
#include "kvm_private.h"
+#include "kvm_arm.h"
-/* minidump must be the first item! */
struct vmstate {
- int minidump; /* 1 = minidump mode */
- pd_entry_t *l1pt;
- void *mmapbase;
- size_t mmapsize;
+ arm_pd_entry_t *l1pt;
+ size_t phnum;
+ GElf_Phdr *phdr;
};
-static int
-_kvm_maphdrs(kvm_t *kd, size_t sz)
-{
- struct vmstate *vm = kd->vmst;
-
- /* munmap() previous mmap(). */
- if (vm->mmapbase != NULL) {
- munmap(vm->mmapbase, vm->mmapsize);
- vm->mmapbase = NULL;
- }
-
- vm->mmapsize = sz;
- vm->mmapbase = mmap(NULL, sz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
- if (vm->mmapbase == MAP_FAILED) {
- _kvm_err(kd, kd->program, "cannot mmap corefile");
- return (-1);
- }
-
- return (0);
-}
-
/*
* Translate a physical memory address to a file-offset in the crash-dump.
*/
static size_t
_kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs, size_t pgsz)
{
- Elf32_Ehdr *e = kd->vmst->mmapbase;
- Elf32_Phdr *p = (Elf32_Phdr*)((char*)e + e->e_phoff);
- int n = e->e_phnum;
+ struct vmstate *vm = kd->vmst;
+ GElf_Phdr *p;
+ size_t n;
+ p = vm->phdr;
+ n = vm->phnum;
while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz))
p++, n--;
if (n == 0)
@@ -111,40 +82,38 @@ _kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs, size_t pgsz)
return (pgsz - ((size_t)pa & (pgsz - 1)));
}
-void
-_kvm_freevtop(kvm_t *kd)
+static void
+_arm_freevtop(kvm_t *kd)
{
- if (kd->vmst != 0) {
- if (kd->vmst->minidump)
- return (_kvm_minidump_freevtop(kd));
- if (kd->vmst->mmapbase != NULL)
- munmap(kd->vmst->mmapbase, kd->vmst->mmapsize);
- free(kd->vmst);
- kd->vmst = NULL;
- }
+ struct vmstate *vm = kd->vmst;
+
+ free(vm->phdr);
+ free(vm);
+ kd->vmst = NULL;
}
-int
-_kvm_initvtop(kvm_t *kd)
+static int
+_arm_probe(kvm_t *kd)
+{
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS32, EM_ARM) &&
+ !_kvm_is_minidump(kd));
+}
+
+static int
+_arm_initvtop(kvm_t *kd)
{
struct vmstate *vm;
- struct nlist nl[2];
- u_long kernbase, physaddr, pa;
- pd_entry_t *l1pt;
- Elf32_Ehdr *ehdr;
- Elf32_Phdr *phdr;
- size_t hdrsz;
- char minihdr[8];
- int found, i;
-
- if (!kd->rawdump) {
- if (pread(kd->pmfd, &minihdr, 8, 0) == 8) {
- if (memcmp(&minihdr, "minidump", 8) == 0)
- return (_kvm_minidump_initvtop(kd));
- } else {
- _kvm_err(kd, kd->program, "cannot read header");
- return (-1);
- }
+ struct kvm_nlist nl[2];
+ kvaddr_t kernbase;
+ arm_physaddr_t physaddr, pa;
+ arm_pd_entry_t *l1pt;
+ size_t i;
+ int found;
+
+ if (kd->rawdump) {
+ _kvm_err(kd, kd->program, "raw dumps not supported on arm");
+ return (-1);
}
vm = _kvm_malloc(kd, sizeof(*vm));
@@ -154,19 +123,15 @@ _kvm_initvtop(kvm_t *kd)
}
kd->vmst = vm;
vm->l1pt = NULL;
- if (_kvm_maphdrs(kd, sizeof(Elf32_Ehdr)) == -1)
- return (-1);
- ehdr = kd->vmst->mmapbase;
- hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum;
- if (_kvm_maphdrs(kd, hdrsz) == -1)
+
+ if (_kvm_read_core_phdrs(kd, &vm->phnum, &vm->phdr) == -1)
return (-1);
- phdr = (Elf32_Phdr *)((uint8_t *)ehdr + ehdr->e_phoff);
found = 0;
- for (i = 0; i < ehdr->e_phnum; i++) {
- if (phdr[i].p_type == PT_DUMP_DELTA) {
- kernbase = phdr[i].p_vaddr;
- physaddr = phdr[i].p_paddr;
+ for (i = 0; i < vm->phnum; i++) {
+ if (vm->phdr[i].p_type == PT_DUMP_DELTA) {
+ kernbase = vm->phdr[i].p_vaddr;
+ physaddr = vm->phdr[i].p_paddr;
found = 1;
break;
}
@@ -175,30 +140,35 @@ _kvm_initvtop(kvm_t *kd)
nl[1].n_name = NULL;
if (!found) {
nl[0].n_name = "kernbase";
- if (kvm_nlist(kd, nl) != 0)
+ if (kvm_nlist2(kd, nl) != 0) {
+#ifdef __arm__
kernbase = KERNBASE;
- else
+#else
+ _kvm_err(kd, kd->program, "cannot resolve kernbase");
+ return (-1);
+#endif
+ } else
kernbase = nl[0].n_value;
nl[0].n_name = "physaddr";
- if (kvm_nlist(kd, nl) != 0) {
+ if (kvm_nlist2(kd, nl) != 0) {
_kvm_err(kd, kd->program, "couldn't get phys addr");
return (-1);
}
physaddr = nl[0].n_value;
}
nl[0].n_name = "kernel_l1pa";
- if (kvm_nlist(kd, nl) != 0) {
+ if (kvm_nlist2(kd, nl) != 0) {
_kvm_err(kd, kd->program, "bad namelist");
return (-1);
}
- if (kvm_read(kd, (nl[0].n_value - kernbase + physaddr), &pa,
+ if (kvm_read2(kd, (nl[0].n_value - kernbase + physaddr), &pa,
sizeof(pa)) != sizeof(pa)) {
_kvm_err(kd, kd->program, "cannot read kernel_l1pa");
return (-1);
}
- l1pt = _kvm_malloc(kd, L1_TABLE_SIZE);
- if (kvm_read(kd, pa, l1pt, L1_TABLE_SIZE) != L1_TABLE_SIZE) {
+ l1pt = _kvm_malloc(kd, ARM_L1_TABLE_SIZE);
+ if (kvm_read2(kd, pa, l1pt, ARM_L1_TABLE_SIZE) != ARM_L1_TABLE_SIZE) {
_kvm_err(kd, kd->program, "cannot read l1pt");
free(l1pt);
return (-1);
@@ -208,62 +178,51 @@ _kvm_initvtop(kvm_t *kd)
}
/* from arm/pmap.c */
-#define L1_IDX(va) (((vm_offset_t)(va)) >> L1_S_SHIFT)
-/* from arm/pmap.h */
-#define L1_TYPE_INV 0x00 /* Invalid (fault) */
-#define L1_TYPE_C 0x01 /* Coarse L2 */
-#define L1_TYPE_S 0x02 /* Section */
-#define L1_TYPE_F 0x03 /* Fine L2 */
-#define L1_TYPE_MASK 0x03 /* mask of type bits */
-
-#define l1pte_section_p(pde) (((pde) & L1_TYPE_MASK) == L1_TYPE_S)
+#define ARM_L1_IDX(va) ((va) >> ARM_L1_S_SHIFT)
+
+#define l1pte_section_p(pde) (((pde) & ARM_L1_TYPE_MASK) == ARM_L1_TYPE_S)
#define l1pte_valid(pde) ((pde) != 0)
#define l2pte_valid(pte) ((pte) != 0)
-#define l2pte_index(v) (((v) & L2_ADDR_BITS) >> L2_S_SHIFT)
+#define l2pte_index(v) (((v) & ARM_L2_ADDR_BITS) >> ARM_L2_S_SHIFT)
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_arm_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm = kd->vmst;
- pd_entry_t pd;
- pt_entry_t pte;
- off_t pte_pa;
-
- if (kd->vmst->minidump)
- return (_kvm_minidump_kvatop(kd, va, pa));
+ arm_pd_entry_t pd;
+ arm_pt_entry_t pte;
+ arm_physaddr_t pte_pa;
+ off_t pte_off;
if (vm->l1pt == NULL)
- return (_kvm_pa2off(kd, va, pa, PAGE_SIZE));
- pd = vm->l1pt[L1_IDX(va)];
+ return (_kvm_pa2off(kd, va, pa, ARM_PAGE_SIZE));
+ pd = _kvm32toh(kd, vm->l1pt[ARM_L1_IDX(va)]);
if (!l1pte_valid(pd))
goto invalid;
if (l1pte_section_p(pd)) {
/* 1MB section mapping. */
- *pa = ((u_long)pd & L1_S_ADDR_MASK) + (va & L1_S_OFFSET);
- return (_kvm_pa2off(kd, *pa, pa, L1_S_SIZE));
+ *pa = (pd & ARM_L1_S_ADDR_MASK) + (va & ARM_L1_S_OFFSET);
+ return (_kvm_pa2off(kd, *pa, pa, ARM_L1_S_SIZE));
}
- pte_pa = (pd & L1_ADDR_MASK) + l2pte_index(va) * sizeof(pte);
- _kvm_pa2off(kd, pte_pa, &pte_pa, L1_S_SIZE);
- if (lseek(kd->pmfd, pte_pa, 0) == -1) {
- _kvm_syserr(kd, kd->program, "_kvm_kvatop: lseek");
- goto invalid;
- }
- if (read(kd->pmfd, &pte, sizeof(pte)) != sizeof (pte)) {
- _kvm_syserr(kd, kd->program, "_kvm_kvatop: read");
+ pte_pa = (pd & ARM_L1_C_ADDR_MASK) + l2pte_index(va) * sizeof(pte);
+ _kvm_pa2off(kd, pte_pa, &pte_off, ARM_L1_S_SIZE);
+ if (pread(kd->pmfd, &pte, sizeof(pte), pte_off) != sizeof(pte)) {
+ _kvm_syserr(kd, kd->program, "_arm_kvatop: pread");
goto invalid;
}
+ pte = _kvm32toh(kd, pte);
if (!l2pte_valid(pte)) {
goto invalid;
}
- if ((pte & L2_TYPE_MASK) == L2_TYPE_L) {
- *pa = (pte & L2_L_FRAME) | (va & L2_L_OFFSET);
- return (_kvm_pa2off(kd, *pa, pa, L2_L_SIZE));
+ if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_L) {
+ *pa = (pte & ARM_L2_L_FRAME) | (va & ARM_L2_L_OFFSET);
+ return (_kvm_pa2off(kd, *pa, pa, ARM_L2_L_SIZE));
}
- *pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET);
- return (_kvm_pa2off(kd, *pa, pa, PAGE_SIZE));
+ *pa = (pte & ARM_L2_S_FRAME) | (va & ARM_L2_S_OFFSET);
+ return (_kvm_pa2off(kd, *pa, pa, ARM_PAGE_SIZE));
invalid:
- _kvm_err(kd, 0, "Invalid address (%lx)", va);
+ _kvm_err(kd, 0, "Invalid address (%jx)", (uintmax_t)va);
return 0;
}
@@ -284,3 +243,28 @@ _kvm_mdopen(kvm_t *kd)
return (0);
}
#endif
+
+int
+_arm_native(kvm_t *kd)
+{
+
+#ifdef __arm__
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ return (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB);
+#else
+ return (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2MSB);
+#endif
+#else
+ return (0);
+#endif
+}
+
+struct kvm_arch kvm_arm = {
+ .ka_probe = _arm_probe,
+ .ka_initvtop = _arm_initvtop,
+ .ka_freevtop = _arm_freevtop,
+ .ka_kvatop = _arm_kvatop,
+ .ka_native = _arm_native,
+};
+
+KVM_ARCH(kvm_arm);
diff --git a/lib/libkvm/kvm_arm.h b/lib/libkvm/kvm_arm.h
new file mode 100644
index 0000000..844e158
--- /dev/null
+++ b/lib/libkvm/kvm_arm.h
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 2015 John H. Baldwin <jhb@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __KVM_ARM_H__
+#define __KVM_ARM_H__
+
+#ifdef __arm__
+#include <machine/pte.h>
+#endif
+
+typedef uint32_t arm_physaddr_t;
+typedef uint32_t arm_pd_entry_t;
+typedef uint32_t arm_pt_entry_t;
+
+#define ARM_PAGE_SHIFT 12
+#define ARM_PAGE_SIZE (1 << ARM_PAGE_SHIFT) /* Page size */
+#define ARM_PAGE_MASK (ARM_PAGE_SIZE - 1)
+
+#define ARM_L1_TABLE_SIZE 0x4000 /* 16K */
+
+#define ARM_L1_S_SIZE 0x00100000 /* 1M */
+#define ARM_L1_S_OFFSET (ARM_L1_S_SIZE - 1)
+#define ARM_L1_S_FRAME (~ARM_L1_S_OFFSET)
+#define ARM_L1_S_SHIFT 20
+
+#define ARM_L2_L_SIZE 0x00010000 /* 64K */
+#define ARM_L2_L_OFFSET (ARM_L2_L_SIZE - 1)
+#define ARM_L2_L_FRAME (~ARM_L2_L_OFFSET)
+#define ARM_L2_L_SHIFT 16
+
+#define ARM_L2_S_SIZE 0x00001000 /* 4K */
+#define ARM_L2_S_OFFSET (ARM_L2_S_SIZE - 1)
+#define ARM_L2_S_FRAME (~ARM_L2_S_OFFSET)
+#define ARM_L2_S_SHIFT 12
+
+#define ARM_L1_TYPE_INV 0x00 /* Invalid (fault) */
+#define ARM_L1_TYPE_C 0x01 /* Coarse L2 */
+#define ARM_L1_TYPE_S 0x02 /* Section */
+#define ARM_L1_TYPE_MASK 0x03 /* Mask of type bits */
+
+#define ARM_L1_S_ADDR_MASK 0xfff00000 /* phys address of section */
+#define ARM_L1_C_ADDR_MASK 0xfffffc00 /* phys address of L2 Table */
+
+#define ARM_L2_TYPE_INV 0x00 /* Invalid (fault) */
+#define ARM_L2_TYPE_L 0x01 /* Large Page - 64k - not used yet*/
+#define ARM_L2_TYPE_S 0x02 /* Small Page - 4 */
+#define ARM_L2_TYPE_MASK 0x03
+
+#define ARM_L2_ADDR_BITS 0x000ff000 /* L2 PTE address bits */
+
+#ifdef __arm__
+_Static_assert(PAGE_SHIFT == ARM_PAGE_SHIFT, "PAGE_SHIFT mismatch");
+_Static_assert(PAGE_SIZE == ARM_PAGE_SIZE, "PAGE_SIZE mismatch");
+_Static_assert(PAGE_MASK == ARM_PAGE_MASK, "PAGE_MASK mismatch");
+_Static_assert(L1_TABLE_SIZE == ARM_L1_TABLE_SIZE, "L1_TABLE_SIZE mismatch");
+_Static_assert(L1_S_SIZE == ARM_L1_S_SIZE, "L1_S_SIZE mismatch");
+_Static_assert(L1_S_OFFSET == ARM_L1_S_OFFSET, "L1_S_OFFSET mismatch");
+_Static_assert(L1_S_FRAME == ARM_L1_S_FRAME, "L1_S_FRAME mismatch");
+_Static_assert(L1_S_SHIFT == ARM_L1_S_SHIFT, "L1_S_SHIFT mismatch");
+_Static_assert(L2_L_SIZE == ARM_L2_L_SIZE, "L2_L_SIZE mismatch");
+_Static_assert(L2_L_OFFSET == ARM_L2_L_OFFSET, "L2_L_OFFSET mismatch");
+_Static_assert(L2_L_FRAME == ARM_L2_L_FRAME, "L2_L_FRAME mismatch");
+_Static_assert(L2_L_SHIFT == ARM_L2_L_SHIFT, "L2_L_SHIFT mismatch");
+_Static_assert(L2_S_SIZE == ARM_L2_S_SIZE, "L2_S_SIZE mismatch");
+_Static_assert(L2_S_OFFSET == ARM_L2_S_OFFSET, "L2_S_OFFSET mismatch");
+_Static_assert(L2_S_FRAME == ARM_L2_S_FRAME, "L2_S_FRAME mismatch");
+_Static_assert(L2_S_SHIFT == ARM_L2_S_SHIFT, "L2_S_SHIFT mismatch");
+_Static_assert(L1_TYPE_INV == ARM_L1_TYPE_INV, "L1_TYPE_INV mismatch");
+_Static_assert(L1_TYPE_C == ARM_L1_TYPE_C, "L1_TYPE_C mismatch");
+_Static_assert(L1_TYPE_S == ARM_L1_TYPE_S, "L1_TYPE_S mismatch");
+_Static_assert(L1_TYPE_MASK == ARM_L1_TYPE_MASK, "L1_TYPE_MASK mismatch");
+_Static_assert(L1_S_ADDR_MASK == ARM_L1_S_ADDR_MASK, "L1_S_ADDR_MASK mismatch");
+_Static_assert(L1_C_ADDR_MASK == ARM_L1_C_ADDR_MASK, "L1_C_ADDR_MASK mismatch");
+_Static_assert(L2_TYPE_INV == ARM_L2_TYPE_INV, "L2_TYPE_INV mismatch");
+_Static_assert(L2_TYPE_L == ARM_L2_TYPE_L, "L2_TYPE_L mismatch");
+_Static_assert(L2_TYPE_S == ARM_L2_TYPE_S, "L2_TYPE_S mismatch");
+_Static_assert(L2_TYPE_MASK == ARM_L2_TYPE_MASK, "L2_TYPE_MASK mismatch");
+_Static_assert(L2_ADDR_BITS == ARM_L2_ADDR_BITS, "L2_ADDR_BITS mismatch");
+#endif
+
+int _arm_native(kvm_t *);
+
+#endif /* !__KVM_ARM_H__ */
diff --git a/lib/libkvm/kvm_cptime.c b/lib/libkvm/kvm_cptime.c
index 08f3fca..dcb2ba7 100644
--- a/lib/libkvm/kvm_cptime.c
+++ b/lib/libkvm/kvm_cptime.c
@@ -96,6 +96,12 @@ kvm_getcptime(kvm_t *kd, long *cp_time)
return (getsysctl(kd, "kern.cp_time", cp_time, sizeof(long) *
CPUSTATES));
+ if (!kd->arch->ka_native(kd)) {
+ _kvm_err(kd, kd->program,
+ "cannot read cp_time from non-native core");
+ return (-1);
+ }
+
if (kvm_cp_time_cached == 0) {
if (_kvm_cp_time_init(kd) < 0)
return (-1);
diff --git a/lib/libkvm/kvm_file.c b/lib/libkvm/kvm_file.c
index 863a9fa..12fe6da 100644
--- a/lib/libkvm/kvm_file.c
+++ b/lib/libkvm/kvm_file.c
@@ -150,7 +150,7 @@ kvm_deadfiles(kvm_t *kd, int op __unused, int arg __unused, long allproc_o,
fail:
free(ofiles);
return (0);
-
+
}
char *
diff --git a/lib/libkvm/kvm_getloadavg.c b/lib/libkvm/kvm_getloadavg.c
index ecfc321..b850c02 100644
--- a/lib/libkvm/kvm_getloadavg.c
+++ b/lib/libkvm/kvm_getloadavg.c
@@ -71,6 +71,12 @@ kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem)
if (ISALIVE(kd))
return (getloadavg(loadavg, nelem));
+ if (!kd->arch->ka_native(kd)) {
+ _kvm_err(kd, kd->program,
+ "cannot read loadavg from non-native core");
+ return (-1);
+ }
+
if (kvm_nlist(kd, nl) != 0) {
for (p = nl; p->n_type != 0; ++p);
_kvm_err(kd, kd->program,
diff --git a/lib/libkvm/kvm_getswapinfo.c b/lib/libkvm/kvm_getswapinfo.c
index d79d70c..16d2076 100644
--- a/lib/libkvm/kvm_getswapinfo.c
+++ b/lib/libkvm/kvm_getswapinfo.c
@@ -10,7 +10,7 @@
* 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 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
@@ -77,7 +77,7 @@ static int getsysctl(kvm_t *, const char *, void *, size_t);
_kvm_err(kd, kd->program, "cannot read %s", msg); \
return (-1); \
}
-
+
#define GETSWDEVNAME(dev, str, flags) \
if (dev == NODEV) { \
strlcpy(str, "[NFS swap]", sizeof(str)); \
@@ -117,6 +117,12 @@ kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max,
struct swdevt *sp, swinfo;
struct kvm_swap tot;
+ if (!kd->arch->ka_native(kd)) {
+ _kvm_err(kd, kd->program,
+ "cannot read swapinfo from non-native core");
+ return (-1);
+ }
+
if (!nlist_init(kd))
return (-1);
@@ -231,7 +237,7 @@ nlist_init(kvm_t *kd)
_kvm_err(kd, kd->program, "unable to find swtailq");
return (0);
}
-
+
if (kvm_swap_nl[NL_DMMAX].n_value == 0) {
_kvm_err(kd, kd->program, "unable to find dmmax");
return (0);
diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c
index 45f0a5e..f37da26 100644
--- a/lib/libkvm/kvm_i386.c
+++ b/lib/libkvm/kvm_i386.c
@@ -46,171 +46,133 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
*/
#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
+#include <sys/endian.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <nlist.h>
#include <kvm.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-
-#include <machine/elf.h>
+#ifdef __i386__
+#include <machine/vmparam.h> /* For KERNBASE. */
+#endif
#include <limits.h>
#include "kvm_private.h"
+#include "kvm_i386.h"
-#ifndef btop
-#define btop(x) (i386_btop(x))
-#define ptob(x) (i386_ptob(x))
-#endif
-
-#define PG_FRAME_PAE (~((uint64_t)PAGE_MASK))
-#define PDRSHIFT_PAE 21
-#define NPTEPG_PAE (PAGE_SIZE/sizeof(uint64_t))
-#define NBPDR_PAE (1<<PDRSHIFT_PAE)
-
-/* minidump must be the first item! */
struct vmstate {
- int minidump; /* 1 = minidump mode */
- void *mmapbase;
- size_t mmapsize;
void *PTD;
int pae;
+ size_t phnum;
+ GElf_Phdr *phdr;
};
/*
- * Map the ELF headers into the process' address space. We do this in two
- * steps: first the ELF header itself and using that information the whole
- * set of headers.
- */
-static int
-_kvm_maphdrs(kvm_t *kd, size_t sz)
-{
- struct vmstate *vm = kd->vmst;
-
- /* munmap() previous mmap(). */
- if (vm->mmapbase != NULL) {
- munmap(vm->mmapbase, vm->mmapsize);
- vm->mmapbase = NULL;
- }
-
- vm->mmapsize = sz;
- vm->mmapbase = mmap(NULL, sz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
- if (vm->mmapbase == MAP_FAILED) {
- _kvm_err(kd, kd->program, "cannot mmap corefile");
- return (-1);
- }
- return (0);
-}
-
-/*
* Translate a physical memory address to a file-offset in the crash-dump.
*/
static size_t
_kvm_pa2off(kvm_t *kd, uint64_t pa, off_t *ofs)
{
- Elf_Ehdr *e = kd->vmst->mmapbase;
- Elf_Phdr *p;
- int n;
+ struct vmstate *vm = kd->vmst;
+ GElf_Phdr *p;
+ size_t n;
if (kd->rawdump) {
*ofs = pa;
- return (PAGE_SIZE - ((size_t)pa & PAGE_MASK));
+ return (I386_PAGE_SIZE - (pa & I386_PAGE_MASK));
}
- p = (Elf_Phdr*)((char*)e + e->e_phoff);
- n = e->e_phnum;
+ p = vm->phdr;
+ n = vm->phnum;
while (n && (pa < p->p_paddr || pa >= p->p_paddr + p->p_memsz))
p++, n--;
if (n == 0)
return (0);
*ofs = (pa - p->p_paddr) + p->p_offset;
- return (PAGE_SIZE - ((size_t)pa & PAGE_MASK));
+ return (I386_PAGE_SIZE - (pa & I386_PAGE_MASK));
}
-void
-_kvm_freevtop(kvm_t *kd)
+static void
+_i386_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (kd->vmst->minidump)
- return (_kvm_minidump_freevtop(kd));
- if (vm->mmapbase != NULL)
- munmap(vm->mmapbase, vm->mmapsize);
if (vm->PTD)
free(vm->PTD);
+ free(vm->phdr);
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_initvtop(kvm_t *kd)
+static int
+_i386_probe(kvm_t *kd)
+{
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS32, EM_386) &&
+ !_kvm_is_minidump(kd));
+}
+
+static int
+_i386_initvtop(kvm_t *kd)
{
- struct nlist nl[2];
- u_long pa;
- u_long kernbase;
+ struct kvm_nlist nl[2];
+ i386_physaddr_t pa;
+ kvaddr_t kernbase;
char *PTD;
- Elf_Ehdr *ehdr;
- size_t hdrsz;
int i;
- char minihdr[8];
- if (!kd->rawdump && pread(kd->pmfd, &minihdr, 8, 0) == 8)
- if (memcmp(&minihdr, "minidump", 8) == 0)
- return (_kvm_minidump_initvtop(kd));
-
- kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst));
- if (kd->vmst == 0) {
+ kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(struct vmstate));
+ if (kd->vmst == NULL) {
_kvm_err(kd, kd->program, "cannot allocate vm");
return (-1);
}
kd->vmst->PTD = 0;
if (kd->rawdump == 0) {
- if (_kvm_maphdrs(kd, sizeof(Elf_Ehdr)) == -1)
- return (-1);
-
- ehdr = kd->vmst->mmapbase;
- hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum;
- if (_kvm_maphdrs(kd, hdrsz) == -1)
+ if (_kvm_read_core_phdrs(kd, &kd->vmst->phnum,
+ &kd->vmst->phdr) == -1)
return (-1);
}
nl[0].n_name = "kernbase";
nl[1].n_name = 0;
- if (kvm_nlist(kd, nl) != 0)
+ if (kvm_nlist2(kd, nl) != 0) {
+#ifdef __i386__
kernbase = KERNBASE; /* for old kernels */
- else
+#else
+ _kvm_err(kd, kd->program, "cannot resolve kernbase");
+ return (-1);
+#endif
+ } else
kernbase = nl[0].n_value;
nl[0].n_name = "IdlePDPT";
nl[1].n_name = 0;
- if (kvm_nlist(kd, nl) == 0) {
- uint64_t pa64;
+ if (kvm_nlist2(kd, nl) == 0) {
+ i386_physaddr_pae_t pa64;
- if (kvm_read(kd, (nl[0].n_value - kernbase), &pa,
+ if (kvm_read2(kd, (nl[0].n_value - kernbase), &pa,
sizeof(pa)) != sizeof(pa)) {
_kvm_err(kd, kd->program, "cannot read IdlePDPT");
return (-1);
}
- PTD = _kvm_malloc(kd, 4 * PAGE_SIZE);
+ pa = le32toh(pa);
+ PTD = _kvm_malloc(kd, 4 * I386_PAGE_SIZE);
for (i = 0; i < 4; i++) {
- if (kvm_read(kd, pa + (i * sizeof(pa64)), &pa64,
+ if (kvm_read2(kd, pa + (i * sizeof(pa64)), &pa64,
sizeof(pa64)) != sizeof(pa64)) {
_kvm_err(kd, kd->program, "Cannot read PDPT");
free(PTD);
return (-1);
}
- if (kvm_read(kd, pa64 & PG_FRAME_PAE,
- PTD + (i * PAGE_SIZE), PAGE_SIZE) != (PAGE_SIZE)) {
+ pa64 = le64toh(pa64);
+ if (kvm_read2(kd, pa64 & I386_PG_FRAME_PAE,
+ PTD + (i * I386_PAGE_SIZE), I386_PAGE_SIZE) !=
+ I386_PAGE_SIZE) {
_kvm_err(kd, kd->program, "cannot read PDPT");
free(PTD);
return (-1);
@@ -222,17 +184,18 @@ _kvm_initvtop(kvm_t *kd)
nl[0].n_name = "IdlePTD";
nl[1].n_name = 0;
- if (kvm_nlist(kd, nl) != 0) {
+ if (kvm_nlist2(kd, nl) != 0) {
_kvm_err(kd, kd->program, "bad namelist");
return (-1);
}
- if (kvm_read(kd, (nl[0].n_value - kernbase), &pa,
+ if (kvm_read2(kd, (nl[0].n_value - kernbase), &pa,
sizeof(pa)) != sizeof(pa)) {
_kvm_err(kd, kd->program, "cannot read IdlePTD");
return (-1);
}
- PTD = _kvm_malloc(kd, PAGE_SIZE);
- if (kvm_read(kd, pa, PTD, PAGE_SIZE) != PAGE_SIZE) {
+ pa = le32toh(pa);
+ PTD = _kvm_malloc(kd, I386_PAGE_SIZE);
+ if (kvm_read2(kd, pa, PTD, I386_PAGE_SIZE) != I386_PAGE_SIZE) {
_kvm_err(kd, kd->program, "cannot read PTD");
return (-1);
}
@@ -243,24 +206,23 @@ _kvm_initvtop(kvm_t *kd)
}
static int
-_kvm_vatop(kvm_t *kd, u_long va, off_t *pa)
+_i386_vatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- u_long offset;
- u_long pte_pa;
- u_long pde_pa;
- pd_entry_t pde;
- pt_entry_t pte;
- u_long pdeindex;
- u_long pteindex;
+ i386_physaddr_t offset;
+ i386_physaddr_t pte_pa;
+ i386_pde_t pde;
+ i386_pte_t pte;
+ kvaddr_t pdeindex;
+ kvaddr_t pteindex;
size_t s;
- u_long a;
+ i386_physaddr_t a;
off_t ofs;
- uint32_t *PTD;
+ i386_pde_t *PTD;
vm = kd->vmst;
- PTD = (uint32_t *)vm->PTD;
- offset = va & (PAGE_SIZE - 1);
+ PTD = (i386_pde_t *)vm->PTD;
+ offset = va & I386_PAGE_MASK;
/*
* If we are initializing (kernel page table descriptor pointer
@@ -269,94 +231,88 @@ _kvm_vatop(kvm_t *kd, u_long va, off_t *pa)
if (PTD == 0) {
s = _kvm_pa2off(kd, va, pa);
if (s == 0) {
- _kvm_err(kd, kd->program,
- "_kvm_vatop: bootstrap data not in dump");
+ _kvm_err(kd, kd->program,
+ "_i386_vatop: bootstrap data not in dump");
goto invalid;
} else
- return (PAGE_SIZE - offset);
+ return (I386_PAGE_SIZE - offset);
}
- pdeindex = va >> PDRSHIFT;
- pde = PTD[pdeindex];
- if (((u_long)pde & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid");
+ pdeindex = va >> I386_PDRSHIFT;
+ pde = le32toh(PTD[pdeindex]);
+ if ((pde & I386_PG_V) == 0) {
+ _kvm_err(kd, kd->program, "_i386_vatop: pde not valid");
goto invalid;
}
- if ((u_long)pde & PG_PS) {
- /*
- * No second-level page table; ptd describes one 4MB page.
- * (We assume that the kernel wouldn't set PG_PS without enabling
- * it cr0).
- */
-#define PAGE4M_MASK (NBPDR - 1)
-#define PG_FRAME4M (~PAGE4M_MASK)
- pde_pa = ((u_long)pde & PG_FRAME4M) + (va & PAGE4M_MASK);
- s = _kvm_pa2off(kd, pde_pa, &ofs);
+ if (pde & I386_PG_PS) {
+ /*
+ * No second-level page table; ptd describes one 4MB
+ * page. (We assume that the kernel wouldn't set
+ * PG_PS without enabling it cr0).
+ */
+ offset = va & I386_PAGE_PS_MASK;
+ a = (pde & I386_PG_PS_FRAME) + offset;
+ s = _kvm_pa2off(kd, a, pa);
if (s == 0) {
_kvm_err(kd, kd->program,
- "_kvm_vatop: 4MB page address not in dump");
+ "_i386_vatop: 4MB page address not in dump");
goto invalid;
}
- *pa = ofs;
- return (NBPDR - (va & PAGE4M_MASK));
+ return (I386_NBPDR - offset);
}
- pteindex = (va >> PAGE_SHIFT) & (NPTEPG-1);
- pte_pa = ((u_long)pde & PG_FRAME) + (pteindex * sizeof(pde));
+ pteindex = (va >> I386_PAGE_SHIFT) & (I386_NPTEPG - 1);
+ pte_pa = (pde & I386_PG_FRAME) + (pteindex * sizeof(pte));
s = _kvm_pa2off(kd, pte_pa, &ofs);
- if (s < sizeof pte) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pdpe_pa not found");
+ if (s < sizeof(pte)) {
+ _kvm_err(kd, kd->program, "_i386_vatop: pte_pa not found");
goto invalid;
}
/* XXX This has to be a physical address read, kvm_read is virtual */
- if (lseek(kd->pmfd, ofs, 0) == -1) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: lseek");
- goto invalid;
- }
- if (read(kd->pmfd, &pte, sizeof pte) != sizeof pte) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop: read");
+ if (pread(kd->pmfd, &pte, sizeof(pte), ofs) != sizeof(pte)) {
+ _kvm_syserr(kd, kd->program, "_i386_vatop: pread");
goto invalid;
}
- if (((u_long)pte & PG_V) == 0) {
+ pte = le32toh(pte);
+ if ((pte & I386_PG_V) == 0) {
_kvm_err(kd, kd->program, "_kvm_kvatop: pte not valid");
goto invalid;
}
- a = ((u_long)pte & PG_FRAME) + offset;
- s =_kvm_pa2off(kd, a, pa);
+ a = (pte & I386_PG_FRAME) + offset;
+ s = _kvm_pa2off(kd, a, pa);
if (s == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: address not in dump");
+ _kvm_err(kd, kd->program, "_i386_vatop: address not in dump");
goto invalid;
} else
- return (PAGE_SIZE - offset);
+ return (I386_PAGE_SIZE - offset);
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
static int
-_kvm_vatop_pae(kvm_t *kd, u_long va, off_t *pa)
+_i386_vatop_pae(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- uint64_t offset;
- uint64_t pte_pa;
- uint64_t pde_pa;
- uint64_t pde;
- uint64_t pte;
- u_long pdeindex;
- u_long pteindex;
+ i386_physaddr_pae_t offset;
+ i386_physaddr_pae_t pte_pa;
+ i386_pde_pae_t pde;
+ i386_pte_pae_t pte;
+ kvaddr_t pdeindex;
+ kvaddr_t pteindex;
size_t s;
- uint64_t a;
+ i386_physaddr_pae_t a;
off_t ofs;
- uint64_t *PTD;
+ i386_pde_pae_t *PTD;
vm = kd->vmst;
- PTD = (uint64_t *)vm->PTD;
- offset = va & (PAGE_SIZE - 1);
+ PTD = (i386_pde_pae_t *)vm->PTD;
+ offset = va & I386_PAGE_MASK;
/*
* If we are initializing (kernel page table descriptor pointer
@@ -365,88 +321,102 @@ _kvm_vatop_pae(kvm_t *kd, u_long va, off_t *pa)
if (PTD == 0) {
s = _kvm_pa2off(kd, va, pa);
if (s == 0) {
- _kvm_err(kd, kd->program,
- "_kvm_vatop_pae: bootstrap data not in dump");
+ _kvm_err(kd, kd->program,
+ "_i386_vatop_pae: bootstrap data not in dump");
goto invalid;
} else
- return (PAGE_SIZE - offset);
+ return (I386_PAGE_SIZE - offset);
}
- pdeindex = va >> PDRSHIFT_PAE;
- pde = PTD[pdeindex];
- if (((u_long)pde & PG_V) == 0) {
+ pdeindex = va >> I386_PDRSHIFT_PAE;
+ pde = le64toh(PTD[pdeindex]);
+ if ((pde & I386_PG_V) == 0) {
_kvm_err(kd, kd->program, "_kvm_kvatop_pae: pde not valid");
goto invalid;
}
- if ((u_long)pde & PG_PS) {
- /*
- * No second-level page table; ptd describes one 2MB page.
- * (We assume that the kernel wouldn't set PG_PS without enabling
- * it cr0).
- */
-#define PAGE2M_MASK (NBPDR_PAE - 1)
-#define PG_FRAME2M (~PAGE2M_MASK)
- pde_pa = ((u_long)pde & PG_FRAME2M) + (va & PAGE2M_MASK);
- s = _kvm_pa2off(kd, pde_pa, &ofs);
+ if (pde & I386_PG_PS) {
+ /*
+ * No second-level page table; ptd describes one 2MB
+ * page. (We assume that the kernel wouldn't set
+ * PG_PS without enabling it cr0).
+ */
+ offset = va & I386_PAGE_PS_MASK_PAE;
+ a = (pde & I386_PG_PS_FRAME_PAE) + offset;
+ s = _kvm_pa2off(kd, a, pa);
if (s == 0) {
_kvm_err(kd, kd->program,
- "_kvm_vatop: 2MB page address not in dump");
+ "_i386_vatop: 2MB page address not in dump");
goto invalid;
}
- *pa = ofs;
- return (NBPDR_PAE - (va & PAGE2M_MASK));
+ return (I386_NBPDR_PAE - offset);
}
- pteindex = (va >> PAGE_SHIFT) & (NPTEPG_PAE-1);
- pte_pa = ((uint64_t)pde & PG_FRAME_PAE) + (pteindex * sizeof(pde));
+ pteindex = (va >> I386_PAGE_SHIFT) & (I386_NPTEPG_PAE - 1);
+ pte_pa = (pde & I386_PG_FRAME_PAE) + (pteindex * sizeof(pde));
s = _kvm_pa2off(kd, pte_pa, &ofs);
- if (s < sizeof pte) {
- _kvm_err(kd, kd->program, "_kvm_vatop_pae: pdpe_pa not found");
+ if (s < sizeof(pte)) {
+ _kvm_err(kd, kd->program, "_i386_vatop_pae: pdpe_pa not found");
goto invalid;
}
/* XXX This has to be a physical address read, kvm_read is virtual */
- if (lseek(kd->pmfd, ofs, 0) == -1) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop_pae: lseek");
- goto invalid;
- }
- if (read(kd->pmfd, &pte, sizeof pte) != sizeof pte) {
- _kvm_syserr(kd, kd->program, "_kvm_vatop_pae: read");
+ if (pread(kd->pmfd, &pte, sizeof(pte), ofs) != sizeof(pte)) {
+ _kvm_syserr(kd, kd->program, "_i386_vatop_pae: read");
goto invalid;
}
- if (((uint64_t)pte & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop_pae: pte not valid");
+ pte = le64toh(pte);
+ if ((pte & I386_PG_V) == 0) {
+ _kvm_err(kd, kd->program, "_i386_vatop_pae: pte not valid");
goto invalid;
}
- a = ((uint64_t)pte & PG_FRAME_PAE) + offset;
- s =_kvm_pa2off(kd, a, pa);
+ a = (pte & I386_PG_FRAME_PAE) + offset;
+ s = _kvm_pa2off(kd, a, pa);
if (s == 0) {
_kvm_err(kd, kd->program,
- "_kvm_vatop_pae: address not in dump");
+ "_i386_vatop_pae: address not in dump");
goto invalid;
} else
- return (PAGE_SIZE - offset);
+ return (I386_PAGE_SIZE - offset);
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_i386_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
- if (kd->vmst->minidump)
- return (_kvm_minidump_kvatop(kd, va, pa));
if (ISALIVE(kd)) {
_kvm_err(kd, 0, "vatop called in live kernel!");
return (0);
}
if (kd->vmst->pae)
- return (_kvm_vatop_pae(kd, va, pa));
+ return (_i386_vatop_pae(kd, va, pa));
else
- return (_kvm_vatop(kd, va, pa));
+ return (_i386_vatop(kd, va, pa));
+}
+
+int
+_i386_native(kvm_t *kd)
+{
+
+#ifdef __i386__
+ return (1);
+#else
+ return (0);
+#endif
}
+
+struct kvm_arch kvm_i386 = {
+ .ka_probe = _i386_probe,
+ .ka_initvtop = _i386_initvtop,
+ .ka_freevtop = _i386_freevtop,
+ .ka_kvatop = _i386_kvatop,
+ .ka_native = _i386_native,
+};
+
+KVM_ARCH(kvm_i386);
diff --git a/lib/libkvm/kvm_i386.h b/lib/libkvm/kvm_i386.h
new file mode 100644
index 0000000..2949e68
--- /dev/null
+++ b/lib/libkvm/kvm_i386.h
@@ -0,0 +1,79 @@
+/*-
+ * Copyright (c) 2015 John H. Baldwin <jhb@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __KVM_I386_H__
+#define __KVM_I386_H__
+
+#ifdef __i386__
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#endif
+
+typedef uint32_t i386_physaddr_t;
+typedef uint32_t i386_pte_t;
+typedef uint32_t i386_pde_t;
+typedef uint64_t i386_physaddr_pae_t;
+typedef uint64_t i386_pte_pae_t;
+typedef uint64_t i386_pde_pae_t;
+
+#define I386_PAGE_SHIFT 12
+#define I386_PAGE_SIZE (1 << I386_PAGE_SHIFT)
+#define I386_PAGE_MASK (I386_PAGE_SIZE - 1)
+#define I386_NPTEPG (I386_PAGE_SIZE / sizeof(i386_pte_t))
+#define I386_PDRSHIFT 22
+#define I386_NBPDR (1 << I386_PDRSHIFT)
+#define I386_PAGE_PS_MASK (I386_NBPDR - 1)
+#define I386_NPTEPG_PAE (I386_PAGE_SIZE / sizeof(i386_pte_pae_t))
+#define I386_PDRSHIFT_PAE 21
+#define I386_NBPDR_PAE (1 << I386_PDRSHIFT_PAE)
+#define I386_PAGE_PS_MASK_PAE (I386_NBPDR_PAE - 1)
+
+#define I386_PG_V 0x001
+#define I386_PG_PS 0x080
+#define I386_PG_FRAME_PAE (0x000ffffffffff000ull)
+#define I386_PG_PS_FRAME_PAE (0x000fffffffe00000ull)
+#define I386_PG_FRAME (0xfffff000)
+#define I386_PG_PS_FRAME (0xffc00000)
+
+#ifdef __i386__
+_Static_assert(PAGE_SHIFT == I386_PAGE_SHIFT, "PAGE_SHIFT mismatch");
+_Static_assert(PAGE_SIZE == I386_PAGE_SIZE, "PAGE_SIZE mismatch");
+_Static_assert(PAGE_MASK == I386_PAGE_MASK, "PAGE_MASK mismatch");
+_Static_assert(NPTEPG == I386_NPTEPG, "NPTEPG mismatch");
+_Static_assert(PDRSHIFT == I386_PDRSHIFT, "PDRSHIFT mismatch");
+_Static_assert(NBPDR == I386_NBPDR, "NBPDR mismatch");
+
+_Static_assert(PG_V == I386_PG_V, "PG_V mismatch");
+_Static_assert(PG_PS == I386_PG_PS, "PG_PS mismatch");
+_Static_assert(PG_FRAME == I386_PG_FRAME, "PG_FRAME mismatch");
+_Static_assert(PG_PS_FRAME == I386_PG_PS_FRAME, "PG_PS_FRAME mismatch");
+#endif
+
+int _i386_native(kvm_t *);
+
+#endif /* !__KVM_I386_H__ */
diff --git a/lib/libkvm/kvm_minidump_aarch64.c b/lib/libkvm/kvm_minidump_aarch64.c
index 5a4990e..366dd9f 100644
--- a/lib/libkvm/kvm_minidump_aarch64.c
+++ b/lib/libkvm/kvm_minidump_aarch64.c
@@ -29,116 +29,55 @@
__FBSDID("$FreeBSD$");
/*
- * ARM64 (AArch64) machine dependent routines for kvm and minidumps.
+ * ARM64 (AArch64) machine dependent routines for kvm and minidumps.
*/
#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/fnv_hash.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <nlist.h>
#include <kvm.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-
-#include <machine/elf.h>
-#include <machine/cpufunc.h>
-#include <machine/pte.h>
-#include <machine/minidump.h>
+#include "../../sys/arm64/include/minidump.h"
#include <limits.h>
-#include <stdint.h>
#include "kvm_private.h"
+#include "kvm_aarch64.h"
-struct hpte {
- struct hpte *next;
- vm_paddr_t pa;
- int64_t off;
-};
-
-#define HPT_SIZE 1024
+#define aarch64_round_page(x) roundup2((kvaddr_t)(x), AARCH64_PAGE_SIZE)
-/* minidump must be the first item! */
struct vmstate {
- int minidump; /* 1 = minidump mode */
struct minidumphdr hdr;
- void *hpt_head[HPT_SIZE];
- uint64_t *bitmap;
+ struct hpt hpt;
uint64_t *page_map;
};
-static void
-hpt_insert(kvm_t *kd, vm_paddr_t pa, int64_t off)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- hpte = malloc(sizeof(*hpte));
- hpte->pa = pa;
- hpte->off = off;
- hpte->next = kd->vmst->hpt_head[fnv];
- kd->vmst->hpt_head[fnv] = hpte;
-}
-
-static int64_t
-hpt_find(kvm_t *kd, vm_paddr_t pa)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) {
- if (pa == hpte->pa)
- return (hpte->off);
- }
- return (-1);
-}
-
static int
-inithash(kvm_t *kd, uint64_t *base, int len, off_t off)
+_aarch64_minidump_probe(kvm_t *kd)
{
- uint64_t idx;
- uint64_t bit, bits;
- vm_paddr_t pa;
- for (idx = 0; idx < len / sizeof(*base); idx++) {
- bits = base[idx];
- while (bits) {
- bit = ffsl(bits) - 1;
- bits &= ~(1ul << bit);
- pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE;
- hpt_insert(kd, pa, off);
- off += PAGE_SIZE;
- }
- }
- return (off);
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_AARCH64) &&
+ _kvm_is_minidump(kd));
}
-void
-_kvm_minidump_freevtop(kvm_t *kd)
+static void
+_aarch64_minidump_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- free(vm->bitmap);
+ _kvm_hpt_free(&vm->hpt);
free(vm->page_map);
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_minidump_initvtop(kvm_t *kd)
+static int
+_aarch64_minidump_initvtop(kvm_t *kd)
{
struct vmstate *vmst;
+ uint64_t *bitmap;
off_t off;
vmst = _kvm_malloc(kd, sizeof(*vmst));
@@ -147,7 +86,6 @@ _kvm_minidump_initvtop(kvm_t *kd)
return (-1);
}
kd->vmst = vmst;
- vmst->minidump = 1;
if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) !=
sizeof(vmst->hdr)) {
_kvm_err(kd, kd->program, "cannot read dump header");
@@ -159,111 +97,157 @@ _kvm_minidump_initvtop(kvm_t *kd)
return (-1);
}
- if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) {
+ vmst->hdr.version = le32toh(vmst->hdr.version);
+ if (vmst->hdr.version != MINIDUMP_VERSION) {
_kvm_err(kd, kd->program, "wrong minidump version. "
"Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version);
return (-1);
}
+ vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize);
+ vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize);
+ vmst->hdr.pmapsize = le32toh(vmst->hdr.pmapsize);
+ vmst->hdr.kernbase = le64toh(vmst->hdr.kernbase);
+ vmst->hdr.dmapphys = le64toh(vmst->hdr.dmapphys);
+ vmst->hdr.dmapbase = le64toh(vmst->hdr.dmapbase);
+ vmst->hdr.dmapend = le64toh(vmst->hdr.dmapend);
/* Skip header and msgbuf */
- off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize);
+ off = AARCH64_PAGE_SIZE + aarch64_round_page(vmst->hdr.msgbufsize);
- vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
- if (vmst->bitmap == NULL) {
+ bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
+ if (bitmap == NULL) {
_kvm_err(kd, kd->program,
"cannot allocate %d bytes for bitmap",
vmst->hdr.bitmapsize);
return (-1);
}
- if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) !=
- vmst->hdr.bitmapsize) {
+ if (pread(kd->pmfd, bitmap, vmst->hdr.bitmapsize, off) !=
+ (ssize_t)vmst->hdr.bitmapsize) {
_kvm_err(kd, kd->program,
"cannot read %d bytes for page bitmap",
vmst->hdr.bitmapsize);
+ free(bitmap);
return (-1);
}
- off += round_page(vmst->hdr.bitmapsize);
+ off += aarch64_round_page(vmst->hdr.bitmapsize);
vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize);
if (vmst->page_map == NULL) {
_kvm_err(kd, kd->program,
"cannot allocate %d bytes for page_map",
vmst->hdr.pmapsize);
+ free(bitmap);
return (-1);
}
/* This is the end of the dump, savecore may have truncated it. */
+ /*
+ * XXX: This doesn't make sense. The pmap is not at the end,
+ * and if it is truncated we don't have any actual data (it's
+ * all stored after the bitmap and pmap. -- jhb
+ */
if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) <
- PAGE_SIZE) {
+ AARCH64_PAGE_SIZE) {
_kvm_err(kd, kd->program, "cannot read %d bytes for page_map",
vmst->hdr.pmapsize);
+ free(bitmap);
+ return (-1);
}
off += vmst->hdr.pmapsize;
/* build physical address hash table for sparse pages */
- inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off);
+ _kvm_hpt_init(kd, &vmst->hpt, bitmap, vmst->hdr.bitmapsize, off,
+ AARCH64_PAGE_SIZE, sizeof(*bitmap));
+ free(bitmap);
return (0);
}
static int
-_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa)
+_aarch64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- u_long offset;
- pt_entry_t l3;
- u_long l3_index;
- u_long a;
+ aarch64_physaddr_t offset;
+ aarch64_pte_t l3;
+ kvaddr_t l3_index;
+ aarch64_physaddr_t a;
off_t ofs;
vm = kd->vmst;
- offset = va & PAGE_MASK;
+ offset = va & AARCH64_PAGE_MASK;
if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) {
- a = (va - vm->hdr.dmapbase + vm->hdr.dmapphys) & ~PAGE_MASK;
- ofs = hpt_find(kd, a);
+ a = (va - vm->hdr.dmapbase + vm->hdr.dmapphys) &
+ ~AARCH64_PAGE_MASK;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: "
- "direct map address 0x%lx not in minidump", va);
+ _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: "
+ "direct map address 0x%jx not in minidump",
+ (uintmax_t)va);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (AARCH64_PAGE_SIZE - offset);
} else if (va >= vm->hdr.kernbase) {
- l3_index = (va - vm->hdr.kernbase) >> L3_SHIFT;
+ l3_index = (va - vm->hdr.kernbase) >> AARCH64_L3_SHIFT;
if (l3_index >= vm->hdr.pmapsize / sizeof(*vm->page_map))
goto invalid;
- l3 = vm->page_map[l3_index];
- if ((l3 & ATTR_DESCR_MASK) != L3_PAGE) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid");
+ l3 = le64toh(vm->page_map[l3_index]);
+ if ((l3 & AARCH64_ATTR_DESCR_MASK) != AARCH64_L3_PAGE) {
+ _kvm_err(kd, kd->program,
+ "_aarch64_minidump_vatop: pde not valid");
goto invalid;
}
- a = l3 & ~ATTR_MASK;
- ofs = hpt_find(kd, a);
+ a = l3 & ~AARCH64_ATTR_MASK;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: "
- "physical address 0x%lx not in minidump", a);
+ _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: "
+ "physical address 0x%jx not in minidump",
+ (uintmax_t)a);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (AARCH64_PAGE_SIZE - offset);
} else {
_kvm_err(kd, kd->program,
- "_kvm_vatop: virtual address 0x%lx not minidumped", va);
+ "_aarch64_minidump_vatop: virtual address 0x%jx not minidumped",
+ (uintmax_t)va);
goto invalid;
}
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
-int
-_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_aarch64_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
if (ISALIVE(kd)) {
- _kvm_err(kd, 0, "kvm_kvatop called in live kernel!");
+ _kvm_err(kd, 0,
+ "_aarch64_minidump_kvatop called in live kernel!");
return (0);
}
- return (_kvm_minidump_vatop(kd, va, pa));
+ return (_aarch64_minidump_vatop(kd, va, pa));
+}
+
+static int
+_aarch64_native(kvm_t *kd)
+{
+
+#ifdef __aarch64__
+ return (1);
+#else
+ return (0);
+#endif
}
+
+struct kvm_arch kvm_aarch64_minidump = {
+ .ka_probe = _aarch64_minidump_probe,
+ .ka_initvtop = _aarch64_minidump_initvtop,
+ .ka_freevtop = _aarch64_minidump_freevtop,
+ .ka_kvatop = _aarch64_minidump_kvatop,
+ .ka_native = _aarch64_native,
+};
+
+KVM_ARCH(kvm_aarch64_minidump);
diff --git a/lib/libkvm/kvm_minidump_amd64.c b/lib/libkvm/kvm_minidump_amd64.c
index 779fa97..cbc1328 100644
--- a/lib/libkvm/kvm_minidump_amd64.c
+++ b/lib/libkvm/kvm_minidump_amd64.c
@@ -27,116 +27,57 @@
__FBSDID("$FreeBSD$");
/*
- * AMD64 machine dependent routines for kvm and minidumps.
+ * AMD64 machine dependent routines for kvm and minidumps.
*/
#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/fnv_hash.h>
+#include <sys/endian.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <nlist.h>
#include <kvm.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-
-#include <machine/elf.h>
-#include <machine/cpufunc.h>
-#include <machine/minidump.h>
+#include "../../sys/amd64/include/minidump.h"
#include <limits.h>
#include "kvm_private.h"
+#include "kvm_amd64.h"
-struct hpte {
- struct hpte *next;
- vm_paddr_t pa;
- int64_t off;
-};
-
-#define HPT_SIZE 1024
+#define amd64_round_page(x) roundup2((kvaddr_t)(x), AMD64_PAGE_SIZE)
-/* minidump must be the first item! */
struct vmstate {
- int minidump; /* 1 = minidump mode */
struct minidumphdr hdr;
- void *hpt_head[HPT_SIZE];
- uint64_t *bitmap;
- uint64_t *page_map;
+ struct hpt hpt;
+ amd64_pte_t *page_map;
};
-static void
-hpt_insert(kvm_t *kd, vm_paddr_t pa, int64_t off)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- hpte = malloc(sizeof(*hpte));
- hpte->pa = pa;
- hpte->off = off;
- hpte->next = kd->vmst->hpt_head[fnv];
- kd->vmst->hpt_head[fnv] = hpte;
-}
-
-static int64_t
-hpt_find(kvm_t *kd, vm_paddr_t pa)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) {
- if (pa == hpte->pa)
- return (hpte->off);
- }
- return (-1);
-}
-
static int
-inithash(kvm_t *kd, uint64_t *base, int len, off_t off)
+_amd64_minidump_probe(kvm_t *kd)
{
- uint64_t idx;
- uint64_t bit, bits;
- vm_paddr_t pa;
-
- for (idx = 0; idx < len / sizeof(*base); idx++) {
- bits = base[idx];
- while (bits) {
- bit = bsfq(bits);
- bits &= ~(1ul << bit);
- pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE;
- hpt_insert(kd, pa, off);
- off += PAGE_SIZE;
- }
- }
- return (off);
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_X86_64) &&
+ _kvm_is_minidump(kd));
}
-void
-_kvm_minidump_freevtop(kvm_t *kd)
+static void
+_amd64_minidump_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (vm->bitmap)
- free(vm->bitmap);
+ _kvm_hpt_free(&vm->hpt);
if (vm->page_map)
free(vm->page_map);
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_minidump_initvtop(kvm_t *kd)
+static int
+_amd64_minidump_initvtop(kvm_t *kd)
{
struct vmstate *vmst;
+ uint64_t *bitmap;
off_t off;
vmst = _kvm_malloc(kd, sizeof(*vmst));
@@ -145,7 +86,6 @@ _kvm_minidump_initvtop(kvm_t *kd)
return (-1);
}
kd->vmst = vmst;
- vmst->minidump = 1;
if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) !=
sizeof(vmst->hdr)) {
_kvm_err(kd, kd->program, "cannot read dump header");
@@ -160,177 +100,222 @@ _kvm_minidump_initvtop(kvm_t *kd)
* NB: amd64 minidump header is binary compatible between version 1
* and version 2; this may not be the case for the future versions.
*/
+ vmst->hdr.version = le32toh(vmst->hdr.version);
if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) {
_kvm_err(kd, kd->program, "wrong minidump version. expected %d got %d",
MINIDUMP_VERSION, vmst->hdr.version);
return (-1);
}
+ vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize);
+ vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize);
+ vmst->hdr.pmapsize = le32toh(vmst->hdr.pmapsize);
+ vmst->hdr.kernbase = le64toh(vmst->hdr.kernbase);
+ vmst->hdr.dmapbase = le64toh(vmst->hdr.dmapbase);
+ vmst->hdr.dmapend = le64toh(vmst->hdr.dmapend);
/* Skip header and msgbuf */
- off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize);
+ off = AMD64_PAGE_SIZE + amd64_round_page(vmst->hdr.msgbufsize);
- vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
- if (vmst->bitmap == NULL) {
+ bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
+ if (bitmap == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for bitmap", vmst->hdr.bitmapsize);
return (-1);
}
- if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) !=
- vmst->hdr.bitmapsize) {
+ if (pread(kd->pmfd, bitmap, vmst->hdr.bitmapsize, off) !=
+ (ssize_t)vmst->hdr.bitmapsize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize);
+ free(bitmap);
return (-1);
}
- off += round_page(vmst->hdr.bitmapsize);
+ off += amd64_round_page(vmst->hdr.bitmapsize);
vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize);
if (vmst->page_map == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for page_map", vmst->hdr.pmapsize);
+ free(bitmap);
return (-1);
}
if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) !=
- vmst->hdr.pmapsize) {
+ (ssize_t)vmst->hdr.pmapsize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for page_map", vmst->hdr.pmapsize);
+ free(bitmap);
return (-1);
}
off += vmst->hdr.pmapsize;
/* build physical address hash table for sparse pages */
- inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off);
+ _kvm_hpt_init(kd, &vmst->hpt, bitmap, vmst->hdr.bitmapsize, off,
+ AMD64_PAGE_SIZE, sizeof(*bitmap));
+ free(bitmap);
return (0);
}
static int
-_kvm_minidump_vatop_v1(kvm_t *kd, u_long va, off_t *pa)
+_amd64_minidump_vatop_v1(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- u_long offset;
- pt_entry_t pte;
- u_long pteindex;
- u_long a;
+ amd64_physaddr_t offset;
+ amd64_pte_t pte;
+ kvaddr_t pteindex;
+ amd64_physaddr_t a;
off_t ofs;
vm = kd->vmst;
- offset = va & (PAGE_SIZE - 1);
+ offset = va & AMD64_PAGE_MASK;
if (va >= vm->hdr.kernbase) {
- pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT;
+ pteindex = (va - vm->hdr.kernbase) >> AMD64_PAGE_SHIFT;
if (pteindex >= vm->hdr.pmapsize / sizeof(*vm->page_map))
goto invalid;
- pte = vm->page_map[pteindex];
- if (((u_long)pte & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
+ pte = le64toh(vm->page_map[pteindex]);
+ if ((pte & AMD64_PG_V) == 0) {
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop_v1: pte not valid");
goto invalid;
}
- a = pte & PG_FRAME;
- ofs = hpt_find(kd, a);
+ a = pte & AMD64_PG_FRAME;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%lx not in minidump", a);
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop_v1: physical address 0x%jx not in minidump",
+ (uintmax_t)a);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (AMD64_PAGE_SIZE - offset);
} else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) {
- a = (va - vm->hdr.dmapbase) & ~PAGE_MASK;
- ofs = hpt_find(kd, a);
+ a = (va - vm->hdr.dmapbase) & ~AMD64_PAGE_MASK;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: direct map address 0x%lx not in minidump", va);
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop_v1: direct map address 0x%jx not in minidump",
+ (uintmax_t)va);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (AMD64_PAGE_SIZE - offset);
} else {
- _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va);
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop_v1: virtual address 0x%jx not minidumped",
+ (uintmax_t)va);
goto invalid;
}
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
static int
-_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa)
+_amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
- pt_entry_t pt[NPTEPG];
+ amd64_pte_t pt[AMD64_NPTEPG];
struct vmstate *vm;
- u_long offset;
- pd_entry_t pde;
- pd_entry_t pte;
- u_long pteindex;
- u_long pdeindex;
- u_long a;
+ amd64_physaddr_t offset;
+ amd64_pde_t pde;
+ amd64_pte_t pte;
+ kvaddr_t pteindex;
+ kvaddr_t pdeindex;
+ amd64_physaddr_t a;
off_t ofs;
vm = kd->vmst;
- offset = va & PAGE_MASK;
+ offset = va & AMD64_PAGE_MASK;
if (va >= vm->hdr.kernbase) {
- pdeindex = (va - vm->hdr.kernbase) >> PDRSHIFT;
+ pdeindex = (va - vm->hdr.kernbase) >> AMD64_PDRSHIFT;
if (pdeindex >= vm->hdr.pmapsize / sizeof(*vm->page_map))
goto invalid;
- pde = vm->page_map[pdeindex];
- if (((u_long)pde & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid");
+ pde = le64toh(vm->page_map[pdeindex]);
+ if ((pde & AMD64_PG_V) == 0) {
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop: pde not valid");
goto invalid;
}
- if ((pde & PG_PS) == 0) {
- a = pde & PG_FRAME;
- ofs = hpt_find(kd, a);
+ if ((pde & AMD64_PG_PS) == 0) {
+ a = pde & AMD64_PG_FRAME;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pt physical address 0x%lx not in minidump", a);
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop: pt physical address 0x%jx not in minidump",
+ (uintmax_t)a);
goto invalid;
}
- if (pread(kd->pmfd, &pt, PAGE_SIZE, ofs) != PAGE_SIZE) {
- _kvm_err(kd, kd->program, "cannot read %d bytes for pt", PAGE_SIZE);
+ /* TODO: Just read the single PTE */
+ if (pread(kd->pmfd, &pt, AMD64_PAGE_SIZE, ofs) !=
+ AMD64_PAGE_SIZE) {
+ _kvm_err(kd, kd->program,
+ "cannot read %d bytes for page table",
+ AMD64_PAGE_SIZE);
return (-1);
}
- pteindex = (va >> PAGE_SHIFT) & ((1ul << NPTEPGSHIFT) - 1);
- pte = pt[pteindex];
- if (((u_long)pte & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
+ pteindex = (va >> AMD64_PAGE_SHIFT) &
+ (AMD64_NPTEPG - 1);
+ pte = le64toh(pt[pteindex]);
+ if ((pte & AMD64_PG_V) == 0) {
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop: pte not valid");
goto invalid;
}
- a = pte & PG_FRAME;
+ a = pte & AMD64_PG_FRAME;
} else {
- a = pde & PG_PS_FRAME;
- a += (va & PDRMASK) ^ offset;
+ a = pde & AMD64_PG_PS_FRAME;
+ a += (va & AMD64_PDRMASK) ^ offset;
}
- ofs = hpt_find(kd, a);
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%lx not in minidump", a);
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop: physical address 0x%jx not in minidump",
+ (uintmax_t)a);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (AMD64_PAGE_SIZE - offset);
} else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) {
- a = (va - vm->hdr.dmapbase) & ~PAGE_MASK;
- ofs = hpt_find(kd, a);
+ a = (va - vm->hdr.dmapbase) & ~AMD64_PAGE_MASK;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: direct map address 0x%lx not in minidump", va);
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop: direct map address 0x%jx not in minidump",
+ (uintmax_t)va);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (AMD64_PAGE_SIZE - offset);
} else {
- _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va);
+ _kvm_err(kd, kd->program,
+ "_amd64_minidump_vatop: virtual address 0x%jx not minidumped",
+ (uintmax_t)va);
goto invalid;
}
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
-int
-_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_amd64_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
if (ISALIVE(kd)) {
- _kvm_err(kd, 0, "kvm_kvatop called in live kernel!");
+ _kvm_err(kd, 0,
+ "_amd64_minidump_kvatop called in live kernel!");
return (0);
}
if (((struct vmstate *)kd->vmst)->hdr.version == 1)
- return (_kvm_minidump_vatop_v1(kd, va, pa));
+ return (_amd64_minidump_vatop_v1(kd, va, pa));
else
- return (_kvm_minidump_vatop(kd, va, pa));
+ return (_amd64_minidump_vatop(kd, va, pa));
}
+
+struct kvm_arch kvm_amd64_minidump = {
+ .ka_probe = _amd64_minidump_probe,
+ .ka_initvtop = _amd64_minidump_initvtop,
+ .ka_freevtop = _amd64_minidump_freevtop,
+ .ka_kvatop = _amd64_minidump_kvatop,
+ .ka_native = _amd64_native,
+};
+
+KVM_ARCH(kvm_amd64_minidump);
diff --git a/lib/libkvm/kvm_minidump_arm.c b/lib/libkvm/kvm_minidump_arm.c
index f4ba604..9e9cd67 100644
--- a/lib/libkvm/kvm_minidump_arm.c
+++ b/lib/libkvm/kvm_minidump_arm.c
@@ -33,120 +33,54 @@ __FBSDID("$FreeBSD$");
* ARM machine dependent routines for kvm and minidumps.
*/
+#include <sys/endian.h>
#include <sys/param.h>
-#ifndef CROSS_LIBKVM
-#include <sys/user.h>
-#endif
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/fnv_hash.h>
+#include <kvm.h>
+#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <nlist.h>
-#include <kvm.h>
-
-#ifndef CROSS_LIBKVM
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <machine/elf.h>
-#include <machine/cpufunc.h>
-#include <machine/minidump.h>
-#else
-#include "../../sys/arm/include/pte.h"
-#include "../../sys/arm/include/vmparam.h"
#include "../../sys/arm/include/minidump.h"
-#endif
-
-#include <limits.h>
#include "kvm_private.h"
+#include "kvm_arm.h"
-struct hpte {
- struct hpte *next;
- uint64_t pa;
- int64_t off;
-};
+#define arm_round_page(x) roundup2((kvaddr_t)(x), ARM_PAGE_SIZE)
-#define HPT_SIZE 1024
-
-/* minidump must be the first field */
struct vmstate {
- int minidump; /* 1 = minidump mode */
struct minidumphdr hdr;
- void *hpt_head[HPT_SIZE];
- uint32_t *bitmap;
+ struct hpt hpt;
void *ptemap;
+ unsigned char ei_data;
};
-static void
-hpt_insert(kvm_t *kd, uint64_t pa, int64_t off)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- hpte = malloc(sizeof(*hpte));
- hpte->pa = pa;
- hpte->off = off;
- hpte->next = kd->vmst->hpt_head[fnv];
- kd->vmst->hpt_head[fnv] = hpte;
-}
-
-static int64_t
-hpt_find(kvm_t *kd, uint64_t pa)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next)
- if (pa == hpte->pa)
- return (hpte->off);
-
- return (-1);
-}
-
static int
-inithash(kvm_t *kd, uint32_t *base, int len, off_t off)
+_arm_minidump_probe(kvm_t *kd)
{
- uint64_t idx, pa;
- uint32_t bit, bits;
-
- for (idx = 0; idx < len / sizeof(*base); idx++) {
- bits = base[idx];
- while (bits) {
- bit = ffs(bits) - 1;
- bits &= ~(1ul << bit);
- pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE;
- hpt_insert(kd, pa, off);
- off += PAGE_SIZE;
- }
- }
- return (off);
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS32, EM_ARM) &&
+ _kvm_is_minidump(kd));
}
-void
-_kvm_minidump_freevtop(kvm_t *kd)
+static void
+_arm_minidump_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (vm->bitmap)
- free(vm->bitmap);
+ _kvm_hpt_free(&vm->hpt);
if (vm->ptemap)
free(vm->ptemap);
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_minidump_initvtop(kvm_t *kd)
+static int
+_arm_minidump_initvtop(kvm_t *kd)
{
struct vmstate *vmst;
+ uint32_t *bitmap;
off_t off;
vmst = _kvm_malloc(kd, sizeof(*vmst));
@@ -156,7 +90,6 @@ _kvm_minidump_initvtop(kvm_t *kd)
}
kd->vmst = vmst;
- vmst->minidump = 1;
if (pread(kd->pmfd, &vmst->hdr,
sizeof(vmst->hdr), 0) != sizeof(vmst->hdr)) {
@@ -169,34 +102,41 @@ _kvm_minidump_initvtop(kvm_t *kd)
_kvm_err(kd, kd->program, "not a minidump for this platform");
return (-1);
}
+ vmst->hdr.version = _kvm32toh(kd, vmst->hdr.version);
if (vmst->hdr.version != MINIDUMP_VERSION) {
_kvm_err(kd, kd->program, "wrong minidump version. "
"Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version);
return (-1);
}
+ vmst->hdr.msgbufsize = _kvm32toh(kd, vmst->hdr.msgbufsize);
+ vmst->hdr.bitmapsize = _kvm32toh(kd, vmst->hdr.bitmapsize);
+ vmst->hdr.ptesize = _kvm32toh(kd, vmst->hdr.ptesize);
+ vmst->hdr.kernbase = _kvm32toh(kd, vmst->hdr.kernbase);
/* Skip header and msgbuf */
- off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize);
+ off = ARM_PAGE_SIZE + arm_round_page(vmst->hdr.msgbufsize);
- vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
- if (vmst->bitmap == NULL) {
+ bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
+ if (bitmap == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for "
"bitmap", vmst->hdr.bitmapsize);
return (-1);
}
- if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) !=
+ if (pread(kd->pmfd, bitmap, vmst->hdr.bitmapsize, off) !=
(ssize_t)vmst->hdr.bitmapsize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap",
vmst->hdr.bitmapsize);
+ free(bitmap);
return (-1);
}
- off += round_page(vmst->hdr.bitmapsize);
+ off += arm_round_page(vmst->hdr.bitmapsize);
vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize);
if (vmst->ptemap == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for "
"ptemap", vmst->hdr.ptesize);
+ free(bitmap);
return (-1);
}
@@ -204,28 +144,32 @@ _kvm_minidump_initvtop(kvm_t *kd)
(ssize_t)vmst->hdr.ptesize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for ptemap",
vmst->hdr.ptesize);
+ free(bitmap);
return (-1);
}
off += vmst->hdr.ptesize;
/* Build physical address hash table for sparse pages */
- inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off);
+ _kvm_hpt_init(kd, &vmst->hpt, bitmap, vmst->hdr.bitmapsize, off,
+ ARM_PAGE_SIZE, sizeof(*bitmap));
+ free(bitmap);
return (0);
}
-int
-_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- pt_entry_t pte;
- u_long offset, pteindex, a;
+ arm_pt_entry_t pte;
+ arm_physaddr_t offset, a;
+ kvaddr_t pteindex;
off_t ofs;
- uint32_t *ptemap;
+ arm_pt_entry_t *ptemap;
if (ISALIVE(kd)) {
- _kvm_err(kd, 0, "kvm_kvatop called in live kernel!");
+ _kvm_err(kd, 0, "_arm_minidump_kvatop called in live kernel!");
return (0);
}
@@ -233,36 +177,48 @@ _kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa)
ptemap = vm->ptemap;
if (va >= vm->hdr.kernbase) {
- pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT;
- pte = ptemap[pteindex];
+ pteindex = (va - vm->hdr.kernbase) >> ARM_PAGE_SHIFT;
+ pte = _kvm32toh(kd, ptemap[pteindex]);
if (!pte) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
+ _kvm_err(kd, kd->program,
+ "_arm_minidump_kvatop: pte not valid");
goto invalid;
}
- if ((pte & L2_TYPE_MASK) == L2_TYPE_L) {
- offset = va & L2_L_OFFSET;
- a = pte & L2_L_FRAME;
- } else if ((pte & L2_TYPE_MASK) == L2_TYPE_S) {
- offset = va & L2_S_OFFSET;
- a = pte & L2_S_FRAME;
+ if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_L) {
+ offset = va & ARM_L2_L_OFFSET;
+ a = pte & ARM_L2_L_FRAME;
+ } else if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_S) {
+ offset = va & ARM_L2_S_OFFSET;
+ a = pte & ARM_L2_S_FRAME;
} else
goto invalid;
- ofs = hpt_find(kd, a);
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: physical "
- "address 0x%lx not in minidump", a);
+ _kvm_err(kd, kd->program, "_arm_minidump_kvatop: "
+ "physical address 0x%jx not in minidump",
+ (uintmax_t)a);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (ARM_PAGE_SIZE - offset);
} else
- _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx "
- "not minidumped", va);
+ _kvm_err(kd, kd->program, "_arm_minidump_kvatop: virtual "
+ "address 0x%jx not minidumped", (uintmax_t)va);
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
+
+struct kvm_arch kvm_arm_minidump = {
+ .ka_probe = _arm_minidump_probe,
+ .ka_initvtop = _arm_minidump_initvtop,
+ .ka_freevtop = _arm_minidump_freevtop,
+ .ka_kvatop = _arm_minidump_kvatop,
+ .ka_native = _arm_native,
+};
+
+KVM_ARCH(kvm_arm_minidump);
diff --git a/lib/libkvm/kvm_minidump_i386.c b/lib/libkvm/kvm_minidump_i386.c
index 5850a55..040d42d 100644
--- a/lib/libkvm/kvm_minidump_i386.c
+++ b/lib/libkvm/kvm_minidump_i386.c
@@ -27,118 +27,57 @@
__FBSDID("$FreeBSD$");
/*
- * AMD64 machine dependent routines for kvm and minidumps.
+ * i386 machine dependent routines for kvm and minidumps.
*/
#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/fnv_hash.h>
+#include <sys/endian.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <nlist.h>
#include <kvm.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-
-#include <machine/elf.h>
-#include <machine/cpufunc.h>
-#include <machine/minidump.h>
+#include "../../sys/i386/include/minidump.h"
#include <limits.h>
#include "kvm_private.h"
+#include "kvm_i386.h"
-#define PG_FRAME_PAE (~((uint64_t)PAGE_MASK))
-
-struct hpte {
- struct hpte *next;
- uint64_t pa;
- int64_t off;
-};
-
-#define HPT_SIZE 1024
+#define i386_round_page(x) roundup2((kvaddr_t)(x), I386_PAGE_SIZE)
-/* minidump must be the first item! */
struct vmstate {
- int minidump; /* 1 = minidump mode */
struct minidumphdr hdr;
- void *hpt_head[HPT_SIZE];
- uint32_t *bitmap;
+ struct hpt hpt;
void *ptemap;
};
-static void
-hpt_insert(kvm_t *kd, uint64_t pa, int64_t off)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- hpte = malloc(sizeof(*hpte));
- hpte->pa = pa;
- hpte->off = off;
- hpte->next = kd->vmst->hpt_head[fnv];
- kd->vmst->hpt_head[fnv] = hpte;
-}
-
-static int64_t
-hpt_find(kvm_t *kd, uint64_t pa)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) {
- if (pa == hpte->pa)
- return (hpte->off);
- }
- return (-1);
-}
-
static int
-inithash(kvm_t *kd, uint32_t *base, int len, off_t off)
+_i386_minidump_probe(kvm_t *kd)
{
- uint64_t idx;
- uint32_t bit, bits;
- uint64_t pa;
- for (idx = 0; idx < len / sizeof(*base); idx++) {
- bits = base[idx];
- while (bits) {
- bit = bsfl(bits);
- bits &= ~(1ul << bit);
- pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE;
- hpt_insert(kd, pa, off);
- off += PAGE_SIZE;
- }
- }
- return (off);
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS32, EM_386) &&
+ _kvm_is_minidump(kd));
}
-void
-_kvm_minidump_freevtop(kvm_t *kd)
+static void
+_i386_minidump_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (vm->bitmap)
- free(vm->bitmap);
+ _kvm_hpt_free(&vm->hpt);
if (vm->ptemap)
free(vm->ptemap);
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_minidump_initvtop(kvm_t *kd)
+static int
+_i386_minidump_initvtop(kvm_t *kd)
{
struct vmstate *vmst;
+ uint32_t *bitmap;
off_t off;
vmst = _kvm_malloc(kd, sizeof(*vmst));
@@ -147,7 +86,6 @@ _kvm_minidump_initvtop(kvm_t *kd)
return (-1);
}
kd->vmst = vmst;
- vmst->minidump = 1;
if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) !=
sizeof(vmst->hdr)) {
_kvm_err(kd, kd->program, "cannot read dump header");
@@ -157,135 +95,166 @@ _kvm_minidump_initvtop(kvm_t *kd)
_kvm_err(kd, kd->program, "not a minidump for this platform");
return (-1);
}
+ vmst->hdr.version = le32toh(vmst->hdr.version);
if (vmst->hdr.version != MINIDUMP_VERSION) {
_kvm_err(kd, kd->program, "wrong minidump version. expected %d got %d",
MINIDUMP_VERSION, vmst->hdr.version);
return (-1);
}
+ vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize);
+ vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize);
+ vmst->hdr.ptesize = le32toh(vmst->hdr.ptesize);
+ vmst->hdr.kernbase = le32toh(vmst->hdr.kernbase);
+ vmst->hdr.paemode = le32toh(vmst->hdr.paemode);
/* Skip header and msgbuf */
- off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize);
+ off = I386_PAGE_SIZE + i386_round_page(vmst->hdr.msgbufsize);
- vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
- if (vmst->bitmap == NULL) {
+ bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
+ if (bitmap == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for bitmap", vmst->hdr.bitmapsize);
return (-1);
}
- if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) !=
+ if (pread(kd->pmfd, bitmap, vmst->hdr.bitmapsize, off) !=
(ssize_t)vmst->hdr.bitmapsize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize);
+ free(bitmap);
return (-1);
}
- off += round_page(vmst->hdr.bitmapsize);
+ off += i386_round_page(vmst->hdr.bitmapsize);
vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize);
if (vmst->ptemap == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for ptemap", vmst->hdr.ptesize);
+ free(bitmap);
return (-1);
}
if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) !=
(ssize_t)vmst->hdr.ptesize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize);
+ free(bitmap);
return (-1);
}
off += vmst->hdr.ptesize;
/* build physical address hash table for sparse pages */
- inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off);
+ _kvm_hpt_init(kd, &vmst->hpt, bitmap, vmst->hdr.bitmapsize, off,
+ I386_PAGE_SIZE, sizeof(*bitmap));
+ free(bitmap);
return (0);
}
static int
-_kvm_minidump_vatop_pae(kvm_t *kd, u_long va, off_t *pa)
+_i386_minidump_vatop_pae(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- uint64_t offset;
- uint64_t pte;
- u_long pteindex;
- uint64_t a;
+ i386_physaddr_pae_t offset;
+ i386_pte_pae_t pte;
+ kvaddr_t pteindex;
+ i386_physaddr_pae_t a;
off_t ofs;
- uint64_t *ptemap;
+ i386_pte_pae_t *ptemap;
vm = kd->vmst;
ptemap = vm->ptemap;
- offset = va & (PAGE_SIZE - 1);
+ offset = va & I386_PAGE_MASK;
if (va >= vm->hdr.kernbase) {
- pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT;
- pte = ptemap[pteindex];
- if ((pte & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
+ pteindex = (va - vm->hdr.kernbase) >> I386_PAGE_SHIFT;
+ pte = le64toh(ptemap[pteindex]);
+ if ((pte & I386_PG_V) == 0) {
+ _kvm_err(kd, kd->program,
+ "_i386_minidump_vatop_pae: pte not valid");
goto invalid;
}
- a = pte & PG_FRAME_PAE;
- ofs = hpt_find(kd, a);
+ a = pte & I386_PG_FRAME_PAE;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%llx not in minidump", a);
+ _kvm_err(kd, kd->program,
+ "_i386_minidump_vatop_pae: physical address 0x%jx not in minidump",
+ (uintmax_t)a);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (I386_PAGE_SIZE - offset);
} else {
- _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va);
+ _kvm_err(kd, kd->program,
+ "_i386_minidump_vatop_pae: virtual address 0x%jx not minidumped",
+ (uintmax_t)va);
goto invalid;
}
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
static int
-_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa)
+_i386_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- u_long offset;
- pt_entry_t pte;
- u_long pteindex;
- u_long a;
+ i386_physaddr_t offset;
+ i386_pte_t pte;
+ kvaddr_t pteindex;
+ i386_physaddr_t a;
off_t ofs;
- uint32_t *ptemap;
+ i386_pte_t *ptemap;
vm = kd->vmst;
ptemap = vm->ptemap;
- offset = va & (PAGE_SIZE - 1);
+ offset = va & I386_PAGE_MASK;
if (va >= vm->hdr.kernbase) {
- pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT;
- pte = ptemap[pteindex];
- if ((pte & PG_V) == 0) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
+ pteindex = (va - vm->hdr.kernbase) >> I386_PAGE_SHIFT;
+ pte = le32toh(ptemap[pteindex]);
+ if ((pte & I386_PG_V) == 0) {
+ _kvm_err(kd, kd->program,
+ "_i386_minidump_vatop: pte not valid");
goto invalid;
}
- a = pte & PG_FRAME;
- ofs = hpt_find(kd, a);
+ a = pte & I386_PG_FRAME;
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%lx not in minidump", a);
+ _kvm_err(kd, kd->program,
+ "_i386_minidump_vatop: physical address 0x%jx not in minidump",
+ (uintmax_t)a);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (I386_PAGE_SIZE - offset);
} else {
- _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va);
+ _kvm_err(kd, kd->program,
+ "_i386_minidump_vatop: virtual address 0x%jx not minidumped",
+ (uintmax_t)va);
goto invalid;
}
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
-int
-_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_i386_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
if (ISALIVE(kd)) {
- _kvm_err(kd, 0, "kvm_kvatop called in live kernel!");
+ _kvm_err(kd, 0, "_i386_minidump_kvatop called in live kernel!");
return (0);
}
if (kd->vmst->hdr.paemode)
- return (_kvm_minidump_vatop_pae(kd, va, pa));
- else
- return (_kvm_minidump_vatop(kd, va, pa));
+ return (_i386_minidump_vatop_pae(kd, va, pa));
+ else
+ return (_i386_minidump_vatop(kd, va, pa));
}
+
+struct kvm_arch kvm_i386_minidump = {
+ .ka_probe = _i386_minidump_probe,
+ .ka_initvtop = _i386_minidump_initvtop,
+ .ka_freevtop = _i386_minidump_freevtop,
+ .ka_kvatop = _i386_minidump_kvatop,
+ .ka_native = _i386_native,
+};
+
+KVM_ARCH(kvm_i386_minidump);
diff --git a/lib/libkvm/kvm_minidump_mips.c b/lib/libkvm/kvm_minidump_mips.c
index 7161115..997b70d 100644
--- a/lib/libkvm/kvm_minidump_mips.c
+++ b/lib/libkvm/kvm_minidump_mips.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2010 Oleksandr Tymoshenko
+ * Copyright (c) 2010 Oleksandr Tymoshenko
* Copyright (c) 2008 Semihalf, Grzegorz Bernacki
* Copyright (c) 2006 Peter Wemm
*
@@ -35,112 +35,57 @@ __FBSDID("$FreeBSD$");
*/
#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/fnv_hash.h>
+#include <kvm.h>
+#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <nlist.h>
-#include <kvm.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <machine/elf.h>
-#include <machine/cpufunc.h>
-#include <machine/minidump.h>
-
-#include <limits.h>
+#include "../../sys/mips/include/cpuregs.h"
+#include "../../sys/mips/include/minidump.h"
#include "kvm_private.h"
+#include "kvm_mips.h"
-struct hpte {
- struct hpte *next;
- uint64_t pa;
- int64_t off;
-};
-
-#define HPT_SIZE 1024
+#define mips_round_page(x) roundup2((kvaddr_t)(x), MIPS_PAGE_SIZE)
-/* minidump must be the first field */
struct vmstate {
- int minidump; /* 1 = minidump mode */
struct minidumphdr hdr;
- void *hpt_head[HPT_SIZE];
- uint32_t *bitmap;
+ struct hpt hpt;
void *ptemap;
+ int pte_size;
};
-static void
-hpt_insert(kvm_t *kd, uint64_t pa, int64_t off)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- hpte = malloc(sizeof(*hpte));
- hpte->pa = pa;
- hpte->off = off;
- hpte->next = kd->vmst->hpt_head[fnv];
- kd->vmst->hpt_head[fnv] = hpte;
-}
-
-static int64_t
-hpt_find(kvm_t *kd, uint64_t pa)
-{
- struct hpte *hpte;
- uint32_t fnv = FNV1_32_INIT;
-
- fnv = fnv_32_buf(&pa, sizeof(pa), fnv);
- fnv &= (HPT_SIZE - 1);
- for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next)
- if (pa == hpte->pa)
- return (hpte->off);
-
- return (-1);
-}
-
static int
-inithash(kvm_t *kd, uint32_t *base, int len, off_t off)
+_mips_minidump_probe(kvm_t *kd)
{
- uint64_t idx, pa;
- uint32_t bit, bits;
-
- for (idx = 0; idx < len / sizeof(*base); idx++) {
- bits = base[idx];
- while (bits) {
- bit = ffs(bits) - 1;
- bits &= ~(1ul << bit);
- pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE;
- hpt_insert(kd, pa, off);
- off += PAGE_SIZE;
- }
- }
- return (off);
+ if (kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS32 &&
+ kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS64)
+ return (0);
+ if (kd->nlehdr.e_machine != EM_MIPS)
+ return (0);
+ return (_kvm_is_minidump(kd));
}
-void
-_kvm_minidump_freevtop(kvm_t *kd)
+static void
+_mips_minidump_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (vm->bitmap)
- free(vm->bitmap);
+ _kvm_hpt_free(&vm->hpt);
if (vm->ptemap)
free(vm->ptemap);
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_minidump_initvtop(kvm_t *kd)
+static int
+_mips_minidump_initvtop(kvm_t *kd)
{
struct vmstate *vmst;
+ uint32_t *bitmap;
off_t off;
vmst = _kvm_malloc(kd, sizeof(*vmst));
@@ -150,9 +95,13 @@ _kvm_minidump_initvtop(kvm_t *kd)
}
kd->vmst = vmst;
- vmst->minidump = 1;
- off = lseek(kd->pmfd, 0, SEEK_CUR);
+ if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64 ||
+ kd->nlehdr.e_flags & EF_MIPS_ABI2)
+ vmst->pte_size = 64;
+ else
+ vmst->pte_size = 32;
+
if (pread(kd->pmfd, &vmst->hdr,
sizeof(vmst->hdr), 0) != sizeof(vmst->hdr)) {
_kvm_err(kd, kd->program, "cannot read dump header");
@@ -164,34 +113,43 @@ _kvm_minidump_initvtop(kvm_t *kd)
_kvm_err(kd, kd->program, "not a minidump for this platform");
return (-1);
}
+ vmst->hdr.version = _kvm32toh(kd, vmst->hdr.version);
if (vmst->hdr.version != MINIDUMP_VERSION) {
_kvm_err(kd, kd->program, "wrong minidump version. "
"Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version);
return (-1);
}
+ vmst->hdr.msgbufsize = _kvm32toh(kd, vmst->hdr.msgbufsize);
+ vmst->hdr.bitmapsize = _kvm32toh(kd, vmst->hdr.bitmapsize);
+ vmst->hdr.ptesize = _kvm32toh(kd, vmst->hdr.ptesize);
+ vmst->hdr.kernbase = _kvm64toh(kd, vmst->hdr.kernbase);
+ vmst->hdr.dmapbase = _kvm64toh(kd, vmst->hdr.dmapbase);
+ vmst->hdr.dmapend = _kvm64toh(kd, vmst->hdr.dmapend);
/* Skip header and msgbuf */
- off = PAGE_SIZE + round_page(vmst->hdr.msgbufsize);
+ off = MIPS_PAGE_SIZE + mips_round_page(vmst->hdr.msgbufsize);
- vmst->bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
- if (vmst->bitmap == NULL) {
+ bitmap = _kvm_malloc(kd, vmst->hdr.bitmapsize);
+ if (bitmap == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for "
"bitmap", vmst->hdr.bitmapsize);
return (-1);
}
- if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) !=
+ if (pread(kd->pmfd, bitmap, vmst->hdr.bitmapsize, off) !=
(ssize_t)vmst->hdr.bitmapsize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap",
vmst->hdr.bitmapsize);
+ free(bitmap);
return (-1);
}
- off += round_page(vmst->hdr.bitmapsize);
+ off += mips_round_page(vmst->hdr.bitmapsize);
vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize);
if (vmst->ptemap == NULL) {
_kvm_err(kd, kd->program, "cannot allocate %d bytes for "
"ptemap", vmst->hdr.ptesize);
+ free(bitmap);
return (-1);
}
@@ -199,75 +157,139 @@ _kvm_minidump_initvtop(kvm_t *kd)
(ssize_t)vmst->hdr.ptesize) {
_kvm_err(kd, kd->program, "cannot read %d bytes for ptemap",
vmst->hdr.ptesize);
+ free(bitmap);
return (-1);
}
off += vmst->hdr.ptesize;
/* Build physical address hash table for sparse pages */
- inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off);
+ _kvm_hpt_init(kd, &vmst->hpt, bitmap, vmst->hdr.bitmapsize, off,
+ MIPS_PAGE_SIZE, sizeof(*bitmap));
+ free(bitmap);
return (0);
}
-int
-_kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
struct vmstate *vm;
- pt_entry_t pte;
- u_long offset, pteindex, a;
+ uint64_t pte;
+ mips_physaddr_t offset, a;
+ kvaddr_t pteindex;
off_t ofs;
- pt_entry_t *ptemap;
+ uint32_t *ptemap32;
+ uint64_t *ptemap64;
if (ISALIVE(kd)) {
- _kvm_err(kd, 0, "kvm_kvatop called in live kernel!");
+ _kvm_err(kd, 0, "_mips_minidump_kvatop called in live kernel!");
return (0);
}
- offset = va & PAGE_MASK;
+ offset = va & MIPS_PAGE_MASK;
/* Operate with page-aligned address */
- va &= ~PAGE_MASK;
+ va &= ~MIPS_PAGE_MASK;
vm = kd->vmst;
- ptemap = vm->ptemap;
+ ptemap32 = vm->ptemap;
+ ptemap64 = vm->ptemap;
-#if defined(__mips_n64)
- if (va >= MIPS_XKPHYS_START && va < MIPS_XKPHYS_END)
- a = (MIPS_XKPHYS_TO_PHYS(va));
- else
-#endif
- if (va >= (u_long)MIPS_KSEG0_START && va < (u_long)MIPS_KSEG0_END)
- a = (MIPS_KSEG0_TO_PHYS(va));
- else if (va >= (u_long)MIPS_KSEG1_START && va < (u_long)MIPS_KSEG1_END)
- a = (MIPS_KSEG1_TO_PHYS(va));
- else if (va >= vm->hdr.kernbase) {
- pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT;
- pte = ptemap[pteindex];
+ if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64) {
+ if (va >= MIPS_XKPHYS_START && va < MIPS_XKPHYS_END) {
+ a = va & MIPS_XKPHYS_PHYS_MASK;
+ goto found;
+ }
+ if (va >= MIPS64_KSEG0_START && va < MIPS64_KSEG0_END) {
+ a = va & MIPS_KSEG0_PHYS_MASK;
+ goto found;
+ }
+ if (va >= MIPS64_KSEG1_START && va < MIPS64_KSEG1_END) {
+ a = va & MIPS_KSEG0_PHYS_MASK;
+ goto found;
+ }
+ } else {
+ if (va >= MIPS32_KSEG0_START && va < MIPS32_KSEG0_END) {
+ a = va & MIPS_KSEG0_PHYS_MASK;
+ goto found;
+ }
+ if (va >= MIPS32_KSEG1_START && va < MIPS32_KSEG1_END) {
+ a = va & MIPS_KSEG0_PHYS_MASK;
+ goto found;
+ }
+ }
+ if (va >= vm->hdr.kernbase) {
+ pteindex = (va - vm->hdr.kernbase) >> MIPS_PAGE_SHIFT;
+ if (vm->pte_size == 64) {
+ pte = _kvm64toh(kd, ptemap64[pteindex]);
+ a = MIPS64_PTE_TO_PA(pte);
+ } else {
+ pte = _kvm32toh(kd, ptemap32[pteindex]);
+ a = MIPS32_PTE_TO_PA(pte);
+ }
if (!pte) {
- _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid");
+ _kvm_err(kd, kd->program, "_mips_minidump_kvatop: pte "
+ "not valid");
goto invalid;
}
-
- a = TLBLO_PTE_TO_PA(pte);
-
} else {
- _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx "
- "not minidumped", va);
+ _kvm_err(kd, kd->program, "_mips_minidump_kvatop: virtual "
+ "address 0x%jx not minidumped", (uintmax_t)va);
return (0);
}
- ofs = hpt_find(kd, a);
+found:
+ ofs = _kvm_hpt_find(&vm->hpt, a);
if (ofs == -1) {
- _kvm_err(kd, kd->program, "_kvm_vatop: physical "
- "address 0x%lx not in minidump", a);
+ _kvm_err(kd, kd->program, "_mips_minidump_kvatop: physical "
+ "address 0x%jx not in minidump", (uintmax_t)a);
goto invalid;
}
*pa = ofs + offset;
- return (PAGE_SIZE - offset);
+ return (MIPS_PAGE_SIZE - offset);
invalid:
- _kvm_err(kd, 0, "invalid address (0x%lx)", va);
+ _kvm_err(kd, 0, "invalid address (0x%jx)", (uintmax_t)va);
return (0);
}
+
+static int
+_mips_native(kvm_t *kd)
+{
+
+#ifdef __mips__
+#ifdef __mips_n64
+ if (kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS64)
+ return (0);
+#else
+ if (kd->nlehdr.e_ident[EI_CLASS] != ELFCLASS32)
+ return (0);
+#ifdef __mips_n32
+ if (!(kd->nlehdr.e_flags & EF_MIPS_ABI2))
+ return (0);
+#else
+ if (kd->nlehdr.e_flags & EF_MIPS_ABI2)
+ return (0);
+#endif
+#endif
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ return (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB);
+#else
+ return (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2MSB);
+#endif
+#else
+ return (0);
+#endif
+}
+
+struct kvm_arch kvm_mips_minidump = {
+ .ka_probe = _mips_minidump_probe,
+ .ka_initvtop = _mips_minidump_initvtop,
+ .ka_freevtop = _mips_minidump_freevtop,
+ .ka_kvatop = _mips_minidump_kvatop,
+ .ka_native = _mips_native,
+};
+
+KVM_ARCH(kvm_mips_minidump);
diff --git a/lib/libkvm/kvm_mips.c b/lib/libkvm/kvm_mips.c
deleted file mode 100644
index 56e7fbf..0000000
--- a/lib/libkvm/kvm_mips.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * Copyright (C) 2006 Bruce M. Simpson.
- * 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.
- */
-
-/*
- * MIPS machine dependent routines for kvm.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/elf32.h>
-#include <sys/mman.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
-
-#include <machine/pmap.h>
-
-#include <db.h>
-#include <limits.h>
-#include <kvm.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "kvm_private.h"
-
-/* minidump must be the first item! */
-struct vmstate {
- int minidump; /* 1 = minidump mode */
- void *mmapbase;
- size_t mmapsize;
-};
-
-void
-_kvm_freevtop(kvm_t *kd)
-{
- if (kd->vmst != 0) {
- if (kd->vmst->minidump)
- return (_kvm_minidump_freevtop(kd));
- if (kd->vmst->mmapbase != NULL)
- munmap(kd->vmst->mmapbase, kd->vmst->mmapsize);
- free(kd->vmst);
- kd->vmst = NULL;
- }
-}
-
-int
-_kvm_initvtop(kvm_t *kd)
-{
- char minihdr[8];
-
- if (!kd->rawdump) {
- if (pread(kd->pmfd, &minihdr, 8, 0) == 8) {
- if (memcmp(&minihdr, "minidump", 8) == 0)
- return (_kvm_minidump_initvtop(kd));
- } else {
- _kvm_err(kd, kd->program, "cannot read header");
- return (-1);
- }
- }
-
- _kvm_err(kd, 0, "_kvm_initvtop: Unsupported image type");
- return (-1);
-}
-
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
-{
-
- if (kd->vmst->minidump)
- return _kvm_minidump_kvatop(kd, va, pa);
-
-
- _kvm_err(kd, 0, "_kvm_kvatop: Unsupported image type");
- return (0);
-}
-
-/*
- * Machine-dependent initialization for ALL open kvm descriptors,
- * not just those for a kernel crash dump. Some architectures
- * have to deal with these NOT being constants! (i.e. m68k)
- */
-#ifdef FBSD_NOT_YET
-int
-_kvm_mdopen(kvm_t *kd __unused)
-{
-
- return (0);
-}
-#endif
diff --git a/lib/libkvm/kvm_mips.h b/lib/libkvm/kvm_mips.h
new file mode 100644
index 0000000..9fba6fb
--- /dev/null
+++ b/lib/libkvm/kvm_mips.h
@@ -0,0 +1,93 @@
+/*-
+ * Copyright (c) 2015 John H. Baldwin <jhb@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __KVM_MIPS_H__
+#define __KVM_MIPS_H__
+
+#ifdef __mips__
+#include <machine/pte.h>
+#endif
+
+typedef uint64_t mips_physaddr_t;
+
+#define MIPS_PAGE_SHIFT 12
+#define MIPS_PAGE_SIZE (1 << MIPS_PAGE_SHIFT)
+#define MIPS_PAGE_MASK (MIPS_PAGE_SIZE - 1)
+
+#define MIPS32_KSEG0_START 0x80000000
+#define MIPS32_KSEG0_END 0x9fffffff
+#define MIPS32_KSEG1_START 0xa0000000
+#define MIPS32_KSEG1_END 0xbfffffff
+#define MIPS64_KSEG0_START 0xffffffff80000000
+#define MIPS64_KSEG0_END 0xffffffff9fffffff
+#define MIPS64_KSEG1_START 0xffffffffa0000000
+#define MIPS64_KSEG1_END 0xffffffffbfffffff
+
+#define MIPS32_PFN_MASK (0x1FFFFFC0)
+#define MIPS64_PFN_MASK 0x3FFFFFFC0
+#define MIPS_PFN_SHIFT (6)
+
+#define MIPS_PFN_TO_PA(pfn) (((pfn) >> MIPS_PFN_SHIFT) << MIPS_PAGE_SHIFT)
+#define MIPS32_PTE_TO_PFN(pte) ((pte) & MIPS32_PFN_MASK)
+#define MIPS32_PTE_TO_PA(pte) (MIPS_PFN_TO_PA(MIPS32_PTE_TO_PFN((pte))))
+#define MIPS64_PTE_TO_PFN(pte) ((pte) & MIPS64_PFN_MASK)
+#define MIPS64_PTE_TO_PA(pte) (MIPS_PFN_TO_PA(MIPS64_PTE_TO_PFN((pte))))
+
+#ifdef __mips__
+_Static_assert(PAGE_SHIFT == MIPS_PAGE_SHIFT, "PAGE_SHIFT mismatch");
+_Static_assert(PAGE_SIZE == MIPS_PAGE_SIZE, "PAGE_SIZE mismatch");
+_Static_assert(PAGE_MASK == MIPS_PAGE_MASK, "PAGE_MASK mismatch");
+#ifdef __mips_n64
+_Static_assert((uint64_t)MIPS_KSEG0_START == MIPS64_KSEG0_START,
+ "MIPS_KSEG0_START mismatch");
+_Static_assert((uint64_t)MIPS_KSEG0_END == MIPS64_KSEG0_END,
+ "MIPS_KSEG0_END mismatch");
+_Static_assert((uint64_t)MIPS_KSEG1_START == MIPS64_KSEG1_START,
+ "MIPS_KSEG1_START mismatch");
+_Static_assert((uint64_t)MIPS_KSEG1_END == MIPS64_KSEG1_END,
+ "MIPS_KSEG1_END mismatch");
+#else
+_Static_assert((uint32_t)MIPS_KSEG0_START == MIPS32_KSEG0_START,
+ "MIPS_KSEG0_START mismatch");
+_Static_assert((uint32_t)MIPS_KSEG0_END == MIPS32_KSEG0_END,
+ "MIPS_KSEG0_END mismatch");
+_Static_assert((uint32_t)MIPS_KSEG1_START == MIPS32_KSEG1_START,
+ "MIPS_KSEG1_START mismatch");
+_Static_assert((uint32_t)MIPS_KSEG1_END == MIPS32_KSEG1_END,
+ "MIPS_KSEG1_END mismatch");
+#endif
+#if defined(__mips_n64) || defined(__mips_n32)
+_Static_assert(TLBLO_PFN_MASK == MIPS64_PFN_MASK, "TLBLO_PFN_MASK mismatch");
+#else
+_Static_assert(TLBLO_PFN_MASK == MIPS32_PFN_MASK, "TLBLO_PFN_MASK mismatch");
+#endif
+_Static_assert(TLBLO_PFN_SHIFT == MIPS_PFN_SHIFT, "TLBLO_PFN_SHIFT mismatch");
+_Static_assert(TLB_PAGE_SHIFT == MIPS_PAGE_SHIFT, "TLB_PAGE_SHIFT mismatch");
+#endif
+
+#endif /* !__KVM_MIPS_H__ */
diff --git a/lib/libkvm/kvm_native.3 b/lib/libkvm/kvm_native.3
new file mode 100644
index 0000000..24d54e6
--- /dev/null
+++ b/lib/libkvm/kvm_native.3
@@ -0,0 +1,62 @@
+.\"
+.\" Copyright (c) 2015 John Baldwin <jhb@FreeBSD.org>
+.\" 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$
+.\"
+.Dd November 27, 2015
+.Dt kvm_native 3
+.Os
+.Sh NAME
+.Nm kvm_native
+.Nd is a kvm descriptor opened on a native kernel image
+.Sh LIBRARY
+.Lb libkvm
+.Sh SYNOPSIS
+.In kvm.h
+.Ft int
+.Fn kvm_native "kvm_t *kd"
+.Sh DESCRIPTION
+The
+.Nm kvm
+library provides an interface for accessing kernel virtual memory images
+for both native kernel images
+.Pq where the ABI of the kernel executable matches the host system
+and non-native kernel images.
+The
+.Fn kvm_native
+function returns a non-zero value if the kvm descriptor
+.Fa kd
+is attached to a native kernel image;
+otherwise it returns zero.
+.Sh RETURN VALUES
+The
+.Fn kvm_native
+function returns a non-zero value if the kvm descriptor
+.Fa kd
+is attached to a native kernel image;
+otherwise it returns zero.
+.Sh SEE ALSO
+.Xr kvm 3 ,
+.Xr kvm_open2 3
diff --git a/lib/libkvm/kvm_nlist.3 b/lib/libkvm/kvm_nlist.3
index a151a3b..f72d5b4 100644
--- a/lib/libkvm/kvm_nlist.3
+++ b/lib/libkvm/kvm_nlist.3
@@ -32,11 +32,12 @@
.\" @(#)kvm_nlist.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd November 27, 2015
.Dt KVM_NLIST 3
.Os
.Sh NAME
-.Nm kvm_nlist
+.Nm kvm_nlist ,
+.Nm kvm_nlist2
.Nd retrieve symbol table names from a kernel image
.Sh LIBRARY
.Lb libkvm
@@ -45,31 +46,62 @@
.In nlist.h
.Ft int
.Fn kvm_nlist "kvm_t *kd" "struct nlist *nl"
+.Ft int
+.Fn kvm_nlist2 "kvm_t *kd" "struct kvm_nlist *nl"
.Sh DESCRIPTION
The
.Fn kvm_nlist
function retrieves the symbol table entries indicated by the name list argument
.Fa \&nl .
This argument points to an array of nlist structures, terminated by
-an entry whose n_name field is
+an entry whose
+.Fa n_name
+field is
.Dv NULL
(see
.Xr nlist 3 ) .
-Each symbol is looked up using the n_name field, and if found, the
-corresponding n_type and n_value fields are filled in.
+Each symbol is looked up using the
+.Fa n_name
+field, and if found, the
+corresponding
+.Fa n_type
+and
+.Fa n_value
+fields are filled in.
These fields are set
to 0 if the symbol is not found.
.Pp
The
.Xr kldsym 2
-system call is used to locate the symbol.
+system call is used to locate symbols in live kernels.
This is a less than perfect
emulation of the nlist values but has the advantage of being aware of kernel
modules and is reasonably fast.
+.Pp
+The
+.Fn kvm_nlist2
+function retrieves the symbol table entries indicated by the name list argument
+.Fa nl .
+This argument points to an array of
+.Vt "struct kvm_nlist"
+structures,
+terminated by an entry whose
+.Fa n_name
+field is
+.Dv NULL
+These structures are similar to the nlist structures used by
+.Fn kvm_nlist
+except that the
+.Fa n_value
+field uses a different type
+.Pq Vt kvaddr_t
+to avoid truncation when examining non-native kernel images.
.Sh RETURN VALUES
The
.Fn kvm_nlist
-function returns the number of invalid entries found.
+and
+.Fn kvm_nlist2
+functions return the number of invalid entries found.
If the kernel symbol table was unreadable, -1 is returned.
.Sh SEE ALSO
.Xr kldsym 2 ,
@@ -79,6 +111,7 @@ If the kernel symbol table was unreadable, -1 is returned.
.Xr kvm_getenvv 3 ,
.Xr kvm_geterr 3 ,
.Xr kvm_getprocs 3 ,
+.Xr kvm_native 3 ,
.Xr kvm_open 3 ,
.Xr kvm_openfiles 3 ,
.Xr kvm_read 3 ,
diff --git a/lib/libkvm/kvm_open.3 b/lib/libkvm/kvm_open.3
index 1b62482..6942239 100644
--- a/lib/libkvm/kvm_open.3
+++ b/lib/libkvm/kvm_open.3
@@ -32,11 +32,12 @@
.\" @(#)kvm_open.3 8.3 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd January 29, 2004
+.Dd November 27, 2015
.Dt KVM_OPEN 3
.Os
.Sh NAME
.Nm kvm_open ,
+.Nm kvm_open2 ,
.Nm kvm_openfiles ,
.Nm kvm_close
.Nd initialize kernel virtual memory access
@@ -48,12 +49,21 @@
.Ft kvm_t *
.Fn kvm_open "const char *execfile" "const char *corefile" "const char *swapfile" "int flags" "const char *errstr"
.Ft kvm_t *
+.Fo kvm_open2
+.Fa "const char *execfile"
+.Fa "const char *corefile"
+.Fa "int flags"
+.Fa "char *errbuf"
+.Fa "int (*resolver)(const char *name, kvaddr_t *addr)"
+.Fc
+.Ft kvm_t *
.Fn kvm_openfiles "const char *execfile" "const char *corefile" "const char *swapfile" "int flags" "char *errbuf"
.Ft int
.Fn kvm_close "kvm_t *kd"
.Sh DESCRIPTION
The functions
-.Fn kvm_open
+.Fn kvm_open ,
+.Fn kvm_open2 ,
and
.Fn kvm_openfiles
return a descriptor used to access kernel virtual memory
@@ -111,10 +121,13 @@ and
.Dv O_RDWR
are permitted.
.Pp
-There are two open routines which differ only with respect to
-the error mechanism.
+The
+.Nm kvm
+library provides two different error reporting mechanisms.
One provides backward compatibility with the SunOS kvm library, while the
other provides an improved error reporting framework.
+The mechanism used by a descriptor is determined by the function used to
+open the descriptor.
.Pp
The
.Fn kvm_open
@@ -140,8 +153,10 @@ The string is assumed to persist at least until the corresponding
call.
.Pp
The
+.Fn kvm_open2
+and
.Fn kvm_openfiles
-function provides
+functions provide
.Bx
style error reporting.
Here, error messages are not printed out by the library.
@@ -160,25 +175,56 @@ on failure,
.Fn kvm_geterr
cannot be used to get the error message if open fails.
Thus,
+.Fn kvm_open2
+and
.Fn kvm_openfiles
will place any error message in the
.Fa errbuf
argument.
This buffer should be _POSIX2_LINE_MAX characters large (from
<limits.h>).
+.Pp
+The
+.Fa resolver
+argument points to a function used by the
+.Nm kvm
+library to map symbol names to kernel virtual addresses.
+When the
+.Fa resolver
+function is called,
+.Fa name
+specifies the requested symbol name.
+If the function is able to resolve the name to an address,
+the address should be set in
+.Fa *addr
+and the function should return zero.
+If the function is not able to resolve the name to an address,
+it should return a non-zero value.
+When opening a native kernel image,
+.Fa resolver
+may be set to
+.Dv NULL
+to use an internal function to resolve symbol names.
+Non-native kernel images
+.Pq such as when cross-debugging a crash dump
+require a valid
+.Fa resolver .
.Sh RETURN VALUES
The
-.Fn kvm_open
+.Fn kvm_open ,
+.Fn kvm_open2 ,
and
.Fn kvm_openfiles
-functions both return a descriptor to be used
+functions return a descriptor to be used
in all subsequent kvm library calls.
The library is fully re-entrant.
On failure,
.Dv NULL
is returned, in which case
+.Fn kvm_open2
+and
.Fn kvm_openfiles
-writes the error message into
+write the error message into
.Fa errbuf .
.Pp
The
@@ -191,13 +237,14 @@ function returns 0 on success and -1 on failure.
.Xr kvm_getenvv 3 ,
.Xr kvm_geterr 3 ,
.Xr kvm_getprocs 3 ,
+.Xr kvm_native 3 ,
.Xr kvm_nlist 3 ,
.Xr kvm_read 3 ,
.Xr kvm_write 3 ,
.Xr kmem 4 ,
.Xr mem 4
.Sh BUGS
-There should not be two open calls.
+There should not be three open calls.
The ill-defined error semantics
of the Sun library and the desire to have a backward-compatible library
for
diff --git a/lib/libkvm/kvm_pcpu.c b/lib/libkvm/kvm_pcpu.c
index 662566a..eaea7e4 100644
--- a/lib/libkvm/kvm_pcpu.c
+++ b/lib/libkvm/kvm_pcpu.c
@@ -60,7 +60,7 @@ static struct nlist kvm_pcpu_nl[] = {
/*
* Kernel per-CPU data state. We cache this stuff on the first
- * access.
+ * access.
*
* XXXRW: Possibly, this (and kvmpcpu_nl) should be per-kvm_t, in case the
* consumer has multiple handles in flight to differently configured
@@ -216,7 +216,7 @@ _kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu, int report_error)
static int
_kvm_dpcpu_init(kvm_t *kd)
{
- struct nlist nl[] = {
+ struct kvm_nlist nl[] = {
#define NLIST_START_SET_PCPU 0
{ .n_name = "___start_" DPCPU_SETNAME },
#define NLIST_STOP_SET_PCPU 1
@@ -232,6 +232,12 @@ _kvm_dpcpu_init(kvm_t *kd)
u_int dpcpu_maxcpus;
/*
+ * XXX: This only works for native kernels for now.
+ */
+ if (!kvm_native(kd))
+ return (-1);
+
+ /*
* Locate and cache locations of important symbols using the internal
* version of _kvm_nlist, turning off initialization to avoid
* recursion in case of unresolveable symbols.
@@ -279,8 +285,8 @@ _kvm_dpcpu_initialized(kvm_t *kd, int intialize)
* Check whether the value is within the dpcpu symbol range and only if so
* adjust the offset relative to the current offset.
*/
-uintptr_t
-_kvm_dpcpu_validaddr(kvm_t *kd, uintptr_t value)
+kvaddr_t
+_kvm_dpcpu_validaddr(kvm_t *kd, kvaddr_t value)
{
if (value == 0)
@@ -319,6 +325,8 @@ ssize_t
kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size_t size, int cpu)
{
+ if (!kvm_native(kd))
+ return (-1);
return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu),
buf, size));
}
diff --git a/lib/libkvm/kvm_powerpc.c b/lib/libkvm/kvm_powerpc.c
index fa38021..39fbf43 100644
--- a/lib/libkvm/kvm_powerpc.c
+++ b/lib/libkvm/kvm_powerpc.c
@@ -34,12 +34,9 @@ __FBSDID("$FreeBSD$");
#include <sys/kerneldump.h>
#include <sys/mman.h>
-#include <vm/vm.h>
-
-#include <db.h>
#include <elf.h>
-#include <limits.h>
#include <kvm.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
@@ -100,7 +97,7 @@ powerpc_maphdrs(kvm_t *kd)
vm = kd->vmst;
- vm->mapsz = PAGE_SIZE;
+ vm->mapsz = sizeof(*vm->eh) + sizeof(struct kerneldumpheader);
vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
if (vm->map == MAP_FAILED) {
_kvm_err(kd, kd->program, "cannot map corefile");
@@ -130,7 +127,7 @@ powerpc_maphdrs(kvm_t *kd)
vm->mapsz = vm->dmphdrsz + mapsz;
vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
if (vm->map == MAP_FAILED) {
- _kvm_err(kd, kd->program, "cannot map corefle headers");
+ _kvm_err(kd, kd->program, "cannot map corefile headers");
return (-1);
}
vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz);
@@ -138,8 +135,6 @@ powerpc_maphdrs(kvm_t *kd)
return (0);
inval:
- munmap(vm->map, vm->mapsz);
- vm->map = MAP_FAILED;
_kvm_err(kd, kd->program, "invalid corefile");
return (-1);
}
@@ -150,7 +145,7 @@ powerpc_maphdrs(kvm_t *kd)
* 0 when the virtual address is invalid.
*/
static size_t
-powerpc_va2off(kvm_t *kd, u_long va, off_t *ofs)
+powerpc_va2off(kvm_t *kd, kvaddr_t va, off_t *ofs)
{
struct vmstate *vm = kd->vmst;
Elf32_Phdr *ph;
@@ -172,48 +167,69 @@ powerpc_va2off(kvm_t *kd, u_long va, off_t *ofs)
return (be32toh(ph->p_memsz) - (va - be32toh(ph->p_vaddr)));
}
-void
-_kvm_freevtop(kvm_t *kd)
+static void
+_powerpc_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (vm == NULL)
- return;
-
- if (vm->eh != MAP_FAILED) {
+ if (vm->eh != MAP_FAILED)
munmap(vm->eh, vm->mapsz);
- vm->eh = MAP_FAILED;
- }
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_initvtop(kvm_t *kd)
+static int
+_powerpc_probe(kvm_t *kd)
+{
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS32, EM_PPC) &&
+ kd->nlehdr.e_ident[EI_DATA] == ELFDATA2MSB);
+}
+
+static int
+_powerpc_initvtop(kvm_t *kd)
{
kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst));
- if (kd->vmst == NULL) {
- _kvm_err(kd, kd->program, "out of virtual memory");
+ if (kd->vmst == NULL)
return (-1);
- }
- if (powerpc_maphdrs(kd) == -1) {
- free(kd->vmst);
- kd->vmst = NULL;
+
+ if (powerpc_maphdrs(kd) == -1)
return (-1);
- }
+
return (0);
}
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs)
+static int
+_powerpc_kvatop(kvm_t *kd, kvaddr_t va, off_t *ofs)
{
struct vmstate *vm;
vm = kd->vmst;
- if (vm->ph->p_paddr == ~0U)
+ if (be32toh(vm->ph->p_paddr) == 0xffffffff)
return ((int)powerpc_va2off(kd, va, ofs));
_kvm_err(kd, kd->program, "Raw corefile not supported");
return (0);
}
+
+static int
+_powerpc_native(kvm_t *kd)
+{
+
+#if defined(__powerpc__) && !defined(__powerpc64__)
+ return (1);
+#else
+ return (0);
+#endif
+}
+
+struct kvm_arch kvm_powerpc = {
+ .ka_probe = _powerpc_probe,
+ .ka_initvtop = _powerpc_initvtop,
+ .ka_freevtop = _powerpc_freevtop,
+ .ka_kvatop = _powerpc_kvatop,
+ .ka_native = _powerpc_native,
+};
+
+KVM_ARCH(kvm_powerpc);
diff --git a/lib/libkvm/kvm_powerpc64.c b/lib/libkvm/kvm_powerpc64.c
index f3a2b24..7912185 100644
--- a/lib/libkvm/kvm_powerpc64.c
+++ b/lib/libkvm/kvm_powerpc64.c
@@ -34,12 +34,9 @@ __FBSDID("$FreeBSD$");
#include <sys/kerneldump.h>
#include <sys/mman.h>
-#include <vm/vm.h>
-
-#include <db.h>
#include <elf.h>
-#include <limits.h>
#include <kvm.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
@@ -100,7 +97,7 @@ powerpc_maphdrs(kvm_t *kd)
vm = kd->vmst;
- vm->mapsz = PAGE_SIZE;
+ vm->mapsz = sizeof(*vm->eh) + sizeof(struct kerneldumpheader);
vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
if (vm->map == MAP_FAILED) {
_kvm_err(kd, kd->program, "cannot map corefile");
@@ -130,16 +127,15 @@ powerpc_maphdrs(kvm_t *kd)
vm->mapsz = vm->dmphdrsz + mapsz;
vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0);
if (vm->map == MAP_FAILED) {
- _kvm_err(kd, kd->program, "cannot map corefle headers");
+ _kvm_err(kd, kd->program, "cannot map corefile headers");
return (-1);
}
vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz);
- vm->ph = (void *)((uintptr_t)vm->eh + be64toh(vm->eh->e_phoff));
+ vm->ph = (void *)((uintptr_t)vm->eh +
+ (uintptr_t)be64toh(vm->eh->e_phoff));
return (0);
inval:
- munmap(vm->map, vm->mapsz);
- vm->map = MAP_FAILED;
_kvm_err(kd, kd->program, "invalid corefile");
return (-1);
}
@@ -150,7 +146,7 @@ powerpc_maphdrs(kvm_t *kd)
* 0 when the virtual address is invalid.
*/
static size_t
-powerpc64_va2off(kvm_t *kd, u_long va, off_t *ofs)
+powerpc64_va2off(kvm_t *kd, kvaddr_t va, off_t *ofs)
{
struct vmstate *vm = kd->vmst;
Elf64_Phdr *ph;
@@ -172,48 +168,69 @@ powerpc64_va2off(kvm_t *kd, u_long va, off_t *ofs)
return (be64toh(ph->p_memsz) - (va - be64toh(ph->p_vaddr)));
}
-void
-_kvm_freevtop(kvm_t *kd)
+static void
+_powerpc64_freevtop(kvm_t *kd)
{
struct vmstate *vm = kd->vmst;
- if (vm == NULL)
- return;
-
- if (vm->eh != MAP_FAILED) {
+ if (vm->eh != MAP_FAILED)
munmap(vm->eh, vm->mapsz);
- vm->eh = MAP_FAILED;
- }
free(vm);
kd->vmst = NULL;
}
-int
-_kvm_initvtop(kvm_t *kd)
+static int
+_powerpc64_probe(kvm_t *kd)
+{
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_PPC64) &&
+ kd->nlehdr.e_ident[EI_DATA] == ELFDATA2MSB);
+}
+
+static int
+_powerpc64_initvtop(kvm_t *kd)
{
kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst));
- if (kd->vmst == NULL) {
- _kvm_err(kd, kd->program, "out of virtual memory");
+ if (kd->vmst == NULL)
return (-1);
- }
- if (powerpc_maphdrs(kd) == -1) {
- free(kd->vmst);
- kd->vmst = NULL;
+
+ if (powerpc_maphdrs(kd) == -1)
return (-1);
- }
+
return (0);
}
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs)
+static int
+_powerpc64_kvatop(kvm_t *kd, kvaddr_t va, off_t *ofs)
{
struct vmstate *vm;
vm = kd->vmst;
- if (vm->ph->p_paddr == ~0UL)
+ if (be64toh(vm->ph->p_paddr) == 0xffffffffffffffff)
return ((int)powerpc64_va2off(kd, va, ofs));
_kvm_err(kd, kd->program, "Raw corefile not supported");
return (0);
}
+
+static int
+_powerpc64_native(kvm_t *kd)
+{
+
+#ifdef __powerpc64__
+ return (1);
+#else
+ return (0);
+#endif
+}
+
+struct kvm_arch kvm_powerpc64 = {
+ .ka_probe = _powerpc64_probe,
+ .ka_initvtop = _powerpc64_initvtop,
+ .ka_freevtop = _powerpc64_freevtop,
+ .ka_kvatop = _powerpc64_kvatop,
+ .ka_native = _powerpc64_native,
+};
+
+KVM_ARCH(kvm_powerpc64);
diff --git a/lib/libkvm/kvm_private.h b/lib/libkvm/kvm_private.h
index 4829046..78b4845 100644
--- a/lib/libkvm/kvm_private.h
+++ b/lib/libkvm/kvm_private.h
@@ -34,7 +34,22 @@
* $FreeBSD$
*/
+#include <sys/endian.h>
+#include <sys/linker_set.h>
+#include <gelf.h>
+
+struct kvm_arch {
+ int (*ka_probe)(kvm_t *);
+ int (*ka_initvtop)(kvm_t *);
+ void (*ka_freevtop)(kvm_t *);
+ int (*ka_kvatop)(kvm_t *, kvaddr_t, off_t *);
+ int (*ka_native)(kvm_t *);
+};
+
+#define KVM_ARCH(ka) DATA_SET(kvm_arch, ka)
+
struct __kvm {
+ struct kvm_arch *arch;
/*
* a string to be prepended to error messages
* provided for compatibility with sun's interface
@@ -46,8 +61,9 @@ struct __kvm {
#define ISALIVE(kd) ((kd)->vmfd >= 0)
int pmfd; /* physical memory file (or crashdump) */
int vmfd; /* virtual memory file (-1 if crashdump) */
- int unused; /* was: swap file (e.g., /dev/drum) */
int nlfd; /* namelist file (e.g., /kernel) */
+ GElf_Ehdr nlehdr; /* ELF file header for namelist file */
+ int (*resolve_symbol)(const char *, kvaddr_t *);
struct kinfo_proc *procbase;
char *argspc; /* (dynamic) storage for argv strings */
int arglen; /* length of the above */
@@ -64,10 +80,10 @@ struct __kvm {
int rawdump; /* raw dump format */
int vnet_initialized; /* vnet fields set up */
- uintptr_t vnet_start; /* start of kernel's vnet region */
- uintptr_t vnet_stop; /* stop of kernel's vnet region */
- uintptr_t vnet_current; /* vnet we're working with */
- uintptr_t vnet_base; /* vnet base of current vnet */
+ kvaddr_t vnet_start; /* start of kernel's vnet region */
+ kvaddr_t vnet_stop; /* stop of kernel's vnet region */
+ kvaddr_t vnet_current; /* vnet we're working with */
+ kvaddr_t vnet_base; /* vnet base of current vnet */
/*
* Dynamic per-CPU kernel memory. We translate symbols, on-demand,
@@ -75,38 +91,69 @@ struct __kvm {
* kvm_dpcpu_setcpu().
*/
int dpcpu_initialized; /* dpcpu fields set up */
- uintptr_t dpcpu_start; /* start of kernel's dpcpu region */
- uintptr_t dpcpu_stop; /* stop of kernel's dpcpu region */
+ kvaddr_t dpcpu_start; /* start of kernel's dpcpu region */
+ kvaddr_t dpcpu_stop; /* stop of kernel's dpcpu region */
u_int dpcpu_maxcpus; /* size of base array */
uintptr_t *dpcpu_off; /* base array, indexed by CPU ID */
u_int dpcpu_curcpu; /* CPU we're currently working with */
- uintptr_t dpcpu_curoff; /* dpcpu base of current CPU */
+ kvaddr_t dpcpu_curoff; /* dpcpu base of current CPU */
+};
+
+/*
+ * Page table hash used by minidump backends to map physical addresses
+ * to file offsets.
+ */
+struct hpte {
+ struct hpte *next;
+ uint64_t pa;
+ off_t off;
+};
+
+#define HPT_SIZE 1024
+
+struct hpt {
+ struct hpte *hpt_head[HPT_SIZE];
};
/*
* Functions used internally by kvm, but across kvm modules.
*/
+static inline uint32_t
+_kvm32toh(kvm_t *kd, uint32_t val)
+{
+
+ if (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB)
+ return (le32toh(val));
+ else
+ return (be32toh(val));
+}
+
+static inline uint64_t
+_kvm64toh(kvm_t *kd, uint64_t val)
+{
+
+ if (kd->nlehdr.e_ident[EI_DATA] == ELFDATA2LSB)
+ return (le64toh(val));
+ else
+ return (be64toh(val));
+}
+
void _kvm_err(kvm_t *kd, const char *program, const char *fmt, ...)
__printflike(3, 4);
void _kvm_freeprocs(kvm_t *kd);
-void _kvm_freevtop(kvm_t *);
-int _kvm_initvtop(kvm_t *);
-int _kvm_kvatop(kvm_t *, u_long, off_t *);
void *_kvm_malloc(kvm_t *kd, size_t);
-int _kvm_nlist(kvm_t *, struct nlist *, int);
+int _kvm_nlist(kvm_t *, struct kvm_nlist *, int);
void *_kvm_realloc(kvm_t *kd, void *, size_t);
void _kvm_syserr (kvm_t *kd, const char *program, const char *fmt, ...)
__printflike(3, 4);
-int _kvm_uvatop(kvm_t *, const struct proc *, u_long, u_long *);
int _kvm_vnet_selectpid(kvm_t *, pid_t);
int _kvm_vnet_initialized(kvm_t *, int);
-uintptr_t _kvm_vnet_validaddr(kvm_t *, uintptr_t);
+kvaddr_t _kvm_vnet_validaddr(kvm_t *, kvaddr_t);
int _kvm_dpcpu_initialized(kvm_t *, int);
-uintptr_t _kvm_dpcpu_validaddr(kvm_t *, uintptr_t);
-
-#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \
- defined(__i386__) || defined(__mips__)
-void _kvm_minidump_freevtop(kvm_t *);
-int _kvm_minidump_initvtop(kvm_t *);
-int _kvm_minidump_kvatop(kvm_t *, u_long, off_t *);
-#endif
+kvaddr_t _kvm_dpcpu_validaddr(kvm_t *, kvaddr_t);
+int _kvm_probe_elf_kernel(kvm_t *, int, int);
+int _kvm_is_minidump(kvm_t *);
+int _kvm_read_core_phdrs(kvm_t *, size_t *, GElf_Phdr **);
+void _kvm_hpt_init(kvm_t *, struct hpt *, void *, size_t, off_t, int, int);
+off_t _kvm_hpt_find(struct hpt *, uint64_t);
+void _kvm_hpt_free(struct hpt *);
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index bafe105..2f2b6c6 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -269,7 +269,7 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc *p,
return (-1);
}
kp->ki_ppid = pproc.p_pid;
- } else
+ } else
kp->ki_ppid = 0;
if (proc.p_pgrp == NULL)
goto nopgrp;
@@ -345,7 +345,7 @@ nopgrp:
* this field.
*/
#define pmap_resident_count(pm) ((pm)->pm_stats.resident_count)
- kp->ki_rssize = pmap_resident_count(&vmspace.vm_pmap);
+ kp->ki_rssize = pmap_resident_count(&vmspace.vm_pmap);
kp->ki_swrss = vmspace.vm_swrss;
kp->ki_tsize = vmspace.vm_tsize;
kp->ki_dsize = vmspace.vm_dsize;
@@ -400,12 +400,12 @@ nopgrp:
kp->ki_sflag = 0;
kp->ki_nice = proc.p_nice;
kp->ki_traceflag = proc.p_traceflag;
- if (proc.p_state == PRS_NORMAL) {
+ if (proc.p_state == PRS_NORMAL) {
if (TD_ON_RUNQ(&mtd) ||
TD_CAN_RUN(&mtd) ||
TD_IS_RUNNING(&mtd)) {
kp->ki_stat = SRUN;
- } else if (mtd.td_state ==
+ } else if (mtd.td_state ==
TDS_INHIBITED) {
if (P_SHOULDSTOP(&proc)) {
kp->ki_stat = SSTOP;
@@ -582,6 +582,12 @@ liveout:
nl[5].n_name = "_cpu_tick_frequency";
nl[6].n_name = 0;
+ if (!kd->arch->ka_native(kd)) {
+ _kvm_err(kd, kd->program,
+ "cannot read procs from non-native core");
+ return (0);
+ }
+
if (kvm_nlist(kd, nl) != 0) {
for (p = nl; p->n_type != 0; ++p)
;
diff --git a/lib/libkvm/kvm_read.3 b/lib/libkvm/kvm_read.3
index a2efd3c..fee3a16 100644
--- a/lib/libkvm/kvm_read.3
+++ b/lib/libkvm/kvm_read.3
@@ -32,11 +32,12 @@
.\" @(#)kvm_read.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd June 4, 1993
+.Dd November 27, 2015
.Dt KVM_READ 3
.Os
.Sh NAME
.Nm kvm_read ,
+.Nm kvm_read2 ,
.Nm kvm_write
.Nd read or write kernel virtual memory
.Sh LIBRARY
@@ -46,23 +47,26 @@
.Ft ssize_t
.Fn kvm_read "kvm_t *kd" "unsigned long addr" "void *buf" "size_t nbytes"
.Ft ssize_t
+.Fn kvm_read2 "kvm_t *kd" "kvaddr_t addr" "void *buf" "size_t nbytes"
+.Ft ssize_t
.Fn kvm_write "kvm_t *kd" "unsigned long addr" "const void *buf" "size_t nbytes"
.Sh DESCRIPTION
The
-.Fn kvm_read
+.Fn kvm_read ,
+.Fn kvm_read2 ,
and
.Fn kvm_write
functions are used to read and write kernel virtual memory (or a crash
dump file).
See
.Fn kvm_open 3
-or
-.Fn kvm_openfiles 3
for information regarding opening kernel virtual memory and crash dumps.
.Pp
The
.Fn kvm_read
-function transfers
+and
+.Fn kvm_read2
+functions transfer
.Fa nbytes
bytes of data from
the kernel space address
@@ -77,6 +81,16 @@ to
.Fa addr .
Unlike their SunOS counterparts, these functions cannot be used to
read or write process address spaces.
+.Pp
+The
+.Fn kvm_read2
+function uses a different type
+.Pq Vt kvaddr_t
+for the
+.Fa addr
+argument to allow use of addresses larger than
+.Dv ULONG_MAX
+when examining non-native kernel images.
.Sh RETURN VALUES
Upon success, the number of bytes actually transferred is returned.
Otherwise, -1 is returned.
diff --git a/lib/libkvm/kvm_sparc.c b/lib/libkvm/kvm_sparc.c
deleted file mode 100644
index bafd08c..0000000
--- a/lib/libkvm/kvm_sparc.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software developed by the Computer Systems
- * Engineering group at Lawrence Berkeley Laboratory under DARPA contract
- * BG 91-66 and contributed to Berkeley.
- *
- * 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.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)kvm_sparc.c 8.1 (Berkeley) 6/4/93";
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Sparc machine dependent routines for kvm. Hopefully, the forthcoming
- * vm code will one day obsolete this module.
- */
-
-#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <nlist.h>
-#include <kvm.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-
-#include <limits.h>
-
-#include "kvm_private.h"
-
-#define NPMEG 128
-
-/* XXX from sparc/pmap.c */
-#define MAXMEM (128 * 1024 * 1024) /* no more than 128 MB phys mem */
-#define NPGBANK 16 /* 2^4 pages per bank (64K / bank) */
-#define BSHIFT 4 /* log2(NPGBANK) */
-#define BOFFSET (NPGBANK - 1)
-#define BTSIZE (MAXMEM / NBPG / NPGBANK)
-#define HWTOSW(pmap_stod, pg) (pmap_stod[(pg) >> BSHIFT] | ((pg) & BOFFSET))
-
-struct vmstate {
- pmeg_t segmap[NKSEG];
- int pmeg[NPMEG][NPTESG];
- int pmap_stod[BTSIZE]; /* dense to sparse */
-};
-
-void
-_kvm_freevtop(kd)
- kvm_t *kd;
-{
- if (kd->vmst != 0)
- free(kd->vmst);
-}
-
-int
-_kvm_initvtop(kd)
- kvm_t *kd;
-{
- int i;
- int off;
- struct vmstate *vm;
- struct stat st;
- struct nlist nlist[2];
-
- vm = (struct vmstate *)_kvm_malloc(kd, sizeof(*vm));
- if (vm == 0)
- return (-1);
-
- kd->vmst = vm;
-
- if (fstat(kd->pmfd, &st) < 0)
- return (-1);
- /*
- * Read segment table.
- */
- off = st.st_size - ctob(btoc(sizeof(vm->segmap)));
- errno = 0;
- if (lseek(kd->pmfd, (off_t)off, 0) == -1 && errno != 0 ||
- read(kd->pmfd, (char *)vm->segmap, sizeof(vm->segmap)) < 0) {
- _kvm_err(kd, kd->program, "cannot read segment map");
- return (-1);
- }
- /*
- * Read PMEGs.
- */
- off = st.st_size - ctob(btoc(sizeof(vm->pmeg)) +
- btoc(sizeof(vm->segmap)));
- errno = 0;
- if (lseek(kd->pmfd, (off_t)off, 0) == -1 && errno != 0 ||
- read(kd->pmfd, (char *)vm->pmeg, sizeof(vm->pmeg)) < 0) {
- _kvm_err(kd, kd->program, "cannot read PMEG table");
- return (-1);
- }
- /*
- * Make pmap_stod be an identity map so we can bootstrap it in.
- * We assume it's in the first contiguous chunk of physical memory.
- */
- for (i = 0; i < BTSIZE; ++i)
- vm->pmap_stod[i] = i << 4;
-
- /*
- * It's okay to do this nlist separately from the one kvm_getprocs()
- * does, since the only time we could gain anything by combining
- * them is if we do a kvm_getprocs() on a dead kernel, which is
- * not too common.
- */
- nlist[0].n_name = "_pmap_stod";
- nlist[1].n_name = 0;
- if (kvm_nlist(kd, nlist) != 0) {
- _kvm_err(kd, kd->program, "pmap_stod: no such symbol");
- return (-1);
- }
- if (kvm_read(kd, (u_long)nlist[0].n_value,
- (char *)vm->pmap_stod, sizeof(vm->pmap_stod))
- != sizeof(vm->pmap_stod)) {
- _kvm_err(kd, kd->program, "cannot read pmap_stod");
- return (-1);
- }
- return (0);
-}
-
-#define VA_OFF(va) (va & (NBPG - 1))
-
-/*
- * Translate a user virtual address to a physical address.
- */
-int
-_kvm_uvatop(kd, p, va, pa)
- kvm_t *kd;
- const struct proc *p;
- u_long va;
- u_long *pa;
-{
- int kva, pte;
- int off, frame;
- struct vmspace *vms = p->p_vmspace;
-
- if ((u_long)vms < KERNBASE) {
- _kvm_err(kd, kd->program, "_kvm_uvatop: corrupt proc");
- return (0);
- }
- if (va >= KERNBASE)
- return (0);
- /*
- * Get the PTE. This takes two steps. We read the
- * base address of the table, then we index it.
- * Note that the index pte table is indexed by
- * virtual segment rather than physical segment.
- */
- kva = (u_long)&vms->vm_pmap.pm_rpte[VA_VSEG(va)];
- if (kvm_read(kd, kva, (char *)&kva, 4) != 4 || kva == 0)
- goto invalid;
- kva += sizeof(vms->vm_pmap.pm_rpte[0]) * VA_VPG(va);
- if (kvm_read(kd, kva, (char *)&pte, 4) == 4 && (pte & PG_V)) {
- off = VA_OFF(va);
- /*
- * /dev/mem adheres to the hardware model of physical memory
- * (with holes in the address space), while crashdumps
- * adhere to the contiguous software model.
- */
- if (ISALIVE(kd))
- frame = pte & PG_PFNUM;
- else
- frame = HWTOSW(kd->vmst->pmap_stod, pte & PG_PFNUM);
- *pa = (frame << PGSHIFT) | off;
- return (NBPG - off);
- }
-invalid:
- _kvm_err(kd, 0, "invalid address (%x)", va);
- return (0);
-}
-
-/*
- * Translate a kernel virtual address to a physical address using the
- * mapping information in kd->vm. Returns the result in pa, and returns
- * the number of bytes that are contiguously available from this
- * physical address. This routine is used only for crashdumps.
- */
-int
-_kvm_kvatop(kd, va, pa)
- kvm_t *kd;
- u_long va;
- uint64_t *pa;
-{
- struct vmstate *vm;
- int s;
- int pte;
- int off;
-
- if (va >= KERNBASE) {
- vm = kd->vmst;
- s = vm->segmap[VA_VSEG(va) - NUSEG];
- pte = vm->pmeg[s][VA_VPG(va)];
- if ((pte & PG_V) != 0) {
- off = VA_OFF(va);
- *pa = (HWTOSW(vm->pmap_stod, pte & PG_PFNUM)
- << PGSHIFT) | off;
-
- return (NBPG - off);
- }
- }
- _kvm_err(kd, 0, "invalid address (%x)", va);
- return (0);
-}
diff --git a/lib/libkvm/kvm_sparc64.c b/lib/libkvm/kvm_sparc64.c
index 1f925a9..97cb516 100644
--- a/lib/libkvm/kvm_sparc64.c
+++ b/lib/libkvm/kvm_sparc64.c
@@ -47,65 +47,54 @@ static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93";
*/
#include <sys/param.h>
-#include <sys/user.h>
-#include <sys/proc.h>
-#include <sys/stat.h>
+#include <kvm.h>
+#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
-#include <nlist.h>
-#include <kvm.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <machine/kerneldump.h>
-#include <machine/tte.h>
-#include <machine/tlb.h>
-#include <machine/tsb.h>
-
-#include <limits.h>
+#include "../../sys/sparc64/include/kerneldump.h"
#include "kvm_private.h"
-
-#ifndef btop
-#define btop(x) (sparc64_btop(x))
-#define ptob(x) (sparc64_ptob(x))
-#endif
+#include "kvm_sparc64.h"
struct vmstate {
off_t vm_tsb_off;
- vm_size_t vm_tsb_mask;
+ uint64_t vm_tsb_mask;
int vm_nregions;
struct sparc64_dump_reg *vm_regions;
};
-void
-_kvm_freevtop(kvm_t *kd)
+static int
+_sparc64_probe(kvm_t *kd)
{
- if (kd->vmst != 0) {
- free(kd->vmst->vm_regions);
- free(kd->vmst);
- }
+
+ return (_kvm_probe_elf_kernel(kd, ELFCLASS64, EM_SPARCV9));
+}
+
+static void
+_sparc64_freevtop(kvm_t *kd)
+{
+
+ free(kd->vmst->vm_regions);
+ free(kd->vmst);
+ kd->vmst = NULL;
}
static int
-_kvm_read_phys(kvm_t *kd, off_t pos, void *buf, size_t size)
+_sparc64_read_phys(kvm_t *kd, off_t pos, void *buf, size_t size)
{
/* XXX This has to be a raw file read, kvm_read is virtual. */
- if (lseek(kd->pmfd, pos, SEEK_SET) == -1) {
- _kvm_syserr(kd, kd->program, "_kvm_read_phys: lseek");
- return (0);
- }
- if (read(kd->pmfd, buf, size) != (ssize_t)size) {
- _kvm_syserr(kd, kd->program, "_kvm_read_phys: read");
+ if (pread(kd->pmfd, buf, size, pos) != (ssize_t)size) {
+ _kvm_syserr(kd, kd->program, "_sparc64_read_phys: pread");
return (0);
}
return (1);
}
static int
-_kvm_reg_cmp(const void *a, const void *b)
+_sparc64_reg_cmp(const void *a, const void *b)
{
const struct sparc64_dump_reg *ra, *rb;
@@ -122,14 +111,14 @@ _kvm_reg_cmp(const void *a, const void *b)
#define KVM_OFF_NOTFOUND 0
static off_t
-_kvm_find_off(struct vmstate *vm, vm_offset_t pa, vm_size_t size)
+_sparc64_find_off(struct vmstate *vm, uint64_t pa, uint64_t size)
{
struct sparc64_dump_reg *reg, key;
vm_offset_t o;
key.dr_pa = pa;
reg = bsearch(&key, vm->vm_regions, vm->vm_nregions,
- sizeof(*vm->vm_regions), _kvm_reg_cmp);
+ sizeof(*vm->vm_regions), _sparc64_reg_cmp);
if (reg == NULL)
return (KVM_OFF_NOTFOUND);
o = pa - reg->dr_pa;
@@ -138,14 +127,15 @@ _kvm_find_off(struct vmstate *vm, vm_offset_t pa, vm_size_t size)
return (reg->dr_offs + o);
}
-int
-_kvm_initvtop(kvm_t *kd)
+static int
+_sparc64_initvtop(kvm_t *kd)
{
struct sparc64_dump_hdr hdr;
struct sparc64_dump_reg *regs;
struct vmstate *vm;
size_t regsz;
- vm_offset_t pa;
+ uint64_t pa;
+ int i;
vm = (struct vmstate *)_kvm_malloc(kd, sizeof(*vm));
if (vm == NULL) {
@@ -154,8 +144,13 @@ _kvm_initvtop(kvm_t *kd)
}
kd->vmst = vm;
- if (!_kvm_read_phys(kd, 0, &hdr, sizeof(hdr)))
+ if (!_sparc64_read_phys(kd, 0, &hdr, sizeof(hdr)))
goto fail_vm;
+ hdr.dh_hdr_size = be64toh(hdr.dh_hdr_size);
+ hdr.dh_tsb_pa = be64toh(hdr.dh_tsb_pa);
+ hdr.dh_tsb_size = be64toh(hdr.dh_tsb_size);
+ hdr.dh_tsb_mask = be64toh(hdr.dh_tsb_mask);
+ hdr.dh_nregions = be32toh(hdr.dh_nregions);
pa = hdr.dh_tsb_pa;
regsz = hdr.dh_nregions * sizeof(*regs);
@@ -164,14 +159,19 @@ _kvm_initvtop(kvm_t *kd)
_kvm_err(kd, kd->program, "cannot allocate regions");
goto fail_vm;
}
- if (!_kvm_read_phys(kd, sizeof(hdr), regs, regsz))
+ if (!_sparc64_read_phys(kd, sizeof(hdr), regs, regsz))
goto fail_regs;
- qsort(regs, hdr.dh_nregions, sizeof(*regs), _kvm_reg_cmp);
+ for (i = 0; i < hdr.dh_nregions; i++) {
+ regs[i].dr_pa = be64toh(regs[i].dr_pa);
+ regs[i].dr_size = be64toh(regs[i].dr_size);
+ regs[i].dr_offs = be64toh(regs[i].dr_offs);
+ }
+ qsort(regs, hdr.dh_nregions, sizeof(*regs), _sparc64_reg_cmp);
vm->vm_tsb_mask = hdr.dh_tsb_mask;
vm->vm_regions = regs;
vm->vm_nregions = hdr.dh_nregions;
- vm->vm_tsb_off = _kvm_find_off(vm, hdr.dh_tsb_pa, hdr.dh_tsb_size);
+ vm->vm_tsb_off = _sparc64_find_off(vm, hdr.dh_tsb_pa, hdr.dh_tsb_size);
if (vm->vm_tsb_off == KVM_OFF_NOTFOUND) {
_kvm_err(kd, kd->program, "tsb not found in dump");
goto fail_regs;
@@ -185,37 +185,60 @@ fail_vm:
return (-1);
}
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+_sparc64_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa)
{
- struct tte tte;
+ struct sparc64_tte tte;
off_t tte_off;
- u_long vpn;
+ kvaddr_t vpn;
off_t pa_off;
- u_long pg_off;
+ kvaddr_t pg_off;
int rest;
- pg_off = va & PAGE_MASK;
- if (va >= VM_MIN_DIRECT_ADDRESS)
- pa_off = TLB_DIRECT_TO_PHYS(va) & ~PAGE_MASK;
+ pg_off = va & SPARC64_PAGE_MASK;
+ if (va >= SPARC64_MIN_DIRECT_ADDRESS)
+ pa_off = SPARC64_DIRECT_TO_PHYS(va) & ~SPARC64_PAGE_MASK;
else {
- vpn = btop(va);
+ vpn = va >> SPARC64_PAGE_SHIFT;
tte_off = kd->vmst->vm_tsb_off +
- ((vpn & kd->vmst->vm_tsb_mask) << TTE_SHIFT);
- if (!_kvm_read_phys(kd, tte_off, &tte, sizeof(tte)))
+ ((vpn & kd->vmst->vm_tsb_mask) << SPARC64_TTE_SHIFT);
+ if (!_sparc64_read_phys(kd, tte_off, &tte, sizeof(tte)))
goto invalid;
- if (!tte_match(&tte, va))
+ tte.tte_vpn = be64toh(tte.tte_vpn);
+ tte.tte_data = be64toh(tte.tte_data);
+ if (!sparc64_tte_match(&tte, va))
goto invalid;
- pa_off = TTE_GET_PA(&tte);
+ pa_off = SPARC64_TTE_GET_PA(&tte);
}
- rest = PAGE_SIZE - pg_off;
- pa_off = _kvm_find_off(kd->vmst, pa_off, rest);
+ rest = SPARC64_PAGE_SIZE - pg_off;
+ pa_off = _sparc64_find_off(kd->vmst, pa_off, rest);
if (pa_off == KVM_OFF_NOTFOUND)
goto invalid;
*pa = pa_off + pg_off;
return (rest);
invalid:
- _kvm_err(kd, 0, "invalid address (%lx)", va);
+ _kvm_err(kd, 0, "invalid address (%jx)", (uintmax_t)va);
return (0);
}
+
+static int
+_sparc64_native(kvm_t *kd)
+{
+
+#ifdef __sparc64__
+ return (1);
+#else
+ return (0);
+#endif
+}
+
+struct kvm_arch kvm_sparc64 = {
+ .ka_probe = _sparc64_probe,
+ .ka_initvtop = _sparc64_initvtop,
+ .ka_freevtop = _sparc64_freevtop,
+ .ka_kvatop = _sparc64_kvatop,
+ .ka_native = _sparc64_native,
+};
+
+KVM_ARCH(kvm_sparc64);
diff --git a/lib/libkvm/kvm_sparc64.h b/lib/libkvm/kvm_sparc64.h
new file mode 100644
index 0000000..ed5ee1f
--- /dev/null
+++ b/lib/libkvm/kvm_sparc64.h
@@ -0,0 +1,118 @@
+/*-
+ * Copyright (c) 2015 John H. Baldwin <jhb@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __KVM_SPARC64_H__
+#define __KVM_SPARC64_H__
+
+#ifdef __sparc64__
+#include <sys/queue.h>
+#include <machine/tlb.h>
+#include <machine/tte.h>
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#endif
+
+#define SPARC64_PAGE_SHIFT 13
+#define SPARC64_PAGE_SIZE (1 << SPARC64_PAGE_SHIFT)
+#define SPARC64_PAGE_MASK (SPARC64_PAGE_SIZE - 1)
+
+#define SPARC64_MIN_DIRECT_ADDRESS (0xfffff80000000000)
+
+#define SPARC64_DIRECT_ADDRESS_BITS (43)
+#define SPARC64_DIRECT_ADDRESS_MASK \
+ (((uint64_t)1 << SPARC64_DIRECT_ADDRESS_BITS) - 1)
+
+#define SPARC64_DIRECT_TO_PHYS(va) ((va) & SPARC64_DIRECT_ADDRESS_MASK)
+
+#define SPARC64_TTE_SHIFT (5)
+
+#define SPARC64_TD_SIZE_SHIFT (61)
+#define SPARC64_TD_PA_SHIFT (13)
+
+#define SPARC64_TD_SIZE_BITS (2)
+#define SPARC64_TD_PA_CH_BITS (30) /* US-III{,i,+}, US-IV{,+}, SPARC64 V */
+#define SPARC64_TD_PA_BITS SPARC64_TD_PA_CH_BITS
+
+#define SPARC64_TD_SIZE_MASK (((uint64_t)1 << SPARC64_TD_SIZE_BITS) - 1)
+#define SPARC64_TD_PA_MASK (((uint64_t)1 << SPARC64_TD_PA_BITS) - 1)
+
+#define SPARC64_TD_V ((uint64_t)1 << 63)
+
+#define SPARC64_TV_SIZE_BITS (SPARC64_TD_SIZE_BITS)
+#define SPARC64_TV_VPN(va, sz) \
+ ((((va) >> SPARC64_TTE_PAGE_SHIFT(sz)) << SPARC64_TV_SIZE_BITS) | sz)
+
+#define SPARC64_TTE_SIZE_SPREAD (3)
+#define SPARC64_TTE_PAGE_SHIFT(sz) \
+ (SPARC64_PAGE_SHIFT + ((sz) * SPARC64_TTE_SIZE_SPREAD))
+
+#define SPARC64_TTE_GET_SIZE(tp) \
+ (((tp)->tte_data >> SPARC64_TD_SIZE_SHIFT) & SPARC64_TD_SIZE_MASK)
+
+#define SPARC64_TTE_GET_PA(tp) \
+ ((tp)->tte_data & (SPARC64_TD_PA_MASK << SPARC64_TD_PA_SHIFT))
+
+struct sparc64_tte {
+ uint64_t tte_vpn;
+ uint64_t tte_data;
+};
+
+static __inline int
+sparc64_tte_match(struct sparc64_tte *tp, kvaddr_t va)
+{
+
+ return (((tp->tte_data & SPARC64_TD_V) != 0) &&
+ (tp->tte_vpn == SPARC64_TV_VPN(va, SPARC64_TTE_GET_SIZE(tp))));
+}
+
+#ifdef __sparc64__
+_Static_assert(PAGE_SHIFT == SPARC64_PAGE_SHIFT, "PAGE_SHIFT mismatch");
+_Static_assert(PAGE_SIZE == SPARC64_PAGE_SIZE, "PAGE_SIZE mismatch");
+_Static_assert(PAGE_MASK == SPARC64_PAGE_MASK, "PAGE_MASK mismatch");
+_Static_assert(VM_MIN_DIRECT_ADDRESS == SPARC64_MIN_DIRECT_ADDRESS,
+ "VM_MIN_DIRECT_ADDRESS mismatch");
+_Static_assert(TLB_DIRECT_ADDRESS_BITS == SPARC64_DIRECT_ADDRESS_BITS,
+ "TLB_DIRECT_ADDRESS_BITS mismatch");
+_Static_assert(TLB_DIRECT_ADDRESS_MASK == SPARC64_DIRECT_ADDRESS_MASK,
+ "TLB_DIRECT_ADDRESS_MASK mismatch");
+_Static_assert(TTE_SHIFT == SPARC64_TTE_SHIFT, "TTE_SHIFT mismatch");
+_Static_assert(TD_SIZE_SHIFT == SPARC64_TD_SIZE_SHIFT,
+ "TD_SIZE_SHIFT mismatch");
+_Static_assert(TD_PA_SHIFT == SPARC64_TD_PA_SHIFT,
+ "TD_PA_SHIFT mismatch");
+_Static_assert(TD_SIZE_BITS == SPARC64_TD_SIZE_BITS, "TD_SIZE_BITS mismatch");
+_Static_assert(TD_PA_BITS == SPARC64_TD_PA_BITS, "TD_PA_BITS mismatch");
+_Static_assert(TD_SIZE_MASK == SPARC64_TD_SIZE_MASK, "TD_SIZE_MASK mismatch");
+_Static_assert(TD_PA_MASK == SPARC64_TD_PA_MASK, "TD_PA_MASK mismatch");
+_Static_assert(TD_V == SPARC64_TD_V, "TD_V mismatch");
+_Static_assert(TV_SIZE_BITS == SPARC64_TV_SIZE_BITS, "TV_SIZE_BITS mismatch");
+_Static_assert(TTE_SIZE_SPREAD == SPARC64_TTE_SIZE_SPREAD,
+ "TTE_SIZE_SPREAD mismatch");
+#endif
+
+#endif /* !__KVM_SPARC64_H__ */
diff --git a/lib/libkvm/kvm_vnet.c b/lib/libkvm/kvm_vnet.c
index 12ecafc..d9bdf55 100644
--- a/lib/libkvm/kvm_vnet.c
+++ b/lib/libkvm/kvm_vnet.c
@@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <net/vnet.h>
-#include <nlist.h>
#include <kvm.h>
#include <limits.h>
#include <stdlib.h>
@@ -62,7 +61,7 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid)
struct ucred cred;
struct prison prison;
struct vnet vnet;
- struct nlist nl[] = {
+ struct kvm_nlist nl[] = {
/*
* Note: kvm_nlist strips the first '_' so add an extra one
* here to __{start,stop}_set_vnet.
@@ -90,6 +89,12 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid)
lwpid_t dumptid;
/*
+ * XXX: This only works for native kernels for now.
+ */
+ if (!kvm_native(kd))
+ return (-1);
+
+ /*
* Locate and cache locations of important symbols
* using the internal version of _kvm_nlist, turning
* off initialization to avoid recursion in case of
@@ -204,7 +209,7 @@ _kvm_vnet_selectpid(kvm_t *kd, pid_t pid)
/*
* Check whether the vnet module has been initialized sucessfully
- * or not, intialize it if permitted.
+ * or not, initialize it if permitted.
*/
int
_kvm_vnet_initialized(kvm_t *kd, int intialize)
@@ -222,8 +227,8 @@ _kvm_vnet_initialized(kvm_t *kd, int intialize)
* Check whether the value is within the vnet symbol range and
* only if so adjust the offset relative to the current base.
*/
-uintptr_t
-_kvm_vnet_validaddr(kvm_t *kd, uintptr_t value)
+kvaddr_t
+_kvm_vnet_validaddr(kvm_t *kd, kvaddr_t value)
{
if (value == 0)
diff --git a/lib/libnandfs/Makefile.depend b/lib/libnandfs/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/lib/libnandfs/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpjdlog/Makefile.depend b/lib/libpjdlog/Makefile.depend
new file mode 100644
index 0000000..7de116d
--- /dev/null
+++ b/lib/libpjdlog/Makefile.depend
@@ -0,0 +1,20 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c
index 129c064..39deec6 100644
--- a/lib/libpmc/libpmc.c
+++ b/lib/libpmc/libpmc.c
@@ -217,6 +217,20 @@ static const struct pmc_event_descr haswell_xeon_event_table[] =
__PMC_EV_ALIAS_HASWELL_XEON()
};
+static const struct pmc_event_descr broadwell_event_table[] =
+{
+ __PMC_EV_ALIAS_BROADWELL()
+};
+
+static const struct pmc_event_descr broadwell_xeon_event_table[] =
+{
+ __PMC_EV_ALIAS_BROADWELL_XEON()
+};
+
+static const struct pmc_event_descr skylake_event_table[] =
+{
+ __PMC_EV_ALIAS_SKYLAKE()
+};
static const struct pmc_event_descr ivybridge_event_table[] =
{
@@ -258,6 +272,11 @@ static const struct pmc_event_descr haswelluc_event_table[] =
__PMC_EV_ALIAS_HASWELLUC()
};
+static const struct pmc_event_descr broadwelluc_event_table[] =
+{
+ __PMC_EV_ALIAS_BROADWELLUC()
+};
+
static const struct pmc_event_descr sandybridgeuc_event_table[] =
{
__PMC_EV_ALIAS_SANDYBRIDGEUC()
@@ -306,6 +325,9 @@ PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CL
PMC_MDEP_TABLE(nehalem_ex, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
PMC_MDEP_TABLE(haswell_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
+PMC_MDEP_TABLE(broadwell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
+PMC_MDEP_TABLE(broadwell_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
+PMC_MDEP_TABLE(skylake, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC);
PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP);
@@ -358,6 +380,9 @@ PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap);
PMC_CLASS_TABLE_DESC(nehalem_ex, IAP, nehalem_ex, iap);
PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap);
PMC_CLASS_TABLE_DESC(haswell_xeon, IAP, haswell_xeon, iap);
+PMC_CLASS_TABLE_DESC(broadwell, IAP, broadwell, iap);
+PMC_CLASS_TABLE_DESC(broadwell_xeon, IAP, broadwell_xeon, iap);
+PMC_CLASS_TABLE_DESC(skylake, IAP, skylake, iap);
PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap);
PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap);
PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap);
@@ -367,6 +392,7 @@ PMC_CLASS_TABLE_DESC(westmere_ex, IAP, westmere_ex, iap);
PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf);
PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp);
PMC_CLASS_TABLE_DESC(haswelluc, UCP, haswelluc, ucp);
+PMC_CLASS_TABLE_DESC(broadwelluc, UCP, broadwelluc, ucp);
PMC_CLASS_TABLE_DESC(sandybridgeuc, UCP, sandybridgeuc, ucp);
PMC_CLASS_TABLE_DESC(westmereuc, UCP, westmereuc, ucp);
#endif
@@ -689,6 +715,12 @@ static struct pmc_event_alias core2_aliases_without_iaf[] = {
#define haswell_aliases_without_iaf core2_aliases_without_iaf
#define haswell_xeon_aliases core2_aliases
#define haswell_xeon_aliases_without_iaf core2_aliases_without_iaf
+#define broadwell_aliases core2_aliases
+#define broadwell_aliases_without_iaf core2_aliases_without_iaf
+#define broadwell_xeon_aliases core2_aliases
+#define broadwell_xeon_aliases_without_iaf core2_aliases_without_iaf
+#define skylake_aliases core2_aliases
+#define skylake_aliases_without_iaf core2_aliases_without_iaf
#define ivybridge_aliases core2_aliases
#define ivybridge_aliases_without_iaf core2_aliases_without_iaf
#define ivybridge_xeon_aliases core2_aliases
@@ -849,6 +881,7 @@ static struct pmc_masks iap_rsp_mask_sb_sbx_ib[] = {
NULLMASK
};
+/* Broadwell is defined to use the same mask as Haswell */
static struct pmc_masks iap_rsp_mask_haswell[] = {
PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)),
PMCMASK(REQ_DMND_RFO, (1ULL << 1)),
@@ -864,6 +897,36 @@ static struct pmc_masks iap_rsp_mask_haswell[] = {
PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)),
PMCMASK(RES_SUPPLIER_LLC_HITF, (1ULL << 21)),
PMCMASK(RES_SUPPLIER_LOCAL, (1ULL << 22)),
+ /*
+ * For processor type 06_45H 22 is L4_HIT_LOCAL_L4
+ * and 23, 24 and 25 are also defined.
+ */
+ PMCMASK(RES_SNOOP_SNP_NONE, (1ULL << 31)),
+ PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)),
+ PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)),
+ PMCMASK(RES_SNOOP_HIT_NO_FWD, (1ULL << 34)),
+ PMCMASK(RES_SNOOP_HIT_FWD, (1ULL << 35)),
+ PMCMASK(RES_SNOOP_HITM, (1ULL << 36)),
+ PMCMASK(RES_NON_DRAM, (1ULL << 37)),
+ NULLMASK
+};
+
+static struct pmc_masks iap_rsp_mask_skylake[] = {
+ PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)),
+ PMCMASK(REQ_DMND_RFO, (1ULL << 1)),
+ PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)),
+ PMCMASK(REQ_PF_DATA_RD, (1ULL << 7)),
+ PMCMASK(REQ_PF_RFO, (1ULL << 8)),
+ PMCMASK(REQ_STRM_ST, (1ULL << 11)),
+ PMCMASK(REQ_OTHER, (1ULL << 15)),
+ PMCMASK(RES_ANY, (1ULL << 16)),
+ PMCMASK(RES_SUPPLIER_SUPP, (1ULL << 17)),
+ PMCMASK(RES_SUPPLIER_LLC_HITM, (1ULL << 18)),
+ PMCMASK(RES_SUPPLIER_LLC_HITE, (1ULL << 19)),
+ PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)),
+ PMCMASK(RES_SUPPLIER_L4_HIT, (1ULL << 22)),
+ PMCMASK(RES_SUPPLIER_DRAM, (1ULL << 26)),
+ PMCMASK(RES_SUPPLIER_SPL_HIT, (1ULL << 30)),
PMCMASK(RES_SNOOP_SNP_NONE, (1ULL << 31)),
PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)),
PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)),
@@ -874,6 +937,7 @@ static struct pmc_masks iap_rsp_mask_haswell[] = {
NULLMASK
};
+
static int
iap_allocate_pmc(enum pmc_event pe, char *ctrspec,
struct pmc_op_pmcallocate *pmc_config)
@@ -965,6 +1029,20 @@ iap_allocate_pmc(enum pmc_event pe, char *ctrspec,
n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp);
} else
return (-1);
+ } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_BROADWELL ||
+ cpu_info.pm_cputype == PMC_CPU_INTEL_BROADWELL_XEON) {
+ /* Broadwell is defined to use same mask as haswell */
+ if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) {
+ n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp);
+ } else
+ return (-1);
+
+ } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SKYLAKE) {
+ if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) {
+ n = pmc_parse_mask(iap_rsp_mask_skylake, p, &rsp);
+ } else
+ return (-1);
+
} else
return (-1);
@@ -2917,6 +2995,18 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
ev = haswell_xeon_event_table;
count = PMC_EVENT_TABLE_SIZE(haswell_xeon);
break;
+ case PMC_CPU_INTEL_BROADWELL:
+ ev = broadwell_event_table;
+ count = PMC_EVENT_TABLE_SIZE(broadwell);
+ break;
+ case PMC_CPU_INTEL_BROADWELL_XEON:
+ ev = broadwell_xeon_event_table;
+ count = PMC_EVENT_TABLE_SIZE(broadwell_xeon);
+ break;
+ case PMC_CPU_INTEL_SKYLAKE:
+ ev = skylake_event_table;
+ count = PMC_EVENT_TABLE_SIZE(skylake);
+ break;
case PMC_CPU_INTEL_IVYBRIDGE:
ev = ivybridge_event_table;
count = PMC_EVENT_TABLE_SIZE(ivybridge);
@@ -2962,6 +3052,10 @@ pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
ev = haswelluc_event_table;
count = PMC_EVENT_TABLE_SIZE(haswelluc);
break;
+ case PMC_CPU_INTEL_BROADWELL:
+ ev = broadwelluc_event_table;
+ count = PMC_EVENT_TABLE_SIZE(broadwelluc);
+ break;
case PMC_CPU_INTEL_SANDYBRIDGE:
ev = sandybridgeuc_event_table;
count = PMC_EVENT_TABLE_SIZE(sandybridgeuc);
@@ -3281,6 +3375,17 @@ pmc_init(void)
case PMC_CPU_INTEL_HASWELL_XEON:
PMC_MDEP_INIT_INTEL_V2(haswell_xeon);
break;
+ case PMC_CPU_INTEL_BROADWELL:
+ pmc_class_table[n++] = &ucf_class_table_descr;
+ pmc_class_table[n++] = &broadwelluc_class_table_descr;
+ PMC_MDEP_INIT_INTEL_V2(broadwell);
+ break;
+ case PMC_CPU_INTEL_BROADWELL_XEON:
+ PMC_MDEP_INIT_INTEL_V2(broadwell_xeon);
+ break;
+ case PMC_CPU_INTEL_SKYLAKE:
+ PMC_MDEP_INIT_INTEL_V2(skylake);
+ break;
case PMC_CPU_INTEL_IVYBRIDGE:
PMC_MDEP_INIT_INTEL_V2(ivybridge);
break;
@@ -3480,7 +3585,18 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype cpu)
ev = haswell_xeon_event_table;
evfence = haswell_xeon_event_table + PMC_EVENT_TABLE_SIZE(haswell_xeon);
break;
-
+ case PMC_CPU_INTEL_BROADWELL:
+ ev = broadwell_event_table;
+ evfence = broadwell_event_table + PMC_EVENT_TABLE_SIZE(broadwell);
+ break;
+ case PMC_CPU_INTEL_BROADWELL_XEON:
+ ev = broadwell_xeon_event_table;
+ evfence = broadwell_xeon_event_table + PMC_EVENT_TABLE_SIZE(broadwell_xeon);
+ break;
+ case PMC_CPU_INTEL_SKYLAKE:
+ ev = skylake_event_table;
+ evfence = skylake_event_table + PMC_EVENT_TABLE_SIZE(skylake);
+ break;
case PMC_CPU_INTEL_IVYBRIDGE:
ev = ivybridge_event_table;
evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge);
diff --git a/lib/libproc/tests/Makefile b/lib/libproc/tests/Makefile
index 326481d..c4a8471 100644
--- a/lib/libproc/tests/Makefile
+++ b/lib/libproc/tests/Makefile
@@ -6,8 +6,7 @@ PROGS= target_prog
SRCS_target_prog= target_prog.c
BINDIR_target_prog= ${TESTSDIR}
-LDADD+= -lelf -lproc -lrtld_db -lutil
-DPADD+= ${LIBELF} ${LIBPROC} ${LIBRTLD_DB} ${LIBUTIL}
+LIBADD= elf proc rtld_db util
# Ensure that symbols aren't stripped from the test program, as they're needed
# for testing symbol lookup.
diff --git a/lib/librt/Makefile b/lib/librt/Makefile
index 5696610..3c16976 100644
--- a/lib/librt/Makefile
+++ b/lib/librt/Makefile
@@ -17,7 +17,8 @@ SRCS+= aio.c mq.c sigev_thread.c timer.c
PRECIOUSLIB=
-VERSION_MAP= ${.CURDIR}/Version.map
+VERSION_DEF=${.CURDIR}/../libc/Versions.def
+SYMBOL_MAPS=${.CURDIR}/Symbol.map
.if ${MK_TESTS} != "no"
SUBDIR+= tests
diff --git a/lib/librt/Version.map b/lib/librt/Symbol.map
index 161bb76..161bb76 100644
--- a/lib/librt/Version.map
+++ b/lib/librt/Symbol.map
diff --git a/lib/libthr/tests/Makefile b/lib/libthr/tests/Makefile
index a5fc85e..aeb1ef8 100644
--- a/lib/libthr/tests/Makefile
+++ b/lib/libthr/tests/Makefile
@@ -30,12 +30,9 @@ NETBSD_ATF_TESTS_SH+= cancel_test
NETBSD_ATF_TESTS_SH+= exit_test
NETBSD_ATF_TESTS_SH+= resolv_test
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
-DPADD.fpu_test+= ${LIBM}
-LDADD.fpu_test+= -lm
-DPADD.sem_test+= ${LIBRT}
-LDADD.sem_test+= -lrt
+LIBADD+= pthread
+LIBADD.fpu_test+= m
+LIBADD.sem_test+= rt
BINDIR= ${TESTSDIR}
diff --git a/lib/libthr/tests/dlopen/Makefile b/lib/libthr/tests/dlopen/Makefile
index 0893192..bea70ec 100644
--- a/lib/libthr/tests/dlopen/Makefile
+++ b/lib/libthr/tests/dlopen/Makefile
@@ -18,8 +18,7 @@ NETBSD_ATF_TESTS_C+= main_pthread_create_test
#NETBSD_ATF_TESTS_C+= dso_pthread_create_test
.for t in dlopen_test main_pthread_create_test
-DPADD.$t+= ${LIBPTHREAD}
-LDADD.$t+= -lpthread
+LIBADD.${t}+= pthread
.endfor
.endif
diff --git a/lib/libthr/tests/dlopen/dso/Makefile b/lib/libthr/tests/dlopen/dso/Makefile
index 53356876..23d4cd6 100644
--- a/lib/libthr/tests/dlopen/dso/Makefile
+++ b/lib/libthr/tests/dlopen/dso/Makefile
@@ -8,8 +8,7 @@ SHLIB_MAJOR= 1
SHLIB_NAME= h_pthread_dlopen.so.${SHLIB_MAJOR}
SRCS= h_pthread_dlopen.c
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
+LIBADD+= pthread
LIBDIR= ${TESTSBASE}/lib/libthr/dlopen
diff --git a/lib/libunbound/Makefile.depend b/lib/libunbound/Makefile.depend
index aaf8d6d..900e3ea 100644
--- a/lib/libunbound/Makefile.depend
+++ b/lib/libunbound/Makefile.depend
@@ -13,6 +13,7 @@ DIRDEPS = \
lib/libthr \
secure/lib/libcrypto \
secure/lib/libssl \
+ usr.bin/yacc.host \
.include <dirdeps.mk>
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index eb826f5..e731a98 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -81,17 +81,16 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
w_cabs.c w_cabsf.c w_drem.c w_dremf.c
# Location of fpmath.h and _fpmath.h
-LIBCDIR= ${.CURDIR}/../libc
-.if exists(${LIBCDIR}/${MACHINE_ARCH})
+.if exists(${LIBCSRCDIR}/${MACHINE_ARCH})
LIBC_ARCH=${MACHINE_ARCH}
.else
LIBC_ARCH=${MACHINE_CPUARCH}
.endif
-CFLAGS+= -I${.CURDIR}/src -I${LIBCDIR}/include \
- -I${LIBCDIR}/${LIBC_ARCH}
+CFLAGS+= -I${.CURDIR}/src -I${LIBCSRCDIR}/include \
+ -I${LIBCSRCDIR}/${LIBC_ARCH}
SYM_MAPS+= ${.CURDIR}/Symbol.map
-VERSION_DEF= ${LIBCDIR}/Versions.def
+VERSION_DEF= ${LIBCSRCDIR}/Versions.def
SYMBOL_MAPS= ${SYM_MAPS}
# C99 long double functions
diff --git a/libexec/bootpd/Makefile.depend b/libexec/bootpd/Makefile.depend
index e0030e3..54c1f6f 100644
--- a/libexec/bootpd/Makefile.depend
+++ b/libexec/bootpd/Makefile.depend
@@ -2,12 +2,14 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/arpa \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
.include <dirdeps.mk>
diff --git a/libexec/casper/dns/Makefile.depend b/libexec/casper/dns/Makefile.depend
new file mode 100644
index 0000000..aa79c09
--- /dev/null
+++ b/libexec/casper/dns/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcasper \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libpjdlog \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/libexec/casper/grp/Makefile.depend b/libexec/casper/grp/Makefile.depend
new file mode 100644
index 0000000..aa79c09
--- /dev/null
+++ b/libexec/casper/grp/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcasper \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libpjdlog \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/libexec/casper/pwd/Makefile.depend b/libexec/casper/pwd/Makefile.depend
new file mode 100644
index 0000000..aa79c09
--- /dev/null
+++ b/libexec/casper/pwd/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcasper \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libpjdlog \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/libexec/casper/random/Makefile.depend b/libexec/casper/random/Makefile.depend
new file mode 100644
index 0000000..aa79c09
--- /dev/null
+++ b/libexec/casper/random/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcasper \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libpjdlog \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/libexec/casper/sysctl/Makefile.depend b/libexec/casper/sysctl/Makefile.depend
new file mode 100644
index 0000000..aa79c09
--- /dev/null
+++ b/libexec/casper/sysctl/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcasper \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libpjdlog \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/libexec/dma/dmagent/Makefile.depend b/libexec/dma/dmagent/Makefile.depend
index da1261f..226aa40 100644
--- a/libexec/dma/dmagent/Makefile.depend
+++ b/libexec/dma/dmagent/Makefile.depend
@@ -12,6 +12,7 @@ DIRDEPS = \
lib/libcompiler_rt \
secure/lib/libcrypto \
secure/lib/libssl \
+ usr.bin/yacc.host \
.include <dirdeps.mk>
diff --git a/libexec/hyperv/Makefile.depend b/libexec/hyperv/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/libexec/hyperv/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/libexec/rpc.rstatd/Makefile.depend b/libexec/rpc.rstatd/Makefile.depend
index bbb48e4..91b8891 100644
--- a/libexec/rpc.rstatd/Makefile.depend
+++ b/libexec/rpc.rstatd/Makefile.depend
@@ -12,6 +12,7 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libdevstat \
+ lib/libelf \
lib/libkvm \
lib/librpcsvc \
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 5667299..ae49e9b 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -13,9 +13,8 @@ SRCS= rtld_start.S \
malloc.c xmalloc.c debug.c libmap.c
MAN= rtld.1
CSTD?= gnu99
-TOPSRCDIR= ${.CURDIR}/../..
-CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD
-CFLAGS+= -I${TOPSRCDIR}/lib/csu/common
+CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding
+CFLAGS+= -I${SRCTOP}/lib/csu/common
.if exists(${.CURDIR}/${MACHINE_ARCH})
RTLD_ARCH= ${MACHINE_ARCH}
.else
@@ -23,7 +22,6 @@ RTLD_ARCH= ${MACHINE_CPUARCH}
.endif
CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR}
.if ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+= -mcall-aixdesc
LDFLAGS+= -nostdlib -e _rtld_start
.else
LDFLAGS+= -nostdlib -e .rtld_start
@@ -59,8 +57,7 @@ LIBADD+= compiler_rt
.if ${MK_SYMVER} == "yes"
-LIBCDIR= ${TOPSRCDIR}/lib/libc
-VERSION_DEF= ${LIBCDIR}/Versions.def
+VERSION_DEF= ${LIBCSRCDIR}/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
VERSION_MAP= Version.map
LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
@@ -87,5 +84,5 @@ beforeinstall:
SUBDIR+= tests
.endif
-.include <bsd.symver.mk>
.include <bsd.prog.mk>
+.include <bsd.symver.mk>
diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c
index ffa83fc..0c75a2a 100644
--- a/libexec/rtld-elf/powerpc64/reloc.c
+++ b/libexec/rtld-elf/powerpc64/reloc.c
@@ -43,11 +43,13 @@
#include "debug.h"
#include "rtld.h"
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
struct funcdesc {
Elf_Addr addr;
Elf_Addr toc;
Elf_Addr env;
};
+#endif
/*
* Process the R_PPC_COPY relocations
@@ -336,11 +338,14 @@ static int
reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela)
{
Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
Elf_Addr *glink;
+#endif
long reloff;
reloff = rela - obj->pltrela;
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
if (obj->priv == NULL)
obj->priv = xmalloc(obj->pltrelasize);
glink = obj->priv + reloff*sizeof(Elf_Addr)*2;
@@ -351,6 +356,10 @@ reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela)
((struct funcdesc *)(where))->env = (Elf_Addr)glink;
*(glink++) = (Elf_Addr)obj;
*(glink++) = reloff*sizeof(Elf_Rela);
+#else
+ dbg(" reloc_plt_object: where=%p,reloff=%lx,glink=%#lx", (void *)where, reloff, obj->glink);
+ *where = (Elf_Addr)obj->glink + 4*reloff + 32;
+#endif
return (0);
}
@@ -416,7 +425,11 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate)
if (def == &sym_zero) {
/* Zero undefined weak symbols */
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
bzero(where, sizeof(struct funcdesc));
+#else
+ *where = 0;
+#endif
} else {
reloc_jmpslot(where, target, defobj, obj,
(const Elf_Rel *) rela);
@@ -436,9 +449,6 @@ Elf_Addr
reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj,
const Obj_Entry *obj, const Elf_Rel *rel)
{
- dbg(" reloc_jmpslot: where=%p, target=%p (%#lx + %#lx)",
- (void *)wherep, (void *)target, *(Elf_Addr *)target,
- (Elf_Addr)defobj->relocbase);
/*
* At the PLT entry pointed at by `wherep', construct
@@ -446,6 +456,11 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj,
* address.
*/
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
+ dbg(" reloc_jmpslot: where=%p, target=%p (%#lx + %#lx)",
+ (void *)wherep, (void *)target, *(Elf_Addr *)target,
+ (Elf_Addr)defobj->relocbase);
+
memcpy(wherep, (void *)target, sizeof(struct funcdesc));
if (((struct funcdesc *)(wherep))->addr < (Elf_Addr)defobj->relocbase) {
/*
@@ -459,8 +474,14 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj,
((struct funcdesc *)(wherep))->toc +=
(Elf_Addr)defobj->relocbase;
}
+#else
+ dbg(" reloc_jmpslot: where=%p, target=%p", (void *)wherep,
+ (void *)target);
+
+ *wherep = target;
+#endif
- __asm __volatile("dcbst 0,%0; sync" :: "r"(wherep) : "memory");
+ __asm __volatile("sync" ::: "memory");
return (target);
}
@@ -485,6 +506,20 @@ reloc_gnu_ifunc(Obj_Entry *obj, int flags,
void
init_pltgot(Obj_Entry *obj)
{
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+ Elf_Addr *pltcall;
+
+ pltcall = obj->pltgot;
+
+ if (pltcall == NULL) {
+ return;
+ }
+
+ pltcall[0] = (Elf_Addr)&_rtld_bind_start;
+ pltcall[1] = (Elf_Addr)obj;
+
+ __asm __volatile("sync" ::: "memory");
+#endif
}
void
diff --git a/libexec/rtld-elf/powerpc64/rtld_start.S b/libexec/rtld-elf/powerpc64/rtld_start.S
index 186e16e..ee04d97 100644
--- a/libexec/rtld-elf/powerpc64/rtld_start.S
+++ b/libexec/rtld-elf/powerpc64/rtld_start.S
@@ -82,9 +82,13 @@ _ENTRY(_rtld_start)
bl _rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/
nop
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
ld %r2,8(%r3)
ld %r11,16(%r3)
ld %r3,0(%r3)
+#else
+ mr %r12,%r3
+#endif
mtlr %r3
/*
@@ -106,7 +110,11 @@ _ENTRY(_rtld_start)
* _rtld_bind_start()
*
* Call into the MI binder. This routine is reached via the PLT call cell
- * On entry, %r11 contains a pointer to the (object, relocation) tuple.
+ *
+ * For ELFv1, on entry, %r11 contains a pointer to the (object, relocation)
+ * tuple.
+ *
+ * For ELFv2, %r11 contains an object pointer and %r0 contains the PLT index.
*
* Save all registers, call into the binder to resolve and fixup the external
* routine, and then transfer to the external routine on return.
@@ -114,6 +122,7 @@ _ENTRY(_rtld_start)
.globl _rtld_bind
_ENTRY(_rtld_bind_start)
+ mr %r12,%r0 # shunt r0 immediately to r12 for ELFv2
mflr %r0
std %r0,16(%r1) # save lr
mfcr %r0
@@ -121,7 +130,7 @@ _ENTRY(_rtld_bind_start)
stdu %r1,-48-12*8(%r1) # stack space for 8 regs + header
# + 2 save regs
- std %r3,64+0*8(%r1) # save r3-r31
+ std %r3,64+0*8(%r1) # save r3-r10 (arguments)
std %r4,64+1*8(%r1)
std %r5,64+2*8(%r1)
std %r6,64+3*8(%r1)
@@ -129,19 +138,27 @@ _ENTRY(_rtld_bind_start)
std %r8,64+5*8(%r1)
std %r9,64+6*8(%r1)
std %r10,64+7*8(%r1)
- std %r12,64+8*8(%r1)
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
ld %r3,0(%r11)
ld %r4,8(%r11)
+#else
+ mr %r3,%r11
+ mulli %r4,%r12,24 /* Multiply index by sizeof(Elf_Rela) */
+#endif
bl _rtld_bind # target addr = _rtld_bind(obj, reloff)
nop
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
ld %r2,8(%r3)
ld %r11,16(%r3)
ld %r3,0(%r3)
+#else
+ mr %r12,%r3
+#endif
mtctr %r3 # move absolute target addr into ctr
- ld %r3,64+0*8(%r1) # restore r3-r31
+ ld %r3,64+0*8(%r1) # restore r3-r10
ld %r4,64+1*8(%r1)
ld %r5,64+2*8(%r1)
ld %r6,64+3*8(%r1)
@@ -149,7 +166,6 @@ _ENTRY(_rtld_bind_start)
ld %r8,64+5*8(%r1)
ld %r9,64+6*8(%r1)
ld %r10,64+7*8(%r1)
- ld %r12,64+8*8(%r1)
ld %r1,0(%r1) # restore stack
ld %r0,8(%r1) # restore cr
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 7ba1e06..68ed46e 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -1148,7 +1148,7 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath,
#ifdef __mips__
case DT_MIPS_LOCAL_GOTNO:
obj->local_gotno = dynp->d_un.d_val;
- break;
+ break;
case DT_MIPS_SYMTABNO:
obj->symtabno = dynp->d_un.d_val;
@@ -1163,6 +1163,12 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath,
break;
#endif
+#ifdef __powerpc64__
+ case DT_PPC64_GLINK:
+ obj->glink = (Elf_Addr) (obj->relocbase + dynp->d_un.d_ptr);
+ break;
+#endif
+
case DT_FLAGS_1:
if (dynp->d_un.d_val & DF_1_NOOPEN)
obj->z_noopen = true;
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
index c7c5888..72a632e 100644
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -187,6 +187,9 @@ typedef struct Struct_Obj_Entry {
Elf_Word symtabno; /* Number of dynamic symbols */
Elf_Word gotsym; /* First dynamic symbol in GOT */
#endif
+#ifdef __powerpc64__
+ Elf_Addr glink; /* GLINK PLT call stub section */
+#endif
const Elf_Verneed *verneed; /* Required versions. */
Elf_Word verneednum; /* Number of entries in verneed table */
diff --git a/libexec/rtld-elf/tests/libpythagoras/Makefile b/libexec/rtld-elf/tests/libpythagoras/Makefile
index 618612f..9ad4b88 100644
--- a/libexec/rtld-elf/tests/libpythagoras/Makefile
+++ b/libexec/rtld-elf/tests/libpythagoras/Makefile
@@ -10,7 +10,6 @@ SHLIBDIR= ${TESTSBASE}/libexec/rtld-elf
SRCS= pythagoras.c
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.lib.mk>
diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index 45a6cc2..de314df 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -53,7 +53,7 @@ CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \
ed expr getfacl hostname kenv kill ln ls mkdir mv \
pkill ps pwd realpath rm rmdir setfacl sh sleep stty \
sync test
-CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil -lxo
+CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -lelf -ll -ltermcapw -lutil -lxo
CRUNCH_BUILDTOOLS+= bin/sh
# Additional options for specific programs
@@ -120,7 +120,7 @@ CRUNCH_PROGS_usr.sbin+= zdb
# crunchgen does not like C++ programs; this should be fixed someday
# CRUNCH_PROGS+= devd
-CRUNCH_LIBS+= -lalias -lcam -lncursesw -ldevstat -lipsec -llzma
+CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma
.if ${MK_ZFS} != "no"
CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
.else
diff --git a/sbin/casperd/Makefile.depend b/sbin/casperd/Makefile.depend
new file mode 100644
index 0000000..aa79c09
--- /dev/null
+++ b/sbin/casperd/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcapsicum \
+ lib/libcasper \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libpjdlog \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sbin/ddb/Makefile.depend b/sbin/ddb/Makefile.depend
index a1ac545..34582cd 100644
--- a/sbin/ddb/Makefile.depend
+++ b/sbin/ddb/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/sbin/dhclient/tests/Makefile b/sbin/dhclient/tests/Makefile
index 45cc8c2..fd3df4e 100644
--- a/sbin/dhclient/tests/Makefile
+++ b/sbin/dhclient/tests/Makefile
@@ -6,8 +6,7 @@ PLAIN_TESTS_C= option-domain-search_test
SRCS.option-domain-search_test= alloc.c convert.c hash.c options.c \
tables.c fake.c option-domain-search.c
CFLAGS.option-domain-search_test+= -I${.CURDIR}/..
-DPADD.option-domain-search_test= ${LIBUTIL}
-LDADD.option-domain-search_test= -lutil
+LIBADD.option-domain-search_test= util
WARNS?= 2
diff --git a/sbin/dmesg/Makefile.depend b/sbin/dmesg/Makefile.depend
index a1ac545..34582cd 100644
--- a/sbin/dmesg/Makefile.depend
+++ b/sbin/dmesg/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index ac7faf9..ed9c205 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -37,8 +37,8 @@ SRCS+= ifgif.c # GIF reversed header workaround
SRCS+= sfp.c # SFP/SFP+ information
LIBADD+= m
-SRCS+= ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support
-LIBADD+= bsdxml sbuf
+SRCS+= ifieee80211.c # SIOC[GS]IEEE80211 support
+LIBADD+= bsdxml sbuf 80211
SRCS+= carp.c # SIOC[GS]VH support
SRCS+= ifgroup.c # ...
diff --git a/sbin/ifconfig/Makefile.depend b/sbin/ifconfig/Makefile.depend
index 768e8c6..9096e8c 100644
--- a/sbin/ifconfig/Makefile.depend
+++ b/sbin/ifconfig/Makefile.depend
@@ -8,6 +8,7 @@ DIRDEPS = \
include/arpa \
include/xlocale \
lib/${CSU_DIR} \
+ lib/lib80211 \
lib/libc \
lib/libcompiler_rt \
lib/libexpat \
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 628eb190..72145d1 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -90,7 +90,9 @@
#include <stddef.h> /* NB: for offsetof */
#include "ifconfig.h"
-#include "regdomain.h"
+
+#include <lib80211/lib80211_regdomain.h>
+#include <lib80211/lib80211_ioctl.h>
#ifndef IEEE80211_FIXED_RATE_NONE
#define IEEE80211_FIXED_RATE_NONE 0xff
@@ -4886,60 +4888,31 @@ end:
static int
get80211(int s, int type, void *data, int len)
{
- struct ieee80211req ireq;
- (void) memset(&ireq, 0, sizeof(ireq));
- (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
- ireq.i_type = type;
- ireq.i_data = data;
- ireq.i_len = len;
- return ioctl(s, SIOCG80211, &ireq);
+ return (lib80211_get80211(s, name, type, data, len));
}
static int
get80211len(int s, int type, void *data, int len, int *plen)
{
- struct ieee80211req ireq;
- (void) memset(&ireq, 0, sizeof(ireq));
- (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
- ireq.i_type = type;
- ireq.i_len = len;
- assert(ireq.i_len == len); /* NB: check for 16-bit truncation */
- ireq.i_data = data;
- if (ioctl(s, SIOCG80211, &ireq) < 0)
- return -1;
- *plen = ireq.i_len;
- return 0;
+ return (lib80211_get80211len(s, name, type, data, len, plen));
}
static int
get80211val(int s, int type, int *val)
{
- struct ieee80211req ireq;
- (void) memset(&ireq, 0, sizeof(ireq));
- (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
- ireq.i_type = type;
- if (ioctl(s, SIOCG80211, &ireq) < 0)
- return -1;
- *val = ireq.i_val;
- return 0;
+ return (lib80211_get80211val(s, name, type, val));
}
static void
set80211(int s, int type, int val, int len, void *data)
{
- struct ieee80211req ireq;
+ int ret;
- (void) memset(&ireq, 0, sizeof(ireq));
- (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
- ireq.i_type = type;
- ireq.i_val = val;
- ireq.i_len = len;
- assert(ireq.i_len == len); /* NB: check for 16-bit truncation */
- ireq.i_data = data;
- if (ioctl(s, SIOCS80211, &ireq) < 0)
+ ret = lib80211_set80211(s, name, type, val, len, data);
+ if (ret < 0)
err(1, "SIOCS80211");
}
diff --git a/sbin/ipf/Makefile.inc b/sbin/ipf/Makefile.inc
index 79bdb8e..c4c44be 100644
--- a/sbin/ipf/Makefile.inc
+++ b/sbin/ipf/Makefile.inc
@@ -18,7 +18,9 @@ CFLAGS+= -DUSE_INET6
CFLAGS+= -DNOINET6
.endif
+.if ${.CURDIR:M*/libipf} == ""
LIBADD+= ipf
+.endif
CLEANFILES+= y.tab.c y.tab.h
diff --git a/sbin/ipf/ipf/Makefile.depend b/sbin/ipf/ipf/Makefile.depend
index 4eb9aad..36b066e 100644
--- a/sbin/ipf/ipf/Makefile.depend
+++ b/sbin/ipf/ipf/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
lib/libpcap \
sbin/ipf/libipf \
diff --git a/sbin/ipf/ipfs/Makefile.depend b/sbin/ipf/ipfs/Makefile.depend
index baac233..6773fa2 100644
--- a/sbin/ipf/ipfs/Makefile.depend
+++ b/sbin/ipf/ipfs/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
sbin/ipf/libipf \
diff --git a/sbin/ipf/ipfstat/Makefile.depend b/sbin/ipf/ipfstat/Makefile.depend
index 9efa7cf..8f5d6f7 100644
--- a/sbin/ipf/ipfstat/Makefile.depend
+++ b/sbin/ipf/ipfstat/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
lib/ncurses/ncursesw \
sbin/ipf/libipf \
diff --git a/sbin/ipf/ipftest/Makefile.depend b/sbin/ipf/ipftest/Makefile.depend
index a62aee2..73f6c41 100644
--- a/sbin/ipf/ipftest/Makefile.depend
+++ b/sbin/ipf/ipftest/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
sbin/ipf/libipf \
usr.bin/yacc.host \
diff --git a/sbin/ipf/ipmon/Makefile.depend b/sbin/ipf/ipmon/Makefile.depend
index 5bdb549..c33fe27 100644
--- a/sbin/ipf/ipmon/Makefile.depend
+++ b/sbin/ipf/ipmon/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
sbin/ipf/libipf \
usr.bin/yacc.host \
diff --git a/sbin/ipf/ipnat/Makefile.depend b/sbin/ipf/ipnat/Makefile.depend
index 1bbd418..ea17231 100644
--- a/sbin/ipf/ipnat/Makefile.depend
+++ b/sbin/ipf/ipnat/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
sbin/ipf/libipf \
usr.bin/yacc.host \
diff --git a/sbin/ipf/ippool/Makefile.depend b/sbin/ipf/ippool/Makefile.depend
index cc3cf4d..bc6ba75 100644
--- a/sbin/ipf/ippool/Makefile.depend
+++ b/sbin/ipf/ippool/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
sbin/ipf/libipf \
usr.bin/yacc.host \
diff --git a/sbin/ipf/ipresend/Makefile.depend b/sbin/ipf/ipresend/Makefile.depend
index 9e0787f..6795d2c 100644
--- a/sbin/ipf/ipresend/Makefile.depend
+++ b/sbin/ipf/ipresend/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
lib/msun \
sbin/ipf/libipf \
diff --git a/sbin/ipf/libipf/Makefile b/sbin/ipf/libipf/Makefile
index 077062f..7a7a011 100644
--- a/sbin/ipf/libipf/Makefile
+++ b/sbin/ipf/libipf/Makefile
@@ -43,4 +43,6 @@ SRCS= addicmp.c addipopt.c alist_free.c alist_new.c allocmbt.c \
tcp_flags.c tcpflags.c tcpoptnames.c v6ionames.c v6optvalue.c \
var.c verbose.c
+LIBADD= kvm
+
.include <bsd.lib.mk>
diff --git a/sbin/nandfs/Makefile.depend b/sbin/nandfs/Makefile.depend
new file mode 100644
index 0000000..b17f6d6
--- /dev/null
+++ b/sbin/nandfs/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libnandfs \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sbin/newfs_msdos/mkfs_msdos.c b/sbin/newfs_msdos/mkfs_msdos.c
index 7978b06..b14896d 100644
--- a/sbin/newfs_msdos/mkfs_msdos.c
+++ b/sbin/newfs_msdos/mkfs_msdos.c
@@ -223,8 +223,8 @@ static void mklabel(u_int8_t *, const char *);
static int oklabel(const char *);
static void setstr(u_int8_t *, const char *, size_t);
-int mkfs_msdos(const char *fname, const char *dtype,
- const struct msdos_options *op)
+int
+mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
{
char buf[MAXPATHLEN];
struct sigaction si_sa;
@@ -245,6 +245,10 @@ int mkfs_msdos(const char *fname, const char *dtype,
int fd, fd1;
struct msdos_options o = *op;
+ if (o.block_size && o.sectors_per_cluster) {
+ warnx("Cannot specify both block size and sectors per cluster");
+ return -1;
+ }
if (o.OEM_string && strlen(o.OEM_string) > 8) {
warnx("%s: bad OEM string", o.OEM_string);
return -1;
@@ -304,7 +308,8 @@ int mkfs_msdos(const char *fname, const char *dtype,
bpb.bpbHugeSectors = o.size;
if (o.hidden_sectors_set)
bpb.bpbHiddenSecs = o.hidden_sectors;
- if (!(o.floppy || (o.drive_heads && o.sectors_per_track && o.bytes_per_sector && o.size && o.hidden_sectors_set))) {
+ if (!(o.floppy || (o.drive_heads && o.sectors_per_track &&
+ o.bytes_per_sector && o.size && o.hidden_sectors_set))) {
off_t delta;
getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb);
bpb.bpbHugeSectors -= (o.offset / bpb.bpbBytesPerSec);
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index d84f706..0d3340d 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -235,31 +235,18 @@ argtooff(const char *arg, const char *msg)
static void
usage(void)
{
- fprintf(stderr,
- "usage: newfs_msdos [ -options ] special [disktype]\n"
- "where the options are:\n"
- "\t-@ create file system at specified offset\n"
- "\t-B get bootstrap from file\n"
- "\t-C create image file with specified size\n"
- "\t-F FAT type (12, 16, or 32)\n"
- "\t-I volume ID\n"
- "\t-L volume label\n"
- "\t-N don't create file system: just print out parameters\n"
- "\t-O OEM string\n"
- "\t-S bytes/sector\n"
- "\t-a sectors/FAT\n"
- "\t-b block size\n"
- "\t-c sectors/cluster\n"
- "\t-e root directory entries\n"
- "\t-f standard format\n"
- "\t-h drive heads\n"
- "\t-i file system info sector\n"
- "\t-k backup boot sector\n"
- "\t-m media descriptor\n"
- "\t-n number of FATs\n"
- "\t-o hidden sectors\n"
- "\t-r reserved sectors\n"
- "\t-s file system size (sectors)\n"
- "\t-u sectors/track\n");
- exit(1);
+ fprintf(stderr,
+ "usage: %s [ -options ] special [disktype]\n", getprogname());
+ fprintf(stderr, "where the options are:\n");
+static struct {
+ char o;
+ const char *h;
+} opts[] = {
+#define AOPT(_opt, _type, _name, _min, _desc) { _opt, _desc },
+ALLOPTS
+#undef AOPT
+ };
+ for (size_t i = 0; i < nitems(opts); i++)
+ fprintf(stderr, "\t-%c %s\n", opts[i].o, opts[i].h);
+ exit(1);
}
diff --git a/sbin/newfs_nandfs/Makefile.depend b/sbin/newfs_nandfs/Makefile.depend
new file mode 100644
index 0000000..851372c
--- /dev/null
+++ b/sbin/newfs_nandfs/Makefile.depend
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/libgeom \
+ lib/libsbuf \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sbin/routed/Makefile.depend b/sbin/routed/Makefile.depend
index d734286..1dd2697 100644
--- a/sbin/routed/Makefile.depend
+++ b/sbin/routed/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/arpa \
@@ -9,6 +10,7 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
lib/libmd \
diff --git a/sbin/savecore/savecore.8 b/sbin/savecore/savecore.8
index c7d7e95..af46d05 100644
--- a/sbin/savecore/savecore.8
+++ b/sbin/savecore/savecore.8
@@ -28,7 +28,7 @@
.\" From: @(#)savecore.8 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd December 17, 2012
+.Dd December 1, 2015
.Dt SAVECORE 8
.Os
.Sh NAME
@@ -44,6 +44,7 @@
.Op Fl v
.Op Ar device ...
.Nm
+.Op Fl -libxo
.Op Fl fkvz
.Op Fl m Ar maxdumps
.Op Ar directory Op Ar device ...
@@ -61,6 +62,13 @@ the system log.
.Pp
The options are as follows:
.Bl -tag -width ".Fl m Ar maxdumps"
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl C
Check to see if a dump exists,
and display a brief message to indicate the status.
@@ -154,6 +162,8 @@ is meant to be called near the end of the initialization file
.Sh SEE ALSO
.Xr gzip 1 ,
.Xr getbootfile 3 ,
+.Xr libxo 3 ,
+.Xr xo_parse_args 3 ,
.Xr textdump 4 ,
.Xr tar 5 ,
.Xr dumpon 8 ,
diff --git a/secure/lib/libcrypto/Makefile.inc b/secure/lib/libcrypto/Makefile.inc
index 8f41603..2eb862f 100644
--- a/secure/lib/libcrypto/Makefile.inc
+++ b/secure/lib/libcrypto/Makefile.inc
@@ -3,8 +3,8 @@
.include <bsd.own.mk>
# OpenSSL version used for manual page generation
-OPENSSL_VER= 1.0.2d
-OPENSSL_DATE= 2015-07-09
+OPENSSL_VER= 1.0.2e
+OPENSSL_DATE= 2015-12-03
LCRYPTO_SRC= ${.CURDIR}/../../../crypto/openssl
LCRYPTO_DOC= ${LCRYPTO_SRC}/doc
diff --git a/secure/lib/libcrypto/Makefile.man b/secure/lib/libcrypto/Makefile.man
index 8a55ce5..cdf4918 100644
--- a/secure/lib/libcrypto/Makefile.man
+++ b/secure/lib/libcrypto/Makefile.man
@@ -769,6 +769,7 @@ MLINKS+= EVP_PKEY_verify.3 EVP_PKEY_verify_init.3
MLINKS+= EVP_PKEY_verify_recover.3 EVP_PKEY_verify_recover_init.3
MLINKS+= EVP_SealInit.3 EVP_SealUpdate.3
MLINKS+= EVP_SealInit.3 EVP_SealFinal.3
+MLINKS+= EVP_SignInit.3 EVP_SignInit_ex.3
MLINKS+= EVP_SignInit.3 EVP_SignUpdate.3
MLINKS+= EVP_SignInit.3 EVP_SignFinal.3
MLINKS+= EVP_VerifyInit.3 EVP_VerifyUpdate.3
@@ -933,9 +934,14 @@ MLINKS+= bn_internal.3 bn_set_max.3
MLINKS+= bn_internal.3 bn_set_high.3
MLINKS+= bn_internal.3 bn_set_low.3
MLINKS+= buffer.3 BUF_MEM_new.3
+MLINKS+= buffer.3 BUF_MEM_new_ex.3
MLINKS+= buffer.3 BUF_MEM_free.3
MLINKS+= buffer.3 BUF_MEM_grow.3
MLINKS+= buffer.3 BUF_strdup.3
+MLINKS+= buffer.3 BUF_strndup.3
+MLINKS+= buffer.3 BUF_memdup.3
+MLINKS+= buffer.3 BUF_strlcpy.3
+MLINKS+= buffer.3 BUF_strlcat.3
MLINKS+= d2i_ASN1_OBJECT.3 i2d_ASN1_OBJECT.3
MLINKS+= d2i_CMS_ContentInfo.3 i2d_CMS_ContentInfo.3
MLINKS+= d2i_DHparams.3 i2d_DHparams.3
diff --git a/secure/lib/libcrypto/amd64/x86_64-mont5.S b/secure/lib/libcrypto/amd64/x86_64-mont5.S
index 6ab0922..19162e8 100644
--- a/secure/lib/libcrypto/amd64/x86_64-mont5.S
+++ b/secure/lib/libcrypto/amd64/x86_64-mont5.S
@@ -1558,6 +1558,15 @@ sqr8x_reduction:
.align 32
.L8x_tail_done:
addq (%rdx),%r8
+ adcq $0,%r9
+ adcq $0,%r10
+ adcq $0,%r11
+ adcq $0,%r12
+ adcq $0,%r13
+ adcq $0,%r14
+ adcq $0,%r15
+
+
xorq %rax,%rax
negq %rsi
diff --git a/secure/lib/libcrypto/engines/libcapi/Makefile.depend b/secure/lib/libcrypto/engines/libcapi/Makefile.depend
new file mode 100644
index 0000000..fc0b633
--- /dev/null
+++ b/secure/lib/libcrypto/engines/libcapi/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ secure/lib/libcrypto \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 b/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
index 2b7ff89..67e7e48 100644
--- a/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
+++ b/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_OBJECT_new 3"
-.TH ASN1_OBJECT_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ASN1_OBJECT_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_length.3 b/secure/lib/libcrypto/man/ASN1_STRING_length.3
index fe95425..e2eb45c 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_length.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_length.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_length 3"
-.TH ASN1_STRING_length 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ASN1_STRING_length 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_new.3 b/secure/lib/libcrypto/man/ASN1_STRING_new.3
index 3d24f4a..f0c2c0a 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_new.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_new 3"
-.TH ASN1_STRING_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ASN1_STRING_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 b/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
index 037a498..cc97d99 100644
--- a/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
+++ b/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_STRING_print_ex 3"
-.TH ASN1_STRING_print_ex 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ASN1_STRING_print_ex 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_TIME_set.3 b/secure/lib/libcrypto/man/ASN1_TIME_set.3
index 8ac876b..a733969 100644
--- a/secure/lib/libcrypto/man/ASN1_TIME_set.3
+++ b/secure/lib/libcrypto/man/ASN1_TIME_set.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_TIME_set 3"
-.TH ASN1_TIME_set 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ASN1_TIME_set 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ASN1_generate_nconf.3 b/secure/lib/libcrypto/man/ASN1_generate_nconf.3
index 7149547..37f279d 100644
--- a/secure/lib/libcrypto/man/ASN1_generate_nconf.3
+++ b/secure/lib/libcrypto/man/ASN1_generate_nconf.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1_generate_nconf 3"
-.TH ASN1_generate_nconf 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ASN1_generate_nconf 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_ctrl.3 b/secure/lib/libcrypto/man/BIO_ctrl.3
index a4b3691..784d307 100644
--- a/secure/lib/libcrypto/man/BIO_ctrl.3
+++ b/secure/lib/libcrypto/man/BIO_ctrl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_ctrl 3"
-.TH BIO_ctrl 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_ctrl 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_base64.3 b/secure/lib/libcrypto/man/BIO_f_base64.3
index 1678773..fb804bd 100644
--- a/secure/lib/libcrypto/man/BIO_f_base64.3
+++ b/secure/lib/libcrypto/man/BIO_f_base64.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_base64 3"
-.TH BIO_f_base64 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_f_base64 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_buffer.3 b/secure/lib/libcrypto/man/BIO_f_buffer.3
index 022f6ac..ace920f 100644
--- a/secure/lib/libcrypto/man/BIO_f_buffer.3
+++ b/secure/lib/libcrypto/man/BIO_f_buffer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_buffer 3"
-.TH BIO_f_buffer 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_f_buffer 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_cipher.3 b/secure/lib/libcrypto/man/BIO_f_cipher.3
index 2ae0f3e..46aa9aa 100644
--- a/secure/lib/libcrypto/man/BIO_f_cipher.3
+++ b/secure/lib/libcrypto/man/BIO_f_cipher.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_cipher 3"
-.TH BIO_f_cipher 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_f_cipher 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_md.3 b/secure/lib/libcrypto/man/BIO_f_md.3
index ae83639..39688fb 100644
--- a/secure/lib/libcrypto/man/BIO_f_md.3
+++ b/secure/lib/libcrypto/man/BIO_f_md.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_md 3"
-.TH BIO_f_md 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_f_md 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_null.3 b/secure/lib/libcrypto/man/BIO_f_null.3
index f877a0a..6fbb010 100644
--- a/secure/lib/libcrypto/man/BIO_f_null.3
+++ b/secure/lib/libcrypto/man/BIO_f_null.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_null 3"
-.TH BIO_f_null 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_f_null 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_f_ssl.3 b/secure/lib/libcrypto/man/BIO_f_ssl.3
index 84c8510..6bed4fe 100644
--- a/secure/lib/libcrypto/man/BIO_f_ssl.3
+++ b/secure/lib/libcrypto/man/BIO_f_ssl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_f_ssl 3"
-.TH BIO_f_ssl 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_f_ssl 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_find_type.3 b/secure/lib/libcrypto/man/BIO_find_type.3
index 04876c1..0ad3bb4 100644
--- a/secure/lib/libcrypto/man/BIO_find_type.3
+++ b/secure/lib/libcrypto/man/BIO_find_type.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_find_type 3"
-.TH BIO_find_type 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_find_type 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_new.3 b/secure/lib/libcrypto/man/BIO_new.3
index 75a8a0b..dc11b30 100644
--- a/secure/lib/libcrypto/man/BIO_new.3
+++ b/secure/lib/libcrypto/man/BIO_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_new 3"
-.TH BIO_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_new_CMS.3 b/secure/lib/libcrypto/man/BIO_new_CMS.3
index e30e9ab..2b4c7a3 100644
--- a/secure/lib/libcrypto/man/BIO_new_CMS.3
+++ b/secure/lib/libcrypto/man/BIO_new_CMS.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_new_CMS 3"
-.TH BIO_new_CMS 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_new_CMS 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_push.3 b/secure/lib/libcrypto/man/BIO_push.3
index e7943c4..d9e132a 100644
--- a/secure/lib/libcrypto/man/BIO_push.3
+++ b/secure/lib/libcrypto/man/BIO_push.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_push 3"
-.TH BIO_push 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_push 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_read.3 b/secure/lib/libcrypto/man/BIO_read.3
index 9267591..54a9974 100644
--- a/secure/lib/libcrypto/man/BIO_read.3
+++ b/secure/lib/libcrypto/man/BIO_read.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_read 3"
-.TH BIO_read 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_read 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -146,9 +146,9 @@ BIO_read, BIO_write, BIO_gets, BIO_puts \- BIO I/O functions
\& #include <openssl/bio.h>
\&
\& int BIO_read(BIO *b, void *buf, int len);
-\& int BIO_gets(BIO *b,char *buf, int size);
+\& int BIO_gets(BIO *b, char *buf, int size);
\& int BIO_write(BIO *b, const void *buf, int len);
-\& int BIO_puts(BIO *b,const char *buf);
+\& int BIO_puts(BIO *b, const char *buf);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
@@ -163,7 +163,7 @@ return the digest and other BIOs may not support \fIBIO_gets()\fR at all.
.PP
\&\fIBIO_write()\fR attempts to write \fBlen\fR bytes from \fBbuf\fR to \s-1BIO \s0\fBb\fR.
.PP
-\&\fIBIO_puts()\fR attempts to write a null terminated string \fBbuf\fR to \s-1BIO \s0\fBb\fR
+\&\fIBIO_puts()\fR attempts to write a null terminated string \fBbuf\fR to \s-1BIO \s0\fBb\fR.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
All these functions return either the amount of data successfully read or
diff --git a/secure/lib/libcrypto/man/BIO_s_accept.3 b/secure/lib/libcrypto/man/BIO_s_accept.3
index fd084f5..8dfb127 100644
--- a/secure/lib/libcrypto/man/BIO_s_accept.3
+++ b/secure/lib/libcrypto/man/BIO_s_accept.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_accept 3"
-.TH BIO_s_accept 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_accept 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_bio.3 b/secure/lib/libcrypto/man/BIO_s_bio.3
index cb0f399..a94fbfd 100644
--- a/secure/lib/libcrypto/man/BIO_s_bio.3
+++ b/secure/lib/libcrypto/man/BIO_s_bio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_bio 3"
-.TH BIO_s_bio 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_bio 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_connect.3 b/secure/lib/libcrypto/man/BIO_s_connect.3
index f4f5010..8e545f9 100644
--- a/secure/lib/libcrypto/man/BIO_s_connect.3
+++ b/secure/lib/libcrypto/man/BIO_s_connect.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_connect 3"
-.TH BIO_s_connect 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_connect 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_fd.3 b/secure/lib/libcrypto/man/BIO_s_fd.3
index f5e6d03..e606e74 100644
--- a/secure/lib/libcrypto/man/BIO_s_fd.3
+++ b/secure/lib/libcrypto/man/BIO_s_fd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_fd 3"
-.TH BIO_s_fd 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_fd 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_file.3 b/secure/lib/libcrypto/man/BIO_s_file.3
index 63d1ef5..0923f56 100644
--- a/secure/lib/libcrypto/man/BIO_s_file.3
+++ b/secure/lib/libcrypto/man/BIO_s_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_file 3"
-.TH BIO_s_file 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_file 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_mem.3 b/secure/lib/libcrypto/man/BIO_s_mem.3
index 1908fdb..cc1131e 100644
--- a/secure/lib/libcrypto/man/BIO_s_mem.3
+++ b/secure/lib/libcrypto/man/BIO_s_mem.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_mem 3"
-.TH BIO_s_mem 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_mem 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_null.3 b/secure/lib/libcrypto/man/BIO_s_null.3
index dd2857b..0bc54c6 100644
--- a/secure/lib/libcrypto/man/BIO_s_null.3
+++ b/secure/lib/libcrypto/man/BIO_s_null.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_null 3"
-.TH BIO_s_null 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_null 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_s_socket.3 b/secure/lib/libcrypto/man/BIO_s_socket.3
index 01d9f44..c425266 100644
--- a/secure/lib/libcrypto/man/BIO_s_socket.3
+++ b/secure/lib/libcrypto/man/BIO_s_socket.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_s_socket 3"
-.TH BIO_s_socket 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_s_socket 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_set_callback.3 b/secure/lib/libcrypto/man/BIO_set_callback.3
index 2b0b4db..59a7d97 100644
--- a/secure/lib/libcrypto/man/BIO_set_callback.3
+++ b/secure/lib/libcrypto/man/BIO_set_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_set_callback 3"
-.TH BIO_set_callback 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_set_callback 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BIO_should_retry.3 b/secure/lib/libcrypto/man/BIO_should_retry.3
index f9563754..fc3aead 100644
--- a/secure/lib/libcrypto/man/BIO_should_retry.3
+++ b/secure/lib/libcrypto/man/BIO_should_retry.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BIO_should_retry 3"
-.TH BIO_should_retry 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BIO_should_retry 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_BLINDING_new.3 b/secure/lib/libcrypto/man/BN_BLINDING_new.3
index 025f834..4029d06 100644
--- a/secure/lib/libcrypto/man/BN_BLINDING_new.3
+++ b/secure/lib/libcrypto/man/BN_BLINDING_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_BLINDING_new 3"
-.TH BN_BLINDING_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_BLINDING_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_CTX_new.3 b/secure/lib/libcrypto/man/BN_CTX_new.3
index f2f61e9..f3424a2 100644
--- a/secure/lib/libcrypto/man/BN_CTX_new.3
+++ b/secure/lib/libcrypto/man/BN_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_CTX_new 3"
-.TH BN_CTX_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_CTX_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_CTX_start.3 b/secure/lib/libcrypto/man/BN_CTX_start.3
index f630a0f..e61bec2 100644
--- a/secure/lib/libcrypto/man/BN_CTX_start.3
+++ b/secure/lib/libcrypto/man/BN_CTX_start.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_CTX_start 3"
-.TH BN_CTX_start 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_CTX_start 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_add.3 b/secure/lib/libcrypto/man/BN_add.3
index 75a2a5c..adbfe1f 100644
--- a/secure/lib/libcrypto/man/BN_add.3
+++ b/secure/lib/libcrypto/man/BN_add.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_add 3"
-.TH BN_add 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_add 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_add_word.3 b/secure/lib/libcrypto/man/BN_add_word.3
index c00d9f4..1180231 100644
--- a/secure/lib/libcrypto/man/BN_add_word.3
+++ b/secure/lib/libcrypto/man/BN_add_word.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_add_word 3"
-.TH BN_add_word 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_add_word 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_bn2bin.3 b/secure/lib/libcrypto/man/BN_bn2bin.3
index 4f94150..318afe6 100644
--- a/secure/lib/libcrypto/man/BN_bn2bin.3
+++ b/secure/lib/libcrypto/man/BN_bn2bin.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_bn2bin 3"
-.TH BN_bn2bin 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_bn2bin 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_cmp.3 b/secure/lib/libcrypto/man/BN_cmp.3
index c9f5a68..1fe36bb 100644
--- a/secure/lib/libcrypto/man/BN_cmp.3
+++ b/secure/lib/libcrypto/man/BN_cmp.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_cmp 3"
-.TH BN_cmp 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_cmp 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_copy.3 b/secure/lib/libcrypto/man/BN_copy.3
index 4fb3a8a..e90cb65 100644
--- a/secure/lib/libcrypto/man/BN_copy.3
+++ b/secure/lib/libcrypto/man/BN_copy.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_copy 3"
-.TH BN_copy 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_copy 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_generate_prime.3 b/secure/lib/libcrypto/man/BN_generate_prime.3
index f27e165..7b30f6e 100644
--- a/secure/lib/libcrypto/man/BN_generate_prime.3
+++ b/secure/lib/libcrypto/man/BN_generate_prime.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_generate_prime 3"
-.TH BN_generate_prime 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_generate_prime 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_inverse.3 b/secure/lib/libcrypto/man/BN_mod_inverse.3
index 7562fea..360547a 100644
--- a/secure/lib/libcrypto/man/BN_mod_inverse.3
+++ b/secure/lib/libcrypto/man/BN_mod_inverse.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_inverse 3"
-.TH BN_mod_inverse 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_mod_inverse 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 b/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
index 5663241..89e295b 100644
--- a/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
+++ b/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_mul_montgomery 3"
-.TH BN_mod_mul_montgomery 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_mod_mul_montgomery 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 b/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
index 1e518cf..a486c2b 100644
--- a/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
+++ b/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_mod_mul_reciprocal 3"
-.TH BN_mod_mul_reciprocal 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_mod_mul_reciprocal 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_new.3 b/secure/lib/libcrypto/man/BN_new.3
index 553bad9..ccedaa8 100644
--- a/secure/lib/libcrypto/man/BN_new.3
+++ b/secure/lib/libcrypto/man/BN_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_new 3"
-.TH BN_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_num_bytes.3 b/secure/lib/libcrypto/man/BN_num_bytes.3
index c9ea90f..fa1407e 100644
--- a/secure/lib/libcrypto/man/BN_num_bytes.3
+++ b/secure/lib/libcrypto/man/BN_num_bytes.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_num_bytes 3"
-.TH BN_num_bytes 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_num_bytes 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_rand.3 b/secure/lib/libcrypto/man/BN_rand.3
index aa365bb..26837ae 100644
--- a/secure/lib/libcrypto/man/BN_rand.3
+++ b/secure/lib/libcrypto/man/BN_rand.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_rand 3"
-.TH BN_rand 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_rand 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -156,7 +156,7 @@ BN_rand, BN_pseudo_rand, BN_rand_range, BN_pseudo_rand_range \- generate pseudo\
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fIBN_rand()\fR generates a cryptographically strong pseudo-random number of
-\&\fBbits\fR bits in length and stores it in \fBrnd\fR. If \fBtop\fR is \-1, the
+\&\fBbits\fR in length and stores it in \fBrnd\fR. If \fBtop\fR is \-1, the
most significant bit of the random number can be zero. If \fBtop\fR is 0,
it is set to 1, and if \fBtop\fR is 1, the two most significant bits of
the number will be set to 1, so that the product of two such random
@@ -170,7 +170,7 @@ non-cryptographic purposes and for certain purposes in cryptographic
protocols, but usually not for key generation etc.
.PP
\&\fIBN_rand_range()\fR generates a cryptographically strong pseudo-random
-number \fBrnd\fR in the range 0 <lt>= \fBrnd\fR < \fBrange\fR.
+number \fBrnd\fR in the range 0 <= \fBrnd\fR < \fBrange\fR.
\&\fIBN_pseudo_rand_range()\fR does the same, but is based on \fIBN_pseudo_rand()\fR,
and hence numbers generated by it are not necessarily unpredictable.
.PP
diff --git a/secure/lib/libcrypto/man/BN_set_bit.3 b/secure/lib/libcrypto/man/BN_set_bit.3
index 7f62476..75c6ce7 100644
--- a/secure/lib/libcrypto/man/BN_set_bit.3
+++ b/secure/lib/libcrypto/man/BN_set_bit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_set_bit 3"
-.TH BN_set_bit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_set_bit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_swap.3 b/secure/lib/libcrypto/man/BN_swap.3
index 2a32dd8..fceba7f 100644
--- a/secure/lib/libcrypto/man/BN_swap.3
+++ b/secure/lib/libcrypto/man/BN_swap.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_swap 3"
-.TH BN_swap 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_swap 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/BN_zero.3 b/secure/lib/libcrypto/man/BN_zero.3
index 51a71bb..a3ede14 100644
--- a/secure/lib/libcrypto/man/BN_zero.3
+++ b/secure/lib/libcrypto/man/BN_zero.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "BN_zero 3"
-.TH BN_zero 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH BN_zero 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add0_cert.3 b/secure/lib/libcrypto/man/CMS_add0_cert.3
index 155e9e3..0835fd8 100644
--- a/secure/lib/libcrypto/man/CMS_add0_cert.3
+++ b/secure/lib/libcrypto/man/CMS_add0_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add0_cert 3"
-.TH CMS_add0_cert 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_add0_cert 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 b/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
index 9e1d3b2..23b9801 100644
--- a/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
+++ b/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add1_recipient_cert 3"
-.TH CMS_add1_recipient_cert 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_add1_recipient_cert 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_add1_signer.3 b/secure/lib/libcrypto/man/CMS_add1_signer.3
index 5729bbc..7183e28 100644
--- a/secure/lib/libcrypto/man/CMS_add1_signer.3
+++ b/secure/lib/libcrypto/man/CMS_add1_signer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_add1_signer 3"
-.TH CMS_add1_signer 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_add1_signer 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_compress.3 b/secure/lib/libcrypto/man/CMS_compress.3
index fc29407..7ae678e 100644
--- a/secure/lib/libcrypto/man/CMS_compress.3
+++ b/secure/lib/libcrypto/man/CMS_compress.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_compress 3"
-.TH CMS_compress 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_compress 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_decrypt.3 b/secure/lib/libcrypto/man/CMS_decrypt.3
index 36e24fe..205144b 100644
--- a/secure/lib/libcrypto/man/CMS_decrypt.3
+++ b/secure/lib/libcrypto/man/CMS_decrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_decrypt 3"
-.TH CMS_decrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_decrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_encrypt.3 b/secure/lib/libcrypto/man/CMS_encrypt.3
index 34faa80..8fd3af8 100644
--- a/secure/lib/libcrypto/man/CMS_encrypt.3
+++ b/secure/lib/libcrypto/man/CMS_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_encrypt 3"
-.TH CMS_encrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_encrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_final.3 b/secure/lib/libcrypto/man/CMS_final.3
index a2b986b..340bead 100644
--- a/secure/lib/libcrypto/man/CMS_final.3
+++ b/secure/lib/libcrypto/man/CMS_final.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_final 3"
-.TH CMS_final 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_final 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 b/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
index 6945fe4..931a88d 100644
--- a/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
+++ b/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_RecipientInfos 3"
-.TH CMS_get0_RecipientInfos 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_get0_RecipientInfos 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 b/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
index 364fa87..160057e 100644
--- a/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
+++ b/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_SignerInfos 3"
-.TH CMS_get0_SignerInfos 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_get0_SignerInfos 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get0_type.3 b/secure/lib/libcrypto/man/CMS_get0_type.3
index 2d552c2..dc32afc 100644
--- a/secure/lib/libcrypto/man/CMS_get0_type.3
+++ b/secure/lib/libcrypto/man/CMS_get0_type.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get0_type 3"
-.TH CMS_get0_type 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_get0_type 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 b/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
index 14bc08b..e6c7788 100644
--- a/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
+++ b/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_get1_ReceiptRequest 3"
-.TH CMS_get1_ReceiptRequest 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_get1_ReceiptRequest 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_sign.3 b/secure/lib/libcrypto/man/CMS_sign.3
index 133362e..bb0be5e 100644
--- a/secure/lib/libcrypto/man/CMS_sign.3
+++ b/secure/lib/libcrypto/man/CMS_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_sign 3"
-.TH CMS_sign 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_sign 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_sign_receipt.3 b/secure/lib/libcrypto/man/CMS_sign_receipt.3
index f757976..6311b4a 100644
--- a/secure/lib/libcrypto/man/CMS_sign_receipt.3
+++ b/secure/lib/libcrypto/man/CMS_sign_receipt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_sign_receipt 3"
-.TH CMS_sign_receipt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_sign_receipt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_uncompress.3 b/secure/lib/libcrypto/man/CMS_uncompress.3
index 4a75752..289e138 100644
--- a/secure/lib/libcrypto/man/CMS_uncompress.3
+++ b/secure/lib/libcrypto/man/CMS_uncompress.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_uncompress 3"
-.TH CMS_uncompress 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_uncompress 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_verify.3 b/secure/lib/libcrypto/man/CMS_verify.3
index 7572718..52a45cd 100644
--- a/secure/lib/libcrypto/man/CMS_verify.3
+++ b/secure/lib/libcrypto/man/CMS_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_verify 3"
-.TH CMS_verify 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_verify 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CMS_verify_receipt.3 b/secure/lib/libcrypto/man/CMS_verify_receipt.3
index f941405..fd9b988 100644
--- a/secure/lib/libcrypto/man/CMS_verify_receipt.3
+++ b/secure/lib/libcrypto/man/CMS_verify_receipt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS_verify_receipt 3"
-.TH CMS_verify_receipt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS_verify_receipt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CONF_modules_free.3 b/secure/lib/libcrypto/man/CONF_modules_free.3
index 3ed0b47..7d1415b 100644
--- a/secure/lib/libcrypto/man/CONF_modules_free.3
+++ b/secure/lib/libcrypto/man/CONF_modules_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CONF_modules_free 3"
-.TH CONF_modules_free 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CONF_modules_free 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CONF_modules_load_file.3 b/secure/lib/libcrypto/man/CONF_modules_load_file.3
index c5be2a2..c83ecbe 100644
--- a/secure/lib/libcrypto/man/CONF_modules_load_file.3
+++ b/secure/lib/libcrypto/man/CONF_modules_load_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CONF_modules_load_file 3"
-.TH CONF_modules_load_file 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CONF_modules_load_file 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 b/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
index 0df3708..38c95e5 100644
--- a/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
+++ b/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRYPTO_set_ex_data 3"
-.TH CRYPTO_set_ex_data 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CRYPTO_set_ex_data 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_generate_key.3 b/secure/lib/libcrypto/man/DH_generate_key.3
index db22819..cf99604 100644
--- a/secure/lib/libcrypto/man/DH_generate_key.3
+++ b/secure/lib/libcrypto/man/DH_generate_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_generate_key 3"
-.TH DH_generate_key 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DH_generate_key 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_generate_parameters.3 b/secure/lib/libcrypto/man/DH_generate_parameters.3
index f4dd262e..a6e5964 100644
--- a/secure/lib/libcrypto/man/DH_generate_parameters.3
+++ b/secure/lib/libcrypto/man/DH_generate_parameters.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_generate_parameters 3"
-.TH DH_generate_parameters 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DH_generate_parameters 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_get_ex_new_index.3 b/secure/lib/libcrypto/man/DH_get_ex_new_index.3
index b1b57c7..7f8afb7 100644
--- a/secure/lib/libcrypto/man/DH_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/DH_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_get_ex_new_index 3"
-.TH DH_get_ex_new_index 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DH_get_ex_new_index 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_new.3 b/secure/lib/libcrypto/man/DH_new.3
index 7d29964..13f05d7 100644
--- a/secure/lib/libcrypto/man/DH_new.3
+++ b/secure/lib/libcrypto/man/DH_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_new 3"
-.TH DH_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DH_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_set_method.3 b/secure/lib/libcrypto/man/DH_set_method.3
index 2032e91..1f7646a 100644
--- a/secure/lib/libcrypto/man/DH_set_method.3
+++ b/secure/lib/libcrypto/man/DH_set_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_set_method 3"
-.TH DH_set_method 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DH_set_method 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DH_size.3 b/secure/lib/libcrypto/man/DH_size.3
index 388e335..e47d1f2 100644
--- a/secure/lib/libcrypto/man/DH_size.3
+++ b/secure/lib/libcrypto/man/DH_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DH_size 3"
-.TH DH_size 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DH_size 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_SIG_new.3 b/secure/lib/libcrypto/man/DSA_SIG_new.3
index 7c32203..701cd77 100644
--- a/secure/lib/libcrypto/man/DSA_SIG_new.3
+++ b/secure/lib/libcrypto/man/DSA_SIG_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_SIG_new 3"
-.TH DSA_SIG_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_SIG_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_do_sign.3 b/secure/lib/libcrypto/man/DSA_do_sign.3
index 35ee6a6..9fac797 100644
--- a/secure/lib/libcrypto/man/DSA_do_sign.3
+++ b/secure/lib/libcrypto/man/DSA_do_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_do_sign 3"
-.TH DSA_do_sign 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_do_sign 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_dup_DH.3 b/secure/lib/libcrypto/man/DSA_dup_DH.3
index 08e499a..142aa13 100644
--- a/secure/lib/libcrypto/man/DSA_dup_DH.3
+++ b/secure/lib/libcrypto/man/DSA_dup_DH.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_dup_DH 3"
-.TH DSA_dup_DH 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_dup_DH 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_generate_key.3 b/secure/lib/libcrypto/man/DSA_generate_key.3
index f87545f..6f12de9 100644
--- a/secure/lib/libcrypto/man/DSA_generate_key.3
+++ b/secure/lib/libcrypto/man/DSA_generate_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_generate_key 3"
-.TH DSA_generate_key 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_generate_key 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_generate_parameters.3 b/secure/lib/libcrypto/man/DSA_generate_parameters.3
index f41c6b8..7ccc54b 100644
--- a/secure/lib/libcrypto/man/DSA_generate_parameters.3
+++ b/secure/lib/libcrypto/man/DSA_generate_parameters.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_generate_parameters 3"
-.TH DSA_generate_parameters 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_generate_parameters 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -168,7 +168,7 @@ maximum of 1024 bits.
If \fBseed\fR is \fB\s-1NULL\s0\fR or \fBseed_len\fR < 20, the primes will be
generated at random. Otherwise, the seed is used to generate
them. If the given seed does not yield a prime q, a new random
-seed is chosen and placed at \fBseed\fR.
+seed is chosen.
.PP
\&\fIDSA_generate_parameters_ex()\fR places the iteration count in
*\fBcounter_ret\fR and a counter used for finding a generator in
diff --git a/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 b/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
index 6124470..f473de1 100644
--- a/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_get_ex_new_index 3"
-.TH DSA_get_ex_new_index 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_get_ex_new_index 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_new.3 b/secure/lib/libcrypto/man/DSA_new.3
index 9c29d65..e3fe408 100644
--- a/secure/lib/libcrypto/man/DSA_new.3
+++ b/secure/lib/libcrypto/man/DSA_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_new 3"
-.TH DSA_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_set_method.3 b/secure/lib/libcrypto/man/DSA_set_method.3
index 280706d..ba984e0 100644
--- a/secure/lib/libcrypto/man/DSA_set_method.3
+++ b/secure/lib/libcrypto/man/DSA_set_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_set_method 3"
-.TH DSA_set_method 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_set_method 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_sign.3 b/secure/lib/libcrypto/man/DSA_sign.3
index b555ef7..5a018ac 100644
--- a/secure/lib/libcrypto/man/DSA_sign.3
+++ b/secure/lib/libcrypto/man/DSA_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_sign 3"
-.TH DSA_sign 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_sign 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/DSA_size.3 b/secure/lib/libcrypto/man/DSA_size.3
index 3ecdac7..bfc328e 100644
--- a/secure/lib/libcrypto/man/DSA_size.3
+++ b/secure/lib/libcrypto/man/DSA_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA_size 3"
-.TH DSA_size 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA_size 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_GFp_simple_method.3 b/secure/lib/libcrypto/man/EC_GFp_simple_method.3
index 703b27f..89a9b9d 100644
--- a/secure/lib/libcrypto/man/EC_GFp_simple_method.3
+++ b/secure/lib/libcrypto/man/EC_GFp_simple_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_GFp_simple_method 3"
-.TH EC_GFp_simple_method 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EC_GFp_simple_method 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_GROUP_copy.3 b/secure/lib/libcrypto/man/EC_GROUP_copy.3
index 6bed833..19ce288 100644
--- a/secure/lib/libcrypto/man/EC_GROUP_copy.3
+++ b/secure/lib/libcrypto/man/EC_GROUP_copy.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_GROUP_copy 3"
-.TH EC_GROUP_copy 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EC_GROUP_copy 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_GROUP_new.3 b/secure/lib/libcrypto/man/EC_GROUP_new.3
index 583a5d3..b21a561 100644
--- a/secure/lib/libcrypto/man/EC_GROUP_new.3
+++ b/secure/lib/libcrypto/man/EC_GROUP_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_GROUP_new 3"
-.TH EC_GROUP_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EC_GROUP_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_KEY_new.3 b/secure/lib/libcrypto/man/EC_KEY_new.3
index cf0d471..9481b9f 100644
--- a/secure/lib/libcrypto/man/EC_KEY_new.3
+++ b/secure/lib/libcrypto/man/EC_KEY_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_KEY_new 3"
-.TH EC_KEY_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EC_KEY_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -207,8 +207,8 @@ The functions EC_KEY_get0_group, EC_KEY_set_group, EC_KEY_get0_private_key, EC_K
The functions EC_KEY_get_conv_form and EC_KEY_set_conv_form get and set the point_conversion_form for the \fBkey\fR. For a description
of point_conversion_forms please refer to \fIEC_POINT_new\fR\|(3).
.PP
-EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitary additional data specific to the
-elliptic curve scheme being used with the \s-1EC_KEY\s0 object. This data is treated as a \*(L"black box\*(R" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the \fBdata\fR parameter, which must have have associated functions for duplicating, freeing and \*(L"clear_freeing\*(R" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and \*(L"clear_freeing\*(R" the data item must be provided again, and they must be the same as they were when the data item was inserted.
+EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitrary additional data specific to the
+elliptic curve scheme being used with the \s-1EC_KEY\s0 object. This data is treated as a \*(L"black box\*(R" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the \fBdata\fR parameter, which must have associated functions for duplicating, freeing and \*(L"clear_freeing\*(R" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and \*(L"clear_freeing\*(R" the data item must be provided again, and they must be the same as they were when the data item was inserted.
.PP
EC_KEY_set_flags sets the flags in the \fBflags\fR parameter on the \s-1EC_KEY\s0 object. Any flags that are already set are left set. The currently defined standard flags are \s-1EC_FLAG_NON_FIPS_ALLOW\s0 and \s-1EC_FLAG_FIPS_CHECKED.\s0 In addition there is the flag \s-1EC_FLAG_COFACTOR_ECDH\s0 which is specific to \s-1ECDH\s0 and is defined in ecdh.h. EC_KEY_get_flags returns the current flags that are set for this \s-1EC_KEY.\s0 EC_KEY_clear_flags clears the flags indicated by the \fBflags\fR parameter. All other flags are left in their existing state.
.PP
diff --git a/secure/lib/libcrypto/man/EC_POINT_add.3 b/secure/lib/libcrypto/man/EC_POINT_add.3
index 36f1ce1..4947575 100644
--- a/secure/lib/libcrypto/man/EC_POINT_add.3
+++ b/secure/lib/libcrypto/man/EC_POINT_add.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_POINT_add 3"
-.TH EC_POINT_add 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EC_POINT_add 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EC_POINT_new.3 b/secure/lib/libcrypto/man/EC_POINT_new.3
index b28c7c1..16a26e5 100644
--- a/secure/lib/libcrypto/man/EC_POINT_new.3
+++ b/secure/lib/libcrypto/man/EC_POINT_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC_POINT_new 3"
-.TH EC_POINT_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EC_POINT_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_GET_LIB.3 b/secure/lib/libcrypto/man/ERR_GET_LIB.3
index d7eb967..e44b533 100644
--- a/secure/lib/libcrypto/man/ERR_GET_LIB.3
+++ b/secure/lib/libcrypto/man/ERR_GET_LIB.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_GET_LIB 3"
-.TH ERR_GET_LIB 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_GET_LIB 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_clear_error.3 b/secure/lib/libcrypto/man/ERR_clear_error.3
index e98d053..e2e9b3c 100644
--- a/secure/lib/libcrypto/man/ERR_clear_error.3
+++ b/secure/lib/libcrypto/man/ERR_clear_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_clear_error 3"
-.TH ERR_clear_error 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_clear_error 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_error_string.3 b/secure/lib/libcrypto/man/ERR_error_string.3
index 470342a..faa1815 100644
--- a/secure/lib/libcrypto/man/ERR_error_string.3
+++ b/secure/lib/libcrypto/man/ERR_error_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_error_string 3"
-.TH ERR_error_string 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_error_string 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_get_error.3 b/secure/lib/libcrypto/man/ERR_get_error.3
index a6ade52..5f50af2 100644
--- a/secure/lib/libcrypto/man/ERR_get_error.3
+++ b/secure/lib/libcrypto/man/ERR_get_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_get_error 3"
-.TH ERR_get_error 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_get_error 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 b/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
index 9c42a1a..542782f 100644
--- a/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
+++ b/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_load_crypto_strings 3"
-.TH ERR_load_crypto_strings 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_load_crypto_strings 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_load_strings.3 b/secure/lib/libcrypto/man/ERR_load_strings.3
index ea5990d..2c22687 100644
--- a/secure/lib/libcrypto/man/ERR_load_strings.3
+++ b/secure/lib/libcrypto/man/ERR_load_strings.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_load_strings 3"
-.TH ERR_load_strings 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_load_strings 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_print_errors.3 b/secure/lib/libcrypto/man/ERR_print_errors.3
index 3b01d25..7048d50 100644
--- a/secure/lib/libcrypto/man/ERR_print_errors.3
+++ b/secure/lib/libcrypto/man/ERR_print_errors.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_print_errors 3"
-.TH ERR_print_errors 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_print_errors 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_put_error.3 b/secure/lib/libcrypto/man/ERR_put_error.3
index 694b728..4020eec 100644
--- a/secure/lib/libcrypto/man/ERR_put_error.3
+++ b/secure/lib/libcrypto/man/ERR_put_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_put_error 3"
-.TH ERR_put_error 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_put_error 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_remove_state.3 b/secure/lib/libcrypto/man/ERR_remove_state.3
index 57009b3..554ebc4 100644
--- a/secure/lib/libcrypto/man/ERR_remove_state.3
+++ b/secure/lib/libcrypto/man/ERR_remove_state.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_remove_state 3"
-.TH ERR_remove_state 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_remove_state 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ERR_set_mark.3 b/secure/lib/libcrypto/man/ERR_set_mark.3
index 29ed839..1be0922 100644
--- a/secure/lib/libcrypto/man/ERR_set_mark.3
+++ b/secure/lib/libcrypto/man/ERR_set_mark.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERR_set_mark 3"
-.TH ERR_set_mark 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERR_set_mark 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_BytesToKey.3 b/secure/lib/libcrypto/man/EVP_BytesToKey.3
index b11c92d..e092a18 100644
--- a/secure/lib/libcrypto/man/EVP_BytesToKey.3
+++ b/secure/lib/libcrypto/man/EVP_BytesToKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_BytesToKey 3"
-.TH EVP_BytesToKey 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_BytesToKey 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestInit.3 b/secure/lib/libcrypto/man/EVP_DigestInit.3
index dcdff95..4096ca2 100644
--- a/secure/lib/libcrypto/man/EVP_DigestInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestInit 3"
-.TH EVP_DigestInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_DigestInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestSignInit.3 b/secure/lib/libcrypto/man/EVP_DigestSignInit.3
index e607489..c3b4c3b 100644
--- a/secure/lib/libcrypto/man/EVP_DigestSignInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestSignInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestSignInit 3"
-.TH EVP_DigestSignInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_DigestSignInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 b/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
index 7b3cea1..dc14e4f 100644
--- a/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
+++ b/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_DigestVerifyInit 3"
-.TH EVP_DigestVerifyInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_DigestVerifyInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -173,10 +173,11 @@ using a macro.
or a negative value for failure. In particular a return value of \-2 indicates
the operation is not supported by the public key algorithm.
.PP
-Unlike other functions the return value 0 from \fIEVP_DigestVerifyFinal()\fR only
-indicates that the signature did not verify successfully (that is tbs did
-not match the original data or the signature was of invalid form) it is not an
-indication of a more serious error.
+\&\fIEVP_DigestVerifyFinal()\fR returns 1 for success; any other value indicates
+failure. A return value of zero indicates that the signature did not verify
+successfully (that is, tbs did not match the original data or the signature had
+an invalid form), while other values indicate a more serious error (and
+sometimes also indicate an invalid signature form).
.PP
The error codes can be obtained from \fIERR_get_error\fR\|(3).
.SH "NOTES"
diff --git a/secure/lib/libcrypto/man/EVP_EncryptInit.3 b/secure/lib/libcrypto/man/EVP_EncryptInit.3
index e850ff1..5b6e418 100644
--- a/secure/lib/libcrypto/man/EVP_EncryptInit.3
+++ b/secure/lib/libcrypto/man/EVP_EncryptInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_EncryptInit 3"
-.TH EVP_EncryptInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_EncryptInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -248,7 +248,7 @@ symmetric ciphers.
\&\fIEVP_EncryptInit_ex()\fR sets up cipher context \fBctx\fR for encryption
with cipher \fBtype\fR from \s-1ENGINE \s0\fBimpl\fR. \fBctx\fR must be initialized
before calling this function. \fBtype\fR is normally supplied
-by a function such as \fIEVP_des_cbc()\fR. If \fBimpl\fR is \s-1NULL\s0 then the
+by a function such as \fIEVP_aes_256_cbc()\fR. If \fBimpl\fR is \s-1NULL\s0 then the
default implementation is used. \fBkey\fR is the symmetric key to use
and \fBiv\fR is the \s-1IV\s0 to use (if necessary), the actual number of bytes
used for the key and \s-1IV\s0 depends on the cipher. It is possible to set
diff --git a/secure/lib/libcrypto/man/EVP_OpenInit.3 b/secure/lib/libcrypto/man/EVP_OpenInit.3
index d5acd78..a9efbc2 100644
--- a/secure/lib/libcrypto/man/EVP_OpenInit.3
+++ b/secure/lib/libcrypto/man/EVP_OpenInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_OpenInit 3"
-.TH EVP_OpenInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_OpenInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 b/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
index bce645d..91e0a11 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_CTX_ctrl 3"
-.TH EVP_PKEY_CTX_ctrl 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_CTX_ctrl 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 b/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
index e113644..6a6bedc 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_CTX_new 3"
-.TH EVP_PKEY_CTX_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_CTX_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 b/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
index 67c9fe2..e27f023 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_cmp 3"
-.TH EVP_PKEY_cmp 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_cmp 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 b/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
index c52382d..7638dd3 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_decrypt 3"
-.TH EVP_PKEY_decrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_decrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_derive.3 b/secure/lib/libcrypto/man/EVP_PKEY_derive.3
index 7923347..7381979 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_derive.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_derive.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_derive 3"
-.TH EVP_PKEY_derive 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_derive 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 b/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
index 6fd361b..425b73f 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_encrypt 3"
-.TH EVP_PKEY_encrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_encrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 b/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
index 084b3e2..8e33b95 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_get_default_digest 3"
-.TH EVP_PKEY_get_default_digest 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_get_default_digest 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 b/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
index 48e07f8..30648cd 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_keygen 3"
-.TH EVP_PKEY_keygen 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_keygen 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_new.3 b/secure/lib/libcrypto/man/EVP_PKEY_new.3
index fd37be3..60d80d3 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_new.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_new 3"
-.TH EVP_PKEY_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 b/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
index 4924221..3410aad 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_print_private 3"
-.TH EVP_PKEY_print_private 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_print_private 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 b/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
index 6f32c7c..8d65be9 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_set1_RSA 3"
-.TH EVP_PKEY_set1_RSA 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_set1_RSA 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_sign.3 b/secure/lib/libcrypto/man/EVP_PKEY_sign.3
index ea634a3..d165f82 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_sign.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_sign 3"
-.TH EVP_PKEY_sign 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_sign 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_verify.3 b/secure/lib/libcrypto/man/EVP_PKEY_verify.3
index 3ba848b..0218f2b 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_verify.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_verify 3"
-.TH EVP_PKEY_verify 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_verify 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 b/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
index 617a33b..982c4a8 100644
--- a/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
+++ b/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_PKEY_verify_recover 3"
-.TH EVP_PKEY_verify_recover 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_PKEY_verify_recover 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/EVP_SealInit.3 b/secure/lib/libcrypto/man/EVP_SealInit.3
index 42ccd2a..b6d3b04 100644
--- a/secure/lib/libcrypto/man/EVP_SealInit.3
+++ b/secure/lib/libcrypto/man/EVP_SealInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_SealInit 3"
-.TH EVP_SealInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_SealInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -162,7 +162,7 @@ encrypted using this key.
.PP
\&\fIEVP_SealInit()\fR initializes a cipher context \fBctx\fR for encryption
with cipher \fBtype\fR using a random secret key and \s-1IV. \s0\fBtype\fR is normally
-supplied by a function such as \fIEVP_des_cbc()\fR. The secret key is encrypted
+supplied by a function such as \fIEVP_aes_256_cbc()\fR. The secret key is encrypted
using one or more public keys, this allows the same encrypted data to be
decrypted using any of the corresponding private keys. \fBek\fR is an array of
buffers where the public key encrypted secret key will be written, each buffer
diff --git a/secure/lib/libcrypto/man/EVP_SignInit.3 b/secure/lib/libcrypto/man/EVP_SignInit.3
index 5cbe3f9..5199db5 100644
--- a/secure/lib/libcrypto/man/EVP_SignInit.3
+++ b/secure/lib/libcrypto/man/EVP_SignInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,13 +133,14 @@
.\" ========================================================================
.\"
.IX Title "EVP_SignInit 3"
-.TH EVP_SignInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_SignInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
-EVP_SignInit, EVP_SignUpdate, EVP_SignFinal \- EVP signing functions
+EVP_SignInit, EVP_SignInit_ex, EVP_SignUpdate, EVP_SignFinal \- EVP signing
+functions
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
diff --git a/secure/lib/libcrypto/man/EVP_VerifyInit.3 b/secure/lib/libcrypto/man/EVP_VerifyInit.3
index 5d34258..06f8bf0 100644
--- a/secure/lib/libcrypto/man/EVP_VerifyInit.3
+++ b/secure/lib/libcrypto/man/EVP_VerifyInit.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EVP_VerifyInit 3"
-.TH EVP_VerifyInit 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EVP_VerifyInit 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OBJ_nid2obj.3 b/secure/lib/libcrypto/man/OBJ_nid2obj.3
index acdaff9..878b605 100644
--- a/secure/lib/libcrypto/man/OBJ_nid2obj.3
+++ b/secure/lib/libcrypto/man/OBJ_nid2obj.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OBJ_nid2obj 3"
-.TH OBJ_nid2obj 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OBJ_nid2obj 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_Applink.3 b/secure/lib/libcrypto/man/OPENSSL_Applink.3
index 221e86c..4e21936 100644
--- a/secure/lib/libcrypto/man/OPENSSL_Applink.3
+++ b/secure/lib/libcrypto/man/OPENSSL_Applink.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_Applink 3"
-.TH OPENSSL_Applink 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OPENSSL_Applink 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 b/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
index 58aa212..b6210d3 100644
--- a/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
+++ b/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_VERSION_NUMBER 3"
-.TH OPENSSL_VERSION_NUMBER 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OPENSSL_VERSION_NUMBER 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_config.3 b/secure/lib/libcrypto/man/OPENSSL_config.3
index 63ef10a..dcc2ad2 100644
--- a/secure/lib/libcrypto/man/OPENSSL_config.3
+++ b/secure/lib/libcrypto/man/OPENSSL_config.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_config 3"
-.TH OPENSSL_config 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OPENSSL_config 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 b/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
index 1acf0f7..3ac977a 100644
--- a/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
+++ b/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_ia32cap 3"
-.TH OPENSSL_ia32cap 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OPENSSL_ia32cap 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 b/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3
index 5d8fea1..af916be 100644
--- a/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3
+++ b/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_instrument_bus 3"
-.TH OPENSSL_instrument_bus 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OPENSSL_instrument_bus 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 b/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
index 06a041f..812480d 100644
--- a/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
+++ b/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL_load_builtin_modules 3"
-.TH OPENSSL_load_builtin_modules 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OPENSSL_load_builtin_modules 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 b/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
index 5338f19..7b1b802 100644
--- a/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
+++ b/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OpenSSL_add_all_algorithms 3"
-.TH OpenSSL_add_all_algorithms 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OpenSSL_add_all_algorithms 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 b/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
index 48dcd4e..7d20799 100644
--- a/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
+++ b/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PEM_write_bio_CMS_stream 3"
-.TH PEM_write_bio_CMS_stream 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PEM_write_bio_CMS_stream 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 b/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
index 2c5026b..14d9d1b 100644
--- a/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
+++ b/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PEM_write_bio_PKCS7_stream 3"
-.TH PEM_write_bio_PKCS7_stream 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PEM_write_bio_PKCS7_stream 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS12_create.3 b/secure/lib/libcrypto/man/PKCS12_create.3
index f48de873..46a12b8 100644
--- a/secure/lib/libcrypto/man/PKCS12_create.3
+++ b/secure/lib/libcrypto/man/PKCS12_create.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12_create 3"
-.TH PKCS12_create 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS12_create 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS12_parse.3 b/secure/lib/libcrypto/man/PKCS12_parse.3
index 3c41710..3be106c 100644
--- a/secure/lib/libcrypto/man/PKCS12_parse.3
+++ b/secure/lib/libcrypto/man/PKCS12_parse.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12_parse 3"
-.TH PKCS12_parse 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS12_parse 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_decrypt.3 b/secure/lib/libcrypto/man/PKCS7_decrypt.3
index 7f991b6..5321f9f 100644
--- a/secure/lib/libcrypto/man/PKCS7_decrypt.3
+++ b/secure/lib/libcrypto/man/PKCS7_decrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_decrypt 3"
-.TH PKCS7_decrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS7_decrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_encrypt.3 b/secure/lib/libcrypto/man/PKCS7_encrypt.3
index 1dd9942..e6c8552 100644
--- a/secure/lib/libcrypto/man/PKCS7_encrypt.3
+++ b/secure/lib/libcrypto/man/PKCS7_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_encrypt 3"
-.TH PKCS7_encrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS7_encrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_sign.3 b/secure/lib/libcrypto/man/PKCS7_sign.3
index 9d6f06d..01de0aa 100644
--- a/secure/lib/libcrypto/man/PKCS7_sign.3
+++ b/secure/lib/libcrypto/man/PKCS7_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_sign 3"
-.TH PKCS7_sign 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS7_sign 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 b/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
index a98f6df..0149972 100644
--- a/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
+++ b/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_sign_add_signer 3"
-.TH PKCS7_sign_add_signer 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS7_sign_add_signer 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/PKCS7_verify.3 b/secure/lib/libcrypto/man/PKCS7_verify.3
index e58a10d..359e5a7 100644
--- a/secure/lib/libcrypto/man/PKCS7_verify.3
+++ b/secure/lib/libcrypto/man/PKCS7_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7_verify 3"
-.TH PKCS7_verify 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS7_verify 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_add.3 b/secure/lib/libcrypto/man/RAND_add.3
index 12f24ea..4dbb95e 100644
--- a/secure/lib/libcrypto/man/RAND_add.3
+++ b/secure/lib/libcrypto/man/RAND_add.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_add 3"
-.TH RAND_add 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RAND_add 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_bytes.3 b/secure/lib/libcrypto/man/RAND_bytes.3
index d3dab57..77b0179 100644
--- a/secure/lib/libcrypto/man/RAND_bytes.3
+++ b/secure/lib/libcrypto/man/RAND_bytes.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_bytes 3"
-.TH RAND_bytes 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RAND_bytes 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_cleanup.3 b/secure/lib/libcrypto/man/RAND_cleanup.3
index 5954086..75444c0 100644
--- a/secure/lib/libcrypto/man/RAND_cleanup.3
+++ b/secure/lib/libcrypto/man/RAND_cleanup.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_cleanup 3"
-.TH RAND_cleanup 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RAND_cleanup 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_egd.3 b/secure/lib/libcrypto/man/RAND_egd.3
index ff644ad..482ff2c 100644
--- a/secure/lib/libcrypto/man/RAND_egd.3
+++ b/secure/lib/libcrypto/man/RAND_egd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_egd 3"
-.TH RAND_egd 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RAND_egd 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_load_file.3 b/secure/lib/libcrypto/man/RAND_load_file.3
index 1e1ab59..0d7851b 100644
--- a/secure/lib/libcrypto/man/RAND_load_file.3
+++ b/secure/lib/libcrypto/man/RAND_load_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_load_file 3"
-.TH RAND_load_file 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RAND_load_file 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RAND_set_rand_method.3 b/secure/lib/libcrypto/man/RAND_set_rand_method.3
index 0a8ee84..ba5c149 100644
--- a/secure/lib/libcrypto/man/RAND_set_rand_method.3
+++ b/secure/lib/libcrypto/man/RAND_set_rand_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND_set_rand_method 3"
-.TH RAND_set_rand_method 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RAND_set_rand_method 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_blinding_on.3 b/secure/lib/libcrypto/man/RSA_blinding_on.3
index 502b30c..68b0be5 100644
--- a/secure/lib/libcrypto/man/RSA_blinding_on.3
+++ b/secure/lib/libcrypto/man/RSA_blinding_on.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_blinding_on 3"
-.TH RSA_blinding_on 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_blinding_on 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_check_key.3 b/secure/lib/libcrypto/man/RSA_check_key.3
index 4d7689e..27df720 100644
--- a/secure/lib/libcrypto/man/RSA_check_key.3
+++ b/secure/lib/libcrypto/man/RSA_check_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_check_key 3"
-.TH RSA_check_key 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_check_key 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_generate_key.3 b/secure/lib/libcrypto/man/RSA_generate_key.3
index 05acc68..5ee29d8 100644
--- a/secure/lib/libcrypto/man/RSA_generate_key.3
+++ b/secure/lib/libcrypto/man/RSA_generate_key.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_generate_key 3"
-.TH RSA_generate_key 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_generate_key 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 b/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
index 18983d3..a73e50a 100644
--- a/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_get_ex_new_index 3"
-.TH RSA_get_ex_new_index 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_get_ex_new_index 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_new.3 b/secure/lib/libcrypto/man/RSA_new.3
index 48b7d3e..39af29e 100644
--- a/secure/lib/libcrypto/man/RSA_new.3
+++ b/secure/lib/libcrypto/man/RSA_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_new 3"
-.TH RSA_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 b/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
index f050930..60ded7e 100644
--- a/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
+++ b/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_padding_add_PKCS1_type_1 3"
-.TH RSA_padding_add_PKCS1_type_1 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_padding_add_PKCS1_type_1 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_print.3 b/secure/lib/libcrypto/man/RSA_print.3
index ece4a26..a48c6d6 100644
--- a/secure/lib/libcrypto/man/RSA_print.3
+++ b/secure/lib/libcrypto/man/RSA_print.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_print 3"
-.TH RSA_print 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_print 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_private_encrypt.3 b/secure/lib/libcrypto/man/RSA_private_encrypt.3
index 15ad222..cc98abd 100644
--- a/secure/lib/libcrypto/man/RSA_private_encrypt.3
+++ b/secure/lib/libcrypto/man/RSA_private_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_private_encrypt 3"
-.TH RSA_private_encrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_private_encrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_public_encrypt.3 b/secure/lib/libcrypto/man/RSA_public_encrypt.3
index c3e05cf..54b997d 100644
--- a/secure/lib/libcrypto/man/RSA_public_encrypt.3
+++ b/secure/lib/libcrypto/man/RSA_public_encrypt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_public_encrypt 3"
-.TH RSA_public_encrypt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_public_encrypt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_set_method.3 b/secure/lib/libcrypto/man/RSA_set_method.3
index e7a53de..a6aa98f 100644
--- a/secure/lib/libcrypto/man/RSA_set_method.3
+++ b/secure/lib/libcrypto/man/RSA_set_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_set_method 3"
-.TH RSA_set_method 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_set_method 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_sign.3 b/secure/lib/libcrypto/man/RSA_sign.3
index a7a33bc..2f57c5a 100644
--- a/secure/lib/libcrypto/man/RSA_sign.3
+++ b/secure/lib/libcrypto/man/RSA_sign.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_sign 3"
-.TH RSA_sign 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_sign 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 b/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
index aa7b184..32d579c 100644
--- a/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
+++ b/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_sign_ASN1_OCTET_STRING 3"
-.TH RSA_sign_ASN1_OCTET_STRING 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_sign_ASN1_OCTET_STRING 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/RSA_size.3 b/secure/lib/libcrypto/man/RSA_size.3
index 5bdc8bf..6fb4b1c 100644
--- a/secure/lib/libcrypto/man/RSA_size.3
+++ b/secure/lib/libcrypto/man/RSA_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA_size 3"
-.TH RSA_size 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA_size 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_read_CMS.3 b/secure/lib/libcrypto/man/SMIME_read_CMS.3
index e9647f9..0f2e94e 100644
--- a/secure/lib/libcrypto/man/SMIME_read_CMS.3
+++ b/secure/lib/libcrypto/man/SMIME_read_CMS.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_read_CMS 3"
-.TH SMIME_read_CMS 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SMIME_read_CMS 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 b/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
index 6693560..341a77c 100644
--- a/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
+++ b/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_read_PKCS7 3"
-.TH SMIME_read_PKCS7 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SMIME_read_PKCS7 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_write_CMS.3 b/secure/lib/libcrypto/man/SMIME_write_CMS.3
index e0d738e..d1288af 100644
--- a/secure/lib/libcrypto/man/SMIME_write_CMS.3
+++ b/secure/lib/libcrypto/man/SMIME_write_CMS.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_write_CMS 3"
-.TH SMIME_write_CMS 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SMIME_write_CMS 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 b/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
index c7c551a..35ce5ce 100644
--- a/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
+++ b/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME_write_PKCS7 3"
-.TH SMIME_write_PKCS7 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SMIME_write_PKCS7 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 b/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
index 77cc58e..1145471 100644
--- a/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
+++ b/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_ENTRY_get_object 3"
-.TH X509_NAME_ENTRY_get_object 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_NAME_ENTRY_get_object 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 b/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
index 5dfc928..6faa83d 100644
--- a/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
+++ b/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_add_entry_by_txt 3"
-.TH X509_NAME_add_entry_by_txt 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_NAME_add_entry_by_txt 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 b/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
index 9f10125..8899c51 100644
--- a/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
+++ b/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_get_index_by_NID 3"
-.TH X509_NAME_get_index_by_NID 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_NAME_get_index_by_NID 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_NAME_print_ex.3 b/secure/lib/libcrypto/man/X509_NAME_print_ex.3
index 6eda0e0..12a6a9ad 100644
--- a/secure/lib/libcrypto/man/X509_NAME_print_ex.3
+++ b/secure/lib/libcrypto/man/X509_NAME_print_ex.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_NAME_print_ex 3"
-.TH X509_NAME_print_ex 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_NAME_print_ex 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
index 9154c3d..5f550bc 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_get_error 3"
-.TH X509_STORE_CTX_get_error 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_STORE_CTX_get_error 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
index 00a0fe8..2d2b347 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_get_ex_new_index 3"
-.TH X509_STORE_CTX_get_ex_new_index 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_STORE_CTX_get_ex_new_index 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
index 1f01425..47e97c3 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_new 3"
-.TH X509_STORE_CTX_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_STORE_CTX_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 b/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
index 234c747..63e8846 100644
--- a/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
+++ b/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_CTX_set_verify_cb 3"
-.TH X509_STORE_CTX_set_verify_cb 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_STORE_CTX_set_verify_cb 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 b/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
index 4ab026a..5ac5a46 100644
--- a/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
+++ b/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_STORE_set_verify_cb_func 3"
-.TH X509_STORE_set_verify_cb_func 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_STORE_set_verify_cb_func 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 b/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
index c8c9907..323e662 100644
--- a/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
+++ b/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_VERIFY_PARAM_set_flags 3"
-.TH X509_VERIFY_PARAM_set_flags 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_VERIFY_PARAM_set_flags 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_check_host.3 b/secure/lib/libcrypto/man/X509_check_host.3
index 4556924..8768078 100644
--- a/secure/lib/libcrypto/man/X509_check_host.3
+++ b/secure/lib/libcrypto/man/X509_check_host.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_check_host 3"
-.TH X509_check_host 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_check_host 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -266,4 +266,4 @@ and the internal checks will be suppressed as appropriate when
\&\fIX509_VERIFY_PARAM_set1_ipasc\fR\|(3)
.SH "HISTORY"
.IX Header "HISTORY"
-These functions were added in OpenSSL 1.1.0.
+These functions were added in OpenSSL 1.0.2.
diff --git a/secure/lib/libcrypto/man/X509_new.3 b/secure/lib/libcrypto/man/X509_new.3
index 8f5fda7..631398d 100644
--- a/secure/lib/libcrypto/man/X509_new.3
+++ b/secure/lib/libcrypto/man/X509_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_new 3"
-.TH X509_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/X509_verify_cert.3 b/secure/lib/libcrypto/man/X509_verify_cert.3
index 7dc95ca..f74bf50 100644
--- a/secure/lib/libcrypto/man/X509_verify_cert.3
+++ b/secure/lib/libcrypto/man/X509_verify_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509_verify_cert 3"
-.TH X509_verify_cert 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509_verify_cert 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bio.3 b/secure/lib/libcrypto/man/bio.3
index 29b4622..86d132c 100644
--- a/secure/lib/libcrypto/man/bio.3
+++ b/secure/lib/libcrypto/man/bio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bio 3"
-.TH bio 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH bio 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/blowfish.3 b/secure/lib/libcrypto/man/blowfish.3
index 1375358..588c21f 100644
--- a/secure/lib/libcrypto/man/blowfish.3
+++ b/secure/lib/libcrypto/man/blowfish.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "blowfish 3"
-.TH blowfish 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH blowfish 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bn.3 b/secure/lib/libcrypto/man/bn.3
index 72a4c04..23948ea 100644
--- a/secure/lib/libcrypto/man/bn.3
+++ b/secure/lib/libcrypto/man/bn.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bn 3"
-.TH bn 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH bn 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/bn_internal.3 b/secure/lib/libcrypto/man/bn_internal.3
index df16fd6..4b7108a 100644
--- a/secure/lib/libcrypto/man/bn_internal.3
+++ b/secure/lib/libcrypto/man/bn_internal.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "bn_internal 3"
-.TH bn_internal 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH bn_internal 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/buffer.3 b/secure/lib/libcrypto/man/buffer.3
index fcb7985..b47075a 100644
--- a/secure/lib/libcrypto/man/buffer.3
+++ b/secure/lib/libcrypto/man/buffer.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,14 +133,17 @@
.\" ========================================================================
.\"
.IX Title "buffer 3"
-.TH buffer 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH buffer 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
-BUF_MEM_new, BUF_MEM_free, BUF_MEM_grow, BUF_strdup \- simple
-character arrays structure
+BUF_MEM_new, BUF_MEM_new_ex, BUF_MEM_free, BUF_MEM_grow \- simple
+character array structure
+.PP
+BUF_strdup, BUF_strndup, BUF_memdup, BUF_strlcpy, BUF_strlcat \-
+standard C library equivalents
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
@@ -152,28 +155,23 @@ character arrays structure
\&
\& int BUF_MEM_grow(BUF_MEM *str, int len);
\&
-\& char * BUF_strdup(const char *str);
+\& char *BUF_strdup(const char *str);
+\&
+\& char *BUF_strndup(const char *str, size_t siz);
+\&
+\& void *BUF_memdup(const void *data, size_t siz);
+\&
+\& size_t BUF_strlcpy(char *dst, const char *src, size_t size);
+\&
+\& size_t BUF_strlcat(char *dst, const char *src, size_t size);
+\&
+\& size_t BUF_strnlen(const char *str, size_t maxlen);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The buffer library handles simple character arrays. Buffers are used for
various purposes in the library, most notably memory BIOs.
.PP
-The library uses the \s-1BUF_MEM\s0 structure defined in buffer.h:
-.PP
-.Vb 6
-\& typedef struct buf_mem_st
-\& {
-\& int length; /* current number of bytes */
-\& char *data;
-\& int max; /* size of buffer */
-\& } BUF_MEM;
-.Ve
-.PP
-\&\fBlength\fR is the current size of the buffer in bytes, \fBmax\fR is the amount of
-memory allocated to the buffer. There are three functions which handle these
-and one \*(L"miscellaneous\*(R" function.
-.PP
\&\fIBUF_MEM_new()\fR allocates a new buffer of zero size.
.PP
\&\fIBUF_MEM_free()\fR frees up an already existing buffer. The data is zeroed
@@ -183,14 +181,17 @@ before freeing up in case the buffer contains sensitive data.
\&\fBlen\fR. Any data already in the buffer is preserved if it increases in
size.
.PP
-\&\fIBUF_strdup()\fR copies a null terminated string into a block of allocated
-memory and returns a pointer to the allocated block.
-Unlike the standard C library \fIstrdup()\fR this function uses \fIOPENSSL_malloc()\fR and so
-should be used in preference to the standard library \fIstrdup()\fR because it can
-be used for memory leak checking or replacing the \fImalloc()\fR function.
+\&\fIBUF_strdup()\fR, \fIBUF_strndup()\fR, \fIBUF_memdup()\fR, \fIBUF_strlcpy()\fR,
+\&\fIBUF_strlcat()\fR and BUF_strnlen are equivalents of the standard C
+library functions. The \fIdup()\fR functions use \fIOPENSSL_malloc()\fR underneath
+and so should be used in preference to the standard library for memory
+leak checking or replacing the \fImalloc()\fR function.
+.PP
+Memory allocated from these functions should be freed up using the
+\&\fIOPENSSL_free()\fR function.
.PP
-The memory allocated from \fIBUF_strdup()\fR should be freed up using the \fIOPENSSL_free()\fR
-function.
+BUF_strndup makes the explicit guarantee that it will never read past
+the first \fBsiz\fR bytes of \fBstr\fR.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
\&\fIBUF_MEM_new()\fR returns the buffer or \s-1NULL\s0 on error.
diff --git a/secure/lib/libcrypto/man/crypto.3 b/secure/lib/libcrypto/man/crypto.3
index 3aeaa33..7c52954 100644
--- a/secure/lib/libcrypto/man/crypto.3
+++ b/secure/lib/libcrypto/man/crypto.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "crypto 3"
-.TH crypto 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH crypto 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 b/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
index dfd106c..dc415b6 100644
--- a/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
+++ b/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ASN1_OBJECT 3"
-.TH d2i_ASN1_OBJECT 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_ASN1_OBJECT 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 b/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
index 2c4f36e..c89e582 100644
--- a/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
+++ b/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_CMS_ContentInfo 3"
-.TH d2i_CMS_ContentInfo 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_CMS_ContentInfo 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_DHparams.3 b/secure/lib/libcrypto/man/d2i_DHparams.3
index 8edf342..93ac08e 100644
--- a/secure/lib/libcrypto/man/d2i_DHparams.3
+++ b/secure/lib/libcrypto/man/d2i_DHparams.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_DHparams 3"
-.TH d2i_DHparams 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_DHparams 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 b/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
index ed56f87..86c2f35 100644
--- a/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
+++ b/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_DSAPublicKey 3"
-.TH d2i_DSAPublicKey 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_DSAPublicKey 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ECPKParameters.3 b/secure/lib/libcrypto/man/d2i_ECPKParameters.3
index b14d481..5108a82 100644
--- a/secure/lib/libcrypto/man/d2i_ECPKParameters.3
+++ b/secure/lib/libcrypto/man/d2i_ECPKParameters.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ECPKParameters 3"
-.TH d2i_ECPKParameters 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_ECPKParameters 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 b/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
index 07a2962..a4deedc 100644
--- a/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
+++ b/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_ECPrivateKey 3"
-.TH d2i_ECPrivateKey 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_ECPrivateKey 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 b/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
index a89957d..d72ddc0 100644
--- a/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
+++ b/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_PKCS8PrivateKey 3"
-.TH d2i_PKCS8PrivateKey 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_PKCS8PrivateKey 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 b/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
index 4e5af7a..71c85b8 100644
--- a/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
+++ b/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_RSAPublicKey 3"
-.TH d2i_RSAPublicKey 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_RSAPublicKey 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509.3 b/secure/lib/libcrypto/man/d2i_X509.3
index fa12c9f..5ad3dd2 100644
--- a/secure/lib/libcrypto/man/d2i_X509.3
+++ b/secure/lib/libcrypto/man/d2i_X509.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509 3"
-.TH d2i_X509 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_X509 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 b/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
index 223d300..5050f66 100644
--- a/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
+++ b/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_ALGOR 3"
-.TH d2i_X509_ALGOR 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_X509_ALGOR 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_CRL.3 b/secure/lib/libcrypto/man/d2i_X509_CRL.3
index 399cd97..ec59a39 100644
--- a/secure/lib/libcrypto/man/d2i_X509_CRL.3
+++ b/secure/lib/libcrypto/man/d2i_X509_CRL.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_CRL 3"
-.TH d2i_X509_CRL 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_X509_CRL 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_NAME.3 b/secure/lib/libcrypto/man/d2i_X509_NAME.3
index 04a2489..cd79512 100644
--- a/secure/lib/libcrypto/man/d2i_X509_NAME.3
+++ b/secure/lib/libcrypto/man/d2i_X509_NAME.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_NAME 3"
-.TH d2i_X509_NAME 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_X509_NAME 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -151,7 +151,7 @@ d2i_X509_NAME, i2d_X509_NAME \- X509_NAME encoding functions
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
These functions decode and encode an \fBX509_NAME\fR structure which is the
-the same as the \fBName\fR type defined in \s-1RFC2459 \s0(and elsewhere) and used
+same as the \fBName\fR type defined in \s-1RFC2459 \s0(and elsewhere) and used
for example in certificate subject and issuer names.
.PP
Othewise the functions behave in a similar way to \fId2i_X509()\fR and \fIi2d_X509()\fR
diff --git a/secure/lib/libcrypto/man/d2i_X509_REQ.3 b/secure/lib/libcrypto/man/d2i_X509_REQ.3
index f6adf50..b8d20a3 100644
--- a/secure/lib/libcrypto/man/d2i_X509_REQ.3
+++ b/secure/lib/libcrypto/man/d2i_X509_REQ.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_REQ 3"
-.TH d2i_X509_REQ 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_X509_REQ 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/d2i_X509_SIG.3 b/secure/lib/libcrypto/man/d2i_X509_SIG.3
index 630ede5..5dbb776 100644
--- a/secure/lib/libcrypto/man/d2i_X509_SIG.3
+++ b/secure/lib/libcrypto/man/d2i_X509_SIG.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_X509_SIG 3"
-.TH d2i_X509_SIG 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_X509_SIG 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/des.3 b/secure/lib/libcrypto/man/des.3
index db4329c..a177c27 100644
--- a/secure/lib/libcrypto/man/des.3
+++ b/secure/lib/libcrypto/man/des.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "des 3"
-.TH des 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH des 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/dh.3 b/secure/lib/libcrypto/man/dh.3
index 93e848d..cab08e2 100644
--- a/secure/lib/libcrypto/man/dh.3
+++ b/secure/lib/libcrypto/man/dh.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "dh 3"
-.TH dh 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH dh 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/dsa.3 b/secure/lib/libcrypto/man/dsa.3
index 14043aa..d45505a 100644
--- a/secure/lib/libcrypto/man/dsa.3
+++ b/secure/lib/libcrypto/man/dsa.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "dsa 3"
-.TH dsa 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH dsa 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ec.3 b/secure/lib/libcrypto/man/ec.3
index cda2f21..6346a15 100644
--- a/secure/lib/libcrypto/man/ec.3
+++ b/secure/lib/libcrypto/man/ec.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ec 3"
-.TH ec 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ec 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ecdsa.3 b/secure/lib/libcrypto/man/ecdsa.3
index d3f0c70..60bd3d2 100644
--- a/secure/lib/libcrypto/man/ecdsa.3
+++ b/secure/lib/libcrypto/man/ecdsa.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ecdsa 3"
-.TH ecdsa 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ecdsa 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/engine.3 b/secure/lib/libcrypto/man/engine.3
index f363220..b6cb04a 100644
--- a/secure/lib/libcrypto/man/engine.3
+++ b/secure/lib/libcrypto/man/engine.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "engine 3"
-.TH engine 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH engine 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -330,7 +330,7 @@ to use the pointer value at all, as this kind of reference is a guarantee
that the structure can not be deallocated until the reference is released.
.PP
However, a structural reference provides no guarantee that the \s-1ENGINE\s0 is
-initiliased and able to use any of its cryptographic
+initialised and able to use any of its cryptographic
implementations. Indeed it's quite possible that most ENGINEs will not
initialise at all in typical environments, as ENGINEs are typically used to
support specialised hardware. To use an \s-1ENGINE\s0's functionality, you need a
@@ -339,8 +339,8 @@ specialised form of structural reference, because each functional reference
implicitly contains a structural reference as well \- however to avoid
difficult-to-find programming bugs, it is recommended to treat the two
kinds of reference independently. If you have a functional reference to an
-\&\s-1ENGINE,\s0 you have a guarantee that the \s-1ENGINE\s0 has been initialised ready to
-perform cryptographic operations and will remain uninitialised
+\&\s-1ENGINE,\s0 you have a guarantee that the \s-1ENGINE\s0 has been initialised and
+is ready to perform cryptographic operations, and will remain initialised
until after you have released your reference.
.PP
\&\fIStructural references\fR
@@ -510,7 +510,7 @@ source code to openssl's builtin utilities as guides.
Here we'll assume an application has been configured by its user or admin
to want to use the \*(L"\s-1ACME\*(R" ENGINE\s0 if it is available in the version of
OpenSSL the application was compiled with. If it is available, it should be
-used by default for all \s-1RSA, DSA,\s0 and symmetric cipher operation, otherwise
+used by default for all \s-1RSA, DSA,\s0 and symmetric cipher operations, otherwise
OpenSSL should use its builtin software as per usual. The following code
illustrates how to approach this;
.PP
@@ -543,7 +543,7 @@ illustrates how to approach this;
.PP
Here we'll assume we want to load and register all \s-1ENGINE\s0 implementations
bundled with OpenSSL, such that for any cryptographic algorithm required by
-OpenSSL \- if there is an \s-1ENGINE\s0 that implements it and can be initialise,
+OpenSSL \- if there is an \s-1ENGINE\s0 that implements it and can be initialised,
it should be used. The following code illustrates how this can work;
.PP
.Vb 4
diff --git a/secure/lib/libcrypto/man/err.3 b/secure/lib/libcrypto/man/err.3
index 63c025b..09f3f3a 100644
--- a/secure/lib/libcrypto/man/err.3
+++ b/secure/lib/libcrypto/man/err.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "err 3"
-.TH err 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH err 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/evp.3 b/secure/lib/libcrypto/man/evp.3
index 69c9fdf..37d7d2d 100644
--- a/secure/lib/libcrypto/man/evp.3
+++ b/secure/lib/libcrypto/man/evp.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "evp 3"
-.TH evp 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH evp 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/hmac.3 b/secure/lib/libcrypto/man/hmac.3
index b6fed21..c565445 100644
--- a/secure/lib/libcrypto/man/hmac.3
+++ b/secure/lib/libcrypto/man/hmac.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "hmac 3"
-.TH hmac 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH hmac 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 b/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
index b1eee7d..24375b1 100644
--- a/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
+++ b/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "i2d_CMS_bio_stream 3"
-.TH i2d_CMS_bio_stream 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH i2d_CMS_bio_stream 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 b/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
index 1910be2..6c436ce 100644
--- a/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
+++ b/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "i2d_PKCS7_bio_stream 3"
-.TH i2d_PKCS7_bio_stream 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH i2d_PKCS7_bio_stream 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/lh_stats.3 b/secure/lib/libcrypto/man/lh_stats.3
index 19a5146..25a53b1 100644
--- a/secure/lib/libcrypto/man/lh_stats.3
+++ b/secure/lib/libcrypto/man/lh_stats.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "lh_stats 3"
-.TH lh_stats 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH lh_stats 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/lhash.3 b/secure/lib/libcrypto/man/lhash.3
index fce16ee..d976c7f 100644
--- a/secure/lib/libcrypto/man/lhash.3
+++ b/secure/lib/libcrypto/man/lhash.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "lhash 3"
-.TH lhash 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH lhash 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/md5.3 b/secure/lib/libcrypto/man/md5.3
index 3970a45..3cbe1ca 100644
--- a/secure/lib/libcrypto/man/md5.3
+++ b/secure/lib/libcrypto/man/md5.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "md5 3"
-.TH md5 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH md5 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/mdc2.3 b/secure/lib/libcrypto/man/mdc2.3
index 46915da..8331dae 100644
--- a/secure/lib/libcrypto/man/mdc2.3
+++ b/secure/lib/libcrypto/man/mdc2.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "mdc2 3"
-.TH mdc2 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH mdc2 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/pem.3 b/secure/lib/libcrypto/man/pem.3
index c25cff4..4acb1e9 100644
--- a/secure/lib/libcrypto/man/pem.3
+++ b/secure/lib/libcrypto/man/pem.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "pem 3"
-.TH pem 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH pem 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rand.3 b/secure/lib/libcrypto/man/rand.3
index 8c45a7a..5af5acd 100644
--- a/secure/lib/libcrypto/man/rand.3
+++ b/secure/lib/libcrypto/man/rand.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rand 3"
-.TH rand 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH rand 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rc4.3 b/secure/lib/libcrypto/man/rc4.3
index 076898b..1092746 100644
--- a/secure/lib/libcrypto/man/rc4.3
+++ b/secure/lib/libcrypto/man/rc4.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rc4 3"
-.TH rc4 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH rc4 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ripemd.3 b/secure/lib/libcrypto/man/ripemd.3
index eee8447..979b866 100644
--- a/secure/lib/libcrypto/man/ripemd.3
+++ b/secure/lib/libcrypto/man/ripemd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ripemd 3"
-.TH ripemd 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ripemd 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/rsa.3 b/secure/lib/libcrypto/man/rsa.3
index d49f16c..c79febb 100644
--- a/secure/lib/libcrypto/man/rsa.3
+++ b/secure/lib/libcrypto/man/rsa.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "rsa 3"
-.TH rsa 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH rsa 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/sha.3 b/secure/lib/libcrypto/man/sha.3
index a76d682..a375649 100644
--- a/secure/lib/libcrypto/man/sha.3
+++ b/secure/lib/libcrypto/man/sha.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "sha 3"
-.TH sha 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH sha 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/threads.3 b/secure/lib/libcrypto/man/threads.3
index 2ef7ebb..041c0ae 100644
--- a/secure/lib/libcrypto/man/threads.3
+++ b/secure/lib/libcrypto/man/threads.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "threads 3"
-.TH threads 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH threads 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ui.3 b/secure/lib/libcrypto/man/ui.3
index 2a3e7f5..93fcba6 100644
--- a/secure/lib/libcrypto/man/ui.3
+++ b/secure/lib/libcrypto/man/ui.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ui 3"
-.TH ui 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ui 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/ui_compat.3 b/secure/lib/libcrypto/man/ui_compat.3
index e286dc6..322d214 100644
--- a/secure/lib/libcrypto/man/ui_compat.3
+++ b/secure/lib/libcrypto/man/ui_compat.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ui_compat 3"
-.TH ui_compat 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ui_compat 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libcrypto/man/x509.3 b/secure/lib/libcrypto/man/x509.3
index 0777817..0e9faab 100644
--- a/secure/lib/libcrypto/man/x509.3
+++ b/secure/lib/libcrypto/man/x509.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "x509 3"
-.TH x509 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH x509 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/Makefile.man b/secure/lib/libssl/Makefile.man
index c06c27f..fdeb315 100644
--- a/secure/lib/libssl/Makefile.man
+++ b/secure/lib/libssl/Makefile.man
@@ -58,6 +58,7 @@ MAN+= SSL_SESSION_get_ex_new_index.3
MAN+= SSL_SESSION_get_time.3
MAN+= SSL_accept.3
MAN+= SSL_alert_type_string.3
+MAN+= SSL_check_chain.3
MAN+= SSL_clear.3
MAN+= SSL_connect.3
MAN+= SSL_do_handshake.3
@@ -121,6 +122,7 @@ MLINKS+= SSL_CTX_add1_chain_cert.3 SSL_CTX_select_current_cert.3
MLINKS+= SSL_CTX_add1_chain_cert.3 SSL_select_current_cert.3
MLINKS+= SSL_CTX_add1_chain_cert.3 SSL_CTX_set_current_cert.3
MLINKS+= SSL_CTX_add1_chain_cert.3 SSL_set_current_cert.3
+MLINKS+= SSL_CTX_add_extra_chain_cert.3 SSL_CTX_clear_extra_chain_certs.3
MLINKS+= SSL_CTX_add_session.3 SSL_add_session.3
MLINKS+= SSL_CTX_add_session.3 SSL_CTX_remove_session.3
MLINKS+= SSL_CTX_add_session.3 SSL_remove_session.3
diff --git a/secure/lib/libssl/man/SSL_CIPHER_get_name.3 b/secure/lib/libssl/man/SSL_CIPHER_get_name.3
index 79b58fb..7b94446 100644
--- a/secure/lib/libssl/man/SSL_CIPHER_get_name.3
+++ b/secure/lib/libssl/man/SSL_CIPHER_get_name.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CIPHER_get_name 3"
-.TH SSL_CIPHER_get_name 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CIPHER_get_name 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 b/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
index 6b2da97..d327d52 100644
--- a/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
+++ b/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_COMP_add_compression_method 3"
-.TH SSL_COMP_add_compression_method 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_COMP_add_compression_method 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_new.3 b/secure/lib/libssl/man/SSL_CONF_CTX_new.3
index d72e8c6..6104db5 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_new.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_new 3"
-.TH SSL_CONF_CTX_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CONF_CTX_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 b/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3
index 99b6f95..905e7ac 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_set1_prefix 3"
-.TH SSL_CONF_CTX_set1_prefix 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CONF_CTX_set1_prefix 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 b/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3
index 0412b59..c75e2f5 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_set_flags 3"
-.TH SSL_CONF_CTX_set_flags 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CONF_CTX_set_flags 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 b/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3
index c07a3eb..eebb6d4 100644
--- a/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3
+++ b/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_CTX_set_ssl_ctx 3"
-.TH SSL_CONF_CTX_set_ssl_ctx 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CONF_CTX_set_ssl_ctx 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_cmd.3 b/secure/lib/libssl/man/SSL_CONF_cmd.3
index 0d38c4c..4b7135b 100644
--- a/secure/lib/libssl/man/SSL_CONF_cmd.3
+++ b/secure/lib/libssl/man/SSL_CONF_cmd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_cmd 3"
-.TH SSL_CONF_cmd 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CONF_cmd 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CONF_cmd_argv.3 b/secure/lib/libssl/man/SSL_CONF_cmd_argv.3
index 377eaac..ec90cab 100644
--- a/secure/lib/libssl/man/SSL_CONF_cmd_argv.3
+++ b/secure/lib/libssl/man/SSL_CONF_cmd_argv.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CONF_cmd_argv 3"
-.TH SSL_CONF_cmd_argv 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CONF_cmd_argv 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 b/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3
index c4fb8ea..2b0b155 100644
--- a/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3
+++ b/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add1_chain_cert 3"
-.TH SSL_CTX_add1_chain_cert 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_add1_chain_cert 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 b/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
index fcaf811..e354223 100644
--- a/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
+++ b/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,34 +133,44 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add_extra_chain_cert 3"
-.TH SSL_CTX_add_extra_chain_cert 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_add_extra_chain_cert 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
-SSL_CTX_add_extra_chain_cert \- add certificate to chain
+SSL_CTX_add_extra_chain_cert, SSL_CTX_clear_extra_chain_certs \- add or clear
+extra chain certificates
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& #include <openssl/ssl.h>
\&
-\& long SSL_CTX_add_extra_chain_cert(SSL_CTX ctx, X509 *x509)
+\& long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509);
+\& long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
-\&\fISSL_CTX_add_extra_chain_cert()\fR adds the certificate \fBx509\fR to the certificate
-chain presented together with the certificate. Several certificates
-can be added one after the other.
+\&\fISSL_CTX_add_extra_chain_cert()\fR adds the certificate \fBx509\fR to the extra chain
+certificates associated with \fBctx\fR. Several certificates can be added one
+after another.
+.PP
+\&\fISSL_CTX_clear_extra_chain_certs()\fR clears all extra chain certificates
+associated with \fBctx\fR.
+.PP
+These functions are implemented as macros.
.SH "NOTES"
.IX Header "NOTES"
-When constructing the certificate chain, the chain will be formed from
-these certificates explicitly specified. If no chain is specified,
-the library will try to complete the chain from the available \s-1CA\s0
-certificates in the trusted \s-1CA\s0 storage, see
+When sending a certificate chain, extra chain certificates are sent in order
+following the end entity certificate.
+.PP
+If no chain is specified, the library will try to complete the chain from the
+available \s-1CA\s0 certificates in the trusted \s-1CA\s0 storage, see
\&\fISSL_CTX_load_verify_locations\fR\|(3).
.PP
-The \fBx509\fR certificate provided to \fISSL_CTX_add_extra_chain_cert()\fR will be freed by the library when the \fB\s-1SSL_CTX\s0\fR is destroyed. An application \fBshould not\fR free the \fBx509\fR object.
+The \fBx509\fR certificate provided to \fISSL_CTX_add_extra_chain_cert()\fR will be
+freed by the library when the \fB\s-1SSL_CTX\s0\fR is destroyed. An application
+\&\fBshould not\fR free the \fBx509\fR object.
.SH "RESTRICTIONS"
.IX Header "RESTRICTIONS"
Only one set of extra chain certificates can be specified per \s-1SSL_CTX\s0
@@ -171,8 +181,9 @@ function. For more flexibility functions such as \fISSL_add1_chain_cert()\fR sho
be used instead.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
-\&\fISSL_CTX_add_extra_chain_cert()\fR returns 1 on success. Check out the
-error stack to find out the reason for failure otherwise.
+\&\fISSL_CTX_add_extra_chain_cert()\fR and \fISSL_CTX_clear_extra_chain_certs()\fR return
+1 on success and 0 for failure. Check out the error stack to find out the
+reason for failure.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIssl\fR\|(3),
diff --git a/secure/lib/libssl/man/SSL_CTX_add_session.3 b/secure/lib/libssl/man/SSL_CTX_add_session.3
index 4a3b113..0c4efd2 100644
--- a/secure/lib/libssl/man/SSL_CTX_add_session.3
+++ b/secure/lib/libssl/man/SSL_CTX_add_session.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_add_session 3"
-.TH SSL_CTX_add_session 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_add_session 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_ctrl.3 b/secure/lib/libssl/man/SSL_CTX_ctrl.3
index 74d9683..68bd173 100644
--- a/secure/lib/libssl/man/SSL_CTX_ctrl.3
+++ b/secure/lib/libssl/man/SSL_CTX_ctrl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_ctrl 3"
-.TH SSL_CTX_ctrl 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_ctrl 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 b/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
index 1bc8b52..8fd1e30 100644
--- a/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
+++ b/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_flush_sessions 3"
-.TH SSL_CTX_flush_sessions 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_flush_sessions 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_free.3 b/secure/lib/libssl/man/SSL_CTX_free.3
index 7df44e9..1a9bd9c 100644
--- a/secure/lib/libssl/man/SSL_CTX_free.3
+++ b/secure/lib/libssl/man/SSL_CTX_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_free 3"
-.TH SSL_CTX_free 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_free 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_get0_param.3 b/secure/lib/libssl/man/SSL_CTX_get0_param.3
index 6e1eb27..a05af05 100644
--- a/secure/lib/libssl/man/SSL_CTX_get0_param.3
+++ b/secure/lib/libssl/man/SSL_CTX_get0_param.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get0_param 3"
-.TH SSL_CTX_get0_param 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_get0_param 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -170,7 +170,7 @@ Check hostname matches \*(L"www.foo.com\*(R" in peer certificate:
.PP
.Vb 2
\& X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
-\& X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com");
+\& X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
.Ve
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
diff --git a/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
index 5dd1820..6e5194c 100644
--- a/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get_ex_new_index 3"
-.TH SSL_CTX_get_ex_new_index 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_get_ex_new_index 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 b/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
index be53503..aa9095e 100644
--- a/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_get_verify_mode 3"
-.TH SSL_CTX_get_verify_mode 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_get_verify_mode 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 b/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
index 5942be4..d2d37a8 100644
--- a/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
+++ b/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_load_verify_locations 3"
-.TH SSL_CTX_load_verify_locations 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_load_verify_locations 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_new.3 b/secure/lib/libssl/man/SSL_CTX_new.3
index f81b32f..60cb996 100644
--- a/secure/lib/libssl/man/SSL_CTX_new.3
+++ b/secure/lib/libssl/man/SSL_CTX_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_new 3"
-.TH SSL_CTX_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_number.3 b/secure/lib/libssl/man/SSL_CTX_sess_number.3
index 2f8194b..1515053 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_number.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_number.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_number 3"
-.TH SSL_CTX_sess_number 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_sess_number 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 b/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
index 32a5ecc..0506967 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_set_cache_size 3"
-.TH SSL_CTX_sess_set_cache_size 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_sess_set_cache_size 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 b/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
index 140755e..d3515c4 100644
--- a/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sess_set_get_cb 3"
-.TH SSL_CTX_sess_set_get_cb 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_sess_set_get_cb 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_sessions.3 b/secure/lib/libssl/man/SSL_CTX_sessions.3
index 9dbd080..bfe8b44 100644
--- a/secure/lib/libssl/man/SSL_CTX_sessions.3
+++ b/secure/lib/libssl/man/SSL_CTX_sessions.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_sessions 3"
-.TH SSL_CTX_sessions 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_sessions 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set1_curves.3 b/secure/lib/libssl/man/SSL_CTX_set1_curves.3
index 0e5fe2d..946a2d7 100644
--- a/secure/lib/libssl/man/SSL_CTX_set1_curves.3
+++ b/secure/lib/libssl/man/SSL_CTX_set1_curves.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set1_curves 3"
-.TH SSL_CTX_set1_curves 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set1_curves 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 b/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3
index 8709286..f22269a 100644
--- a/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3
+++ b/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set1_verify_cert_store 3"
-.TH SSL_CTX_set1_verify_cert_store 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set1_verify_cert_store 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3
index b858902..ed00c36 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_cb 3"
-.TH SSL_CTX_set_cert_cb 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_cert_cb 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
index 4253a53..445fa7e 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_store 3"
-.TH SSL_CTX_set_cert_store 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_cert_store 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
index a6a590e..0599310 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cert_verify_callback 3"
-.TH SSL_CTX_set_cert_verify_callback 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_cert_verify_callback 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 b/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
index 3d70ced..3a711f5 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_cipher_list 3"
-.TH SSL_CTX_set_cipher_list 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_cipher_list 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 b/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
index 203378c..8224a07 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_client_CA_list 3"
-.TH SSL_CTX_set_client_CA_list 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_client_CA_list 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
index d9a4b7e..551b489 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_client_cert_cb 3"
-.TH SSL_CTX_set_client_cert_cb 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_client_cert_cb 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 b/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3
index 4bec817..8ca38bf 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_custom_cli_ext 3"
-.TH SSL_CTX_set_custom_cli_ext 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_custom_cli_ext 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
index 7388cb1..68c1b43 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_default_passwd_cb 3"
-.TH SSL_CTX_set_default_passwd_cb 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_default_passwd_cb 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 b/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
index 602d00c..543072e 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_generate_session_id 3"
-.TH SSL_CTX_set_generate_session_id 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_generate_session_id 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
index d8bcc3e..2830703 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_info_callback 3"
-.TH SSL_CTX_set_info_callback 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_info_callback 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 b/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
index c018083..31bf93d 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_max_cert_list 3"
-.TH SSL_CTX_set_max_cert_list 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_max_cert_list 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_mode.3 b/secure/lib/libssl/man/SSL_CTX_set_mode.3
index d0e0442..bb63268 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_mode.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_mode 3"
-.TH SSL_CTX_set_mode 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_mode 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
index 8c5cc1d..ac58fe5 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_msg_callback 3"
-.TH SSL_CTX_set_msg_callback 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_msg_callback 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_options.3 b/secure/lib/libssl/man/SSL_CTX_set_options.3
index 2be16ce..138cdc5 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_options.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_options.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_options 3"
-.TH SSL_CTX_set_options 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_options 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
index 0596370..b4708b8 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_psk_client_callback 3"
-.TH SSL_CTX_set_psk_client_callback 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_psk_client_callback 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 b/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
index 1184c4a..8c9d08f 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_quiet_shutdown 3"
-.TH SSL_CTX_set_quiet_shutdown 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_quiet_shutdown 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 b/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
index c5fbc2c..da19c43 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_read_ahead 3"
-.TH SSL_CTX_set_read_ahead 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_read_ahead 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 b/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
index 40585e6..1881c7e 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_session_cache_mode 3"
-.TH SSL_CTX_set_session_cache_mode 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_session_cache_mode 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 b/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
index 1ade776..d93a804 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_session_id_context 3"
-.TH SSL_CTX_set_session_id_context 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_session_id_context 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 b/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
index c3037c8..9339a29 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_ssl_version 3"
-.TH SSL_CTX_set_ssl_version 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_ssl_version 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_timeout.3 b/secure/lib/libssl/man/SSL_CTX_set_timeout.3
index 6b085c8..121cc04 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_timeout.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_timeout.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_timeout 3"
-.TH SSL_CTX_set_timeout 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_timeout 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 b/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
index ca7e7aa..3d730ef 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tlsext_ticket_key_cb 3"
-.TH SSL_CTX_set_tlsext_ticket_key_cb 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_tlsext_ticket_key_cb 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
index 22e2e6b..fc01487 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tmp_dh_callback 3"
-.TH SSL_CTX_set_tmp_dh_callback 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_tmp_dh_callback 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 b/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
index efd8ee0..0eda38b 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_tmp_rsa_callback 3"
-.TH SSL_CTX_set_tmp_rsa_callback 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_tmp_rsa_callback 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_set_verify.3 b/secure/lib/libssl/man/SSL_CTX_set_verify.3
index 6a5961e..ea67828 100644
--- a/secure/lib/libssl/man/SSL_CTX_set_verify.3
+++ b/secure/lib/libssl/man/SSL_CTX_set_verify.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_set_verify 3"
-.TH SSL_CTX_set_verify 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_set_verify 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_certificate.3 b/secure/lib/libssl/man/SSL_CTX_use_certificate.3
index c5c6eea..1e5b7e8 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_certificate.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_certificate.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_certificate 3"
-.TH SSL_CTX_use_certificate 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_use_certificate 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 b/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
index 3061fbc..198578b 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_psk_identity_hint 3"
-.TH SSL_CTX_use_psk_identity_hint 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_use_psk_identity_hint 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 b/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3
index 124d00a..948529c 100644
--- a/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3
+++ b/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_CTX_use_serverinfo 3"
-.TH SSL_CTX_use_serverinfo 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_CTX_use_serverinfo 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_free.3 b/secure/lib/libssl/man/SSL_SESSION_free.3
index 31dc630..03d8b0e 100644
--- a/secure/lib/libssl/man/SSL_SESSION_free.3
+++ b/secure/lib/libssl/man/SSL_SESSION_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_free 3"
-.TH SSL_SESSION_free 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_SESSION_free 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
index f84542d..2932782 100644
--- a/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_get_ex_new_index 3"
-.TH SSL_SESSION_get_ex_new_index 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_SESSION_get_ex_new_index 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_SESSION_get_time.3 b/secure/lib/libssl/man/SSL_SESSION_get_time.3
index 5dc18e6..0878ddc 100644
--- a/secure/lib/libssl/man/SSL_SESSION_get_time.3
+++ b/secure/lib/libssl/man/SSL_SESSION_get_time.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_SESSION_get_time 3"
-.TH SSL_SESSION_get_time 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_SESSION_get_time 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_accept.3 b/secure/lib/libssl/man/SSL_accept.3
index 9c9608a..85b68a2 100644
--- a/secure/lib/libssl/man/SSL_accept.3
+++ b/secure/lib/libssl/man/SSL_accept.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_accept 3"
-.TH SSL_accept 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_accept 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_alert_type_string.3 b/secure/lib/libssl/man/SSL_alert_type_string.3
index f4d2f4e..59571f2 100644
--- a/secure/lib/libssl/man/SSL_alert_type_string.3
+++ b/secure/lib/libssl/man/SSL_alert_type_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_alert_type_string 3"
-.TH SSL_alert_type_string 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_alert_type_string 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_check_chain.3 b/secure/lib/libssl/man/SSL_check_chain.3
new file mode 100644
index 0000000..afd73e5
--- /dev/null
+++ b/secure/lib/libssl/man/SSL_check_chain.3
@@ -0,0 +1,217 @@
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings. \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote. \*(C+ will
+.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+. ds -- \(*W-
+. ds PI pi
+. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
+. ds L" ""
+. ds R" ""
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds -- \|\(em\|
+. ds PI \(*p
+. ds L" ``
+. ds R" ''
+. ds C`
+. ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is turned on, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{
+. if \nF \{
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. if !\nF==2 \{
+. nr % 0
+. nr F 2
+. \}
+. \}
+.\}
+.rr rF
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear. Run. Save yourself. No user-serviceable parts.
+. \" fudge factors for nroff and troff
+.if n \{\
+. ds #H 0
+. ds #V .8m
+. ds #F .3m
+. ds #[ \f1
+. ds #] \fP
+.\}
+.if t \{\
+. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+. ds #V .6m
+. ds #F 0
+. ds #[ \&
+. ds #] \&
+.\}
+. \" simple accents for nroff and troff
+.if n \{\
+. ds ' \&
+. ds ` \&
+. ds ^ \&
+. ds , \&
+. ds ~ ~
+. ds /
+.\}
+.if t \{\
+. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+. \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+. \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+. \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+. ds : e
+. ds 8 ss
+. ds o a
+. ds d- d\h'-1'\(ga
+. ds D- D\h'-1'\(hy
+. ds th \o'bp'
+. ds Th \o'LP'
+. ds ae ae
+. ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "SSL_check_chain 3"
+.TH SSL_check_chain 3 "2015-12-03" "1.0.2e" "OpenSSL"
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+SSL_check_chain \- check certificate chain suitability
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+.Vb 1
+\& #include <openssl/ssl.h>
+\&
+\& int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);
+.Ve
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fISSL_check_chain()\fR checks whether certificate \fBx\fR, private key \fBpk\fR and
+certificate chain \fBchain\fR is suitable for use with the current session
+\&\fBs\fR.
+.SH "RETURN VALUES"
+.IX Header "RETURN VALUES"
+\&\fISSL_check_chain()\fR returns a bitmap of flags indicating the validity of the
+chain.
+.PP
+\&\fB\s-1CERT_PKEY_VALID\s0\fR: the chain can be used with the current session.
+If this flag is \fBnot\fR set then the certificate will never be used even
+if the application tries to set it because it is inconsistent with the
+peer preferences.
+.PP
+\&\fB\s-1CERT_PKEY_SIGN\s0\fR: the \s-1EE\s0 key can be used for signing.
+.PP
+\&\fB\s-1CERT_PKEY_EE_SIGNATURE\s0\fR: the signature algorithm of the \s-1EE\s0 certificate is
+acceptable.
+.PP
+\&\fB\s-1CERT_PKEY_CA_SIGNATURE\s0\fR: the signature algorithms of all \s-1CA\s0 certificates
+are acceptable.
+.PP
+\&\fB\s-1CERT_PKEY_EE_PARAM\s0\fR: the parameters of the end entity certificate are
+acceptable (e.g. it is a supported curve).
+.PP
+\&\fB\s-1CERT_PKEY_CA_PARAM\s0\fR: the parameters of all \s-1CA\s0 certificates are acceptable.
+.PP
+\&\fB\s-1CERT_PKEY_EXPLICIT_SIGN\s0\fR: the end entity certificate algorithm
+can be used explicitly for signing (i.e. it is mentioned in the signature
+algorithms extension).
+.PP
+\&\fB\s-1CERT_PKEY_ISSUER_NAME\s0\fR: the issuer name is acceptable. This is only
+meaningful for client authentication.
+.PP
+\&\fB\s-1CERT_PKEY_CERT_TYPE\s0\fR: the certificate type is acceptable. Only meaningful
+for client authentication.
+.PP
+\&\fB\s-1CERT_PKEY_SUITEB\s0\fR: chain is suitable for Suite B use.
+.SH "NOTES"
+.IX Header "NOTES"
+\&\fISSL_check_chain()\fR must be called in servers after a client hello message or in
+clients after a certificate request message. It will typically be called
+in the certificate callback.
+.PP
+An application wishing to support multiple certificate chains may call this
+function on each chain in turn: starting with the one it considers the
+most secure. It could then use the chain of the first set which returns
+suitable flags.
+.PP
+As a minimum the flag \fB\s-1CERT_PKEY_VALID\s0\fR must be set for a chain to be
+usable. An application supporting multiple chains with different \s-1CA\s0 signature
+algorithms may also wish to check \fB\s-1CERT_PKEY_CA_SIGNATURE\s0\fR too. If no
+chain is suitable a server should fall back to the most secure chain which
+sets \fB\s-1CERT_PKEY_VALID\s0\fR.
+.PP
+The validity of a chain is determined by checking if it matches a supported
+signature algorithm, supported curves and in the case of client authentication
+certificate types and issuer names.
+.PP
+Since the supported signature algorithms extension is only used in \s-1TLS 1.2\s0
+and \s-1DTLS 1.2\s0 the results for earlier versions of \s-1TLS\s0 and \s-1DTLS\s0 may not be
+very useful. Applications may wish to specify a different \*(L"legacy\*(R" chain
+for earlier versions of \s-1TLS\s0 or \s-1DTLS.\s0
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fISSL_CTX_set_cert_cb\fR\|(3),
+\&\fIssl\fR\|(3)
diff --git a/secure/lib/libssl/man/SSL_clear.3 b/secure/lib/libssl/man/SSL_clear.3
index 26bca44..8889174 100644
--- a/secure/lib/libssl/man/SSL_clear.3
+++ b/secure/lib/libssl/man/SSL_clear.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_clear 3"
-.TH SSL_clear 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_clear 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_connect.3 b/secure/lib/libssl/man/SSL_connect.3
index a1039ba..748c3f5 100644
--- a/secure/lib/libssl/man/SSL_connect.3
+++ b/secure/lib/libssl/man/SSL_connect.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_connect 3"
-.TH SSL_connect 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_connect 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_do_handshake.3 b/secure/lib/libssl/man/SSL_do_handshake.3
index 5471b70..988ae4d 100644
--- a/secure/lib/libssl/man/SSL_do_handshake.3
+++ b/secure/lib/libssl/man/SSL_do_handshake.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_do_handshake 3"
-.TH SSL_do_handshake 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_do_handshake 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_free.3 b/secure/lib/libssl/man/SSL_free.3
index 1c87807..cb704d5 100644
--- a/secure/lib/libssl/man/SSL_free.3
+++ b/secure/lib/libssl/man/SSL_free.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_free 3"
-.TH SSL_free 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_free 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_SSL_CTX.3 b/secure/lib/libssl/man/SSL_get_SSL_CTX.3
index 2960a43..c36c734 100644
--- a/secure/lib/libssl/man/SSL_get_SSL_CTX.3
+++ b/secure/lib/libssl/man/SSL_get_SSL_CTX.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_SSL_CTX 3"
-.TH SSL_get_SSL_CTX 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_SSL_CTX 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ciphers.3 b/secure/lib/libssl/man/SSL_get_ciphers.3
index 37fa048..6eee14f 100644
--- a/secure/lib/libssl/man/SSL_get_ciphers.3
+++ b/secure/lib/libssl/man/SSL_get_ciphers.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ciphers 3"
-.TH SSL_get_ciphers 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_ciphers 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_client_CA_list.3 b/secure/lib/libssl/man/SSL_get_client_CA_list.3
index 370f86f..6294a42 100644
--- a/secure/lib/libssl/man/SSL_get_client_CA_list.3
+++ b/secure/lib/libssl/man/SSL_get_client_CA_list.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_client_CA_list 3"
-.TH SSL_get_client_CA_list 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_client_CA_list 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_current_cipher.3 b/secure/lib/libssl/man/SSL_get_current_cipher.3
index 1c27046..8fa10a6 100644
--- a/secure/lib/libssl/man/SSL_get_current_cipher.3
+++ b/secure/lib/libssl/man/SSL_get_current_cipher.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_current_cipher 3"
-.TH SSL_get_current_cipher 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_current_cipher 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_default_timeout.3 b/secure/lib/libssl/man/SSL_get_default_timeout.3
index bfa05ef..24835f0 100644
--- a/secure/lib/libssl/man/SSL_get_default_timeout.3
+++ b/secure/lib/libssl/man/SSL_get_default_timeout.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_default_timeout 3"
-.TH SSL_get_default_timeout 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_default_timeout 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_error.3 b/secure/lib/libssl/man/SSL_get_error.3
index 68201a0..5c2485d 100644
--- a/secure/lib/libssl/man/SSL_get_error.3
+++ b/secure/lib/libssl/man/SSL_get_error.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_error 3"
-.TH SSL_get_error 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_error 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 b/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
index 0f067ed..7db9989 100644
--- a/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
+++ b/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ex_data_X509_STORE_CTX_idx 3"
-.TH SSL_get_ex_data_X509_STORE_CTX_idx 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_ex_data_X509_STORE_CTX_idx 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_ex_new_index.3 b/secure/lib/libssl/man/SSL_get_ex_new_index.3
index 3a7177c..f4aae89 100644
--- a/secure/lib/libssl/man/SSL_get_ex_new_index.3
+++ b/secure/lib/libssl/man/SSL_get_ex_new_index.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_ex_new_index 3"
-.TH SSL_get_ex_new_index 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_ex_new_index 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_fd.3 b/secure/lib/libssl/man/SSL_get_fd.3
index 1660074..5f49b89 100644
--- a/secure/lib/libssl/man/SSL_get_fd.3
+++ b/secure/lib/libssl/man/SSL_get_fd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_fd 3"
-.TH SSL_get_fd 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_fd 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 b/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
index 3659142..90fa8cf 100644
--- a/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
+++ b/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_peer_cert_chain 3"
-.TH SSL_get_peer_cert_chain 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_peer_cert_chain 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_peer_certificate.3 b/secure/lib/libssl/man/SSL_get_peer_certificate.3
index 2199634..d3f83bc 100644
--- a/secure/lib/libssl/man/SSL_get_peer_certificate.3
+++ b/secure/lib/libssl/man/SSL_get_peer_certificate.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_peer_certificate 3"
-.TH SSL_get_peer_certificate 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_peer_certificate 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_psk_identity.3 b/secure/lib/libssl/man/SSL_get_psk_identity.3
index a67c8a1..918aa1a 100644
--- a/secure/lib/libssl/man/SSL_get_psk_identity.3
+++ b/secure/lib/libssl/man/SSL_get_psk_identity.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_psk_identity 3"
-.TH SSL_get_psk_identity 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_psk_identity 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_rbio.3 b/secure/lib/libssl/man/SSL_get_rbio.3
index 8e2aca5..cf64cc9 100644
--- a/secure/lib/libssl/man/SSL_get_rbio.3
+++ b/secure/lib/libssl/man/SSL_get_rbio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_rbio 3"
-.TH SSL_get_rbio 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_rbio 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_session.3 b/secure/lib/libssl/man/SSL_get_session.3
index 8071642..d4554da 100644
--- a/secure/lib/libssl/man/SSL_get_session.3
+++ b/secure/lib/libssl/man/SSL_get_session.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_session 3"
-.TH SSL_get_session 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_session 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_verify_result.3 b/secure/lib/libssl/man/SSL_get_verify_result.3
index 85bd8a7..8c3aad5 100644
--- a/secure/lib/libssl/man/SSL_get_verify_result.3
+++ b/secure/lib/libssl/man/SSL_get_verify_result.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_verify_result 3"
-.TH SSL_get_verify_result 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_verify_result 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_get_version.3 b/secure/lib/libssl/man/SSL_get_version.3
index faf1c43..7035ce6 100644
--- a/secure/lib/libssl/man/SSL_get_version.3
+++ b/secure/lib/libssl/man/SSL_get_version.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_get_version 3"
-.TH SSL_get_version 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_get_version 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_library_init.3 b/secure/lib/libssl/man/SSL_library_init.3
index bc49f6c..38b95af 100644
--- a/secure/lib/libssl/man/SSL_library_init.3
+++ b/secure/lib/libssl/man/SSL_library_init.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_library_init 3"
-.TH SSL_library_init 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_library_init 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_load_client_CA_file.3 b/secure/lib/libssl/man/SSL_load_client_CA_file.3
index 4382fea..61b43a0 100644
--- a/secure/lib/libssl/man/SSL_load_client_CA_file.3
+++ b/secure/lib/libssl/man/SSL_load_client_CA_file.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_load_client_CA_file 3"
-.TH SSL_load_client_CA_file 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_load_client_CA_file 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_new.3 b/secure/lib/libssl/man/SSL_new.3
index a6a5319..7ed2114 100644
--- a/secure/lib/libssl/man/SSL_new.3
+++ b/secure/lib/libssl/man/SSL_new.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_new 3"
-.TH SSL_new 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_new 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_pending.3 b/secure/lib/libssl/man/SSL_pending.3
index 1f25900..d3903fc 100644
--- a/secure/lib/libssl/man/SSL_pending.3
+++ b/secure/lib/libssl/man/SSL_pending.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_pending 3"
-.TH SSL_pending 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_pending 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_read.3 b/secure/lib/libssl/man/SSL_read.3
index 9f899c5..8fc6323 100644
--- a/secure/lib/libssl/man/SSL_read.3
+++ b/secure/lib/libssl/man/SSL_read.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_read 3"
-.TH SSL_read 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_read 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_rstate_string.3 b/secure/lib/libssl/man/SSL_rstate_string.3
index ba560a5..57095dd 100644
--- a/secure/lib/libssl/man/SSL_rstate_string.3
+++ b/secure/lib/libssl/man/SSL_rstate_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_rstate_string 3"
-.TH SSL_rstate_string 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_rstate_string 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_session_reused.3 b/secure/lib/libssl/man/SSL_session_reused.3
index c977ef6..4bd1b89 100644
--- a/secure/lib/libssl/man/SSL_session_reused.3
+++ b/secure/lib/libssl/man/SSL_session_reused.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_session_reused 3"
-.TH SSL_session_reused 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_session_reused 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_bio.3 b/secure/lib/libssl/man/SSL_set_bio.3
index d097281..ec6fd41 100644
--- a/secure/lib/libssl/man/SSL_set_bio.3
+++ b/secure/lib/libssl/man/SSL_set_bio.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_bio 3"
-.TH SSL_set_bio 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_set_bio 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_connect_state.3 b/secure/lib/libssl/man/SSL_set_connect_state.3
index 0fe480a..5e2fed8 100644
--- a/secure/lib/libssl/man/SSL_set_connect_state.3
+++ b/secure/lib/libssl/man/SSL_set_connect_state.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_connect_state 3"
-.TH SSL_set_connect_state 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_set_connect_state 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_fd.3 b/secure/lib/libssl/man/SSL_set_fd.3
index 56bde1d..5cb627c 100644
--- a/secure/lib/libssl/man/SSL_set_fd.3
+++ b/secure/lib/libssl/man/SSL_set_fd.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_fd 3"
-.TH SSL_set_fd 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_set_fd 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_session.3 b/secure/lib/libssl/man/SSL_set_session.3
index 63eecd5..7c9b269 100644
--- a/secure/lib/libssl/man/SSL_set_session.3
+++ b/secure/lib/libssl/man/SSL_set_session.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_session 3"
-.TH SSL_set_session 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_set_session 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_shutdown.3 b/secure/lib/libssl/man/SSL_set_shutdown.3
index 6c401f4..8983bfa 100644
--- a/secure/lib/libssl/man/SSL_set_shutdown.3
+++ b/secure/lib/libssl/man/SSL_set_shutdown.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_shutdown 3"
-.TH SSL_set_shutdown 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_set_shutdown 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_set_verify_result.3 b/secure/lib/libssl/man/SSL_set_verify_result.3
index f0ce4c3..6492b9d 100644
--- a/secure/lib/libssl/man/SSL_set_verify_result.3
+++ b/secure/lib/libssl/man/SSL_set_verify_result.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_set_verify_result 3"
-.TH SSL_set_verify_result 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_set_verify_result 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_shutdown.3 b/secure/lib/libssl/man/SSL_shutdown.3
index cef5bfb..7975e98 100644
--- a/secure/lib/libssl/man/SSL_shutdown.3
+++ b/secure/lib/libssl/man/SSL_shutdown.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_shutdown 3"
-.TH SSL_shutdown 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_shutdown 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_state_string.3 b/secure/lib/libssl/man/SSL_state_string.3
index f9ecb1e..f8aad0c 100644
--- a/secure/lib/libssl/man/SSL_state_string.3
+++ b/secure/lib/libssl/man/SSL_state_string.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_state_string 3"
-.TH SSL_state_string 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_state_string 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_want.3 b/secure/lib/libssl/man/SSL_want.3
index b45588f..417f2fc 100644
--- a/secure/lib/libssl/man/SSL_want.3
+++ b/secure/lib/libssl/man/SSL_want.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_want 3"
-.TH SSL_want 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_want 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/SSL_write.3 b/secure/lib/libssl/man/SSL_write.3
index 8b258da..d1e018d 100644
--- a/secure/lib/libssl/man/SSL_write.3
+++ b/secure/lib/libssl/man/SSL_write.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SSL_write 3"
-.TH SSL_write 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SSL_write 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/d2i_SSL_SESSION.3 b/secure/lib/libssl/man/d2i_SSL_SESSION.3
index 02f691e..746576e 100644
--- a/secure/lib/libssl/man/d2i_SSL_SESSION.3
+++ b/secure/lib/libssl/man/d2i_SSL_SESSION.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "d2i_SSL_SESSION 3"
-.TH d2i_SSL_SESSION 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH d2i_SSL_SESSION 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/lib/libssl/man/ssl.3 b/secure/lib/libssl/man/ssl.3
index c155431..90fd9fb 100644
--- a/secure/lib/libssl/man/ssl.3
+++ b/secure/lib/libssl/man/ssl.3
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ssl 3"
-.TH ssl 3 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ssl 3 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/CA.pl.1 b/secure/usr.bin/openssl/man/CA.pl.1
index d70ef8c..1a9f97a 100644
--- a/secure/usr.bin/openssl/man/CA.pl.1
+++ b/secure/usr.bin/openssl/man/CA.pl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CA.PL 1"
-.TH CA.PL 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CA.PL 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/asn1parse.1 b/secure/usr.bin/openssl/man/asn1parse.1
index 5b30f3d..f02283d 100644
--- a/secure/usr.bin/openssl/man/asn1parse.1
+++ b/secure/usr.bin/openssl/man/asn1parse.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ASN1PARSE 1"
-.TH ASN1PARSE 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ASN1PARSE 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/c_rehash.1 b/secure/usr.bin/openssl/man/c_rehash.1
index 1f26bb3..b13de85 100644
--- a/secure/usr.bin/openssl/man/c_rehash.1
+++ b/secure/usr.bin/openssl/man/c_rehash.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "C_REHASH 1"
-.TH C_REHASH 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH C_REHASH 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ca.1 b/secure/usr.bin/openssl/man/ca.1
index 0026b4c..1d55714 100644
--- a/secure/usr.bin/openssl/man/ca.1
+++ b/secure/usr.bin/openssl/man/ca.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CA 1"
-.TH CA 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CA 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ciphers.1 b/secure/usr.bin/openssl/man/ciphers.1
index ff87f0d..934ce08 100644
--- a/secure/usr.bin/openssl/man/ciphers.1
+++ b/secure/usr.bin/openssl/man/ciphers.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CIPHERS 1"
-.TH CIPHERS 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CIPHERS 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/cms.1 b/secure/usr.bin/openssl/man/cms.1
index bb4dae5..8c862b9 100644
--- a/secure/usr.bin/openssl/man/cms.1
+++ b/secure/usr.bin/openssl/man/cms.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CMS 1"
-.TH CMS 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CMS 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/crl.1 b/secure/usr.bin/openssl/man/crl.1
index 352499a..6e58472 100644
--- a/secure/usr.bin/openssl/man/crl.1
+++ b/secure/usr.bin/openssl/man/crl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRL 1"
-.TH CRL 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CRL 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/crl2pkcs7.1 b/secure/usr.bin/openssl/man/crl2pkcs7.1
index a768c92..fa7eb92 100644
--- a/secure/usr.bin/openssl/man/crl2pkcs7.1
+++ b/secure/usr.bin/openssl/man/crl2pkcs7.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "CRL2PKCS7 1"
-.TH CRL2PKCS7 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH CRL2PKCS7 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dgst.1 b/secure/usr.bin/openssl/man/dgst.1
index fdf1535..fa01ddd 100644
--- a/secure/usr.bin/openssl/man/dgst.1
+++ b/secure/usr.bin/openssl/man/dgst.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DGST 1"
-.TH DGST 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DGST 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -149,7 +149,6 @@ dgst, sha, sha1, mdc2, ripemd160, sha224, sha256, sha384, sha512, md2, md4, md5,
[\fB\-hex\fR]
[\fB\-binary\fR]
[\fB\-r\fR]
-[\fB\-hmac arg\fR]
[\fB\-non\-fips\-allow\fR]
[\fB\-out filename\fR]
[\fB\-sign filename\fR]
@@ -191,9 +190,6 @@ output the digest or signature in binary form.
.IP "\fB\-r\fR" 4
.IX Item "-r"
output the digest in the \*(L"coreutils\*(R" format used by programs like \fBsha1sum\fR.
-.IP "\fB\-hmac arg\fR" 4
-.IX Item "-hmac arg"
-set the \s-1HMAC\s0 key to \*(L"arg\*(R".
.IP "\fB\-non\-fips\-allow\fR" 4
.IX Item "-non-fips-allow"
Allow use of non \s-1FIPS\s0 digest when in \s-1FIPS\s0 mode. This has no effect when not in
diff --git a/secure/usr.bin/openssl/man/dhparam.1 b/secure/usr.bin/openssl/man/dhparam.1
index e89a351..601ba5c 100644
--- a/secure/usr.bin/openssl/man/dhparam.1
+++ b/secure/usr.bin/openssl/man/dhparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DHPARAM 1"
-.TH DHPARAM 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DHPARAM 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dsa.1 b/secure/usr.bin/openssl/man/dsa.1
index da5df42..0bceba9 100644
--- a/secure/usr.bin/openssl/man/dsa.1
+++ b/secure/usr.bin/openssl/man/dsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSA 1"
-.TH DSA 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSA 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/dsaparam.1 b/secure/usr.bin/openssl/man/dsaparam.1
index 20e8e68..d09fba7 100644
--- a/secure/usr.bin/openssl/man/dsaparam.1
+++ b/secure/usr.bin/openssl/man/dsaparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "DSAPARAM 1"
-.TH DSAPARAM 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH DSAPARAM 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ec.1 b/secure/usr.bin/openssl/man/ec.1
index 24ced4b..bec981f 100644
--- a/secure/usr.bin/openssl/man/ec.1
+++ b/secure/usr.bin/openssl/man/ec.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "EC 1"
-.TH EC 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH EC 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ecparam.1 b/secure/usr.bin/openssl/man/ecparam.1
index a615b3f..81bf55d 100644
--- a/secure/usr.bin/openssl/man/ecparam.1
+++ b/secure/usr.bin/openssl/man/ecparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ECPARAM 1"
-.TH ECPARAM 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ECPARAM 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/enc.1 b/secure/usr.bin/openssl/man/enc.1
index c119e7e..27bd55d 100644
--- a/secure/usr.bin/openssl/man/enc.1
+++ b/secure/usr.bin/openssl/man/enc.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ENC 1"
-.TH ENC 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ENC 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/errstr.1 b/secure/usr.bin/openssl/man/errstr.1
index c4f1e0a..1c171c0 100644
--- a/secure/usr.bin/openssl/man/errstr.1
+++ b/secure/usr.bin/openssl/man/errstr.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "ERRSTR 1"
-.TH ERRSTR 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH ERRSTR 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/gendsa.1 b/secure/usr.bin/openssl/man/gendsa.1
index 642e7ad..9c95a77 100644
--- a/secure/usr.bin/openssl/man/gendsa.1
+++ b/secure/usr.bin/openssl/man/gendsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENDSA 1"
-.TH GENDSA 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH GENDSA 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/genpkey.1 b/secure/usr.bin/openssl/man/genpkey.1
index fd2264e..15cd25b 100644
--- a/secure/usr.bin/openssl/man/genpkey.1
+++ b/secure/usr.bin/openssl/man/genpkey.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENPKEY 1"
-.TH GENPKEY 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH GENPKEY 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/genrsa.1 b/secure/usr.bin/openssl/man/genrsa.1
index a701f16..94fbcb4 100644
--- a/secure/usr.bin/openssl/man/genrsa.1
+++ b/secure/usr.bin/openssl/man/genrsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "GENRSA 1"
-.TH GENRSA 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH GENRSA 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -146,12 +146,6 @@ genrsa \- generate an RSA private key
[\fB\-out filename\fR]
[\fB\-passout arg\fR]
[\fB\-aes128\fR]
-[\fB\-aes128\fR]
-[\fB\-aes192\fR]
-[\fB\-aes256\fR]
-[\fB\-camellia128\fR]
-[\fB\-camellia192\fR]
-[\fB\-camellia256\fR]
[\fB\-aes192\fR]
[\fB\-aes256\fR]
[\fB\-camellia128\fR]
diff --git a/secure/usr.bin/openssl/man/nseq.1 b/secure/usr.bin/openssl/man/nseq.1
index 990d4f7..a760b1d 100644
--- a/secure/usr.bin/openssl/man/nseq.1
+++ b/secure/usr.bin/openssl/man/nseq.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "NSEQ 1"
-.TH NSEQ 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH NSEQ 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ocsp.1 b/secure/usr.bin/openssl/man/ocsp.1
index f99ce3b..fc08fef 100644
--- a/secure/usr.bin/openssl/man/ocsp.1
+++ b/secure/usr.bin/openssl/man/ocsp.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OCSP 1"
-.TH OCSP 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OCSP 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/openssl.1 b/secure/usr.bin/openssl/man/openssl.1
index b307e03..f8e9017 100644
--- a/secure/usr.bin/openssl/man/openssl.1
+++ b/secure/usr.bin/openssl/man/openssl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "OPENSSL 1"
-.TH OPENSSL 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH OPENSSL 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/passwd.1 b/secure/usr.bin/openssl/man/passwd.1
index 54e355a..a65ad30 100644
--- a/secure/usr.bin/openssl/man/passwd.1
+++ b/secure/usr.bin/openssl/man/passwd.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PASSWD 1"
-.TH PASSWD 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PASSWD 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs12.1 b/secure/usr.bin/openssl/man/pkcs12.1
index 85e4b73..7f0e7ce 100644
--- a/secure/usr.bin/openssl/man/pkcs12.1
+++ b/secure/usr.bin/openssl/man/pkcs12.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS12 1"
-.TH PKCS12 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS12 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -312,7 +312,7 @@ key is encrypted using triple \s-1DES\s0 and the certificate using 40 bit \s-1RC
.IX Item "-keypbe alg, -certpbe alg"
these options allow the algorithm used to encrypt the private key and
certificates to be selected. Any PKCS#5 v1.5 or PKCS#12 \s-1PBE\s0 algorithm name
-can be used (see \fB\s-1NOTES\s0\fR section for more information). If a a cipher name
+can be used (see \fB\s-1NOTES\s0\fR section for more information). If a cipher name
(as output by the \fBlist-cipher-algorithms\fR command is specified then it
is used with PKCS#5 v2.0. For interoperability reasons it is advisable to only
use PKCS#12 algorithms.
diff --git a/secure/usr.bin/openssl/man/pkcs7.1 b/secure/usr.bin/openssl/man/pkcs7.1
index d077174..0022246 100644
--- a/secure/usr.bin/openssl/man/pkcs7.1
+++ b/secure/usr.bin/openssl/man/pkcs7.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS7 1"
-.TH PKCS7 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS7 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkcs8.1 b/secure/usr.bin/openssl/man/pkcs8.1
index 5e3dfab..11d9d0e 100644
--- a/secure/usr.bin/openssl/man/pkcs8.1
+++ b/secure/usr.bin/openssl/man/pkcs8.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKCS8 1"
-.TH PKCS8 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKCS8 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkey.1 b/secure/usr.bin/openssl/man/pkey.1
index 77b824c..3198c5a 100644
--- a/secure/usr.bin/openssl/man/pkey.1
+++ b/secure/usr.bin/openssl/man/pkey.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEY 1"
-.TH PKEY 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKEY 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkeyparam.1 b/secure/usr.bin/openssl/man/pkeyparam.1
index 2df7904..7be5d4c 100644
--- a/secure/usr.bin/openssl/man/pkeyparam.1
+++ b/secure/usr.bin/openssl/man/pkeyparam.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEYPARAM 1"
-.TH PKEYPARAM 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKEYPARAM 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/pkeyutl.1 b/secure/usr.bin/openssl/man/pkeyutl.1
index 64ec80e..fe398ff 100644
--- a/secure/usr.bin/openssl/man/pkeyutl.1
+++ b/secure/usr.bin/openssl/man/pkeyutl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "PKEYUTL 1"
-.TH PKEYUTL 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH PKEYUTL 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rand.1 b/secure/usr.bin/openssl/man/rand.1
index a1c30f6..788373c 100644
--- a/secure/usr.bin/openssl/man/rand.1
+++ b/secure/usr.bin/openssl/man/rand.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RAND 1"
-.TH RAND 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RAND 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/req.1 b/secure/usr.bin/openssl/man/req.1
index a404c1c..d173049 100644
--- a/secure/usr.bin/openssl/man/req.1
+++ b/secure/usr.bin/openssl/man/req.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "REQ 1"
-.TH REQ 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH REQ 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -165,7 +165,6 @@ req \- PKCS#10 certificate request and certificate generating utility.
[\fB\-keygen_engine id\fR]
[\fB\-[digest]\fR]
[\fB\-config filename\fR]
-[\fB\-subj arg\fR]
[\fB\-multivalue\-rdn\fR]
[\fB\-x509\fR]
[\fB\-days n\fR]
@@ -564,7 +563,7 @@ be input by calling it \*(L"1.organizationName\*(R".
The actual permitted field names are any object identifier short or
long names. These are compiled into OpenSSL and include the usual
values such as commonName, countryName, localityName, organizationName,
-organizationUnitName, stateOrProvinceName. Additionally emailAddress
+organizationalUnitName, stateOrProvinceName. Additionally emailAddress
is include as well as name, surname, givenName initials and dnQualifier.
.PP
Additional object identifiers can be defined with the \fBoid_file\fR or
@@ -581,20 +580,20 @@ Examine and verify certificate request:
Create a private key and then generate a certificate request from it:
.PP
.Vb 2
-\& openssl genrsa \-out key.pem 1024
+\& openssl genrsa \-out key.pem 2048
\& openssl req \-new \-key key.pem \-out req.pem
.Ve
.PP
The same but just using req:
.PP
.Vb 1
-\& openssl req \-newkey rsa:1024 \-keyout key.pem \-out req.pem
+\& openssl req \-newkey rsa:2048 \-keyout key.pem \-out req.pem
.Ve
.PP
Generate a self signed root certificate:
.PP
.Vb 1
-\& openssl req \-x509 \-newkey rsa:1024 \-keyout key.pem \-out req.pem
+\& openssl req \-x509 \-newkey rsa:2048 \-keyout key.pem \-out req.pem
.Ve
.PP
Example of a file pointed to by the \fBoid_file\fR option:
@@ -616,7 +615,7 @@ Sample configuration file prompting for field values:
.PP
.Vb 6
\& [ req ]
-\& default_bits = 1024
+\& default_bits = 2048
\& default_keyfile = privkey.pem
\& distinguished_name = req_distinguished_name
\& attributes = req_attributes
@@ -658,7 +657,7 @@ Sample configuration containing all field values:
\& RANDFILE = $ENV::HOME/.rnd
\&
\& [ req ]
-\& default_bits = 1024
+\& default_bits = 2048
\& default_keyfile = keyfile.pem
\& distinguished_name = req_distinguished_name
\& attributes = req_attributes
diff --git a/secure/usr.bin/openssl/man/rsa.1 b/secure/usr.bin/openssl/man/rsa.1
index 339cbf8..0feeb41 100644
--- a/secure/usr.bin/openssl/man/rsa.1
+++ b/secure/usr.bin/openssl/man/rsa.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSA 1"
-.TH RSA 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSA 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/rsautl.1 b/secure/usr.bin/openssl/man/rsautl.1
index b9cc868..76d0a68 100644
--- a/secure/usr.bin/openssl/man/rsautl.1
+++ b/secure/usr.bin/openssl/man/rsautl.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "RSAUTL 1"
-.TH RSAUTL 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH RSAUTL 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/s_client.1 b/secure/usr.bin/openssl/man/s_client.1
index 31064e2..bfed887 100644
--- a/secure/usr.bin/openssl/man/s_client.1
+++ b/secure/usr.bin/openssl/man/s_client.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_CLIENT 1"
-.TH S_CLIENT 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH S_CLIENT 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/s_server.1 b/secure/usr.bin/openssl/man/s_server.1
index 0f3b3c1..ec7ad93 100644
--- a/secure/usr.bin/openssl/man/s_server.1
+++ b/secure/usr.bin/openssl/man/s_server.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_SERVER 1"
-.TH S_SERVER 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH S_SERVER 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/s_time.1 b/secure/usr.bin/openssl/man/s_time.1
index 38a26e9..4d2026f 100644
--- a/secure/usr.bin/openssl/man/s_time.1
+++ b/secure/usr.bin/openssl/man/s_time.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "S_TIME 1"
-.TH S_TIME 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH S_TIME 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/sess_id.1 b/secure/usr.bin/openssl/man/sess_id.1
index 365ece1..fe6a3c9 100644
--- a/secure/usr.bin/openssl/man/sess_id.1
+++ b/secure/usr.bin/openssl/man/sess_id.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SESS_ID 1"
-.TH SESS_ID 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SESS_ID 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/smime.1 b/secure/usr.bin/openssl/man/smime.1
index 3c97bbd..943717f 100644
--- a/secure/usr.bin/openssl/man/smime.1
+++ b/secure/usr.bin/openssl/man/smime.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SMIME 1"
-.TH SMIME 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SMIME 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/speed.1 b/secure/usr.bin/openssl/man/speed.1
index 5eb4866..217b068 100644
--- a/secure/usr.bin/openssl/man/speed.1
+++ b/secure/usr.bin/openssl/man/speed.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SPEED 1"
-.TH SPEED 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SPEED 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/spkac.1 b/secure/usr.bin/openssl/man/spkac.1
index e29183f..7fc5fbf 100644
--- a/secure/usr.bin/openssl/man/spkac.1
+++ b/secure/usr.bin/openssl/man/spkac.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SPKAC 1"
-.TH SPKAC 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH SPKAC 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/ts.1 b/secure/usr.bin/openssl/man/ts.1
index 677663d..29357eb 100644
--- a/secure/usr.bin/openssl/man/ts.1
+++ b/secure/usr.bin/openssl/man/ts.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "TS 1"
-.TH TS 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH TS 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/tsget.1 b/secure/usr.bin/openssl/man/tsget.1
index b8baff5..8bbec0d 100644
--- a/secure/usr.bin/openssl/man/tsget.1
+++ b/secure/usr.bin/openssl/man/tsget.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "TSGET 1"
-.TH TSGET 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH TSGET 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/verify.1 b/secure/usr.bin/openssl/man/verify.1
index 0b8fa29..c987a55 100644
--- a/secure/usr.bin/openssl/man/verify.1
+++ b/secure/usr.bin/openssl/man/verify.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "VERIFY 1"
-.TH VERIFY 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH VERIFY 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/version.1 b/secure/usr.bin/openssl/man/version.1
index 401bde5..1e22bab 100644
--- a/secure/usr.bin/openssl/man/version.1
+++ b/secure/usr.bin/openssl/man/version.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "VERSION 1"
-.TH VERSION 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH VERSION 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/secure/usr.bin/openssl/man/x509.1 b/secure/usr.bin/openssl/man/x509.1
index 27b8a8e..546fd90 100644
--- a/secure/usr.bin/openssl/man/x509.1
+++ b/secure/usr.bin/openssl/man/x509.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509 1"
-.TH X509 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -581,7 +581,8 @@ very rare and their use is discouraged). The options ending in
\&\*(L"space\*(R" additionally place a space after the separator to make it
more readable. The \fBsep_multiline\fR uses a linefeed character for
the \s-1RDN\s0 separator and a spaced \fB+\fR for the \s-1AVA\s0 separator. It also
-indents the fields by four characters.
+indents the fields by four characters. If no field separator is specified
+then \fBsep_comma_plus_space\fR is used by default.
.IP "\fBdn_rev\fR" 4
.IX Item "dn_rev"
reverse the fields of the \s-1DN.\s0 This is required by \s-1RFC2253.\s0 As a side
diff --git a/secure/usr.bin/openssl/man/x509v3_config.1 b/secure/usr.bin/openssl/man/x509v3_config.1
index 3eb624d..d5936ec 100644
--- a/secure/usr.bin/openssl/man/x509v3_config.1
+++ b/secure/usr.bin/openssl/man/x509v3_config.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "X509V3_CONFIG 1"
-.TH X509V3_CONFIG 1 "2015-07-09" "1.0.2d" "OpenSSL"
+.TH X509V3_CONFIG 1 "2015-12-03" "1.0.2e" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/share/dtrace/Makefile.depend b/share/dtrace/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/dtrace/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/examples/libvgl/Makefile.depend b/share/examples/libvgl/Makefile.depend
index 79eb58b..2a82ebb 100644
--- a/share/examples/libvgl/Makefile.depend
+++ b/share/examples/libvgl/Makefile.depend
@@ -2,11 +2,14 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
+ lib/libvgl \
.include <dirdeps.mk>
diff --git a/share/examples/smbfs/Makefile.depend b/share/examples/smbfs/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/examples/smbfs/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/examples/smbfs/print/Makefile.depend b/share/examples/smbfs/print/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/examples/smbfs/print/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/keys/pkg/trusted/Makefile.depend b/share/keys/pkg/trusted/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/keys/pkg/trusted/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/locale-links/Makefile.depend b/share/locale-links/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/locale-links/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 3b75018..1807876 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -521,6 +521,7 @@ MAN= aac.4 \
tws.4 \
tx.4 \
txp.4 \
+ ure.4 \
vale.4 \
vga.4 \
vge.4 \
@@ -710,6 +711,7 @@ MLINKS+=tl.4 if_tl.4
MLINKS+=tun.4 if_tun.4
MLINKS+=tx.4 if_tx.4
MLINKS+=txp.4 if_txp.4
+MLINKS+=ure.4 if_ure.4
MLINKS+=vge.4 if_vge.4
MLINKS+=vlan.4 if_vlan.4
MLINKS+=vxlan.4 if_vxlan.4
diff --git a/share/man/man4/arcmsr.4 b/share/man/man4/arcmsr.4
index b34bbd7..76be39e 100644
--- a/share/man/man4/arcmsr.4
+++ b/share/man/man4/arcmsr.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 18, 2013
+.Dd December 4, 2015
.Dt ARCMSR 4
.Os
.Sh NAME
@@ -94,6 +94,8 @@ ARC-1200
.It
ARC-1201
.It
+ARC-1203
+.It
ARC-1210
.It
ARC-1212
diff --git a/share/man/man4/cxgbe.4 b/share/man/man4/cxgbe.4
index 9a9f868..ea17f35 100644
--- a/share/man/man4/cxgbe.4
+++ b/share/man/man4/cxgbe.4
@@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd March 20, 2014
+.Dd December 2, 2015
.Dt CXGBE 4
.Os
.Sh NAME
@@ -170,6 +170,16 @@ number of CPU cores in the system, whichever is less.
.It Va hw.cxgbe.nofldrxq1g
The number of TOE rx queues to use for a 1Gb port.
The default is 1.
+.It Va hw.cxgbe.num_vis
+The number of virtual interfaces (VIs) created for each port.
+Each virtual interface creates a separate network interface.
+The first virtual interface on each port is required and represents
+the primary network interface on the port.
+Additional virtual interfaces on a port are named vcxgbe (T4) or
+vcxl (T5) and only use a single rx and tx queue.
+Additional virtual interfaces use a single pair of queues
+for rx and tx as well an additional pair of queues for TOE rx and tx.
+The default is 1.
.It Va hw.cxgbe.holdoff_timer_idx_10G
.It Va hw.cxgbe.holdoff_timer_idx_1G
The timer index value to use to delay interrupts.
diff --git a/share/man/man4/ispfw.4 b/share/man/man4/ispfw.4
index 119b675..d6c26ca 100644
--- a/share/man/man4/ispfw.4
+++ b/share/man/man4/ispfw.4
@@ -22,12 +22,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 20, 2000
+.Dd November 30, 2015
.Dt ISPFW 4
.Os
.Sh NAME
.Nm ispfw
-.Nd "Firmware Module for Qlogic based SCSI and FibreChannel SCSI Host Adapters"
+.Nd "Firmware for Qlogic based SPI and FibreChannel SCSI Host Adapters"
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
@@ -44,7 +44,7 @@ ispfw_load="YES"
.Ed
.Sh DESCRIPTION
This trivial driver provides access to firmware sets for the Qlogic
-based SCSI and FibreChannel SCSI Host Adapters.
+based SPI and FibreChannel SCSI Host Adapters.
It may either be
statically linked into the kernel, or loaded as a module.
In either
diff --git a/share/man/man4/miibus.4 b/share/man/man4/miibus.4
index b0f5204..667addf 100644
--- a/share/man/man4/miibus.4
+++ b/share/man/man4/miibus.4
@@ -8,7 +8,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 5, 2015
+.Dd December 1, 2015
.Dt MIIBUS 4
.Os
.Sh NAME
@@ -117,6 +117,8 @@ Texas Instruments ThunderLAN
SMC EtherPower II (83c170)
.It Xr udav 4
Davicom DM9601 USB Ethernet
+.It Xr ure 4
+RealTek RTL8152 USB To Fast Ethernet
.It Xr vge 4
VIA VT612x PCI Gigabit Ethernet
.It Xr vr 4
@@ -177,6 +179,7 @@ but as a result are not well behaved newbus device drivers.
.Xr tl 4 ,
.Xr tx 4 ,
.Xr udav 4 ,
+.Xr ure 4 ,
.Xr vge 4 ,
.Xr vr 4 ,
.Xr vte 4 ,
diff --git a/share/man/man4/mlx5en.4 b/share/man/man4/mlx5en.4
index 03bb02c..e1b2b6d 100644
--- a/share/man/man4/mlx5en.4
+++ b/share/man/man4/mlx5en.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 22, 2015
+.Dd December 3, 2015
.Dt mlx5en 4
.Os
.Sh NAME
@@ -40,6 +40,12 @@ kernel configuration file:
.Cd "device mlx5en"
.Ed
.Pp
+To load the driver as a module at run-time,
+run the following command as root:
+.Bd -literal -offset indent
+kldload mlx5en
+.Ed
+.Pp
To load the driver as a
module at boot time, place the following lines in
.Xr loader.conf 5 :
diff --git a/share/man/man4/pass.4 b/share/man/man4/pass.4
index 6b4fb1e..140e7df 100644
--- a/share/man/man4/pass.4
+++ b/share/man/man4/pass.4
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 10, 1998
+.Dd March 17, 2015
.Dt PASS 4
.Os
.Sh NAME
@@ -53,9 +53,13 @@ The
.Nm
driver attaches to every
.Tn SCSI
+and
+.Tn ATA
device found in the system.
Since it attaches to every device, it provides a generic means of accessing
.Tn SCSI
+and
+.Tn ATA
devices, and allows the user to access devices which have no
"standard" peripheral driver associated with them.
.Sh KERNEL CONFIGURATION
@@ -65,10 +69,12 @@ device in the kernel;
.Nm
devices are automatically allocated as
.Tn SCSI
+and
+.Tn ATA
devices are found.
.Sh IOCTLS
-.Bl -tag -width 012345678901234
-.It CAMIOCOMMAND
+.Bl -tag -width 5n
+.It CAMIOCOMMAND union ccb *
This ioctl takes most kinds of CAM CCBs and passes them through to the CAM
transport layer for action.
Note that some CCB types are not allowed
@@ -79,7 +85,7 @@ Some examples of xpt-only CCBs are XPT_SCAN_BUS,
XPT_DEV_MATCH, XPT_RESET_BUS, XPT_SCAN_LUN, XPT_ENG_INQ, and XPT_ENG_EXEC.
These CCB types have various attributes that make it illogical or
impossible to service them through the passthrough interface.
-.It CAMGETPASSTHRU
+.It CAMGETPASSTHRU union ccb *
This ioctl takes an XPT_GDEVLIST CCB, and returns the passthrough device
corresponding to the device in question.
Although this ioctl is available through the
@@ -90,6 +96,109 @@ ioctl.
It is probably more useful to issue this ioctl through the
.Xr xpt 4
device.
+.It CAMIOQUEUE union ccb *
+Queue a CCB to the
+.Xr pass 4
+driver to be executed asynchronously.
+The caller may use
+.Xr select 2 ,
+.Xr poll 2
+or
+.Xr kevent 2
+to receive notification when the CCB has completed.
+.Pp
+This ioctl takes most CAM CCBs, but some CCB types are not allowed through
+the pass device, and must be sent through the
+.Xr xpt 4
+device instead.
+Some examples of xpt-only CCBs are XPT_SCAN_BUS,
+XPT_DEV_MATCH, XPT_RESET_BUS, XPT_SCAN_LUN, XPT_ENG_INQ, and XPT_ENG_EXEC.
+These CCB types have various attributes that make it illogical or
+impossible to service them through the passthrough interface.
+.Pp
+Although the
+.Dv CAMIOQUEUE
+ioctl is not defined to take an argument, it does require a
+pointer to a union ccb.
+It is not defined to take an argument to avoid an extra malloc and copy
+inside the generic
+.Xr ioctl 2
+handler.
+.pp
+The completed CCB will be returned via the
+.Dv CAMIOGET
+ioctl.
+An error will only be returned from the
+.Dv CAMIOQUEUE
+ioctl if there is an error allocating memory for the request or copying
+memory from userland.
+All other errors will be reported as standard CAM CCB status errors.
+Since the CCB is not copied back to the user process from the pass driver
+in the
+.Dv CAMIOQUEUE
+ioctl, the user's passed-in CCB will not be modfied.
+This is the case even with immediate CCBs.
+Instead, the completed CCB must be retrieved via the
+.Dv CAMIOGET
+ioctl and the status examined.
+.Pp
+Multiple CCBs may be queued via the
+.Dv CAMIOQUEUE
+ioctl at any given time, and they may complete in a different order than
+the order that they were submitted.
+The caller must take steps to identify CCBs that are queued and completed.
+The
+.Dv periph_priv
+structure inside struct ccb_hdr is available for userland use with the
+.Dv CAMIOQUEUE
+and
+.Dv CAMIOGET
+ioctls, and will be preserved across calls.
+Also, the periph_links linked list pointers inside struct ccb_hdr are
+available for userland use with the
+.Dv CAMIOQUEUE
+and
+.Dv CAMIOGET
+ioctls and will be preserved across calls.
+.It CAMIOGET union ccb *
+Retrieve completed CAM CCBs queued via the
+.Dv CAMIOQUEUE
+ioctl.
+An error will only be returned from the
+.Dv CAMIOGET
+ioctl if the
+.Xr pass 4
+driver fails to copy data to the user process or if there are no completed
+CCBs available to retrieve.
+If no CCBs are available to retrieve,
+errno will be set to
+.Dv ENOENT .
+.Pp
+All other errors will be reported as standard CAM CCB status errors.
+.Pp
+Although the
+.Dv CAMIOGET
+ioctl is not defined to take an argument, it does require a
+pointer to a union ccb.
+It is not defined to take an argument to avoid an extra malloc and copy
+inside the generic
+.Xr ioctl 2
+handler.
+.Pp
+The pass driver will report via
+.Xr select 2 ,
+.Xr poll 2
+or
+.Xr kevent 2
+when a CCB has completed.
+One CCB may be retrieved per
+.Dv CAMIOGET
+call.
+CCBs may be returned in an order different than the order they were
+submitted.
+So the caller should use the
+.Dv periph_priv
+area inside the CCB header to store pointers to identifying information.
.El
.Sh FILES
.Bl -tag -width /dev/passn -compact
@@ -103,18 +212,21 @@ CAM subsystem.
.Sh DIAGNOSTICS
None.
.Sh SEE ALSO
+.Xr kqueue 2 ,
+.Xr poll 2 ,
+.Xr select 2 ,
.Xr cam 3 ,
.Xr cam_cdbparse 3 ,
.Xr cam 4 ,
+.Xr cd 4 ,
+.Xr ctl 4 ,
+.Xr da 4 ,
+.Xr sa 4 ,
.Xr xpt 4 ,
-.Xr camcontrol 8
+.Xr camcontrol 8 ,
+.Xr camdd 8
.Sh HISTORY
The CAM passthrough driver first appeared in
.Fx 3.0 .
.Sh AUTHORS
.An Kenneth Merry Aq Mt ken@FreeBSD.org
-.Sh BUGS
-It might be nice to have a way to asynchronously send CCBs through the
-passthrough driver.
-This would probably require some sort of read/write
-interface or an asynchronous ioctl interface.
diff --git a/share/man/man4/sfxge.4 b/share/man/man4/sfxge.4
index 462b620..81e2af4 100644
--- a/share/man/man4/sfxge.4
+++ b/share/man/man4/sfxge.4
@@ -148,6 +148,14 @@ Number of packets with payload that must arrive in-order following loss
before a connection is eligible for LRO.
The idea is we should avoid coalescing segments when the sender is recovering
from loss, because reducing the ACK rate can damage performance.
+.It Va hw.sfxge.mcdi_logging
+Enable logging of MCDI protocol messages (only available if enabled at compile-time).
+.It Va hw.sfxge.N.mcdi_logging
+Enable or disable logging of MCDI protocol messages on a per-port basis. The default for each
+port will be the value of
+.Va hw.sfxge.mcdi_logging.
+The logging may also be enabled or disabled after the driver is loaded using the sysctl
+.Va dev.sfxge.%d.mcdi_logging.
.El
.Sh SUPPORT
For general information and support,
diff --git a/share/man/man4/ure.4 b/share/man/man4/ure.4
new file mode 100644
index 0000000..1b2ebb8
--- /dev/null
+++ b/share/man/man4/ure.4
@@ -0,0 +1,121 @@
+.\"
+.\" Copyright (c) 2015 Kevin Lo <kevlo@FreeBSD.org>
+.\" 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$
+.\"
+.Dd December 1, 2015
+.Dt URE 4
+.Os
+.Sh NAME
+.Nm ure
+.Nd "RealTek RTL8152 USB to Fast Ethernet controller driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device uhci"
+.Cd "device ohci"
+.Cd "device usb"
+.Cd "device miibus"
+.Cd "device uether"
+.Cd "device ure"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_ure_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for USB Ethernet adapters based on the RealTek
+RTL8152 USB to Fast Ethernet controller chip.
+.Pp
+The RTL8152 contains an integrated Fast Ethernet MAC, which supports
+both 10 and 100Mbps speeds in either full or half duplex.
+.Pp
+The
+.Nm
+driver supports the following media types:
+.Bl -tag -width ".Cm 10baseT/UTP"
+.It Cm autoselect
+Enable auto selection of the media type and options.
+The user can manually override
+the auto selected mode by adding media options to the
+.Pa /etc/rc.conf
+file.
+.It Cm 10baseT/UTP
+Set 10Mbps operation.
+The
+.Cm mediaopt
+option can also be used to select either
+.Cm full-duplex
+or
+.Cm half-duplex
+modes.
+.It Cm 100baseTX
+Set 100Mbps (Fast Ethernet) operation.
+The
+.Cm mediaopt
+option can also be used to select either
+.Cm full-duplex
+or
+.Cm half-duplex
+modes.
+.El
+.Pp
+The
+.Nm
+driver supports the following media options:
+.Bl -tag -width ".Cm 10baseT/UTP"
+.It Cm full-duplex
+Force full duplex operation.
+.It Cm half-duplex
+Force half duplex operation.
+.El
+.Pp
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh DIAGNOSTICS
+.Bl -diag
+.It "ure%d: watchdog timeout"
+A packet was queued for transmission and a transmit command was
+issued, however the device failed to acknowledge the transmission
+before a timeout expired.
+.El
+.Sh SEE ALSO
+.Xr arp 4 ,
+.Xr miibus 4 ,
+.Xr netintro 4 ,
+.Xr ng_ether 4 ,
+.Xr ifconfig 8
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An Kevin Lo Aq Mt kevlo@FreeBSD.org .
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index c9462ab..f6223b8 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,7 +1,7 @@
.\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: head/tools/build/options/makeman 290435 2015-11-06 05:28:08Z bdrewery
+.\" from FreeBSD: head/tools/build/options/makeman 291414 2015-11-28 00:41:37Z ume
.\" $FreeBSD$
-.Dd November 13, 2015
+.Dd November 28, 2015
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -515,6 +515,10 @@ When set, the following options are also in effect:
(unless
.Va WITHOUT_AUTO_OBJ
is set explicitly)
+.It Va WITH_META_MODE
+(unless
+.Va WITHOUT_META_MODE
+is set explicitly)
.It Va WITH_STAGING
(unless
.Va WITHOUT_STAGING
@@ -1104,16 +1108,6 @@ Enable building openldap support for kerberos.
.It Va WITHOUT_OPENSSH
.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru
Set to not build OpenSSH.
-.It Va WITH_OPENSSH_NONE_CIPHER
-.\" from FreeBSD: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER 245527 2013-01-17 01:51:04Z bz
-Set to include the "None" cipher support in OpenSSH and its libraries.
-Additional adjustments may need to be done to system configuration
-files, such as
-.Xr sshd_config 5 ,
-to enable this cipher.
-Please see
-.Pa /usr/src/crypto/openssh/README.hpn
-for full details.
.It Va WITHOUT_OPENSSL
.\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSL 156932 2006-03-21 07:50:50Z ru
Set to not build OpenSSL.
diff --git a/share/man/man9/devfs_set_cdevpriv.9 b/share/man/man9/devfs_set_cdevpriv.9
index 5b05626..c040ca6 100644
--- a/share/man/man9/devfs_set_cdevpriv.9
+++ b/share/man/man9/devfs_set_cdevpriv.9
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 20, 2015
+.Dd December 2, 2015
.Dt DEVFS_CDEVPRIV 9
.Os
.Sh NAME
@@ -36,12 +36,12 @@
.In sys/param.h
.In sys/conf.h
.Bd -literal
-typedef void (*cdevpriv_dtr_t)(void *data);
+typedef void d_priv_dtor_t(void *data);
.Ed
.Ft int
.Fn devfs_get_cdevpriv "void **datap"
.Ft int
-.Fn devfs_set_cdevpriv "void *priv" "cdevpriv_dtr_t dtr"
+.Fn devfs_set_cdevpriv "void *priv" "d_priv_dtor_t *dtr"
.Ft void
.Fn devfs_clear_cdevpriv "void"
.Sh DESCRIPTION
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
index 1d0c7b3..946df14 100644
--- a/share/man/man9/style.9
+++ b/share/man/man9/style.9
@@ -26,7 +26,7 @@
.\" From: @(#)style 1.14 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
-.Dd November 22, 2015
+.Dd December 5, 2015
.Dt STYLE 9
.Os
.Sh NAME
@@ -288,6 +288,30 @@ Like white-space commits, care should be taken in making
.Vt uintXX_t
only commits.
.Pp
+Similarly, the project is slowly moving to use the
+.St -isoC-99
+.Vt bool
+in preference to the older
+.Vt int
+or
+.Vt boolean_t .
+New code should use
+.Vt bool ,
+and old code may be converted if it is
+reasonable to do so.
+Literal values are named
+.Dv true
+and
+.Dv false .
+These are preferred to the old spellings
+.Dv TRUE
+and
+.Dv FALSE .
+Userspace code should include
+.In stdbool.h ,
+while kernel code should include
+.In sys/types.h .
+.Pp
Enumeration values are all uppercase.
.Bd -literal
enum enumtype { ONE, TWO } et;
diff --git a/share/mk/Makefile b/share/mk/Makefile
index b088b91..ac3fd94 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -6,6 +6,11 @@
# will read this Makefile since it auto includes it into -I.
.if ${.CURDIR} == ${.PARSEDIR}
+# Avoid creating a Makefile.depend here as it would get included anywhere
+# in the build, similar to the problem above. It would cause dirdeps.mk
+# to be included more times than desired.
+UPDATE_DEPENDFILE= no
+
.include <src.opts.mk>
FILES= \
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 2e5e486..d34b9a9 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -59,15 +59,19 @@ DEPENDFILE?= .depend
DEPENDFILES= ${DEPENDFILE}
.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == ""
DEPENDFILES+= ${DEPENDFILE}.*
-DEPEND_CFLAGS+= -MD -MP -MF${DEPENDFILE}.${.TARGET}
+DEPEND_MP?= -MP
+# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to
+# avoid collisions.
+DEPEND_FILTER= C,/,_,g
+DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
DEPEND_CFLAGS+= -MT${.TARGET}
CFLAGS+= ${DEPEND_CFLAGS}
DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS}
.for __obj in ${DEPENDOBJS:O:u}
.if ${.MAKEFLAGS:M-V} == ""
-.sinclude "${DEPENDFILE}.${__obj}"
+.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}"
.endif
-DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj}
+DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}}
.endfor
.endif # ${MK_FAST_DEPEND} == "yes"
diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk
index 7d7faf1..58df94e 100644
--- a/share/mk/bsd.libnames.mk
+++ b/share/mk/bsd.libnames.mk
@@ -14,6 +14,7 @@
LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o
+LIB80211?= ${DESTDIR}${LIBDIR}/lib80211.a
LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a
LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a
LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a
@@ -41,6 +42,7 @@ LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a
LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a
LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a
LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a
+LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a
LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a
LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a
LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a
@@ -88,6 +90,7 @@ LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a
LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a
LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a
LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a
+LIBNANDFS?= ${DESTDIR}${LIBDIR}/libnandfs.a
LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a
LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a
LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a
@@ -97,6 +100,7 @@ LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a
LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a
LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a
LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a
+LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a
LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a
LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a
LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a
@@ -116,6 +120,7 @@ LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a
LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a
LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a
LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a
+LIBSTDTHREADS?= ${DESTDIR}${LIBDIR}/libstdthreads.a
LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a
LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a
LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a
@@ -151,3 +156,18 @@ LDADD:= ${LDADD:N-lpthread} -lpthread
LDADD:= ${LDADD:N-lc} -lc
.endif
.endif
+
+# Only do this for src builds.
+.if defined(SRCTOP)
+.if defined(_LIBRARIES) && defined(LIB) && \
+ ${_LIBRARIES:M${LIB}} != ""
+.if !defined(LIB${LIB:tu})
+.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR}/lib${LIB}.a
+.endif
+.endif
+
+# Derive LIB*SRCDIR from LIB*DIR
+.for lib in ${_LIBRARIES}
+LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,}
+.endfor
+.endif
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index 9fefdc2..bbc2d19 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -36,10 +36,11 @@
.if !target(__<bsd.subdir.mk>__)
__<bsd.subdir.mk>__:
-ALL_SUBDIR_TARGETS= all all-man buildconfig check checkdpadd clean cleandepend \
- cleandir cleanilinks cleanobj depend distribute \
- installconfig lint maninstall manlint obj objlink \
- realinstall tags \
+ALL_SUBDIR_TARGETS= all all-man buildconfig buildfiles buildincludes \
+ check checkdpadd clean cleandepend cleandir cleanilinks \
+ cleanobj depend distribute files includes installconfig \
+ installfiles installincludes realinstall lint maninstall \
+ manlint obj objlink tags \
${SUBDIR_TARGETS}
# Described above.
@@ -55,12 +56,6 @@ STANDALONE_SUBDIR_TARGETS?= obj checkdpadd clean cleandepend cleandir \
_SUBDIR:
.endif
.endif
-.if !target(_SUBDIR)
-
-.if defined(SUBDIR)
-SUBDIR:=${SUBDIR} ${SUBDIR.yes}
-SUBDIR:=${SUBDIR:u}
-.endif
DISTRIBUTION?= base
.if !target(distribute)
@@ -71,6 +66,35 @@ distribute: .MAKE
.endfor
.endif
+# Convenience targets to run 'build${target}' and 'install${target}' when
+# calling 'make ${target}'.
+.for __target in files includes
+.if !target(${__target})
+${__target}: build${__target} install${__target}
+.ORDER: build${__target} install${__target}
+.endif
+.endfor
+
+# Make 'install' supports a before and after target. Actual install
+# hooks are placed in 'realinstall'.
+.if !target(install)
+.for __stage in before real after
+.if !target(${__stage}install)
+${__stage}install:
+.endif
+.endfor
+install: beforeinstall realinstall afterinstall
+.ORDER: beforeinstall realinstall afterinstall
+.endif
+
+# SUBDIR recursing may be disabled for MK_DIRDEPS_BUILD
+.if !target(_SUBDIR)
+
+.if defined(SUBDIR)
+SUBDIR:=${SUBDIR} ${SUBDIR.yes}
+SUBDIR:=${SUBDIR:u}
+.endif
+
# Subdir code shared among 'make <subdir>', 'make <target>' and SUBDIR_PARALLEL.
_SUBDIR_SH= \
if test -d ${.CURDIR}/$${dir}.${MACHINE_ARCH}; then \
@@ -82,7 +106,7 @@ _SUBDIR_SH= \
_SUBDIR: .USEBEFORE
.if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR)
- @${_+_}target=${.TARGET:S,realinstall,install,}; \
+ @${_+_}target=${.TARGET:realinstall=install}; \
for dir in ${SUBDIR:N.WAIT}; do ( ${_SUBDIR_SH} ); done
.endif
@@ -91,11 +115,14 @@ ${SUBDIR:N.WAIT}: .PHONY .MAKE
dir=${.TARGET}; \
${_SUBDIR_SH};
-# Work around parsing of .if nested in .for by putting .WAIT string into a var.
-__wait= .WAIT
.for __target in ${ALL_SUBDIR_TARGETS}
+# Only recurse on directly-called targets. I.e., don't recurse on dependencies
+# such as 'install' becoming {before,real,after}install, just recurse
+# 'install'. Despite that, 'realinstall' is special due to ordering issues
+# with 'afterinstall'.
+.if make(${__target}) || (${__target} == realinstall && make(install))
# Can ordering be skipped for this and SUBDIR_PARALLEL forced?
-.if make(${__target}) && ${STANDALONE_SUBDIR_TARGETS:M${__target}}
+.if ${STANDALONE_SUBDIR_TARGETS:M${__target}}
_is_standalone_target= 1
SUBDIR:= ${SUBDIR:N.WAIT}
.else
@@ -104,7 +131,7 @@ _is_standalone_target= 0
.if defined(SUBDIR_PARALLEL) || ${_is_standalone_target} == 1
__subdir_targets=
.for __dir in ${SUBDIR}
-.if ${__wait} == ${__dir}
+.if ${__dir} == .WAIT
__subdir_targets+= .WAIT
.else
__subdir_targets+= ${__target}_subdir_${__dir}
@@ -126,35 +153,16 @@ ${__target}: ${__subdir_targets}
.else
${__target}: _SUBDIR
.endif # SUBDIR_PARALLEL || _is_standalone_target
+.endif # make(${__target})
.endfor # __target in ${ALL_SUBDIR_TARGETS}
-# This is to support 'make includes' calling 'make buildincludes' and
-# 'make installincludes' in the proper order, and to support these
-# targets as SUBDIR_TARGETS.
-.for __target in files includes
-.for __stage in build install
-${__stage}${__target}:
-.if make(${__stage}${__target})
-${__stage}${__target}: _SUBDIR
-.endif
-.endfor
+.endif # !target(_SUBDIR)
+
+# Ensure all targets exist
+.for __target in ${ALL_SUBDIR_TARGETS}
.if !target(${__target})
-${__target}: .MAKE
- ${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target}
+${__target}:
.endif
.endfor
.endif
-
-.if !target(install)
-.if !target(beforeinstall)
-beforeinstall:
-.endif
-.if !target(afterinstall)
-afterinstall:
-.endif
-install: beforeinstall realinstall afterinstall
-.ORDER: beforeinstall realinstall afterinstall
-.endif
-
-.endif
diff --git a/share/mk/install-new.mk b/share/mk/install-new.mk
index 469e986..5e95c99 100644
--- a/share/mk/install-new.mk
+++ b/share/mk/install-new.mk
@@ -32,9 +32,23 @@ CmpCp= CmpCp() { \
cp $$src $$target; \
fi; }
+# Replace the file if they are different and make a backup if desired
+CmpReplace= CmpReplace() { \
+ src=$$1 target=$$2 _bak=$$3; \
+ if ! test -s $$target || ! cmp -s $$target $$src; then \
+ trap "" 1 2 3 15; \
+ if test -s $$target; then \
+ if test "x$$_bak" != x; then \
+ rm -f $$target$$_bak; \
+ cp -f $$target $$target$$_bak; \
+ fi; \
+ fi; \
+ mv -f $$src $$target; \
+ fi; }
+
# If the .new file is different, we want it.
# Note: this function will work as is for *.new$RANDOM"
-InstallNew= ${CmpCp}; InstallNew() { \
+InstallNew= ${CmpReplace}; InstallNew() { \
_t=-e; _bak=; \
while :; do \
case "$$1" in \
@@ -46,7 +60,7 @@ InstallNew= ${CmpCp}; InstallNew() { \
for new in "$$@"; do \
if test $$_t $$new; then \
target=`expr $$new : '\(.*\).new'`; \
- CmpCp $$new $$target $$_bak; \
+ CmpReplace $$new $$target $$_bak; \
fi; \
rm -f $$new; \
done; :; }
diff --git a/share/mk/local.autodep.mk b/share/mk/local.autodep.mk
index 8ea5ca6..8223fec 100644
--- a/share/mk/local.autodep.mk
+++ b/share/mk/local.autodep.mk
@@ -14,12 +14,6 @@ LDFLAGS+= ${LDFLAGS_LAST}
CLEANFILES+= .depend
-.for h in ${SRCS:M*.h}
-.if target($h)
-buildfiles: $h
-.endif
-.endfor
-
# handy for debugging
.SUFFIXES: .S .c .cc .cpp .cpp-out
diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk
index 762fae4..a24d012 100644
--- a/share/mk/local.dirdeps.mk
+++ b/share/mk/local.dirdeps.mk
@@ -84,11 +84,73 @@ DIRDEPS += \
cddl/usr.bin/ctfmerge.host
.endif
+# Bootstrap support. Give hints to DIRDEPS if there is no Makefile.depend*
+# generated yet. This can be based on things such as SRC files and LIBADD.
+# These hints will not factor into the final Makefile.depend as only what is
+# used will be added in and handled via [local.]gendirdeps.mk. This is not
+# done for MACHINE=host builds.
+# XXX: Include this in local.autodep.mk as well for gendirdeps without filemon.
+.if ${RELDIR} == ${DEP_RELDIR} # Only do this for main build target
+.for _depfile in ${.MAKE.DEPENDFILE_PREFERENCE:T}
+.if !defined(_have_depfile) && exists(${.CURDIR}/${_depfile})
+_have_depfile=
.endif
-
-.if ${MK_CLANG} == "yes" && ${DEP_RELDIR:Nlib/clang/lib*:Nlib/libc*} == ""
-DIRDEPS+= lib/clang/include
+.endfor
+.if !defined(_have_depfile)
+# Has C files. The C_DIRDEPS are shared with C++ files as well.
+C_DIRDEPS= \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+.if !empty(SRCS:M*.c)
+DIRDEPS+= ${C_DIRDEPS}
+.endif
+# Has C++ files
+.if !empty(SRCS:M*.cc) || !empty(SRCS:M*.C) || !empty(SRCS:M*.cpp) || \
+ !empty(SRCS:M*.cxx)
+DIRDEPS+= ${C_DIRDEPS}
+.if ${MK_CLANG} == "yes"
+DIRDEPS+= lib/libc++ lib/libcxxrt
+.else
+DIRDEPS+= gnu/lib/libstdc++ gnu/lib/libsupc++
+.endif
+# XXX: Clang and GCC always adds -lm currently, even when not needed.
+DIRDEPS+= lib/msun
.endif
+# Has yacc files.
+.if !empty(SRCS:M*.y)
+DIRDEPS+= usr.bin/yacc.host
+.endif
+.if !empty(DPADD)
+# Taken from meta.autodep.mk (where it only does something with
+# BUILD_AT_LEVEL0, which we don't use).
+# This only works for DPADD with full OBJ/SRC paths, which is mostly just
+# _INTERNALLIBS.
+_DP_DIRDEPS+= \
+ ${DPADD:M${OBJTOP}*:H:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \
+ ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
+# Resolve the paths to RELDIRs
+DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,}
+.endif
+.if !empty(LIBADD)
+# Also handle LIBADD for non-internal libraries.
+.for _lib in ${LIBADD}
+_lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,}
+.if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \
+ exists(${SRCTOP}/${_lib${_lib}reldir})
+DIRDEPS+= ${_lib${_lib}reldir}
+.endif
+.endfor
+.endif # !empty(LIBADD)
+.endif # no Makefile.depend*
+.endif # ${RELDIR} == ${DEP_RELDIR}
+
+.endif # ${DEP_MACHINE} != "host"
.if ${MK_STAGING} == "yes"
# we need targets/pseudo/stage to prep the stage tree
diff --git a/share/mk/local.gendirdeps.mk b/share/mk/local.gendirdeps.mk
index dc65d16..ac22471 100644
--- a/share/mk/local.gendirdeps.mk
+++ b/share/mk/local.gendirdeps.mk
@@ -9,7 +9,6 @@ GENDIRDEPS_FILTER+= \
Nbin/cat.host \
Ngnu/lib/libssp/libssp_nonshared \
Ncddl/usr.bin/ctf* \
- Nlib/clang/include \
Nlib/libc_nonshared \
Ntargets/pseudo/stage* \
Ntools/*
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index 6df0688..03c4723 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -204,34 +204,41 @@ TRACER= ${TIME_STAMP} ${:U}
.if ${MACHINE} == "host"
MK_SHARED_TOOLCHAIN= no
.endif
+TOOLCHAIN_VARS= AS AR CC CLANG_TBLGEN CXX CPP LD NM OBJDUMP OBJCOPY RANLIB \
+ STRINGS SIZE TBLGEN
+_toolchain_bin_CLANG_TBLGEN= /usr/bin/clang-tblgen
+_toolchain_bin_CXX= /usr/bin/c++
.ifdef WITH_TOOLSDIR
TOOLSDIR?= ${HOST_OBJTOP}/tools
-.elif defined(STAGE_HOST_OBJTOP) && exists(${STAGE_HOST_OBJTOP}/usr/bin)
+.elif defined(STAGE_HOST_OBJTOP)
TOOLSDIR?= ${STAGE_HOST_OBJTOP}
.endif
-.if !empty(TOOLSDIR)
-.if ${.MAKE.LEVEL} == 0 && exists(${TOOLSDIR}/usr/bin)
-PATH:= ${PATH:S,:, ,g:@d@${exists(${TOOLSDIR}$d):?${TOOLSDIR}$d:}@:ts:}:${PATH}
+# Don't use the bootstrap tools logic on itself.
+.if ${.TARGETS:Mbootstrap-tools} == "" && \
+ !defined(BOOTSTRAPPING_TOOLS) && !empty(TOOLSDIR) && ${.MAKE.LEVEL} == 0
+.for dir in /sbin /bin /usr/sbin /usr/bin
+PATH:= ${TOOLSDIR}${dir}:${PATH}
+.endfor
.export PATH
-.if exists(${TOOLSDIR}/usr/bin/cc)
-HOST_CC?= ${TOOLSDIR}/usr/bin/cc
-CC?= ${HOST_CC}
-HOST_CXX?= ${TOOLSDIR}/usr/bin/c++
-CXX?= ${HOST_CXX}
-HOST_CPP?= ${TOOLSDIR}/usr/bin/cpp
-CPP?= ${HOST_CPP}
-.export HOST_CC CC HOST_CXX CXX HOST_CPP CPP
-.endif
+# Prefer the TOOLSDIR version of the toolchain if present vs the host version.
+.for var in ${TOOLCHAIN_VARS}
+_toolchain_bin.${var}= ${TOOLSDIR}${_toolchain_bin_${var}:U/usr/bin/${var:tl}}
+.if exists(${_toolchain_bin.${var}})
+HOST_${var}?= ${_toolchain_bin.${var}}
+${var}?= ${HOST_${var}}
+.export HOST_${var} ${var}
.endif
+.endfor
.endif
+.for var in ${TOOLCHAIN_VARS}
+HOST_${var}?= ${_toolchain_bin_${var}:U/usr/bin/${var:tl}}
+.endfor
+
.if ${MACHINE} == "host"
-HOST_CC?= /usr/bin/cc
-CC= ${HOST_CC}
-HOST_CXX?= /usr/bin/c++
-CXX= ${HOST_CXX}
-HOST_CPP?= /usr/bin/cpp
-CPP= ${HOST_CPP}
+.for var in ${TOOLCHAIN_VARS}
+${var}= ${HOST_${var}}
+.endfor
.endif
.if ${MACHINE:Nhost:Ncommon} != "" && ${MACHINE} != ${HOST_MACHINE}
diff --git a/share/mk/netbsd-tests.test.mk b/share/mk/netbsd-tests.test.mk
index 5357b08..c1c9f91 100644
--- a/share/mk/netbsd-tests.test.mk
+++ b/share/mk/netbsd-tests.test.mk
@@ -18,8 +18,7 @@ LIBNETBSD_OBJDIR= ${OBJTOP}/lib/libnetbsd
CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests
LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR}
-DPADD.$t+= ${LIBNETBSD}
-LDADD.$t+= -lnetbsd
+LIBADD.${t}+= netbsd
SRCS.$t?= ${t:C/^/t_/:C/_test$//g}.c
.endfor
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 79da325..15d30cc 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -50,6 +50,8 @@ _INTERNALLIBS= \
_LIBRARIES= \
${_PRIVATELIBS} \
${_INTERNALLIBS} \
+ ${LOCAL_LIBRARIES} \
+ 80211 \
alias \
archive \
asn1 \
@@ -119,6 +121,7 @@ _LIBRARIES= \
netgraph \
ngatm \
nv \
+ nvpair \
opie \
pam \
panel \
@@ -150,27 +153,37 @@ _LIBRARIES= \
ufs \
ugidfw \
ulog \
+ umem \
usb \
usbhid \
util \
+ uutil \
vmmapi \
wind \
wrap \
xo \
y \
ypclnt \
- z
+ z \
+ zfs_core \
+ zfs \
+ zpool \
+
+# Each library's LIBADD needs to be duplicated here for static linkage of
+# 2nd+ order consumers. Auto-generating this would be better.
+_DP_80211= sbuf bsdxml
_DP_archive= z bz2 lzma bsdxml
.if ${MK_OPENSSL} != "no"
_DP_archive+= crypto
.else
_DP_archive+= md
.endif
+_DP_sqlite3= pthread
_DP_ssl= crypto
-_DP_ssh= crypto crypt
+_DP_ssh= crypto crypt z
.if ${MK_LDNS} != "no"
-_DP_ssh+= ldns z
+_DP_ssh+= ldns
.endif
_DP_edit= ncursesw
.if ${MK_OPENSSL} != "no"
@@ -180,10 +193,11 @@ _DP_geom= bsdxml sbuf
_DP_cam= sbuf
_DP_casper= capsicum nv pjdlog
_DP_capsicum= nv
+_DP_kvm= elf
_DP_pjdlog= util
_DP_opie= md
_DP_usb= pthread
-_DP_unbound= pthread
+_DP_unbound= ssl crypto pthread
_DP_rt= pthread
.if ${MK_OPENSSL} == "no"
_DP_radius= md
@@ -201,10 +215,11 @@ _DP_proc= supcplusplus
.if ${MK_CDDL} != "no"
_DP_proc+= ctf
.endif
+_DP_proc+= elf rtld_db util
_DP_mp= crypto
_DP_memstat= kvm
_DP_magic= z
-_DP_mt= bsdxml
+_DP_mt= sbuf bsdxml
_DP_ldns= crypto
.if ${MK_OPENSSL} != "no"
_DP_fetch= ssl crypto
@@ -213,7 +228,7 @@ _DP_fetch= md
.endif
_DP_execinfo= elf
_DP_dwarf= elf
-_DP_dpv= dialog figpar util
+_DP_dpv= dialog figpar util ncursesw
_DP_dialog= ncursesw m
_DP_cuse= pthread
_DP_atf_cxx= atf_c
@@ -228,18 +243,49 @@ _DP_pam+= ssh
.if ${MK_NIS} != "no"
_DP_pam+= ypclnt
.endif
-_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc \
- pthread
+_DP_readline= ncursesw
+_DP_roken= crypt
+_DP_kadm5clnt= com_err krb5 roken
+_DP_kadm5srv= com_err hdb krb5 roken
+_DP_heimntlm= crypto com_err krb5 roken
+_DP_hx509= asn1 com_err crypto roken wind
+_DP_hdb= asn1 com_err krb5 roken sqlite3
+_DP_asn1= com_err roken
+_DP_kdc= roken hdb hx509 krb5 heimntlm asn1 crypto
+_DP_wind= com_err roken
+_DP_heimbase= pthread
+_DP_heimipcc= heimbase roken pthread
+_DP_heimipcs= heimbase roken pthread
+_DP_kafs5= asn1 krb5 roken
+_DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc
_DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_err
_DP_lzma= pthread
_DP_ucl= m
_DP_vmmapi= util
_DP_ctf= z
-_DP_proc= rtld_db util
-_DP_dtrace= rtld_db pthread
+_DP_dtrace= ctf elf proc pthread rtld_db
_DP_xo= util
-
-# Define spacial cases
+# The libc dependencies are not strictly needed but are defined to make the
+# assert happy.
+_DP_c= compiler_rt
+.if ${MK_SSP} != "no"
+_DP_c+= ssp_nonshared
+.endif
+_DP_stdthreads= pthread
+_DP_tacplus= md
+_DP_panel= ncurses
+_DP_panelw= ncursesw
+_DP_rpcsec_gss= gssapi
+_DP_smb= kiconv
+_DP_ulog= md
+_DP_fifolog= z
+_DP_ipf= kvm
+_DP_zfs= md pthread umem util uutil m nvpair avl bsdxml geom nvpair z \
+ zfs_core
+_DP_zfs_core= nvpair
+_DP_zpool= md pthread z nvpair avl umem
+
+# Define special cases
LDADD_supcplusplus= -lsupc++
LIBATF_C= ${DESTDIR}${LIBDIR}/libprivateatf-c.a
LIBATF_CXX= ${DESTDIR}${LIBDIR}/libprivateatf-c++.a
@@ -260,7 +306,9 @@ LDADD_${_l}?= -lprivate${_l}
.else
LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l}
.endif
-.if defined(_DP_${_l}) && defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
+# Add in all dependencies for static linkage.
+.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \
+ (defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")))
.for _d in ${_DP_${_l}}
DPADD_${_l}+= ${DPADD_${_d}}
LDADD_${_l}+= ${LDADD_${_d}}
@@ -268,43 +316,34 @@ LDADD_${_l}+= ${LDADD_${_d}}
.endif
.endfor
+# These are special cases where the library is broken and anything that uses
+# it needs to add more dependencies. Broken usually means that it has a
+# cyclic dependency and cannot link its own dependencies. This is bad, please
+# fix the library instead.
+# Unless the library itself is broken then the proper place to define
+# dependencies is _DP_* above.
+
+# libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for
+# atf_cxx
DPADD_atf_cxx+= ${DPADD_atf_c}
LDADD_atf_cxx+= ${LDADD_atf_c}
-DPADD_sqlite3+= ${DPADD_pthread}
-LDADD_sqlite3+= ${LDADD_pthread}
-
-DPADD_fifolog+= ${DPADD_z}
-LDADD_fifolog+= ${LDADD_z}
-
-DPADD_ipf+= ${DPADD_kvm}
-LDADD_ipf+= ${LDADD_kvm}
-
-DPADD_mt+= ${DPADD_sbuf}
-LDADD_mt+= ${LDADD_sbuf}
-
-DPADD_dtrace+= ${DPADD_ctf} ${DPADD_elf} ${DPADD_proc}
-LDADD_dtrace+= ${LDADD_ctf} ${LDADD_elf} ${LDADD_proc}
-
-# The following depends on libraries which are using pthread
-DPADD_hdb+= ${DPADD_pthread}
-LDADD_hdb+= ${LDADD_pthread}
-DPADD_kadm5srv+= ${DPADD_pthread}
-LDADD_kadm5srv+= ${LDADD_pthread}
-DPADD_krb5+= ${DPADD_pthread}
-LDADD_krb5+= ${LDADD_pthread}
-DPADD_gssapi_krb5+= ${DPADD_pthread}
-LDADD_gssapi_krb5+= ${LDADD_pthread}
+# Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here.
+.for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,}
+.if ${_LIBRARIES:M${_l}}
+_BADLDADD+= ${_l}
+.endif
+.endfor
+.if !empty(_BADLDADD)
+.error ${.CURDIR}: These libraries should be LIBADD+=foo rather than DPADD/LDADD+=-lfoo: ${_BADLDADD}
+.endif
.for _l in ${LIBADD}
-DPADD+= ${DPADD_${_l}:Umissing-dpadd_${_l}}
+DPADD+= ${DPADD_${_l}}
LDADD+= ${LDADD_${_l}}
.endfor
-.if defined(DPADD) && ${DPADD:Mmissing-dpadd_*}
-.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}".
-.endif
-
+# INTERNALLIB definitions.
LIBELFTCDIR= ${OBJTOP}/lib/libelftc
LIBELFTC?= ${LIBELFTCDIR}/libelftc.a
@@ -348,7 +387,7 @@ LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent
LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a
LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts
-LIBOTPS?= ${LIBOPTSDIR}/libopts.a
+LIBOPTS?= ${LIBOPTSDIR}/libopts.a
LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse
LIBPARSE?= ${LIBPARSEDIR}/libparse.a
@@ -412,8 +451,10 @@ LIBFORMDIR= ${OBJTOP}/lib/ncurses/form
LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw
LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu
LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw
-LIBTERMCAPDIR= ${OBJTOP}/lib/ncurses/ncurses
-LIBTERMCAPWDIR= ${OBJTOP}/lib/ncurses/ncursesw
+LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses
+LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw
+LIBTERMCAPDIR= ${LIBNCURSESDIR}
+LIBTERMCAPWDIR= ${LIBNCURSESWDIR}
LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel
LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw
LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto
@@ -428,4 +469,28 @@ LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib
LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib}
.endfor
+# Validate that listed LIBADD are valid.
+.for _l in ${LIBADD}
+.if empty(_LIBRARIES:M${_l})
+_BADLIBADD+= ${_l}
+.endif
+.endfor
+.if !empty(_BADLIBADD)
+.error ${.CURDIR}: Invalid LIBADD used which may need to be added to ${_this:T}: ${_BADLIBADD}
+.endif
+
+# Sanity check that libraries are defined here properly when building them.
+.if defined(LIB) && ${_LIBRARIES:M${LIB}} != ""
+.if !empty(LIBADD) && \
+ (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u})
+.error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}')
+.endif
+.if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,})
+.error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}
+.endif
+.if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu})
+.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a
+.endif
+.endif
+
.endif # !target(__<src.libnames.mk>__)
diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk
index 7b84d51..6c1ebb7 100644
--- a/share/mk/src.sys.mk
+++ b/share/mk/src.sys.mk
@@ -5,6 +5,7 @@
# to preserve historical (and useful) behavior. Changes here need to
# be reflected there so SRCCONF isn't included multiple times.
+.if !defined(_WITHOUT_SRCCONF)
# Allow user to configure things that only effect src tree builds.
SRCCONF?= /etc/src.conf
.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
@@ -29,6 +30,7 @@ __postrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno
.endfor
.endif # SRCCONF
+.endif
# tempting, but bsd.compiler.mk causes problems this early
# probably need to remove dependence on bsd.own.mk
diff --git a/share/termcap/Makefile b/share/termcap/Makefile
index 46e1f8b..6cb2ab7 100644
--- a/share/termcap/Makefile
+++ b/share/termcap/Makefile
@@ -24,6 +24,6 @@ termcap.db: termcap
cap_mkdb ${CAP_MKDB_ENDIAN} -f ${.TARGET:R} ${.ALLSRC}
etc-termcap:
- ln -fs ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap
+ ${INSTALL_SYMLINK} ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap
.include <bsd.prog.mk>
diff --git a/share/vt/fonts/Makefile.depend b/share/vt/fonts/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/vt/fonts/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/vt/keymaps/Makefile.depend b/share/vt/keymaps/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/vt/keymaps/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 86efdd9..c6520f3 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -51,8 +51,6 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -60,7 +58,6 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode,
.sv_szsigcode = &szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF64",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 3318ddd..d87d38c 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -87,11 +87,6 @@ extern struct pcpu __pcpu[];
char *doublefault_stack;
char *nmi_stack;
-/* Variables needed for SMP tlb shootdown. */
-static vm_offset_t smp_tlb_addr1, smp_tlb_addr2;
-static pmap_t smp_tlb_pmap;
-volatile int smp_tlb_wait;
-
extern inthand_t IDTVEC(fast_syscall), IDTVEC(fast_syscall32);
/*
@@ -410,121 +405,6 @@ start_ap(int apic_id)
return 0; /* return FAILURE */
}
-/*
- * Flush the TLB on other CPU's
- */
-
-static void
-smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap,
- vm_offset_t addr1, vm_offset_t addr2)
-{
- int cpu, ncpu, othercpus;
-
- othercpus = mp_ncpus - 1; /* does not shootdown self */
-
- /*
- * Check for other cpus. Return if none.
- */
- if (CPU_ISFULLSET(&mask)) {
- if (othercpus < 1)
- return;
- } else {
- CPU_CLR(PCPU_GET(cpuid), &mask);
- if (CPU_EMPTY(&mask))
- return;
- }
-
- if (!(read_rflags() & PSL_I))
- panic("%s: interrupts disabled", __func__);
- mtx_lock_spin(&smp_ipi_mtx);
- smp_tlb_addr1 = addr1;
- smp_tlb_addr2 = addr2;
- smp_tlb_pmap = pmap;
- smp_tlb_wait = 0;
- if (CPU_ISFULLSET(&mask)) {
- ncpu = othercpus;
- ipi_all_but_self(vector);
- } else {
- ncpu = 0;
- while ((cpu = CPU_FFS(&mask)) != 0) {
- cpu--;
- CPU_CLR(cpu, &mask);
- CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__,
- cpu, vector);
- ipi_send_cpu(cpu, vector);
- ncpu++;
- }
- }
- while (smp_tlb_wait < ncpu)
- ia32_pause();
- mtx_unlock_spin(&smp_ipi_mtx);
-}
-
-void
-smp_masked_invltlb(cpuset_t mask, pmap_t pmap)
-{
-
- if (smp_started) {
- smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_global++;
-#endif
- }
-}
-
-void
-smp_masked_invlpg(cpuset_t mask, vm_offset_t addr)
-{
-
- if (smp_started) {
- smp_targeted_tlb_shootdown(mask, IPI_INVLPG, NULL, addr, 0);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_page++;
-#endif
- }
-}
-
-void
-smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2)
-{
-
- if (smp_started) {
- smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, NULL,
- addr1, addr2);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_range++;
- ipi_range_size += (addr2 - addr1) / PAGE_SIZE;
-#endif
- }
-}
-
-void
-smp_cache_flush(void)
-{
-
- if (smp_started) {
- smp_targeted_tlb_shootdown(all_cpus, IPI_INVLCACHE, NULL,
- 0, 0);
- }
-}
-
-/*
- * Handlers for TLB related IPIs
- */
-void
-invltlb_handler(void)
-{
-#ifdef COUNT_XINVLTLB_HITS
- xhits_gbl[PCPU_GET(cpuid)]++;
-#endif /* COUNT_XINVLTLB_HITS */
-#ifdef COUNT_IPIS
- (*ipi_invltlb_counts[PCPU_GET(cpuid)])++;
-#endif /* COUNT_IPIS */
-
- invltlb();
- atomic_add_int(&smp_tlb_wait, 1);
-}
-
void
invltlb_invpcid_handler(void)
{
@@ -556,7 +436,7 @@ invltlb_pcid_handler(void)
#endif /* COUNT_IPIS */
if (smp_tlb_pmap == kernel_pmap) {
- invltlb_globpcid();
+ invltlb_glob();
} else {
/*
* The current pmap might not be equal to
@@ -572,38 +452,3 @@ invltlb_pcid_handler(void)
}
atomic_add_int(&smp_tlb_wait, 1);
}
-
-void
-invlpg_handler(void)
-{
-#ifdef COUNT_XINVLTLB_HITS
- xhits_pg[PCPU_GET(cpuid)]++;
-#endif /* COUNT_XINVLTLB_HITS */
-#ifdef COUNT_IPIS
- (*ipi_invlpg_counts[PCPU_GET(cpuid)])++;
-#endif /* COUNT_IPIS */
-
- invlpg(smp_tlb_addr1);
- atomic_add_int(&smp_tlb_wait, 1);
-}
-
-void
-invlrng_handler(void)
-{
- vm_offset_t addr;
-
-#ifdef COUNT_XINVLTLB_HITS
- xhits_rng[PCPU_GET(cpuid)]++;
-#endif /* COUNT_XINVLTLB_HITS */
-#ifdef COUNT_IPIS
- (*ipi_invlrng_counts[PCPU_GET(cpuid)])++;
-#endif /* COUNT_IPIS */
-
- addr = smp_tlb_addr1;
- do {
- invlpg(addr);
- addr += PAGE_SIZE;
- } while (addr < smp_tlb_addr2);
-
- atomic_add_int(&smp_tlb_wait, 1);
-}
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 883c1c5..9f9654a 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -1321,7 +1321,7 @@ pmap_update_pde_invalidate(pmap_t pmap, vm_offset_t va, pd_entry_t newpde)
* Promotion: flush every 4KB page mapping from the TLB,
* including any global (PG_G) mappings.
*/
- invltlb_globpcid();
+ invltlb_glob();
}
}
#ifdef SMP
@@ -1482,7 +1482,7 @@ pmap_invalidate_all(pmap_t pmap)
bzero(&d, sizeof(d));
invpcid(&d, INVPCID_CTXGLOB);
} else {
- invltlb_globpcid();
+ invltlb_glob();
}
mask = &all_cpus;
} else {
@@ -1653,7 +1653,7 @@ pmap_invalidate_all(pmap_t pmap)
bzero(&d, sizeof(d));
invpcid(&d, INVPCID_CTXGLOB);
} else {
- invltlb_globpcid();
+ invltlb_glob();
}
} else if (pmap == PCPU_GET(curpmap)) {
if (pmap_pcid_enabled) {
diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
index ec943f9..cbe3a76 100644
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -28,7 +28,7 @@ options SCHED_ULE # ULE scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
-options IPSEC # IP (v4/v6) security
+options IPSEC # IP (v4/v6) security
options TCP_OFFLOAD # TCP offload
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index f2961d6..f234873 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -505,7 +505,7 @@ invltlb(void)
* Operations that Invalidate TLBs and Paging-Structure Caches.
*/
static __inline void
-invltlb_globpcid(void)
+invltlb_glob(void)
{
uint64_t cr4;
diff --git a/sys/amd64/include/smp.h b/sys/amd64/include/smp.h
index 850289a..9c93e5c 100644
--- a/sys/amd64/include/smp.h
+++ b/sys/amd64/include/smp.h
@@ -25,6 +25,8 @@
#include <x86/apicvar.h>
#include <machine/pcb.h>
+struct pmap;
+
/* global symbols in mpboot.S */
extern char mptramp_start[];
extern char mptramp_end[];
@@ -53,6 +55,7 @@ extern u_int ipi_global;
extern u_int ipi_page;
extern u_int ipi_range;
extern u_int ipi_range_size;
+extern struct pmap *smp_tlb_pmap;
extern volatile int smp_tlb_wait;
@@ -86,8 +89,6 @@ inthand_t
IDTVEC(justreturn), /* interrupt CPU with minimum overhead */
IDTVEC(rendezvous); /* handle CPU rendezvous */
-struct pmap;
-
/* functions in mp_machdep.c */
void assign_cpu_ids(void);
void cpu_add(u_int apic_id, char boot_cpu);
diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c
index 37c1b69..96428b8 100644
--- a/sys/amd64/linux/linux_sysvec.c
+++ b/sys/amd64/linux/linux_sysvec.c
@@ -750,8 +750,6 @@ struct sysentvec elf_linux_sysvec = {
.sv_size = LINUX_SYS_MAXSYSCALL,
.sv_table = linux_sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = ELAST + 1,
.sv_errtbl = bsd_to_linux_errno,
.sv_transtrap = translate_traps,
@@ -759,7 +757,6 @@ struct sysentvec elf_linux_sysvec = {
.sv_sendsig = linux_rt_sendsig,
.sv_sigcode = &_binary_linux_locore_o_start,
.sv_szsigcode = &linux_szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "Linux ELF64",
.sv_coredump = elf64_coredump,
.sv_imgact_try = exec_linux_imgact_try,
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index 6ed0369..693f003 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -1011,8 +1011,6 @@ struct sysentvec elf_linux_sysvec = {
.sv_size = LINUX32_SYS_MAXSYSCALL,
.sv_table = linux32_sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = ELAST + 1,
.sv_errtbl = bsd_to_linux_errno,
.sv_transtrap = translate_traps,
@@ -1020,7 +1018,6 @@ struct sysentvec elf_linux_sysvec = {
.sv_sendsig = linux_sendsig,
.sv_sigcode = &_binary_linux32_locore_o_start,
.sv_szsigcode = &linux_szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "Linux ELF32",
.sv_coredump = elf32_coredump,
.sv_imgact_try = exec_linux_imgact_try,
diff --git a/lib/libkvm/kvm_aarch64.c b/sys/arm/amlogic/aml8726/aml8726_if_dwc.c
index 40b050b..f91bc47 100644
--- a/lib/libkvm/kvm_aarch64.c
+++ b/sys/arm/amlogic/aml8726/aml8726_if_dwc.c
@@ -1,11 +1,7 @@
/*-
- * Copyright (C) 2006 Bruce M. Simpson.
- * Copyright (c) 2015 The FreeBSD Foundation
+ * Copyright (c) 2015 Ganbold Tsagaankhuu <ganbold@FreeBSD.org>
* All rights reserved.
*
- * This software was developed by Andrew Turner under
- * sponsorship from the FreeBSD Foundation.
- *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -28,78 +24,75 @@
* SUCH DAMAGE.
*/
-/*
- * arm64 (AArch64) machine dependent routines for kvm.
- */
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
-#include <sys/mman.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
+#include <machine/bus.h>
-#include <machine/pmap.h>
+#include <dev/dwc/if_dwc.h>
+#include <dev/dwc/if_dwcvar.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
-#include <limits.h>
-#include <kvm.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
+#include "if_dwc_if.h"
-#include "kvm_private.h"
+static int
+aml8726_if_dwc_probe(device_t dev)
+{
-/* minidump must be the first item! */
-struct vmstate {
- int minidump; /* 1 = minidump mode */
- void *mmapbase;
- size_t mmapsize;
-};
+ if (!ofw_bus_status_okay(dev))
+ return (ENXIO);
+ if (!ofw_bus_is_compatible(dev, "amlogic,meson6-dwmac"))
+ return (ENXIO);
+ device_set_desc(dev, "Amlogic Meson Gigabit Ethernet Controller");
-void
-_kvm_freevtop(kvm_t *kd)
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+aml8726_if_dwc_init(device_t dev)
{
- if (kd->vmst != 0) {
- if (kd->vmst->minidump)
- return (_kvm_minidump_freevtop(kd));
- if (kd->vmst->mmapbase != NULL)
- munmap(kd->vmst->mmapbase, kd->vmst->mmapsize);
- free(kd->vmst);
- kd->vmst = NULL;
- }
+ return (0);
}
-int
-_kvm_initvtop(kvm_t *kd)
+static int
+aml8726_if_dwc_mac_type(device_t dev)
{
- char minihdr[8];
-
- if (!kd->rawdump) {
- if (pread(kd->pmfd, &minihdr, 8, 0) == 8) {
- if (memcmp(&minihdr, "minidump", 8) == 0)
- return (_kvm_minidump_initvtop(kd));
- } else {
- _kvm_err(kd, kd->program, "cannot read header");
- return (-1);
- }
- }
-
- _kvm_err(kd, 0, "_kvm_initvtop: Unsupported image type");
- return (-1);
+
+ return (DWC_GMAC_ALT_DESC);
}
-int
-_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa)
+static int
+aml8726_if_dwc_mii_clk(device_t dev)
{
- if (kd->vmst->minidump)
- return _kvm_minidump_kvatop(kd, va, pa);
+ return (GMAC_MII_CLK_100_150M_DIV62);
+}
+static device_method_t aml8726_dwc_methods[] = {
+ DEVMETHOD(device_probe, aml8726_if_dwc_probe),
- _kvm_err(kd, 0, "_kvm_kvatop: Unsupported image type");
- return (0);
-}
+ DEVMETHOD(if_dwc_init, aml8726_if_dwc_init),
+ DEVMETHOD(if_dwc_mac_type, aml8726_if_dwc_mac_type),
+ DEVMETHOD(if_dwc_mii_clk, aml8726_if_dwc_mii_clk),
+
+ DEVMETHOD_END
+};
+
+static devclass_t aml8726_dwc_devclass;
+
+extern driver_t dwc_driver;
+
+DEFINE_CLASS_1(dwc, aml8726_dwc_driver, aml8726_dwc_methods,
+ sizeof(struct dwc_softc), dwc_driver);
+DRIVER_MODULE(aml8726_dwc, simplebus, aml8726_dwc_driver,
+ aml8726_dwc_devclass, 0, 0);
+
+MODULE_DEPEND(aml8726_dwc, dwc, 1, 1, 1);
diff --git a/sys/arm/amlogic/aml8726/files.aml8726 b/sys/arm/amlogic/aml8726/files.aml8726
index 5b2df66..edd9a08 100644
--- a/sys/arm/amlogic/aml8726/files.aml8726
+++ b/sys/arm/amlogic/aml8726/files.aml8726
@@ -28,3 +28,4 @@ arm/amlogic/aml8726/aml8726_pinctrl.c optional fdt_pinctrl
arm/amlogic/aml8726/uart_dev_aml8726.c optional uart
arm/amlogic/aml8726/aml8726_usb_phy-m3.c optional dwcotg usb gpio
arm/amlogic/aml8726/aml8726_usb_phy-m6.c optional dwcotg usb gpio
+arm/amlogic/aml8726/aml8726_if_dwc.c optional dwc
diff --git a/sys/arm/arm/cpufunc.c b/sys/arm/arm/cpufunc.c
index 734ee58..0dd9241 100644
--- a/sys/arm/arm/cpufunc.c
+++ b/sys/arm/arm/cpufunc.c
@@ -910,7 +910,8 @@ set_cpufuncs()
cputype == CPU_ID_CORTEXA15R1 ||
cputype == CPU_ID_CORTEXA15R2 ||
cputype == CPU_ID_CORTEXA15R3 ||
- cputype == CPU_ID_KRAIT ) {
+ cputype == CPU_ID_KRAIT300R0 ||
+ cputype == CPU_ID_KRAIT300R1 ) {
cpufuncs = cortexa_cpufuncs;
cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */
get_cachetype_cp15();
diff --git a/sys/arm/arm/elf_machdep.c b/sys/arm/arm/elf_machdep.c
index 34761ff..1081bdf 100644
--- a/sys/arm/arm/elf_machdep.c
+++ b/sys/arm/arm/elf_machdep.c
@@ -52,8 +52,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -61,7 +59,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode,
.sv_szsigcode = &szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF32",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/arm/arm/exception.S b/sys/arm/arm/exception.S
index dc727d1..5acaf15 100644
--- a/sys/arm/arm/exception.S
+++ b/sys/arm/arm/exception.S
@@ -52,13 +52,15 @@
#include <machine/asm.h>
#include <machine/armreg.h>
#include <machine/asmacros.h>
+#include <machine/trap.h>
+
__FBSDID("$FreeBSD$");
#ifdef KDTRACE_HOOKS
.bss
.align 4
- .global _C_LABEL(dtrace_invop_calltrap_addr)
-_C_LABEL(dtrace_invop_calltrap_addr):
+ .global _C_LABEL(dtrace_invop_jump_addr)
+_C_LABEL(dtrace_invop_jump_addr):
.word 0
.word 0
#endif
@@ -361,9 +363,39 @@ END(data_abort_entry)
*/
ASENTRY_NP(undefined_entry)
PUSHFRAMEINSVC /* mode stack, build trapframe there. */
+ mov r4, r0 /* R0 contains SPSR */
adr lr, exception_exit /* Return from handler via standard */
- mov r0, sp /* exception exit routine. Pass the */
- b undefinedinstruction /* trapframe to the handler. */
+ mov r0, sp /* exception exit routine. pass frame */
+
+ ldr r2, [sp, #(TF_PC)] /* load pc */
+#if __ARM_ARCH >= 7
+ tst r4, #(PSR_T) /* test if PSR_T */
+ subne r2, r2, #(THUMB_INSN_SIZE)
+ subeq r2, r2, #(INSN_SIZE)
+#else
+ sub r2, r2, #(INSN_SIZE) /* fix pc */
+#endif
+ str r2, [sp, #TF_PC] /* store pc */
+
+#ifdef KDTRACE_HOOKS
+ /* Check if dtrace is enabled */
+ ldr r1, =_C_LABEL(dtrace_invop_jump_addr)
+ ldr r3, [r1]
+ cmp r3, #0
+ beq undefinedinstruction
+
+ and r4, r4, #(PSR_MODE) /* Mask out unneeded bits */
+ cmp r4, #(PSR_USR32_MODE) /* Check if we came from usermode */
+ beq undefinedinstruction
+
+ ldr r4, [r2] /* load instrution */
+ ldr r1, =FBT_BREAKPOINT /* load fbt inv op */
+ cmp r1, r4
+ bne undefinedinstruction
+
+ bx r3 /* call invop_jump_addr */
+#endif
+ b undefinedinstruction /* call stadnard handler */
END(undefined_entry)
/*
diff --git a/sys/arm/arm/genassym.c b/sys/arm/arm/genassym.c
index 4e2b7e9..659c471 100644
--- a/sys/arm/arm/genassym.c
+++ b/sys/arm/arm/genassym.c
@@ -118,6 +118,7 @@ ASSYM(MD_TP, offsetof(struct mdthread, md_tp));
ASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start));
ASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end));
+ASSYM(TF_SPSR, offsetof(struct trapframe, tf_spsr));
ASSYM(TF_R0, offsetof(struct trapframe, tf_r0));
ASSYM(TF_R1, offsetof(struct trapframe, tf_r1));
ASSYM(TF_PC, offsetof(struct trapframe, tf_pc));
diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
index 079e089..f570cb4 100644
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -68,6 +68,8 @@ __FBSDID("$FreeBSD$");
#include "pic_if.h"
#endif
+#define GIC_DEBUG_SPURIOUS
+
/* We are using GICv2 register naming */
/* Distributor Registers */
@@ -135,6 +137,9 @@ struct arm_gic_softc {
uint8_t ver;
struct mtx mutex;
uint32_t nirqs;
+#ifdef GIC_DEBUG_SPURIOUS
+ uint32_t last_irq[MAXCPU];
+#endif
};
static struct resource_spec arm_gic_spec[] = {
@@ -287,7 +292,7 @@ arm_gic_init_secondary(device_t dev)
}
#endif /* ARM_INTRNG */
#endif /* SMP */
-
+
#ifndef ARM_INTRNG
int
gic_decode_fdt(phandle_t iparent, pcell_t *intr, int *interrupt,
@@ -335,11 +340,10 @@ gic_decode_fdt(phandle_t iparent, pcell_t *intr, int *interrupt,
*/
if (fdt32_to_cpu(intr[2]) & 0x0a) {
printf("unsupported trigger/polarity configuration "
- "0x%2x\n", fdt32_to_cpu(intr[2]) & 0x0f);
- return (ENOTSUP);
+ "0x%02x\n", fdt32_to_cpu(intr[2]) & 0x0f);
}
*pol = INTR_POLARITY_CONFORM;
- if (fdt32_to_cpu(intr[2]) & 0x01)
+ if (fdt32_to_cpu(intr[2]) & 0x03)
*trig = INTR_TRIGGER_EDGE;
else
*trig = INTR_TRIGGER_LEVEL;
@@ -367,6 +371,7 @@ arm_gic_attach(device_t dev)
int i;
uint32_t icciidr;
#ifdef ARM_INTRNG
+ phandle_t pxref;
intptr_t xref = gic_xref(dev);
#endif
@@ -456,7 +461,13 @@ arm_gic_attach(device_t dev)
goto cleanup;
}
- if (sc->gic_res[2] == NULL) {
+ /*
+ * Controller is root if:
+ * - doesn't have interrupt parent
+ * - his interrupt parent is this controller
+ */
+ pxref = ofw_bus_find_iparent(ofw_bus_get_node(dev));
+ if (pxref == 0 || xref == pxref) {
if (arm_pic_claim_root(dev, xref, arm_gic_intr, sc,
GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
device_printf(dev, "could not set PIC as a root\n");
@@ -464,6 +475,12 @@ arm_gic_attach(device_t dev)
goto cleanup;
}
} else {
+ if (sc->gic_res[2] == NULL) {
+ device_printf(dev,
+ "not root PIC must have defined interrupt\n");
+ arm_pic_unregister(dev, xref);
+ goto cleanup;
+ }
if (bus_setup_intr(dev, sc->gic_res[2], INTR_TYPE_CLK,
arm_gic_intr, NULL, sc, &sc->gic_intrhand)) {
device_printf(dev, "could not setup irq handler\n");
@@ -472,6 +489,7 @@ arm_gic_attach(device_t dev)
}
}
+ OF_device_register_xref(xref, dev);
return (0);
cleanup:
@@ -516,8 +534,11 @@ arm_gic_intr(void *arg)
*/
if (irq >= sc->nirqs) {
- device_printf(sc->gic_dev, "Spurious interrupt detected\n");
- gic_c_write_4(sc, GICC_EOIR, irq_active_reg);
+#ifdef GIC_DEBUG_SPURIOUS
+ device_printf(sc->gic_dev,
+ "Spurious interrupt detected: last irq: %d on CPU%d\n",
+ sc->last_irq[PCPU_GET(cpuid)], PCPU_GET(cpuid));
+#endif
return (FILTER_HANDLED);
}
@@ -542,12 +563,16 @@ dispatch_irq:
arm_ipi_dispatch(isrc, tf);
goto next_irq;
#else
- printf("SGI %u on UP system detected\n", irq - GIC_FIRST_SGI);
+ device_printf(sc->gic_dev, "SGI %u on UP system detected\n",
+ irq - GIC_FIRST_SGI);
gic_c_write_4(sc, GICC_EOIR, irq_active_reg);
goto next_irq;
#endif
}
+#ifdef GIC_DEBUG_SPURIOUS
+ sc->last_irq[PCPU_GET(cpuid)] = irq;
+#endif
if (isrc->isrc_trig == INTR_TRIGGER_EDGE)
gic_c_write_4(sc, GICC_EOIR, irq_active_reg);
@@ -729,12 +754,12 @@ gic_map_fdt(struct arm_gic_softc *sc, struct arm_irqsrc *isrc, u_int *irqp)
*/
tripol = isrc->isrc_cells[2];
if (tripol & 0x0a) {
- printf("unsupported trigger/polarity configuration "
- "0x%2x\n", tripol & 0x0f);
- return (ENOTSUP);
+ device_printf(sc->gic_dev,
+ "unsupported trigger/polarity configuration "
+ "0x%02x\n", tripol & 0x0f);
}
pol = INTR_POLARITY_CONFORM;
- if (tripol & 0x01)
+ if (tripol & 0x03)
trig = INTR_TRIGGER_EDGE;
else
trig = INTR_TRIGGER_LEVEL;
@@ -911,7 +936,8 @@ arm_gic_next_irq(struct arm_gic_softc *sc, int last_irq)
if (active_irq == 0x3FF) {
if (last_irq == -1)
- printf("Spurious interrupt detected\n");
+ device_printf(sc->gic_dev,
+ "Spurious interrupt detected\n");
return -1;
}
diff --git a/sys/arm/arm/identcpu.c b/sys/arm/arm/identcpu.c
index be1393b1..6c5764c 100644
--- a/sys/arm/arm/identcpu.c
+++ b/sys/arm/arm/identcpu.c
@@ -197,7 +197,9 @@ const struct cpuidtab cpuids[] = {
generic_steppings },
{ CPU_ID_CORTEXA15R3, CPU_CLASS_CORTEXA, "Cortex A15-r3",
generic_steppings },
- { CPU_ID_KRAIT, CPU_CLASS_KRAIT, "Krait",
+ { CPU_ID_KRAIT300R0, CPU_CLASS_KRAIT, "Krait 300-r0",
+ generic_steppings },
+ { CPU_ID_KRAIT300R1, CPU_CLASS_KRAIT, "Krait 300-r1",
generic_steppings },
{ CPU_ID_80200, CPU_CLASS_XSCALE, "i80200",
diff --git a/sys/arm/arm/pmap-v6-new.c b/sys/arm/arm/pmap-v6-new.c
index 8b7676e..2196f91 100644
--- a/sys/arm/arm/pmap-v6-new.c
+++ b/sys/arm/arm/pmap-v6-new.c
@@ -388,14 +388,14 @@ pmap_debug(int level)
static uint32_t tex_class[8] = {
/* type inner cache outer cache */
- TEX(PRRR_MEM, NMRR_WB_WA, NMRR_WB_WA, 0), /* 0 - ATTR_WB_WA */
- TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 1 - ATTR_NOCACHE */
- TEX(PRRR_DEV, NMRR_NC, NMRR_NC, 0), /* 2 - ATTR_DEVICE */
- TEX(PRRR_SO, NMRR_NC, NMRR_NC, 0), /* 3 - ATTR_SO */
- TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 4 - NOT USED YET */
- TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 5 - NOT USED YET */
- TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 6 - NOT USED YET */
- TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 7 - NOT USED YET */
+ TEX(PRRR_MEM, NMRR_WB_WA, NMRR_WB_WA, 0), /* 0 - ATTR_WB_WA */
+ TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 1 - ATTR_NOCACHE */
+ TEX(PRRR_DEV, NMRR_NC, NMRR_NC, 0), /* 2 - ATTR_DEVICE */
+ TEX(PRRR_SO, NMRR_NC, NMRR_NC, 0), /* 3 - ATTR_SO */
+ TEX(PRRR_MEM, NMRR_WT, NMRR_WT, 0), /* 4 - ATTR_WT */
+ TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 5 - NOT USED YET */
+ TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 6 - NOT USED YET */
+ TEX(PRRR_MEM, NMRR_NC, NMRR_NC, 0), /* 7 - NOT USED YET */
};
#undef TEX
diff --git a/sys/arm/arm/trap-v6.c b/sys/arm/arm/trap-v6.c
index 41dcd24..ea8ec0d 100644
--- a/sys/arm/arm/trap-v6.c
+++ b/sys/arm/arm/trap-v6.c
@@ -66,6 +66,10 @@ __FBSDID("$FreeBSD$");
#include <machine/db_machdep.h>
#endif
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+#endif
+
extern char fusubailout[];
extern char cachebailout[];
@@ -561,6 +565,13 @@ abort_fatal(struct trapframe *tf, u_int idx, u_int fsr, u_int far,
const char *rw_mode;
usermode = TRAPF_USERMODE(tf);
+#ifdef KDTRACE_HOOKS
+ if (!usermode) {
+ if (dtrace_trap_func != NULL && (*dtrace_trap_func)(tf, far))
+ return (0);
+ }
+#endif
+
mode = usermode ? "user" : "kernel";
rw_mode = fsr & FSR_WNR ? "write" : "read";
disable_interrupts(PSR_I|PSR_F);
diff --git a/sys/arm/arm/undefined.c b/sys/arm/arm/undefined.c
index 3b32bc3..fec194e6 100644
--- a/sys/arm/arm/undefined.c
+++ b/sys/arm/arm/undefined.c
@@ -99,10 +99,6 @@ __FBSDID("$FreeBSD$");
#define COPROC_VFP 10
-#ifdef KDTRACE_HOOKS
-int (*dtrace_invop_jump_addr)(struct trapframe *);
-#endif
-
static int gdb_trapper(u_int, u_int, struct trapframe *, int);
LIST_HEAD(, undefined_handler) undefined_handlers[MAX_COPROCS];
@@ -206,12 +202,6 @@ undefinedinstruction(struct trapframe *frame)
PCPU_INC(cnt.v_trap);
-#if __ARM_ARCH >= 7
- if ((frame->tf_spsr & PSR_T) != 0)
- frame->tf_pc -= THUMB_INSN_SIZE;
- else
-#endif
- frame->tf_pc -= INSN_SIZE;
fault_pc = frame->tf_pc;
/*
@@ -350,12 +340,6 @@ undefinedinstruction(struct trapframe *frame)
#endif
return;
}
-#ifdef KDTRACE_HOOKS
- else if (dtrace_invop_jump_addr != 0) {
- dtrace_invop_jump_addr(frame);
- return;
- }
-#endif
else
panic("Undefined instruction in kernel.\n");
}
diff --git a/sys/arm/freescale/imx/imx6_anatop.c b/sys/arm/freescale/imx/imx6_anatop.c
index 16a09d3..c0afe57 100644
--- a/sys/arm/freescale/imx/imx6_anatop.c
+++ b/sys/arm/freescale/imx/imx6_anatop.c
@@ -72,11 +72,10 @@ __FBSDID("$FreeBSD$");
#include <arm/freescale/fsl_ocotpreg.h>
#include <arm/freescale/fsl_ocotpvar.h>
#include <arm/freescale/imx/imx_ccmvar.h>
+#include <arm/freescale/imx/imx_machdep.h>
#include <arm/freescale/imx/imx6_anatopreg.h>
#include <arm/freescale/imx/imx6_anatopvar.h>
-static SYSCTL_NODE(_hw, OID_AUTO, imx6, CTLFLAG_RW, NULL, "i.MX6 container");
-
static struct resource_spec imx6_anatop_spec[] = {
{ SYS_RES_MEMORY, 0, RF_ACTIVE },
{ SYS_RES_IRQ, 0, RF_ACTIVE },
@@ -395,23 +394,23 @@ cpufreq_initialize(struct imx6_anatop_softc *sc)
uint32_t cfg3speed;
struct oppt * op;
- SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_mhz", CTLFLAG_RD, &sc->cpu_curmhz, 0,
"CPU frequency");
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency");
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH,
sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency");
- SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0,
"Maximum CPU frequency allowed by hardware");
- SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "cpu_overclock_enable", CTLFLAG_RWTUN,
&sc->cpu_overclock_enable, 0,
"Allow setting CPU frequency higher than cpu_maxmhz_hw");
@@ -626,10 +625,10 @@ initialize_tempmon(struct imx6_anatop_softc *sc)
callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay,
0, tempmon_throttle_check, sc, 0);
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0,
temp_sysctl_handler, "IK", "Current die temperature");
- SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6),
+ SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx),
OID_AUTO, "throttle_temperature", CTLTYPE_INT | CTLFLAG_RW, sc,
0, temp_throttle_sysctl_handler, "IK",
"Throttle CPU when exceeding this temperature");
diff --git a/sys/arm/freescale/imx/imx6_machdep.c b/sys/arm/freescale/imx/imx6_machdep.c
index ce936b6..eaa380d 100644
--- a/sys/arm/freescale/imx/imx6_machdep.c
+++ b/sys/arm/freescale/imx/imx6_machdep.c
@@ -104,7 +104,6 @@ imx6_lastaddr(platform_t plat)
static int
imx6_attach(platform_t plat)
{
-
/* Inform the MPCore timer driver that its clock is variable. */
arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES);
@@ -114,6 +113,9 @@ imx6_attach(platform_t plat)
static void
imx6_late_init(platform_t plat)
{
+ const uint32_t IMX6_WDOG_SR_PHYS = 0x020bc004;
+
+ imx_wdog_init_last_reset(IMX6_WDOG_SR_PHYS);
/* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */
gpio1_node = OF_node_from_xref(
diff --git a/sys/arm/freescale/imx/imx_machdep.c b/sys/arm/freescale/imx/imx_machdep.c
index 2362607..002651a 100644
--- a/sys/arm/freescale/imx/imx_machdep.c
+++ b/sys/arm/freescale/imx/imx_machdep.c
@@ -45,6 +45,15 @@ __FBSDID("$FreeBSD$");
#include <arm/freescale/imx/imx_machdep.h>
#include <arm/freescale/imx/imx_wdogreg.h>
+SYSCTL_NODE(_hw, OID_AUTO, imx, CTLFLAG_RW, NULL, "i.MX container");
+
+static int last_reset_status;
+SYSCTL_UINT(_hw_imx, OID_AUTO, last_reset_status, CTLFLAG_RD,
+ &last_reset_status, 0, "Last reset status register");
+
+SYSCTL_STRING(_hw_imx, OID_AUTO, last_reset_reason, CTLFLAG_RD,
+ "unknown", 0, "Last reset reason");
+
struct arm32_dma_range *
bus_dma_get_range(void)
{
@@ -85,6 +94,23 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr)
continue;
}
+void
+imx_wdog_init_last_reset(vm_offset_t wdsr_phys)
+{
+ volatile uint16_t * psr;
+
+ if ((psr = arm_devmap_ptov(wdsr_phys, sizeof(*psr))) == NULL)
+ return;
+ last_reset_status = *psr;
+ if (last_reset_status & WDOG_RSR_SFTW) {
+ sysctl___hw_imx_last_reset_reason.oid_arg1 = "SoftwareReset";
+ } else if (last_reset_status & WDOG_RSR_TOUT) {
+ sysctl___hw_imx_last_reset_reason.oid_arg1 = "WatchdogTimeout";
+ } else if (last_reset_status & WDOG_RSR_POR) {
+ sysctl___hw_imx_last_reset_reason.oid_arg1 = "PowerOnReset";
+ }
+}
+
u_int
imx_soc_family(void)
{
diff --git a/sys/arm/freescale/imx/imx_machdep.h b/sys/arm/freescale/imx/imx_machdep.h
index 6909e51..2bb8bb3 100644
--- a/sys/arm/freescale/imx/imx_machdep.h
+++ b/sys/arm/freescale/imx/imx_machdep.h
@@ -30,10 +30,14 @@
#define IMX_MACHDEP_H
#include <sys/types.h>
+#include <sys/sysctl.h>
+
+SYSCTL_DECL(_hw_imx);
/* Common functions, implemented in imx_machdep.c. */
void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__));
+void imx_wdog_init_last_reset(vm_offset_t _wdsr_phys);
/* From here down, routines are implemented in imxNN_machdep.c. */
diff --git a/sys/arm/freescale/imx/imx_wdogreg.h b/sys/arm/freescale/imx/imx_wdogreg.h
index 1bff106..030cee8 100644
--- a/sys/arm/freescale/imx/imx_wdogreg.h
+++ b/sys/arm/freescale/imx/imx_wdogreg.h
@@ -47,6 +47,7 @@
#define WDOG_SR_STEP2 0xaaaa
#define WDOG_RSR_REG 0x04 /* Reset Status Register */
+#define WDOG_RSR_POR (1 << 4) /* Due to Power-On Reset */
#define WDOG_RSR_TOUT (1 << 1) /* Due WDog timeout reset */
#define WDOG_RSR_SFTW (1 << 0) /* Due Soft reset */
diff --git a/sys/arm/include/armreg.h b/sys/arm/include/armreg.h
index 5cc022b..5596b7f 100644
--- a/sys/arm/include/armreg.h
+++ b/sys/arm/include/armreg.h
@@ -139,7 +139,9 @@
#define CPU_ID_CORTEXA15R1 0x411fc0f0
#define CPU_ID_CORTEXA15R2 0x412fc0f0
#define CPU_ID_CORTEXA15R3 0x413fc0f0
-#define CPU_ID_KRAIT 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */
+#define CPU_ID_KRAIT300R0 0x510f06f0 /* Snapdragon S4 Pro/APQ8064 */
+#define CPU_ID_KRAIT300R1 0x511f06f0
+
#define CPU_ID_TI925T 0x54029250
#define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */
#define CPU_ID_MV88FR331 0x56153310 /* Marvell Feroceon 88FR331 Core */
diff --git a/sys/arm/include/atomic-v4.h b/sys/arm/include/atomic-v4.h
index e8f6fb2..0c0b377 100644
--- a/sys/arm/include/atomic-v4.h
+++ b/sys/arm/include/atomic-v4.h
@@ -363,6 +363,13 @@ atomic_readandclear_32(volatile u_int32_t *p)
return (__swp(0, p));
}
+static __inline uint32_t
+atomic_swap_32(volatile u_int32_t *p, u_int32_t v)
+{
+
+ return (__swp(v, p));
+}
+
#define atomic_cmpset_rel_32 atomic_cmpset_32
#define atomic_cmpset_acq_32 atomic_cmpset_32
#define atomic_set_rel_32 atomic_set_32
diff --git a/sys/arm/include/atomic-v6.h b/sys/arm/include/atomic-v6.h
index aa1780f..06cb507 100644
--- a/sys/arm/include/atomic-v6.h
+++ b/sys/arm/include/atomic-v6.h
@@ -641,6 +641,25 @@ atomic_testandset_64(volatile uint64_t *p, u_int v)
return (atomic_testandset_32(p32, v));
}
+static __inline uint32_t
+atomic_swap_32(volatile uint32_t *p, uint32_t v)
+{
+ uint32_t ret, exflag;
+
+ __asm __volatile(
+ "1: ldrex %[ret], [%[ptr]] \n"
+ " strex %[exf], %[val], [%[ptr]] \n"
+ " teq %[exf], #0 \n"
+ " it ne \n"
+ " bne 1b \n"
+ : [ret] "=r" (ret),
+ [exf] "=&r" (exflag)
+ : [val] "r" (v),
+ [ptr] "r" (p)
+ : "cc", "memory");
+ return (ret);
+}
+
#undef ATOMIC_ACQ_REL
#undef ATOMIC_ACQ_REL_LONG
diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h
index 039af34..ee89f06 100644
--- a/sys/arm/include/atomic.h
+++ b/sys/arm/include/atomic.h
@@ -109,5 +109,6 @@ atomic_store_long(volatile u_long *dst, u_long src)
#define atomic_readandclear_int atomic_readandclear_32
#define atomic_load_acq_int atomic_load_acq_32
#define atomic_store_rel_int atomic_store_rel_32
+#define atomic_swap_int atomic_swap_32
#endif /* _MACHINE_ATOMIC_H_ */
diff --git a/sys/arm/include/pte-v6.h b/sys/arm/include/pte-v6.h
index 536c1e1..c0eb417 100644
--- a/sys/arm/include/pte-v6.h
+++ b/sys/arm/include/pte-v6.h
@@ -196,6 +196,7 @@
#define PTE2_ATTR_NOCACHE TEX2_CLASS_1
#define PTE2_ATTR_DEVICE TEX2_CLASS_2
#define PTE2_ATTR_SO TEX2_CLASS_3
+#define PTE2_ATTR_WT TEX2_CLASS_4
/*
* Software defined bits for L1 descriptors
* - L1_AP0 is used as page accessed bit
diff --git a/sys/arm/include/resource.h b/sys/arm/include/resource.h
index 723d145..bfa5b3f 100644
--- a/sys/arm/include/resource.h
+++ b/sys/arm/include/resource.h
@@ -42,5 +42,8 @@
#define SYS_RES_MEMORY 3 /* i/o memory */
#define SYS_RES_IOPORT 4 /* i/o ports */
#define SYS_RES_GPIO 5 /* general purpose i/o */
+#ifdef NEW_PCIB
+#define PCI_RES_BUS 6 /* PCI bus numbers */
+#endif
#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/arm/include/trap.h b/sys/arm/include/trap.h
index a9f42e3..ae1c571 100644
--- a/sys/arm/include/trap.h
+++ b/sys/arm/include/trap.h
@@ -7,4 +7,5 @@
#define GDB5_BREAKPOINT 0xe7ffdefe
#define PTRACE_BREAKPOINT 0xe7fffff0
#define KERNEL_BREAKPOINT 0xe7ffffff
+#define FBT_BREAKPOINT 0xe7f000f0
#endif /* _MACHINE_TRAP_H_ */
diff --git a/sys/arm/include/vm.h b/sys/arm/include/vm.h
index 5b2f125..8fb230e 100644
--- a/sys/arm/include/vm.h
+++ b/sys/arm/include/vm.h
@@ -32,14 +32,16 @@
#ifdef ARM_NEW_PMAP
#include <machine/pte-v6.h>
-#define VM_MEMATTR_WB_WA ((vm_memattr_t)PTE2_ATTR_WB_WA)
-#define VM_MEMATTR_NOCACHE ((vm_memattr_t)PTE2_ATTR_NOCACHE)
-#define VM_MEMATTR_DEVICE ((vm_memattr_t)PTE2_ATTR_DEVICE)
-#define VM_MEMATTR_SO ((vm_memattr_t)PTE2_ATTR_SO)
-
-#define VM_MEMATTR_DEFAULT VM_MEMATTR_WB_WA
-#define VM_MEMATTR_UNCACHEABLE VM_MEMATTR_SO /*name is misused by DMA */
+#define VM_MEMATTR_WB_WA ((vm_memattr_t)PTE2_ATTR_WB_WA)
+#define VM_MEMATTR_NOCACHE ((vm_memattr_t)PTE2_ATTR_NOCACHE)
+#define VM_MEMATTR_DEVICE ((vm_memattr_t)PTE2_ATTR_DEVICE)
+#define VM_MEMATTR_SO ((vm_memattr_t)PTE2_ATTR_SO)
+#define VM_MEMATTR_WT ((vm_memattr_t)PTE2_ATTR_WT)
+#define VM_MEMATTR_DEFAULT VM_MEMATTR_WB_WA
+#define VM_MEMATTR_UNCACHEABLE VM_MEMATTR_SO /* misused by DMA */
+#define VM_MEMATTR_WRITE_COMBINING VM_MEMATTR_WT /* for DRM */
+#define VM_MEMATTR_WRITE_BACK VM_MEMATTR_WB_WA /* for DRM */
#else
/* Memory attribute configuration. */
diff --git a/sys/arm/samsung/exynos/exynos5_combiner.c b/sys/arm/samsung/exynos/exynos5_combiner.c
index ffd557e..4711377 100644
--- a/sys/arm/samsung/exynos/exynos5_combiner.c
+++ b/sys/arm/samsung/exynos/exynos5_combiner.c
@@ -28,7 +28,9 @@
* Samsung Exynos 5 Interrupt Combiner
* Chapter 7, Exynos 5 Dual User's Manual Public Rev 1.00
*/
-
+#ifdef USB_GLOBAL_INCLUDE_FILE
+#include USB_GLOBAL_INCLUDE_FILE
+#else
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -50,6 +52,7 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/intr.h>
+#endif
#include <arm/samsung/exynos/exynos5_common.h>
#include <arm/samsung/exynos/exynos5_combiner.h>
diff --git a/sys/arm/samsung/exynos/exynos5_ehci.c b/sys/arm/samsung/exynos/exynos5_ehci.c
index 6683937..a9f0314 100644
--- a/sys/arm/samsung/exynos/exynos5_ehci.c
+++ b/sys/arm/samsung/exynos/exynos5_ehci.c
@@ -24,6 +24,9 @@
* SUCH DAMAGE.
*/
+#ifdef USB_GLOBAL_INCLUDE_FILE
+#include USB_GLOBAL_INCLUDE_FILE
+#else
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -59,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include "gpio_if.h"
#include "opt_platform.h"
+#endif
/* GPIO control */
#define GPIO_OUTPUT 1
diff --git a/sys/arm/samsung/exynos/exynos5_pad.c b/sys/arm/samsung/exynos/exynos5_pad.c
index 19fa583..ea07f5d 100644
--- a/sys/arm/samsung/exynos/exynos5_pad.c
+++ b/sys/arm/samsung/exynos/exynos5_pad.c
@@ -28,7 +28,9 @@
* Samsung Exynos 5 Pad Control
* Chapter 4, Exynos 5 Dual User's Manual Public Rev 1.00
*/
-
+#ifdef USB_GLOBAL_INCLUDE_FILE
+#include USB_GLOBAL_INCLUDE_FILE
+#else
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$");
#include <machine/intr.h>
#include "gpio_if.h"
+#endif
#include <arm/samsung/exynos/exynos5_combiner.h>
#include <arm/samsung/exynos/exynos5_pad.h>
diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c
index b783a26..2506de3 100644
--- a/sys/arm64/arm64/elf_machdep.c
+++ b/sys/arm64/arm64/elf_machdep.c
@@ -59,8 +59,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -68,7 +66,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode,
.sv_szsigcode = &szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF64",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S
index 3dc484e..9ca9685 100644
--- a/sys/arm64/arm64/exception.S
+++ b/sys/arm64/arm64/exception.S
@@ -37,29 +37,32 @@ __FBSDID("$FreeBSD$");
mov x18, sp
sub sp, sp, #128
.endif
- stp x28, x29, [sp, #-16]!
- stp x26, x27, [sp, #-16]!
- stp x24, x25, [sp, #-16]!
- stp x22, x23, [sp, #-16]!
- stp x20, x21, [sp, #-16]!
- stp x18, x19, [sp, #-16]!
- stp x16, x17, [sp, #-16]!
- stp x14, x15, [sp, #-16]!
- stp x12, x13, [sp, #-16]!
- stp x10, x11, [sp, #-16]!
- stp x8, x9, [sp, #-16]!
- stp x6, x7, [sp, #-16]!
- stp x4, x5, [sp, #-16]!
- stp x2, x3, [sp, #-16]!
- stp x0, x1, [sp, #-16]!
+ sub sp, sp, #(TF_SIZE + 16)
+ stp x29, x30, [sp, #(TF_SIZE)]
+ stp x28, x29, [sp, #(TF_X + 28 * 8)]
+ stp x26, x27, [sp, #(TF_X + 26 * 8)]
+ stp x24, x25, [sp, #(TF_X + 24 * 8)]
+ stp x22, x23, [sp, #(TF_X + 22 * 8)]
+ stp x20, x21, [sp, #(TF_X + 20 * 8)]
+ stp x18, x19, [sp, #(TF_X + 18 * 8)]
+ stp x16, x17, [sp, #(TF_X + 16 * 8)]
+ stp x14, x15, [sp, #(TF_X + 14 * 8)]
+ stp x12, x13, [sp, #(TF_X + 12 * 8)]
+ stp x10, x11, [sp, #(TF_X + 10 * 8)]
+ stp x8, x9, [sp, #(TF_X + 8 * 8)]
+ stp x6, x7, [sp, #(TF_X + 6 * 8)]
+ stp x4, x5, [sp, #(TF_X + 4 * 8)]
+ stp x2, x3, [sp, #(TF_X + 2 * 8)]
+ stp x0, x1, [sp, #(TF_X + 0 * 8)]
mrs x10, elr_el1
mrs x11, spsr_el1
.if \el == 0
mrs x18, sp_el0
.endif
- stp x10, x11, [sp, #-16]!
- stp x18, lr, [sp, #-16]!
+ stp x10, x11, [sp, #(TF_ELR)]
+ stp x18, lr, [sp, #(TF_SP)]
mrs x18, tpidr_el1
+ add x29, sp, #(TF_SIZE)
.endm
.macro restore_registers el
@@ -70,33 +73,35 @@ __FBSDID("$FreeBSD$");
* handler. For EL0 exceptions, do_ast already did this.
*/
.endif
- ldp x18, lr, [sp], #16
- ldp x10, x11, [sp], #16
+ ldp x18, lr, [sp, #(TF_SP)]
+ ldp x10, x11, [sp, #(TF_ELR)]
.if \el == 0
msr sp_el0, x18
.endif
msr spsr_el1, x11
msr elr_el1, x10
- ldp x0, x1, [sp], #16
- ldp x2, x3, [sp], #16
- ldp x4, x5, [sp], #16
- ldp x6, x7, [sp], #16
- ldp x8, x9, [sp], #16
- ldp x10, x11, [sp], #16
- ldp x12, x13, [sp], #16
- ldp x14, x15, [sp], #16
- ldp x16, x17, [sp], #16
+ ldp x0, x1, [sp, #(TF_X + 0 * 8)]
+ ldp x2, x3, [sp, #(TF_X + 2 * 8)]
+ ldp x4, x5, [sp, #(TF_X + 4 * 8)]
+ ldp x6, x7, [sp, #(TF_X + 6 * 8)]
+ ldp x8, x9, [sp, #(TF_X + 8 * 8)]
+ ldp x10, x11, [sp, #(TF_X + 10 * 8)]
+ ldp x12, x13, [sp, #(TF_X + 12 * 8)]
+ ldp x14, x15, [sp, #(TF_X + 14 * 8)]
+ ldp x16, x17, [sp, #(TF_X + 16 * 8)]
.if \el == 0
- ldp x18, x19, [sp], #16
+ ldp x18, x19, [sp, #(TF_X + 18 * 8)]
.else
- ldp xzr, x19, [sp], #16
+ ldr x19, [sp, #(TF_X + 19 * 8)]
.endif
- ldp x20, x21, [sp], #16
- ldp x22, x23, [sp], #16
- ldp x24, x25, [sp], #16
- ldp x26, x27, [sp], #16
- ldp x28, x29, [sp], #16
-.if \el == 1
+ ldp x20, x21, [sp, #(TF_X + 20 * 8)]
+ ldp x22, x23, [sp, #(TF_X + 22 * 8)]
+ ldp x24, x25, [sp, #(TF_X + 24 * 8)]
+ ldp x26, x27, [sp, #(TF_X + 26 * 8)]
+ ldp x28, x29, [sp, #(TF_X + 28 * 8)]
+.if \el == 0
+ add sp, sp, #(TF_SIZE + 16)
+.else
mov sp, x18
mrs x18, tpidr_el1
.endif
@@ -116,8 +121,7 @@ __FBSDID("$FreeBSD$");
mov x3, #((TDF_ASTPENDING|TDF_NEEDRESCHED) >> 8)
lsl x3, x3, #8
and x2, x2, x3
- cmp x2, #0
- b.eq 2f
+ cbz x2, 2f
/* Restore interrupts */
msr daif, x19
diff --git a/sys/arm64/arm64/genassym.c b/sys/arm64/arm64/genassym.c
index f8dfeda..214b99d 100644
--- a/sys/arm64/arm64/genassym.c
+++ b/sys/arm64/arm64/genassym.c
@@ -60,4 +60,7 @@ ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
+ASSYM(TF_SIZE, sizeof(struct trapframe));
+ASSYM(TF_SP, offsetof(struct trapframe, tf_sp));
+ASSYM(TF_ELR, offsetof(struct trapframe, tf_elr));
ASSYM(TF_X, offsetof(struct trapframe, tf_x));
diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c
index 7b38416..c0e939b 100644
--- a/sys/arm64/arm64/gic_v3.c
+++ b/sys/arm64/arm64/gic_v3.c
@@ -155,7 +155,7 @@ gic_v3_attach(device_t dev)
* One entry for Distributor and all remaining for Re-Distributor.
*/
sc->gic_res = malloc(
- sizeof(sc->gic_res) * (sc->gic_redists.nregions + 1),
+ sizeof(*sc->gic_res) * (sc->gic_redists.nregions + 1),
M_GIC_V3, M_WAITOK);
/* Now allocate corresponding resources */
diff --git a/sys/arm64/arm64/support.S b/sys/arm64/arm64/support.S
index 749fc6e..2f42a84 100644
--- a/sys/arm64/arm64/support.S
+++ b/sys/arm64/arm64/support.S
@@ -60,7 +60,6 @@ ENTRY(casueword32)
b.ne 2f /* Not equal, exit */
stxr w5, w3, [x0] /* Store the new data */
cbnz w5, 1b /* Retry on failure */
- ldrb w0, [x0] /* Try loading the data */
2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */
str w4, [x2] /* Store the read data */
mov x0, #0 /* Success */
@@ -81,7 +80,6 @@ ENTRY(casueword)
b.ne 2f /* Not equal, exit */
stxr w5, x3, [x0] /* Store the new data */
cbnz w5, 1b /* Retry on failure */
- ldrb w0, [x0] /* Try loading the data */
2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */
str x4, [x2] /* Store the read data */
mov x0, #0 /* Success */
diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index b7db974..ac810ad 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -186,6 +186,8 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower)
if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK |
WARN_GIANTOK, NULL, "Kernel page fault") != 0) {
print_registers(frame);
+ printf(" far: %16lx\n", far);
+ printf(" esr: %.8lx\n", esr);
panic("data abort in critical section or under mutex");
}
@@ -220,6 +222,12 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower)
frame->tf_elr = pcb->pcb_onfault;
return;
}
+
+ printf("Fatal data abort:\n");
+ print_registers(frame);
+ printf(" far: %16lx\n", far);
+ printf(" esr: %.8lx\n", esr);
+
#ifdef KDB
if (debugger_on_panic || kdb_active)
if (kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame))
@@ -271,6 +279,7 @@ do_el1h_sync(struct trapframe *frame)
case EXCP_FP_SIMD:
case EXCP_TRAP_FP:
print_registers(frame);
+ printf(" esr: %.8lx\n", esr);
panic("VFP exception in the kernel");
case EXCP_DATA_ABORT:
far = READ_SPECIALREG(far_el1);
diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h
index 12ce4a1..41ad6cc 100644
--- a/sys/arm64/include/atomic.h
+++ b/sys/arm64/include/atomic.h
@@ -53,69 +53,135 @@
#define wmb() dmb(st) /* Full system memory barrier store */
#define rmb() dmb(ld) /* Full system memory barrier load */
-static __inline void
-atomic_add_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " add %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc"
- );
-}
-
-static __inline void
-atomic_clear_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " bic %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc"
- );
-}
+#define ATOMIC_OP(op, asm_op, bar, a, l) \
+static __inline void \
+atomic_##op##_##bar##32(volatile uint32_t *p, uint32_t val) \
+{ \
+ uint32_t tmp; \
+ int res; \
+ \
+ __asm __volatile( \
+ "1: ld"#a"xr %w0, [%2] \n" \
+ " "#asm_op" %w0, %w0, %w3 \n" \
+ " st"#l"xr %w1, %w0, [%2] \n" \
+ " cbnz %w1, 1b \n" \
+ : "=&r"(tmp), "=&r"(res) \
+ : "r" (p), "r" (val) \
+ : "memory" \
+ ); \
+} \
+ \
+static __inline void \
+atomic_##op##_##bar##64(volatile uint64_t *p, uint64_t val) \
+{ \
+ uint64_t tmp; \
+ int res; \
+ \
+ __asm __volatile( \
+ "1: ld"#a"xr %0, [%2] \n" \
+ " "#asm_op" %0, %0, %3 \n" \
+ " st"#l"xr %w1, %0, [%2] \n" \
+ " cbnz %w1, 1b \n" \
+ : "=&r"(tmp), "=&r"(res) \
+ : "r" (p), "r" (val) \
+ : "memory" \
+ ); \
+}
+
+#define ATOMIC(op, asm_op) \
+ ATOMIC_OP(op, asm_op, , , ) \
+ ATOMIC_OP(op, asm_op, acq_, a, ) \
+ ATOMIC_OP(op, asm_op, rel_, , l) \
+
+ATOMIC(add, add)
+ATOMIC(clear, bic)
+ATOMIC(set, orr)
+ATOMIC(subtract, sub)
+
+#define ATOMIC_CMPSET(bar, a, l) \
+static __inline int \
+atomic_cmpset_##bar##32(volatile uint32_t *p, uint32_t cmpval, \
+ uint32_t newval) \
+{ \
+ uint32_t tmp; \
+ int res; \
+ \
+ __asm __volatile( \
+ "1: mov %w1, #1 \n" \
+ " ld"#a"xr %w0, [%2] \n" \
+ " cmp %w0, %w3 \n" \
+ " b.ne 2f \n" \
+ " st"#l"xr %w1, %w4, [%2] \n" \
+ " cbnz %w1, 1b \n" \
+ "2:" \
+ : "=&r"(tmp), "=&r"(res) \
+ : "r" (p), "r" (cmpval), "r" (newval) \
+ : "cc", "memory" \
+ ); \
+ \
+ return (!res); \
+} \
+ \
+static __inline int \
+atomic_cmpset_##bar##64(volatile uint64_t *p, uint64_t cmpval, \
+ uint64_t newval) \
+{ \
+ uint64_t tmp; \
+ int res; \
+ \
+ __asm __volatile( \
+ "1: mov %w1, #1 \n" \
+ " ld"#a"xr %0, [%2] \n" \
+ " cmp %0, %3 \n" \
+ " b.ne 2f \n" \
+ " st"#l"xr %w1, %4, [%2] \n" \
+ " cbnz %w1, 1b \n" \
+ "2:" \
+ : "=&r"(tmp), "=&r"(res) \
+ : "r" (p), "r" (cmpval), "r" (newval) \
+ : "cc", "memory" \
+ ); \
+ \
+ return (!res); \
+}
+
+ATOMIC_CMPSET( , , )
+ATOMIC_CMPSET(acq_, a, )
+ATOMIC_CMPSET(rel_, ,l)
-static __inline int
-atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
+static __inline uint32_t
+atomic_fetchadd_32(volatile uint32_t *p, uint32_t val)
{
- uint32_t tmp;
+ uint32_t tmp, ret;
int res;
__asm __volatile(
- "1: mov %w1, #1 \n"
- " ldxr %w0, [%2] \n"
- " cmp %w0, %w3 \n"
- " b.ne 2f \n"
- " stxr %w1, %w4, [%2] \n"
+ "1: ldxr %w2, [%3] \n"
+ " add %w0, %w2, %w4 \n"
+ " stxr %w1, %w0, [%3] \n"
" cbnz %w1, 1b \n"
- "2:"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (cmpval), "+r" (newval)
- : : "cc"
+ : "=&r"(tmp), "=&r"(res), "=&r"(ret)
+ : "r" (p), "r" (val)
+ : "memory"
);
- return (!res);
+ return (ret);
}
-static __inline uint32_t
-atomic_fetchadd_32(volatile uint32_t *p, uint32_t val)
+static __inline uint64_t
+atomic_fetchadd_64(volatile uint64_t *p, uint64_t val)
{
- uint32_t tmp, ret;
+ uint64_t tmp, ret;
int res;
__asm __volatile(
- "1: ldxr %w4, [%2] \n"
- " add %w0, %w4, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val), "=&r"(ret) : : "cc"
+ "1: ldxr %2, [%3] \n"
+ " add %0, %2, %4 \n"
+ " stxr %w1, %0, [%3] \n"
+ " cbnz %w1, 1b \n"
+ : "=&r"(tmp), "=&r"(res), "=&r"(ret)
+ : "r" (p), "r" (val)
+ : "memory"
);
return (ret);
@@ -124,125 +190,73 @@ atomic_fetchadd_32(volatile uint32_t *p, uint32_t val)
static __inline uint32_t
atomic_readandclear_32(volatile uint32_t *p)
{
- uint32_t tmp, ret;
+ uint32_t ret;
int res;
__asm __volatile(
- " mov %w0, #0 \n"
- "1: ldxr %w3, [%2] \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "=&r"(ret) : : "cc"
+ "1: ldxr %w1, [%2] \n"
+ " stxr %w0, wzr, [%2] \n"
+ " cbnz %w0, 1b \n"
+ : "=&r"(res), "=&r"(ret)
+ : "r" (p)
+ : "memory"
);
return (ret);
}
-static __inline void
-atomic_set_32(volatile uint32_t *p, uint32_t val)
+static __inline uint64_t
+atomic_readandclear_64(volatile uint64_t *p)
{
- uint32_t tmp;
+ uint64_t ret;
int res;
__asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " orr %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc"
+ "1: ldxr %1, [%2] \n"
+ " stxr %w0, xzr, [%2] \n"
+ " cbnz %w0, 1b \n"
+ : "=&r"(res), "=&r"(ret)
+ : "r" (p)
+ : "memory"
);
+
+ return (ret);
}
static __inline uint32_t
atomic_swap_32(volatile uint32_t *p, uint32_t val)
{
- uint32_t tmp;
+ uint32_t ret;
int res;
__asm __volatile(
"1: ldxr %w0, [%2] \n"
" stxr %w1, %w3, [%2] \n"
" cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-
- return (tmp);
-}
-
-static __inline void
-atomic_subtract_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " sub %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc"
- );
-}
-
-#define atomic_add_int atomic_add_32
-#define atomic_clear_int atomic_clear_32
-#define atomic_cmpset_int atomic_cmpset_32
-#define atomic_fetchadd_int atomic_fetchadd_32
-#define atomic_readandclear_int atomic_readandclear_32
-#define atomic_set_int atomic_set_32
-#define atomic_swap_int atomic_swap_32
-#define atomic_subtract_int atomic_subtract_32
-
-static __inline void
-atomic_add_acq_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %w0, [%2] \n"
- " add %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
+ : "=&r"(ret), "=&r"(res)
+ : "r" (p), "r" (val)
+ : "memory"
);
-}
-static __inline void
-atomic_clear_acq_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %w0, [%2] \n"
- " bic %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
+ return (ret);
}
-static __inline int
-atomic_cmpset_acq_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
+static __inline uint64_t
+atomic_swap_64(volatile uint64_t *p, uint64_t val)
{
- uint32_t tmp;
+ uint64_t ret;
int res;
__asm __volatile(
- "1: mov %w1, #1 \n"
- " ldaxr %w0, [%2] \n"
- " cmp %w0, %w3 \n"
- " b.ne 2f \n"
- " stxr %w1, %w4, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (cmpval), "+r" (newval)
- : : "cc", "memory"
+ "1: ldxr %0, [%2] \n"
+ " stxr %w1, %3, [%2] \n"
+ " cbnz %w1, 1b \n"
+ : "=&r"(ret), "=&r"(res)
+ : "r" (p), "r" (val)
+ : "memory"
);
- return (!res);
+ return (ret);
}
static __inline uint32_t
@@ -252,279 +266,72 @@ atomic_load_acq_32(volatile uint32_t *p)
__asm __volatile(
"ldar %w0, [%1] \n"
- : "=&r" (ret) : "r" (p) : "memory");
-
- return (ret);
-}
-
-static __inline void
-atomic_set_acq_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %w0, [%2] \n"
- " orr %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline void
-atomic_subtract_acq_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %w0, [%2] \n"
- " sub %w0, %w0, %w3 \n"
- " stxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-#define atomic_add_acq_int atomic_add_acq_32
-#define atomic_clear_acq_int atomic_clear_acq_32
-#define atomic_cmpset_acq_int atomic_cmpset_acq_32
-#define atomic_load_acq_int atomic_load_acq_32
-#define atomic_set_acq_int atomic_set_acq_32
-#define atomic_subtract_acq_int atomic_subtract_acq_32
-
-/* The atomic functions currently are both acq and rel, we should fix this. */
-
-static __inline void
-atomic_add_rel_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " add %w0, %w0, %w3 \n"
- " stlxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline void
-atomic_clear_rel_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " bic %w0, %w0, %w3 \n"
- " stlxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline int
-atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: mov %w1, #1 \n"
- " ldxr %w0, [%2] \n"
- " cmp %w0, %w3 \n"
- " b.ne 2f \n"
- " stlxr %w1, %w4, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (cmpval), "+r" (newval)
- : : "cc", "memory"
- );
-
- return (!res);
-}
-
-static __inline void
-atomic_set_rel_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " orr %w0, %w0, %w3 \n"
- " stlxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline void
-atomic_store_rel_32(volatile uint32_t *p, uint32_t val)
-{
-
- __asm __volatile(
- "stlr %w0, [%1] \n"
- : : "r" (val), "r" (p) : "memory");
-}
-
-static __inline void
-atomic_subtract_rel_32(volatile uint32_t *p, uint32_t val)
-{
- uint32_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %w0, [%2] \n"
- " sub %w0, %w0, %w3 \n"
- " stlxr %w1, %w0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-#define atomic_add_rel_int atomic_add_rel_32
-#define atomic_clear_rel_int atomic_add_rel_32
-#define atomic_cmpset_rel_int atomic_cmpset_rel_32
-#define atomic_set_rel_int atomic_set_rel_32
-#define atomic_subtract_rel_int atomic_subtract_rel_32
-#define atomic_store_rel_int atomic_store_rel_32
-
-
-static __inline void
-atomic_add_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %0, [%2] \n"
- " add %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r" (tmp), "=&r" (res), "+r" (p), "+r" (val) : : "cc"
- );
-}
-
-static __inline void
-atomic_clear_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %0, [%2] \n"
- " bic %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc"
- );
-}
-
-static __inline int
-atomic_cmpset_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: mov %w1, #1 \n"
- " ldxr %0, [%2] \n"
- " cmp %0, %3 \n"
- " b.ne 2f \n"
- " stxr %w1, %4, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r" (tmp), "=&r"(res), "+r" (p), "+r" (cmpval), "+r" (newval)
- : : "cc", "memory"
- );
-
- return (!res);
-}
-
-static __inline uint64_t
-atomic_fetchadd_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp, ret;
- int res;
-
- __asm __volatile(
- "1: ldxr %4, [%2] \n"
- " add %0, %4, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val), "=&r"(ret) : : "cc"
- );
+ : "=&r" (ret)
+ : "r" (p)
+ : "memory");
return (ret);
}
static __inline uint64_t
-atomic_readandclear_64(volatile uint64_t *p)
+atomic_load_acq_64(volatile uint64_t *p)
{
- uint64_t tmp, ret;
- int res;
+ uint64_t ret;
__asm __volatile(
- " mov %0, #0 \n"
- "1: ldxr %3, [%2] \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "=&r"(ret) : : "cc"
- );
+ "ldar %0, [%1] \n"
+ : "=&r" (ret)
+ : "r" (p)
+ : "memory");
return (ret);
}
static __inline void
-atomic_set_64(volatile uint64_t *p, uint64_t val)
+atomic_store_rel_32(volatile uint32_t *p, uint32_t val)
{
- uint64_t tmp;
- int res;
__asm __volatile(
- "1: ldxr %0, [%2] \n"
- " orr %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc"
- );
+ "stlr %w0, [%1] \n"
+ :
+ : "r" (val), "r" (p)
+ : "memory");
}
static __inline void
-atomic_subtract_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %0, [%2] \n"
- " sub %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc"
- );
-}
-
-static __inline uint64_t
-atomic_swap_64(volatile uint64_t *p, uint64_t val)
+atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
{
- uint64_t old;
- int res;
__asm __volatile(
- "1: ldxr %0, [%2] \n"
- " stxr %w1, %3, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(old), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-
- return (old);
-}
+ "stlr %0, [%1] \n"
+ :
+ : "r" (val), "r" (p)
+ : "memory");
+}
+
+
+#define atomic_add_int atomic_add_32
+#define atomic_clear_int atomic_clear_32
+#define atomic_cmpset_int atomic_cmpset_32
+#define atomic_fetchadd_int atomic_fetchadd_32
+#define atomic_readandclear_int atomic_readandclear_32
+#define atomic_set_int atomic_set_32
+#define atomic_swap_int atomic_swap_32
+#define atomic_subtract_int atomic_subtract_32
+
+#define atomic_add_acq_int atomic_add_acq_32
+#define atomic_clear_acq_int atomic_clear_acq_32
+#define atomic_cmpset_acq_int atomic_cmpset_acq_32
+#define atomic_load_acq_int atomic_load_acq_32
+#define atomic_set_acq_int atomic_set_acq_32
+#define atomic_subtract_acq_int atomic_subtract_acq_32
+
+#define atomic_add_rel_int atomic_add_rel_32
+#define atomic_clear_rel_int atomic_add_rel_32
+#define atomic_cmpset_rel_int atomic_cmpset_rel_32
+#define atomic_set_rel_int atomic_set_rel_32
+#define atomic_subtract_rel_int atomic_subtract_rel_32
+#define atomic_store_rel_int atomic_store_rel_32
#define atomic_add_long atomic_add_64
#define atomic_clear_long atomic_clear_64
@@ -544,100 +351,6 @@ atomic_swap_64(volatile uint64_t *p, uint64_t val)
#define atomic_swap_ptr atomic_swap_64
#define atomic_subtract_ptr atomic_subtract_64
-static __inline void
-atomic_add_acq_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %0, [%2] \n"
- " add %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline void
-atomic_clear_acq_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %0, [%2] \n"
- " bic %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline int
-atomic_cmpset_acq_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: mov %w1, #1 \n"
- " ldaxr %0, [%2] \n"
- " cmp %0, %3 \n"
- " b.ne 2f \n"
- " stxr %w1, %4, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r" (tmp), "=&r" (res), "+r" (p), "+r" (cmpval), "+r" (newval)
- : : "cc", "memory"
- );
-
- return (!res);
-}
-
-static __inline uint64_t
-atomic_load_acq_64(volatile uint64_t *p)
-{
- uint64_t ret;
-
- __asm __volatile(
- "ldar %0, [%1] \n"
- : "=&r" (ret) : "r" (p) : "memory");
-
- return (ret);
-}
-
-static __inline void
-atomic_set_acq_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %0, [%2] \n"
- " orr %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline void
-atomic_subtract_acq_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldaxr %0, [%2] \n"
- " sub %0, %0, %3 \n"
- " stxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
#define atomic_add_acq_long atomic_add_acq_64
#define atomic_clear_acq_long atomic_add_acq_64
#define atomic_cmpset_acq_long atomic_cmpset_acq_64
@@ -652,100 +365,19 @@ atomic_subtract_acq_64(volatile uint64_t *p, uint64_t val)
#define atomic_set_acq_ptr atomic_set_acq_64
#define atomic_subtract_acq_ptr atomic_subtract_acq_64
-/*
- * TODO: The atomic functions currently are both acq and rel, we should fix
- * this.
- */
-static __inline void
-atomic_add_rel_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %0, [%2] \n"
- " add %0, %0, %3 \n"
- " stlxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline void
-atomic_clear_rel_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %0, [%2] \n"
- " bic %0, %0, %3 \n"
- " stlxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline int
-atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: mov %w1, #1 \n"
- " ldxr %0, [%2] \n"
- " cmp %0, %3 \n"
- " b.ne 2f \n"
- " stlxr %w1, %4, [%2] \n"
- " cbnz %w1, 1b \n"
- "2:"
- : "=&r" (tmp), "=&r" (res), "+r" (p), "+r" (cmpval), "+r" (newval)
- : : "cc", "memory"
- );
-
- return (!res);
-}
-
-static __inline void
-atomic_set_rel_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
-
- __asm __volatile(
- "1: ldxr %0, [%2] \n"
- " orr %0, %0, %3 \n"
- " stlxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
-
-static __inline void
-atomic_store_rel_64(volatile uint64_t *p, uint64_t val)
-{
-
- __asm __volatile(
- "stlr %0, [%1] \n"
- : : "r" (val), "r" (p) : "memory");
-}
-
-static __inline void
-atomic_subtract_rel_64(volatile uint64_t *p, uint64_t val)
-{
- uint64_t tmp;
- int res;
+#define atomic_add_rel_long atomic_add_rel_64
+#define atomic_clear_rel_long atomic_clear_rel_64
+#define atomic_cmpset_rel_long atomic_cmpset_rel_64
+#define atomic_set_rel_long atomic_set_rel_64
+#define atomic_subtract_rel_long atomic_subtract_rel_64
+#define atomic_store_rel_long atomic_store_rel_64
- __asm __volatile(
- "1: ldxr %0, [%2] \n"
- " sub %0, %0, %3 \n"
- " stlxr %w1, %0, [%2] \n"
- " cbnz %w1, 1b \n"
- : "=&r"(tmp), "=&r"(res), "+r" (p), "+r" (val) : : "cc", "memory"
- );
-}
+#define atomic_add_rel_ptr atomic_add_rel_64
+#define atomic_clear_rel_ptr atomic_clear_rel_64
+#define atomic_cmpset_rel_ptr atomic_cmpset_rel_64
+#define atomic_set_rel_ptr atomic_set_rel_64
+#define atomic_subtract_rel_ptr atomic_subtract_rel_64
+#define atomic_store_rel_ptr atomic_store_rel_64
static __inline void
atomic_thread_fence_acq(void)
@@ -775,19 +407,5 @@ atomic_thread_fence_seq_cst(void)
dmb(sy);
}
-#define atomic_add_rel_long atomic_add_rel_64
-#define atomic_clear_rel_long atomic_clear_rel_64
-#define atomic_cmpset_rel_long atomic_cmpset_rel_64
-#define atomic_set_rel_long atomic_set_rel_64
-#define atomic_subtract_rel_long atomic_subtract_rel_64
-#define atomic_store_rel_long atomic_store_rel_64
-
-#define atomic_add_rel_ptr atomic_add_rel_64
-#define atomic_clear_rel_ptr atomic_clear_rel_64
-#define atomic_cmpset_rel_ptr atomic_cmpset_rel_64
-#define atomic_set_rel_ptr atomic_set_rel_64
-#define atomic_subtract_rel_ptr atomic_subtract_rel_64
-#define atomic_store_rel_ptr atomic_store_rel_64
-
#endif /* _MACHINE_ATOMIC_H_ */
diff --git a/sys/boot/common/Makefile.depend b/sys/boot/common/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/common/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/common/disk.c b/sys/boot/common/disk.c
index a541cb0..a8801e1 100644
--- a/sys/boot/common/disk.c
+++ b/sys/boot/common/disk.c
@@ -233,6 +233,42 @@ disk_print(struct disk_devdesc *dev, char *prefix, int verbose)
}
int
+disk_read(struct disk_devdesc *dev, void *buf, off_t offset, u_int blocks)
+{
+ struct open_disk *od;
+ int ret;
+
+ od = (struct open_disk *)dev->d_opendata;
+ ret = dev->d_dev->dv_strategy(dev, F_READ, dev->d_offset + offset,
+ blocks * od->sectorsize, buf, NULL);
+
+ return (ret);
+}
+
+int
+disk_write(struct disk_devdesc *dev, void *buf, off_t offset, u_int blocks)
+{
+ struct open_disk *od;
+ int ret;
+
+ od = (struct open_disk *)dev->d_opendata;
+ ret = dev->d_dev->dv_strategy(dev, F_WRITE, dev->d_offset + offset,
+ blocks * od->sectorsize, buf, NULL);
+
+ return (ret);
+}
+
+int
+disk_ioctl(struct disk_devdesc *dev, u_long cmd, void *buf)
+{
+
+ if (dev->d_dev->dv_ioctl)
+ return ((*dev->d_dev->dv_ioctl)(dev->d_opendata, cmd, buf));
+
+ return (ENXIO);
+}
+
+int
disk_open(struct disk_devdesc *dev, off_t mediasize, u_int sectorsize,
u_int flags)
{
diff --git a/sys/boot/common/disk.h b/sys/boot/common/disk.h
index 6a78fbf..e95256d 100644
--- a/sys/boot/common/disk.h
+++ b/sys/boot/common/disk.h
@@ -89,6 +89,11 @@ struct disk_devdesc
off_t d_offset;
};
+enum disk_ioctl {
+ IOCTL_GET_BLOCKS,
+ IOCTL_GET_BLOCK_SIZE
+};
+
/*
* Parse disk metadata and initialise dev->d_offset.
*/
@@ -97,6 +102,11 @@ extern int disk_open(struct disk_devdesc *dev, off_t mediasize,
#define DISK_F_NOCACHE 0x0001 /* Do not use metadata caching */
extern int disk_close(struct disk_devdesc *dev);
extern void disk_cleanup(const struct devsw *d_dev);
+extern int disk_ioctl(struct disk_devdesc *dev, u_long cmd, void *buf);
+extern int disk_read(struct disk_devdesc *dev, void *buf, off_t offset,
+ u_int blocks);
+extern int disk_write(struct disk_devdesc *dev, void *buf, off_t offset,
+ u_int blocks);
/*
* Print information about slices on a disk.
diff --git a/sys/boot/efi/boot1/Makefile.depend b/sys/boot/efi/boot1/Makefile.depend
new file mode 100644
index 0000000..79506ce
--- /dev/null
+++ b/sys/boot/efi/boot1/Makefile.depend
@@ -0,0 +1,12 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/efi/fdt/Makefile.depend b/sys/boot/efi/fdt/Makefile.depend
new file mode 100644
index 0000000..18be76b
--- /dev/null
+++ b/sys/boot/efi/fdt/Makefile.depend
@@ -0,0 +1,13 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/efi/loader/Makefile.depend b/sys/boot/efi/loader/Makefile.depend
new file mode 100644
index 0000000..3129986
--- /dev/null
+++ b/sys/boot/efi/loader/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libstand \
+ sys/boot/efi/libefi \
+ sys/boot/ficl \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+vers.o: vers.c
+vers.po: vers.c
+.endif
diff --git a/sys/boot/fdt/Makefile.depend b/sys/boot/fdt/Makefile.depend
new file mode 100644
index 0000000..2984414
--- /dev/null
+++ b/sys/boot/fdt/Makefile.depend
@@ -0,0 +1,14 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libstand \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/fdt/dts/arm/odroidc1.dts b/sys/boot/fdt/dts/arm/odroidc1.dts
index aadaef3..2d15a09 100644
--- a/sys/boot/fdt/dts/arm/odroidc1.dts
+++ b/sys/boot/fdt/dts/arm/odroidc1.dts
@@ -323,7 +323,7 @@
eth@c9410000 {
/* ethernet */
- compatible = "snps,dwmac";
+ compatible = "amlogic,meson6-dwmac";
reg = <0xc9410000 0x2000>; /* ahbbus 0x410000 */
interrupts = <0 8 1>;
#address-cells = <1>;
diff --git a/sys/boot/ficl32/Makefile.depend b/sys/boot/ficl32/Makefile.depend
new file mode 100644
index 0000000..729ef23
--- /dev/null
+++ b/sys/boot/ficl32/Makefile.depend
@@ -0,0 +1,17 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libstand \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+softcore.o: softcore.c
+softcore.po: softcore.c
+.endif
diff --git a/sys/boot/forth/Makefile.depend b/sys/boot/forth/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/forth/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/boot2/Makefile.depend b/sys/boot/i386/boot2/Makefile.depend
index f80275d..d5a67a6 100644
--- a/sys/boot/i386/boot2/Makefile.depend
+++ b/sys/boot/i386/boot2/Makefile.depend
@@ -2,6 +2,9 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ include \
+ sys/boot/i386/btx/btx \
+ sys/boot/i386/btx/lib \
.include <dirdeps.mk>
diff --git a/sys/boot/i386/btx/btx/Makefile.depend b/sys/boot/i386/btx/btx/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/i386/btx/btx/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/btx/btxldr/Makefile.depend b/sys/boot/i386/btx/btxldr/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/i386/btx/btxldr/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/btx/lib/Makefile.depend b/sys/boot/i386/btx/lib/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/i386/btx/lib/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/cdboot/Makefile.depend b/sys/boot/i386/cdboot/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/i386/cdboot/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/gptboot/Makefile.depend b/sys/boot/i386/gptboot/Makefile.depend
new file mode 100644
index 0000000..c798603
--- /dev/null
+++ b/sys/boot/i386/gptboot/Makefile.depend
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ sys/boot/i386/btx/btx \
+ sys/boot/i386/btx/lib \
+ sys/boot/libstand32 \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/gptzfsboot/Makefile.depend b/sys/boot/i386/gptzfsboot/Makefile.depend
new file mode 100644
index 0000000..63a43d8
--- /dev/null
+++ b/sys/boot/i386/gptzfsboot/Makefile.depend
@@ -0,0 +1,16 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ sys/boot/i386/btx/btx \
+ sys/boot/i386/btx/lib \
+ sys/boot/libstand32 \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/kgzldr/Makefile.depend b/sys/boot/i386/kgzldr/Makefile.depend
new file mode 100644
index 0000000..79506ce
--- /dev/null
+++ b/sys/boot/i386/kgzldr/Makefile.depend
@@ -0,0 +1,12 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/libfirewire/Makefile.depend b/sys/boot/i386/libfirewire/Makefile.depend
new file mode 100644
index 0000000..18be76b
--- /dev/null
+++ b/sys/boot/i386/libfirewire/Makefile.depend
@@ -0,0 +1,13 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/libi386/Makefile.depend b/sys/boot/i386/libi386/Makefile.depend
new file mode 100644
index 0000000..18be76b
--- /dev/null
+++ b/sys/boot/i386/libi386/Makefile.depend
@@ -0,0 +1,13 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/loader/Makefile.depend b/sys/boot/i386/loader/Makefile.depend
index f80275d..ece1e95 100644
--- a/sys/boot/i386/loader/Makefile.depend
+++ b/sys/boot/i386/loader/Makefile.depend
@@ -2,10 +2,21 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libstand \
+ sys/boot/ficl32 \
+ sys/boot/i386/btx/btx \
+ sys/boot/i386/btx/btxldr \
+ sys/boot/i386/btx/lib \
+ sys/boot/i386/libi386 \
+ sys/boot/libstand32 \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
+vers.o: vers.c
+vers.po: vers.c
.endif
diff --git a/sys/boot/i386/mbr/Makefile.depend b/sys/boot/i386/mbr/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/i386/mbr/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/pmbr/Makefile.depend b/sys/boot/i386/pmbr/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/sys/boot/i386/pmbr/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/pxeldr/Makefile.depend b/sys/boot/i386/pxeldr/Makefile.depend
new file mode 100644
index 0000000..c6f574a
--- /dev/null
+++ b/sys/boot/i386/pxeldr/Makefile.depend
@@ -0,0 +1,15 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ sys/boot/i386/btx/btx \
+ sys/boot/i386/btx/btxldr \
+ sys/boot/i386/loader \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/zfsboot/Makefile.depend b/sys/boot/i386/zfsboot/Makefile.depend
new file mode 100644
index 0000000..63a43d8
--- /dev/null
+++ b/sys/boot/i386/zfsboot/Makefile.depend
@@ -0,0 +1,16 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ sys/boot/i386/btx/btx \
+ sys/boot/i386/btx/lib \
+ sys/boot/libstand32 \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/i386/zfsloader/Makefile.depend b/sys/boot/i386/zfsloader/Makefile.depend
index f80275d..840a6c3 100644
--- a/sys/boot/i386/zfsloader/Makefile.depend
+++ b/sys/boot/i386/zfsloader/Makefile.depend
@@ -2,10 +2,22 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libstand \
+ sys/boot/ficl32 \
+ sys/boot/i386/btx/btx \
+ sys/boot/i386/btx/btxldr \
+ sys/boot/i386/btx/lib \
+ sys/boot/i386/libi386 \
+ sys/boot/libstand32 \
+ sys/boot/zfs \
.include <dirdeps.mk>
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
+vers.o: vers.c
+vers.po: vers.c
.endif
diff --git a/sys/boot/kshim/bsd_busspace.c b/sys/boot/kshim/bsd_busspace.c
index c9ba09f..778c449 100644
--- a/sys/boot/kshim/bsd_busspace.c
+++ b/sys/boot/kshim/bsd_busspace.c
@@ -37,6 +37,15 @@ struct burst {
uint32_t dw7;
};
+int
+bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp)
+{
+
+ *nbshp = bsh + offset;
+ return (0);
+}
+
void
bus_space_read_multi_1(bus_space_tag_t t, bus_space_handle_t h,
bus_size_t offset, uint8_t *datap, bus_size_t count)
diff --git a/sys/boot/kshim/bsd_global.h b/sys/boot/kshim/bsd_global.h
index 2fb0dcc..4f6d88b 100644
--- a/sys/boot/kshim/bsd_global.h
+++ b/sys/boot/kshim/bsd_global.h
@@ -29,6 +29,8 @@
#include <bsd_kernel.h>
+#include <sys/gpio.h>
+
#define USB_DEBUG_VAR usb_debug
#include <dev/usb/usb_freebsd_loader.h>
#include <dev/usb/usb_endian.h>
@@ -59,6 +61,8 @@
#include <dev/usb/usb_generic.h>
#include <dev/usb/quirk/usb_quirk.h>
#include <dev/usb/template/usb_template.h>
+#include <dev/usb/controller/ehci.h>
+#include <dev/usb/controller/ehcireg.h>
extern struct usb_process usb_process[USB_PROC_MAX];
diff --git a/sys/boot/kshim/bsd_kernel.c b/sys/boot/kshim/bsd_kernel.c
index d41b9f4..de92c8f 100644
--- a/sys/boot/kshim/bsd_kernel.c
+++ b/sys/boot/kshim/bsd_kernel.c
@@ -35,6 +35,10 @@ static device_t usb_pci_root;
*------------------------------------------------------------------------*/
struct mtx Giant;
+int (*bus_alloc_resource_any_cb)(struct resource *res, device_t dev,
+ int type, int *rid, unsigned int flags);
+int (*ofw_bus_status_ok_cb)(device_t dev);
+int (*ofw_bus_is_compatible_cb)(device_t dev, char *name);
static void
mtx_system_init(void *arg)
@@ -43,6 +47,146 @@ mtx_system_init(void *arg)
}
SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL);
+struct resource *
+bus_alloc_resource_any(device_t dev, int type, int *rid, unsigned int flags)
+{
+ struct resource *res;
+ int ret = EINVAL;
+
+ res = malloc(sizeof(*res), XXX, XXX);
+ if (res == NULL)
+ return (NULL);
+
+ res->__r_i = malloc(sizeof(struct resource_i), XXX, XXX);
+ if (res->__r_i == NULL) {
+ free(res, XXX);
+ return (NULL);
+ }
+
+ if (bus_alloc_resource_any_cb != NULL)
+ ret = (*bus_alloc_resource_any_cb)(res, dev, type, rid, flags);
+ if (ret == 0)
+ return (res);
+
+ free(res->__r_i, XXX);
+ free(res, XXX);
+ return (NULL);
+}
+
+int
+bus_alloc_resources(device_t dev, struct resource_spec *rs,
+ struct resource **res)
+{
+ int i;
+
+ for (i = 0; rs[i].type != -1; i++)
+ res[i] = NULL;
+ for (i = 0; rs[i].type != -1; i++) {
+ res[i] = bus_alloc_resource_any(dev,
+ rs[i].type, &rs[i].rid, rs[i].flags);
+ if (res[i] == NULL && !(rs[i].flags & RF_OPTIONAL)) {
+ bus_release_resources(dev, rs, res);
+ return (ENXIO);
+ }
+ }
+ return (0);
+}
+
+void
+bus_release_resources(device_t dev, const struct resource_spec *rs,
+ struct resource **res)
+{
+ int i;
+
+ for (i = 0; rs[i].type != -1; i++)
+ if (res[i] != NULL) {
+ bus_release_resource(
+ dev, rs[i].type, rs[i].rid, res[i]);
+ res[i] = NULL;
+ }
+}
+
+int
+bus_setup_intr(device_t dev, struct resource *r, int flags,
+ driver_filter_t filter, driver_intr_t handler, void *arg, void **cookiep)
+{
+
+ dev->dev_irq_filter = filter;
+ dev->dev_irq_fn = handler;
+ dev->dev_irq_arg = arg;
+
+ return (0);
+}
+
+int
+bus_teardown_intr(device_t dev, struct resource *r, void *cookie)
+{
+
+ dev->dev_irq_filter = NULL;
+ dev->dev_irq_fn = NULL;
+ dev->dev_irq_arg = NULL;
+
+ return (0);
+}
+
+int
+bus_release_resource(device_t dev, int type, int rid, struct resource *r)
+{
+ /* Resource releasing is not supported */
+ return (EINVAL);
+}
+
+int
+bus_generic_attach(device_t dev)
+{
+ device_t child;
+
+ TAILQ_FOREACH(child, &dev->dev_children, dev_link) {
+ device_probe_and_attach(child);
+ }
+
+ return (0);
+}
+
+bus_space_tag_t
+rman_get_bustag(struct resource *r)
+{
+
+ return (r->r_bustag);
+}
+
+bus_space_handle_t
+rman_get_bushandle(struct resource *r)
+{
+
+ return (r->r_bushandle);
+}
+
+u_long
+rman_get_size(struct resource *r)
+{
+
+ return (r->__r_i->r_end - r->__r_i->r_start + 1);
+}
+
+int
+ofw_bus_status_okay(device_t dev)
+{
+ if (ofw_bus_status_ok_cb == NULL)
+ return (0);
+
+ return ((*ofw_bus_status_ok_cb)(dev));
+}
+
+int
+ofw_bus_is_compatible(device_t dev, char *name)
+{
+ if (ofw_bus_is_compatible_cb == NULL)
+ return (0);
+
+ return ((*ofw_bus_is_compatible_cb)(dev, name));
+}
+
void
mtx_init(struct mtx *mtx, const char *name, const char *type, int opt)
{
@@ -138,6 +282,7 @@ cv_timedwait(struct cv *cv, struct mtx *mtx, int timo)
{
int start = ticks;
int delta;
+ int time = 0;
if (cv->sleeping)
return (EWOULDBLOCK); /* not allowed */
@@ -154,6 +299,14 @@ cv_timedwait(struct cv *cv, struct mtx *mtx, int timo)
usb_idle();
+ if (++time >= (1000000 / hz)) {
+ time = 0;
+ callout_process(1);
+ }
+
+ /* Sleep for 1 us */
+ delay(1);
+
mtx_lock(mtx);
}
@@ -864,7 +1017,7 @@ devclass_find(const char *classname)
const struct module_data *mod;
TAILQ_FOREACH(mod, &module_head, entry) {
- if (devclass_equal(mod->mod_name, classname))
+ if (devclass_equal(mod->driver->name, classname))
return (mod->devclass_pp[0]);
}
return (NULL);
diff --git a/sys/boot/kshim/bsd_kernel.h b/sys/boot/kshim/bsd_kernel.h
index aba8131..72e0d23 100644
--- a/sys/boot/kshim/bsd_kernel.h
+++ b/sys/boot/kshim/bsd_kernel.h
@@ -109,6 +109,7 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \
#define WITNESS_WARN(...)
#define cold 0
#define BUS_PROBE_GENERIC 0
+#define BUS_PROBE_DEFAULT (-20)
#define CALLOUT_RETURNUNLOCKED 0x1
#undef ffs
#define ffs(x) __builtin_ffs(x)
@@ -138,6 +139,10 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \
(((usb_handle_request_t *)(device_get_method(dev, "usb_handle_request")))(dev,## __VA_ARGS__))
#define USB_TAKE_CONTROLLER(dev, ...) \
(((usb_take_controller_t *)(device_get_method(dev, "usb_take_controller")))(dev,## __VA_ARGS__))
+#define GPIO_PIN_SET(dev, ...) \
+ (((gpio_pin_set_t *)(device_get_method(dev, "gpio_pin_set")))(dev,## __VA_ARGS__))
+#define GPIO_PIN_SETFLAGS(dev, ...) \
+ (((gpio_pin_setflags_t *)(device_get_method(dev, "gpio_pin_setflags")))(dev,## __VA_ARGS__))
enum {
SI_SUB_DUMMY = 0x0000000,
@@ -302,6 +307,8 @@ typedef int device_resume_t (device_t dev);
typedef int device_shutdown_t (device_t dev);
typedef int device_probe_t (device_t dev);
typedef int device_suspend_t (device_t dev);
+typedef int gpio_pin_set_t (device_t dev, uint32_t, unsigned int);
+typedef int gpio_pin_setflags_t (device_t dev, uint32_t, uint32_t);
typedef int bus_child_location_str_t (device_t parent, device_t child, char *buf, size_t buflen);
typedef int bus_child_pnpinfo_str_t (device_t parent, device_t child, char *buf, size_t buflen);
@@ -397,6 +404,8 @@ int bus_generic_shutdown(device_t dev);
int bus_generic_suspend(device_t dev);
int bus_generic_print_child(device_t dev, device_t child);
void bus_generic_driver_added(device_t dev, driver_t *driver);
+int bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh,
+ bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp);
/* BUS SPACE API */
@@ -496,4 +505,78 @@ struct selinfo {
extern const void *sysinit_data[];
extern const void *sysuninit_data[];
+/* Resources */
+
+enum intr_type {
+ INTR_TYPE_TTY = 1,
+ INTR_TYPE_BIO = 2,
+ INTR_TYPE_NET = 4,
+ INTR_TYPE_CAM = 8,
+ INTR_TYPE_MISC = 16,
+ INTR_TYPE_CLK = 32,
+ INTR_TYPE_AV = 64,
+ INTR_EXCL = 256, /* exclusive interrupt */
+ INTR_MPSAFE = 512, /* this interrupt is SMP safe */
+ INTR_ENTROPY = 1024, /* this interrupt provides entropy */
+ INTR_MD1 = 4096, /* flag reserved for MD use */
+ INTR_MD2 = 8192, /* flag reserved for MD use */
+ INTR_MD3 = 16384, /* flag reserved for MD use */
+ INTR_MD4 = 32768 /* flag reserved for MD use */
+};
+
+struct resource_i {
+ u_long r_start; /* index of the first entry in this resource */
+ u_long r_end; /* index of the last entry (inclusive) */
+};
+
+struct resource {
+ struct resource_i *__r_i;
+ bus_space_tag_t r_bustag; /* bus_space tag */
+ bus_space_handle_t r_bushandle; /* bus_space handle */
+};
+
+struct resource_spec {
+ int type;
+ int rid;
+ int flags;
+};
+
+#define SYS_RES_IRQ 1 /* interrupt lines */
+#define SYS_RES_DRQ 2 /* isa dma lines */
+#define SYS_RES_MEMORY 3 /* i/o memory */
+#define SYS_RES_IOPORT 4 /* i/o ports */
+
+#define RF_ALLOCATED 0x0001 /* resource has been reserved */
+#define RF_ACTIVE 0x0002 /* resource allocation has been activated */
+#define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */
+#define RF_SPARE1 0x0008
+#define RF_SPARE2 0x0010
+#define RF_FIRSTSHARE 0x0020 /* first in sharing list */
+#define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */
+#define RF_OPTIONAL 0x0080 /* for bus_alloc_resources() */
+
+int bus_alloc_resources(device_t, struct resource_spec *, struct resource **);
+int bus_release_resource(device_t, int, int, struct resource *);
+void bus_release_resources(device_t, const struct resource_spec *,
+ struct resource **);
+struct resource *bus_alloc_resource_any(device_t, int, int *, unsigned int);
+int bus_generic_attach(device_t);
+bus_space_tag_t rman_get_bustag(struct resource *);
+bus_space_handle_t rman_get_bushandle(struct resource *);
+u_long rman_get_size(struct resource *);
+int bus_setup_intr(device_t, struct resource *, int, driver_filter_t,
+ driver_intr_t, void *, void **);
+int bus_teardown_intr(device_t, struct resource *, void *);
+int ofw_bus_status_okay(device_t);
+int ofw_bus_is_compatible(device_t, char *);
+
+extern int (*bus_alloc_resource_any_cb)(struct resource *res, device_t dev,
+ int type, int *rid, unsigned int flags);
+extern int (*ofw_bus_status_ok_cb)(device_t dev);
+extern int (*ofw_bus_is_compatible_cb)(device_t dev, char *name);
+
+#ifndef strlcpy
+#define strlcpy(d,s,n) snprintf((d),(n),"%s",(s))
+#endif
+
#endif /* _BSD_KERNEL_H_ */
diff --git a/sys/boot/libstand32/Makefile.depend b/sys/boot/libstand32/Makefile.depend
new file mode 100644
index 0000000..dae5bcd
--- /dev/null
+++ b/sys/boot/libstand32/Makefile.depend
@@ -0,0 +1,58 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/libbz2 \
+ lib/libstand \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+_bzlib.o: _bzlib.c
+_bzlib.o: libstand_bzlib_private.h
+_bzlib.po: _bzlib.c
+_bzlib.po: libstand_bzlib_private.h
+_crctable.o: _crctable.c
+_crctable.o: libstand_bzlib_private.h
+_crctable.po: _crctable.c
+_crctable.po: libstand_bzlib_private.h
+_decompress.o: _decompress.c
+_decompress.o: libstand_bzlib_private.h
+_decompress.po: _decompress.c
+_decompress.po: libstand_bzlib_private.h
+_huffman.o: _huffman.c
+_huffman.o: libstand_bzlib_private.h
+_huffman.po: _huffman.c
+_huffman.po: libstand_bzlib_private.h
+_infback.o: _infback.c
+_infback.o: libstand_zutil.h
+_infback.po: _infback.c
+_infback.po: libstand_zutil.h
+_inffast.o: _inffast.c
+_inffast.o: libstand_zutil.h
+_inffast.po: _inffast.c
+_inffast.po: libstand_zutil.h
+_inflate.o: _inflate.c
+_inflate.o: libstand_zutil.h
+_inflate.po: _inflate.c
+_inflate.po: libstand_zutil.h
+_inftrees.o: _inftrees.c
+_inftrees.o: libstand_zutil.h
+_inftrees.po: _inftrees.c
+_inftrees.po: libstand_zutil.h
+_randtable.o: _randtable.c
+_randtable.o: libstand_bzlib_private.h
+_randtable.po: _randtable.c
+_randtable.po: libstand_bzlib_private.h
+_zutil.o: _zutil.c
+_zutil.o: libstand_gzguts.h
+_zutil.o: libstand_zutil.h
+_zutil.po: _zutil.c
+_zutil.po: libstand_gzguts.h
+_zutil.po: libstand_zutil.h
+.endif
diff --git a/sys/boot/ofw/libofw/ppc64_elf_freebsd.c b/sys/boot/ofw/libofw/ppc64_elf_freebsd.c
index f85a77a..b411da4 100644
--- a/sys/boot/ofw/libofw/ppc64_elf_freebsd.c
+++ b/sys/boot/ofw/libofw/ppc64_elf_freebsd.c
@@ -77,8 +77,11 @@ ppc64_ofw_elf_exec(struct preloaded_file *fp)
}
e = (Elf_Ehdr *)&fmp->md_data;
- /* Handle function descriptor */
- entry = *(uint64_t *)e->e_entry;
+ /* Handle function descriptor for ELFv1 kernels */
+ if ((e->e_flags & 3) == 2)
+ entry = e->e_entry;
+ else
+ entry = *(uint64_t *)e->e_entry;
if ((error = md_load64(fp->f_args, &mdp, &dtbp)) != 0)
return (error);
diff --git a/sys/boot/powerpc/Makefile.inc b/sys/boot/powerpc/Makefile.inc
index e67c0dc..1b62477 100644
--- a/sys/boot/powerpc/Makefile.inc
+++ b/sys/boot/powerpc/Makefile.inc
@@ -2,7 +2,6 @@
.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+= -m32 -mcpu=powerpc
-LDFLAGS+= -m elf32ppc_fbsd
.endif
.include "../Makefile.inc"
diff --git a/sys/boot/powerpc/boot1.chrp/Makefile b/sys/boot/powerpc/boot1.chrp/Makefile
index c350e5c..381d2a8 100644
--- a/sys/boot/powerpc/boot1.chrp/Makefile
+++ b/sys/boot/powerpc/boot1.chrp/Makefile
@@ -12,7 +12,7 @@ SRCS= boot1.c ashldi3.c syncicache.c
MAN=
-CFLAGS= -ffreestanding -msoft-float -Os \
+CFLAGS= -ffreestanding -msoft-float \
-I${.CURDIR}/../../common -I${.CURDIR}/../../../ \
-D_STANDALONE
LDFLAGS=-nostdlib -static -Wl,-N
diff --git a/sys/boot/powerpc/kboot/ppc64_elf_freebsd.c b/sys/boot/powerpc/kboot/ppc64_elf_freebsd.c
index 3ee5e78..22fa7b5 100644
--- a/sys/boot/powerpc/kboot/ppc64_elf_freebsd.c
+++ b/sys/boot/powerpc/kboot/ppc64_elf_freebsd.c
@@ -78,10 +78,15 @@ ppc64_elf_exec(struct preloaded_file *fp)
/* Figure out where to put it */
trampolinebase = archsw.arch_loadaddr(LOAD_RAW, NULL, 0);
- /* Set up interesting values in function descriptor */
+ /* Set up loader trampoline */
trampoline = malloc(szkerneltramp);
memcpy(trampoline, &kerneltramp, szkerneltramp);
- archsw.arch_copyout(e->e_entry + elf64_relocation_offset, &entry, 8);
+ /* Parse function descriptor for ELFv1 kernels */
+ if ((e->e_flags & 3) == 2)
+ entry = e->e_entry;
+ else
+ archsw.arch_copyout(e->e_entry + elf64_relocation_offset,
+ &entry, 8);
trampoline[2] = entry + elf64_relocation_offset;
trampoline[4] = 0; /* Phys. mem offset */
trampoline[5] = 0; /* OF entry point */
diff --git a/sys/boot/powerpc/ps3/ppc64_elf_freebsd.c b/sys/boot/powerpc/ps3/ppc64_elf_freebsd.c
index 2892448..3eb991e 100644
--- a/sys/boot/powerpc/ps3/ppc64_elf_freebsd.c
+++ b/sys/boot/powerpc/ps3/ppc64_elf_freebsd.c
@@ -75,8 +75,11 @@ ppc64_elf_exec(struct preloaded_file *fp)
}
e = (Elf_Ehdr *)&fmp->md_data;
- /* Handle function descriptor */
- entry = (void *)(uintptr_t)(*(uint64_t *)e->e_entry);
+ /* Handle function descriptor for ELFv1 kernels */
+ if ((e->e_flags & 3) == 2)
+ entry = e->e_entry;
+ else
+ entry = (void *)(uintptr_t)(*(uint64_t *)e->e_entry);
if ((error = md_load64(fp->f_args, &mdp)) != 0)
return (error);
diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c
index aac7bf8..28cbbd5 100644
--- a/sys/boot/uboot/common/main.c
+++ b/sys/boot/uboot/common/main.c
@@ -488,7 +488,7 @@ main(void)
ldev = uboot_fmtdev(&currdev);
env_setenv("currdev", EV_VOLATILE, ldev, uboot_setcurrdev, env_nounset);
env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset);
- printf("Booting from %s %\n", ldev);
+ printf("Booting from %s\n", ldev);
setenv("LINES", "24", 1); /* optional */
setenv("prompt", "loader>", 1);
diff --git a/sys/boot/usb/storage/umass_common.c b/sys/boot/usb/storage/umass_common.c
index b9c7e0d..5ddd159 100644
--- a/sys/boot/usb/storage/umass_common.c
+++ b/sys/boot/usb/storage/umass_common.c
@@ -82,6 +82,9 @@ umass_attach(device_t dev)
static int
umass_detach(device_t dev)
{
+
+#ifdef USB_DEBUG
memset(&umass_uaa, 0, sizeof(umass_uaa));
+#endif
return (0);
}
diff --git a/sys/boot/usb/storage/umass_loader.c b/sys/boot/usb/storage/umass_loader.c
index cba82ae..4311b2b 100644
--- a/sys/boot/usb/storage/umass_loader.c
+++ b/sys/boot/usb/storage/umass_loader.c
@@ -47,6 +47,7 @@ static int umass_disk_init(void);
static int umass_disk_open(struct open_file *,...);
static int umass_disk_close(struct open_file *);
static void umass_disk_cleanup(void);
+static int umass_disk_ioctl(struct open_file *, u_long, void *);
static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *);
static void umass_disk_print(int);
@@ -57,7 +58,7 @@ struct devsw umass_disk = {
.dv_strategy = umass_disk_strategy,
.dv_open = umass_disk_open,
.dv_close = umass_disk_close,
- .dv_ioctl = noioctl,
+ .dv_ioctl = umass_disk_ioctl,
.dv_print = umass_disk_print,
.dv_cleanup = umass_disk_cleanup,
};
@@ -136,6 +137,30 @@ umass_disk_open(struct open_file *f,...)
}
static int
+umass_disk_ioctl(struct open_file *f __unused, u_long cmd, void *buf)
+{
+ uint32_t nblock;
+ uint32_t blocksize;
+
+ switch (cmd) {
+ case IOCTL_GET_BLOCK_SIZE:
+ case IOCTL_GET_BLOCKS:
+ if (usb_msc_read_capacity(umass_uaa.device, 0,
+ &nblock, &blocksize) != 0)
+ return (EINVAL);
+
+ if (cmd == IOCTL_GET_BLOCKS)
+ *(uint32_t*)buf = nblock;
+ else
+ *(uint32_t*)buf = blocksize;
+
+ return (0);
+ default:
+ return (ENXIO);
+ }
+}
+
+static int
umass_disk_close(struct open_file *f)
{
struct disk_devdesc *dev;
diff --git a/sys/boot/usb/usb_busdma_loader.c b/sys/boot/usb/usb_busdma_loader.c
index ad7180b..90dc169 100644
--- a/sys/boot/usb/usb_busdma_loader.c
+++ b/sys/boot/usb/usb_busdma_loader.c
@@ -233,7 +233,7 @@ usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
pc->ismultiseg = (align == 1);
/* compute physical address */
- usb_pc_common_mem_cb(pc, ptr, size);
+ usb_pc_common_mem_cb(pc, pc->buffer, size);
usb_pc_cpu_flush(pc);
return (0);
diff --git a/sys/boot/usb/usbcore.mk b/sys/boot/usb/usbcore.mk
index 121e036..153a1d4 100644
--- a/sys/boot/usb/usbcore.mk
+++ b/sys/boot/usb/usbcore.mk
@@ -34,6 +34,12 @@
USBCOREDIR:= ${.PARSEDIR}
S=${USBCOREDIR}/../..
+MACHDEP_DIRS=
+
+.if defined(HAVE_EXYNOS_EHCI)
+MACHDEP_DIRS+= ${S}/arm/samsung/exynos
+.endif
+
.PATH: \
${USBCOREDIR} \
${USBCOREDIR}/storage \
@@ -41,11 +47,15 @@ S=${USBCOREDIR}/../..
${S}/dev/usb/controller \
${S}/dev/usb/serial \
${S}/dev/usb/storage \
- ${S}/dev/usb/template
+ ${S}/dev/usb/template \
+ ${MACHDEP_DIRS}
.undef S
+USB_POOL_SIZE?= 131072
+
CFLAGS+= -DUSB_MSCTEST_BULK_SIZE=65536
-CFLAGS+= -DUSB_POOL_SIZE=131072
+CFLAGS+= -DUSB_POOL_SIZE=${USB_POOL_SIZE}
+
#
# BUSDMA implementation
@@ -88,6 +98,14 @@ CFLAGS += -DUSB_PCI_PROBE_LIST="\"ehci\""
KSRCS+= ehci.c
.endif
+.if defined(HAVE_EXYNOS_EHCI)
+CFLAGS += -DUSB_PCI_PROBE_LIST="\"combiner\", \"pad\", \"ehci\""
+KSRCS+= ehci.c
+KSRCS+= exynos5_combiner.c
+KSRCS+= exynos5_pad.c
+KSRCS+= exynos5_ehci.c
+.endif
+
.if defined(HAVE_OHCI)
CFLAGS += -DUSB_PCI_PROBE_LIST="\"ohci\""
KSRCS+= ohci.c
diff --git a/sys/boot/userboot/ficl/Makefile.depend b/sys/boot/userboot/ficl/Makefile.depend
new file mode 100644
index 0000000..729ef23
--- /dev/null
+++ b/sys/boot/userboot/ficl/Makefile.depend
@@ -0,0 +1,17 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/libstand \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+softcore.o: softcore.c
+softcore.po: softcore.c
+.endif
diff --git a/sys/boot/userboot/libstand/Makefile.depend b/sys/boot/userboot/libstand/Makefile.depend
new file mode 100644
index 0000000..dae5bcd
--- /dev/null
+++ b/sys/boot/userboot/libstand/Makefile.depend
@@ -0,0 +1,58 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/libbz2 \
+ lib/libstand \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+_bzlib.o: _bzlib.c
+_bzlib.o: libstand_bzlib_private.h
+_bzlib.po: _bzlib.c
+_bzlib.po: libstand_bzlib_private.h
+_crctable.o: _crctable.c
+_crctable.o: libstand_bzlib_private.h
+_crctable.po: _crctable.c
+_crctable.po: libstand_bzlib_private.h
+_decompress.o: _decompress.c
+_decompress.o: libstand_bzlib_private.h
+_decompress.po: _decompress.c
+_decompress.po: libstand_bzlib_private.h
+_huffman.o: _huffman.c
+_huffman.o: libstand_bzlib_private.h
+_huffman.po: _huffman.c
+_huffman.po: libstand_bzlib_private.h
+_infback.o: _infback.c
+_infback.o: libstand_zutil.h
+_infback.po: _infback.c
+_infback.po: libstand_zutil.h
+_inffast.o: _inffast.c
+_inffast.o: libstand_zutil.h
+_inffast.po: _inffast.c
+_inffast.po: libstand_zutil.h
+_inflate.o: _inflate.c
+_inflate.o: libstand_zutil.h
+_inflate.po: _inflate.c
+_inflate.po: libstand_zutil.h
+_inftrees.o: _inftrees.c
+_inftrees.o: libstand_zutil.h
+_inftrees.po: _inftrees.c
+_inftrees.po: libstand_zutil.h
+_randtable.o: _randtable.c
+_randtable.o: libstand_bzlib_private.h
+_randtable.po: _randtable.c
+_randtable.po: libstand_bzlib_private.h
+_zutil.o: _zutil.c
+_zutil.o: libstand_gzguts.h
+_zutil.o: libstand_zutil.h
+_zutil.po: _zutil.c
+_zutil.po: libstand_gzguts.h
+_zutil.po: libstand_zutil.h
+.endif
diff --git a/sys/boot/userboot/test/Makefile.depend b/sys/boot/userboot/test/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/sys/boot/userboot/test/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/userboot/userboot/Makefile.depend b/sys/boot/userboot/userboot/Makefile.depend
new file mode 100644
index 0000000..a011827
--- /dev/null
+++ b/sys/boot/userboot/userboot/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ sys/boot/userboot/ficl \
+ sys/boot/userboot/libstand \
+ sys/boot/userboot/zfs \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+vers.So: vers.c
+vers.po: vers.c
+.endif
diff --git a/sys/boot/userboot/zfs/Makefile.depend b/sys/boot/userboot/zfs/Makefile.depend
new file mode 100644
index 0000000..18be76b
--- /dev/null
+++ b/sys/boot/userboot/zfs/Makefile.depend
@@ -0,0 +1,13 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/boot/zfs/Makefile.depend b/sys/boot/zfs/Makefile.depend
new file mode 100644
index 0000000..18be76b
--- /dev/null
+++ b/sys/boot/zfs/Makefile.depend
@@ -0,0 +1,13 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index db28518..6ea25c2 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -1543,12 +1543,26 @@ adastart(struct cam_periph *periph, union ccb *start_ccb)
}
switch (bp->bio_cmd) {
case BIO_WRITE:
- softc->flags |= ADA_FLAG_DIRTY;
- /* FALLTHROUGH */
case BIO_READ:
{
uint64_t lba = bp->bio_pblkno;
uint16_t count = bp->bio_bcount / softc->params.secsize;
+ void *data_ptr;
+ int rw_op;
+
+ if (bp->bio_cmd == BIO_WRITE) {
+ softc->flags |= ADA_FLAG_DIRTY;
+ rw_op = CAM_DIR_OUT;
+ } else {
+ rw_op = CAM_DIR_IN;
+ }
+
+ data_ptr = bp->bio_data;
+ if ((bp->bio_flags & (BIO_UNMAPPED|BIO_VLIST)) != 0) {
+ rw_op |= CAM_DATA_BIO;
+ data_ptr = bp;
+ }
+
#ifdef ADA_TEST_FAILURE
int fail = 0;
@@ -1593,12 +1607,9 @@ adastart(struct cam_periph *periph, union ccb *start_ccb)
cam_fill_ataio(ataio,
ada_retry_count,
adadone,
- (bp->bio_cmd == BIO_READ ? CAM_DIR_IN :
- CAM_DIR_OUT) | ((bp->bio_flags & BIO_UNMAPPED)
- != 0 ? CAM_DATA_BIO : 0),
+ rw_op,
tag_code,
- ((bp->bio_flags & BIO_UNMAPPED) != 0) ? (void *)bp :
- bp->bio_data,
+ data_ptr,
bp->bio_bcount,
ada_default_timeout*1000);
diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h
index b4fe543..834e2b7 100644
--- a/sys/cam/cam_ccb.h
+++ b/sys/cam/cam_ccb.h
@@ -109,6 +109,12 @@ typedef enum {
CAM_UNLOCKED = 0x80000000 /* Call callback without lock. */
} ccb_flags;
+typedef enum {
+ CAM_USER_DATA_ADDR = 0x00000001,/* Userspace data pointers */
+ CAM_SG_FORMAT_IOVEC = 0x00000002,/* iovec instead of busdma S/G*/
+ CAM_UNMAPPED_BUF = 0x00000004 /* use unmapped I/O */
+} ccb_xflags;
+
/* XPT Opcodes for xpt_action */
typedef enum {
/* Function code flags are bits greater than 0xff */
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index fb5d041..89736f2 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -3333,7 +3333,8 @@ xpt_merge_ccb(union ccb *master_ccb, union ccb *slave_ccb)
}
void
-xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority)
+xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, struct cam_path *path,
+ u_int32_t priority, u_int32_t flags)
{
CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_setup_ccb\n"));
@@ -3351,10 +3352,16 @@ xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority)
ccb_h->target_lun = CAM_TARGET_WILDCARD;
}
ccb_h->pinfo.index = CAM_UNQUEUED_INDEX;
- ccb_h->flags = 0;
+ ccb_h->flags = flags;
ccb_h->xflags = 0;
}
+void
+xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority)
+{
+ xpt_setup_ccb_flags(ccb_h, path, priority, /*flags*/ 0);
+}
+
/* Path manipulation functions */
cam_status
xpt_create_path(struct cam_path **new_path_ptr, struct cam_periph *perph,
diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h
index d92981c..ba5c924 100644
--- a/sys/cam/cam_xpt.h
+++ b/sys/cam/cam_xpt.h
@@ -70,6 +70,10 @@ void xpt_action_default(union ccb *new_ccb);
union ccb *xpt_alloc_ccb(void);
union ccb *xpt_alloc_ccb_nowait(void);
void xpt_free_ccb(union ccb *free_ccb);
+void xpt_setup_ccb_flags(struct ccb_hdr *ccb_h,
+ struct cam_path *path,
+ u_int32_t priority,
+ u_int32_t flags);
void xpt_setup_ccb(struct ccb_hdr *ccb_h,
struct cam_path *path,
u_int32_t priority);
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 084645ec..d21bd5a 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -11091,6 +11091,8 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io,
__func__, pending_entry->seridx, pending_io->scsiio.cdb[0],
pending_io->scsiio.cdb[1], pending_io));
ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio, NULL);
+ if (ooa_entry->seridx == CTL_SERIDX_INVLD)
+ return (CTL_ACTION_PASS); /* Unsupported command in OOA queue */
KASSERT(ooa_entry->seridx < CTL_SERIDX_COUNT,
("%s: Invalid seridx %d for ooa CDB %02x %02x @ %p",
__func__, ooa_entry->seridx, ooa_io->scsiio.cdb[0],
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index f870288..0a7f627 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -2328,29 +2328,40 @@ skipstate:
switch (bp->bio_cmd) {
case BIO_WRITE:
- softc->flags |= DA_FLAG_DIRTY;
- /* FALLTHROUGH */
case BIO_READ:
+ {
+ void *data_ptr;
+ int rw_op;
+
+ if (bp->bio_cmd == BIO_WRITE) {
+ softc->flags |= DA_FLAG_DIRTY;
+ rw_op = SCSI_RW_WRITE;
+ } else {
+ rw_op = SCSI_RW_READ;
+ }
+
+ data_ptr = bp->bio_data;
+ if ((bp->bio_flags & (BIO_UNMAPPED|BIO_VLIST)) != 0) {
+ rw_op |= SCSI_RW_BIO;
+ data_ptr = bp;
+ }
+
scsi_read_write(&start_ccb->csio,
/*retries*/da_retry_count,
/*cbfcnp*/dadone,
/*tag_action*/tag_code,
- /*read_op*/(bp->bio_cmd == BIO_READ ?
- SCSI_RW_READ : SCSI_RW_WRITE) |
- ((bp->bio_flags & BIO_UNMAPPED) != 0 ?
- SCSI_RW_BIO : 0),
+ rw_op,
/*byte2*/0,
softc->minimum_cmd_size,
/*lba*/bp->bio_pblkno,
/*block_count*/bp->bio_bcount /
softc->params.secsize,
- /*data_ptr*/ (bp->bio_flags &
- BIO_UNMAPPED) != 0 ? (void *)bp :
- bp->bio_data,
+ data_ptr,
/*dxfer_len*/ bp->bio_bcount,
/*sense_len*/SSD_FULL_SIZE,
da_default_timeout * 1000);
break;
+ }
case BIO_FLUSH:
/*
* BIO_FLUSH doesn't currently communicate
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 055291b..09cda5b 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -28,27 +28,39 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_kdtrace.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/conf.h>
#include <sys/types.h>
#include <sys/bio.h>
-#include <sys/malloc.h>
-#include <sys/fcntl.h>
-#include <sys/conf.h>
-#include <sys/errno.h>
+#include <sys/bus.h>
#include <sys/devicestat.h>
+#include <sys/errno.h>
+#include <sys/fcntl.h>
+#include <sys/malloc.h>
#include <sys/proc.h>
+#include <sys/poll.h>
+#include <sys/selinfo.h>
+#include <sys/sdt.h>
#include <sys/taskqueue.h>
+#include <vm/uma.h>
+#include <vm/vm.h>
+#include <vm/vm_extern.h>
+
+#include <machine/bus.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_periph.h>
#include <cam/cam_queue.h>
+#include <cam/cam_xpt.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_debug.h>
-#include <cam/cam_sim.h>
#include <cam/cam_compat.h>
+#include <cam/cam_xpt_periph.h>
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_pass.h>
@@ -57,7 +69,11 @@ typedef enum {
PASS_FLAG_OPEN = 0x01,
PASS_FLAG_LOCKED = 0x02,
PASS_FLAG_INVALID = 0x04,
- PASS_FLAG_INITIAL_PHYSPATH = 0x08
+ PASS_FLAG_INITIAL_PHYSPATH = 0x08,
+ PASS_FLAG_ZONE_INPROG = 0x10,
+ PASS_FLAG_ZONE_VALID = 0x20,
+ PASS_FLAG_UNMAPPED_CAPABLE = 0x40,
+ PASS_FLAG_ABANDONED_REF_SET = 0x80
} pass_flags;
typedef enum {
@@ -65,38 +81,104 @@ typedef enum {
} pass_state;
typedef enum {
- PASS_CCB_BUFFER_IO
+ PASS_CCB_BUFFER_IO,
+ PASS_CCB_QUEUED_IO
} pass_ccb_types;
#define ccb_type ppriv_field0
-#define ccb_bp ppriv_ptr1
+#define ccb_ioreq ppriv_ptr1
-struct pass_softc {
- pass_state state;
- pass_flags flags;
- u_int8_t pd_type;
- union ccb saved_ccb;
- int open_count;
- u_int maxio;
- struct devstat *device_stats;
- struct cdev *dev;
- struct cdev *alias_dev;
- struct task add_physpath_task;
+/*
+ * The maximum number of memory segments we preallocate.
+ */
+#define PASS_MAX_SEGS 16
+
+typedef enum {
+ PASS_IO_NONE = 0x00,
+ PASS_IO_USER_SEG_MALLOC = 0x01,
+ PASS_IO_KERN_SEG_MALLOC = 0x02,
+ PASS_IO_ABANDONED = 0x04
+} pass_io_flags;
+
+struct pass_io_req {
+ union ccb ccb;
+ union ccb *alloced_ccb;
+ union ccb *user_ccb_ptr;
+ camq_entry user_periph_links;
+ ccb_ppriv_area user_periph_priv;
+ struct cam_periph_map_info mapinfo;
+ pass_io_flags flags;
+ ccb_flags data_flags;
+ int num_user_segs;
+ bus_dma_segment_t user_segs[PASS_MAX_SEGS];
+ int num_kern_segs;
+ bus_dma_segment_t kern_segs[PASS_MAX_SEGS];
+ bus_dma_segment_t *user_segptr;
+ bus_dma_segment_t *kern_segptr;
+ int num_bufs;
+ uint32_t dirs[CAM_PERIPH_MAXMAPS];
+ uint32_t lengths[CAM_PERIPH_MAXMAPS];
+ uint8_t *user_bufs[CAM_PERIPH_MAXMAPS];
+ uint8_t *kern_bufs[CAM_PERIPH_MAXMAPS];
+ struct bintime start_time;
+ TAILQ_ENTRY(pass_io_req) links;
};
+struct pass_softc {
+ pass_state state;
+ pass_flags flags;
+ u_int8_t pd_type;
+ union ccb saved_ccb;
+ int open_count;
+ u_int maxio;
+ struct devstat *device_stats;
+ struct cdev *dev;
+ struct cdev *alias_dev;
+ struct task add_physpath_task;
+ struct task shutdown_kqueue_task;
+ struct selinfo read_select;
+ TAILQ_HEAD(, pass_io_req) incoming_queue;
+ TAILQ_HEAD(, pass_io_req) active_queue;
+ TAILQ_HEAD(, pass_io_req) abandoned_queue;
+ TAILQ_HEAD(, pass_io_req) done_queue;
+ struct cam_periph *periph;
+ char zone_name[12];
+ char io_zone_name[12];
+ uma_zone_t pass_zone;
+ uma_zone_t pass_io_zone;
+ size_t io_zone_size;
+};
static d_open_t passopen;
static d_close_t passclose;
static d_ioctl_t passioctl;
static d_ioctl_t passdoioctl;
+static d_poll_t passpoll;
+static d_kqfilter_t passkqfilter;
+static void passreadfiltdetach(struct knote *kn);
+static int passreadfilt(struct knote *kn, long hint);
static periph_init_t passinit;
static periph_ctor_t passregister;
static periph_oninv_t passoninvalidate;
static periph_dtor_t passcleanup;
-static void pass_add_physpath(void *context, int pending);
+static periph_start_t passstart;
+static void pass_shutdown_kqueue(void *context, int pending);
+static void pass_add_physpath(void *context, int pending);
static void passasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
+static void passdone(struct cam_periph *periph,
+ union ccb *done_ccb);
+static int passcreatezone(struct cam_periph *periph);
+static void passiocleanup(struct pass_softc *softc,
+ struct pass_io_req *io_req);
+static int passcopysglist(struct cam_periph *periph,
+ struct pass_io_req *io_req,
+ ccb_flags direction);
+static int passmemsetup(struct cam_periph *periph,
+ struct pass_io_req *io_req);
+static int passmemdone(struct cam_periph *periph,
+ struct pass_io_req *io_req);
static int passerror(union ccb *ccb, u_int32_t cam_flags,
u_int32_t sense_flags);
static int passsendccb(struct cam_periph *periph, union ccb *ccb,
@@ -116,9 +198,19 @@ static struct cdevsw pass_cdevsw = {
.d_open = passopen,
.d_close = passclose,
.d_ioctl = passioctl,
+ .d_poll = passpoll,
+ .d_kqfilter = passkqfilter,
.d_name = "pass",
};
+static struct filterops passread_filtops = {
+ .f_isfd = 1,
+ .f_detach = passreadfiltdetach,
+ .f_event = passreadfilt
+};
+
+static MALLOC_DEFINE(M_SCSIPASS, "scsi_pass", "scsi passthrough buffers");
+
static void
passinit(void)
{
@@ -138,6 +230,60 @@ passinit(void)
}
static void
+passrejectios(struct cam_periph *periph)
+{
+ struct pass_io_req *io_req, *io_req2;
+ struct pass_softc *softc;
+
+ softc = (struct pass_softc *)periph->softc;
+
+ /*
+ * The user can no longer get status for I/O on the done queue, so
+ * clean up all outstanding I/O on the done queue.
+ */
+ TAILQ_FOREACH_SAFE(io_req, &softc->done_queue, links, io_req2) {
+ TAILQ_REMOVE(&softc->done_queue, io_req, links);
+ passiocleanup(softc, io_req);
+ uma_zfree(softc->pass_zone, io_req);
+ }
+
+ /*
+ * The underlying device is gone, so we can't issue these I/Os.
+ * The devfs node has been shut down, so we can't return status to
+ * the user. Free any I/O left on the incoming queue.
+ */
+ TAILQ_FOREACH_SAFE(io_req, &softc->incoming_queue, links, io_req2) {
+ TAILQ_REMOVE(&softc->incoming_queue, io_req, links);
+ passiocleanup(softc, io_req);
+ uma_zfree(softc->pass_zone, io_req);
+ }
+
+ /*
+ * Normally we would put I/Os on the abandoned queue and acquire a
+ * reference when we saw the final close. But, the device went
+ * away and devfs may have moved everything off to deadfs by the
+ * time the I/O done callback is called; as a result, we won't see
+ * any more closes. So, if we have any active I/Os, we need to put
+ * them on the abandoned queue. When the abandoned queue is empty,
+ * we'll release the remaining reference (see below) to the peripheral.
+ */
+ TAILQ_FOREACH_SAFE(io_req, &softc->active_queue, links, io_req2) {
+ TAILQ_REMOVE(&softc->active_queue, io_req, links);
+ io_req->flags |= PASS_IO_ABANDONED;
+ TAILQ_INSERT_TAIL(&softc->abandoned_queue, io_req, links);
+ }
+
+ /*
+ * If we put any I/O on the abandoned queue, acquire a reference.
+ */
+ if ((!TAILQ_EMPTY(&softc->abandoned_queue))
+ && ((softc->flags & PASS_FLAG_ABANDONED_REF_SET) == 0)) {
+ cam_periph_doacquire(periph);
+ softc->flags |= PASS_FLAG_ABANDONED_REF_SET;
+ }
+}
+
+static void
passdevgonecb(void *arg)
{
struct cam_periph *periph;
@@ -165,17 +311,26 @@ passdevgonecb(void *arg)
/*
* Release the reference held for the device node, it is gone now.
+ * Accordingly, inform all queued I/Os of their fate.
*/
cam_periph_release_locked(periph);
+ passrejectios(periph);
/*
- * We reference the lock directly here, instead of using
+ * We reference the SIM lock directly here, instead of using
* cam_periph_unlock(). The reason is that the final call to
* cam_periph_release_locked() above could result in the periph
* getting freed. If that is the case, dereferencing the periph
* with a cam_periph_unlock() call would cause a page fault.
*/
mtx_unlock(mtx);
+
+ /*
+ * We have to remove our kqueue context from a thread because it
+ * may sleep. It would be nice if we could get a callback from
+ * kqueue when it is done cleaning up resources.
+ */
+ taskqueue_enqueue(taskqueue_thread, &softc->shutdown_kqueue_task);
}
static void
@@ -197,12 +352,6 @@ passoninvalidate(struct cam_periph *periph)
* when it has cleaned up its state.
*/
destroy_dev_sched_cb(softc->dev, passdevgonecb, periph);
-
- /*
- * XXX Return all queued I/O with ENXIO.
- * XXX Handle any transactions queued to the card
- * with XPT_ABORT_CCB.
- */
}
static void
@@ -212,9 +361,40 @@ passcleanup(struct cam_periph *periph)
softc = (struct pass_softc *)periph->softc;
+ cam_periph_assert(periph, MA_OWNED);
+ KASSERT(TAILQ_EMPTY(&softc->active_queue),
+ ("%s called when there are commands on the active queue!\n",
+ __func__));
+ KASSERT(TAILQ_EMPTY(&softc->abandoned_queue),
+ ("%s called when there are commands on the abandoned queue!\n",
+ __func__));
+ KASSERT(TAILQ_EMPTY(&softc->incoming_queue),
+ ("%s called when there are commands on the incoming queue!\n",
+ __func__));
+ KASSERT(TAILQ_EMPTY(&softc->done_queue),
+ ("%s called when there are commands on the done queue!\n",
+ __func__));
+
devstat_remove_entry(softc->device_stats);
cam_periph_unlock(periph);
+
+ /*
+ * We call taskqueue_drain() for the physpath task to make sure it
+ * is complete. We drop the lock because this can potentially
+ * sleep. XXX KDM that is bad. Need a way to get a callback when
+ * a taskqueue is drained.
+ *
+ * Note that we don't drain the kqueue shutdown task queue. This
+ * is because we hold a reference on the periph for kqueue, and
+ * release that reference from the kqueue shutdown task queue. So
+ * we cannot come into this routine unless we've released that
+ * reference. Also, because that could be the last reference, we
+ * could be called from the cam_periph_release() call in
+ * pass_shutdown_kqueue(). In that case, the taskqueue_drain()
+ * would deadlock. It would be preferable if we had a way to
+ * get a callback when a taskqueue is done.
+ */
taskqueue_drain(taskqueue_thread, &softc->add_physpath_task);
cam_periph_lock(periph);
@@ -223,10 +403,29 @@ passcleanup(struct cam_periph *periph)
}
static void
+pass_shutdown_kqueue(void *context, int pending)
+{
+ struct cam_periph *periph;
+ struct pass_softc *softc;
+
+ periph = context;
+ softc = periph->softc;
+
+ knlist_clear(&softc->read_select.si_note, /*is_locked*/ 0);
+ knlist_destroy(&softc->read_select.si_note);
+
+ /*
+ * Release the reference we held for kqueue.
+ */
+ cam_periph_release(periph);
+}
+
+static void
pass_add_physpath(void *context, int pending)
{
struct cam_periph *periph;
struct pass_softc *softc;
+ struct mtx *mtx;
char *physpath;
/*
@@ -236,34 +435,38 @@ pass_add_physpath(void *context, int pending)
periph = context;
softc = periph->softc;
physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK);
- cam_periph_lock(periph);
- if (periph->flags & CAM_PERIPH_INVALID) {
- cam_periph_unlock(periph);
+ mtx = cam_periph_mtx(periph);
+ mtx_lock(mtx);
+
+ if (periph->flags & CAM_PERIPH_INVALID)
goto out;
- }
+
if (xpt_getattr(physpath, MAXPATHLEN,
"GEOM::physpath", periph->path) == 0
&& strlen(physpath) != 0) {
- cam_periph_unlock(periph);
+ mtx_unlock(mtx);
make_dev_physpath_alias(MAKEDEV_WAITOK, &softc->alias_dev,
softc->dev, softc->alias_dev, physpath);
- cam_periph_lock(periph);
+ mtx_lock(mtx);
}
+out:
/*
* Now that we've made our alias, we no longer have to have a
* reference to the device.
*/
- if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0) {
+ if ((softc->flags & PASS_FLAG_INITIAL_PHYSPATH) == 0)
softc->flags |= PASS_FLAG_INITIAL_PHYSPATH;
- cam_periph_unlock(periph);
- dev_rel(softc->dev);
- }
- else
- cam_periph_unlock(periph);
-out:
+ /*
+ * We always acquire a reference to the periph before queueing this
+ * task queue function, so it won't go away before we run.
+ */
+ while (pending-- > 0)
+ cam_periph_release_locked(periph);
+ mtx_unlock(mtx);
+
free(physpath, M_DEVBUF);
}
@@ -291,7 +494,7 @@ passasync(void *callback_arg, u_int32_t code,
* process.
*/
status = cam_periph_alloc(passregister, passoninvalidate,
- passcleanup, NULL, "pass",
+ passcleanup, passstart, "pass",
CAM_PERIPH_BIO, path,
passasync, AC_FOUND_DEVICE, cgd);
@@ -315,8 +518,19 @@ passasync(void *callback_arg, u_int32_t code,
buftype = (uintptr_t)arg;
if (buftype == CDAI_TYPE_PHYS_PATH) {
struct pass_softc *softc;
+ cam_status status;
softc = (struct pass_softc *)periph->softc;
+ /*
+ * Acquire a reference to the periph before we
+ * start the taskqueue, so that we don't run into
+ * a situation where the periph goes away before
+ * the task queue has a chance to run.
+ */
+ status = cam_periph_acquire(periph);
+ if (status != CAM_REQ_CMP)
+ break;
+
taskqueue_enqueue(taskqueue_thread,
&softc->add_physpath_task);
}
@@ -361,6 +575,17 @@ passregister(struct cam_periph *periph, void *arg)
softc->pd_type = T_DIRECT;
periph->softc = softc;
+ softc->periph = periph;
+ TAILQ_INIT(&softc->incoming_queue);
+ TAILQ_INIT(&softc->active_queue);
+ TAILQ_INIT(&softc->abandoned_queue);
+ TAILQ_INIT(&softc->done_queue);
+ snprintf(softc->zone_name, sizeof(softc->zone_name), "%s%d",
+ periph->periph_name, periph->unit_number);
+ snprintf(softc->io_zone_name, sizeof(softc->io_zone_name), "%s%dIO",
+ periph->periph_name, periph->unit_number);
+ softc->io_zone_size = MAXPHYS;
+ knlist_init_mtx(&softc->read_select.si_note, cam_periph_mtx(periph));
bzero(&cpi, sizeof(cpi));
xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
@@ -374,6 +599,9 @@ passregister(struct cam_periph *periph, void *arg)
else
softc->maxio = cpi.maxio; /* real value */
+ if (cpi.hba_misc & PIM_UNMAPPED)
+ softc->flags |= PASS_FLAG_UNMAPPED_CAPABLE;
+
/*
* We pass in 0 for a blocksize, since we don't
* know what the blocksize of this device is, if
@@ -391,6 +619,23 @@ passregister(struct cam_periph *periph, void *arg)
DEVSTAT_PRIORITY_PASS);
/*
+ * Initialize the taskqueue handler for shutting down kqueue.
+ */
+ TASK_INIT(&softc->shutdown_kqueue_task, /*priority*/ 0,
+ pass_shutdown_kqueue, periph);
+
+ /*
+ * Acquire a reference to the periph that we can release once we've
+ * cleaned up the kqueue.
+ */
+ if (cam_periph_acquire(periph) != CAM_REQ_CMP) {
+ xpt_print(periph->path, "%s: lost periph during "
+ "registration!\n", __func__);
+ cam_periph_lock(periph);
+ return (CAM_REQ_CMP_ERR);
+ }
+
+ /*
* Acquire a reference to the periph before we create the devfs
* instance for it. We'll release this reference once the devfs
* instance has been freed.
@@ -408,12 +653,15 @@ passregister(struct cam_periph *periph, void *arg)
periph->periph_name, periph->unit_number);
/*
- * Now that we have made the devfs instance, hold a reference to it
- * until the task queue has run to setup the physical path alias.
- * That way devfs won't get rid of the device before we add our
- * alias.
+ * Hold a reference to the periph before we create the physical
+ * path alias so it can't go away.
*/
- dev_ref(softc->dev);
+ if (cam_periph_acquire(periph) != CAM_REQ_CMP) {
+ xpt_print(periph->path, "%s: lost periph during "
+ "registration!\n", __func__);
+ cam_periph_lock(periph);
+ return (CAM_REQ_CMP_ERR);
+ }
cam_periph_lock(periph);
softc->dev->si_drv1 = periph;
@@ -514,6 +762,55 @@ passclose(struct cdev *dev, int flag, int fmt, struct thread *td)
softc = periph->softc;
softc->open_count--;
+ if (softc->open_count == 0) {
+ struct pass_io_req *io_req, *io_req2;
+ int need_unlock;
+
+ need_unlock = 0;
+
+ TAILQ_FOREACH_SAFE(io_req, &softc->done_queue, links, io_req2) {
+ TAILQ_REMOVE(&softc->done_queue, io_req, links);
+ passiocleanup(softc, io_req);
+ uma_zfree(softc->pass_zone, io_req);
+ }
+
+ TAILQ_FOREACH_SAFE(io_req, &softc->incoming_queue, links,
+ io_req2) {
+ TAILQ_REMOVE(&softc->incoming_queue, io_req, links);
+ passiocleanup(softc, io_req);
+ uma_zfree(softc->pass_zone, io_req);
+ }
+
+ /*
+ * If there are any active I/Os, we need to forcibly acquire a
+ * reference to the peripheral so that we don't go away
+ * before they complete. We'll release the reference when
+ * the abandoned queue is empty.
+ */
+ io_req = TAILQ_FIRST(&softc->active_queue);
+ if ((io_req != NULL)
+ && (softc->flags & PASS_FLAG_ABANDONED_REF_SET) == 0) {
+ cam_periph_doacquire(periph);
+ softc->flags |= PASS_FLAG_ABANDONED_REF_SET;
+ }
+
+ /*
+ * Since the I/O in the active queue is not under our
+ * control, just set a flag so that we can clean it up when
+ * it completes and put it on the abandoned queue. This
+ * will prevent our sending spurious completions in the
+ * event that the device is opened again before these I/Os
+ * complete.
+ */
+ TAILQ_FOREACH_SAFE(io_req, &softc->active_queue, links,
+ io_req2) {
+ TAILQ_REMOVE(&softc->active_queue, io_req, links);
+ io_req->flags |= PASS_IO_ABANDONED;
+ TAILQ_INSERT_TAIL(&softc->abandoned_queue, io_req,
+ links);
+ }
+ }
+
cam_periph_release_locked(periph);
/*
@@ -533,6 +830,915 @@ passclose(struct cdev *dev, int flag, int fmt, struct thread *td)
return (0);
}
+
+static void
+passstart(struct cam_periph *periph, union ccb *start_ccb)
+{
+ struct pass_softc *softc;
+
+ softc = (struct pass_softc *)periph->softc;
+
+ switch (softc->state) {
+ case PASS_STATE_NORMAL: {
+ struct pass_io_req *io_req;
+
+ /*
+ * Check for any queued I/O requests that require an
+ * allocated slot.
+ */
+ io_req = TAILQ_FIRST(&softc->incoming_queue);
+ if (io_req == NULL) {
+ xpt_release_ccb(start_ccb);
+ break;
+ }
+ TAILQ_REMOVE(&softc->incoming_queue, io_req, links);
+ TAILQ_INSERT_TAIL(&softc->active_queue, io_req, links);
+ /*
+ * Merge the user's CCB into the allocated CCB.
+ */
+ xpt_merge_ccb(start_ccb, &io_req->ccb);
+ start_ccb->ccb_h.ccb_type = PASS_CCB_QUEUED_IO;
+ start_ccb->ccb_h.ccb_ioreq = io_req;
+ start_ccb->ccb_h.cbfcnp = passdone;
+ io_req->alloced_ccb = start_ccb;
+ binuptime(&io_req->start_time);
+ devstat_start_transaction(softc->device_stats,
+ &io_req->start_time);
+
+ xpt_action(start_ccb);
+
+ /*
+ * If we have any more I/O waiting, schedule ourselves again.
+ */
+ if (!TAILQ_EMPTY(&softc->incoming_queue))
+ xpt_schedule(periph, CAM_PRIORITY_NORMAL);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+static void
+passdone(struct cam_periph *periph, union ccb *done_ccb)
+{
+ struct pass_softc *softc;
+ struct ccb_scsiio *csio;
+
+ softc = (struct pass_softc *)periph->softc;
+
+ cam_periph_assert(periph, MA_OWNED);
+
+ csio = &done_ccb->csio;
+ switch (csio->ccb_h.ccb_type) {
+ case PASS_CCB_QUEUED_IO: {
+ struct pass_io_req *io_req;
+
+ io_req = done_ccb->ccb_h.ccb_ioreq;
+#if 0
+ xpt_print(periph->path, "%s: called for user CCB %p\n",
+ __func__, io_req->user_ccb_ptr);
+#endif
+ if (((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
+ && (done_ccb->ccb_h.flags & CAM_PASS_ERR_RECOVER)
+ && ((io_req->flags & PASS_IO_ABANDONED) == 0)) {
+ int error;
+
+ error = passerror(done_ccb, CAM_RETRY_SELTO,
+ SF_RETRY_UA | SF_NO_PRINT);
+
+ if (error == ERESTART) {
+ /*
+ * A retry was scheduled, so
+ * just return.
+ */
+ return;
+ }
+ }
+
+ /*
+ * Copy the allocated CCB contents back to the malloced CCB
+ * so we can give status back to the user when he requests it.
+ */
+ bcopy(done_ccb, &io_req->ccb, sizeof(*done_ccb));
+
+ /*
+ * Log data/transaction completion with devstat(9).
+ */
+ switch (done_ccb->ccb_h.func_code) {
+ case XPT_SCSI_IO:
+ devstat_end_transaction(softc->device_stats,
+ done_ccb->csio.dxfer_len - done_ccb->csio.resid,
+ done_ccb->csio.tag_action & 0x3,
+ ((done_ccb->ccb_h.flags & CAM_DIR_MASK) ==
+ CAM_DIR_NONE) ? DEVSTAT_NO_DATA :
+ (done_ccb->ccb_h.flags & CAM_DIR_OUT) ?
+ DEVSTAT_WRITE : DEVSTAT_READ, NULL,
+ &io_req->start_time);
+ break;
+ case XPT_ATA_IO:
+ devstat_end_transaction(softc->device_stats,
+ done_ccb->ataio.dxfer_len - done_ccb->ataio.resid,
+ done_ccb->ataio.tag_action & 0x3,
+ ((done_ccb->ccb_h.flags & CAM_DIR_MASK) ==
+ CAM_DIR_NONE) ? DEVSTAT_NO_DATA :
+ (done_ccb->ccb_h.flags & CAM_DIR_OUT) ?
+ DEVSTAT_WRITE : DEVSTAT_READ, NULL,
+ &io_req->start_time);
+ break;
+ case XPT_SMP_IO:
+ /*
+ * XXX KDM this isn't quite right, but there isn't
+ * currently an easy way to represent a bidirectional
+ * transfer in devstat. The only way to do it
+ * and have the byte counts come out right would
+ * mean that we would have to record two
+ * transactions, one for the request and one for the
+ * response. For now, so that we report something,
+ * just treat the entire thing as a read.
+ */
+ devstat_end_transaction(softc->device_stats,
+ done_ccb->smpio.smp_request_len +
+ done_ccb->smpio.smp_response_len,
+ DEVSTAT_TAG_SIMPLE, DEVSTAT_READ, NULL,
+ &io_req->start_time);
+ break;
+ default:
+ devstat_end_transaction(softc->device_stats, 0,
+ DEVSTAT_TAG_NONE, DEVSTAT_NO_DATA, NULL,
+ &io_req->start_time);
+ break;
+ }
+
+ /*
+ * In the normal case, take the completed I/O off of the
+ * active queue and put it on the done queue. Notitfy the
+ * user that we have a completed I/O.
+ */
+ if ((io_req->flags & PASS_IO_ABANDONED) == 0) {
+ TAILQ_REMOVE(&softc->active_queue, io_req, links);
+ TAILQ_INSERT_TAIL(&softc->done_queue, io_req, links);
+ selwakeuppri(&softc->read_select, PRIBIO);
+ KNOTE_LOCKED(&softc->read_select.si_note, 0);
+ } else {
+ /*
+ * In the case of an abandoned I/O (final close
+ * without fetching the I/O), take it off of the
+ * abandoned queue and free it.
+ */
+ TAILQ_REMOVE(&softc->abandoned_queue, io_req, links);
+ passiocleanup(softc, io_req);
+ uma_zfree(softc->pass_zone, io_req);
+
+ /*
+ * Release the done_ccb here, since we may wind up
+ * freeing the peripheral when we decrement the
+ * reference count below.
+ */
+ xpt_release_ccb(done_ccb);
+
+ /*
+ * If the abandoned queue is empty, we can release
+ * our reference to the periph since we won't have
+ * any more completions coming.
+ */
+ if ((TAILQ_EMPTY(&softc->abandoned_queue))
+ && (softc->flags & PASS_FLAG_ABANDONED_REF_SET)) {
+ softc->flags &= ~PASS_FLAG_ABANDONED_REF_SET;
+ cam_periph_release_locked(periph);
+ }
+
+ /*
+ * We have already released the CCB, so we can
+ * return.
+ */
+ return;
+ }
+ break;
+ }
+ }
+ xpt_release_ccb(done_ccb);
+}
+
+static int
+passcreatezone(struct cam_periph *periph)
+{
+ struct pass_softc *softc;
+ int error;
+
+ error = 0;
+ softc = (struct pass_softc *)periph->softc;
+
+ cam_periph_assert(periph, MA_OWNED);
+ KASSERT(((softc->flags & PASS_FLAG_ZONE_VALID) == 0),
+ ("%s called when the pass(4) zone is valid!\n", __func__));
+ KASSERT((softc->pass_zone == NULL),
+ ("%s called when the pass(4) zone is allocated!\n", __func__));
+
+ if ((softc->flags & PASS_FLAG_ZONE_INPROG) == 0) {
+
+ /*
+ * We're the first context through, so we need to create
+ * the pass(4) UMA zone for I/O requests.
+ */
+ softc->flags |= PASS_FLAG_ZONE_INPROG;
+
+ /*
+ * uma_zcreate() does a blocking (M_WAITOK) allocation,
+ * so we cannot hold a mutex while we call it.
+ */
+ cam_periph_unlock(periph);
+
+ softc->pass_zone = uma_zcreate(softc->zone_name,
+ sizeof(struct pass_io_req), NULL, NULL, NULL, NULL,
+ /*align*/ 0, /*flags*/ 0);
+
+ softc->pass_io_zone = uma_zcreate(softc->io_zone_name,
+ softc->io_zone_size, NULL, NULL, NULL, NULL,
+ /*align*/ 0, /*flags*/ 0);
+
+ cam_periph_lock(periph);
+
+ if ((softc->pass_zone == NULL)
+ || (softc->pass_io_zone == NULL)) {
+ if (softc->pass_zone == NULL)
+ xpt_print(periph->path, "unable to allocate "
+ "IO Req UMA zone\n");
+ else
+ xpt_print(periph->path, "unable to allocate "
+ "IO UMA zone\n");
+ softc->flags &= ~PASS_FLAG_ZONE_INPROG;
+ goto bailout;
+ }
+
+ /*
+ * Set the flags appropriately and notify any other waiters.
+ */
+ softc->flags &= PASS_FLAG_ZONE_INPROG;
+ softc->flags |= PASS_FLAG_ZONE_VALID;
+ wakeup(&softc->pass_zone);
+ } else {
+ /*
+ * In this case, the UMA zone has not yet been created, but
+ * another context is in the process of creating it. We
+ * need to sleep until the creation is either done or has
+ * failed.
+ */
+ while ((softc->flags & PASS_FLAG_ZONE_INPROG)
+ && ((softc->flags & PASS_FLAG_ZONE_VALID) == 0)) {
+ error = msleep(&softc->pass_zone,
+ cam_periph_mtx(periph), PRIBIO,
+ "paszon", 0);
+ if (error != 0)
+ goto bailout;
+ }
+ /*
+ * If the zone creation failed, no luck for the user.
+ */
+ if ((softc->flags & PASS_FLAG_ZONE_VALID) == 0){
+ error = ENOMEM;
+ goto bailout;
+ }
+ }
+bailout:
+ return (error);
+}
+
+static void
+passiocleanup(struct pass_softc *softc, struct pass_io_req *io_req)
+{
+ union ccb *ccb;
+ u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS];
+ int i, numbufs;
+
+ ccb = &io_req->ccb;
+
+ switch (ccb->ccb_h.func_code) {
+ case XPT_DEV_MATCH:
+ numbufs = min(io_req->num_bufs, 2);
+
+ if (numbufs == 1) {
+ data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches;
+ } else {
+ data_ptrs[0] = (u_int8_t **)&ccb->cdm.patterns;
+ data_ptrs[1] = (u_int8_t **)&ccb->cdm.matches;
+ }
+ break;
+ case XPT_SCSI_IO:
+ case XPT_CONT_TARGET_IO:
+ data_ptrs[0] = &ccb->csio.data_ptr;
+ numbufs = min(io_req->num_bufs, 1);
+ break;
+ case XPT_ATA_IO:
+ data_ptrs[0] = &ccb->ataio.data_ptr;
+ numbufs = min(io_req->num_bufs, 1);
+ break;
+ case XPT_SMP_IO:
+ numbufs = min(io_req->num_bufs, 2);
+ data_ptrs[0] = &ccb->smpio.smp_request;
+ data_ptrs[1] = &ccb->smpio.smp_response;
+ break;
+ case XPT_DEV_ADVINFO:
+ numbufs = min(io_req->num_bufs, 1);
+ data_ptrs[0] = (uint8_t **)&ccb->cdai.buf;
+ break;
+ default:
+ /* allow ourselves to be swapped once again */
+ return;
+ break; /* NOTREACHED */
+ }
+
+ if (io_req->flags & PASS_IO_USER_SEG_MALLOC) {
+ free(io_req->user_segptr, M_SCSIPASS);
+ io_req->user_segptr = NULL;
+ }
+
+ /*
+ * We only want to free memory we malloced.
+ */
+ if (io_req->data_flags == CAM_DATA_VADDR) {
+ for (i = 0; i < io_req->num_bufs; i++) {
+ if (io_req->kern_bufs[i] == NULL)
+ continue;
+
+ free(io_req->kern_bufs[i], M_SCSIPASS);
+ io_req->kern_bufs[i] = NULL;
+ }
+ } else if (io_req->data_flags == CAM_DATA_SG) {
+ for (i = 0; i < io_req->num_kern_segs; i++) {
+ if ((uint8_t *)(uintptr_t)
+ io_req->kern_segptr[i].ds_addr == NULL)
+ continue;
+
+ uma_zfree(softc->pass_io_zone, (uint8_t *)(uintptr_t)
+ io_req->kern_segptr[i].ds_addr);
+ io_req->kern_segptr[i].ds_addr = 0;
+ }
+ }
+
+ if (io_req->flags & PASS_IO_KERN_SEG_MALLOC) {
+ free(io_req->kern_segptr, M_SCSIPASS);
+ io_req->kern_segptr = NULL;
+ }
+
+ if (io_req->data_flags != CAM_DATA_PADDR) {
+ for (i = 0; i < numbufs; i++) {
+ /*
+ * Restore the user's buffer pointers to their
+ * previous values.
+ */
+ if (io_req->user_bufs[i] != NULL)
+ *data_ptrs[i] = io_req->user_bufs[i];
+ }
+ }
+
+}
+
+static int
+passcopysglist(struct cam_periph *periph, struct pass_io_req *io_req,
+ ccb_flags direction)
+{
+ bus_size_t kern_watermark, user_watermark, len_copied, len_to_copy;
+ bus_dma_segment_t *user_sglist, *kern_sglist;
+ int i, j, error;
+
+ error = 0;
+ kern_watermark = 0;
+ user_watermark = 0;
+ len_to_copy = 0;
+ len_copied = 0;
+ user_sglist = io_req->user_segptr;
+ kern_sglist = io_req->kern_segptr;
+
+ for (i = 0, j = 0; i < io_req->num_user_segs &&
+ j < io_req->num_kern_segs;) {
+ uint8_t *user_ptr, *kern_ptr;
+
+ len_to_copy = min(user_sglist[i].ds_len -user_watermark,
+ kern_sglist[j].ds_len - kern_watermark);
+
+ user_ptr = (uint8_t *)(uintptr_t)user_sglist[i].ds_addr;
+ user_ptr = user_ptr + user_watermark;
+ kern_ptr = (uint8_t *)(uintptr_t)kern_sglist[j].ds_addr;
+ kern_ptr = kern_ptr + kern_watermark;
+
+ user_watermark += len_to_copy;
+ kern_watermark += len_to_copy;
+
+ if (!useracc(user_ptr, len_to_copy,
+ (direction == CAM_DIR_IN) ? VM_PROT_WRITE : VM_PROT_READ)) {
+ xpt_print(periph->path, "%s: unable to access user "
+ "S/G list element %p len %zu\n", __func__,
+ user_ptr, len_to_copy);
+ error = EFAULT;
+ goto bailout;
+ }
+
+ if (direction == CAM_DIR_IN) {
+ error = copyout(kern_ptr, user_ptr, len_to_copy);
+ if (error != 0) {
+ xpt_print(periph->path, "%s: copyout of %u "
+ "bytes from %p to %p failed with "
+ "error %d\n", __func__, len_to_copy,
+ kern_ptr, user_ptr, error);
+ goto bailout;
+ }
+ } else {
+ error = copyin(user_ptr, kern_ptr, len_to_copy);
+ if (error != 0) {
+ xpt_print(periph->path, "%s: copyin of %u "
+ "bytes from %p to %p failed with "
+ "error %d\n", __func__, len_to_copy,
+ user_ptr, kern_ptr, error);
+ goto bailout;
+ }
+ }
+
+ len_copied += len_to_copy;
+
+ if (user_sglist[i].ds_len == user_watermark) {
+ i++;
+ user_watermark = 0;
+ }
+
+ if (kern_sglist[j].ds_len == kern_watermark) {
+ j++;
+ kern_watermark = 0;
+ }
+ }
+
+bailout:
+
+ return (error);
+}
+
+static int
+passmemsetup(struct cam_periph *periph, struct pass_io_req *io_req)
+{
+ union ccb *ccb;
+ struct pass_softc *softc;
+ int numbufs, i;
+ uint8_t **data_ptrs[CAM_PERIPH_MAXMAPS];
+ uint32_t lengths[CAM_PERIPH_MAXMAPS];
+ uint32_t dirs[CAM_PERIPH_MAXMAPS];
+ uint32_t num_segs;
+ uint16_t *seg_cnt_ptr;
+ size_t maxmap;
+ int error;
+
+ cam_periph_assert(periph, MA_NOTOWNED);
+
+ softc = periph->softc;
+
+ error = 0;
+ ccb = &io_req->ccb;
+ maxmap = 0;
+ num_segs = 0;
+ seg_cnt_ptr = NULL;
+
+ switch(ccb->ccb_h.func_code) {
+ case XPT_DEV_MATCH:
+ if (ccb->cdm.match_buf_len == 0) {
+ printf("%s: invalid match buffer length 0\n", __func__);
+ return(EINVAL);
+ }
+ if (ccb->cdm.pattern_buf_len > 0) {
+ data_ptrs[0] = (u_int8_t **)&ccb->cdm.patterns;
+ lengths[0] = ccb->cdm.pattern_buf_len;
+ dirs[0] = CAM_DIR_OUT;
+ data_ptrs[1] = (u_int8_t **)&ccb->cdm.matches;
+ lengths[1] = ccb->cdm.match_buf_len;
+ dirs[1] = CAM_DIR_IN;
+ numbufs = 2;
+ } else {
+ data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches;
+ lengths[0] = ccb->cdm.match_buf_len;
+ dirs[0] = CAM_DIR_IN;
+ numbufs = 1;
+ }
+ io_req->data_flags = CAM_DATA_VADDR;
+ break;
+ case XPT_SCSI_IO:
+ case XPT_CONT_TARGET_IO:
+ if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
+ return(0);
+
+ /*
+ * The user shouldn't be able to supply a bio.
+ */
+ if ((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_BIO)
+ return (EINVAL);
+
+ io_req->data_flags = ccb->ccb_h.flags & CAM_DATA_MASK;
+
+ data_ptrs[0] = &ccb->csio.data_ptr;
+ lengths[0] = ccb->csio.dxfer_len;
+ dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
+ num_segs = ccb->csio.sglist_cnt;
+ seg_cnt_ptr = &ccb->csio.sglist_cnt;
+ numbufs = 1;
+ maxmap = softc->maxio;
+ break;
+ case XPT_ATA_IO:
+ if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
+ return(0);
+
+ /*
+ * We only support a single virtual address for ATA I/O.
+ */
+ if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR)
+ return (EINVAL);
+
+ io_req->data_flags = CAM_DATA_VADDR;
+
+ data_ptrs[0] = &ccb->ataio.data_ptr;
+ lengths[0] = ccb->ataio.dxfer_len;
+ dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK;
+ numbufs = 1;
+ maxmap = softc->maxio;
+ break;
+ case XPT_SMP_IO:
+ io_req->data_flags = CAM_DATA_VADDR;
+
+ data_ptrs[0] = &ccb->smpio.smp_request;
+ lengths[0] = ccb->smpio.smp_request_len;
+ dirs[0] = CAM_DIR_OUT;
+ data_ptrs[1] = &ccb->smpio.smp_response;
+ lengths[1] = ccb->smpio.smp_response_len;
+ dirs[1] = CAM_DIR_IN;
+ numbufs = 2;
+ maxmap = softc->maxio;
+ break;
+ case XPT_DEV_ADVINFO:
+ if (ccb->cdai.bufsiz == 0)
+ return (0);
+
+ io_req->data_flags = CAM_DATA_VADDR;
+
+ data_ptrs[0] = (uint8_t **)&ccb->cdai.buf;
+ lengths[0] = ccb->cdai.bufsiz;
+ dirs[0] = CAM_DIR_IN;
+ numbufs = 1;
+ break;
+ default:
+ return(EINVAL);
+ break; /* NOTREACHED */
+ }
+
+ io_req->num_bufs = numbufs;
+
+ /*
+ * If there is a maximum, check to make sure that the user's
+ * request fits within the limit. In general, we should only have
+ * a maximum length for requests that go to hardware. Otherwise it
+ * is whatever we're able to malloc.
+ */
+ for (i = 0; i < numbufs; i++) {
+ io_req->user_bufs[i] = *data_ptrs[i];
+ io_req->dirs[i] = dirs[i];
+ io_req->lengths[i] = lengths[i];
+
+ if (maxmap == 0)
+ continue;
+
+ if (lengths[i] <= maxmap)
+ continue;
+
+ xpt_print(periph->path, "%s: data length %u > max allowed %u "
+ "bytes\n", __func__, lengths[i], maxmap);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ switch (io_req->data_flags) {
+ case CAM_DATA_VADDR:
+ /* Map or copy the buffer into kernel address space */
+ for (i = 0; i < numbufs; i++) {
+ uint8_t *tmp_buf;
+
+ /*
+ * If for some reason no length is specified, we
+ * don't need to allocate anything.
+ */
+ if (io_req->lengths[i] == 0)
+ continue;
+
+ /*
+ * Make sure that the user's buffer is accessible
+ * to that process.
+ */
+ if (!useracc(io_req->user_bufs[i], io_req->lengths[i],
+ (io_req->dirs[i] == CAM_DIR_IN) ? VM_PROT_WRITE :
+ VM_PROT_READ)) {
+ xpt_print(periph->path, "%s: user address %p "
+ "length %u is not accessible\n", __func__,
+ io_req->user_bufs[i], io_req->lengths[i]);
+ error = EFAULT;
+ goto bailout;
+ }
+
+ tmp_buf = malloc(lengths[i], M_SCSIPASS,
+ M_WAITOK | M_ZERO);
+ io_req->kern_bufs[i] = tmp_buf;
+ *data_ptrs[i] = tmp_buf;
+
+#if 0
+ xpt_print(periph->path, "%s: malloced %p len %u, user "
+ "buffer %p, operation: %s\n", __func__,
+ tmp_buf, lengths[i], io_req->user_bufs[i],
+ (dirs[i] == CAM_DIR_IN) ? "read" : "write");
+#endif
+ /*
+ * We only need to copy in if the user is writing.
+ */
+ if (dirs[i] != CAM_DIR_OUT)
+ continue;
+
+ error = copyin(io_req->user_bufs[i],
+ io_req->kern_bufs[i], lengths[i]);
+ if (error != 0) {
+ xpt_print(periph->path, "%s: copy of user "
+ "buffer from %p to %p failed with "
+ "error %d\n", __func__,
+ io_req->user_bufs[i],
+ io_req->kern_bufs[i], error);
+ goto bailout;
+ }
+ }
+ break;
+ case CAM_DATA_PADDR:
+ /* Pass down the pointer as-is */
+ break;
+ case CAM_DATA_SG: {
+ size_t sg_length, size_to_go, alloc_size;
+ uint32_t num_segs_needed;
+
+ /*
+ * Copy the user S/G list in, and then copy in the
+ * individual segments.
+ */
+ /*
+ * We shouldn't see this, but check just in case.
+ */
+ if (numbufs != 1) {
+ xpt_print(periph->path, "%s: cannot currently handle "
+ "more than one S/G list per CCB\n", __func__);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ /*
+ * We have to have at least one segment.
+ */
+ if (num_segs == 0) {
+ xpt_print(periph->path, "%s: CAM_DATA_SG flag set, "
+ "but sglist_cnt=0!\n", __func__);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ /*
+ * Make sure the user specified the total length and didn't
+ * just leave it to us to decode the S/G list.
+ */
+ if (lengths[0] == 0) {
+ xpt_print(periph->path, "%s: no dxfer_len specified, "
+ "but CAM_DATA_SG flag is set!\n", __func__);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ /*
+ * We allocate buffers in io_zone_size increments for an
+ * S/G list. This will generally be MAXPHYS.
+ */
+ if (lengths[0] <= softc->io_zone_size)
+ num_segs_needed = 1;
+ else {
+ num_segs_needed = lengths[0] / softc->io_zone_size;
+ if ((lengths[0] % softc->io_zone_size) != 0)
+ num_segs_needed++;
+ }
+
+ /* Figure out the size of the S/G list */
+ sg_length = num_segs * sizeof(bus_dma_segment_t);
+ io_req->num_user_segs = num_segs;
+ io_req->num_kern_segs = num_segs_needed;
+
+ /* Save the user's S/G list pointer for later restoration */
+ io_req->user_bufs[0] = *data_ptrs[0];
+
+ /*
+ * If we have enough segments allocated by default to handle
+ * the length of the user's S/G list,
+ */
+ if (num_segs > PASS_MAX_SEGS) {
+ io_req->user_segptr = malloc(sizeof(bus_dma_segment_t) *
+ num_segs, M_SCSIPASS, M_WAITOK | M_ZERO);
+ io_req->flags |= PASS_IO_USER_SEG_MALLOC;
+ } else
+ io_req->user_segptr = io_req->user_segs;
+
+ if (!useracc(*data_ptrs[0], sg_length, VM_PROT_READ)) {
+ xpt_print(periph->path, "%s: unable to access user "
+ "S/G list at %p\n", __func__, *data_ptrs[0]);
+ error = EFAULT;
+ goto bailout;
+ }
+
+ error = copyin(*data_ptrs[0], io_req->user_segptr, sg_length);
+ if (error != 0) {
+ xpt_print(periph->path, "%s: copy of user S/G list "
+ "from %p to %p failed with error %d\n",
+ __func__, *data_ptrs[0], io_req->user_segptr,
+ error);
+ goto bailout;
+ }
+
+ if (num_segs_needed > PASS_MAX_SEGS) {
+ io_req->kern_segptr = malloc(sizeof(bus_dma_segment_t) *
+ num_segs_needed, M_SCSIPASS, M_WAITOK | M_ZERO);
+ io_req->flags |= PASS_IO_KERN_SEG_MALLOC;
+ } else {
+ io_req->kern_segptr = io_req->kern_segs;
+ }
+
+ /*
+ * Allocate the kernel S/G list.
+ */
+ for (size_to_go = lengths[0], i = 0;
+ size_to_go > 0 && i < num_segs_needed;
+ i++, size_to_go -= alloc_size) {
+ uint8_t *kern_ptr;
+
+ alloc_size = min(size_to_go, softc->io_zone_size);
+ kern_ptr = uma_zalloc(softc->pass_io_zone, M_WAITOK);
+ io_req->kern_segptr[i].ds_addr =
+ (bus_addr_t)(uintptr_t)kern_ptr;
+ io_req->kern_segptr[i].ds_len = alloc_size;
+ }
+ if (size_to_go > 0) {
+ printf("%s: size_to_go = %zu, software error!\n",
+ __func__, size_to_go);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ *data_ptrs[0] = (uint8_t *)io_req->kern_segptr;
+ *seg_cnt_ptr = io_req->num_kern_segs;
+
+ /*
+ * We only need to copy data here if the user is writing.
+ */
+ if (dirs[0] == CAM_DIR_OUT)
+ error = passcopysglist(periph, io_req, dirs[0]);
+ break;
+ }
+ case CAM_DATA_SG_PADDR: {
+ size_t sg_length;
+
+ /*
+ * We shouldn't see this, but check just in case.
+ */
+ if (numbufs != 1) {
+ printf("%s: cannot currently handle more than one "
+ "S/G list per CCB\n", __func__);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ /*
+ * We have to have at least one segment.
+ */
+ if (num_segs == 0) {
+ xpt_print(periph->path, "%s: CAM_DATA_SG_PADDR flag "
+ "set, but sglist_cnt=0!\n", __func__);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ /*
+ * Make sure the user specified the total length and didn't
+ * just leave it to us to decode the S/G list.
+ */
+ if (lengths[0] == 0) {
+ xpt_print(periph->path, "%s: no dxfer_len specified, "
+ "but CAM_DATA_SG flag is set!\n", __func__);
+ error = EINVAL;
+ goto bailout;
+ }
+
+ /* Figure out the size of the S/G list */
+ sg_length = num_segs * sizeof(bus_dma_segment_t);
+ io_req->num_user_segs = num_segs;
+ io_req->num_kern_segs = io_req->num_user_segs;
+
+ /* Save the user's S/G list pointer for later restoration */
+ io_req->user_bufs[0] = *data_ptrs[0];
+
+ if (num_segs > PASS_MAX_SEGS) {
+ io_req->user_segptr = malloc(sizeof(bus_dma_segment_t) *
+ num_segs, M_SCSIPASS, M_WAITOK | M_ZERO);
+ io_req->flags |= PASS_IO_USER_SEG_MALLOC;
+ } else
+ io_req->user_segptr = io_req->user_segs;
+
+ io_req->kern_segptr = io_req->user_segptr;
+
+ error = copyin(*data_ptrs[0], io_req->user_segptr, sg_length);
+ if (error != 0) {
+ xpt_print(periph->path, "%s: copy of user S/G list "
+ "from %p to %p failed with error %d\n",
+ __func__, *data_ptrs[0], io_req->user_segptr,
+ error);
+ goto bailout;
+ }
+ break;
+ }
+ default:
+ case CAM_DATA_BIO:
+ /*
+ * A user shouldn't be attaching a bio to the CCB. It
+ * isn't a user-accessible structure.
+ */
+ error = EINVAL;
+ break;
+ }
+
+bailout:
+ if (error != 0)
+ passiocleanup(softc, io_req);
+
+ return (error);
+}
+
+static int
+passmemdone(struct cam_periph *periph, struct pass_io_req *io_req)
+{
+ struct pass_softc *softc;
+ union ccb *ccb;
+ int error;
+ int i;
+
+ error = 0;
+ softc = (struct pass_softc *)periph->softc;
+ ccb = &io_req->ccb;
+
+ switch (io_req->data_flags) {
+ case CAM_DATA_VADDR:
+ /*
+ * Copy back to the user buffer if this was a read.
+ */
+ for (i = 0; i < io_req->num_bufs; i++) {
+ if (io_req->dirs[i] != CAM_DIR_IN)
+ continue;
+
+ error = copyout(io_req->kern_bufs[i],
+ io_req->user_bufs[i], io_req->lengths[i]);
+ if (error != 0) {
+ xpt_print(periph->path, "Unable to copy %u "
+ "bytes from %p to user address %p\n",
+ io_req->lengths[i],
+ io_req->kern_bufs[i],
+ io_req->user_bufs[i]);
+ goto bailout;
+ }
+
+ }
+ break;
+ case CAM_DATA_PADDR:
+ /* Do nothing. The pointer is a physical address already */
+ break;
+ case CAM_DATA_SG:
+ /*
+ * Copy back to the user buffer if this was a read.
+ * Restore the user's S/G list buffer pointer.
+ */
+ if (io_req->dirs[0] == CAM_DIR_IN)
+ error = passcopysglist(periph, io_req, io_req->dirs[0]);
+ break;
+ case CAM_DATA_SG_PADDR:
+ /*
+ * Restore the user's S/G list buffer pointer. No need to
+ * copy.
+ */
+ break;
+ default:
+ case CAM_DATA_BIO:
+ error = EINVAL;
+ break;
+ }
+
+bailout:
+ /*
+ * Reset the user's pointers to their original values and free
+ * allocated memory.
+ */
+ passiocleanup(softc, io_req);
+
+ return (error);
+}
+
static int
passioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
@@ -548,6 +1754,7 @@ static int
passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct cam_periph *periph;
+ struct pass_softc *softc;
int error;
uint32_t priority;
@@ -556,6 +1763,7 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread
return(ENXIO);
cam_periph_lock(periph);
+ softc = (struct pass_softc *)periph->softc;
error = 0;
@@ -620,15 +1828,317 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread
break;
}
+ case CAMIOQUEUE:
+ {
+ struct pass_io_req *io_req;
+ union ccb **user_ccb, *ccb;
+ xpt_opcode fc;
+
+ if ((softc->flags & PASS_FLAG_ZONE_VALID) == 0) {
+ error = passcreatezone(periph);
+ if (error != 0)
+ goto bailout;
+ }
+
+ /*
+ * We're going to do a blocking allocation for this I/O
+ * request, so we have to drop the lock.
+ */
+ cam_periph_unlock(periph);
+
+ io_req = uma_zalloc(softc->pass_zone, M_WAITOK | M_ZERO);
+ ccb = &io_req->ccb;
+ user_ccb = (union ccb **)addr;
+
+ /*
+ * Unlike the CAMIOCOMMAND ioctl above, we only have a
+ * pointer to the user's CCB, so we have to copy the whole
+ * thing in to a buffer we have allocated (above) instead
+ * of allowing the ioctl code to malloc a buffer and copy
+ * it in.
+ *
+ * This is an advantage for this asynchronous interface,
+ * since we don't want the memory to get freed while the
+ * CCB is outstanding.
+ */
+#if 0
+ xpt_print(periph->path, "Copying user CCB %p to "
+ "kernel address %p\n", *user_ccb, ccb);
+#endif
+ error = copyin(*user_ccb, ccb, sizeof(*ccb));
+ if (error != 0) {
+ xpt_print(periph->path, "Copy of user CCB %p to "
+ "kernel address %p failed with error %d\n",
+ *user_ccb, ccb, error);
+ uma_zfree(softc->pass_zone, io_req);
+ cam_periph_lock(periph);
+ break;
+ }
+
+ /*
+ * Some CCB types, like scan bus and scan lun can only go
+ * through the transport layer device.
+ */
+ if (ccb->ccb_h.func_code & XPT_FC_XPT_ONLY) {
+ xpt_print(periph->path, "CCB function code %#x is "
+ "restricted to the XPT device\n",
+ ccb->ccb_h.func_code);
+ uma_zfree(softc->pass_zone, io_req);
+ cam_periph_lock(periph);
+ error = ENODEV;
+ break;
+ }
+
+ /*
+ * Save the user's CCB pointer as well as his linked list
+ * pointers and peripheral private area so that we can
+ * restore these later.
+ */
+ io_req->user_ccb_ptr = *user_ccb;
+ io_req->user_periph_links = ccb->ccb_h.periph_links;
+ io_req->user_periph_priv = ccb->ccb_h.periph_priv;
+
+ /*
+ * Now that we've saved the user's values, we can set our
+ * own peripheral private entry.
+ */
+ ccb->ccb_h.ccb_ioreq = io_req;
+
+ /* Compatibility for RL/priority-unaware code. */
+ priority = ccb->ccb_h.pinfo.priority;
+ if (priority <= CAM_PRIORITY_OOB)
+ priority += CAM_PRIORITY_OOB + 1;
+
+ /*
+ * Setup fields in the CCB like the path and the priority.
+ * The path in particular cannot be done in userland, since
+ * it is a pointer to a kernel data structure.
+ */
+ xpt_setup_ccb_flags(&ccb->ccb_h, periph->path, priority,
+ ccb->ccb_h.flags);
+
+ /*
+ * Setup our done routine. There is no way for the user to
+ * have a valid pointer here.
+ */
+ ccb->ccb_h.cbfcnp = passdone;
+
+ fc = ccb->ccb_h.func_code;
+ /*
+ * If this function code has memory that can be mapped in
+ * or out, we need to call passmemsetup().
+ */
+ if ((fc == XPT_SCSI_IO) || (fc == XPT_ATA_IO)
+ || (fc == XPT_SMP_IO) || (fc == XPT_DEV_MATCH)
+ || (fc == XPT_DEV_ADVINFO)) {
+ error = passmemsetup(periph, io_req);
+ if (error != 0) {
+ uma_zfree(softc->pass_zone, io_req);
+ cam_periph_lock(periph);
+ break;
+ }
+ } else
+ io_req->mapinfo.num_bufs_used = 0;
+
+ cam_periph_lock(periph);
+
+ /*
+ * Everything goes on the incoming queue initially.
+ */
+ TAILQ_INSERT_TAIL(&softc->incoming_queue, io_req, links);
+
+ /*
+ * If the CCB is queued, and is not a user CCB, then
+ * we need to allocate a slot for it. Call xpt_schedule()
+ * so that our start routine will get called when a CCB is
+ * available.
+ */
+ if ((fc & XPT_FC_QUEUED)
+ && ((fc & XPT_FC_USER_CCB) == 0)) {
+ xpt_schedule(periph, priority);
+ break;
+ }
+
+ /*
+ * At this point, the CCB in question is either an
+ * immediate CCB (like XPT_DEV_ADVINFO) or it is a user CCB
+ * and therefore should be malloced, not allocated via a slot.
+ * Remove the CCB from the incoming queue and add it to the
+ * active queue.
+ */
+ TAILQ_REMOVE(&softc->incoming_queue, io_req, links);
+ TAILQ_INSERT_TAIL(&softc->active_queue, io_req, links);
+
+ xpt_action(ccb);
+
+ /*
+ * If this is not a queued CCB (i.e. it is an immediate CCB),
+ * then it is already done. We need to put it on the done
+ * queue for the user to fetch.
+ */
+ if ((fc & XPT_FC_QUEUED) == 0) {
+ TAILQ_REMOVE(&softc->active_queue, io_req, links);
+ TAILQ_INSERT_TAIL(&softc->done_queue, io_req, links);
+ }
+ break;
+ }
+ case CAMIOGET:
+ {
+ union ccb **user_ccb;
+ struct pass_io_req *io_req;
+ int old_error;
+
+ user_ccb = (union ccb **)addr;
+ old_error = 0;
+
+ io_req = TAILQ_FIRST(&softc->done_queue);
+ if (io_req == NULL) {
+ error = ENOENT;
+ break;
+ }
+
+ /*
+ * Remove the I/O from the done queue.
+ */
+ TAILQ_REMOVE(&softc->done_queue, io_req, links);
+
+ /*
+ * We have to drop the lock during the copyout because the
+ * copyout can result in VM faults that require sleeping.
+ */
+ cam_periph_unlock(periph);
+
+ /*
+ * Do any needed copies (e.g. for reads) and revert the
+ * pointers in the CCB back to the user's pointers.
+ */
+ error = passmemdone(periph, io_req);
+
+ old_error = error;
+
+ io_req->ccb.ccb_h.periph_links = io_req->user_periph_links;
+ io_req->ccb.ccb_h.periph_priv = io_req->user_periph_priv;
+
+#if 0
+ xpt_print(periph->path, "Copying to user CCB %p from "
+ "kernel address %p\n", *user_ccb, &io_req->ccb);
+#endif
+
+ error = copyout(&io_req->ccb, *user_ccb, sizeof(union ccb));
+ if (error != 0) {
+ xpt_print(periph->path, "Copy to user CCB %p from "
+ "kernel address %p failed with error %d\n",
+ *user_ccb, &io_req->ccb, error);
+ }
+
+ /*
+ * Prefer the first error we got back, and make sure we
+ * don't overwrite bad status with good.
+ */
+ if (old_error != 0)
+ error = old_error;
+
+ cam_periph_lock(periph);
+
+ /*
+ * At this point, if there was an error, we could potentially
+ * re-queue the I/O and try again. But why? The error
+ * would almost certainly happen again. We might as well
+ * not leak memory.
+ */
+ uma_zfree(softc->pass_zone, io_req);
+ break;
+ }
default:
error = cam_periph_ioctl(periph, cmd, addr, passerror);
break;
}
+bailout:
cam_periph_unlock(periph);
+
return(error);
}
+static int
+passpoll(struct cdev *dev, int poll_events, struct thread *td)
+{
+ struct cam_periph *periph;
+ struct pass_softc *softc;
+ int revents;
+
+ periph = (struct cam_periph *)dev->si_drv1;
+ if (periph == NULL)
+ return (ENXIO);
+
+ softc = (struct pass_softc *)periph->softc;
+
+ revents = poll_events & (POLLOUT | POLLWRNORM);
+ if ((poll_events & (POLLIN | POLLRDNORM)) != 0) {
+ cam_periph_lock(periph);
+
+ if (!TAILQ_EMPTY(&softc->done_queue)) {
+ revents |= poll_events & (POLLIN | POLLRDNORM);
+ }
+ cam_periph_unlock(periph);
+ if (revents == 0)
+ selrecord(td, &softc->read_select);
+ }
+
+ return (revents);
+}
+
+static int
+passkqfilter(struct cdev *dev, struct knote *kn)
+{
+ struct cam_periph *periph;
+ struct pass_softc *softc;
+
+ periph = (struct cam_periph *)dev->si_drv1;
+ if (periph == NULL)
+ return (ENXIO);
+
+ softc = (struct pass_softc *)periph->softc;
+
+ kn->kn_hook = (caddr_t)periph;
+ kn->kn_fop = &passread_filtops;
+ knlist_add(&softc->read_select.si_note, kn, 0);
+
+ return (0);
+}
+
+static void
+passreadfiltdetach(struct knote *kn)
+{
+ struct cam_periph *periph;
+ struct pass_softc *softc;
+
+ periph = (struct cam_periph *)kn->kn_hook;
+ softc = (struct pass_softc *)periph->softc;
+
+ knlist_remove(&softc->read_select.si_note, kn, 0);
+}
+
+static int
+passreadfilt(struct knote *kn, long hint)
+{
+ struct cam_periph *periph;
+ struct pass_softc *softc;
+ int retval;
+
+ periph = (struct cam_periph *)kn->kn_hook;
+ softc = (struct pass_softc *)periph->softc;
+
+ cam_periph_assert(periph, MA_OWNED);
+
+ if (TAILQ_EMPTY(&softc->done_queue))
+ retval = 0;
+ else
+ retval = 1;
+
+ return (retval);
+}
+
/*
* Generally, "ccb" should be the CCB supplied by the kernel. "inccb"
* should be the CCB that is copied in from the user.
@@ -650,6 +2160,10 @@ passsendccb(struct cam_periph *periph, union ccb *ccb, union ccb *inccb)
xpt_merge_ccb(ccb, inccb);
/*
+ */
+ ccb->ccb_h.cbfcnp = passdone;
+
+ /*
* Let cam_periph_mapmem do a sanity check on the data pointer format.
* Even if no data transfer is needed, it's a cheap check and it
* simplifies the code.
diff --git a/sys/cam/scsi/scsi_pass.h b/sys/cam/scsi/scsi_pass.h
index ae0e058..797ef08 100644
--- a/sys/cam/scsi/scsi_pass.h
+++ b/sys/cam/scsi/scsi_pass.h
@@ -39,4 +39,12 @@
#define CAMIOCOMMAND _IOWR(CAM_VERSION, 2, union ccb)
#define CAMGETPASSTHRU _IOWR(CAM_VERSION, 3, union ccb)
+/*
+ * These two ioctls take a union ccb *, but that is not explicitly declared
+ * to avoid having the ioctl handling code malloc and free their own copy
+ * of the CCB or the CCB pointer.
+ */
+#define CAMIOQUEUE _IO(CAM_VERSION, 4)
+#define CAMIOGET _IO(CAM_VERSION, 5)
+
#endif
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
index df48567..348222c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
@@ -63,6 +63,7 @@
#ifndef illumos
#include <sys/dtrace_bsd.h>
#include <sys/eventhandler.h>
+#include <sys/sysctl.h>
#include <sys/u8_textprep.h>
#include <sys/user.h>
#include <vm/vm.h>
@@ -172,13 +173,14 @@ static volatile uint64_t fasttrap_mod_gen;
/*
* When the fasttrap provider is loaded, fasttrap_max is set to either
- * FASTTRAP_MAX_DEFAULT or the value for fasttrap-max-probes in the
- * fasttrap.conf file. Each time a probe is created, fasttrap_total is
- * incremented by the number of tracepoints that may be associated with that
- * probe; fasttrap_total is capped at fasttrap_max.
+ * FASTTRAP_MAX_DEFAULT, or the value for fasttrap-max-probes in the
+ * fasttrap.conf file (Illumos), or the value provied in the loader.conf (FreeBSD).
+ * Each time a probe is created, fasttrap_total is incremented by the number
+ * of tracepoints that may be associated with that probe; fasttrap_total is capped
+ * at fasttrap_max.
*/
#define FASTTRAP_MAX_DEFAULT 250000
-static uint32_t fasttrap_max;
+static uint32_t fasttrap_max = FASTTRAP_MAX_DEFAULT;
static uint32_t fasttrap_total;
/*
@@ -226,6 +228,17 @@ static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU];
static eventhandler_tag fasttrap_thread_dtor_tag;
#endif
+static unsigned long tpoints_hash_size = FASTTRAP_TPOINTS_DEFAULT_SIZE;
+
+#ifdef __FreeBSD__
+SYSCTL_DECL(_kern_dtrace);
+SYSCTL_NODE(_kern_dtrace, OID_AUTO, fasttrap, CTLFLAG_RD, 0, "DTrace fasttrap parameters");
+SYSCTL_UINT(_kern_dtrace_fasttrap, OID_AUTO, max_probes, CTLFLAG_RWTUN, &fasttrap_max,
+ FASTTRAP_MAX_DEFAULT, "Maximum number of fasttrap probes");
+SYSCTL_ULONG(_kern_dtrace_fasttrap, OID_AUTO, tpoints_hash_size, CTLFLAG_RDTUN, &tpoints_hash_size,
+ FASTTRAP_TPOINTS_DEFAULT_SIZE, "Size of the tracepoint hash table");
+#endif
+
static int
fasttrap_highbit(ulong_t i)
{
@@ -2480,8 +2493,6 @@ fasttrap_load(void)
#ifdef illumos
fasttrap_max = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS,
"fasttrap-max-probes", FASTTRAP_MAX_DEFAULT);
-#else
- fasttrap_max = FASTTRAP_MAX_DEFAULT;
#endif
fasttrap_total = 0;
@@ -2492,12 +2503,14 @@ fasttrap_load(void)
nent = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS,
"fasttrap-hash-size", FASTTRAP_TPOINTS_DEFAULT_SIZE);
#else
- nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
+ nent = tpoints_hash_size;
#endif
if (nent == 0 || nent > 0x1000000)
nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
+ tpoints_hash_size = nent;
+
if (ISP2(nent))
fasttrap_tpoints.fth_nent = nent;
else
diff --git a/sys/cddl/dev/fbt/arm/fbt_isa.c b/sys/cddl/dev/fbt/arm/fbt_isa.c
index c02c1ec..c3b6fca 100644
--- a/sys/cddl/dev/fbt/arm/fbt_isa.c
+++ b/sys/cddl/dev/fbt/arm/fbt_isa.c
@@ -35,11 +35,10 @@
#include <sys/param.h>
#include <sys/dtrace.h>
+#include <machine/trap.h>
#include "fbt.h"
-#define FBT_PATCHVAL 0xe7f000f0 /* Specified undefined instruction */
-
#define FBT_PUSHM 0xe92d0000
#define FBT_POPM 0xe8bd0000
#define FBT_JUMP 0xea000000
@@ -53,15 +52,20 @@ fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval)
struct trapframe *frame = (struct trapframe *)stack;
solaris_cpu_t *cpu = &solaris_cpu[curcpu];
fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)];
+ register_t fifthparam;
for (; fbt != NULL; fbt = fbt->fbtp_hashnext) {
if ((uintptr_t)fbt->fbtp_patchpoint == addr) {
cpu->cpu_dtrace_caller = addr;
- /* TODO: Need 5th parameter from stack */
+ /* Get 5th parameter from stack */
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
+ fifthparam = *(register_t *)frame->tf_usr_sp;
+ DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR);
+
dtrace_probe(fbt->fbtp_id, frame->tf_r0,
frame->tf_r1, frame->tf_r2,
- frame->tf_r3, 0);
+ frame->tf_r3, fifthparam);
cpu->cpu_dtrace_caller = 0;
@@ -77,7 +81,7 @@ fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val)
{
*fbt->fbtp_patchpoint = val;
- cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, 4);
+ cpu_icache_sync_range((vm_offset_t)fbt->fbtp_patchpoint, sizeof(val));
}
int
@@ -104,13 +108,6 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
if (name[0] == '_' && name[1] == '_')
return (0);
- /*
- * Architecture-specific exclusion list, largely to do with FBT trap
- * processing, to prevent reentrance.
- */
- if (strcmp(name, "undefinedinstruction") == 0)
- return (0);
-
instr = (uint32_t *)symval->value;
limit = (uint32_t *)(symval->value + symval->size);
@@ -125,12 +122,12 @@ fbt_provide_module_function(linker_file_t lf, int symindx,
fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO);
fbt->fbtp_name = name;
fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
- name, FBT_ENTRY, 3, fbt);
+ name, FBT_ENTRY, 2, fbt);
fbt->fbtp_patchpoint = instr;
fbt->fbtp_ctl = lf;
fbt->fbtp_loadcnt = lf->loadcnt;
fbt->fbtp_savedval = *instr;
- fbt->fbtp_patchval = FBT_PATCHVAL;
+ fbt->fbtp_patchval = FBT_BREAKPOINT;
fbt->fbtp_rval = DTRACE_INVOP_PUSHM;
fbt->fbtp_symindx = symindx;
@@ -157,7 +154,6 @@ again:
start = (uint32_t *)symval->value;
if (target >= limit || target < start)
break;
- instr++; /* skip delay slot */
}
}
@@ -171,7 +167,7 @@ again:
fbt->fbtp_name = name;
if (retfbt == NULL) {
fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
- name, FBT_RETURN, 3, fbt);
+ name, FBT_RETURN, 2, fbt);
} else {
retfbt->fbtp_next = fbt;
fbt->fbtp_id = retfbt->fbtp_id;
@@ -187,7 +183,7 @@ again:
else
fbt->fbtp_rval = DTRACE_INVOP_POPM;
fbt->fbtp_savedval = *instr;
- fbt->fbtp_patchval = FBT_PATCHVAL;
+ fbt->fbtp_patchval = FBT_BREAKPOINT;
fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)];
fbt_probetab[FBT_ADDR2NDX(instr)] = fbt;
diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c
index 80a0eca..4deac87 100644
--- a/sys/cddl/dev/profile/profile.c
+++ b/sys/cddl/dev/profile/profile.c
@@ -50,6 +50,7 @@
#include <sys/proc.h>
#include <sys/selinfo.h>
#include <sys/smp.h>
+#include <sys/sysctl.h>
#include <sys/uio.h>
#include <sys/unistd.h>
#include <machine/cpu.h>
@@ -134,10 +135,7 @@ struct profile_probe_percpu;
#endif
#ifdef __arm__
-/*
- * At least on ARMv7, this appears to work quite well.
- */
-#define PROF_ARTIFICIAL_FRAMES 10
+#define PROF_ARTIFICIAL_FRAMES 3
#endif
#ifdef __aarch64__
@@ -233,7 +231,12 @@ static dtrace_pops_t profile_pops = {
static struct cdev *profile_cdev;
static dtrace_provider_id_t profile_id;
static hrtime_t profile_interval_min = NANOSEC / 5000; /* 5000 hz */
-static int profile_aframes = 0; /* override */
+static int profile_aframes = PROF_ARTIFICIAL_FRAMES;
+
+SYSCTL_DECL(_kern_dtrace);
+SYSCTL_NODE(_kern_dtrace, OID_AUTO, profile, CTLFLAG_RD, 0, "DTrace profile parameters");
+SYSCTL_INT(_kern_dtrace_profile, OID_AUTO, aframes, CTLFLAG_RW, &profile_aframes,
+ 0, "Skipped frames for profile provider");
static sbintime_t
nsec_to_sbt(hrtime_t nsec)
@@ -352,7 +355,7 @@ profile_create(hrtime_t interval, char *name, int kind)
prof->prof_kind = kind;
prof->prof_id = dtrace_probe_create(profile_id,
NULL, NULL, name,
- profile_aframes ? profile_aframes : PROF_ARTIFICIAL_FRAMES, prof);
+ profile_aframes, prof);
}
/*ARGSUSED*/
diff --git a/sys/compat/ia32/ia32_sysvec.c b/sys/compat/ia32/ia32_sysvec.c
index c580e5d..1a6dd72 100644
--- a/sys/compat/ia32/ia32_sysvec.c
+++ b/sys/compat/ia32/ia32_sysvec.c
@@ -99,8 +99,6 @@ struct sysentvec ia32_freebsd_sysvec = {
.sv_size = FREEBSD32_SYS_MAXSYSCALL,
.sv_table = freebsd32_sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -108,7 +106,6 @@ struct sysentvec ia32_freebsd_sysvec = {
.sv_sendsig = ia32_sendsig,
.sv_sigcode = ia32_sigcode,
.sv_szsigcode = &sz_ia32_sigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF32",
.sv_coredump = elf32_coredump,
.sv_imgact_try = NULL,
diff --git a/sys/compat/linuxkpi/common/include/linux/compat.h b/sys/compat/linuxkpi/common/include/linux/compat.h
index 74ce9ec..0630b83 100644
--- a/sys/compat/linuxkpi/common/include/linux/compat.h
+++ b/sys/compat/linuxkpi/common/include/linux/compat.h
@@ -31,8 +31,4 @@
#ifndef _LINUX_COMPAT_H_
#define _LINUX_COMPAT_H_
-#define is_multicast_ether_addr(x) 0
-#define is_broadcast_ether_addr(x) 0
-
-
#endif /* _LINUX_COMPAT_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h b/sys/compat/linuxkpi/common/include/linux/etherdevice.h
index 12ea345..c7a6ebe 100644
--- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h
+++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h
@@ -29,6 +29,25 @@
#include <linux/types.h>
+#define ETH_MODULE_SFF_8079 1
+#define ETH_MODULE_SFF_8079_LEN 256
+#define ETH_MODULE_SFF_8472 2
+#define ETH_MODULE_SFF_8472_LEN 512
+#define ETH_MODULE_SFF_8636 3
+#define ETH_MODULE_SFF_8636_LEN 256
+#define ETH_MODULE_SFF_8436 4
+#define ETH_MODULE_SFF_8436_LEN 256
+
+struct ethtool_eeprom {
+ u32 offset;
+ u32 len;
+};
+
+struct ethtool_modinfo {
+ u32 type;
+ u32 eeprom_len;
+};
+
static inline bool
is_zero_ether_addr(const u8 * addr)
{
diff --git a/sys/compat/linuxkpi/common/include/linux/file.h b/sys/compat/linuxkpi/common/include/linux/file.h
index b23c971..e52afa5 100644
--- a/sys/compat/linuxkpi/common/include/linux/file.h
+++ b/sys/compat/linuxkpi/common/include/linux/file.h
@@ -2,7 +2,7 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -125,6 +125,21 @@ get_unused_fd(void)
return fd;
}
+static inline int
+get_unused_fd_flags(int flags)
+{
+ struct file *file;
+ int error;
+ int fd;
+
+ error = falloc(curthread, &file, &fd, flags);
+ if (error)
+ return -error;
+ /* drop the extra reference */
+ fdrop(file, curthread);
+ return fd;
+}
+
static inline struct linux_file *
alloc_file(int mode, const struct file_operations *fops)
{
diff --git a/sys/compat/linuxkpi/common/include/linux/workqueue.h b/sys/compat/linuxkpi/common/include/linux/workqueue.h
index e9a6f5a..58ef463 100644
--- a/sys/compat/linuxkpi/common/include/linux/workqueue.h
+++ b/sys/compat/linuxkpi/common/include/linux/workqueue.h
@@ -2,7 +2,7 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,8 @@ struct work_struct {
void (*fn)(struct work_struct *);
};
+typedef __typeof(((struct work_struct *)0)->fn) work_func_t;
+
struct delayed_work {
struct work_struct work;
struct callout timer;
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index 0c82f0b..f37d8cb 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -167,8 +167,6 @@ struct sysentvec svr4_sysvec = {
.sv_size = SVR4_SYS_MAXSYSCALL,
.sv_table = svr4_sysent,
.sv_mask = 0xff,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = ELAST, /* ELAST */
.sv_errtbl = bsd_to_svr4_errno,
.sv_transtrap = NULL,
@@ -176,7 +174,6 @@ struct sysentvec svr4_sysvec = {
.sv_sendsig = svr4_sendsig,
.sv_sigcode = svr4_sigcode,
.sv_szsigcode = &svr4_szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "SVR4",
.sv_coredump = elf32_coredump,
.sv_imgact_try = NULL,
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 89a9a0a..3c64d5b 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -2740,6 +2740,9 @@ device rue
# Davicom DM9601E USB to fast ethernet. Supports the Corega FEther USB-TXC.
device udav
#
+# RealTek RTL8152 USB to fast ethernet.
+device ure
+#
# Moschip MCS7730/MCS7840 USB to fast ethernet. Supports the Sitecom LN030.
device mos
#
diff --git a/sys/conf/files b/sys/conf/files
index ea03624..3eb2ab5 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1058,6 +1058,8 @@ contrib/dev/ath/ath_hal/ar9300/ar9300_stub.c optional ath_hal | ath_ar9300 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c optional ath_hal | ath_ar9300 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
+contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c optional ath_hal | ath_ar9300 \
+ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
contrib/dev/ath/ath_hal/ar9300/ar9300_timer.c optional ath_hal | ath_ar9300 \
compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal -I$S/contrib/dev/ath/ath_hal"
contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c optional ath_hal | ath_ar9300 \
@@ -2612,12 +2614,13 @@ dev/usb/net/if_mos.c optional mos
dev/usb/net/if_rue.c optional rue
dev/usb/net/if_smsc.c optional smsc
dev/usb/net/if_udav.c optional udav
+dev/usb/net/if_ure.c optional ure
dev/usb/net/if_usie.c optional usie
dev/usb/net/if_urndis.c optional urndis
dev/usb/net/ruephy.c optional rue
dev/usb/net/usb_ethernet.c optional uether | aue | axe | axge | cdce | \
cue | ipheth | kue | mos | rue | \
- smsc | udav | urndis
+ smsc | udav | ure | urndis
dev/usb/net/uhso.c optional uhso
#
# USB WLAN drivers
diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64
index 303b084..7c8c4f7 100644
--- a/sys/conf/files.arm64
+++ b/sys/conf/files.arm64
@@ -57,6 +57,7 @@ arm64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64
crypto/blowfish/bf_enc.c optional crypto | ipsec
crypto/des/des_enc.c optional crypto | ipsec | netsmb
dev/acpica/acpi_if.m optional acpi
+dev/ahci/ahci_generic.c optional ahci fdt
dev/fdt/fdt_arm64.c optional fdt
dev/hwpmc/hwpmc_arm64.c optional hwpmc
dev/hwpmc/hwpmc_arm64_md.c optional hwpmc
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index 912f015..e8827d7 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -142,6 +142,7 @@ powerpc/mpc85xx/mpc85xx_gpio.c optional mpc85xx gpio
powerpc/mpc85xx/platform_mpc85xx.c optional mpc85xx | qoriq_dpaa
powerpc/mpc85xx/pci_mpc85xx.c optional pci mpc85xx | pci qoriq_dpaa
powerpc/mpc85xx/pci_mpc85xx_pcib.c optional pci mpc85xx | pci qoriq_dpaa
+powerpc/mpc85xx/qoriq_gpio.c optional mpc85xx gpio | qoriq_dpaa gpio
powerpc/ofw/ofw_machdep.c standard
powerpc/ofw/ofw_pci.c optional pci
powerpc/ofw/ofw_pcibus.c optional pci
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 100f7aa..007e665 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -206,9 +206,8 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \
SYSTEM_DEP+= ${LDSCRIPT}
# Calculate path for .m files early, if needed.
-.if !defined(_MPATH)
+.if !defined(__MPATH)
__MPATH!=find ${S:tA}/ -name \*_if.m
-_MPATH=${__MPATH:H:O:u}
.endif
# MKMODULESENV is set here so that port makefiles can augment
@@ -227,7 +226,7 @@ MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}"
.if defined(DEBUG)
MKMODULESENV+= DEBUG_FLAGS="${DEBUG}"
.endif
-MKMODULESENV+= _MPATH="${_MPATH}"
+MKMODULESENV+= __MPATH="${__MPATH}"
# Architecture and output format arguments for objdump to convert image to
# object file
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 8bbcfcb..203d6d7 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -370,14 +370,20 @@ vnode_if_typedef.h:
.endif
# Build _if.[ch] from _if.m, and clean them when we're done.
-.if !defined(_MPATH)
+# This is duplicated in sys/modules/Makefile.
+.if !defined(__MPATH)
__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
-_MPATH=${__MPATH:H:O:u}
+.export __MPATH
.endif
+_MFILES=${__MPATH:T:O}
+_MPATH=${__MPATH:H:O:u}
.PATH.m: ${_MPATH}
.for _i in ${SRCS:M*_if.[ch]}
-#removes too much, comment out until it's more constrained.
-#CLEANFILES+= ${_i}
+_MATCH=M${_i:R:S/$/.m/}
+_MATCHES=${_MFILES:${_MATCH}}
+.if !empty(_MATCHES)
+CLEANFILES+= ${_i}
+.endif
.endfor # _i
.m.c: ${SYSDIR}/tools/makeobjops.awk
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
diff --git a/sys/conf/ldscript.powerpc64 b/sys/conf/ldscript.powerpc64
index dba7455..18349a5 100644
--- a/sys/conf/ldscript.powerpc64
+++ b/sys/conf/ldscript.powerpc64
@@ -69,6 +69,7 @@ SECTIONS
.toc1 : ALIGN(8) { *(.toc1) }
.opd : ALIGN(8) { KEEP (*(.opd)) }
.branch_lt : ALIGN(8) { *(.branch_lt) }
+ . = ALIGN(4096);
.got : ALIGN(8) { __tocbase = .; *(.got .toc) }
.dynamic : { *(.dynamic) }
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 2239ac6..fc812c5 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -97,7 +97,15 @@ then
fi
touch version
-v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date`
+v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`}
+if [ -n "$SOURCE_DATE_EPOCH" ]; then
+ if ! t=`date -r $SOURCE_DATE_EPOCH 2>/dev/null`; then
+ echo "Invalid SOURCE_DATE_EPOCH" >&2
+ exit 1
+ fi
+else
+ t=`date`
+fi
i=`${MAKE:-make} -V KERN_IDENT`
compiler_v=$($(${MAKE:-make} -V CC) -v 2>&1 | grep -w 'version')
diff --git a/sys/conf/options b/sys/conf/options
index aa07e97..bbe692f 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -818,6 +818,7 @@ AH_SUPPORT_AR9130 opt_ah.h
# This is required for AR933x SoC support
AH_SUPPORT_AR9330 opt_ah.h
AH_SUPPORT_AR9340 opt_ah.h
+AH_SUPPORT_QCA9530 opt_ah.h
AH_SUPPORT_QCA9550 opt_ah.h
AH_DEBUG opt_ah.h
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
index adbef28..f7f3ed7 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
@@ -39,8 +39,10 @@
#include "ar9300/ar9485_1_1.ini"
#include "ar9300/ar9300_jupiter10.ini"
#include "ar9300/ar9300_jupiter20.ini"
+#include "ar9300/ar9462_2p1_initvals.h"
#include "ar9300/ar9580.ini"
#include "ar9300/ar955x.ini"
+#include "ar9300/ar953x.ini"
#include "ar9300/ar9300_aphrodite10.ini"
@@ -565,6 +567,9 @@ ar9300_read_revisions(struct ath_hal *ah)
} else if(AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_QCA955X) {
/* XXX: AR_SREV register in Scorpion reads 0 */
AH_PRIVATE(ah)->ah_macVersion = AR_SREV_VERSION_SCORPION;
+ } else if(AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_QCA953X) {
+ /* XXX: AR_SREV register in HoneyBEE reads 0 */
+ AH_PRIVATE(ah)->ah_macVersion = AR_SREV_VERSION_HONEYBEE;
} else {
/*
* Include 6-bit Chip Type (masked to 0)
@@ -798,6 +803,11 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
#undef AR9340_SOC_SEL_25M_40M
#undef AR9340_REF_CLK_40
}
+
+ if (AR_SREV_HONEYBEE(ah)) {
+ ahp->clk_25mhz = 1;
+ }
+
ar9300_init_pll(ah, AH_NULL);
if (!ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE)) {
@@ -822,6 +832,7 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
ahpriv->ah_macVersion != AR_SREV_VERSION_HORNET &&
ahpriv->ah_macVersion != AR_SREV_VERSION_POSEIDON &&
ahpriv->ah_macVersion != AR_SREV_VERSION_SCORPION &&
+ ahpriv->ah_macVersion != AR_SREV_VERSION_HONEYBEE &&
ahpriv->ah_macVersion != AR_SREV_VERSION_JUPITER &&
ahpriv->ah_macVersion != AR_SREV_VERSION_APHRODITE) ) {
HALDEBUG(ah, HAL_DEBUG_RESET,
@@ -1375,6 +1386,15 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
ar9340Modes_fast_clock_wasp_1p0,
ARRAY_LENGTH(ar9340Modes_fast_clock_wasp_1p0), 3);
+ /* XXX TODO: need to add this for freebsd; it's missing from the current .ini files */
+#if 0
+ /* Japan 2484Mhz CCK settings */
+ INIT_INI_ARRAY(&ahp->ah_ini_japan2484,
+ ar9340_wasp_1p0_baseband_core_txfir_coeff_japan_2484,
+ ARRAY_LENGTH(
+ ar9340_wasp_1p0_baseband_core_txfir_coeff_japan_2484), 2);
+#endif
+
/* Additional setttings for 40Mhz */
INIT_INI_ARRAY(&ahp->ah_ini_modes_additional_40mhz,
ar9340_wasp_1p0_radio_core_40M,
@@ -1444,6 +1464,67 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
//INIT_INI_ARRAY(&ahp->ah_ini_modes_additional_40M,
// ar955x_scorpion_1p0_radio_core_40M,
// ARRAY_LENGTH(ar955x_scorpion_1p0_radio_core_40M), 2);
+ } else if (AR_SREV_HONEYBEE(ah)) {
+ /* mac */
+ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_PRE], NULL, 0, 0);
+ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_CORE],
+ qca953x_honeybee_1p0_mac_core,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_mac_core), 2);
+ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_POST],
+ qca953x_honeybee_1p0_mac_postamble,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_mac_postamble), 5);
+
+ /* bb */
+ INIT_INI_ARRAY(&ahp->ah_ini_bb[ATH_INI_PRE], NULL, 0, 0);
+ INIT_INI_ARRAY(&ahp->ah_ini_bb[ATH_INI_CORE],
+ qca953x_honeybee_1p0_baseband_core,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_baseband_core), 2);
+ INIT_INI_ARRAY(&ahp->ah_ini_bb[ATH_INI_POST],
+ qca953x_honeybee_1p0_baseband_postamble,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_baseband_postamble), 5);
+
+ /* radio */
+ INIT_INI_ARRAY(&ahp->ah_ini_radio[ATH_INI_PRE], NULL, 0, 0);
+ INIT_INI_ARRAY(&ahp->ah_ini_radio[ATH_INI_CORE],
+ qca953x_honeybee_1p0_radio_core,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_radio_core), 2);
+ INIT_INI_ARRAY(&ahp->ah_ini_radio[ATH_INI_POST],
+ qca953x_honeybee_1p0_radio_postamble,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_radio_postamble), 5);
+
+ /* soc */
+ INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_PRE],
+ qca953x_honeybee_1p0_soc_preamble,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_soc_preamble), 2);
+ INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_CORE], NULL, 0, 0);
+ INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_POST],
+ qca953x_honeybee_1p0_soc_postamble,
+ ARRAY_LENGTH(qca953x_honeybee_1p0_soc_postamble), 5);
+
+ /* rx/tx gain */
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
+ qca953xCommon_wo_xlna_rx_gain_table_honeybee_1p0,
+ ARRAY_LENGTH(qca953xCommon_wo_xlna_rx_gain_table_honeybee_1p0), 2);
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bounds,
+ qca953xCommon_wo_xlna_rx_gain_bounds_honeybee_1p0,
+ ARRAY_LENGTH(qca953xCommon_wo_xlna_rx_gain_bounds_honeybee_1p0), 5);
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
+ qca953xModes_no_xpa_tx_gain_table_honeybee_1p0,
+ ARRAY_LENGTH(qca953xModes_no_xpa_tx_gain_table_honeybee_1p0), 2);
+
+ /*ath_hal_pciePowerSaveEnable should be 2 for OWL/Condor and 0 for merlin */
+ ah->ah_config.ath_hal_pcie_power_save_enable = 0;
+
+ /* Fast clock modal settings */
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_additional,
+ qca953xModes_fast_clock_honeybee_1p0,
+ ARRAY_LENGTH(qca953xModes_fast_clock_honeybee_1p0), 3);
+
+ /* Additional setttings for 40Mhz */
+ //INIT_INI_ARRAY(&ahp->ah_ini_modes_additional_40M,
+ // qca953x_honeybee_1p0_radio_core_40M,
+ // ARRAY_LENGTH(qca953x_honeybee_1p0_radio_core_40M), 2);
+
} else if (AR_SREV_JUPITER_10(ah)) {
/* Jupiter: new INI format (pre, core, post arrays per subsystem) */
@@ -1598,11 +1679,21 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
else if (AR_SREV_JUPITER_20(ah)) {
/* Jupiter: new INI format (pre, core, post arrays per subsystem) */
+ /* FreeBSD: just override the registers for jupiter 2.1 */
+
/* mac */
INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_PRE], NULL, 0, 0);
- INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_CORE],
- ar9300_jupiter_2p0_mac_core,
- ARRAY_LENGTH(ar9300_jupiter_2p0_mac_core), 2);
+
+ if (AR_SREV_JUPITER_21(ah)) {
+ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_CORE],
+ ar9462_2p1_mac_core,
+ ARRAY_LENGTH(ar9462_2p1_mac_core), 2);
+ } else {
+ INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_CORE],
+ ar9300_jupiter_2p0_mac_core,
+ ARRAY_LENGTH(ar9300_jupiter_2p0_mac_core), 2);
+ }
+
INIT_INI_ARRAY(&ahp->ah_ini_mac[ATH_INI_POST],
ar9300_jupiter_2p0_mac_postamble,
ARRAY_LENGTH(ar9300_jupiter_2p0_mac_postamble), 5);
@@ -1612,9 +1703,16 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
INIT_INI_ARRAY(&ahp->ah_ini_bb[ATH_INI_CORE],
ar9300_jupiter_2p0_baseband_core,
ARRAY_LENGTH(ar9300_jupiter_2p0_baseband_core), 2);
- INIT_INI_ARRAY(&ahp->ah_ini_bb[ATH_INI_POST],
- ar9300_jupiter_2p0_baseband_postamble,
- ARRAY_LENGTH(ar9300_jupiter_2p0_baseband_postamble), 5);
+
+ if (AR_SREV_JUPITER_21(ah)) {
+ INIT_INI_ARRAY(&ahp->ah_ini_bb[ATH_INI_POST],
+ ar9462_2p1_baseband_postamble,
+ ARRAY_LENGTH(ar9462_2p1_baseband_postamble), 5);
+ } else {
+ INIT_INI_ARRAY(&ahp->ah_ini_bb[ATH_INI_POST],
+ ar9300_jupiter_2p0_baseband_postamble,
+ ARRAY_LENGTH(ar9300_jupiter_2p0_baseband_postamble), 5);
+ }
/* radio */
INIT_INI_ARRAY(&ahp->ah_ini_radio[ATH_INI_PRE], NULL, 0, 0);
@@ -1629,9 +1727,15 @@ ar9300_attach(u_int16_t devid, HAL_SOFTC sc, HAL_BUS_TAG st,
ARRAY_LENGTH(ar9300_jupiter_2p0_radio_postamble_sys2ant), 5);
/* soc */
- INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_PRE],
- ar9300_jupiter_2p0_soc_preamble,
- ARRAY_LENGTH(ar9300_jupiter_2p0_soc_preamble), 2);
+ if (AR_SREV_JUPITER_21(ah)) {
+ INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_PRE],
+ ar9462_2p1_soc_preamble,
+ ARRAY_LENGTH(ar9462_2p1_soc_preamble), 2);
+ } else {
+ INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_PRE],
+ ar9300_jupiter_2p0_soc_preamble,
+ ARRAY_LENGTH(ar9300_jupiter_2p0_soc_preamble), 2);
+ }
INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_CORE], NULL, 0, 0);
INIT_INI_ARRAY(&ahp->ah_ini_soc[ATH_INI_POST],
ar9300_jupiter_2p0_soc_postamble,
@@ -3494,6 +3598,13 @@ void ar9300_rx_gain_table_apply(struct ath_hal *ah)
INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bounds,
ar955xCommon_rx_gain_bounds_scorpion_1p0,
ARRAY_LENGTH(ar955xCommon_rx_gain_bounds_scorpion_1p0), 5);
+ } else if (AR_SREV_HONEYBEE(ah)) {
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
+ qca953xCommon_rx_gain_table_honeybee_1p0,
+ ARRAY_LENGTH(qca953xCommon_rx_gain_table_honeybee_1p0), 2);
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bounds,
+ qca953xCommon_rx_gain_bounds_honeybee_1p0,
+ ARRAY_LENGTH(qca953xCommon_rx_gain_bounds_honeybee_1p0), 5);
} else {
INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
ar9300_common_rx_gain_table_osprey_2p2,
@@ -3547,6 +3658,13 @@ void ar9300_rx_gain_table_apply(struct ath_hal *ah)
INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bounds,
ar955xCommon_wo_xlna_rx_gain_bounds_scorpion_1p0,
ARRAY_LENGTH(ar955xCommon_wo_xlna_rx_gain_bounds_scorpion_1p0), 5);
+ } else if (AR_SREV_HONEYBEE(ah)) {
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
+ qca953xCommon_wo_xlna_rx_gain_table_honeybee_1p0,
+ ARRAY_LENGTH(qca953xCommon_wo_xlna_rx_gain_table_honeybee_1p0), 2);
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain_bounds,
+ qca953xCommon_wo_xlna_rx_gain_bounds_honeybee_1p0,
+ ARRAY_LENGTH(qca953xCommon_wo_xlna_rx_gain_bounds_honeybee_1p0), 5);
} else {
INIT_INI_ARRAY(&ahp->ah_ini_modes_rxgain,
ar9300Common_wo_xlna_rx_gain_table_osprey_2p2,
@@ -3605,6 +3723,11 @@ void ar9300_tx_gain_table_apply(struct ath_hal *ah)
ar9300Modes_low_ob_db_tx_gain_table_jupiter_2p0,
ARRAY_LENGTH(ar9300Modes_low_ob_db_tx_gain_table_jupiter_2p0),
5);
+ } else if (AR_SREV_HONEYBEE(ah)) {
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
+ qca953xModes_xpa_tx_gain_table_honeybee_1p0,
+ ARRAY_LENGTH(qca953xModes_xpa_tx_gain_table_honeybee_1p0),
+ 2);
} else if (AR_SREV_APHRODITE(ah)) {
INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
ar956XModes_low_ob_db_tx_gain_table_aphrodite_1p0,
@@ -3662,6 +3785,16 @@ void ar9300_tx_gain_table_apply(struct ath_hal *ah)
ar956XModes_high_ob_db_tx_gain_table_aphrodite_1p0,
ARRAY_LENGTH(
ar956XModes_high_ob_db_tx_gain_table_aphrodite_1p0), 5);
+ } else if (AR_SREV_HONEYBEE(ah)) {
+ if (AR_SREV_HONEYBEE_11(ah)) {
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
+ qca953xModes_no_xpa_tx_gain_table_honeybee_1p1,
+ ARRAY_LENGTH(qca953xModes_no_xpa_tx_gain_table_honeybee_1p1), 2);
+ } else {
+ INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
+ qca953xModes_no_xpa_tx_gain_table_honeybee_1p0,
+ ARRAY_LENGTH(qca953xModes_no_xpa_tx_gain_table_honeybee_1p0), 2);
+ }
} else {
INIT_INI_ARRAY(&ahp->ah_ini_modes_txgain,
ar9300Modes_high_ob_db_tx_gain_table_osprey_2p2,
@@ -4135,6 +4268,8 @@ ar9300_probe(uint16_t vendorid, uint16_t devid)
return "Qualcomm Atheros QCA955x";
case AR9300_DEVID_QCA9565: /* Aphrodite */
return "Qualcomm Atheros AR9565";
+ case AR9300_DEVID_QCA953X: /* Honeybee */
+ return "Qualcomm Atheros QCA953x";
case AR9300_DEVID_AR1111_PCIE:
return "Atheros AR1111";
default:
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
index c8d2b51..f1ae989 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c
@@ -254,6 +254,9 @@ ar9300_otp_read(struct ath_hal *ah, u_int off, u_int32_t *data, HAL_BOOL is_wifi
int status = 0;
u_int32_t addr;
+ if (AR_SREV_HONEYBEE(ah)){ /* no OTP for Honeybee */
+ return false;
+ }
addr = (AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah))?
OTP_MEM_START_ADDRESS_WASP : OTP_MEM_START_ADDRESS;
if (!is_wifi) {
@@ -354,7 +357,7 @@ ar9300_eeprom_attach(struct ath_hal *ah)
ar9300_flash_map(ah);
/*
* ###### This function always return NO SPUR.
- * This is not AH_TRUE for many board designs.
+ * This is not true for many board designs.
* Does anyone use this?
*/
AH_PRIVATE(ah)->ah_getSpurChan = ar9300_eeprom_get_spur_chan;
@@ -438,10 +441,15 @@ ar9300_eeprom_attach(struct ath_hal *ah)
return HAL_OK;
}
#endif
- if (AR_SREV_HORNET(ah) || AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) {
+ if (AR_SREV_HORNET(ah) || AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)
+ || AR_SREV_HONEYBEE(ah)) {
ahp->try_eeprom = 0;
}
+ if (AR_SREV_HONEYBEE(ah)) {
+ ahp->try_otp = 0;
+ }
+
if (!ar9300_eeprom_restore(ah)) {
return HAL_EIO;
}
@@ -1652,6 +1660,8 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct ath_hal *ah, HAL_BOOL is_2ghz)
#define AR_SWITCH_TABLE_COM_JUPITER_ALL_S (0)
#define AR_SWITCH_TABLE_COM_SCORPION_ALL (0xffffff)
#define AR_SWITCH_TABLE_COM_SCORPION_ALL_S (0)
+#define AR_SWITCH_TABLE_COM_HONEYBEE_ALL (0xffffff)
+#define AR_SWITCH_TABLE_COM_HONEYBEE_ALL_S (0)
#define AR_SWITCH_TABLE_COM_SPDT (0x00f00000)
value = ar9300_ant_ctrl_common_get(ah, is_2ghz);
if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah)) {
@@ -1667,6 +1677,10 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct ath_hal *ah, HAL_BOOL is_2ghz)
OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM,
AR_SWITCH_TABLE_COM_SCORPION_ALL, value);
}
+ else if (AR_SREV_HONEYBEE(ah)) {
+ OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM,
+ AR_SWITCH_TABLE_COM_HONEYBEE_ALL, value);
+ }
else {
OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM,
AR_SWITCH_TABLE_COM_ALL, value);
@@ -1713,7 +1727,7 @@ HAL_BOOL ar9300_ant_ctrl_apply(struct ath_hal *ah, HAL_BOOL is_2ghz)
value = ar9300_ant_ctrl_chain_get(ah, 1, is_2ghz);
OS_REG_RMW_FIELD(ah, AR_PHY_SWITCH_CHAIN_1, AR_SWITCH_TABLE_ALL, value);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah)) {
value = ar9300_ant_ctrl_chain_get(ah, 2, is_2ghz);
OS_REG_RMW_FIELD(ah,
AR_PHY_SWITCH_CHAIN_2, AR_SWITCH_TABLE_ALL, value);
@@ -1899,7 +1913,7 @@ HAL_BOOL ar9300_attenuation_apply(struct ath_hal *ah, u_int16_t channel)
OS_REG_RMW_FIELD(ah,
AR_PHY_EXT_ATTEN_CTL_1, AR_PHY_EXT_ATTEN_CTL_XATTEN1_MARGIN,
value);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)&& !AR_SREV_HONEYBEE(ah) ) {
value = ar9300_attenuation_chain_get(ah, 2, channel);
OS_REG_RMW_FIELD(ah,
AR_PHY_EXT_ATTEN_CTL_2, AR_PHY_EXT_ATTEN_CTL_XATTEN1_DB, value);
@@ -2270,7 +2284,7 @@ ar9300_power_control_override(struct ath_hal *ah, int frequency,
OS_REG_RMW(ah, AR_PHY_TPC_11_B1,
(correction[1] << AR_PHY_TPC_OLPC_GAIN_DELTA_S),
AR_PHY_TPC_OLPC_GAIN_DELTA);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW(ah, AR_PHY_TPC_11_B2,
(correction[2] << AR_PHY_TPC_OLPC_GAIN_DELTA_S),
AR_PHY_TPC_OLPC_GAIN_DELTA);
@@ -2284,7 +2298,7 @@ ar9300_power_control_override(struct ath_hal *ah, int frequency,
if (!AR_SREV_POSEIDON(ah)) {
OS_REG_RMW(ah, AR_PHY_TPC_6_B1,
(3 << AR_PHY_TPC_6_ERROR_EST_MODE_S), AR_PHY_TPC_6_ERROR_EST_MODE);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW(ah, AR_PHY_TPC_6_B2,
(3 << AR_PHY_TPC_6_ERROR_EST_MODE_S),
AR_PHY_TPC_6_ERROR_EST_MODE);
@@ -2344,42 +2358,60 @@ ar9300_power_control_override(struct ath_hal *ah, int frequency,
}
}
- if (!AR_SREV_SCORPION(ah)) {
+ if (!AR_SREV_SCORPION(ah) && !AR_SREV_HONEYBEE(ah)) {
OS_REG_RMW_FIELD(ah,
AR_PHY_TPC_19, AR_PHY_TPC_19_ALPHA_THERM, temp_slope);
} else {
- /*Scorpion has tempSlope register for each chain*/
+ /*Scorpion and Honeybee has tempSlope register for each chain*/
/*Check whether temp_compensation feature is enabled or not*/
if (eep->base_eep_header.feature_enable & 0x1){
if(frequency < 4000) {
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x1) {
OS_REG_RMW_FIELD(ah,
AR_PHY_TPC_19, AR_PHY_TPC_19_ALPHA_THERM,
eep->base_ext2.temp_slope_low);
+ }
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x2) {
OS_REG_RMW_FIELD(ah,
AR_SCORPION_PHY_TPC_19_B1, AR_PHY_TPC_19_ALPHA_THERM,
temp_slope);
+ }
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x4) {
OS_REG_RMW_FIELD(ah,
AR_SCORPION_PHY_TPC_19_B2, AR_PHY_TPC_19_ALPHA_THERM,
eep->base_ext2.temp_slope_high);
+ }
} else {
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x1) {
OS_REG_RMW_FIELD(ah,
AR_PHY_TPC_19, AR_PHY_TPC_19_ALPHA_THERM,
temp_slope);
+ }
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x2) {
OS_REG_RMW_FIELD(ah,
AR_SCORPION_PHY_TPC_19_B1, AR_PHY_TPC_19_ALPHA_THERM,
temp_slope_1);
+ }
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x4) {
OS_REG_RMW_FIELD(ah,
AR_SCORPION_PHY_TPC_19_B2, AR_PHY_TPC_19_ALPHA_THERM,
temp_slope_2);
+ }
}
}else {
/* If temp compensation is not enabled, set all registers to 0*/
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x1) {
OS_REG_RMW_FIELD(ah,
AR_PHY_TPC_19, AR_PHY_TPC_19_ALPHA_THERM, 0);
+ }
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x2) {
OS_REG_RMW_FIELD(ah,
AR_SCORPION_PHY_TPC_19_B1, AR_PHY_TPC_19_ALPHA_THERM, 0);
+ }
+ if (((eep->base_eep_header.txrx_mask & 0xf0) >> 4) & 0x4) {
OS_REG_RMW_FIELD(ah,
AR_SCORPION_PHY_TPC_19_B2, AR_PHY_TPC_19_ALPHA_THERM, 0);
+ }
}
}
OS_REG_RMW_FIELD(ah,
@@ -4392,7 +4424,7 @@ HAL_BOOL ar9300_thermometer_apply(struct ath_hal *ah)
if (!AR_SREV_HORNET(ah) && !AR_SREV_POSEIDON(ah)) {
OS_REG_RMW_FIELD(ah,
AR_PHY_65NM_CH1_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, 0);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, 0);
}
@@ -4402,7 +4434,7 @@ HAL_BOOL ar9300_thermometer_apply(struct ath_hal *ah)
if (!AR_SREV_HORNET(ah) && !AR_SREV_POSEIDON(ah)) {
OS_REG_RMW_FIELD(ah,
AR_PHY_65NM_CH1_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, 0);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW_FIELD(ah,
AR_PHY_65NM_CH2_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, 0);
}
@@ -4413,7 +4445,7 @@ HAL_BOOL ar9300_thermometer_apply(struct ath_hal *ah)
if (!AR_SREV_HORNET(ah) && !AR_SREV_POSEIDON(ah)) {
OS_REG_RMW_FIELD(ah,
AR_PHY_65NM_CH1_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, 1);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, 1);
}
@@ -4424,7 +4456,7 @@ HAL_BOOL ar9300_thermometer_apply(struct ath_hal *ah)
if (!AR_SREV_HORNET(ah) && !AR_SREV_POSEIDON(ah)) {
OS_REG_RMW_FIELD(ah,
AR_PHY_65NM_CH1_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, 0);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
AR_PHY_65NM_CH0_RXTX4_THERM_ON, 0);
}
@@ -4435,7 +4467,7 @@ HAL_BOOL ar9300_thermometer_apply(struct ath_hal *ah)
if (!AR_SREV_HORNET(ah) && !AR_SREV_POSEIDON(ah)) {
OS_REG_RMW_FIELD(ah,
AR_PHY_65NM_CH1_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, 1);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
AR_PHY_65NM_CH0_RXTX4_THERM_ON, 0);
}
@@ -4446,7 +4478,7 @@ HAL_BOOL ar9300_thermometer_apply(struct ath_hal *ah)
if (!AR_SREV_HORNET(ah) && !AR_SREV_POSEIDON(ah)) {
OS_REG_RMW_FIELD(ah,
AR_PHY_65NM_CH1_RXTX4, AR_PHY_65NM_CH0_RXTX4_THERM_ON, 0);
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4,
AR_PHY_65NM_CH0_RXTX4_THERM_ON, 1);
}
@@ -4476,9 +4508,8 @@ HAL_BOOL ar9300_tuning_caps_apply(struct ath_hal *ah)
if ((eep->base_eep_header.feature_enable & 0x40) >> 6) {
tuning_caps_params &= 0x7f;
- /* XXX TODO: ath9k skips it for Wasp and Honeybee/AR9531, not Poseidon */
- if (AR_SREV_POSEIDON(ah) || AR_SREV_WASP(ah)) {
- return AH_TRUE;
+ if (AR_SREV_POSEIDON(ah) || AR_SREV_WASP(ah) || AR_SREV_HONEYBEE(ah)) {
+ return true;
} else if (AR_SREV_HORNET(ah)) {
OS_REG_RMW_FIELD(ah,
AR_HORNET_CH0_XTAL, AR_OSPREY_CHO_XTAL_CAPINDAC,
@@ -4515,7 +4546,7 @@ HAL_BOOL ar9300_xpa_timing_control_apply(struct ath_hal *ah, HAL_BOOL is_2ghz)
u_int8_t xpa_timing_control;
ar9300_eeprom_t *eep = &AH9300(ah)->ah_eeprom;
if ((eep->base_eep_header.feature_enable & 0x80) >> 7) {
- if (AR_SREV_OSPREY(ah) || AR_SREV_AR9580(ah) || AR_SREV_WASP(ah)) {
+ if (AR_SREV_OSPREY(ah) || AR_SREV_AR9580(ah) || AR_SREV_WASP(ah) || AR_SREV_HONEYBEE(ah)) {
if (is_2ghz) {
xpa_timing_control = eep->modal_header_2g.tx_frame_to_xpa_on;
OS_REG_RMW_FIELD(ah,
@@ -4586,7 +4617,7 @@ ar9300_eeprom_set_board_values(struct ath_hal *ah, const struct ieee80211_channe
/* wait for Poseidon internal regular turnning */
/* for Hornet we move it before initPLL to avoid an access issue */
/* Function not used when EMULATION. */
- if (!AR_SREV_HORNET(ah) && !AR_SREV_WASP(ah)) {
+ if (!AR_SREV_HORNET(ah) && !AR_SREV_WASP(ah) && !AR_SREV_HONEYBEE(ah)) {
ar9300_internal_regulator_apply(ah);
}
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
index 0f817f6..d00f7c8 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
@@ -224,6 +224,14 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah)
ah->ah_isFastClockEnabled = ar9300_is_fast_clock_enabled;
ah->ah_get11nExtBusy = ar9300_get_11n_ext_busy;
+ /* Spectral Scan Functions */
+ ah->ah_spectralConfigure = ar9300_configure_spectral_scan;
+ ah->ah_spectralGetConfig = ar9300_get_spectral_params;
+ ah->ah_spectralStart = ar9300_start_spectral_scan;
+ ah->ah_spectralStop = ar9300_stop_spectral_scan;
+ ah->ah_spectralIsEnabled = ar9300_is_spectral_enabled;
+ ah->ah_spectralIsActive = ar9300_is_spectral_active;
+
/* Key cache functions */
ah->ah_getKeyCacheSize = ar9300_get_key_cache_size;
ah->ah_resetKeyCacheEntry = ar9300_reset_key_cache_entry;
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h
index 1af621b..1ad0a44 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd_inc.h
@@ -17,7 +17,7 @@
#define ATH_ANT_DIV_COMB 1 /* Antenna combining */
#define ATH_SUPPORT_RAW_ADC_CAPTURE 0 /* Raw ADC capture support */
#define ATH_TRAFFIC_FAST_RECOVER 0 /* XXX not sure yet */
-#define ATH_SUPPORT_SPECTRAL 0 /* Spectral scan support */
+#define ATH_SUPPORT_SPECTRAL 1 /* Spectral scan support */
#define ATH_BT_COEX 1 /* Enable BT Coex code */
#define ATH_PCIE_ERROR_MONITOR 0 /* ??? */
#define ATH_SUPPORT_CRDC 0 /* ??? */
@@ -51,7 +51,7 @@
#define AH_SUPPORT_POSEIDON 1
#define AH_SUPPORT_AR9300 1
-/* These are the embedded boards; we don't currently support these */
+/* These are the embedded boards */
#ifdef AH_SUPPORT_AR9330
#define AH_SUPPORT_HORNET 1
#endif /* AH_SUPPORT_AR9330 */
@@ -61,6 +61,9 @@
#ifdef AH_SUPPORT_QCA9550
#define AH_SUPPORT_SCORPION 1
#endif /* AH_SUPPORT_QCA9550 */
+#ifdef AH_SUPPORT_QCA9530
+#define AH_SUPPORT_HONEYBEE 1
+#endif /* AH_SUPPORT_QCA9530 */
#define FIX_NOISE_FLOOR 1
/* XXX this needs to be removed! No atomics in the HAL! */
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c
index 2a5f5bd..cfe0748 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radar.c
@@ -578,7 +578,7 @@ ar9300_handle_radar_bb_panic(struct ath_hal *ah)
/* EV92527: we do not need a reset if we see this signature */
HALDEBUG(ah, HAL_DEBUG_DFS, "%s: BB Panic -- 0x1300000a\n", __func__);
return AH_TRUE;
- } else if (AR_SREV_WASP(ah) && (status == 0x04000409)) {
+ } else if ((AR_SREV_WASP(ah) || AR_SREV_HONEYBEE(ah)) && (status == 0x04000409)) {
return AH_TRUE;
} else {
if (ar9300_get_capability(ah, HAL_CAP_LDPCWAR, 0, AH_NULL) == HAL_OK &&
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c
index 9b29471..e70e132 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c
@@ -86,7 +86,9 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan)
u_int8_t clk_25mhz = AH9300(ah)->clk_25mhz;
CHAN_CENTERS centers;
int load_synth_channel;
+#ifdef AH_DEBUG_ALQ
HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan);
+#endif
/*
* Put this behind AH_DEBUG_ALQ for now until the Hornet
@@ -99,7 +101,6 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan)
ar9300_get_channel_centers(ah, chan, &centers);
freq = centers.synth_center;
-
if (freq < 4800) { /* 2 GHz, fractional mode */
b_mode = 1; /* 2 GHz */
@@ -116,7 +117,19 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan)
#endif
uint32_t i;
- i = ath_hal_mhz2ieee_2ghz(ah, ichan);
+ /*
+ * Pay close attention to this bit!
+ *
+ * We need to map the actual desired synth frequency to
+ * one of the channel select array entries.
+ *
+ * For HT20, it'll align with the channel we select.
+ *
+ * For HT40 though it won't - the centre frequency
+ * will not be the frequency of chan->ic_freq or ichan->freq;
+ * it needs to be whatever frequency maps to 'freq'.
+ */
+ i = ath_hal_mhz2ieee_2ghz(ah, freq);
HALASSERT(i > 0 && i <= 14);
if (clk_25mhz) {
channel_sel = ar9300_chansel_xtal_25M[i - 1];
@@ -134,7 +147,7 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan)
channel_sel = (freq * 4) / 120;
channel_frac = (((freq * 4) % 120) * 0x20000) / 120;
channel_sel = (channel_sel << 17) | (channel_frac);
- } else if (AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) {
+ } else if (AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah) || AR_SREV_HONEYBEE(ah)) {
u_int32_t channel_frac;
if (clk_25mhz) {
/*
@@ -143,7 +156,7 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan)
* ndiv = ((chan_mhz * 4) / 3) / freq_ref;
* chansel = int(ndiv), chanfrac = (ndiv - chansel) * 0x20000
*/
- if (AR_SREV_SCORPION(ah)) {
+ if (AR_SREV_SCORPION(ah) || AR_SREV_HONEYBEE(ah)) {
/* Doubler is off for Scorpion */
channel_sel = (freq * 4) / 75;
channel_frac = (((freq * 4) % 75) * 0x20000) / 75;
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c
index c919d3c..e5f4519 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv.c
@@ -228,7 +228,7 @@ ar9300_set_rx_filter(struct ath_hal *ah, u_int32_t bits)
{
u_int32_t phybits;
- if (AR_SREV_SCORPION(ah)) {
+ if (AR_SREV_SCORPION(ah) || AR_SREV_HONEYBEE(ah)) {
/* Enable Rx for 4 address frames */
bits |= AR_RX_4ADDRESS;
}
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
index fcfa58e..3a95c35 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
@@ -288,7 +288,7 @@ ar9300_upload_noise_floor(struct ath_hal *ah, int is_2g,
*/
if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) {
chainmask = 0x01;
- } else if (AR_SREV_WASP(ah) || AR_SREV_JUPITER(ah)) {
+ } else if (AR_SREV_WASP(ah) || AR_SREV_JUPITER(ah) || AR_SREV_HONEYBEE(ah)) {
chainmask = 0x03;
} else {
chainmask = 0x07;
@@ -1476,7 +1476,7 @@ ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan)
OS_REG_WRITE(ah, AR_RTC_PLL_CONTROL, 0x142c);
OS_DELAY(1000);
- } else if (AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) {
+ } else if (AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah) || AR_SREV_HONEYBEE(ah)) {
#define SRIF_PLL 1
u_int32_t regdata, pll2_divint, pll2_divfrac;
@@ -1492,9 +1492,15 @@ ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan)
pll2_divint = 0x1c;
pll2_divfrac = 0xa3d7;
#else
- pll2_divint = 0x54;
- pll2_divfrac = 0x1eb85;
- refdiv = 3;
+ if (AR_SREV_HONEYBEE(ah)) {
+ pll2_divint = 0x1c;
+ pll2_divfrac = 0xa3d2;
+ refdiv = 1;
+ } else {
+ pll2_divint = 0x54;
+ pll2_divfrac = 0x1eb85;
+ refdiv = 3;
+ }
#endif
} else {
#ifndef SRIF_PLL
@@ -1520,7 +1526,11 @@ ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan)
OS_DELAY(1000);
do {
regdata = OS_REG_READ(ah, AR_PHY_PLL_MODE);
- regdata = regdata | (0x1 << 16);
+ if (AR_SREV_HONEYBEE(ah)) {
+ regdata = regdata | (0x1 << 22);
+ } else {
+ regdata = regdata | (0x1 << 16);
+ }
OS_REG_WRITE(ah, AR_PHY_PLL_MODE, regdata); /* PWD_PLL set to 1 */
OS_DELAY(100);
/* override int, frac, refdiv */
@@ -1540,6 +1550,12 @@ ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan)
if (AR_SREV_WASP(ah)) {
regdata = (regdata & 0x80071fff) |
(0x1 << 30) | (0x1 << 13) | (0x4 << 26) | (0x18 << 19);
+ } else if (AR_SREV_HONEYBEE(ah)) {
+ /*
+ * Kd=10, Ki=2, Outdiv=1, Local PLL=0, Phase Shift=4
+ */
+ regdata = (regdata & 0x01c00fff) |
+ (0x1 << 31) | (0x2 << 29) | (0xa << 25) | (0x1 << 19) | (0x6 << 12);
} else {
regdata = (regdata & 0x80071fff) |
(0x3 << 30) | (0x1 << 13) | (0x4 << 26) | (0x60 << 19);
@@ -1548,7 +1564,11 @@ ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan)
/* Ki, Kd, Local PLL, Outdiv */
OS_REG_WRITE(ah, AR_PHY_PLL_MODE, regdata);
regdata = OS_REG_READ(ah, AR_PHY_PLL_MODE);
- regdata = (regdata & 0xfffeffff);
+ if (AR_SREV_HONEYBEE(ah)) {
+ regdata = (regdata & 0xffbfffff);
+ } else {
+ regdata = (regdata & 0xfffeffff);
+ }
OS_REG_WRITE(ah, AR_PHY_PLL_MODE, regdata); /* PWD_PLL set to 0 */
OS_DELAY(1000);
if (AR_SREV_WASP(ah)) {
@@ -1617,6 +1637,7 @@ ar9300_init_pll(struct ath_hal *ah, struct ieee80211_channel *chan)
OS_REG_WRITE(ah, AR_RTC_SLEEP_CLK,
AR_RTC_FORCE_DERIVED_CLK | AR_RTC_PCIE_RST_PWDN_EN);
+ /* XXX TODO: honeybee? */
if (AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) {
if (clk_25mhz) {
OS_REG_WRITE(ah,
@@ -1950,6 +1971,9 @@ ar9300_phy_disable(struct ath_hal *ah)
/* Turn off JMPST led */
REG_WRITE(ATH_GPIO_OUT, (REG_READ(ATH_GPIO_OUT) | (0x1 << 15)));
}
+ else if (AR_SREV_HONEYBEE(ah)) {
+ REG_WRITE(ATH_GPIO_OE, (REG_READ(ATH_GPIO_OE) | (0x1 << 12)));
+ }
#undef REG_READ
#undef REG_WRITE
#endif
@@ -2207,7 +2231,7 @@ ar9300_load_nf(struct ath_hal *ah, int16_t nf[])
*/
if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) {
chainmask = 0x9;
- } else if (AR_SREV_WASP(ah) || AR_SREV_JUPITER(ah)) {
+ } else if (AR_SREV_WASP(ah) || AR_SREV_JUPITER(ah) || AR_SREV_HONEYBEE(ah)) {
chainmask = 0x1b;
} else {
chainmask = 0x3F;
@@ -2395,7 +2419,7 @@ ar9300_calibration(struct ath_hal *ah, struct ieee80211_channel *chan, u_int8_t
HALDEBUG(ah, HAL_DEBUG_CALIBRATE,
"%s: Chain 1 Rx IQ Cal Correction 0x%08x\n",
__func__, OS_REG_READ(ah, AR_PHY_RX_IQCAL_CORR_B1));
- if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah)) {
+ if (!AR_SREV_WASP(ah) && !AR_SREV_JUPITER(ah) && !AR_SREV_HONEYBEE(ah)) {
HALDEBUG(ah, HAL_DEBUG_CALIBRATE,
"%s: Chain 2 Rx IQ Cal Correction 0x%08x\n",
__func__, OS_REG_READ(ah, AR_PHY_RX_IQCAL_CORR_B2));
@@ -2855,6 +2879,7 @@ ar9300_process_ini(struct ath_hal *ah, struct ieee80211_channel *chan,
}
}
modes_index = 1;
+ freq_index = 1;
break;
case CHANNEL_A_HT40PLUS:
@@ -2869,6 +2894,7 @@ ar9300_process_ini(struct ath_hal *ah, struct ieee80211_channel *chan,
}
}
modes_index = 2;
+ freq_index = 1;
break;
case CHANNEL_PUREG:
@@ -2876,20 +2902,27 @@ ar9300_process_ini(struct ath_hal *ah, struct ieee80211_channel *chan,
case CHANNEL_B:
if (AR_SREV_SCORPION(ah)){
modes_txgaintable_index = 8;
- }
+ }else if (AR_SREV_HONEYBEE(ah)){
+ modes_txgaintable_index = 1;
+ }
modes_index = 4;
+ freq_index = 2;
break;
case CHANNEL_G_HT40PLUS:
case CHANNEL_G_HT40MINUS:
if (AR_SREV_SCORPION(ah)){
modes_txgaintable_index = 7;
+ }else if (AR_SREV_HONEYBEE(ah)){
+ modes_txgaintable_index = 1;
}
modes_index = 3;
+ freq_index = 2;
break;
case CHANNEL_108G:
modes_index = 5;
+ freq_index = 2;
break;
default:
@@ -2930,11 +2963,15 @@ ar9300_process_ini(struct ath_hal *ah, struct ieee80211_channel *chan,
} else if (IEEE80211_IS_CHAN_HT40U(chan) || IEEE80211_IS_CHAN_HT40D(chan)) {
if (AR_SREV_SCORPION(ah)){
modes_txgaintable_index = 7;
+ } else if (AR_SREV_HONEYBEE(ah)){
+ modes_txgaintable_index = 1;
}
modes_index = 3;
} else if (IEEE80211_IS_CHAN_HT20(chan) || IEEE80211_IS_CHAN_G(chan) || IEEE80211_IS_CHAN_B(chan) || IEEE80211_IS_CHAN_PUREG(chan)) {
if (AR_SREV_SCORPION(ah)){
modes_txgaintable_index = 8;
+ } else if (AR_SREV_HONEYBEE(ah)){
+ modes_txgaintable_index = 1;
}
modes_index = 4;
} else
@@ -3045,7 +3082,7 @@ ar9300_process_ini(struct ath_hal *ah, struct ieee80211_channel *chan,
/* Write txgain Array Parameters */
- if (AR_SREV_SCORPION(ah)) {
+ if (AR_SREV_SCORPION(ah) || AR_SREV_HONEYBEE(ah)) {
REG_WRITE_ARRAY(&ahp->ah_ini_modes_txgain, modes_txgaintable_index,
reg_writes);
}else{
@@ -3510,7 +3547,7 @@ ar9300_init_cal_internal(struct ath_hal *ah, struct ieee80211_channel *chan,
/* Hornet: 1 x 1 */
ahp->ah_rx_cal_chainmask = 0x1;
ahp->ah_tx_cal_chainmask = 0x1;
- } else if (AR_SREV_WASP(ah) || AR_SREV_JUPITER(ah)) {
+ } else if (AR_SREV_WASP(ah) || AR_SREV_JUPITER(ah) || AR_SREV_HONEYBEE(ah)) {
/* Wasp/Jupiter: 2 x 2 */
ahp->ah_rx_cal_chainmask = 0x3;
ahp->ah_tx_cal_chainmask = 0x3;
@@ -4069,7 +4106,7 @@ ar9300_init_bb(struct ath_hal *ah, struct ieee80211_channel *chan)
/*
* There is an issue if the AP starts the calibration before
* the base band timeout completes. This could result in the
- * rx_clear AH_FALSE triggering. As a workaround we add delay an
+ * rx_clear false triggering. As a workaround we add delay an
* extra BASE_ACTIVATE_DELAY usecs to ensure this condition
* does not happen.
*/
@@ -4438,6 +4475,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *ch
#ifdef ATH_FORCE_PPM
u_int32_t save_force_val, tmp_reg;
#endif
+ u_int8_t clk_25mhz = AH9300(ah)->clk_25mhz;
HAL_BOOL stopped, cal_ret;
HAL_BOOL apply_last_iqcorr = AH_FALSE;
@@ -4449,7 +4487,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *ch
/*
* Set the status to "ok" by default to cover the cases
- * where we return AH_FALSE without going to "bad"
+ * where we return false without going to "bad"
*/
HALASSERT(status);
*status = HAL_OK;
@@ -4792,6 +4830,18 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *ch
if (ecode != HAL_OK) {
goto bad;
}
+
+ /*
+ * Configuring WMAC PLL values for 25/40 MHz
+ */
+ if(AR_SREV_WASP(ah) || AR_SREV_HONEYBEE(ah) || AR_SREV_SCORPION(ah) ) {
+ if(clk_25mhz) {
+ OS_REG_WRITE(ah, AR_RTC_DERIVED_RTC_CLK, (0x17c << 1)); // 32KHz sleep clk
+ } else {
+ OS_REG_WRITE(ah, AR_RTC_DERIVED_RTC_CLK, (0x261 << 1)); // 32KHz sleep clk
+ }
+ OS_DELAY(100);
+ }
ahp->ah_immunity_on = AH_FALSE;
@@ -5147,14 +5197,14 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *ch
* For big endian systems turn on swapping for descriptors
*/
#if AH_BYTE_ORDER == AH_BIG_ENDIAN
- if (AR_SREV_HORNET(ah) || AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) {
+ if (AR_SREV_HORNET(ah) || AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah) || AR_SREV_HONEYBEE(ah)) {
OS_REG_RMW(ah, AR_CFG, AR_CFG_SWTB | AR_CFG_SWRB, 0);
} else {
ar9300_init_cfg_reg(ah);
}
#endif
- if ( AR_SREV_OSPREY(ah) || AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) {
+ if ( AR_SREV_OSPREY(ah) || AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah) || AR_SREV_HONEYBEE(ah) ) {
OS_REG_RMW(ah, AR_CFG_LED, AR_CFG_LED_ASSOC_CTL, AR_CFG_LED_ASSOC_CTL);
}
@@ -5189,6 +5239,10 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *ch
REG_WRITE(ATH_GPIO_OE, (( REG_READ(ATH_GPIO_OE) & (~(0x1 << 12) )) | (0x1 << 13)));
}
}
+ else if (AR_SREV_HONEYBEE(ah)) {
+ REG_WRITE(ATH_GPIO_OUT_FUNCTION3, ( REG_READ(ATH_GPIO_OUT_FUNCTION3) & (~(0xff))) | (0x32) );
+ REG_WRITE(ATH_GPIO_OE, (( REG_READ(ATH_GPIO_OE) & (~(0x1 << 12) ))));
+ }
#undef REG_READ
#undef REG_WRITE
#endif
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c
index 1219b77..9eda4a6 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_spectral.c
@@ -15,12 +15,14 @@
*/
#include "opt_ah.h"
-#ifdef AH_SUPPORT_AR9300
+//#ifdef AH_SUPPORT_AR9300
#include "ah.h"
#include "ah_desc.h"
#include "ah_internal.h"
+#include "ar9300_freebsd_inc.h"
+
#include "ar9300/ar9300phy.h"
#include "ar9300/ar9300.h"
#include "ar9300/ar9300reg.h"
@@ -310,7 +312,7 @@ ar9300_configure_spectral_scan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
u_int32_t val, i;
struct ath_hal_9300 *ahp = AH9300(ah);
HAL_BOOL asleep = ahp->ah_chip_full_sleep;
- int16_t nf_buf[NUM_NF_READINGS];
+ int16_t nf_buf[HAL_NUM_NF_READINGS];
if ((AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) && asleep) {
ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE);
@@ -319,7 +321,7 @@ ar9300_configure_spectral_scan(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
ar9300_prep_spectral_scan(ah);
if (ss->ss_spectral_pri) {
- for (i = 0; i < NUM_NF_READINGS; i++) {
+ for (i = 0; i < HAL_NUM_NF_READINGS; i++) {
nf_buf[i] = NOISE_PWR_DBM_2_INT(ss->ss_nf_cal[i]);
}
ar9300_load_nf(ah, nf_buf);
@@ -392,11 +394,17 @@ void
ar9300_get_spectral_params(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
{
u_int32_t val;
- HAL_CHANNEL_INTERNAL *chan = AH_PRIVATE(ah)->ah_curchan;
+ HAL_CHANNEL_INTERNAL *chan = NULL;
+ const struct ieee80211_channel *c;
int i, ichain, rx_chain_status;
struct ath_hal_9300 *ahp = AH9300(ah);
HAL_BOOL asleep = ahp->ah_chip_full_sleep;
+ c = AH_PRIVATE(ah)->ah_curchan;
+ if (c != NULL)
+ chan = ath_hal_checkchannel(ah, c);
+
+ // XXX TODO: just always wake up all chips?
if ((AR_SREV_WASP(ah) || AR_SREV_SCORPION(ah)) && asleep) {
ar9300_set_power_mode(ah, HAL_PM_AWAKE, AH_TRUE);
}
@@ -414,7 +422,7 @@ ar9300_get_spectral_params(struct ath_hal *ah, HAL_SPECTRAL_PARAM *ss)
if (chan != NULL) {
rx_chain_status = OS_REG_READ(ah, AR_PHY_RX_CHAINMASK) & 0x7;
- for (i = 0; i < NUM_NF_READINGS; i++) {
+ for (i = 0; i < HAL_NUM_NF_READINGS; i++) {
ichain = i % 3;
if (rx_chain_status & (1 << ichain)) {
ss->ss_nf_cal[i] =
@@ -550,14 +558,16 @@ u_int32_t ar9300_get_spectral_config(struct ath_hal *ah)
int16_t ar9300_get_ctl_chan_nf(struct ath_hal *ah)
{
int16_t nf;
+#if 0
struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
+#endif
if ( (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) {
/* Noise floor calibration value is ready */
nf = MS(OS_REG_READ(ah, AR_PHY_CCA_0), AR_PHY_MINCCA_PWR);
} else {
/* NF calibration is not done, return nominal value */
- nf = ahpriv->nfp->nominal;
+ nf = AH9300(ah)->nfp->nominal;
}
if (nf & 0x100) {
nf = (0 - ((nf ^ 0x1ff) + 1));
@@ -568,14 +578,16 @@ int16_t ar9300_get_ctl_chan_nf(struct ath_hal *ah)
int16_t ar9300_get_ext_chan_nf(struct ath_hal *ah)
{
int16_t nf;
+#if 0
struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
+#endif
if ((OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) == 0) {
/* Noise floor calibration value is ready */
nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR_PHY_EXT_MINCCA_PWR);
} else {
/* NF calibration is not done, return nominal value */
- nf = ahpriv->nfp->nominal;
+ nf = AH9300(ah)->nfp->nominal;
}
if (nf & 0x100) {
nf = (0 - ((nf ^ 0x1ff) + 1));
@@ -583,6 +595,6 @@ int16_t ar9300_get_ext_chan_nf(struct ath_hal *ah)
return nf;
}
-#endif
#endif /* ATH_SUPPORT_SPECTRAL */
+//#endif
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h
index edb50ee..0d072e3 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h
@@ -2945,6 +2945,7 @@ enum {
#define AR_SREV_VERSION_WASP 0x300 /* XXX: Check Wasp version number */
#define AR_SREV_VERSION_SCORPION 0x400
#define AR_SREV_VERSION_POSEIDON 0x240
+#define AR_SREV_VERSION_HONEYBEE 0x500
#define AR_SREV_VERSION_APHRODITE 0x2C0
#define AR_SREV_REVISION_OSPREY_10 0 /* Osprey 1.0 */
@@ -2970,6 +2971,11 @@ enum {
#define AR_SREV_REVISION_JUPITER_10 0 /* Jupiter 1.0 */
#define AR_SREV_REVISION_JUPITER_20 2 /* Jupiter 2.0 */
+#define AR_SREV_REVISION_JUPITER_21 3 /* Jupiter 2.1 */
+
+#define AR_SREV_REVISION_HONEYBEE_10 0 /* Honeybee 1.0 */
+#define AR_SREV_REVISION_HONEYBEE_11 1 /* Honeybee 1.1 */
+#define AR_SREV_REVISION_HONEYBEE_MASK 0xf /* Honeybee revision mask */
#define AR_SREV_REVISION_APHRODITE_10 0 /* Aphrodite 1.0 */
@@ -2999,7 +3005,7 @@ enum {
/* NOTE: When adding chips newer than Peacock, add chip check here. */
#define AR_SREV_AR9580_10_OR_LATER(_ah) \
- (AR_SREV_AR9580(_ah))
+ (AR_SREV_AR9580(_ah) || AR_SREV_SCORPION(_ah) || AR_SREV_HONEYBEE(_ah))
#define AR_SREV_JUPITER(_ah) \
((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_JUPITER))
@@ -3012,10 +3018,18 @@ enum {
((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_JUPITER) && \
(AH_PRIVATE((_ah))->ah_macRev == AR_SREV_REVISION_JUPITER_20))
+#define AR_SREV_JUPITER_21(_ah) \
+ ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_JUPITER) && \
+ (AH_PRIVATE((_ah))->ah_macRev == AR_SREV_REVISION_JUPITER_21))
+
#define AR_SREV_JUPITER_20_OR_LATER(_ah) \
((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_JUPITER) && \
(AH_PRIVATE((_ah))->ah_macRev >= AR_SREV_REVISION_JUPITER_20))
+#define AR_SREV_JUPITER_21_OR_LATER(_ah) \
+ ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_JUPITER) && \
+ (AH_PRIVATE((_ah))->ah_macRev >= AR_SREV_REVISION_JUPITER_21))
+
#define AR_SREV_APHRODITE(_ah) \
((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_APHRODITE))
@@ -3052,6 +3066,21 @@ enum {
#define AR_SREV_WASP(_ah) 0
#endif /* #if defined(AH_SUPPORT_WASP) */
+#if defined(AH_SUPPORT_HONEYBEE)
+#define AR_SREV_HONEYBEE(_ah) \
+ ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_HONEYBEE))
+#define AR_SREV_HONEYBEE_10(_ah) \
+ ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_HONEYBEE) && \
+ (AH_PRIVATE((_ah))->ah_macRev == AR_SREV_REVISION_HONEYBEE_10))
+#define AR_SREV_HONEYBEE_11(_ah) \
+ ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_HONEYBEE) && \
+ (AH_PRIVATE((_ah))->ah_macRev == AR_SREV_REVISION_HONEYBEE_11))
+#else
+#define AR_SREV_HONEYBEE(_ah) 0
+#define AR_SREV_HONEYBEE_10(_ah) 0
+#define AR_SREV_HONEYBEE_11(_ah) 0
+#endif /* #if defined(AH_SUPPORT_HONEYBEE) */
+
#define AR_SREV_WASP_10(_ah) \
((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_WASP) && \
(AH_PRIVATE((_ah))->ah_macRev == AR_SREV_REVISION_WASP_10))
@@ -3094,7 +3123,7 @@ enum {
#define AR_SREV_POSEIDON_OR_LATER(_ah) \
(AH_PRIVATE((_ah))->ah_macVersion >= AR_SREV_VERSION_POSEIDON)
-#define AR_SREV_SOC(_ah) (AR_SREV_HORNET(_ah) || AR_SREV_POSEIDON(_ah) || AR_SREV_WASP(_ah))
+#define AR_SREV_SOC(_ah) (AR_SREV_HORNET(_ah) || AR_SREV_POSEIDON(_ah) || AR_SREV_WASP(_ah) || AR_SREV_HONEYBEE(_ah))
/*
* Mask used to construct AAD for CCMP-AES
* Cisco spec defined bits 0-3 as mask
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h b/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h
new file mode 100644
index 0000000..1b6b4d0
--- /dev/null
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p0_initvals.h
@@ -0,0 +1,1250 @@
+/*
+ * Copyright (c) 2010-2011 Atheros Communications Inc.
+ * Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef INITVALS_9462_2P0_H
+#define INITVALS_9462_2P0_H
+
+/* AR9462 2.0 */
+
+#define ar9462_2p0_mac_postamble ar9331_1p1_mac_postamble
+
+#define ar9462_2p0_common_wo_xlna_rx_gain ar9300Common_wo_xlna_rx_gain_table_2p2
+
+#define ar9462_2p0_common_5g_xlna_only_rxgain ar9462_2p0_common_mixed_rx_gain
+
+#define ar9462_2p0_baseband_core_txfir_coeff_japan_2484 ar9300_2p2_baseband_core_txfir_coeff_japan_2484
+
+static const u32 ar9462_2p0_modes_fast_clock[][3] = {
+ /* Addr 5G_HT20 5G_HT40 */
+ {0x00001030, 0x00000268, 0x000004d0},
+ {0x00001070, 0x0000018c, 0x00000318},
+ {0x000010b0, 0x00000fd0, 0x00001fa0},
+ {0x00008014, 0x044c044c, 0x08980898},
+ {0x0000801c, 0x148ec02b, 0x148ec057},
+ {0x00008318, 0x000044c0, 0x00008980},
+ {0x00009e00, 0x0372131c, 0x0372131c},
+ {0x0000a230, 0x0000400b, 0x00004016},
+ {0x0000a254, 0x00000898, 0x00001130},
+};
+
+static const u32 ar9462_2p0_baseband_postamble[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d},
+ {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae},
+ {0x00009824, 0x63c640de, 0x5ac640d0, 0x5ac640d0, 0x63c640da},
+ {0x00009828, 0x0796be89, 0x0696b081, 0x0696b881, 0x09143e81},
+ {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
+ {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
+ {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
+ {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a2},
+ {0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020},
+ {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000d8},
+ {0x00009e10, 0x92c88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec86d2e},
+ {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e},
+ {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
+ {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5},
+ {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
+ {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
+ {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
+ {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
+ {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
+ {0x0000a204, 0x01318fc0, 0x01318fc4, 0x01318fc4, 0x01318fc0},
+ {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
+ {0x0000a22c, 0x01026a2f, 0x01026a27, 0x01026a2f, 0x01026a2f},
+ {0x0000a230, 0x0000400a, 0x00004014, 0x00004016, 0x0000400b},
+ {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff},
+ {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
+ {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
+ {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
+ {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
+ {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
+ {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501},
+ {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
+ {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
+ {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150},
+ {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
+ {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
+ {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+ {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
+ {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
+ {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a3a4, 0x00000050, 0x00000050, 0x00000000, 0x00000000},
+ {0x0000a3a8, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa},
+ {0x0000a3ac, 0xaaaaaa00, 0xaa30aa30, 0xaaaaaa00, 0xaaaaaa00},
+ {0x0000a41c, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a420, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce},
+ {0x0000a424, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a428, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce},
+ {0x0000a42c, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a430, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
+ {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
+ {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
+ {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa},
+ {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
+};
+
+static const u32 ar9462_2p0_common_rx_gain[][2] = {
+ /* Addr allmodes */
+ {0x0000a000, 0x00010000},
+ {0x0000a004, 0x00030002},
+ {0x0000a008, 0x00050004},
+ {0x0000a00c, 0x00810080},
+ {0x0000a010, 0x00830082},
+ {0x0000a014, 0x01810180},
+ {0x0000a018, 0x01830182},
+ {0x0000a01c, 0x01850184},
+ {0x0000a020, 0x01890188},
+ {0x0000a024, 0x018b018a},
+ {0x0000a028, 0x018d018c},
+ {0x0000a02c, 0x01910190},
+ {0x0000a030, 0x01930192},
+ {0x0000a034, 0x01950194},
+ {0x0000a038, 0x038a0196},
+ {0x0000a03c, 0x038c038b},
+ {0x0000a040, 0x0390038d},
+ {0x0000a044, 0x03920391},
+ {0x0000a048, 0x03940393},
+ {0x0000a04c, 0x03960395},
+ {0x0000a050, 0x00000000},
+ {0x0000a054, 0x00000000},
+ {0x0000a058, 0x00000000},
+ {0x0000a05c, 0x00000000},
+ {0x0000a060, 0x00000000},
+ {0x0000a064, 0x00000000},
+ {0x0000a068, 0x00000000},
+ {0x0000a06c, 0x00000000},
+ {0x0000a070, 0x00000000},
+ {0x0000a074, 0x00000000},
+ {0x0000a078, 0x00000000},
+ {0x0000a07c, 0x00000000},
+ {0x0000a080, 0x22222229},
+ {0x0000a084, 0x1d1d1d1d},
+ {0x0000a088, 0x1d1d1d1d},
+ {0x0000a08c, 0x1d1d1d1d},
+ {0x0000a090, 0x171d1d1d},
+ {0x0000a094, 0x11111717},
+ {0x0000a098, 0x00030311},
+ {0x0000a09c, 0x00000000},
+ {0x0000a0a0, 0x00000000},
+ {0x0000a0a4, 0x00000000},
+ {0x0000a0a8, 0x00000000},
+ {0x0000a0ac, 0x00000000},
+ {0x0000a0b0, 0x00000000},
+ {0x0000a0b4, 0x00000000},
+ {0x0000a0b8, 0x00000000},
+ {0x0000a0bc, 0x00000000},
+ {0x0000a0c0, 0x001f0000},
+ {0x0000a0c4, 0x01000101},
+ {0x0000a0c8, 0x011e011f},
+ {0x0000a0cc, 0x011c011d},
+ {0x0000a0d0, 0x02030204},
+ {0x0000a0d4, 0x02010202},
+ {0x0000a0d8, 0x021f0200},
+ {0x0000a0dc, 0x0302021e},
+ {0x0000a0e0, 0x03000301},
+ {0x0000a0e4, 0x031e031f},
+ {0x0000a0e8, 0x0402031d},
+ {0x0000a0ec, 0x04000401},
+ {0x0000a0f0, 0x041e041f},
+ {0x0000a0f4, 0x0502041d},
+ {0x0000a0f8, 0x05000501},
+ {0x0000a0fc, 0x051e051f},
+ {0x0000a100, 0x06010602},
+ {0x0000a104, 0x061f0600},
+ {0x0000a108, 0x061d061e},
+ {0x0000a10c, 0x07020703},
+ {0x0000a110, 0x07000701},
+ {0x0000a114, 0x00000000},
+ {0x0000a118, 0x00000000},
+ {0x0000a11c, 0x00000000},
+ {0x0000a120, 0x00000000},
+ {0x0000a124, 0x00000000},
+ {0x0000a128, 0x00000000},
+ {0x0000a12c, 0x00000000},
+ {0x0000a130, 0x00000000},
+ {0x0000a134, 0x00000000},
+ {0x0000a138, 0x00000000},
+ {0x0000a13c, 0x00000000},
+ {0x0000a140, 0x001f0000},
+ {0x0000a144, 0x01000101},
+ {0x0000a148, 0x011e011f},
+ {0x0000a14c, 0x011c011d},
+ {0x0000a150, 0x02030204},
+ {0x0000a154, 0x02010202},
+ {0x0000a158, 0x021f0200},
+ {0x0000a15c, 0x0302021e},
+ {0x0000a160, 0x03000301},
+ {0x0000a164, 0x031e031f},
+ {0x0000a168, 0x0402031d},
+ {0x0000a16c, 0x04000401},
+ {0x0000a170, 0x041e041f},
+ {0x0000a174, 0x0502041d},
+ {0x0000a178, 0x05000501},
+ {0x0000a17c, 0x051e051f},
+ {0x0000a180, 0x06010602},
+ {0x0000a184, 0x061f0600},
+ {0x0000a188, 0x061d061e},
+ {0x0000a18c, 0x07020703},
+ {0x0000a190, 0x07000701},
+ {0x0000a194, 0x00000000},
+ {0x0000a198, 0x00000000},
+ {0x0000a19c, 0x00000000},
+ {0x0000a1a0, 0x00000000},
+ {0x0000a1a4, 0x00000000},
+ {0x0000a1a8, 0x00000000},
+ {0x0000a1ac, 0x00000000},
+ {0x0000a1b0, 0x00000000},
+ {0x0000a1b4, 0x00000000},
+ {0x0000a1b8, 0x00000000},
+ {0x0000a1bc, 0x00000000},
+ {0x0000a1c0, 0x00000000},
+ {0x0000a1c4, 0x00000000},
+ {0x0000a1c8, 0x00000000},
+ {0x0000a1cc, 0x00000000},
+ {0x0000a1d0, 0x00000000},
+ {0x0000a1d4, 0x00000000},
+ {0x0000a1d8, 0x00000000},
+ {0x0000a1dc, 0x00000000},
+ {0x0000a1e0, 0x00000000},
+ {0x0000a1e4, 0x00000000},
+ {0x0000a1e8, 0x00000000},
+ {0x0000a1ec, 0x00000000},
+ {0x0000a1f0, 0x00000396},
+ {0x0000a1f4, 0x00000396},
+ {0x0000a1f8, 0x00000396},
+ {0x0000a1fc, 0x00000196},
+ {0x0000b000, 0x00010000},
+ {0x0000b004, 0x00030002},
+ {0x0000b008, 0x00050004},
+ {0x0000b00c, 0x00810080},
+ {0x0000b010, 0x00830082},
+ {0x0000b014, 0x01810180},
+ {0x0000b018, 0x01830182},
+ {0x0000b01c, 0x01850184},
+ {0x0000b020, 0x02810280},
+ {0x0000b024, 0x02830282},
+ {0x0000b028, 0x02850284},
+ {0x0000b02c, 0x02890288},
+ {0x0000b030, 0x028b028a},
+ {0x0000b034, 0x0388028c},
+ {0x0000b038, 0x038a0389},
+ {0x0000b03c, 0x038c038b},
+ {0x0000b040, 0x0390038d},
+ {0x0000b044, 0x03920391},
+ {0x0000b048, 0x03940393},
+ {0x0000b04c, 0x03960395},
+ {0x0000b050, 0x00000000},
+ {0x0000b054, 0x00000000},
+ {0x0000b058, 0x00000000},
+ {0x0000b05c, 0x00000000},
+ {0x0000b060, 0x00000000},
+ {0x0000b064, 0x00000000},
+ {0x0000b068, 0x00000000},
+ {0x0000b06c, 0x00000000},
+ {0x0000b070, 0x00000000},
+ {0x0000b074, 0x00000000},
+ {0x0000b078, 0x00000000},
+ {0x0000b07c, 0x00000000},
+ {0x0000b080, 0x2a2d2f32},
+ {0x0000b084, 0x21232328},
+ {0x0000b088, 0x19191c1e},
+ {0x0000b08c, 0x12141417},
+ {0x0000b090, 0x07070e0e},
+ {0x0000b094, 0x03030305},
+ {0x0000b098, 0x00000003},
+ {0x0000b09c, 0x00000000},
+ {0x0000b0a0, 0x00000000},
+ {0x0000b0a4, 0x00000000},
+ {0x0000b0a8, 0x00000000},
+ {0x0000b0ac, 0x00000000},
+ {0x0000b0b0, 0x00000000},
+ {0x0000b0b4, 0x00000000},
+ {0x0000b0b8, 0x00000000},
+ {0x0000b0bc, 0x00000000},
+ {0x0000b0c0, 0x003f0020},
+ {0x0000b0c4, 0x00400041},
+ {0x0000b0c8, 0x0140005f},
+ {0x0000b0cc, 0x0160015f},
+ {0x0000b0d0, 0x017e017f},
+ {0x0000b0d4, 0x02410242},
+ {0x0000b0d8, 0x025f0240},
+ {0x0000b0dc, 0x027f0260},
+ {0x0000b0e0, 0x0341027e},
+ {0x0000b0e4, 0x035f0340},
+ {0x0000b0e8, 0x037f0360},
+ {0x0000b0ec, 0x04400441},
+ {0x0000b0f0, 0x0460045f},
+ {0x0000b0f4, 0x0541047f},
+ {0x0000b0f8, 0x055f0540},
+ {0x0000b0fc, 0x057f0560},
+ {0x0000b100, 0x06400641},
+ {0x0000b104, 0x0660065f},
+ {0x0000b108, 0x067e067f},
+ {0x0000b10c, 0x07410742},
+ {0x0000b110, 0x075f0740},
+ {0x0000b114, 0x077f0760},
+ {0x0000b118, 0x07800781},
+ {0x0000b11c, 0x07a0079f},
+ {0x0000b120, 0x07c107bf},
+ {0x0000b124, 0x000007c0},
+ {0x0000b128, 0x00000000},
+ {0x0000b12c, 0x00000000},
+ {0x0000b130, 0x00000000},
+ {0x0000b134, 0x00000000},
+ {0x0000b138, 0x00000000},
+ {0x0000b13c, 0x00000000},
+ {0x0000b140, 0x003f0020},
+ {0x0000b144, 0x00400041},
+ {0x0000b148, 0x0140005f},
+ {0x0000b14c, 0x0160015f},
+ {0x0000b150, 0x017e017f},
+ {0x0000b154, 0x02410242},
+ {0x0000b158, 0x025f0240},
+ {0x0000b15c, 0x027f0260},
+ {0x0000b160, 0x0341027e},
+ {0x0000b164, 0x035f0340},
+ {0x0000b168, 0x037f0360},
+ {0x0000b16c, 0x04400441},
+ {0x0000b170, 0x0460045f},
+ {0x0000b174, 0x0541047f},
+ {0x0000b178, 0x055f0540},
+ {0x0000b17c, 0x057f0560},
+ {0x0000b180, 0x06400641},
+ {0x0000b184, 0x0660065f},
+ {0x0000b188, 0x067e067f},
+ {0x0000b18c, 0x07410742},
+ {0x0000b190, 0x075f0740},
+ {0x0000b194, 0x077f0760},
+ {0x0000b198, 0x07800781},
+ {0x0000b19c, 0x07a0079f},
+ {0x0000b1a0, 0x07c107bf},
+ {0x0000b1a4, 0x000007c0},
+ {0x0000b1a8, 0x00000000},
+ {0x0000b1ac, 0x00000000},
+ {0x0000b1b0, 0x00000000},
+ {0x0000b1b4, 0x00000000},
+ {0x0000b1b8, 0x00000000},
+ {0x0000b1bc, 0x00000000},
+ {0x0000b1c0, 0x00000000},
+ {0x0000b1c4, 0x00000000},
+ {0x0000b1c8, 0x00000000},
+ {0x0000b1cc, 0x00000000},
+ {0x0000b1d0, 0x00000000},
+ {0x0000b1d4, 0x00000000},
+ {0x0000b1d8, 0x00000000},
+ {0x0000b1dc, 0x00000000},
+ {0x0000b1e0, 0x00000000},
+ {0x0000b1e4, 0x00000000},
+ {0x0000b1e8, 0x00000000},
+ {0x0000b1ec, 0x00000000},
+ {0x0000b1f0, 0x00000396},
+ {0x0000b1f4, 0x00000396},
+ {0x0000b1f8, 0x00000396},
+ {0x0000b1fc, 0x00000196},
+};
+
+static const u32 ar9462_2p0_pciephy_clkreq_disable_L1[][2] = {
+ /* Addr allmodes */
+ {0x00018c00, 0x18213ede},
+ {0x00018c04, 0x000801d8},
+ {0x00018c08, 0x0003780c},
+};
+
+static const u32 ar9462_2p0_radio_postamble_sys2ant[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x000160ac, 0xa4646c08, 0xa4646c08, 0x24645808, 0x24645808},
+ {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
+ {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
+};
+
+static const u32 ar9462_2p0_modes_low_ob_db_tx_gain[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
+ {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
+ {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
+ {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
+ {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
+ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
+ {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
+ {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
+ {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
+ {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
+ {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
+ {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402},
+ {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404},
+ {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
+ {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
+ {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
+ {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
+ {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
+ {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
+ {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
+ {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
+ {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
+ {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861},
+ {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81},
+ {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83},
+ {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84},
+ {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3},
+ {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5},
+ {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9},
+ {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb},
+ {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
+ {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
+ {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
+ {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
+ {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
+ {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
+ {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec},
+ {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a614, 0x01404000, 0x01404000, 0x01404000, 0x01404000},
+ {0x0000a618, 0x01404501, 0x01404501, 0x01404501, 0x01404501},
+ {0x0000a61c, 0x02008802, 0x02008802, 0x02008501, 0x02008501},
+ {0x0000a620, 0x0300cc03, 0x0300cc03, 0x0280ca03, 0x0280ca03},
+ {0x0000a624, 0x0300cc03, 0x0300cc03, 0x03010c04, 0x03010c04},
+ {0x0000a628, 0x0300cc03, 0x0300cc03, 0x04014c04, 0x04014c04},
+ {0x0000a62c, 0x03810c03, 0x03810c03, 0x04015005, 0x04015005},
+ {0x0000a630, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
+ {0x0000a634, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
+ {0x0000a638, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
+ {0x0000a63c, 0x03810e04, 0x03810e04, 0x04015005, 0x04015005},
+ {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
+ {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
+ {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
+ {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
+ {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
+ {0x00016048, 0x64992060, 0x64992060, 0x64992060, 0x64992060},
+ {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
+ {0x00016444, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4},
+ {0x00016448, 0x64992000, 0x64992000, 0x64992000, 0x64992000},
+ {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
+};
+
+static const u32 ar9462_2p0_soc_postamble[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x00007010, 0x00000033, 0x00000033, 0x00000033, 0x00000033},
+};
+
+static const u32 ar9462_2p0_baseband_core[][2] = {
+ /* Addr allmodes */
+ {0x00009800, 0xafe68e30},
+ {0x00009804, 0xfd14e000},
+ {0x00009808, 0x9c0a9f6b},
+ {0x0000980c, 0x04900000},
+ {0x00009814, 0x9280c00a},
+ {0x00009818, 0x00000000},
+ {0x0000981c, 0x00020028},
+ {0x00009834, 0x6400a290},
+ {0x00009838, 0x0108ecff},
+ {0x0000983c, 0x0d000600},
+ {0x00009880, 0x201fff00},
+ {0x00009884, 0x00001042},
+ {0x000098a4, 0x00200400},
+ {0x000098b0, 0x32440bbe},
+ {0x000098d0, 0x004b6a8e},
+ {0x000098d4, 0x00000820},
+ {0x000098dc, 0x00000000},
+ {0x000098e4, 0x01ffffff},
+ {0x000098e8, 0x01ffffff},
+ {0x000098ec, 0x01ffffff},
+ {0x000098f0, 0x00000000},
+ {0x000098f4, 0x00000000},
+ {0x00009bf0, 0x80000000},
+ {0x00009c04, 0xff55ff55},
+ {0x00009c08, 0x0320ff55},
+ {0x00009c0c, 0x00000000},
+ {0x00009c10, 0x00000000},
+ {0x00009c14, 0x00046384},
+ {0x00009c18, 0x05b6b440},
+ {0x00009c1c, 0x00b6b440},
+ {0x00009d00, 0xc080a333},
+ {0x00009d04, 0x40206c10},
+ {0x00009d08, 0x009c4060},
+ {0x00009d0c, 0x9883800a},
+ {0x00009d10, 0x01834061},
+ {0x00009d14, 0x00c0040b},
+ {0x00009d18, 0x00000000},
+ {0x00009e08, 0x0038230c},
+ {0x00009e24, 0x990bb515},
+ {0x00009e28, 0x0c6f0000},
+ {0x00009e30, 0x06336f77},
+ {0x00009e34, 0x6af6532f},
+ {0x00009e38, 0x0cc80c00},
+ {0x00009e40, 0x15262820},
+ {0x00009e4c, 0x00001004},
+ {0x00009e50, 0x00ff03f1},
+ {0x00009e54, 0xe4c555c2},
+ {0x00009e58, 0xfd857722},
+ {0x00009e5c, 0xe9198724},
+ {0x00009fc0, 0x803e4788},
+ {0x00009fc4, 0x0001efb5},
+ {0x00009fcc, 0x40000014},
+ {0x00009fd0, 0x0a193b93},
+ {0x0000a20c, 0x00000000},
+ {0x0000a220, 0x00000000},
+ {0x0000a224, 0x00000000},
+ {0x0000a228, 0x10002310},
+ {0x0000a23c, 0x00000000},
+ {0x0000a244, 0x0c000000},
+ {0x0000a2a0, 0x00000001},
+ {0x0000a2c0, 0x00000001},
+ {0x0000a2c8, 0x00000000},
+ {0x0000a2cc, 0x18c43433},
+ {0x0000a2d4, 0x00000000},
+ {0x0000a2ec, 0x00000000},
+ {0x0000a2f0, 0x00000000},
+ {0x0000a2f4, 0x00000000},
+ {0x0000a2f8, 0x00000000},
+ {0x0000a344, 0x00000000},
+ {0x0000a34c, 0x00000000},
+ {0x0000a350, 0x0000a000},
+ {0x0000a364, 0x00000000},
+ {0x0000a370, 0x00000000},
+ {0x0000a390, 0x00000001},
+ {0x0000a394, 0x00000444},
+ {0x0000a398, 0x001f0e0f},
+ {0x0000a39c, 0x0075393f},
+ {0x0000a3a0, 0xb79f6427},
+ {0x0000a3c0, 0x20202020},
+ {0x0000a3c4, 0x22222220},
+ {0x0000a3c8, 0x20200020},
+ {0x0000a3cc, 0x20202020},
+ {0x0000a3d0, 0x20202020},
+ {0x0000a3d4, 0x20202020},
+ {0x0000a3d8, 0x20202020},
+ {0x0000a3dc, 0x20202020},
+ {0x0000a3e0, 0x20202020},
+ {0x0000a3e4, 0x20202020},
+ {0x0000a3e8, 0x20202020},
+ {0x0000a3ec, 0x20202020},
+ {0x0000a3f0, 0x00000000},
+ {0x0000a3f4, 0x00000006},
+ {0x0000a3f8, 0x0c9bd380},
+ {0x0000a3fc, 0x000f0f01},
+ {0x0000a400, 0x8fa91f01},
+ {0x0000a404, 0x00000000},
+ {0x0000a408, 0x0e79e5c6},
+ {0x0000a40c, 0x00820820},
+ {0x0000a414, 0x1ce739ce},
+ {0x0000a418, 0x2d001dce},
+ {0x0000a434, 0x00000000},
+ {0x0000a438, 0x00001801},
+ {0x0000a43c, 0x00100000},
+ {0x0000a444, 0x00000000},
+ {0x0000a448, 0x05000080},
+ {0x0000a44c, 0x00000001},
+ {0x0000a450, 0x00010000},
+ {0x0000a454, 0x07000000},
+ {0x0000a644, 0xbfad9d74},
+ {0x0000a648, 0x0048060a},
+ {0x0000a64c, 0x00002037},
+ {0x0000a670, 0x03020100},
+ {0x0000a674, 0x09080504},
+ {0x0000a678, 0x0d0c0b0a},
+ {0x0000a67c, 0x13121110},
+ {0x0000a680, 0x31301514},
+ {0x0000a684, 0x35343332},
+ {0x0000a688, 0x00000036},
+ {0x0000a690, 0x00000838},
+ {0x0000a6b0, 0x0000000a},
+ {0x0000a6b4, 0x00512c01},
+ {0x0000a7c0, 0x00000000},
+ {0x0000a7c4, 0xfffffffc},
+ {0x0000a7c8, 0x00000000},
+ {0x0000a7cc, 0x00000000},
+ {0x0000a7d0, 0x00000000},
+ {0x0000a7d4, 0x00000004},
+ {0x0000a7dc, 0x00000000},
+ {0x0000a7f0, 0x80000000},
+ {0x0000a8d0, 0x004b6a8e},
+ {0x0000a8d4, 0x00000820},
+ {0x0000a8dc, 0x00000000},
+ {0x0000a8f0, 0x00000000},
+ {0x0000a8f4, 0x00000000},
+ {0x0000abf0, 0x80000000},
+ {0x0000b2d0, 0x00000080},
+ {0x0000b2d4, 0x00000000},
+ {0x0000b2ec, 0x00000000},
+ {0x0000b2f0, 0x00000000},
+ {0x0000b2f4, 0x00000000},
+ {0x0000b2f8, 0x00000000},
+ {0x0000b408, 0x0e79e5c0},
+ {0x0000b40c, 0x00820820},
+ {0x0000b420, 0x00000000},
+ {0x0000b6b0, 0x0000000a},
+ {0x0000b6b4, 0x00000001},
+};
+
+static const u32 ar9462_2p0_radio_postamble[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524},
+ {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70},
+ {0x0001610c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
+ {0x0001650c, 0x48000000, 0x40000000, 0x40000000, 0x40000000},
+};
+
+static const u32 ar9462_2p0_modes_mix_ob_db_tx_gain[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
+ {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
+ {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
+ {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
+ {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
+ {0x0000a410, 0x0000d0da, 0x0000d0da, 0x0000d0de, 0x0000d0de},
+ {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
+ {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
+ {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
+ {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
+ {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
+ {0x0000a514, 0x18022622, 0x18022622, 0x12000400, 0x12000400},
+ {0x0000a518, 0x1b022822, 0x1b022822, 0x16000402, 0x16000402},
+ {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
+ {0x0000a520, 0x22022c41, 0x22022c41, 0x1c000603, 0x1c000603},
+ {0x0000a524, 0x28023042, 0x28023042, 0x21000a02, 0x21000a02},
+ {0x0000a528, 0x2c023044, 0x2c023044, 0x25000a04, 0x25000a04},
+ {0x0000a52c, 0x2f023644, 0x2f023644, 0x28000a20, 0x28000a20},
+ {0x0000a530, 0x34025643, 0x34025643, 0x2c000e20, 0x2c000e20},
+ {0x0000a534, 0x38025a44, 0x38025a44, 0x30000e22, 0x30000e22},
+ {0x0000a538, 0x3b025e45, 0x3b025e45, 0x34000e24, 0x34000e24},
+ {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x38001640, 0x38001640},
+ {0x0000a540, 0x48025e6c, 0x48025e6c, 0x3c001660, 0x3c001660},
+ {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3f001861, 0x3f001861},
+ {0x0000a548, 0x55025eb3, 0x55025eb3, 0x43001a81, 0x43001a81},
+ {0x0000a54c, 0x58025ef3, 0x58025ef3, 0x47001a83, 0x47001a83},
+ {0x0000a550, 0x5d025ef6, 0x5d025ef6, 0x4a001c84, 0x4a001c84},
+ {0x0000a554, 0x62025f56, 0x62025f56, 0x4e001ce3, 0x4e001ce3},
+ {0x0000a558, 0x66027f56, 0x66027f56, 0x52001ce5, 0x52001ce5},
+ {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x56001ce9, 0x56001ce9},
+ {0x0000a560, 0x70049f56, 0x70049f56, 0x5a001ceb, 0x5a001ceb},
+ {0x0000a564, 0x751ffff6, 0x751ffff6, 0x5c001eec, 0x5c001eec},
+ {0x0000a568, 0x751ffff6, 0x751ffff6, 0x5e001ef0, 0x5e001ef0},
+ {0x0000a56c, 0x751ffff6, 0x751ffff6, 0x60001ef4, 0x60001ef4},
+ {0x0000a570, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
+ {0x0000a574, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
+ {0x0000a578, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
+ {0x0000a57c, 0x751ffff6, 0x751ffff6, 0x62001ff6, 0x62001ff6},
+ {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
+ {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
+ {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
+ {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
+ {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
+ {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
+ {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
+ {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
+ {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
+ {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
+ {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
+};
+
+static const u32 ar9462_2p0_modes_high_ob_db_tx_gain[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x000098bc, 0x00000002, 0x00000002, 0x00000002, 0x00000002},
+ {0x0000a2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
+ {0x0000a2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
+ {0x0000a2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
+ {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
+ {0x0000a410, 0x000050da, 0x000050da, 0x000050de, 0x000050de},
+ {0x0000a458, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
+ {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002},
+ {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004},
+ {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200},
+ {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202},
+ {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400},
+ {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402},
+ {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404},
+ {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603},
+ {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02},
+ {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04},
+ {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20},
+ {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20},
+ {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22},
+ {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24},
+ {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640},
+ {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660},
+ {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861},
+ {0x0000a548, 0x55025eb3, 0x55025eb3, 0x3e001a81, 0x3e001a81},
+ {0x0000a54c, 0x58025ef3, 0x58025ef3, 0x42001a83, 0x42001a83},
+ {0x0000a550, 0x5d025ef6, 0x5d025ef6, 0x44001a84, 0x44001a84},
+ {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3},
+ {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5},
+ {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9},
+ {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb},
+ {0x0000a564, 0x751ffff6, 0x751ffff6, 0x56001eec, 0x56001eec},
+ {0x0000a568, 0x751ffff6, 0x751ffff6, 0x58001ef0, 0x58001ef0},
+ {0x0000a56c, 0x751ffff6, 0x751ffff6, 0x5a001ef4, 0x5a001ef4},
+ {0x0000a570, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
+ {0x0000a574, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
+ {0x0000a578, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
+ {0x0000a57c, 0x751ffff6, 0x751ffff6, 0x5c001ff6, 0x5c001ff6},
+ {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
+ {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
+ {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
+ {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
+ {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
+ {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
+ {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
+ {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
+ {0x0000b2dc, 0x01feee00, 0x01feee00, 0x03aaa352, 0x03aaa352},
+ {0x0000b2e0, 0x0000f000, 0x0000f000, 0x03ccc584, 0x03ccc584},
+ {0x0000b2e4, 0x01ff0000, 0x01ff0000, 0x03f0f800, 0x03f0f800},
+ {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
+ {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
+ {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060},
+ {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
+ {0x00016444, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4},
+ {0x00016448, 0x8db49000, 0x8db49000, 0x8db49000, 0x8db49000},
+ {0x00016454, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000},
+};
+
+static const u32 ar9462_2p0_radio_core[][2] = {
+ /* Addr allmodes */
+ {0x00016000, 0x36db6db6},
+ {0x00016004, 0x6db6db40},
+ {0x00016008, 0x73f00000},
+ {0x0001600c, 0x00000000},
+ {0x00016010, 0x6d820001},
+ {0x00016040, 0x7f80fff8},
+ {0x0001604c, 0x2699e04f},
+ {0x00016050, 0x6db6db6c},
+ {0x00016058, 0x6c200000},
+ {0x00016080, 0x000c0000},
+ {0x00016084, 0x9a68048c},
+ {0x00016088, 0x54214514},
+ {0x0001608c, 0x1203040b},
+ {0x00016090, 0x24926490},
+ {0x00016098, 0xd2888888},
+ {0x000160a0, 0x0a108ffe},
+ {0x000160a4, 0x812fc491},
+ {0x000160a8, 0x423c8000},
+ {0x000160b4, 0x92000000},
+ {0x000160b8, 0x0285dddc},
+ {0x000160bc, 0x02908888},
+ {0x000160c0, 0x00adb6d0},
+ {0x000160c4, 0x6db6db60},
+ {0x000160c8, 0x6db6db6c},
+ {0x000160cc, 0x0de6c1b0},
+ {0x00016100, 0x3fffbe04},
+ {0x00016104, 0xfff80000},
+ {0x00016108, 0x00200400},
+ {0x00016110, 0x00000000},
+ {0x00016144, 0x02084080},
+ {0x00016148, 0x000080c0},
+ {0x00016280, 0x050a0001},
+ {0x00016284, 0x3d841418},
+ {0x00016288, 0x00000000},
+ {0x0001628c, 0xe3000000},
+ {0x00016290, 0xa1005080},
+ {0x00016294, 0x00000020},
+ {0x00016298, 0x54a82900},
+ {0x00016340, 0x121e4276},
+ {0x00016344, 0x00300000},
+ {0x00016400, 0x36db6db6},
+ {0x00016404, 0x6db6db40},
+ {0x00016408, 0x73f00000},
+ {0x0001640c, 0x00000000},
+ {0x00016410, 0x6c800001},
+ {0x00016440, 0x7f80fff8},
+ {0x0001644c, 0x4699e04f},
+ {0x00016450, 0x6db6db6c},
+ {0x00016500, 0x3fffbe04},
+ {0x00016504, 0xfff80000},
+ {0x00016508, 0x00200400},
+ {0x00016510, 0x00000000},
+ {0x00016544, 0x02084080},
+ {0x00016548, 0x000080c0},
+};
+
+static const u32 ar9462_2p0_soc_preamble[][2] = {
+ /* Addr allmodes */
+ {0x000040a4, 0x00a0c1c9},
+ {0x00007020, 0x00000000},
+ {0x00007034, 0x00000002},
+ {0x00007038, 0x000004c2},
+};
+
+static const u32 ar9462_2p0_mac_core[][2] = {
+ /* Addr allmodes */
+ {0x00000008, 0x00000000},
+ {0x00000030, 0x000e0085},
+ {0x00000034, 0x00000005},
+ {0x00000040, 0x00000000},
+ {0x00000044, 0x00000000},
+ {0x00000048, 0x00000008},
+ {0x0000004c, 0x00000010},
+ {0x00000050, 0x00000000},
+ {0x00001040, 0x002ffc0f},
+ {0x00001044, 0x002ffc0f},
+ {0x00001048, 0x002ffc0f},
+ {0x0000104c, 0x002ffc0f},
+ {0x00001050, 0x002ffc0f},
+ {0x00001054, 0x002ffc0f},
+ {0x00001058, 0x002ffc0f},
+ {0x0000105c, 0x002ffc0f},
+ {0x00001060, 0x002ffc0f},
+ {0x00001064, 0x002ffc0f},
+ {0x000010f0, 0x00000100},
+ {0x00001270, 0x00000000},
+ {0x000012b0, 0x00000000},
+ {0x000012f0, 0x00000000},
+ {0x0000143c, 0x00000000},
+ {0x0000147c, 0x00000000},
+ {0x00001810, 0x0f000003},
+ {0x00008000, 0x00000000},
+ {0x00008004, 0x00000000},
+ {0x00008008, 0x00000000},
+ {0x0000800c, 0x00000000},
+ {0x00008018, 0x00000000},
+ {0x00008020, 0x00000000},
+ {0x00008038, 0x00000000},
+ {0x0000803c, 0x00080000},
+ {0x00008040, 0x00000000},
+ {0x00008044, 0x00000000},
+ {0x00008048, 0x00000000},
+ {0x0000804c, 0xffffffff},
+ {0x00008054, 0x00000000},
+ {0x00008058, 0x00000000},
+ {0x0000805c, 0x000fc78f},
+ {0x00008060, 0x0000000f},
+ {0x00008064, 0x00000000},
+ {0x00008070, 0x00000310},
+ {0x00008074, 0x00000020},
+ {0x00008078, 0x00000000},
+ {0x0000809c, 0x0000000f},
+ {0x000080a0, 0x00000000},
+ {0x000080a4, 0x02ff0000},
+ {0x000080a8, 0x0e070605},
+ {0x000080ac, 0x0000000d},
+ {0x000080b0, 0x00000000},
+ {0x000080b4, 0x00000000},
+ {0x000080b8, 0x00000000},
+ {0x000080bc, 0x00000000},
+ {0x000080c0, 0x2a800000},
+ {0x000080c4, 0x06900168},
+ {0x000080c8, 0x13881c20},
+ {0x000080cc, 0x01f40000},
+ {0x000080d0, 0x00252500},
+ {0x000080d4, 0x00b00005},
+ {0x000080d8, 0x00400002},
+ {0x000080dc, 0x00000000},
+ {0x000080e0, 0xffffffff},
+ {0x000080e4, 0x0000ffff},
+ {0x000080e8, 0x3f3f3f3f},
+ {0x000080ec, 0x00000000},
+ {0x000080f0, 0x00000000},
+ {0x000080f4, 0x00000000},
+ {0x000080fc, 0x00020000},
+ {0x00008100, 0x00000000},
+ {0x00008108, 0x00000052},
+ {0x0000810c, 0x00000000},
+ {0x00008110, 0x00000000},
+ {0x00008114, 0x000007ff},
+ {0x00008118, 0x000000aa},
+ {0x0000811c, 0x00003210},
+ {0x00008124, 0x00000000},
+ {0x00008128, 0x00000000},
+ {0x0000812c, 0x00000000},
+ {0x00008130, 0x00000000},
+ {0x00008134, 0x00000000},
+ {0x00008138, 0x00000000},
+ {0x0000813c, 0x0000ffff},
+ {0x00008144, 0xffffffff},
+ {0x00008168, 0x00000000},
+ {0x0000816c, 0x00000000},
+ {0x00008170, 0x18486e00},
+ {0x00008174, 0x33332210},
+ {0x00008178, 0x00000000},
+ {0x0000817c, 0x00020000},
+ {0x000081c4, 0x33332210},
+ {0x000081c8, 0x00000000},
+ {0x000081cc, 0x00000000},
+ {0x000081d4, 0x00000000},
+ {0x000081ec, 0x00000000},
+ {0x000081f0, 0x00000000},
+ {0x000081f4, 0x00000000},
+ {0x000081f8, 0x00000000},
+ {0x000081fc, 0x00000000},
+ {0x00008240, 0x00100000},
+ {0x00008244, 0x0010f400},
+ {0x00008248, 0x00000800},
+ {0x0000824c, 0x0001e800},
+ {0x00008250, 0x00000000},
+ {0x00008254, 0x00000000},
+ {0x00008258, 0x00000000},
+ {0x0000825c, 0x40000000},
+ {0x00008260, 0x00080922},
+ {0x00008264, 0x99c00010},
+ {0x00008268, 0xffffffff},
+ {0x0000826c, 0x0000ffff},
+ {0x00008270, 0x00000000},
+ {0x00008274, 0x40000000},
+ {0x00008278, 0x003e4180},
+ {0x0000827c, 0x00000004},
+ {0x00008284, 0x0000002c},
+ {0x00008288, 0x0000002c},
+ {0x0000828c, 0x000000ff},
+ {0x00008294, 0x00000000},
+ {0x00008298, 0x00000000},
+ {0x0000829c, 0x00000000},
+ {0x00008300, 0x00000140},
+ {0x00008314, 0x00000000},
+ {0x0000831c, 0x0000010d},
+ {0x00008328, 0x00000000},
+ {0x0000832c, 0x0000001f},
+ {0x00008330, 0x00000302},
+ {0x00008334, 0x00000700},
+ {0x00008338, 0xffff0000},
+ {0x0000833c, 0x02400000},
+ {0x00008340, 0x000107ff},
+ {0x00008344, 0xaa48105b},
+ {0x00008348, 0x008f0000},
+ {0x0000835c, 0x00000000},
+ {0x00008360, 0xffffffff},
+ {0x00008364, 0xffffffff},
+ {0x00008368, 0x00000000},
+ {0x00008370, 0x00000000},
+ {0x00008374, 0x000000ff},
+ {0x00008378, 0x00000000},
+ {0x0000837c, 0x00000000},
+ {0x00008380, 0xffffffff},
+ {0x00008384, 0xffffffff},
+ {0x00008390, 0xffffffff},
+ {0x00008394, 0xffffffff},
+ {0x00008398, 0x00000000},
+ {0x0000839c, 0x00000000},
+ {0x000083a4, 0x0000fa14},
+ {0x000083a8, 0x000f0c00},
+ {0x000083ac, 0x33332210},
+ {0x000083b0, 0x33332210},
+ {0x000083b4, 0x33332210},
+ {0x000083b8, 0x33332210},
+ {0x000083bc, 0x00000000},
+ {0x000083c0, 0x00000000},
+ {0x000083c4, 0x00000000},
+ {0x000083c8, 0x00000000},
+ {0x000083cc, 0x00000200},
+ {0x000083d0, 0x000301ff},
+};
+
+static const u32 ar9462_2p0_common_mixed_rx_gain[][2] = {
+ /* Addr allmodes */
+ {0x0000a000, 0x00010000},
+ {0x0000a004, 0x00030002},
+ {0x0000a008, 0x00050004},
+ {0x0000a00c, 0x00810080},
+ {0x0000a010, 0x00830082},
+ {0x0000a014, 0x01810180},
+ {0x0000a018, 0x01830182},
+ {0x0000a01c, 0x01850184},
+ {0x0000a020, 0x01890188},
+ {0x0000a024, 0x018b018a},
+ {0x0000a028, 0x018d018c},
+ {0x0000a02c, 0x03820190},
+ {0x0000a030, 0x03840383},
+ {0x0000a034, 0x03880385},
+ {0x0000a038, 0x038a0389},
+ {0x0000a03c, 0x038c038b},
+ {0x0000a040, 0x0390038d},
+ {0x0000a044, 0x03920391},
+ {0x0000a048, 0x03940393},
+ {0x0000a04c, 0x03960395},
+ {0x0000a050, 0x00000000},
+ {0x0000a054, 0x00000000},
+ {0x0000a058, 0x00000000},
+ {0x0000a05c, 0x00000000},
+ {0x0000a060, 0x00000000},
+ {0x0000a064, 0x00000000},
+ {0x0000a068, 0x00000000},
+ {0x0000a06c, 0x00000000},
+ {0x0000a070, 0x00000000},
+ {0x0000a074, 0x00000000},
+ {0x0000a078, 0x00000000},
+ {0x0000a07c, 0x00000000},
+ {0x0000a080, 0x29292929},
+ {0x0000a084, 0x29292929},
+ {0x0000a088, 0x29292929},
+ {0x0000a08c, 0x29292929},
+ {0x0000a090, 0x22292929},
+ {0x0000a094, 0x1d1d2222},
+ {0x0000a098, 0x0c111117},
+ {0x0000a09c, 0x00030303},
+ {0x0000a0a0, 0x00000000},
+ {0x0000a0a4, 0x00000000},
+ {0x0000a0a8, 0x00000000},
+ {0x0000a0ac, 0x00000000},
+ {0x0000a0b0, 0x00000000},
+ {0x0000a0b4, 0x00000000},
+ {0x0000a0b8, 0x00000000},
+ {0x0000a0bc, 0x00000000},
+ {0x0000a0c0, 0x001f0000},
+ {0x0000a0c4, 0x01000101},
+ {0x0000a0c8, 0x011e011f},
+ {0x0000a0cc, 0x011c011d},
+ {0x0000a0d0, 0x02030204},
+ {0x0000a0d4, 0x02010202},
+ {0x0000a0d8, 0x021f0200},
+ {0x0000a0dc, 0x0302021e},
+ {0x0000a0e0, 0x03000301},
+ {0x0000a0e4, 0x031e031f},
+ {0x0000a0e8, 0x0402031d},
+ {0x0000a0ec, 0x04000401},
+ {0x0000a0f0, 0x041e041f},
+ {0x0000a0f4, 0x0502041d},
+ {0x0000a0f8, 0x05000501},
+ {0x0000a0fc, 0x051e051f},
+ {0x0000a100, 0x06010602},
+ {0x0000a104, 0x061f0600},
+ {0x0000a108, 0x061d061e},
+ {0x0000a10c, 0x07020703},
+ {0x0000a110, 0x07000701},
+ {0x0000a114, 0x00000000},
+ {0x0000a118, 0x00000000},
+ {0x0000a11c, 0x00000000},
+ {0x0000a120, 0x00000000},
+ {0x0000a124, 0x00000000},
+ {0x0000a128, 0x00000000},
+ {0x0000a12c, 0x00000000},
+ {0x0000a130, 0x00000000},
+ {0x0000a134, 0x00000000},
+ {0x0000a138, 0x00000000},
+ {0x0000a13c, 0x00000000},
+ {0x0000a140, 0x001f0000},
+ {0x0000a144, 0x01000101},
+ {0x0000a148, 0x011e011f},
+ {0x0000a14c, 0x011c011d},
+ {0x0000a150, 0x02030204},
+ {0x0000a154, 0x02010202},
+ {0x0000a158, 0x021f0200},
+ {0x0000a15c, 0x0302021e},
+ {0x0000a160, 0x03000301},
+ {0x0000a164, 0x031e031f},
+ {0x0000a168, 0x0402031d},
+ {0x0000a16c, 0x04000401},
+ {0x0000a170, 0x041e041f},
+ {0x0000a174, 0x0502041d},
+ {0x0000a178, 0x05000501},
+ {0x0000a17c, 0x051e051f},
+ {0x0000a180, 0x06010602},
+ {0x0000a184, 0x061f0600},
+ {0x0000a188, 0x061d061e},
+ {0x0000a18c, 0x07020703},
+ {0x0000a190, 0x07000701},
+ {0x0000a194, 0x00000000},
+ {0x0000a198, 0x00000000},
+ {0x0000a19c, 0x00000000},
+ {0x0000a1a0, 0x00000000},
+ {0x0000a1a4, 0x00000000},
+ {0x0000a1a8, 0x00000000},
+ {0x0000a1ac, 0x00000000},
+ {0x0000a1b0, 0x00000000},
+ {0x0000a1b4, 0x00000000},
+ {0x0000a1b8, 0x00000000},
+ {0x0000a1bc, 0x00000000},
+ {0x0000a1c0, 0x00000000},
+ {0x0000a1c4, 0x00000000},
+ {0x0000a1c8, 0x00000000},
+ {0x0000a1cc, 0x00000000},
+ {0x0000a1d0, 0x00000000},
+ {0x0000a1d4, 0x00000000},
+ {0x0000a1d8, 0x00000000},
+ {0x0000a1dc, 0x00000000},
+ {0x0000a1e0, 0x00000000},
+ {0x0000a1e4, 0x00000000},
+ {0x0000a1e8, 0x00000000},
+ {0x0000a1ec, 0x00000000},
+ {0x0000a1f0, 0x00000396},
+ {0x0000a1f4, 0x00000396},
+ {0x0000a1f8, 0x00000396},
+ {0x0000a1fc, 0x00000196},
+ {0x0000b000, 0x00010000},
+ {0x0000b004, 0x00030002},
+ {0x0000b008, 0x00050004},
+ {0x0000b00c, 0x00810080},
+ {0x0000b010, 0x00830082},
+ {0x0000b014, 0x01810180},
+ {0x0000b018, 0x01830182},
+ {0x0000b01c, 0x01850184},
+ {0x0000b020, 0x02810280},
+ {0x0000b024, 0x02830282},
+ {0x0000b028, 0x02850284},
+ {0x0000b02c, 0x02890288},
+ {0x0000b030, 0x028b028a},
+ {0x0000b034, 0x0388028c},
+ {0x0000b038, 0x038a0389},
+ {0x0000b03c, 0x038c038b},
+ {0x0000b040, 0x0390038d},
+ {0x0000b044, 0x03920391},
+ {0x0000b048, 0x03940393},
+ {0x0000b04c, 0x03960395},
+ {0x0000b050, 0x00000000},
+ {0x0000b054, 0x00000000},
+ {0x0000b058, 0x00000000},
+ {0x0000b05c, 0x00000000},
+ {0x0000b060, 0x00000000},
+ {0x0000b064, 0x00000000},
+ {0x0000b068, 0x00000000},
+ {0x0000b06c, 0x00000000},
+ {0x0000b070, 0x00000000},
+ {0x0000b074, 0x00000000},
+ {0x0000b078, 0x00000000},
+ {0x0000b07c, 0x00000000},
+ {0x0000b080, 0x2a2d2f32},
+ {0x0000b084, 0x21232328},
+ {0x0000b088, 0x19191c1e},
+ {0x0000b08c, 0x12141417},
+ {0x0000b090, 0x07070e0e},
+ {0x0000b094, 0x03030305},
+ {0x0000b098, 0x00000003},
+ {0x0000b09c, 0x00000000},
+ {0x0000b0a0, 0x00000000},
+ {0x0000b0a4, 0x00000000},
+ {0x0000b0a8, 0x00000000},
+ {0x0000b0ac, 0x00000000},
+ {0x0000b0b0, 0x00000000},
+ {0x0000b0b4, 0x00000000},
+ {0x0000b0b8, 0x00000000},
+ {0x0000b0bc, 0x00000000},
+ {0x0000b0c0, 0x003f0020},
+ {0x0000b0c4, 0x00400041},
+ {0x0000b0c8, 0x0140005f},
+ {0x0000b0cc, 0x0160015f},
+ {0x0000b0d0, 0x017e017f},
+ {0x0000b0d4, 0x02410242},
+ {0x0000b0d8, 0x025f0240},
+ {0x0000b0dc, 0x027f0260},
+ {0x0000b0e0, 0x0341027e},
+ {0x0000b0e4, 0x035f0340},
+ {0x0000b0e8, 0x037f0360},
+ {0x0000b0ec, 0x04400441},
+ {0x0000b0f0, 0x0460045f},
+ {0x0000b0f4, 0x0541047f},
+ {0x0000b0f8, 0x055f0540},
+ {0x0000b0fc, 0x057f0560},
+ {0x0000b100, 0x06400641},
+ {0x0000b104, 0x0660065f},
+ {0x0000b108, 0x067e067f},
+ {0x0000b10c, 0x07410742},
+ {0x0000b110, 0x075f0740},
+ {0x0000b114, 0x077f0760},
+ {0x0000b118, 0x07800781},
+ {0x0000b11c, 0x07a0079f},
+ {0x0000b120, 0x07c107bf},
+ {0x0000b124, 0x000007c0},
+ {0x0000b128, 0x00000000},
+ {0x0000b12c, 0x00000000},
+ {0x0000b130, 0x00000000},
+ {0x0000b134, 0x00000000},
+ {0x0000b138, 0x00000000},
+ {0x0000b13c, 0x00000000},
+ {0x0000b140, 0x003f0020},
+ {0x0000b144, 0x00400041},
+ {0x0000b148, 0x0140005f},
+ {0x0000b14c, 0x0160015f},
+ {0x0000b150, 0x017e017f},
+ {0x0000b154, 0x02410242},
+ {0x0000b158, 0x025f0240},
+ {0x0000b15c, 0x027f0260},
+ {0x0000b160, 0x0341027e},
+ {0x0000b164, 0x035f0340},
+ {0x0000b168, 0x037f0360},
+ {0x0000b16c, 0x04400441},
+ {0x0000b170, 0x0460045f},
+ {0x0000b174, 0x0541047f},
+ {0x0000b178, 0x055f0540},
+ {0x0000b17c, 0x057f0560},
+ {0x0000b180, 0x06400641},
+ {0x0000b184, 0x0660065f},
+ {0x0000b188, 0x067e067f},
+ {0x0000b18c, 0x07410742},
+ {0x0000b190, 0x075f0740},
+ {0x0000b194, 0x077f0760},
+ {0x0000b198, 0x07800781},
+ {0x0000b19c, 0x07a0079f},
+ {0x0000b1a0, 0x07c107bf},
+ {0x0000b1a4, 0x000007c0},
+ {0x0000b1a8, 0x00000000},
+ {0x0000b1ac, 0x00000000},
+ {0x0000b1b0, 0x00000000},
+ {0x0000b1b4, 0x00000000},
+ {0x0000b1b8, 0x00000000},
+ {0x0000b1bc, 0x00000000},
+ {0x0000b1c0, 0x00000000},
+ {0x0000b1c4, 0x00000000},
+ {0x0000b1c8, 0x00000000},
+ {0x0000b1cc, 0x00000000},
+ {0x0000b1d0, 0x00000000},
+ {0x0000b1d4, 0x00000000},
+ {0x0000b1d8, 0x00000000},
+ {0x0000b1dc, 0x00000000},
+ {0x0000b1e0, 0x00000000},
+ {0x0000b1e4, 0x00000000},
+ {0x0000b1e8, 0x00000000},
+ {0x0000b1ec, 0x00000000},
+ {0x0000b1f0, 0x00000396},
+ {0x0000b1f4, 0x00000396},
+ {0x0000b1f8, 0x00000396},
+ {0x0000b1fc, 0x00000196},
+};
+
+static const u32 ar9462_2p0_baseband_postamble_5g_xlna[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
+};
+
+static const u32 ar9462_2p0_baseband_core_mix_rxgain[][2] = {
+ /* Addr allmodes */
+ {0x00009fd0, 0x0a2d6b93},
+};
+
+static const u32 ar9462_2p0_baseband_postamble_mix_rxgain[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x00009820, 0x206a022e, 0x206a022e, 0x206a01ae, 0x206a01ae},
+ {0x00009824, 0x63c640de, 0x5ac640d0, 0x63c640da, 0x63c640da},
+ {0x00009828, 0x0796be89, 0x0696b081, 0x0916be81, 0x0916be81},
+ {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000d8, 0x6c4000d8},
+ {0x00009e10, 0x92c88d2e, 0x7ec88d2e, 0x7ec86d2e, 0x7ec86d2e},
+ {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32395c5e},
+};
+
+#endif /* INITVALS_9462_2P0_H */
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p1_initvals.h b/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p1_initvals.h
new file mode 100644
index 0000000..f64118f
--- /dev/null
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9462_2p1_initvals.h
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 2010-2011 Atheros Communications Inc.
+ * Copyright (c) 2011-2012 Qualcomm Atheros Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef INITVALS_9462_2P1_H
+#define INITVALS_9462_2P1_H
+
+/* AR9462 2.1 */
+
+#define ar9462_2p1_mac_postamble ar9462_2p0_mac_postamble
+
+#define ar9462_2p1_baseband_core ar9462_2p0_baseband_core
+
+#define ar9462_2p1_radio_core ar9462_2p0_radio_core
+
+#define ar9462_2p1_radio_postamble ar9462_2p0_radio_postamble
+
+#define ar9462_2p1_soc_postamble ar9462_2p0_soc_postamble
+
+#define ar9462_2p1_radio_postamble_sys2ant ar9462_2p0_radio_postamble_sys2ant
+
+#define ar9462_2p1_common_rx_gain ar9462_2p0_common_rx_gain
+
+#define ar9462_2p1_common_mixed_rx_gain ar9462_2p0_common_mixed_rx_gain
+
+#define ar9462_2p1_common_5g_xlna_only_rxgain ar9462_2p0_common_5g_xlna_only_rxgain
+
+#define ar9462_2p1_baseband_core_mix_rxgain ar9462_2p0_baseband_core_mix_rxgain
+
+#define ar9462_2p1_baseband_postamble_mix_rxgain ar9462_2p0_baseband_postamble_mix_rxgain
+
+#define ar9462_2p1_baseband_postamble_5g_xlna ar9462_2p0_baseband_postamble_5g_xlna
+
+#define ar9462_2p1_common_wo_xlna_rx_gain ar9462_2p0_common_wo_xlna_rx_gain
+
+#define ar9462_2p1_modes_low_ob_db_tx_gain ar9462_2p0_modes_low_ob_db_tx_gain
+
+#define ar9462_2p1_modes_high_ob_db_tx_gain ar9462_2p0_modes_high_ob_db_tx_gain
+
+#define ar9462_2p1_modes_mix_ob_db_tx_gain ar9462_2p0_modes_mix_ob_db_tx_gain
+
+#define ar9462_2p1_modes_fast_clock ar9462_2p0_modes_fast_clock
+
+#define ar9462_2p1_baseband_core_txfir_coeff_japan_2484 ar9462_2p0_baseband_core_txfir_coeff_japan_2484
+
+#define ar9462_2p1_pciephy_clkreq_disable_L1 ar9462_2p0_pciephy_clkreq_disable_L1
+
+static const uint32_t ar9462_2p1_mac_core[][2] = {
+ /* Addr allmodes */
+ {0x00000008, 0x00000000},
+ {0x00000030, 0x000e0085},
+ {0x00000034, 0x00000005},
+ {0x00000040, 0x00000000},
+ {0x00000044, 0x00000000},
+ {0x00000048, 0x00000008},
+ {0x0000004c, 0x00000010},
+ {0x00000050, 0x00000000},
+ {0x00001040, 0x002ffc0f},
+ {0x00001044, 0x002ffc0f},
+ {0x00001048, 0x002ffc0f},
+ {0x0000104c, 0x002ffc0f},
+ {0x00001050, 0x002ffc0f},
+ {0x00001054, 0x002ffc0f},
+ {0x00001058, 0x002ffc0f},
+ {0x0000105c, 0x002ffc0f},
+ {0x00001060, 0x002ffc0f},
+ {0x00001064, 0x002ffc0f},
+ {0x000010f0, 0x00000100},
+ {0x00001270, 0x00000000},
+ {0x000012b0, 0x00000000},
+ {0x000012f0, 0x00000000},
+ {0x0000143c, 0x00000000},
+ {0x0000147c, 0x00000000},
+ {0x00001810, 0x0f000003},
+ {0x00008000, 0x00000000},
+ {0x00008004, 0x00000000},
+ {0x00008008, 0x00000000},
+ {0x0000800c, 0x00000000},
+ {0x00008018, 0x00000000},
+ {0x00008020, 0x00000000},
+ {0x00008038, 0x00000000},
+ {0x0000803c, 0x00080000},
+ {0x00008040, 0x00000000},
+ {0x00008044, 0x00000000},
+ {0x00008048, 0x00000000},
+ {0x0000804c, 0xffffffff},
+ {0x00008054, 0x00000000},
+ {0x00008058, 0x00000000},
+ {0x0000805c, 0x000fc78f},
+ {0x00008060, 0x0000000f},
+ {0x00008064, 0x00000000},
+ {0x00008070, 0x00000310},
+ {0x00008074, 0x00000020},
+ {0x00008078, 0x00000000},
+ {0x0000809c, 0x0000000f},
+ {0x000080a0, 0x00000000},
+ {0x000080a4, 0x02ff0000},
+ {0x000080a8, 0x0e070605},
+ {0x000080ac, 0x0000000d},
+ {0x000080b0, 0x00000000},
+ {0x000080b4, 0x00000000},
+ {0x000080b8, 0x00000000},
+ {0x000080bc, 0x00000000},
+ {0x000080c0, 0x2a800000},
+ {0x000080c4, 0x06900168},
+ {0x000080c8, 0x13881c20},
+ {0x000080cc, 0x01f40000},
+ {0x000080d0, 0x00252500},
+ {0x000080d4, 0x00b00005},
+ {0x000080d8, 0x00400002},
+ {0x000080dc, 0x00000000},
+ {0x000080e0, 0xffffffff},
+ {0x000080e4, 0x0000ffff},
+ {0x000080e8, 0x3f3f3f3f},
+ {0x000080ec, 0x00000000},
+ {0x000080f0, 0x00000000},
+ {0x000080f4, 0x00000000},
+ {0x000080fc, 0x00020000},
+ {0x00008100, 0x00000000},
+ {0x00008108, 0x00000052},
+ {0x0000810c, 0x00000000},
+ {0x00008110, 0x00000000},
+ {0x00008114, 0x000007ff},
+ {0x00008118, 0x000000aa},
+ {0x0000811c, 0x00003210},
+ {0x00008124, 0x00000000},
+ {0x00008128, 0x00000000},
+ {0x0000812c, 0x00000000},
+ {0x00008130, 0x00000000},
+ {0x00008134, 0x00000000},
+ {0x00008138, 0x00000000},
+ {0x0000813c, 0x0000ffff},
+ {0x00008144, 0xffffffff},
+ {0x00008168, 0x00000000},
+ {0x0000816c, 0x00000000},
+ {0x00008170, 0x18486e00},
+ {0x00008174, 0x33332210},
+ {0x00008178, 0x00000000},
+ {0x0000817c, 0x00020000},
+ {0x000081c4, 0x33332210},
+ {0x000081c8, 0x00000000},
+ {0x000081cc, 0x00000000},
+ {0x000081d4, 0x00000000},
+ {0x000081ec, 0x00000000},
+ {0x000081f0, 0x00000000},
+ {0x000081f4, 0x00000000},
+ {0x000081f8, 0x00000000},
+ {0x000081fc, 0x00000000},
+ {0x00008240, 0x00100000},
+ {0x00008244, 0x0010f400},
+ {0x00008248, 0x00000800},
+ {0x0000824c, 0x0001e800},
+ {0x00008250, 0x00000000},
+ {0x00008254, 0x00000000},
+ {0x00008258, 0x00000000},
+ {0x0000825c, 0x40000000},
+ {0x00008260, 0x00080922},
+ {0x00008264, 0x99c00010},
+ {0x00008268, 0xffffffff},
+ {0x0000826c, 0x0000ffff},
+ {0x00008270, 0x00000000},
+ {0x00008274, 0x40000000},
+ {0x00008278, 0x003e4180},
+ {0x0000827c, 0x00000004},
+ {0x00008284, 0x0000002c},
+ {0x00008288, 0x0000002c},
+ {0x0000828c, 0x000000ff},
+ {0x00008294, 0x00000000},
+ {0x00008298, 0x00000000},
+ {0x0000829c, 0x00000000},
+ {0x00008300, 0x00000140},
+ {0x00008314, 0x00000000},
+ {0x0000831c, 0x0000010d},
+ {0x00008328, 0x00000000},
+ {0x0000832c, 0x0000001f},
+ {0x00008330, 0x00000302},
+ {0x00008334, 0x00000700},
+ {0x00008338, 0xffff0000},
+ {0x0000833c, 0x02400000},
+ {0x00008340, 0x000107ff},
+ {0x00008344, 0xaa48107b},
+ {0x00008348, 0x008f0000},
+ {0x0000835c, 0x00000000},
+ {0x00008360, 0xffffffff},
+ {0x00008364, 0xffffffff},
+ {0x00008368, 0x00000000},
+ {0x00008370, 0x00000000},
+ {0x00008374, 0x000000ff},
+ {0x00008378, 0x00000000},
+ {0x0000837c, 0x00000000},
+ {0x00008380, 0xffffffff},
+ {0x00008384, 0xffffffff},
+ {0x00008390, 0xffffffff},
+ {0x00008394, 0xffffffff},
+ {0x00008398, 0x00000000},
+ {0x0000839c, 0x00000000},
+ {0x000083a4, 0x0000fa14},
+ {0x000083a8, 0x000f0c00},
+ {0x000083ac, 0x33332210},
+ {0x000083b0, 0x33332210},
+ {0x000083b4, 0x33332210},
+ {0x000083b8, 0x33332210},
+ {0x000083bc, 0x00000000},
+ {0x000083c0, 0x00000000},
+ {0x000083c4, 0x00000000},
+ {0x000083c8, 0x00000000},
+ {0x000083cc, 0x00000200},
+ {0x000083d0, 0x000301ff},
+};
+
+static const uint32_t ar9462_2p1_baseband_postamble[][5] = {
+ /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a800d},
+ {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae},
+ {0x00009824, 0x63c640de, 0x5ac640d0, 0x5ac640d0, 0x63c640da},
+ {0x00009828, 0x0796be89, 0x0696b081, 0x0696b881, 0x09143e81},
+ {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4},
+ {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c},
+ {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4},
+ {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a2},
+ {0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020},
+ {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000d8},
+ {0x00009e10, 0x92c88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec86d2e},
+ {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e},
+ {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
+ {0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5},
+ {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
+ {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
+ {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
+ {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
+ {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
+ {0x0000a204, 0x01318fc0, 0x01318fc4, 0x01318fc4, 0x01318fc0},
+ {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004},
+ {0x0000a22c, 0x01026a2f, 0x01026a27, 0x01026a2f, 0x01026a2f},
+ {0x0000a230, 0x0000400a, 0x00004014, 0x00004016, 0x0000400b},
+ {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff},
+ {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018},
+ {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108},
+ {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898},
+ {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002},
+ {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e},
+ {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501},
+ {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e},
+ {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b},
+ {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150},
+ {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110},
+ {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222},
+ {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+ {0x0000a2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
+ {0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
+ {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000a3a4, 0x00000050, 0x00000050, 0x00000000, 0x00000000},
+ {0x0000a3a8, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa},
+ {0x0000a3ac, 0xaaaaaa00, 0xaa30aa30, 0xaaaaaa00, 0xaaaaaa00},
+ {0x0000a41c, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a420, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce},
+ {0x0000a424, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a428, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce},
+ {0x0000a42c, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a430, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce},
+ {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
+ {0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
+ {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
+ {0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa},
+ {0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
+};
+
+static const uint32_t ar9462_2p1_soc_preamble[][2] = {
+ /* Addr allmodes */
+ {0x000040a4, 0x00a0c9c9},
+ {0x00007020, 0x00000000},
+ {0x00007034, 0x00000002},
+ {0x00007038, 0x000004c2},
+};
+
+#endif /* INITVALS_9462_2P1_H */
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar953x.ini b/sys/contrib/dev/ath/ath_hal/ar9300/ar953x.ini
new file mode 100644
index 0000000..69aa5e3
--- /dev/null
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar953x.ini
@@ -0,0 +1,1420 @@
+/*
+ * Copyright (c) 2013 Qualcomm Atheros Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#define INI_VERSION_AR953X "$Id$"
+static const u_int32_t qca953xCommon_wo_xlna_rx_gain_bounds_honeybee_1p0[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27 },
+ { 0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_mac_postamble_emulation[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00008014, 0x10f810f8, 0x10f810f8, 0x10f810f8, 0x10f810f8 },
+ { 0x0000801c, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017, 0x0e8d8017 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_tx_gain_table_baseband_postamble_emulation[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x0000a410, 0x000000d5, 0x000000d5, 0x000000d5, 0x000000d5 },
+ { 0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+ { 0x0000a504, 0x00004002, 0x00004002, 0x00004002, 0x00004002 },
+ { 0x0000a508, 0x00008004, 0x00008004, 0x00008004, 0x00008004 },
+ { 0x0000a510, 0x0001000c, 0x0001000c, 0x0001000c, 0x0001000c },
+ { 0x0000a514, 0x0001420b, 0x0001420b, 0x0001420b, 0x0001420b },
+ { 0x0000a518, 0x0001824a, 0x0001824a, 0x0001824a, 0x0001824a },
+ { 0x0000a51c, 0x0001c44a, 0x0001c44a, 0x0001c44a, 0x0001c44a },
+ { 0x0000a520, 0x0002064a, 0x0002064a, 0x0002064a, 0x0002064a },
+ { 0x0000a524, 0x0002484a, 0x0002484a, 0x0002484a, 0x0002484a },
+ { 0x0000a528, 0x00028a4a, 0x00028a4a, 0x00028a4a, 0x00028a4a },
+ { 0x0000a52c, 0x00030e4a, 0x00030e4a, 0x00030e4a, 0x00030e4a },
+ { 0x0000a530, 0x00030e4a, 0x00030e4a, 0x00030e4a, 0x00030e4a },
+ { 0x0000a534, 0x00034e8a, 0x00034e8a, 0x00034e8a, 0x00034e8a },
+};
+
+static const u_int32_t qca953xModes_no_xpa_tx_gain_table_honeybee_1p1[][2] = {
+/* Addr allmodes */
+ { 0x0000a2dc, 0xffd5f552 },
+ { 0x0000a2e0, 0xffe60664 },
+ { 0x0000a2e4, 0xfff80780 },
+ { 0x0000a2e8, 0xfffff800 },
+ { 0x0000a410, 0x000050de },
+ { 0x0000a500, 0x00000061 },
+ { 0x0000a504, 0x04000063 },
+ { 0x0000a508, 0x08000065 },
+ { 0x0000a50c, 0x0c000261 },
+ { 0x0000a510, 0x10000263 },
+ { 0x0000a514, 0x14000265 },
+ { 0x0000a518, 0x18000482 },
+ { 0x0000a51c, 0x1b000484 },
+ { 0x0000a520, 0x1f000486 },
+ { 0x0000a524, 0x240008c2 },
+ { 0x0000a528, 0x28000cc1 },
+ { 0x0000a52c, 0x2d000ce3 },
+ { 0x0000a530, 0x31000ce5 },
+ { 0x0000a534, 0x350010e5 },
+ { 0x0000a538, 0x360012e5 },
+ { 0x0000a53c, 0x380014e5 },
+ { 0x0000a540, 0x3b0018e5 },
+ { 0x0000a544, 0x3d001d04 },
+ { 0x0000a548, 0x3e001d05 },
+ { 0x0000a54c, 0x40001d07 },
+ { 0x0000a550, 0x42001f27 },
+ { 0x0000a554, 0x43001f67 },
+ { 0x0000a558, 0x46001fe7 },
+ { 0x0000a55c, 0x47001f2b },
+ { 0x0000a560, 0x49001f0d },
+ { 0x0000a564, 0x4b001ed2 },
+ { 0x0000a568, 0x4c001ed4 },
+ { 0x0000a56c, 0x4e001f15 },
+ { 0x0000a570, 0x4f001ff6 },
+ { 0x0000a574, 0x4f001ff6 },
+ { 0x0000a578, 0x4f001ff6 },
+ { 0x0000a57c, 0x4f001ff6 },
+ { 0x0000a600, 0x00000000 },
+ { 0x0000a604, 0x00000000 },
+ { 0x0000a608, 0x00000000 },
+ { 0x0000a60c, 0x00804201 },
+ { 0x0000a610, 0x01008201 },
+ { 0x0000a614, 0x0180c402 },
+ { 0x0000a618, 0x0180c603 },
+ { 0x0000a61c, 0x0180c603 },
+ { 0x0000a620, 0x01c10603 },
+ { 0x0000a624, 0x01c10704 },
+ { 0x0000a628, 0x02c18b05 },
+ { 0x0000a62c, 0x02c14c07 },
+ { 0x0000a630, 0x01008704 },
+ { 0x0000a634, 0x01c10402 },
+ { 0x0000a638, 0x0301cc07 },
+ { 0x0000a63c, 0x0301cc07 },
+ { 0x0000b2dc, 0xffd5f552 },
+ { 0x0000b2e0, 0xffe60664 },
+ { 0x0000b2e4, 0xfff80780 },
+ { 0x0000b2e8, 0xfffff800 },
+ { 0x00016044, 0x049242db },
+ { 0x00016048, 0x6c927a70 },
+ { 0x00016444, 0x049242db },
+ { 0x00016448, 0x6c927a70 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_baseband_postamble_emulation[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+ { 0x00009e3c, 0xcfa10821, 0xcfa10821, 0xcfa10821, 0xcfa10821 },
+ { 0x00009e44, 0x005c0000, 0x005c0000, 0x005c0000, 0x005c0000 },
+ { 0x0000a258, 0x02020200, 0x02020200, 0x02020200, 0x02020200 },
+ { 0x0000a25c, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
+ { 0x0000a28c, 0x00011111, 0x00011111, 0x00011111, 0x00011111 },
+ { 0x0000a2c4, 0x00148d18, 0x00148d18, 0x00148d20, 0x00148d20 },
+ { 0x0000a2d8, 0xf999a801, 0xf999a801, 0xf999a80d, 0xf999a80d },
+ { 0x0000a50c, 0x0000c00a, 0x0000c00a, 0x0000c00a, 0x0000c00a },
+ { 0x0000a538, 0x00038e8c, 0x00038e8c, 0x00038e8c, 0x00038e8c },
+ { 0x0000a53c, 0x0003cecc, 0x0003cecc, 0x0003cecc, 0x0003cecc },
+ { 0x0000a540, 0x00040ed4, 0x00040ed4, 0x00040ed4, 0x00040ed4 },
+ { 0x0000a544, 0x00044edc, 0x00044edc, 0x00044edc, 0x00044edc },
+ { 0x0000a548, 0x00048ede, 0x00048ede, 0x00048ede, 0x00048ede },
+ { 0x0000a54c, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e, 0x0004cf1e },
+ { 0x0000a550, 0x00050f5e, 0x00050f5e, 0x00050f5e, 0x00050f5e },
+ { 0x0000a554, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a558, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a55c, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a560, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a564, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a568, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a56c, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a570, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a574, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a578, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000a57c, 0x00054f9e, 0x00054f9e, 0x00054f9e, 0x00054f9e },
+ { 0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+};
+
+static const u_int32_t qca953xCommon_wo_xlna_rx_gain_table_honeybee_1p0[][2] = {
+/* Addr allmodes */
+ { 0x0000a000, 0x00010000 },
+ { 0x0000a004, 0x00030002 },
+ { 0x0000a008, 0x00050004 },
+ { 0x0000a00c, 0x00810080 },
+ { 0x0000a010, 0x00830082 },
+ { 0x0000a014, 0x01810180 },
+ { 0x0000a018, 0x01830182 },
+ { 0x0000a01c, 0x01850184 },
+ { 0x0000a020, 0x01890188 },
+ { 0x0000a024, 0x018b018a },
+ { 0x0000a028, 0x018d018c },
+ { 0x0000a02c, 0x03820190 },
+ { 0x0000a030, 0x03840383 },
+ { 0x0000a034, 0x03880385 },
+ { 0x0000a038, 0x038a0389 },
+ { 0x0000a03c, 0x038c038b },
+ { 0x0000a040, 0x0390038d },
+ { 0x0000a044, 0x03920391 },
+ { 0x0000a048, 0x03940393 },
+ { 0x0000a04c, 0x03960395 },
+ { 0x0000a050, 0x00000000 },
+ { 0x0000a054, 0x00000000 },
+ { 0x0000a058, 0x00000000 },
+ { 0x0000a05c, 0x00000000 },
+ { 0x0000a060, 0x00000000 },
+ { 0x0000a064, 0x00000000 },
+ { 0x0000a068, 0x00000000 },
+ { 0x0000a06c, 0x00000000 },
+ { 0x0000a070, 0x00000000 },
+ { 0x0000a074, 0x00000000 },
+ { 0x0000a078, 0x00000000 },
+ { 0x0000a07c, 0x00000000 },
+ { 0x0000a080, 0x29292929 },
+ { 0x0000a084, 0x29292929 },
+ { 0x0000a088, 0x29292929 },
+ { 0x0000a08c, 0x29292929 },
+ { 0x0000a090, 0x22292929 },
+ { 0x0000a094, 0x1d1d2222 },
+ { 0x0000a098, 0x0c111117 },
+ { 0x0000a09c, 0x00030303 },
+ { 0x0000a0a0, 0x00000000 },
+ { 0x0000a0a4, 0x00000000 },
+ { 0x0000a0a8, 0x00000000 },
+ { 0x0000a0ac, 0x00000000 },
+ { 0x0000a0b0, 0x00000000 },
+ { 0x0000a0b4, 0x00000000 },
+ { 0x0000a0b8, 0x00000000 },
+ { 0x0000a0bc, 0x00000000 },
+ { 0x0000a0c0, 0x001f0000 },
+ { 0x0000a0c4, 0x01000101 },
+ { 0x0000a0c8, 0x011e011f },
+ { 0x0000a0cc, 0x011c011d },
+ { 0x0000a0d0, 0x02030204 },
+ { 0x0000a0d4, 0x02010202 },
+ { 0x0000a0d8, 0x021f0200 },
+ { 0x0000a0dc, 0x0302021e },
+ { 0x0000a0e0, 0x03000301 },
+ { 0x0000a0e4, 0x031e031f },
+ { 0x0000a0e8, 0x0402031d },
+ { 0x0000a0ec, 0x04000401 },
+ { 0x0000a0f0, 0x041e041f },
+ { 0x0000a0f4, 0x0502041d },
+ { 0x0000a0f8, 0x05000501 },
+ { 0x0000a0fc, 0x051e051f },
+ { 0x0000a100, 0x06010602 },
+ { 0x0000a104, 0x061f0600 },
+ { 0x0000a108, 0x061d061e },
+ { 0x0000a10c, 0x07020703 },
+ { 0x0000a110, 0x07000701 },
+ { 0x0000a114, 0x00000000 },
+ { 0x0000a118, 0x00000000 },
+ { 0x0000a11c, 0x00000000 },
+ { 0x0000a120, 0x00000000 },
+ { 0x0000a124, 0x00000000 },
+ { 0x0000a128, 0x00000000 },
+ { 0x0000a12c, 0x00000000 },
+ { 0x0000a130, 0x00000000 },
+ { 0x0000a134, 0x00000000 },
+ { 0x0000a138, 0x00000000 },
+ { 0x0000a13c, 0x00000000 },
+ { 0x0000a140, 0x001f0000 },
+ { 0x0000a144, 0x01000101 },
+ { 0x0000a148, 0x011e011f },
+ { 0x0000a14c, 0x011c011d },
+ { 0x0000a150, 0x02030204 },
+ { 0x0000a154, 0x02010202 },
+ { 0x0000a158, 0x021f0200 },
+ { 0x0000a15c, 0x0302021e },
+ { 0x0000a160, 0x03000301 },
+ { 0x0000a164, 0x031e031f },
+ { 0x0000a168, 0x0402031d },
+ { 0x0000a16c, 0x04000401 },
+ { 0x0000a170, 0x041e041f },
+ { 0x0000a174, 0x0502041d },
+ { 0x0000a178, 0x05000501 },
+ { 0x0000a17c, 0x051e051f },
+ { 0x0000a180, 0x06010602 },
+ { 0x0000a184, 0x061f0600 },
+ { 0x0000a188, 0x061d061e },
+ { 0x0000a18c, 0x07020703 },
+ { 0x0000a190, 0x07000701 },
+ { 0x0000a194, 0x00000000 },
+ { 0x0000a198, 0x00000000 },
+ { 0x0000a19c, 0x00000000 },
+ { 0x0000a1a0, 0x00000000 },
+ { 0x0000a1a4, 0x00000000 },
+ { 0x0000a1a8, 0x00000000 },
+ { 0x0000a1ac, 0x00000000 },
+ { 0x0000a1b0, 0x00000000 },
+ { 0x0000a1b4, 0x00000000 },
+ { 0x0000a1b8, 0x00000000 },
+ { 0x0000a1bc, 0x00000000 },
+ { 0x0000a1c0, 0x00000000 },
+ { 0x0000a1c4, 0x00000000 },
+ { 0x0000a1c8, 0x00000000 },
+ { 0x0000a1cc, 0x00000000 },
+ { 0x0000a1d0, 0x00000000 },
+ { 0x0000a1d4, 0x00000000 },
+ { 0x0000a1d8, 0x00000000 },
+ { 0x0000a1dc, 0x00000000 },
+ { 0x0000a1e0, 0x00000000 },
+ { 0x0000a1e4, 0x00000000 },
+ { 0x0000a1e8, 0x00000000 },
+ { 0x0000a1ec, 0x00000000 },
+ { 0x0000a1f0, 0x00000396 },
+ { 0x0000a1f4, 0x00000396 },
+ { 0x0000a1f8, 0x00000396 },
+ { 0x0000a1fc, 0x00000196 },
+ { 0x0000b000, 0x00010000 },
+ { 0x0000b004, 0x00030002 },
+ { 0x0000b008, 0x00050004 },
+ { 0x0000b00c, 0x00810080 },
+ { 0x0000b010, 0x00830082 },
+ { 0x0000b014, 0x01810180 },
+ { 0x0000b018, 0x01830182 },
+ { 0x0000b01c, 0x01850184 },
+ { 0x0000b020, 0x02810280 },
+ { 0x0000b024, 0x02830282 },
+ { 0x0000b028, 0x02850284 },
+ { 0x0000b02c, 0x02890288 },
+ { 0x0000b030, 0x028b028a },
+ { 0x0000b034, 0x0388028c },
+ { 0x0000b038, 0x038a0389 },
+ { 0x0000b03c, 0x038c038b },
+ { 0x0000b040, 0x0390038d },
+ { 0x0000b044, 0x03920391 },
+ { 0x0000b048, 0x03940393 },
+ { 0x0000b04c, 0x03960395 },
+ { 0x0000b050, 0x00000000 },
+ { 0x0000b054, 0x00000000 },
+ { 0x0000b058, 0x00000000 },
+ { 0x0000b05c, 0x00000000 },
+ { 0x0000b060, 0x00000000 },
+ { 0x0000b064, 0x00000000 },
+ { 0x0000b068, 0x00000000 },
+ { 0x0000b06c, 0x00000000 },
+ { 0x0000b070, 0x00000000 },
+ { 0x0000b074, 0x00000000 },
+ { 0x0000b078, 0x00000000 },
+ { 0x0000b07c, 0x00000000 },
+ { 0x0000b080, 0x32323232 },
+ { 0x0000b084, 0x2f2f3232 },
+ { 0x0000b088, 0x23282a2d },
+ { 0x0000b08c, 0x1c1e2123 },
+ { 0x0000b090, 0x14171919 },
+ { 0x0000b094, 0x0e0e1214 },
+ { 0x0000b098, 0x03050707 },
+ { 0x0000b09c, 0x00030303 },
+ { 0x0000b0a0, 0x00000000 },
+ { 0x0000b0a4, 0x00000000 },
+ { 0x0000b0a8, 0x00000000 },
+ { 0x0000b0ac, 0x00000000 },
+ { 0x0000b0b0, 0x00000000 },
+ { 0x0000b0b4, 0x00000000 },
+ { 0x0000b0b8, 0x00000000 },
+ { 0x0000b0bc, 0x00000000 },
+ { 0x0000b0c0, 0x003f0020 },
+ { 0x0000b0c4, 0x00400041 },
+ { 0x0000b0c8, 0x0140005f },
+ { 0x0000b0cc, 0x0160015f },
+ { 0x0000b0d0, 0x017e017f },
+ { 0x0000b0d4, 0x02410242 },
+ { 0x0000b0d8, 0x025f0240 },
+ { 0x0000b0dc, 0x027f0260 },
+ { 0x0000b0e0, 0x0341027e },
+ { 0x0000b0e4, 0x035f0340 },
+ { 0x0000b0e8, 0x037f0360 },
+ { 0x0000b0ec, 0x04400441 },
+ { 0x0000b0f0, 0x0460045f },
+ { 0x0000b0f4, 0x0541047f },
+ { 0x0000b0f8, 0x055f0540 },
+ { 0x0000b0fc, 0x057f0560 },
+ { 0x0000b100, 0x06400641 },
+ { 0x0000b104, 0x0660065f },
+ { 0x0000b108, 0x067e067f },
+ { 0x0000b10c, 0x07410742 },
+ { 0x0000b110, 0x075f0740 },
+ { 0x0000b114, 0x077f0760 },
+ { 0x0000b118, 0x07800781 },
+ { 0x0000b11c, 0x07a0079f },
+ { 0x0000b120, 0x07c107bf },
+ { 0x0000b124, 0x000007c0 },
+ { 0x0000b128, 0x00000000 },
+ { 0x0000b12c, 0x00000000 },
+ { 0x0000b130, 0x00000000 },
+ { 0x0000b134, 0x00000000 },
+ { 0x0000b138, 0x00000000 },
+ { 0x0000b13c, 0x00000000 },
+ { 0x0000b140, 0x003f0020 },
+ { 0x0000b144, 0x00400041 },
+ { 0x0000b148, 0x0140005f },
+ { 0x0000b14c, 0x0160015f },
+ { 0x0000b150, 0x017e017f },
+ { 0x0000b154, 0x02410242 },
+ { 0x0000b158, 0x025f0240 },
+ { 0x0000b15c, 0x027f0260 },
+ { 0x0000b160, 0x0341027e },
+ { 0x0000b164, 0x035f0340 },
+ { 0x0000b168, 0x037f0360 },
+ { 0x0000b16c, 0x04400441 },
+ { 0x0000b170, 0x0460045f },
+ { 0x0000b174, 0x0541047f },
+ { 0x0000b178, 0x055f0540 },
+ { 0x0000b17c, 0x057f0560 },
+ { 0x0000b180, 0x06400641 },
+ { 0x0000b184, 0x0660065f },
+ { 0x0000b188, 0x067e067f },
+ { 0x0000b18c, 0x07410742 },
+ { 0x0000b190, 0x075f0740 },
+ { 0x0000b194, 0x077f0760 },
+ { 0x0000b198, 0x07800781 },
+ { 0x0000b19c, 0x07a0079f },
+ { 0x0000b1a0, 0x07c107bf },
+ { 0x0000b1a4, 0x000007c0 },
+ { 0x0000b1a8, 0x00000000 },
+ { 0x0000b1ac, 0x00000000 },
+ { 0x0000b1b0, 0x00000000 },
+ { 0x0000b1b4, 0x00000000 },
+ { 0x0000b1b8, 0x00000000 },
+ { 0x0000b1bc, 0x00000000 },
+ { 0x0000b1c0, 0x00000000 },
+ { 0x0000b1c4, 0x00000000 },
+ { 0x0000b1c8, 0x00000000 },
+ { 0x0000b1cc, 0x00000000 },
+ { 0x0000b1d0, 0x00000000 },
+ { 0x0000b1d4, 0x00000000 },
+ { 0x0000b1d8, 0x00000000 },
+ { 0x0000b1dc, 0x00000000 },
+ { 0x0000b1e0, 0x00000000 },
+ { 0x0000b1e4, 0x00000000 },
+ { 0x0000b1e8, 0x00000000 },
+ { 0x0000b1ec, 0x00000000 },
+ { 0x0000b1f0, 0x00000396 },
+ { 0x0000b1f4, 0x00000396 },
+ { 0x0000b1f8, 0x00000396 },
+ { 0x0000b1fc, 0x00000196 },
+};
+
+static const u_int32_t qca953xModes_no_xpa_low_power_tx_gain_table_honeybee_1p1[][2] = {
+/* Addr allmodes */
+ { 0x0000a2dc, 0xfff55592 },
+ { 0x0000a2e0, 0xfff99924 },
+ { 0x0000a2e4, 0xfffe1e00 },
+ { 0x0000a2e8, 0xffffe000 },
+ { 0x0000a410, 0x000050d6 },
+ { 0x0000a500, 0x00000069 },
+ { 0x0000a504, 0x0400006b },
+ { 0x0000a508, 0x0800006d },
+ { 0x0000a50c, 0x0c000269 },
+ { 0x0000a510, 0x1000026b },
+ { 0x0000a514, 0x1400026d },
+ { 0x0000a518, 0x18000669 },
+ { 0x0000a51c, 0x1c00066b },
+ { 0x0000a520, 0x1d000a68 },
+ { 0x0000a524, 0x21000a6a },
+ { 0x0000a528, 0x25000a6c },
+ { 0x0000a52c, 0x29000a6e },
+ { 0x0000a530, 0x2d0012a9 },
+ { 0x0000a534, 0x310012ab },
+ { 0x0000a538, 0x350012ad },
+ { 0x0000a53c, 0x39001b0a },
+ { 0x0000a540, 0x3d001b0c },
+ { 0x0000a544, 0x41001b0e },
+ { 0x0000a548, 0x43001bae },
+ { 0x0000a54c, 0x45001914 },
+ { 0x0000a550, 0x47001916 },
+ { 0x0000a554, 0x49001b96 },
+ { 0x0000a558, 0x49001b96 },
+ { 0x0000a55c, 0x49001b96 },
+ { 0x0000a560, 0x49001b96 },
+ { 0x0000a564, 0x49001b96 },
+ { 0x0000a568, 0x49001b96 },
+ { 0x0000a56c, 0x49001b96 },
+ { 0x0000a570, 0x49001b96 },
+ { 0x0000a574, 0x49001b96 },
+ { 0x0000a578, 0x49001b96 },
+ { 0x0000a57c, 0x49001b96 },
+ { 0x0000a600, 0x00000000 },
+ { 0x0000a604, 0x00000000 },
+ { 0x0000a608, 0x00000000 },
+ { 0x0000a60c, 0x00000000 },
+ { 0x0000a610, 0x00000000 },
+ { 0x0000a614, 0x00000000 },
+ { 0x0000a618, 0x00804201 },
+ { 0x0000a61c, 0x01408201 },
+ { 0x0000a620, 0x01408502 },
+ { 0x0000a624, 0x01408502 },
+ { 0x0000a628, 0x01408502 },
+ { 0x0000a62c, 0x01408502 },
+ { 0x0000a630, 0x01408502 },
+ { 0x0000a634, 0x01408502 },
+ { 0x0000a638, 0x01408502 },
+ { 0x0000a63c, 0x01408502 },
+ { 0x0000b2dc, 0xfff55592 },
+ { 0x0000b2e0, 0xfff99924 },
+ { 0x0000b2e4, 0xfffe1e00 },
+ { 0x0000b2e8, 0xffffe000 },
+ { 0x00016044, 0x044922db },
+ { 0x00016048, 0x6c927a70 },
+ { 0x00016444, 0x044922db },
+ { 0x00016448, 0x6c927a70 },
+};
+
+static const u_int32_t qca953xModes_fast_clock_honeybee_1p0[][3] = {
+/* Addr 5G_HT20 5G_HT40 */
+ { 0x00001030, 0x00000268, 0x000004d0 },
+ { 0x00001070, 0x0000018c, 0x00000318 },
+ { 0x000010b0, 0x00000fd0, 0x00001fa0 },
+ { 0x00008014, 0x044c044c, 0x08980898 },
+ { 0x0000801c, 0x148ec02b, 0x148ec057 },
+ { 0x00008318, 0x000044c0, 0x00008980 },
+ { 0x00009e00, 0x0372131c, 0x0372131c },
+ { 0x0000a230, 0x0000000b, 0x00000016 },
+ { 0x0000a254, 0x00000898, 0x00001130 },
+};
+
+static const u_int32_t qca953xCommon_rx_gain_bounds_honeybee_1p0[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27 },
+ { 0x00009e48, 0x5030201a, 0x5030201a, 0x50302018, 0x50302018 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_baseband_core[][2] = {
+/* Addr allmodes */
+ { 0x00009800, 0xafe68e30 },
+ { 0x00009804, 0xfd14e000 },
+ { 0x00009808, 0x9c0a9f6b },
+ { 0x0000980c, 0x04900000 },
+ { 0x00009814, 0x0280c00a },
+ { 0x00009818, 0x00000000 },
+ { 0x0000981c, 0x00020028 },
+ { 0x00009834, 0x6400a190 },
+ { 0x00009838, 0x0108ecff },
+ { 0x0000983c, 0x14000600 },
+ { 0x00009880, 0x201fff00 },
+ { 0x00009884, 0x00001042 },
+ { 0x000098a4, 0x00200400 },
+ { 0x000098b0, 0x32840bbe },
+ { 0x000098bc, 0x00000002 },
+ { 0x000098d0, 0x004b6a8e },
+ { 0x000098d4, 0x00000820 },
+ { 0x000098dc, 0x00000000 },
+ { 0x000098f0, 0x00000000 },
+ { 0x000098f4, 0x00000000 },
+ { 0x00009c04, 0xff55ff55 },
+ { 0x00009c08, 0x0320ff55 },
+ { 0x00009c0c, 0x00000000 },
+ { 0x00009c10, 0x00000000 },
+ { 0x00009c14, 0x00046384 },
+ { 0x00009c18, 0x05b6b440 },
+ { 0x00009c1c, 0x00b6b440 },
+ { 0x00009d00, 0xc080a333 },
+ { 0x00009d04, 0x40206c10 },
+ { 0x00009d08, 0x009c4060 },
+ { 0x00009d0c, 0x9883800a },
+ { 0x00009d10, 0x01884061 },
+ { 0x00009d14, 0x00c0040b },
+ { 0x00009d18, 0x00000000 },
+ { 0x00009e08, 0x0038230c },
+ { 0x00009e24, 0x990bb515 },
+ { 0x00009e28, 0x0c6f0000 },
+ { 0x00009e30, 0x06336f77 },
+ { 0x00009e34, 0x6af6532f },
+ { 0x00009e38, 0x0cc80c00 },
+ { 0x00009e40, 0x0d261820 },
+ { 0x00009e4c, 0x00001004 },
+ { 0x00009e50, 0x00ff03f1 },
+ { 0x00009fc0, 0x813e4788 },
+ { 0x00009fc4, 0x0001efb5 },
+ { 0x00009fcc, 0x40000014 },
+ { 0x00009fd0, 0x01193b91 },
+ { 0x0000a20c, 0x00000000 },
+ { 0x0000a220, 0x00000000 },
+ { 0x0000a224, 0x00000000 },
+ { 0x0000a228, 0x10002310 },
+ { 0x0000a23c, 0x00000000 },
+ { 0x0000a244, 0x0c000000 },
+ { 0x0000a248, 0x00000140 },
+ { 0x0000a2a0, 0x00000007 },
+ { 0x0000a2c0, 0x00000007 },
+ { 0x0000a2c8, 0x00000000 },
+ { 0x0000a2d4, 0x00000000 },
+ { 0x0000a2ec, 0x00000000 },
+ { 0x0000a2f0, 0x00000000 },
+ { 0x0000a2f4, 0x00000000 },
+ { 0x0000a2f8, 0x00000000 },
+ { 0x0000a344, 0x00000000 },
+ { 0x0000a34c, 0x00000000 },
+ { 0x0000a350, 0x0000a000 },
+ { 0x0000a364, 0x00000000 },
+ { 0x0000a370, 0x00000000 },
+ { 0x0000a390, 0x00000001 },
+ { 0x0000a394, 0x00000444 },
+ { 0x0000a398, 0x1f020503 },
+ { 0x0000a39c, 0x29180c03 },
+ { 0x0000a3a0, 0x9a8b6844 },
+ { 0x0000a3a4, 0x000000ff },
+ { 0x0000a3a8, 0x6a6a6a6a },
+ { 0x0000a3ac, 0x6a6a6a6a },
+ { 0x0000a3b0, 0x00c8641a },
+ { 0x0000a3b4, 0x0000001a },
+ { 0x0000a3b8, 0x0088642a },
+ { 0x0000a3bc, 0x000001fa },
+ { 0x0000a3c0, 0x20202020 },
+ { 0x0000a3c4, 0x22222220 },
+ { 0x0000a3c8, 0x20200020 },
+ { 0x0000a3cc, 0x20202020 },
+ { 0x0000a3d0, 0x20202020 },
+ { 0x0000a3d4, 0x20202020 },
+ { 0x0000a3d8, 0x20202020 },
+ { 0x0000a3dc, 0x20202020 },
+ { 0x0000a3e0, 0x20202020 },
+ { 0x0000a3e4, 0x20202020 },
+ { 0x0000a3e8, 0x20202020 },
+ { 0x0000a3ec, 0x20202020 },
+ { 0x0000a3f0, 0x00000000 },
+ { 0x0000a3f4, 0x00000000 },
+ { 0x0000a3f8, 0x0c9bd380 },
+ { 0x0000a3fc, 0x000f0f01 },
+ { 0x0000a400, 0x8fa91f01 },
+ { 0x0000a404, 0x00000000 },
+ { 0x0000a408, 0x0e79e5c6 },
+ { 0x0000a40c, 0x00820820 },
+ { 0x0000a414, 0x1ce42108 },
+ { 0x0000a418, 0x2d001dce },
+ { 0x0000a41c, 0x1ce73908 },
+ { 0x0000a420, 0x000001ce },
+ { 0x0000a424, 0x1ce738e7 },
+ { 0x0000a428, 0x000001ce },
+ { 0x0000a42c, 0x1ce739ce },
+ { 0x0000a430, 0x1ce739ce },
+ { 0x0000a434, 0x00000000 },
+ { 0x0000a438, 0x00001801 },
+ { 0x0000a43c, 0x00100000 },
+ { 0x0000a444, 0x00000000 },
+ { 0x0000a448, 0x05000080 },
+ { 0x0000a44c, 0x00000001 },
+ { 0x0000a450, 0x00010000 },
+ { 0x0000a458, 0x00000000 },
+ { 0x0000a644, 0xbfad9d74 },
+ { 0x0000a648, 0x0048060a },
+ { 0x0000a64c, 0x00003c37 },
+ { 0x0000a670, 0x03020100 },
+ { 0x0000a674, 0x09080504 },
+ { 0x0000a678, 0x0d0c0b0a },
+ { 0x0000a67c, 0x13121110 },
+ { 0x0000a680, 0x31301514 },
+ { 0x0000a684, 0x35343332 },
+ { 0x0000a688, 0x00000036 },
+ { 0x0000a690, 0x08000838 },
+ { 0x0000a7cc, 0x00000000 },
+ { 0x0000a7d0, 0x00000000 },
+ { 0x0000a7d4, 0x00000004 },
+ { 0x0000a7dc, 0x00000000 },
+ { 0x0000a8d0, 0x004b6a8e },
+ { 0x0000a8d4, 0x00000820 },
+ { 0x0000a8dc, 0x00000000 },
+ { 0x0000a8f0, 0x00000000 },
+ { 0x0000a8f4, 0x00000000 },
+ { 0x0000b2d0, 0x00000080 },
+ { 0x0000b2d4, 0x00000000 },
+ { 0x0000b2ec, 0x00000000 },
+ { 0x0000b2f0, 0x00000000 },
+ { 0x0000b2f4, 0x00000000 },
+ { 0x0000b2f8, 0x00000000 },
+ { 0x0000b408, 0x0e79e5c0 },
+ { 0x0000b40c, 0x00820820 },
+ { 0x0000b420, 0x00000000 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_radio_postamble[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00016098, 0xd2dd5554, 0xd2dd5554, 0xc4128f5c, 0xc4128f5c },
+ { 0x0001609c, 0x0a566f3a, 0x0a566f3a, 0x0fd08f25, 0x0fd08f25 },
+ { 0x000160ac, 0xa4647c00, 0xa4647c00, 0x24646800, 0x24646800 },
+ { 0x000160b0, 0x01885f52, 0x01885f52, 0x00fe7f46, 0x00fe7f46 },
+ { 0x00016104, 0xb7a00001, 0xb7a00001, 0xfff80005, 0xfff80005 },
+ { 0x0001610c, 0xc0000000, 0xc0000000, 0x00000000, 0x00000000 },
+ { 0x00016140, 0x10804008, 0x10804008, 0x50804000, 0x50804000 },
+ { 0x00016504, 0xb7a00001, 0xb7a00001, 0xfff80001, 0xfff80001 },
+ { 0x0001650c, 0xc0000000, 0xc0000000, 0x00000000, 0x00000000 },
+ { 0x00016540, 0x10804008, 0x10804008, 0x50804000, 0x50804000 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_radio_core[][2] = {
+/* Addr allmodes */
+ { 0x00016000, 0x36db6db6 },
+ { 0x00016004, 0x6db6db40 },
+ { 0x00016008, 0x73f00000 },
+ { 0x0001600c, 0x00000000 },
+ { 0x00016040, 0x3f80fff8 },
+ { 0x0001604c, 0x000f0278 },
+ { 0x00016050, 0x8036db6c },
+ { 0x00016054, 0x6db60000 },
+ { 0x00016080, 0x00080000 },
+ { 0x00016084, 0x0e48048c },
+ { 0x00016088, 0x14214514 },
+ { 0x0001608c, 0x119f080a },
+ { 0x00016090, 0x24926490 },
+ { 0x00016094, 0x00000000 },
+ { 0x000160a0, 0xc2108ffe },
+ { 0x000160a4, 0x812fc370 },
+ { 0x000160a8, 0x423c8000 },
+ { 0x000160b4, 0x92480080 },
+ { 0x000160c0, 0x006db6d8 },
+ { 0x000160c4, 0x24b6db6c },
+ { 0x000160c8, 0x6db6db6c },
+ { 0x000160cc, 0x6db6fb7c },
+ { 0x000160d0, 0x6db6da44 },
+ { 0x00016100, 0x07ff8001 },
+ { 0x00016108, 0x00080010 },
+ { 0x00016144, 0x01884080 },
+ { 0x00016148, 0x000080d8 },
+ { 0x00016280, 0x01000901 },
+ { 0x00016284, 0x15d30000 },
+ { 0x00016288, 0x00318000 },
+ { 0x0001628c, 0x50000000 },
+ { 0x00016380, 0x00000000 },
+ { 0x00016384, 0x00000000 },
+ { 0x00016388, 0x00800700 },
+ { 0x0001638c, 0x00800700 },
+ { 0x00016390, 0x00800700 },
+ { 0x00016394, 0x00000000 },
+ { 0x00016398, 0x00000000 },
+ { 0x0001639c, 0x00000000 },
+ { 0x000163a0, 0x00000001 },
+ { 0x000163a4, 0x00000001 },
+ { 0x000163a8, 0x00000000 },
+ { 0x000163ac, 0x00000000 },
+ { 0x000163b0, 0x00000000 },
+ { 0x000163b4, 0x00000000 },
+ { 0x000163b8, 0x00000000 },
+ { 0x000163bc, 0x00000000 },
+ { 0x000163c0, 0x000000a0 },
+ { 0x000163c4, 0x000c0000 },
+ { 0x000163c8, 0x14021402 },
+ { 0x000163cc, 0x00001402 },
+ { 0x000163d0, 0x00000000 },
+ { 0x000163d4, 0x00000000 },
+ { 0x00016400, 0x36db6db6 },
+ { 0x00016404, 0x6db6db40 },
+ { 0x00016408, 0x73f00000 },
+ { 0x0001640c, 0x00000000 },
+ { 0x00016440, 0x3f80fff8 },
+ { 0x0001644c, 0x000f0278 },
+ { 0x00016450, 0x8036db6c },
+ { 0x00016454, 0x6db60000 },
+ { 0x00016500, 0x07ff8001 },
+ { 0x00016508, 0x00080010 },
+ { 0x00016544, 0x01884080 },
+ { 0x00016548, 0x000080d8 },
+ { 0x00016780, 0x00000000 },
+ { 0x00016784, 0x00000000 },
+ { 0x00016788, 0x00800700 },
+ { 0x0001678c, 0x00800700 },
+ { 0x00016790, 0x00800700 },
+ { 0x00016794, 0x00000000 },
+ { 0x00016798, 0x00000000 },
+ { 0x0001679c, 0x00000000 },
+ { 0x000167a0, 0x00000001 },
+ { 0x000167a4, 0x00000001 },
+ { 0x000167a8, 0x00000000 },
+ { 0x000167ac, 0x00000000 },
+ { 0x000167b0, 0x00000000 },
+ { 0x000167b4, 0x00000000 },
+ { 0x000167b8, 0x00000000 },
+ { 0x000167bc, 0x00000000 },
+ { 0x000167c0, 0x000000a0 },
+ { 0x000167c4, 0x000c0000 },
+ { 0x000167c8, 0x14021402 },
+ { 0x000167cc, 0x00001402 },
+ { 0x000167d0, 0x00000000 },
+ { 0x000167d4, 0x00000000 },
+};
+
+static const u_int32_t qca953xCommon_rx_gain_table_honeybee_1p0[][2] = {
+/* Addr allmodes */
+ { 0x0000a000, 0x00010000 },
+ { 0x0000a004, 0x00030002 },
+ { 0x0000a008, 0x00050004 },
+ { 0x0000a00c, 0x00810080 },
+ { 0x0000a010, 0x00830082 },
+ { 0x0000a014, 0x01810180 },
+ { 0x0000a018, 0x01830182 },
+ { 0x0000a01c, 0x01850184 },
+ { 0x0000a020, 0x01890188 },
+ { 0x0000a024, 0x018b018a },
+ { 0x0000a028, 0x018d018c },
+ { 0x0000a02c, 0x01910190 },
+ { 0x0000a030, 0x01930192 },
+ { 0x0000a034, 0x01950194 },
+ { 0x0000a038, 0x038a0196 },
+ { 0x0000a03c, 0x038c038b },
+ { 0x0000a040, 0x0390038d },
+ { 0x0000a044, 0x03920391 },
+ { 0x0000a048, 0x03940393 },
+ { 0x0000a04c, 0x03960395 },
+ { 0x0000a050, 0x00000000 },
+ { 0x0000a054, 0x00000000 },
+ { 0x0000a058, 0x00000000 },
+ { 0x0000a05c, 0x00000000 },
+ { 0x0000a060, 0x00000000 },
+ { 0x0000a064, 0x00000000 },
+ { 0x0000a068, 0x00000000 },
+ { 0x0000a06c, 0x00000000 },
+ { 0x0000a070, 0x00000000 },
+ { 0x0000a074, 0x00000000 },
+ { 0x0000a078, 0x00000000 },
+ { 0x0000a07c, 0x00000000 },
+ { 0x0000a080, 0x22222229 },
+ { 0x0000a084, 0x1d1d1d1d },
+ { 0x0000a088, 0x1d1d1d1d },
+ { 0x0000a08c, 0x1d1d1d1d },
+ { 0x0000a090, 0x171d1d1d },
+ { 0x0000a094, 0x11111717 },
+ { 0x0000a098, 0x00030311 },
+ { 0x0000a09c, 0x00000000 },
+ { 0x0000a0a0, 0x00000000 },
+ { 0x0000a0a4, 0x00000000 },
+ { 0x0000a0a8, 0x00000000 },
+ { 0x0000a0ac, 0x00000000 },
+ { 0x0000a0b0, 0x00000000 },
+ { 0x0000a0b4, 0x00000000 },
+ { 0x0000a0b8, 0x00000000 },
+ { 0x0000a0bc, 0x00000000 },
+ { 0x0000a0c0, 0x001f0000 },
+ { 0x0000a0c4, 0x01000101 },
+ { 0x0000a0c8, 0x011e011f },
+ { 0x0000a0cc, 0x011c011d },
+ { 0x0000a0d0, 0x02030204 },
+ { 0x0000a0d4, 0x02010202 },
+ { 0x0000a0d8, 0x021f0200 },
+ { 0x0000a0dc, 0x0302021e },
+ { 0x0000a0e0, 0x03000301 },
+ { 0x0000a0e4, 0x031e031f },
+ { 0x0000a0e8, 0x0402031d },
+ { 0x0000a0ec, 0x04000401 },
+ { 0x0000a0f0, 0x041e041f },
+ { 0x0000a0f4, 0x0502041d },
+ { 0x0000a0f8, 0x05000501 },
+ { 0x0000a0fc, 0x051e051f },
+ { 0x0000a100, 0x06010602 },
+ { 0x0000a104, 0x061f0600 },
+ { 0x0000a108, 0x061d061e },
+ { 0x0000a10c, 0x07020703 },
+ { 0x0000a110, 0x07000701 },
+ { 0x0000a114, 0x00000000 },
+ { 0x0000a118, 0x00000000 },
+ { 0x0000a11c, 0x00000000 },
+ { 0x0000a120, 0x00000000 },
+ { 0x0000a124, 0x00000000 },
+ { 0x0000a128, 0x00000000 },
+ { 0x0000a12c, 0x00000000 },
+ { 0x0000a130, 0x00000000 },
+ { 0x0000a134, 0x00000000 },
+ { 0x0000a138, 0x00000000 },
+ { 0x0000a13c, 0x00000000 },
+ { 0x0000a140, 0x001f0000 },
+ { 0x0000a144, 0x01000101 },
+ { 0x0000a148, 0x011e011f },
+ { 0x0000a14c, 0x011c011d },
+ { 0x0000a150, 0x02030204 },
+ { 0x0000a154, 0x02010202 },
+ { 0x0000a158, 0x021f0200 },
+ { 0x0000a15c, 0x0302021e },
+ { 0x0000a160, 0x03000301 },
+ { 0x0000a164, 0x031e031f },
+ { 0x0000a168, 0x0402031d },
+ { 0x0000a16c, 0x04000401 },
+ { 0x0000a170, 0x041e041f },
+ { 0x0000a174, 0x0502041d },
+ { 0x0000a178, 0x05000501 },
+ { 0x0000a17c, 0x051e051f },
+ { 0x0000a180, 0x06010602 },
+ { 0x0000a184, 0x061f0600 },
+ { 0x0000a188, 0x061d061e },
+ { 0x0000a18c, 0x07020703 },
+ { 0x0000a190, 0x07000701 },
+ { 0x0000a194, 0x00000000 },
+ { 0x0000a198, 0x00000000 },
+ { 0x0000a19c, 0x00000000 },
+ { 0x0000a1a0, 0x00000000 },
+ { 0x0000a1a4, 0x00000000 },
+ { 0x0000a1a8, 0x00000000 },
+ { 0x0000a1ac, 0x00000000 },
+ { 0x0000a1b0, 0x00000000 },
+ { 0x0000a1b4, 0x00000000 },
+ { 0x0000a1b8, 0x00000000 },
+ { 0x0000a1bc, 0x00000000 },
+ { 0x0000a1c0, 0x00000000 },
+ { 0x0000a1c4, 0x00000000 },
+ { 0x0000a1c8, 0x00000000 },
+ { 0x0000a1cc, 0x00000000 },
+ { 0x0000a1d0, 0x00000000 },
+ { 0x0000a1d4, 0x00000000 },
+ { 0x0000a1d8, 0x00000000 },
+ { 0x0000a1dc, 0x00000000 },
+ { 0x0000a1e0, 0x00000000 },
+ { 0x0000a1e4, 0x00000000 },
+ { 0x0000a1e8, 0x00000000 },
+ { 0x0000a1ec, 0x00000000 },
+ { 0x0000a1f0, 0x00000396 },
+ { 0x0000a1f4, 0x00000396 },
+ { 0x0000a1f8, 0x00000396 },
+ { 0x0000a1fc, 0x00000196 },
+ { 0x0000b000, 0x00010000 },
+ { 0x0000b004, 0x00030002 },
+ { 0x0000b008, 0x00050004 },
+ { 0x0000b00c, 0x00810080 },
+ { 0x0000b010, 0x00830082 },
+ { 0x0000b014, 0x01810180 },
+ { 0x0000b018, 0x01830182 },
+ { 0x0000b01c, 0x01850184 },
+ { 0x0000b020, 0x02810280 },
+ { 0x0000b024, 0x02830282 },
+ { 0x0000b028, 0x02850284 },
+ { 0x0000b02c, 0x02890288 },
+ { 0x0000b030, 0x028b028a },
+ { 0x0000b034, 0x0388028c },
+ { 0x0000b038, 0x038a0389 },
+ { 0x0000b03c, 0x038c038b },
+ { 0x0000b040, 0x0390038d },
+ { 0x0000b044, 0x03920391 },
+ { 0x0000b048, 0x03940393 },
+ { 0x0000b04c, 0x03960395 },
+ { 0x0000b050, 0x00000000 },
+ { 0x0000b054, 0x00000000 },
+ { 0x0000b058, 0x00000000 },
+ { 0x0000b05c, 0x00000000 },
+ { 0x0000b060, 0x00000000 },
+ { 0x0000b064, 0x00000000 },
+ { 0x0000b068, 0x00000000 },
+ { 0x0000b06c, 0x00000000 },
+ { 0x0000b070, 0x00000000 },
+ { 0x0000b074, 0x00000000 },
+ { 0x0000b078, 0x00000000 },
+ { 0x0000b07c, 0x00000000 },
+ { 0x0000b080, 0x23232323 },
+ { 0x0000b084, 0x21232323 },
+ { 0x0000b088, 0x19191c1e },
+ { 0x0000b08c, 0x12141417 },
+ { 0x0000b090, 0x07070e0e },
+ { 0x0000b094, 0x03030305 },
+ { 0x0000b098, 0x00000003 },
+ { 0x0000b09c, 0x00000000 },
+ { 0x0000b0a0, 0x00000000 },
+ { 0x0000b0a4, 0x00000000 },
+ { 0x0000b0a8, 0x00000000 },
+ { 0x0000b0ac, 0x00000000 },
+ { 0x0000b0b0, 0x00000000 },
+ { 0x0000b0b4, 0x00000000 },
+ { 0x0000b0b8, 0x00000000 },
+ { 0x0000b0bc, 0x00000000 },
+ { 0x0000b0c0, 0x003f0020 },
+ { 0x0000b0c4, 0x00400041 },
+ { 0x0000b0c8, 0x0140005f },
+ { 0x0000b0cc, 0x0160015f },
+ { 0x0000b0d0, 0x017e017f },
+ { 0x0000b0d4, 0x02410242 },
+ { 0x0000b0d8, 0x025f0240 },
+ { 0x0000b0dc, 0x027f0260 },
+ { 0x0000b0e0, 0x0341027e },
+ { 0x0000b0e4, 0x035f0340 },
+ { 0x0000b0e8, 0x037f0360 },
+ { 0x0000b0ec, 0x04400441 },
+ { 0x0000b0f0, 0x0460045f },
+ { 0x0000b0f4, 0x0541047f },
+ { 0x0000b0f8, 0x055f0540 },
+ { 0x0000b0fc, 0x057f0560 },
+ { 0x0000b100, 0x06400641 },
+ { 0x0000b104, 0x0660065f },
+ { 0x0000b108, 0x067e067f },
+ { 0x0000b10c, 0x07410742 },
+ { 0x0000b110, 0x075f0740 },
+ { 0x0000b114, 0x077f0760 },
+ { 0x0000b118, 0x07800781 },
+ { 0x0000b11c, 0x07a0079f },
+ { 0x0000b120, 0x07c107bf },
+ { 0x0000b124, 0x000007c0 },
+ { 0x0000b128, 0x00000000 },
+ { 0x0000b12c, 0x00000000 },
+ { 0x0000b130, 0x00000000 },
+ { 0x0000b134, 0x00000000 },
+ { 0x0000b138, 0x00000000 },
+ { 0x0000b13c, 0x00000000 },
+ { 0x0000b140, 0x003f0020 },
+ { 0x0000b144, 0x00400041 },
+ { 0x0000b148, 0x0140005f },
+ { 0x0000b14c, 0x0160015f },
+ { 0x0000b150, 0x017e017f },
+ { 0x0000b154, 0x02410242 },
+ { 0x0000b158, 0x025f0240 },
+ { 0x0000b15c, 0x027f0260 },
+ { 0x0000b160, 0x0341027e },
+ { 0x0000b164, 0x035f0340 },
+ { 0x0000b168, 0x037f0360 },
+ { 0x0000b16c, 0x04400441 },
+ { 0x0000b170, 0x0460045f },
+ { 0x0000b174, 0x0541047f },
+ { 0x0000b178, 0x055f0540 },
+ { 0x0000b17c, 0x057f0560 },
+ { 0x0000b180, 0x06400641 },
+ { 0x0000b184, 0x0660065f },
+ { 0x0000b188, 0x067e067f },
+ { 0x0000b18c, 0x07410742 },
+ { 0x0000b190, 0x075f0740 },
+ { 0x0000b194, 0x077f0760 },
+ { 0x0000b198, 0x07800781 },
+ { 0x0000b19c, 0x07a0079f },
+ { 0x0000b1a0, 0x07c107bf },
+ { 0x0000b1a4, 0x000007c0 },
+ { 0x0000b1a8, 0x00000000 },
+ { 0x0000b1ac, 0x00000000 },
+ { 0x0000b1b0, 0x00000000 },
+ { 0x0000b1b4, 0x00000000 },
+ { 0x0000b1b8, 0x00000000 },
+ { 0x0000b1bc, 0x00000000 },
+ { 0x0000b1c0, 0x00000000 },
+ { 0x0000b1c4, 0x00000000 },
+ { 0x0000b1c8, 0x00000000 },
+ { 0x0000b1cc, 0x00000000 },
+ { 0x0000b1d0, 0x00000000 },
+ { 0x0000b1d4, 0x00000000 },
+ { 0x0000b1d8, 0x00000000 },
+ { 0x0000b1dc, 0x00000000 },
+ { 0x0000b1e0, 0x00000000 },
+ { 0x0000b1e4, 0x00000000 },
+ { 0x0000b1e8, 0x00000000 },
+ { 0x0000b1ec, 0x00000000 },
+ { 0x0000b1f0, 0x00000396 },
+ { 0x0000b1f4, 0x00000396 },
+ { 0x0000b1f8, 0x00000396 },
+ { 0x0000b1fc, 0x00000196 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_mac_postamble[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160 },
+ { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c },
+ { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38 },
+ { 0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00 },
+ { 0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b },
+ { 0x00008120, 0x18f04800, 0x18f04800, 0x18f04810, 0x18f04810 },
+ { 0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a },
+ { 0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_baseband_postamble_dfs_channel[][3] = {
+/* Addr 5G_HT20 5G_HT40 */
+ { 0x00009824, 0x5ac668d0, 0x5ac668d0 },
+ { 0x00009e0c, 0x6d4000e2, 0x6d4000e2 },
+ { 0x00009e14, 0x37b9625e, 0x37b9625e },
+};
+
+static const u_int32_t qca953xModes_no_xpa_tx_gain_table_honeybee_1p0[][2] = {
+/* Addr allmodes */
+ { 0x0000a2dc, 0xffd5f552 },
+ { 0x0000a2e0, 0xffe60664 },
+ { 0x0000a2e4, 0xfff80780 },
+ { 0x0000a2e8, 0xfffff800 },
+ { 0x0000a410, 0x000050d6 },
+ { 0x0000a500, 0x00060020 },
+ { 0x0000a504, 0x04060060 },
+ { 0x0000a508, 0x080600a0 },
+ { 0x0000a50c, 0x0c068020 },
+ { 0x0000a510, 0x10068060 },
+ { 0x0000a514, 0x140680a0 },
+ { 0x0000a518, 0x18090040 },
+ { 0x0000a51c, 0x1b090080 },
+ { 0x0000a520, 0x1f0900c0 },
+ { 0x0000a524, 0x240c0041 },
+ { 0x0000a528, 0x280d0021 },
+ { 0x0000a52c, 0x2d0f0061 },
+ { 0x0000a530, 0x310f00a1 },
+ { 0x0000a534, 0x350e00a2 },
+ { 0x0000a538, 0x360e80a2 },
+ { 0x0000a53c, 0x380f00a2 },
+ { 0x0000a540, 0x3b0e00a3 },
+ { 0x0000a544, 0x3d110083 },
+ { 0x0000a548, 0x3e1100a3 },
+ { 0x0000a54c, 0x401100e3 },
+ { 0x0000a550, 0x421380e3 },
+ { 0x0000a554, 0x431780e3 },
+ { 0x0000a558, 0x461f80e3 },
+ { 0x0000a55c, 0x461f80e3 },
+ { 0x0000a560, 0x461f80e3 },
+ { 0x0000a564, 0x461f80e3 },
+ { 0x0000a568, 0x461f80e3 },
+ { 0x0000a56c, 0x461f80e3 },
+ { 0x0000a570, 0x461f80e3 },
+ { 0x0000a574, 0x461f80e3 },
+ { 0x0000a578, 0x461f80e3 },
+ { 0x0000a57c, 0x461f80e3 },
+ { 0x0000a600, 0x00000000 },
+ { 0x0000a604, 0x00000000 },
+ { 0x0000a608, 0x00000000 },
+ { 0x0000a60c, 0x00804201 },
+ { 0x0000a610, 0x01008201 },
+ { 0x0000a614, 0x0180c402 },
+ { 0x0000a618, 0x0180c603 },
+ { 0x0000a61c, 0x0180c603 },
+ { 0x0000a620, 0x01c10603 },
+ { 0x0000a624, 0x01c10704 },
+ { 0x0000a628, 0x02c18b05 },
+ { 0x0000a62c, 0x0301cc07 },
+ { 0x0000a630, 0x0301cc07 },
+ { 0x0000a634, 0x0301cc07 },
+ { 0x0000a638, 0x0301cc07 },
+ { 0x0000a63c, 0x0301cc07 },
+ { 0x0000b2dc, 0xffd5f552 },
+ { 0x0000b2e0, 0xffe60664 },
+ { 0x0000b2e4, 0xfff80780 },
+ { 0x0000b2e8, 0xfffff800 },
+ { 0x00016044, 0x049242db },
+ { 0x00016048, 0x6c927a70 },
+ { 0x00016444, 0x049242db },
+ { 0x00016448, 0x6c927a70 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_baseband_core_emulation[][2] = {
+/* Addr allmodes */
+ { 0x00009800, 0xafa68e30 },
+ { 0x00009884, 0x00002842 },
+ { 0x00009c04, 0xff55ff55 },
+ { 0x00009c08, 0x0320ff55 },
+ { 0x00009e50, 0x00000000 },
+ { 0x00009fcc, 0x00000014 },
+ { 0x0000a344, 0x00000010 },
+ { 0x0000a398, 0x00000000 },
+ { 0x0000a39c, 0x71733d01 },
+ { 0x0000a3a0, 0xd0ad5c12 },
+ { 0x0000a3c0, 0x22222220 },
+ { 0x0000a3c4, 0x22222222 },
+ { 0x0000a404, 0x00418a11 },
+ { 0x0000a418, 0x050001ce },
+ { 0x0000a438, 0x00001800 },
+ { 0x0000a458, 0x93444452 },
+ { 0x0000a690, 0x08000038 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_soc_preamble[][2] = {
+/* Addr allmodes */
+ { 0x00007000, 0x00000000 },
+ { 0x00007004, 0x00000000 },
+ { 0x00007008, 0x00000000 },
+ { 0x0000700c, 0x00000000 },
+ { 0x0000701c, 0x00000000 },
+ { 0x00007020, 0x00000000 },
+ { 0x00007024, 0x00000000 },
+ { 0x00007028, 0x00000000 },
+ { 0x0000702c, 0x00000000 },
+ { 0x00007030, 0x00000000 },
+ { 0x00007034, 0x00000002 },
+ { 0x00007038, 0x000004c2 },
+ { 0x00007048, 0x00000000 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_baseband_core_txfir_coeff_japan_2484[][2] = {
+/* Addr allmodes */
+ { 0x0000a398, 0x00000000 },
+ { 0x0000a39c, 0x6f7f0301 },
+ { 0x0000a3a0, 0xca9228ee },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_mac_core[][2] = {
+/* Addr allmodes */
+ { 0x00000008, 0x00000000 },
+ { 0x00000030, 0x00020085 },
+ { 0x00000034, 0x00000005 },
+ { 0x00000040, 0x00000000 },
+ { 0x00000044, 0x00000000 },
+ { 0x00000048, 0x00000008 },
+ { 0x0000004c, 0x00000010 },
+ { 0x00000050, 0x00000000 },
+ { 0x00001040, 0x002ffc0f },
+ { 0x00001044, 0x002ffc0f },
+ { 0x00001048, 0x002ffc0f },
+ { 0x0000104c, 0x002ffc0f },
+ { 0x00001050, 0x002ffc0f },
+ { 0x00001054, 0x002ffc0f },
+ { 0x00001058, 0x002ffc0f },
+ { 0x0000105c, 0x002ffc0f },
+ { 0x00001060, 0x002ffc0f },
+ { 0x00001064, 0x002ffc0f },
+ { 0x000010f0, 0x00000100 },
+ { 0x00001270, 0x00000000 },
+ { 0x000012b0, 0x00000000 },
+ { 0x000012f0, 0x00000000 },
+ { 0x0000143c, 0x00000000 },
+ { 0x0000147c, 0x00000000 },
+ { 0x00008000, 0x00000000 },
+ { 0x00008004, 0x00000000 },
+ { 0x00008008, 0x00000000 },
+ { 0x0000800c, 0x00000000 },
+ { 0x00008018, 0x00000000 },
+ { 0x00008020, 0x00000000 },
+ { 0x00008038, 0x00000000 },
+ { 0x0000803c, 0x00000000 },
+ { 0x00008040, 0x00000000 },
+ { 0x00008044, 0x00000000 },
+ { 0x00008048, 0x00000000 },
+ { 0x0000804c, 0xffffffff },
+ { 0x00008054, 0x00000000 },
+ { 0x00008058, 0x00000000 },
+ { 0x0000805c, 0x000fc78f },
+ { 0x00008060, 0x0000000f },
+ { 0x00008064, 0x00000000 },
+ { 0x00008070, 0x00000310 },
+ { 0x00008074, 0x00000020 },
+ { 0x00008078, 0x00000000 },
+ { 0x0000809c, 0x0000000f },
+ { 0x000080a0, 0x00000000 },
+ { 0x000080a4, 0x02ff0000 },
+ { 0x000080a8, 0x0e070605 },
+ { 0x000080ac, 0x0000000d },
+ { 0x000080b0, 0x00000000 },
+ { 0x000080b4, 0x00000000 },
+ { 0x000080b8, 0x00000000 },
+ { 0x000080bc, 0x00000000 },
+ { 0x000080c0, 0x2a800000 },
+ { 0x000080c4, 0x06900168 },
+ { 0x000080c8, 0x13881c22 },
+ { 0x000080cc, 0x01f40000 },
+ { 0x000080d0, 0x00252500 },
+ { 0x000080d4, 0x00a00000 },
+ { 0x000080d8, 0x00400000 },
+ { 0x000080dc, 0x00000000 },
+ { 0x000080e0, 0xffffffff },
+ { 0x000080e4, 0x0000ffff },
+ { 0x000080e8, 0x3f3f3f3f },
+ { 0x000080ec, 0x00000000 },
+ { 0x000080f0, 0x00000000 },
+ { 0x000080f4, 0x00000000 },
+ { 0x000080fc, 0x00020000 },
+ { 0x00008100, 0x00000000 },
+ { 0x00008108, 0x00000052 },
+ { 0x0000810c, 0x00000000 },
+ { 0x00008110, 0x00000000 },
+ { 0x00008114, 0x000007ff },
+ { 0x00008118, 0x000000aa },
+ { 0x0000811c, 0x00003210 },
+ { 0x00008124, 0x00000000 },
+ { 0x00008128, 0x00000000 },
+ { 0x0000812c, 0x00000000 },
+ { 0x00008130, 0x00000000 },
+ { 0x00008134, 0x00000000 },
+ { 0x00008138, 0x00000000 },
+ { 0x0000813c, 0x0000ffff },
+ { 0x00008140, 0x000000fe },
+ { 0x00008144, 0xffffffff },
+ { 0x00008168, 0x00000000 },
+ { 0x0000816c, 0x00000000 },
+ { 0x000081c0, 0x00000000 },
+ { 0x000081c4, 0x33332210 },
+ { 0x000081ec, 0x00000000 },
+ { 0x000081f0, 0x00000000 },
+ { 0x000081f4, 0x00000000 },
+ { 0x000081f8, 0x00000000 },
+ { 0x000081fc, 0x00000000 },
+ { 0x00008240, 0x00100000 },
+ { 0x00008244, 0x0010f3d7 },
+ { 0x00008248, 0x00000852 },
+ { 0x0000824c, 0x0001e7ae },
+ { 0x00008250, 0x00000000 },
+ { 0x00008254, 0x00000000 },
+ { 0x00008258, 0x00000000 },
+ { 0x0000825c, 0x40000000 },
+ { 0x00008260, 0x00080922 },
+ { 0x00008264, 0x9d400010 },
+ { 0x00008268, 0xffffffff },
+ { 0x0000826c, 0x0000ffff },
+ { 0x00008270, 0x00000000 },
+ { 0x00008274, 0x40000000 },
+ { 0x00008278, 0x003e4180 },
+ { 0x0000827c, 0x00000004 },
+ { 0x00008284, 0x0000002c },
+ { 0x00008288, 0x0000002c },
+ { 0x0000828c, 0x000000ff },
+ { 0x00008294, 0x00000000 },
+ { 0x00008298, 0x00000000 },
+ { 0x0000829c, 0x00000000 },
+ { 0x00008300, 0x00001d40 },
+ { 0x00008314, 0x00000000 },
+ { 0x0000831c, 0x0000010d },
+ { 0x00008328, 0x00000000 },
+ { 0x0000832c, 0x0000001f },
+ { 0x00008330, 0x00000302 },
+ { 0x00008334, 0x00000700 },
+ { 0x00008338, 0xffff0000 },
+ { 0x0000833c, 0x02400000 },
+ { 0x00008340, 0x000107ff },
+ { 0x00008344, 0xaa48107b },
+ { 0x00008348, 0x008f0000 },
+ { 0x0000835c, 0x00000000 },
+ { 0x00008360, 0xffffffff },
+ { 0x00008364, 0xffffffff },
+ { 0x00008368, 0x00000000 },
+ { 0x00008370, 0x00000000 },
+ { 0x00008374, 0x000000ff },
+ { 0x00008378, 0x00000000 },
+ { 0x0000837c, 0x00000000 },
+ { 0x00008380, 0xffffffff },
+ { 0x00008384, 0xffffffff },
+ { 0x00008390, 0xffffffff },
+ { 0x00008394, 0xffffffff },
+ { 0x00008398, 0x00000000 },
+ { 0x0000839c, 0x00000000 },
+ { 0x000083a0, 0x00000000 },
+ { 0x000083a4, 0x0000fa14 },
+ { 0x000083a8, 0x000f0c00 },
+ { 0x000083ac, 0x33332210 },
+ { 0x000083b0, 0x33332210 },
+ { 0x000083b4, 0x33332210 },
+ { 0x000083b8, 0x33332210 },
+ { 0x000083bc, 0x00000000 },
+ { 0x000083c0, 0x00000000 },
+ { 0x000083c4, 0x00000000 },
+ { 0x000083c8, 0x00000000 },
+ { 0x000083cc, 0x00000200 },
+ { 0x000083d0, 0x8c7901ff },
+};
+
+static const u_int32_t qca953xModes_xpa_tx_gain_table_honeybee_1p0[][2] = {
+/* Addr allmodes */
+ { 0x0000a2dc, 0xfffd5aaa },
+ { 0x0000a2e0, 0xfffe9ccc },
+ { 0x0000a2e4, 0xffffe0f0 },
+ { 0x0000a2e8, 0xfffcff00 },
+ { 0x0000a410, 0x000050da },
+ { 0x0000a500, 0x00000000 },
+ { 0x0000a504, 0x04000002 },
+ { 0x0000a508, 0x08000004 },
+ { 0x0000a50c, 0x0c000006 },
+ { 0x0000a510, 0x0f00000a },
+ { 0x0000a514, 0x1300000c },
+ { 0x0000a518, 0x1700000e },
+ { 0x0000a51c, 0x1b000064 },
+ { 0x0000a520, 0x1f000242 },
+ { 0x0000a524, 0x23000229 },
+ { 0x0000a528, 0x270002a2 },
+ { 0x0000a52c, 0x2c001203 },
+ { 0x0000a530, 0x30001803 },
+ { 0x0000a534, 0x33000881 },
+ { 0x0000a538, 0x38001809 },
+ { 0x0000a53c, 0x3a000814 },
+ { 0x0000a540, 0x3f001a0c },
+ { 0x0000a544, 0x43001a0e },
+ { 0x0000a548, 0x46001812 },
+ { 0x0000a54c, 0x49001884 },
+ { 0x0000a550, 0x4d001e84 },
+ { 0x0000a554, 0x50001e69 },
+ { 0x0000a558, 0x550006f4 },
+ { 0x0000a55c, 0x59000ad3 },
+ { 0x0000a560, 0x5e000ad5 },
+ { 0x0000a564, 0x61001ced },
+ { 0x0000a568, 0x660018d4 },
+ { 0x0000a56c, 0x660018d4 },
+ { 0x0000a570, 0x660018d4 },
+ { 0x0000a574, 0x660018d4 },
+ { 0x0000a578, 0x660018d4 },
+ { 0x0000a57c, 0x660018d4 },
+ { 0x0000a600, 0x00000000 },
+ { 0x0000a604, 0x00000000 },
+ { 0x0000a608, 0x00000000 },
+ { 0x0000a60c, 0x03804000 },
+ { 0x0000a610, 0x0300ca02 },
+ { 0x0000a614, 0x00000e04 },
+ { 0x0000a618, 0x03014000 },
+ { 0x0000a61c, 0x00000000 },
+ { 0x0000a620, 0x00000000 },
+ { 0x0000a624, 0x03014000 },
+ { 0x0000a628, 0x03804c05 },
+ { 0x0000a62c, 0x0701de06 },
+ { 0x0000a630, 0x07819c07 },
+ { 0x0000a634, 0x0701dc07 },
+ { 0x0000a638, 0x0701dc07 },
+ { 0x0000a63c, 0x0701dc07 },
+ { 0x0000b2dc, 0xfffd5aaa },
+ { 0x0000b2e0, 0xfffe9ccc },
+ { 0x0000b2e4, 0xffffe0f0 },
+ { 0x0000b2e8, 0xfffcff00 },
+ { 0x00016044, 0x010002d4 },
+ { 0x00016048, 0x66482400 },
+ { 0x00016280, 0x01000015 },
+ { 0x00016444, 0x010002d4 },
+ { 0x00016448, 0x66482400 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_soc_postamble[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00007010, 0x00000023, 0x00000023, 0x00000023, 0x00000023 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_baseband_postamble[][5] = {
+/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
+ { 0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011 },
+ { 0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e },
+ { 0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0 },
+ { 0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881 },
+ { 0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4 },
+ { 0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c },
+ { 0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4 },
+ { 0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0 },
+ { 0x00009e04, 0x001c2020, 0x001c2020, 0x001c2020, 0x001c2020 },
+ { 0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2 },
+ { 0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e },
+ { 0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e },
+ { 0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+ { 0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c },
+ { 0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce },
+ { 0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021 },
+ { 0x00009e3c, 0xcfa10820, 0xcfa10820, 0xcfa10822, 0xcfa10822 },
+ { 0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27 },
+ { 0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012 },
+ { 0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000 },
+ { 0x0000a204, 0x005c0ec0, 0x005c0ec4, 0x005c0ec4, 0x005c0ec0 },
+ { 0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004 },
+ { 0x0000a22c, 0x07e26a2f, 0x07e26a2f, 0x01026a2f, 0x01026a2f },
+ { 0x0000a230, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b },
+ { 0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff },
+ { 0x0000a238, 0xffb01018, 0xffb01018, 0xffb01018, 0xffb01018 },
+ { 0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108 },
+ { 0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898 },
+ { 0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002 },
+ { 0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01010e0e, 0x01010e0e },
+ { 0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501 },
+ { 0x0000a264, 0x00000e0e, 0x00000e0e, 0x01000e0e, 0x01000e0e },
+ { 0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b },
+ { 0x0000a284, 0x00000000, 0x00000000, 0x00000010, 0x00000010 },
+ { 0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110 },
+ { 0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222 },
+ { 0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18 },
+ { 0x0000a2cc, 0x18c50033, 0x18c43433, 0x18c41033, 0x18c44c33 },
+ { 0x0000a2d0, 0x00041982, 0x00041982, 0x00041982, 0x00041982 },
+ { 0x0000a2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b },
+ { 0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+ { 0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c },
+ { 0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x001c0000 },
+ { 0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+ { 0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c },
+ { 0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce },
+ { 0x0000b284, 0x00000000, 0x00000000, 0x00000010, 0x00000010 },
+};
+
+static const u_int32_t qca953x_honeybee_1p0_mac_core_emulation[][2] = {
+/* Addr allmodes */
+ { 0x00000030, 0x00020085 },
+ { 0x00000044, 0x00000008 },
+ { 0x0000805c, 0xffffc7ff },
+ { 0x00008344, 0xaa4a105b },
+};
+
diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c
index 026a9b6..5250651 100644
--- a/sys/ddb/db_run.c
+++ b/sys/ddb/db_run.c
@@ -65,16 +65,28 @@ int db_inst_count;
int db_load_count;
int db_store_count;
+#ifdef SOFTWARE_SSTEP
+db_breakpoint_t db_not_taken_bkpt = 0;
+db_breakpoint_t db_taken_bkpt = 0;
+#endif
+
#ifndef db_set_single_step
void db_set_single_step(void);
#endif
#ifndef db_clear_single_step
void db_clear_single_step(void);
#endif
-
+#ifndef db_pc_is_singlestep
+static bool
+db_pc_is_singlestep(db_addr_t pc)
+{
#ifdef SOFTWARE_SSTEP
-db_breakpoint_t db_not_taken_bkpt = 0;
-db_breakpoint_t db_taken_bkpt = 0;
+ if ((db_not_taken_bkpt != 0 && pc == db_not_taken_bkpt->address)
+ || (db_taken_bkpt != 0 && pc == db_taken_bkpt->address))
+ return (true);
+#endif
+ return (false);
+}
#endif
bool
@@ -84,11 +96,9 @@ db_stop_at_pc(bool *is_breakpoint)
db_breakpoint_t bkpt;
pc = PC_REGS();
-#ifdef SOFTWARE_SSTEP
- if ((db_not_taken_bkpt != 0 && pc == db_not_taken_bkpt->address)
- || (db_taken_bkpt != 0 && pc == db_taken_bkpt->address))
+
+ if (db_pc_is_singlestep(pc))
*is_breakpoint = false;
-#endif
db_clear_single_step();
db_clear_breakpoints();
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 6a2c766..7fe3da8 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -483,6 +483,7 @@ ahci_intr(void *data)
/* AHCI declares level triggered IS. */
if (!(ctlr->quirks & AHCI_Q_EDGEIS))
ATA_OUTL(ctlr->r_mem, AHCI_IS, is);
+ ATA_RBL(ctlr->r_mem, AHCI_IS);
}
/*
@@ -501,6 +502,7 @@ ahci_intr_one(void *data)
ctlr->interrupt[unit].function(arg);
/* AHCI declares level triggered IS. */
ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
+ ATA_RBL(ctlr->r_mem, AHCI_IS);
}
static void
@@ -516,6 +518,7 @@ ahci_intr_one_edge(void *data)
ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit);
if ((arg = ctlr->interrupt[unit].argument))
ctlr->interrupt[unit].function(arg);
+ ATA_RBL(ctlr->r_mem, AHCI_IS);
}
struct resource *
@@ -1606,10 +1609,15 @@ ahci_execute_transaction(struct ahci_slot *slot)
if ((ch->quirks & AHCI_Q_NOBSYRES) == 0 &&
(ch->quirks & AHCI_Q_ATI_PMP_BUG) == 0 &&
softreset == 2 && et == AHCI_ERR_NONE) {
- while ((val = fis[2]) & ATA_S_BUSY) {
- DELAY(10);
- if (count++ >= timeout)
+ for ( ; count < timeout; count++) {
+ bus_dmamap_sync(ch->dma.rfis_tag,
+ ch->dma.rfis_map, BUS_DMASYNC_POSTREAD);
+ val = fis[2];
+ bus_dmamap_sync(ch->dma.rfis_tag,
+ ch->dma.rfis_map, BUS_DMASYNC_PREREAD);
+ if ((val & ATA_S_BUSY) == 0)
break;
+ DELAY(10);
}
}
diff --git a/sys/dev/ahci/ahci.h b/sys/dev/ahci/ahci.h
index 0461953..5953425 100644
--- a/sys/dev/ahci/ahci.h
+++ b/sys/dev/ahci/ahci.h
@@ -562,6 +562,20 @@ enum ahci_err_type {
#define ATA_OUTSL_STRM(res, offset, addr, count) \
bus_write_multi_stream_4((res), (offset), (addr), (count))
+/*
+ * On some platforms, we must ensure proper interdevice write ordering.
+ * The AHCI interrupt status register must be updated in HW before
+ * registers in interrupt controller.
+ * Unfortunately, only way how we can do it is readback.
+ *
+ * Currently, only ARM is known to have this issue.
+ */
+#if defined(__arm__)
+#define ATA_RBL(res, offset) \
+ bus_read_4((res), (offset))
+#else
+#define ATA_RBL(res, offset)
+#endif
#define AHCI_Q_NOFORCE 0x00000001
#define AHCI_Q_NOPMP 0x00000002
diff --git a/sys/dev/ahci/ahci_generic.c b/sys/dev/ahci/ahci_generic.c
new file mode 100644
index 0000000..80f7fed
--- /dev/null
+++ b/sys/dev/ahci/ahci_generic.c
@@ -0,0 +1,131 @@
+/*-
+ * Copyright (c) 2009-2012 Alexander Motin <mav@FreeBSD.org>
+ * 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,
+ * without modification, immediately at the beginning of the file.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/module.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/endian.h>
+#include <sys/malloc.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/rman.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+
+#include <dev/ahci/ahci.h>
+
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+static struct ofw_compat_data compat_data[] = {
+ {"generic-ahci", 1},
+ {"snps,dwc-ahci", 1},
+ {NULL, 0}
+};
+
+static int
+ahci_gen_ctlr_reset(device_t dev)
+{
+
+ return ahci_ctlr_reset(dev);
+}
+
+static int
+ahci_probe(device_t dev)
+{
+
+ if (!ofw_bus_status_okay(dev))
+ return (ENXIO);
+
+ if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
+ return (ENXIO);
+
+ device_set_desc_copy(dev, "AHCI SATA controller");
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+ahci_gen_attach(device_t dev)
+{
+ struct ahci_controller *ctlr = device_get_softc(dev);
+ int error;
+
+ ctlr->r_rid = 0;
+ ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_rid,
+ RF_ACTIVE);
+ if (ctlr->r_mem == NULL)
+ return (ENXIO);
+
+ /* Setup controller defaults. */
+ ctlr->numirqs = 1;
+
+ /* Reset controller */
+ if ((error = ahci_gen_ctlr_reset(dev)) == 0)
+ error = ahci_attach(dev);
+
+ if (error != 0) {
+ if (ctlr->r_mem != NULL)
+ bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid,
+ ctlr->r_mem);
+ }
+ return error;
+}
+
+static int
+ahci_gen_detach(device_t dev)
+{
+
+ ahci_detach(dev);
+ return (0);
+}
+
+static devclass_t ahci_gen_devclass;
+static device_method_t ahci_methods[] = {
+ DEVMETHOD(device_probe, ahci_probe),
+ DEVMETHOD(device_attach, ahci_gen_attach),
+ DEVMETHOD(device_detach, ahci_gen_detach),
+ DEVMETHOD(bus_print_child, ahci_print_child),
+ DEVMETHOD(bus_alloc_resource, ahci_alloc_resource),
+ DEVMETHOD(bus_release_resource, ahci_release_resource),
+ DEVMETHOD(bus_setup_intr, ahci_setup_intr),
+ DEVMETHOD(bus_teardown_intr,ahci_teardown_intr),
+ DEVMETHOD(bus_child_location_str, ahci_child_location_str),
+ DEVMETHOD(bus_get_dma_tag, ahci_get_dma_tag),
+ DEVMETHOD_END
+};
+static driver_t ahci_driver = {
+ "ahci",
+ ahci_methods,
+ sizeof(struct ahci_controller)
+};
+DRIVER_MODULE(ahci, simplebus, ahci_driver, ahci_gen_devclass, NULL, NULL);
diff --git a/sys/dev/aic7xxx/aicasm/Makefile b/sys/dev/aic7xxx/aicasm/Makefile
index a3adbe9..51a3a90 100644
--- a/sys/dev/aic7xxx/aicasm/Makefile
+++ b/sys/dev/aic7xxx/aicasm/Makefile
@@ -13,8 +13,7 @@ GENHDRS= aicasm_gram.h aicasm_macro_gram.h
SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS}
CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g}
-DPADD= ${LIBL}
-LDADD= -ll
+LIBADD= l
WARNS?= 0
# Correct path for kernel builds
diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c
index f9885d3..f1eb7f3 100644
--- a/sys/dev/arcmsr/arcmsr.c
+++ b/sys/dev/arcmsr/arcmsr.c
@@ -76,6 +76,7 @@
** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4
** 1.20.00.28 09/13/2013 Ching Huang Removed recursive mutex in arcmsr_abort_dr_ccbs
** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883
+** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203
******************************************************************************************
*/
@@ -126,15 +127,15 @@ __FBSDID("$FreeBSD$");
**************************************************************************
*/
#if __FreeBSD_version >= 500005
- #include <sys/selinfo.h>
- #include <sys/mutex.h>
- #include <sys/endian.h>
- #include <dev/pci/pcivar.h>
- #include <dev/pci/pcireg.h>
+ #include <sys/selinfo.h>
+ #include <sys/mutex.h>
+ #include <sys/endian.h>
+ #include <dev/pci/pcivar.h>
+ #include <dev/pci/pcireg.h>
#else
- #include <sys/select.h>
- #include <pci/pcivar.h>
- #include <pci/pcireg.h>
+ #include <sys/select.h>
+ #include <pci/pcivar.h>
+ #include <pci/pcireg.h>
#endif
#if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025
@@ -147,7 +148,7 @@ __FBSDID("$FreeBSD$");
#define arcmsr_callout_init(a) callout_init(a);
#endif
-#define ARCMSR_DRIVER_VERSION "arcmsr version 1.20.00.29 2013-12-18"
+#define ARCMSR_DRIVER_VERSION "arcmsr version 1.30.00.00 2015-11-30"
#include <dev/arcmsr/arcmsr.h>
/*
**************************************************************************
@@ -181,8 +182,8 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
static int arcmsr_resume(device_t dev);
static int arcmsr_suspend(device_t dev);
static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb);
-static void arcmsr_polling_devmap(void *arg);
-static void arcmsr_srb_timeout(void *arg);
+static void arcmsr_polling_devmap(void *arg);
+static void arcmsr_srb_timeout(void *arg);
static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb);
#ifdef ARCMSR_DEBUG1
static void arcmsr_dump_data(struct AdapterControlBlock *acb);
@@ -220,11 +221,11 @@ static device_method_t arcmsr_methods[]={
{ 0, 0 }
#endif
};
-
+
static driver_t arcmsr_driver={
"arcmsr", arcmsr_methods, sizeof(struct AdapterControlBlock)
};
-
+
static devclass_t arcmsr_devclass;
DRIVER_MODULE(arcmsr, pci, arcmsr_driver, arcmsr_devclass, 0, 0);
MODULE_DEPEND(arcmsr, pci, 1, 1, 1);
@@ -247,38 +248,38 @@ static struct cdevsw arcmsr_cdevsw={
};
#else
#define ARCMSR_CDEV_MAJOR 180
-
+
static struct cdevsw arcmsr_cdevsw = {
- arcmsr_open, /* open */
- arcmsr_close, /* close */
- noread, /* read */
- nowrite, /* write */
- arcmsr_ioctl, /* ioctl */
- nopoll, /* poll */
- nommap, /* mmap */
- nostrategy, /* strategy */
- "arcmsr", /* name */
- ARCMSR_CDEV_MAJOR, /* major */
- nodump, /* dump */
- nopsize, /* psize */
- 0 /* flags */
+ arcmsr_open, /* open */
+ arcmsr_close, /* close */
+ noread, /* read */
+ nowrite, /* write */
+ arcmsr_ioctl, /* ioctl */
+ nopoll, /* poll */
+ nommap, /* mmap */
+ nostrategy, /* strategy */
+ "arcmsr", /* name */
+ ARCMSR_CDEV_MAJOR, /* major */
+ nodump, /* dump */
+ nopsize, /* psize */
+ 0 /* flags */
};
#endif
/*
**************************************************************************
**************************************************************************
*/
-#if __FreeBSD_version < 500005
+#if __FreeBSD_version < 500005
static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc)
#else
- #if __FreeBSD_version < 503000
+ #if __FreeBSD_version < 503000
static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc)
#else
static int arcmsr_open(struct cdev *dev, int flags, int fmt, struct thread *proc)
#endif
#endif
{
- #if __FreeBSD_version < 503000
+ #if __FreeBSD_version < 503000
struct AdapterControlBlock *acb = dev->si_drv1;
#else
int unit = dev2unit(dev);
@@ -293,17 +294,17 @@ static struct cdevsw arcmsr_cdevsw = {
**************************************************************************
**************************************************************************
*/
-#if __FreeBSD_version < 500005
+#if __FreeBSD_version < 500005
static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc)
#else
- #if __FreeBSD_version < 503000
+ #if __FreeBSD_version < 503000
static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc)
#else
static int arcmsr_close(struct cdev *dev, int flags, int fmt, struct thread *proc)
#endif
#endif
{
- #if __FreeBSD_version < 503000
+ #if __FreeBSD_version < 503000
struct AdapterControlBlock *acb = dev->si_drv1;
#else
int unit = dev2unit(dev);
@@ -318,17 +319,17 @@ static struct cdevsw arcmsr_cdevsw = {
**************************************************************************
**************************************************************************
*/
-#if __FreeBSD_version < 500005
+#if __FreeBSD_version < 500005
static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc)
#else
- #if __FreeBSD_version < 503000
+ #if __FreeBSD_version < 503000
static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc)
#else
static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc)
#endif
#endif
{
- #if __FreeBSD_version < 503000
+ #if __FreeBSD_version < 503000
struct AdapterControlBlock *acb = dev->si_drv1;
#else
int unit = dev2unit(dev);
@@ -347,7 +348,7 @@ static struct cdevsw arcmsr_cdevsw = {
static u_int32_t arcmsr_disable_allintr( struct AdapterControlBlock *acb)
{
u_int32_t intmask_org = 0;
-
+
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
/* disable all outbound interrupt */
@@ -356,10 +357,11 @@ static u_int32_t arcmsr_disable_allintr( struct AdapterControlBlock *acb)
}
break;
case ACB_ADAPTER_TYPE_B: {
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
/* disable all outbound interrupt */
- intmask_org = CHIP_REG_READ32(HBB_DOORBELL,
- 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */
+ intmask_org = READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask)
+ & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, 0); /* disable all interrupt */
}
break;
case ACB_ADAPTER_TYPE_C: {
@@ -384,7 +386,7 @@ static u_int32_t arcmsr_disable_allintr( struct AdapterControlBlock *acb)
static void arcmsr_enable_allintr( struct AdapterControlBlock *acb, u_int32_t intmask_org)
{
u_int32_t mask;
-
+
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
/* enable outbound Post Queue, outbound doorbell Interrupt */
@@ -394,9 +396,10 @@ static void arcmsr_enable_allintr( struct AdapterControlBlock *acb, u_int32_t in
}
break;
case ACB_ADAPTER_TYPE_B: {
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
/* enable ARCMSR_IOP2DRV_MESSAGE_CMD_DONE */
mask = (ARCMSR_IOP2DRV_DATA_WRITE_OK|ARCMSR_IOP2DRV_DATA_READ_OK|ARCMSR_IOP2DRV_CDB_DONE|ARCMSR_IOP2DRV_MESSAGE_CMD_DONE);
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell_mask, intmask_org | mask); /*1=interrupt enable, 0=interrupt disable*/
acb->outbound_int_enable = (intmask_org | mask) & 0x0000000f;
}
break;
@@ -425,7 +428,7 @@ static u_int8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb)
{
u_int32_t Index;
u_int8_t Retries = 0x00;
-
+
do {
for(Index=0; Index < 100; Index++) {
if(CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & ARCMSR_MU_OUTBOUND_MESSAGE0_INT) {
@@ -445,12 +448,13 @@ static u_int8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb)
{
u_int32_t Index;
u_int8_t Retries = 0x00;
-
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+
do {
for(Index=0; Index < 100; Index++) {
- if(CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) {
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
+ if(READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell) & ARCMSR_IOP2DRV_MESSAGE_CMD_DONE) {
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt*/
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
return TRUE;
}
UDELAY(10000);
@@ -466,7 +470,7 @@ static u_int8_t arcmsr_hbc_wait_msgint_ready(struct AdapterControlBlock *acb)
{
u_int32_t Index;
u_int8_t Retries = 0x00;
-
+
do {
for(Index=0; Index < 100; Index++) {
if(CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE) {
@@ -486,7 +490,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_ready(struct AdapterControlBlock *acb)
{
u_int32_t Index;
u_int8_t Retries = 0x00;
-
+
do {
for(Index=0; Index < 100; Index++) {
if(CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE) {
@@ -505,7 +509,7 @@ static u_int8_t arcmsr_hbd_wait_msgint_ready(struct AdapterControlBlock *acb)
static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb)
{
int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */
-
+
CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE);
do {
if(arcmsr_hba_wait_msgint_ready(acb)) {
@@ -522,9 +526,9 @@ static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb)
static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb)
{
int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */
-
- CHIP_REG_WRITE32(HBB_DOORBELL,
- 0, drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE);
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_FLUSH_CACHE);
do {
if(arcmsr_hbb_wait_msgint_ready(acb)) {
break;
@@ -540,7 +544,7 @@ static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb)
static void arcmsr_flush_hbc_cache(struct AdapterControlBlock *acb)
{
int retry_count = 30;/* enlarge wait flush adapter cache time: 10 minute */
-
+
CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE);
CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE);
do {
@@ -558,7 +562,7 @@ static void arcmsr_flush_hbc_cache(struct AdapterControlBlock *acb)
static void arcmsr_flush_hbd_cache(struct AdapterControlBlock *acb)
{
int retry_count = 30; /* enlarge wait flush adapter cache time: 10 minute */
-
+
CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_FLUSH_CACHE);
do {
if(arcmsr_hbd_wait_msgint_ready(acb)) {
@@ -600,7 +604,7 @@ static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb)
static int arcmsr_suspend(device_t dev)
{
struct AdapterControlBlock *acb = device_get_softc(dev);
-
+
/* flush controller */
arcmsr_iop_parking(acb);
/* disable all outbound interrupt */
@@ -614,7 +618,7 @@ static int arcmsr_suspend(device_t dev)
static int arcmsr_resume(device_t dev)
{
struct AdapterControlBlock *acb = device_get_softc(dev);
-
+
arcmsr_iop_init(acb);
return(0);
}
@@ -627,7 +631,7 @@ static void arcmsr_async(void *cb_arg, u_int32_t code, struct cam_path *path, vo
struct AdapterControlBlock *acb;
u_int8_t target_id, target_lun;
struct cam_sim *sim;
-
+
sim = (struct cam_sim *) cb_arg;
acb =(struct AdapterControlBlock *) cam_sim_softc(sim);
switch (code) {
@@ -650,7 +654,7 @@ static void arcmsr_async(void *cb_arg, u_int32_t code, struct cam_path *path, vo
static void arcmsr_report_sense_info(struct CommandControlBlock *srb)
{
union ccb *pccb = srb->pccb;
-
+
pccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
pccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
if(pccb->csio.sense_len) {
@@ -678,7 +682,8 @@ static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb)
*/
static void arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb)
{
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_ABORT_CMD);
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ABORT_CMD);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf("arcmsr%d: wait 'abort all outstanding command' timeout \n", acb->pci_unit);
}
@@ -739,12 +744,12 @@ static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag)
{
struct AdapterControlBlock *acb = srb->acb;
union ccb *pccb = srb->pccb;
-
+
if(srb->srb_flags & SRB_FLAG_TIMER_START)
callout_stop(&srb->ccb_callout);
if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
bus_dmasync_op_t op;
-
+
if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
op = BUS_DMASYNC_POSTREAD;
} else {
@@ -773,7 +778,7 @@ static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag)
static void arcmsr_report_srb_state(struct AdapterControlBlock *acb, struct CommandControlBlock *srb, u_int16_t error)
{
int target, lun;
-
+
target = srb->pccb->ccb_h.target_id;
lun = srb->pccb->ccb_h.target_lun;
if(error == FALSE) {
@@ -824,7 +829,7 @@ static void arcmsr_report_srb_state(struct AdapterControlBlock *acb, struct Comm
static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, u_int32_t flag_srb, u_int16_t error)
{
struct CommandControlBlock *srb;
-
+
/* check if command done with no error*/
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_C:
@@ -860,7 +865,7 @@ static void arcmsr_srb_timeout(void *arg)
struct AdapterControlBlock *acb;
int target, lun;
u_int8_t cmd;
-
+
target = srb->pccb->ccb_h.target_id;
lun = srb->pccb->ccb_h.target_lun;
acb = srb->acb;
@@ -876,7 +881,7 @@ static void arcmsr_srb_timeout(void *arg)
}
ARCMSR_LOCK_RELEASE(&acb->isr_lock);
#ifdef ARCMSR_DEBUG1
- arcmsr_dump_data(acb);
+ arcmsr_dump_data(acb);
#endif
}
@@ -889,29 +894,29 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
int i=0;
u_int32_t flag_srb;
u_int16_t error;
-
+
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
u_int32_t outbound_intstatus;
-
+
/*clear and abort all outbound posted Q*/
outbound_intstatus = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable;
CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_intstatus, outbound_intstatus);/*clear interrupt*/
while(((flag_srb=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_queueport)) != 0xFFFFFFFF) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) {
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
arcmsr_drain_donequeue(acb, flag_srb, error);
}
}
break;
case ACB_ADAPTER_TYPE_B: {
struct HBB_MessageUnit *phbbmu=(struct HBB_MessageUnit *)acb->pmu;
-
+
/*clear all outbound posted Q*/
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */
for(i=0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) {
if((flag_srb = phbbmu->done_qbuffer[i]) != 0) {
phbbmu->done_qbuffer[i] = 0;
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
arcmsr_drain_donequeue(acb, flag_srb, error);
}
phbbmu->post_qbuffer[i] = 0;
@@ -921,10 +926,10 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb)
}
break;
case ACB_ADAPTER_TYPE_C: {
-
+
while((CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR) && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) {
flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low);
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE;
arcmsr_drain_donequeue(acb, flag_srb, error);
}
}
@@ -944,7 +949,7 @@ static void arcmsr_iop_reset(struct AdapterControlBlock *acb)
struct CommandControlBlock *srb;
u_int32_t intmask_org;
u_int32_t i=0;
-
+
if(acb->srboutstandingcount>0) {
/* disable all outbound interrupt */
intmask_org = arcmsr_disable_allintr(acb);
@@ -985,7 +990,7 @@ static void arcmsr_build_srb(struct CommandControlBlock *srb,
union ccb *pccb = srb->pccb;
struct ccb_scsiio *pcsio = &pccb->csio;
u_int32_t arccdbsize = 0x30;
-
+
memset(arcmsr_cdb, 0, sizeof(struct ARCMSR_CDB));
arcmsr_cdb->Bus = 0;
arcmsr_cdb->TargetID = pccb->ccb_h.target_id;
@@ -997,7 +1002,7 @@ static void arcmsr_build_srb(struct CommandControlBlock *srb,
struct AdapterControlBlock *acb = srb->acb;
bus_dmasync_op_t op;
u_int32_t length, i, cdb_sgcount = 0;
-
+
if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
op = BUS_DMASYNC_PREREAD;
} else {
@@ -1019,11 +1024,11 @@ static void arcmsr_build_srb(struct CommandControlBlock *srb,
arccdbsize += sizeof(struct SG32ENTRY);
} else {
u_int32_t sg64s_size = 0, tmplength = length;
-
+
while(1) {
u_int64_t span4G, length0;
struct SG64ENTRY *pdma_sg = (struct SG64ENTRY *)psge;
-
+
span4G = (u_int64_t)address_lo + tmplength;
pdma_sg->addresshigh = address_hi;
pdma_sg->address = address_lo;
@@ -1056,8 +1061,8 @@ static void arcmsr_build_srb(struct CommandControlBlock *srb,
} else {
arcmsr_cdb->DataLength = 0;
}
- srb->arc_cdb_size = arccdbsize;
- arcmsr_cdb->msgPages = (arccdbsize/256) + ((arccdbsize % 256) ? 1 : 0);
+ srb->arc_cdb_size = arccdbsize;
+ arcmsr_cdb->msgPages = (arccdbsize/256) + ((arccdbsize % 256) ? 1 : 0);
}
/*
**************************************************************************
@@ -1067,7 +1072,7 @@ static void arcmsr_post_srb(struct AdapterControlBlock *acb, struct CommandContr
{
u_int32_t cdb_phyaddr_low = (u_int32_t) srb->cdb_phyaddr_low;
struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&srb->arcmsr_cdb;
-
+
bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, (srb->srb_flags & SRB_FLAG_WRITE) ? BUS_DMASYNC_POSTWRITE:BUS_DMASYNC_POSTREAD);
atomic_add_int(&acb->srboutstandingcount, 1);
srb->srb_state = ARCMSR_SRB_START;
@@ -1084,7 +1089,7 @@ static void arcmsr_post_srb(struct AdapterControlBlock *acb, struct CommandContr
case ACB_ADAPTER_TYPE_B: {
struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
int ending_index, index;
-
+
index = phbbmu->postq_index;
ending_index = ((index+1) % ARCMSR_MAX_HBB_POSTQUEUE);
phbbmu->post_qbuffer[ending_index] = 0;
@@ -1096,26 +1101,26 @@ static void arcmsr_post_srb(struct AdapterControlBlock *acb, struct CommandContr
index++;
index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */
phbbmu->postq_index = index;
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_CDB_POSTED);
}
break;
- case ACB_ADAPTER_TYPE_C: {
- u_int32_t ccb_post_stamp, arc_cdb_size, cdb_phyaddr_hi32;
+ case ACB_ADAPTER_TYPE_C: {
+ u_int32_t ccb_post_stamp, arc_cdb_size, cdb_phyaddr_hi32;
- arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size;
- ccb_post_stamp = (cdb_phyaddr_low | ((arc_cdb_size-1) >> 6) | 1);
+ arc_cdb_size = (srb->arc_cdb_size > 0x300) ? 0x300 : srb->arc_cdb_size;
+ ccb_post_stamp = (cdb_phyaddr_low | ((arc_cdb_size-1) >> 6) | 1);
cdb_phyaddr_hi32 = acb->srb_phyaddr.B.phyadd_high;
- if(cdb_phyaddr_hi32)
- {
- CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_high, cdb_phyaddr_hi32);
- CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp);
- }
- else
- {
- CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp);
- }
- }
- break;
+ if(cdb_phyaddr_hi32)
+ {
+ CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_high, cdb_phyaddr_hi32);
+ CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp);
+ }
+ else
+ {
+ CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp);
+ }
+ }
+ break;
case ACB_ADAPTER_TYPE_D: {
struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu;
u_int16_t index_stripped;
@@ -1153,29 +1158,29 @@ static void arcmsr_post_srb(struct AdapterControlBlock *acb, struct CommandContr
static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct AdapterControlBlock *acb)
{
struct QBUFFER *qbuffer=NULL;
-
+
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
struct HBA_MessageUnit *phbamu = (struct HBA_MessageUnit *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbamu->message_rbuffer;
}
break;
case ACB_ADAPTER_TYPE_B: {
struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_rbuffer;
}
break;
case ACB_ADAPTER_TYPE_C: {
struct HBC_MessageUnit *phbcmu = (struct HBC_MessageUnit *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbcmu->message_rbuffer;
}
break;
case ACB_ADAPTER_TYPE_D: {
struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_rbuffer;
}
break;
@@ -1189,29 +1194,29 @@ static struct QBUFFER *arcmsr_get_iop_rqbuffer( struct AdapterControlBlock *acb)
static struct QBUFFER *arcmsr_get_iop_wqbuffer( struct AdapterControlBlock *acb)
{
struct QBUFFER *qbuffer = NULL;
-
+
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
struct HBA_MessageUnit *phbamu = (struct HBA_MessageUnit *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbamu->message_wbuffer;
}
break;
case ACB_ADAPTER_TYPE_B: {
struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbbmu->hbb_rwbuffer->message_wbuffer;
}
break;
case ACB_ADAPTER_TYPE_C: {
struct HBC_MessageUnit *phbcmu = (struct HBC_MessageUnit *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbcmu->message_wbuffer;
}
break;
case ACB_ADAPTER_TYPE_D: {
struct HBD_MessageUnit0 *phbdmu = (struct HBD_MessageUnit0 *)acb->pmu;
-
+
qbuffer = (struct QBUFFER *)&phbdmu->phbdmu->message_wbuffer;
}
break;
@@ -1231,8 +1236,9 @@ static void arcmsr_iop_message_read(struct AdapterControlBlock *acb)
}
break;
case ACB_ADAPTER_TYPE_B: {
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
/* let IOP know data has been read */
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK);
}
break;
case ACB_ADAPTER_TYPE_C: {
@@ -1263,11 +1269,12 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb)
}
break;
case ACB_ADAPTER_TYPE_B: {
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
/*
** push inbound doorbell tell iop, driver data write ok
** and wait reply on next hwinterrupt for next Qbuffer post
*/
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_WRITE_OK);
}
break;
case ACB_ADAPTER_TYPE_C: {
@@ -1296,7 +1303,7 @@ static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb)
{
acb->acb_flags &= ~ACB_F_MSG_START_BGRB;
CHIP_REG_WRITE32(HBA_MessageUnit,
- 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB);
+ 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_STOP_BGRB);
if(!arcmsr_hba_wait_msgint_ready(acb)) {
printf("arcmsr%d: wait 'stop adapter background rebulid' timeout \n"
, acb->pci_unit);
@@ -1308,9 +1315,9 @@ static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb)
*/
static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb)
{
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
acb->acb_flags &= ~ACB_F_MSG_START_BGRB;
- CHIP_REG_WRITE32(HBB_DOORBELL,
- 0, drv2iop_doorbell, ARCMSR_MESSAGE_STOP_BGRB);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_STOP_BGRB);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf( "arcmsr%d: wait 'stop adapter background rebulid' timeout \n"
, acb->pci_unit);
@@ -1388,7 +1395,7 @@ static void arcmsr_poll(struct cam_sim *psim)
**************************************************************************
*/
static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb,
- struct QBUFFER *prbuffer) {
+ struct QBUFFER *prbuffer) {
u_int8_t *pQbuffer;
u_int8_t *buf1 = 0;
@@ -1433,7 +1440,7 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data_D(struct AdapterControlBlock *acb
**************************************************************************
*/
static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb,
- struct QBUFFER *prbuffer) {
+ struct QBUFFER *prbuffer) {
u_int8_t *pQbuffer;
u_int8_t *iop_data;
@@ -1465,12 +1472,12 @@ static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb)
{
struct QBUFFER *prbuffer;
int my_empty_len;
-
+
/*check this iop data if overflow my rqbuffer*/
ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
prbuffer = arcmsr_get_iop_rqbuffer(acb);
my_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex - 1) &
- (ARCMSR_MAX_QBUFFER-1);
+ (ARCMSR_MAX_QBUFFER-1);
if(my_empty_len >= prbuffer->data_len) {
if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
acb->acb_flags |= ACB_F_IOPDATA_OVERFLOW;
@@ -1490,7 +1497,7 @@ static void arcmsr_Write_data_2iop_wqbuffer_D(struct AdapterControlBlock *acb)
u_int8_t *buf1 = 0;
u_int32_t *iop_data, *buf2 = 0;
u_int32_t allxfer_len = 0, data_len;
-
+
if(acb->acb_flags & ACB_F_MESSAGE_WQBUFFER_READ) {
buf1 = malloc(128, M_DEVBUF, M_NOWAIT | M_ZERO);
buf2 = (u_int32_t *)buf1;
@@ -1533,7 +1540,7 @@ static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb)
struct QBUFFER *pwbuffer;
u_int8_t *iop_data;
int32_t allxfer_len=0;
-
+
if(acb->adapter_type & (ACB_ADAPTER_TYPE_C | ACB_ADAPTER_TYPE_D)) {
arcmsr_Write_data_2iop_wqbuffer_D(acb);
return;
@@ -1586,8 +1593,8 @@ static void arcmsr_rescanLun_cb(struct cam_periph *periph, union ccb *ccb)
/*
if (ccb->ccb_h.status != CAM_REQ_CMP)
printf("arcmsr_rescanLun_cb: Rescan Target=%x, lun=%x,"
- "failure status=%x\n", ccb->ccb_h.target_id,
- ccb->ccb_h.target_lun, ccb->ccb_h.status);
+ "failure status=%x\n", ccb->ccb_h.target_id,
+ ccb->ccb_h.target_lun, ccb->ccb_h.status);
else
printf("arcmsr_rescanLun_cb: Rescan lun successfully!\n");
*/
@@ -1601,7 +1608,7 @@ static void arcmsr_rescan_lun(struct AdapterControlBlock *acb, int target, int l
union ccb *ccb;
if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL)
- return;
+ return;
if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP)
{
xpt_free_ccb(ccb);
@@ -1619,9 +1626,9 @@ static void arcmsr_rescan_lun(struct AdapterControlBlock *acb, int target, int l
static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, int lun)
{
- struct CommandControlBlock *srb;
+ struct CommandControlBlock *srb;
u_int32_t intmask_org;
- int i;
+ int i;
/* disable all outbound interrupts */
intmask_org = arcmsr_disable_allintr(acb);
@@ -1630,13 +1637,13 @@ static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, in
srb = acb->psrb_pool[i];
if (srb->srb_state == ARCMSR_SRB_START)
{
- if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun))
- {
- srb->srb_state = ARCMSR_SRB_ABORTED;
+ if((target == srb->pccb->ccb_h.target_id) && (lun == srb->pccb->ccb_h.target_lun))
+ {
+ srb->srb_state = ARCMSR_SRB_ABORTED;
srb->pccb->ccb_h.status |= CAM_REQ_ABORTED;
- arcmsr_srb_complete(srb, 1);
+ arcmsr_srb_complete(srb, 1);
printf("arcmsr%d: abort scsi id %d lun %d srb=%p \n", acb->pci_unit, target, lun, srb);
- }
+ }
}
}
/* enable outbound Post Queue, outbound doorbell Interrupt */
@@ -1649,87 +1656,87 @@ static void arcmsr_abort_dr_ccbs(struct AdapterControlBlock *acb, int target, in
static void arcmsr_dr_handle(struct AdapterControlBlock *acb) {
u_int32_t devicemap;
u_int32_t target, lun;
- u_int32_t deviceMapCurrent[4]={0};
- u_int8_t *pDevMap;
+ u_int32_t deviceMapCurrent[4]={0};
+ u_int8_t *pDevMap;
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A:
- devicemap = offsetof(struct HBA_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
- for (target = 0; target < 4; target++)
- {
- deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap);
- devicemap += 4;
- }
- break;
+ devicemap = offsetof(struct HBA_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
+ for (target = 0; target < 4; target++)
+ {
+ deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap);
+ devicemap += 4;
+ }
+ break;
case ACB_ADAPTER_TYPE_B:
- devicemap = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
- for (target = 0; target < 4; target++)
- {
- deviceMapCurrent[target]=bus_space_read_4(acb->btag[1], acb->bhandle[1], devicemap);
- devicemap += 4;
- }
- break;
+ devicemap = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
+ for (target = 0; target < 4; target++)
+ {
+ deviceMapCurrent[target]=bus_space_read_4(acb->btag[1], acb->bhandle[1], devicemap);
+ devicemap += 4;
+ }
+ break;
case ACB_ADAPTER_TYPE_C:
- devicemap = offsetof(struct HBC_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
- for (target = 0; target < 4; target++)
- {
- deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap);
- devicemap += 4;
- }
- break;
+ devicemap = offsetof(struct HBC_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
+ for (target = 0; target < 4; target++)
+ {
+ deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap);
+ devicemap += 4;
+ }
+ break;
case ACB_ADAPTER_TYPE_D:
- devicemap = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
- for (target = 0; target < 4; target++)
- {
- deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap);
- devicemap += 4;
- }
- break;
- }
-
- if(acb->acb_flags & ACB_F_BUS_HANG_ON)
+ devicemap = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
+ for (target = 0; target < 4; target++)
{
- acb->acb_flags &= ~ACB_F_BUS_HANG_ON;
+ deviceMapCurrent[target]=bus_space_read_4(acb->btag[0], acb->bhandle[0], devicemap);
+ devicemap += 4;
}
- /*
- ** adapter posted CONFIG message
- ** copy the new map, note if there are differences with the current map
- */
- pDevMap = (u_int8_t *)&deviceMapCurrent[0];
- for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++)
+ break;
+ }
+
+ if(acb->acb_flags & ACB_F_BUS_HANG_ON)
+ {
+ acb->acb_flags &= ~ACB_F_BUS_HANG_ON;
+ }
+ /*
+ ** adapter posted CONFIG message
+ ** copy the new map, note if there are differences with the current map
+ */
+ pDevMap = (u_int8_t *)&deviceMapCurrent[0];
+ for (target = 0; target < ARCMSR_MAX_TARGETID - 1; target++)
+ {
+ if (*pDevMap != acb->device_map[target])
{
- if (*pDevMap != acb->device_map[target])
+ u_int8_t difference, bit_check;
+
+ difference = *pDevMap ^ acb->device_map[target];
+ for(lun=0; lun < ARCMSR_MAX_TARGETLUN; lun++)
{
- u_int8_t difference, bit_check;
-
- difference = *pDevMap ^ acb->device_map[target];
- for(lun=0; lun < ARCMSR_MAX_TARGETLUN; lun++)
- {
- bit_check = (1 << lun); /*check bit from 0....31*/
- if(difference & bit_check)
- {
- if(acb->device_map[target] & bit_check)
- {/* unit departed */
- printf("arcmsr_dr_handle: Target=%x, lun=%x, GONE!!!\n",target,lun);
- arcmsr_abort_dr_ccbs(acb, target, lun);
- arcmsr_rescan_lun(acb, target, lun);
- acb->devstate[target][lun] = ARECA_RAID_GONE;
- }
- else
- {/* unit arrived */
- printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun);
- arcmsr_rescan_lun(acb, target, lun);
- acb->devstate[target][lun] = ARECA_RAID_GOOD;
- }
- }
- }
-/* printf("arcmsr_dr_handle: acb->device_map[%x]=0x%x, deviceMapCurrent[%x]=%x\n",target,acb->device_map[target],target,*pDevMap); */
- acb->device_map[target] = *pDevMap;
+ bit_check = (1 << lun); /*check bit from 0....31*/
+ if(difference & bit_check)
+ {
+ if(acb->device_map[target] & bit_check)
+ {/* unit departed */
+ printf("arcmsr_dr_handle: Target=%x, lun=%x, GONE!!!\n",target,lun);
+ arcmsr_abort_dr_ccbs(acb, target, lun);
+ arcmsr_rescan_lun(acb, target, lun);
+ acb->devstate[target][lun] = ARECA_RAID_GONE;
+ }
+ else
+ {/* unit arrived */
+ printf("arcmsr_dr_handle: Target=%x, lun=%x, Plug-IN!!!\n",target,lun);
+ arcmsr_rescan_lun(acb, target, lun);
+ acb->devstate[target][lun] = ARECA_RAID_GOOD;
+ }
+ }
}
- pDevMap++;
+/* printf("arcmsr_dr_handle: acb->device_map[%x]=0x%x, deviceMapCurrent[%x]=%x\n",target,acb->device_map[target],target,*pDevMap); */
+ acb->device_map[target] = *pDevMap;
}
+ pDevMap++;
+ }
}
/*
**************************************************************************
@@ -1749,9 +1756,10 @@ static void arcmsr_hba_message_isr(struct AdapterControlBlock *acb) {
*/
static void arcmsr_hbb_message_isr(struct AdapterControlBlock *acb) {
u_int32_t outbound_message;
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
/* clear interrupts */
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);
outbound_message = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0]);
if (outbound_message == ARCMSR_SIGNATURE_GET_CONFIG)
arcmsr_dr_handle( acb );
@@ -1787,7 +1795,7 @@ static void arcmsr_hbd_message_isr(struct AdapterControlBlock *acb) {
static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb)
{
u_int32_t doorbell_status;
-
+
/*
*******************************************************************
** Maybe here we need to check wrqbuffer_lock is lock or not
@@ -1811,7 +1819,7 @@ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb)
static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *acb)
{
u_int32_t doorbell_status;
-
+
/*
*******************************************************************
** Maybe here we need to check wrqbuffer_lock is lock or not
@@ -1838,7 +1846,7 @@ static void arcmsr_hbc_doorbell_isr(struct AdapterControlBlock *acb)
static void arcmsr_hbd_doorbell_isr(struct AdapterControlBlock *acb)
{
u_int32_t doorbell_status;
-
+
/*
*******************************************************************
** Maybe here we need to check wrqbuffer_lock is lock or not
@@ -1872,7 +1880,7 @@ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb)
{
u_int32_t flag_srb;
u_int16_t error;
-
+
/*
*****************************************************************************
** areca cdb command done
@@ -1883,7 +1891,7 @@ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb)
while((flag_srb = CHIP_REG_READ32(HBA_MessageUnit,
0, outbound_queueport)) != 0xFFFFFFFF) {
/* check if command done with no error*/
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0) ? TRUE : FALSE;
arcmsr_drain_donequeue(acb, flag_srb, error);
} /*drain reply FIFO*/
}
@@ -1912,7 +1920,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb)
index %= ARCMSR_MAX_HBB_POSTQUEUE; /*if last index number set it to 0 */
phbbmu->doneq_index = index;
/* check if command done with no error*/
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
arcmsr_drain_donequeue(acb, flag_srb, error);
} /*drain reply FIFO*/
}
@@ -1924,7 +1932,7 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterControlBlock *acb)
{
u_int32_t flag_srb,throttling = 0;
u_int16_t error;
-
+
/*
*****************************************************************************
** areca cdb command done
@@ -1933,14 +1941,16 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterControlBlock *acb)
bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
do {
flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low);
+ if (flag_srb == 0xFFFFFFFF)
+ break;
/* check if command done with no error*/
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE;
arcmsr_drain_donequeue(acb, flag_srb, error);
- throttling++;
+ throttling++;
if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) {
CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING);
throttling = 0;
- }
+ }
} while(CHIP_REG_READ32(HBC_MessageUnit, 0, host_int_status) & ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR);
}
/*
@@ -1985,8 +1995,8 @@ static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb)
*****************************************************************************
*/
if((CHIP_REG_READ32(HBD_MessageUnit, 0, outboundlist_interrupt_cause) &
- ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT) == 0)
- return;
+ ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT) == 0)
+ return;
bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
outbound_write_pointer = phbdmu->done_qbuffer[0].addressLow;
@@ -2039,19 +2049,20 @@ static void arcmsr_handle_hba_isr( struct AdapterControlBlock *acb)
static void arcmsr_handle_hbb_isr( struct AdapterControlBlock *acb)
{
u_int32_t outbound_doorbell;
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
/*
*********************************************
** check outbound intstatus
*********************************************
*/
- outbound_doorbell = CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell) & acb->outbound_int_enable;
+ outbound_doorbell = READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell) & acb->outbound_int_enable;
if(!outbound_doorbell) {
/*it must be share irq*/
return;
}
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ~outbound_doorbell); /* clear doorbell interrupt */
- CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell);
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ~outbound_doorbell); /* clear doorbell interrupt */
+ READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
/* MU ioctl transfer doorbell interrupts*/
if(outbound_doorbell & ARCMSR_IOP2DRV_DATA_WRITE_OK) {
arcmsr_iop2drv_data_wrote_handle(acb);
@@ -2163,7 +2174,7 @@ static void arcmsr_interrupt(struct AdapterControlBlock *acb)
static void arcmsr_intr_handler(void *arg)
{
struct AdapterControlBlock *acb = (struct AdapterControlBlock *)arg;
-
+
ARCMSR_LOCK_ACQUIRE(&acb->isr_lock);
arcmsr_interrupt(acb);
ARCMSR_LOCK_RELEASE(&acb->isr_lock);
@@ -2176,22 +2187,24 @@ static void arcmsr_polling_devmap(void *arg)
{
struct AdapterControlBlock *acb = (struct AdapterControlBlock *)arg;
switch (acb->adapter_type) {
- case ACB_ADAPTER_TYPE_A:
- CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
- break;
+ case ACB_ADAPTER_TYPE_A:
+ CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
+ break;
- case ACB_ADAPTER_TYPE_B:
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_GET_CONFIG);
- break;
+ case ACB_ADAPTER_TYPE_B: {
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_GET_CONFIG);
+ }
+ break;
- case ACB_ADAPTER_TYPE_C:
- CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
- CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE);
- break;
+ case ACB_ADAPTER_TYPE_C:
+ CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
+ CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE);
+ break;
- case ACB_ADAPTER_TYPE_D:
- CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
- break;
+ case ACB_ADAPTER_TYPE_D:
+ CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
+ break;
}
if((acb->acb_flags & ACB_F_SCSISTOPADAPTER) == 0)
@@ -2228,7 +2241,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
{
struct CMD_MESSAGE_FIELD *pcmdmessagefld;
u_int32_t retvalue = EINVAL;
-
+
pcmdmessagefld = (struct CMD_MESSAGE_FIELD *) arg;
if(memcmp(pcmdmessagefld->cmdmessage.Signature, "ARCMSR", 6)!=0) {
return retvalue;
@@ -2239,7 +2252,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
u_int8_t *pQbuffer;
u_int8_t *ptmpQbuffer = pcmdmessagefld->messagedatabuffer;
u_int32_t allxfer_len=0;
-
+
while((acb->rqbuf_firstindex != acb->rqbuf_lastindex)
&& (allxfer_len < 1031)) {
/*copy READ QBUFFER to srb*/
@@ -2253,7 +2266,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
}
if(acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
struct QBUFFER *prbuffer;
-
+
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
prbuffer = arcmsr_get_iop_rqbuffer(acb);
if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
@@ -2268,7 +2281,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
u_int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
u_int8_t *pQbuffer;
u_int8_t *ptmpuserbuffer = pcmdmessagefld->messagedatabuffer;
-
+
user_len = pcmdmessagefld->cmdmessage.Length;
/*check if data xfer length of this request will overflow my array qbuffer */
wqbuf_lastindex = acb->wqbuf_lastindex;
@@ -2278,7 +2291,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_ERROR;
} else {
my_empty_len = (wqbuf_firstindex - wqbuf_lastindex - 1) &
- (ARCMSR_MAX_QBUFFER - 1);
+ (ARCMSR_MAX_QBUFFER - 1);
if(my_empty_len >= user_len) {
while(user_len > 0) {
/*copy srb data to wqbuffer*/
@@ -2305,7 +2318,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
break;
case ARCMSR_MESSAGE_CLEAR_RQBUFFER: {
u_int8_t *pQbuffer = acb->rqbuffer;
-
+
if(acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
arcmsr_iop_message_read(acb);
@@ -2322,10 +2335,10 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
case ARCMSR_MESSAGE_CLEAR_WQBUFFER:
{
u_int8_t *pQbuffer = acb->wqbuffer;
-
+
if(acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
- arcmsr_iop_message_read(acb);
+ arcmsr_iop_message_read(acb);
/*signature, let IOP know data has been readed */
}
acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED|ACB_F_MESSAGE_WQBUFFER_READ);
@@ -2338,10 +2351,10 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
break;
case ARCMSR_MESSAGE_CLEAR_ALLQBUFFER: {
u_int8_t *pQbuffer;
-
+
if(acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
- arcmsr_iop_message_read(acb);
+ arcmsr_iop_message_read(acb);
/*signature, let IOP know data has been readed */
}
acb->acb_flags |= (ACB_F_MESSAGE_WQBUFFER_CLEARED
@@ -2367,7 +2380,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
case ARCMSR_MESSAGE_SAY_HELLO: {
u_int8_t *hello_string = "Hello! I am ARCMSR";
u_int8_t *puserbuffer = (u_int8_t *)pcmdmessagefld->messagedatabuffer;
-
+
if(memcpy(puserbuffer, hello_string, (int16_t)strlen(hello_string))) {
pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_ERROR;
ARCMSR_LOCK_RELEASE(&acb->qbuffer_lock);
@@ -2398,7 +2411,7 @@ u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_c
static void arcmsr_free_srb(struct CommandControlBlock *srb)
{
struct AdapterControlBlock *acb;
-
+
acb = srb->acb;
ARCMSR_LOCK_ACQUIRE(&acb->srb_lock);
srb->srb_state = ARCMSR_SRB_DONE;
@@ -2462,7 +2475,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
u_int8_t *pQbuffer;
u_int8_t *ptmpQbuffer = pcmdmessagefld->messagedatabuffer;
int32_t allxfer_len = 0;
-
+
ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex)
&& (allxfer_len < 1031)) {
@@ -2475,7 +2488,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
}
if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
struct QBUFFER *prbuffer;
-
+
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
prbuffer = arcmsr_get_iop_rqbuffer(acb);
if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer) == 0)
@@ -2491,7 +2504,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
u_int8_t *pQbuffer;
u_int8_t *ptmpuserbuffer = pcmdmessagefld->messagedatabuffer;
-
+
user_len = pcmdmessagefld->cmdmessage.Length;
ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
wqbuf_lastindex = acb->wqbuf_lastindex;
@@ -2499,7 +2512,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
if (wqbuf_lastindex != wqbuf_firstindex) {
arcmsr_Write_data_2iop_wqbuffer(acb);
/* has error report sensedata */
- if(pccb->csio.sense_len) {
+ if(pccb->csio.sense_len) {
((u_int8_t *)&pccb->csio.sense_data)[0] = (0x1 << 7 | 0x70);
/* Valid,ErrorCode */
((u_int8_t *)&pccb->csio.sense_data)[2] = 0x05;
@@ -2547,7 +2560,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
break;
case ARCMSR_MESSAGE_CLEAR_RQBUFFER: {
u_int8_t *pQbuffer = acb->rqbuffer;
-
+
ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
@@ -2564,7 +2577,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
break;
case ARCMSR_MESSAGE_CLEAR_WQBUFFER: {
u_int8_t *pQbuffer = acb->wqbuffer;
-
+
ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
@@ -2583,7 +2596,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
break;
case ARCMSR_MESSAGE_CLEAR_ALLQBUFFER: {
u_int8_t *pQbuffer;
-
+
ARCMSR_LOCK_ACQUIRE(&acb->qbuffer_lock);
if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) {
acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW;
@@ -2611,7 +2624,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, union ccb *p
break;
case ARCMSR_MESSAGE_SAY_HELLO: {
int8_t *hello_string = "Hello! I am ARCMSR";
-
+
memcpy(pcmdmessagefld->messagedatabuffer, hello_string
, (int16_t)strlen(hello_string));
pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
@@ -2639,7 +2652,7 @@ static void arcmsr_execute_srb(void *arg, bus_dma_segment_t *dm_segs, int nseg,
struct AdapterControlBlock *acb = (struct AdapterControlBlock *)srb->acb;
union ccb *pccb;
int target, lun;
-
+
pccb = srb->pccb;
target = pccb->ccb_h.target_id;
lun = pccb->ccb_h.target_lun;
@@ -2721,7 +2734,7 @@ static u_int8_t arcmsr_seek_cmd2abort(union ccb *abortccb)
struct AdapterControlBlock *acb = (struct AdapterControlBlock *) abortccb->ccb_h.arcmsr_ccbacb_ptr;
u_int32_t intmask_org;
int i = 0;
-
+
acb->num_aborts++;
/*
***************************************************************************
@@ -2763,7 +2776,7 @@ static u_int8_t arcmsr_seek_cmd2abort(union ccb *abortccb)
static void arcmsr_bus_reset(struct AdapterControlBlock *acb)
{
int retry = 0;
-
+
acb->num_resets++;
acb->acb_flags |= ACB_F_BUS_RESET;
while(acb->srboutstandingcount != 0 && retry < 400) {
@@ -2793,10 +2806,10 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
char *buffer = pccb->csio.data_ptr;
inqdata[0] = T_PROCESSOR; /* Periph Qualifier & Periph Dev Type */
- inqdata[1] = 0; /* rem media bit & Dev Type Modifier */
- inqdata[2] = 0; /* ISO, ECMA, & ANSI versions */
+ inqdata[1] = 0; /* rem media bit & Dev Type Modifier */
+ inqdata[2] = 0; /* ISO, ECMA, & ANSI versions */
inqdata[3] = 0;
- inqdata[4] = 31; /* length of additional data */
+ inqdata[4] = 31; /* length of additional data */
inqdata[5] = 0;
inqdata[6] = 0;
inqdata[7] = 0;
@@ -2827,7 +2840,7 @@ static void arcmsr_handle_virtual_command(struct AdapterControlBlock *acb,
static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
{
struct AdapterControlBlock *acb;
-
+
acb = (struct AdapterControlBlock *) cam_sim_softc(psim);
if(acb == NULL) {
pccb->ccb_h.status |= CAM_REQ_INVALID;
@@ -2839,7 +2852,7 @@ static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
struct CommandControlBlock *srb;
int target = pccb->ccb_h.target_id;
int error;
-
+
if(target == 16) {
/* virtual device for iop message transfer */
arcmsr_handle_virtual_command(acb, pccb);
@@ -2942,8 +2955,8 @@ static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
}
case XPT_RESET_BUS:
case XPT_RESET_DEV: {
- u_int32_t i;
-
+ u_int32_t i;
+
arcmsr_bus_reset(acb);
for (i=0; i < 500; i++) {
DELAY(1000);
@@ -2959,7 +2972,7 @@ static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
}
case XPT_GET_TRAN_SETTINGS: {
struct ccb_trans_settings *cts;
-
+
if(pccb->ccb_h.target_id == 16) {
pccb->ccb_h.status |= CAM_FUNC_NOTAVAIL;
xpt_done(pccb);
@@ -2971,7 +2984,7 @@ static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
struct ccb_trans_settings_scsi *scsi;
struct ccb_trans_settings_spi *spi;
struct ccb_trans_settings_sas *sas;
-
+
scsi = &cts->proto_specific.scsi;
scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
scsi->valid = CTS_SCSI_VALID_TQ;
@@ -2986,12 +2999,11 @@ static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
cts->transport = XPORT_SAS;
sas = &cts->xport_specific.sas;
sas->valid = CTS_SAS_VALID_SPEED;
- if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883)
+ if (acb->adapter_bus_speed == ACB_BUS_SPEED_12G)
sas->bitrate = 1200000;
- else if((acb->vendor_device_id == PCIDevVenIDARC1880) ||
- (acb->vendor_device_id == PCIDevVenIDARC1214))
+ else if(acb->adapter_bus_speed == ACB_BUS_SPEED_6G)
sas->bitrate = 600000;
- else if(acb->vendor_device_id == PCIDevVenIDARC1680)
+ else if(acb->adapter_bus_speed == ACB_BUS_SPEED_3G)
sas->bitrate = 300000;
}
else
@@ -3001,7 +3013,10 @@ static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
cts->transport = XPORT_SPI;
spi = &cts->xport_specific.spi;
spi->flags = CTS_SPI_FLAGS_DISC_ENB;
- spi->sync_period = 2;
+ if (acb->adapter_bus_speed == ACB_BUS_SPEED_6G)
+ spi->sync_period = 1;
+ else
+ spi->sync_period = 2;
spi->sync_offset = 32;
spi->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
spi->valid = CTS_SPI_VALID_DISC
@@ -3013,7 +3028,10 @@ static void arcmsr_action(struct cam_sim *psim, union ccb *pccb)
#else
{
cts->flags = (CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB);
- cts->sync_period = 2;
+ if (acb->adapter_bus_speed == ACB_BUS_SPEED_6G)
+ cts->sync_period = 1;
+ else
+ cts->sync_period = 2;
cts->sync_offset = 32;
cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
cts->valid = CCB_TRANS_SYNC_RATE_VALID |
@@ -3096,8 +3114,9 @@ static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb)
*/
static void arcmsr_start_hbb_bgrb(struct AdapterControlBlock *acb)
{
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
acb->acb_flags |= ACB_F_MSG_START_BGRB;
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_START_BGRB);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_START_BGRB);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf( "arcmsr%d: wait 'start adapter background rebulid' timeout \n", acb->pci_unit);
}
@@ -3158,7 +3177,7 @@ static void arcmsr_polling_hba_srbdone(struct AdapterControlBlock *acb, struct C
struct CommandControlBlock *srb;
u_int32_t flag_srb, outbound_intstatus, poll_srb_done=0, poll_count=0;
u_int16_t error;
-
+
polling_ccb_retry:
poll_count++;
outbound_intstatus=CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_intstatus) & acb->outbound_int_enable;
@@ -3180,7 +3199,7 @@ polling_ccb_retry:
/* check if command done with no error*/
srb = (struct CommandControlBlock *)
(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
poll_srb_done = (srb == poll_srb) ? 1:0;
if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) {
if(srb->srb_state == ARCMSR_SRB_ABORTED) {
@@ -3214,11 +3233,10 @@ static void arcmsr_polling_hbb_srbdone(struct AdapterControlBlock *acb, struct C
u_int32_t flag_srb, poll_srb_done=0, poll_count=0;
int index;
u_int16_t error;
-
+
polling_ccb_retry:
poll_count++;
- CHIP_REG_WRITE32(HBB_DOORBELL,
- 0, iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN); /* clear doorbell interrupt */
bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
while(1) {
index = phbbmu->doneq_index;
@@ -3227,7 +3245,7 @@ polling_ccb_retry:
break;/*chip FIFO no ccb for completion already*/
} else {
UDELAY(25000);
- if ((poll_count > 100) && (poll_srb != NULL)) {
+ if ((poll_count > 100) && (poll_srb != NULL)) {
break;
}
goto polling_ccb_retry;
@@ -3240,7 +3258,7 @@ polling_ccb_retry:
/* check if command done with no error*/
srb = (struct CommandControlBlock *)
(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE0)?TRUE:FALSE;
poll_srb_done = (srb == poll_srb) ? 1:0;
if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) {
if(srb->srb_state == ARCMSR_SRB_ABORTED) {
@@ -3272,7 +3290,7 @@ static void arcmsr_polling_hbc_srbdone(struct AdapterControlBlock *acb, struct C
struct CommandControlBlock *srb;
u_int32_t flag_srb, poll_srb_done=0, poll_count=0;
u_int16_t error;
-
+
polling_ccb_retry:
poll_count++;
bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
@@ -3282,19 +3300,19 @@ polling_ccb_retry:
break;/*chip FIFO no ccb for completion already*/
} else {
UDELAY(25000);
- if ((poll_count > 100) && (poll_srb != NULL)) {
+ if ((poll_count > 100) && (poll_srb != NULL)) {
break;
}
- if (acb->srboutstandingcount == 0) {
+ if (acb->srboutstandingcount == 0) {
break;
- }
+ }
goto polling_ccb_retry;
}
}
flag_srb = CHIP_REG_READ32(HBC_MessageUnit, 0, outbound_queueport_low);
/* check if command done with no error*/
srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0));/*frame must be 32 bytes aligned*/
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE;
if (poll_srb != NULL)
poll_srb_done = (srb == poll_srb) ? 1:0;
if((srb->acb != acb) || (srb->srb_state != ARCMSR_SRB_START)) {
@@ -3324,7 +3342,7 @@ static void arcmsr_polling_hbd_srbdone(struct AdapterControlBlock *acb, struct C
u_int32_t flag_srb, poll_srb_done=0, poll_count=0;
u_int32_t outbound_write_pointer;
u_int16_t error, doneq_index;
-
+
polling_ccb_retry:
poll_count++;
bus_dmamap_sync(acb->srb_dmat, acb->srb_dmamap, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
@@ -3336,12 +3354,12 @@ polling_ccb_retry:
break;/*chip FIFO no ccb for completion already*/
} else {
UDELAY(25000);
- if ((poll_count > 100) && (poll_srb != NULL)) {
+ if ((poll_count > 100) && (poll_srb != NULL)) {
+ break;
+ }
+ if (acb->srboutstandingcount == 0) {
break;
}
- if (acb->srboutstandingcount == 0) {
- break;
- }
goto polling_ccb_retry;
}
}
@@ -3349,7 +3367,7 @@ polling_ccb_retry:
flag_srb = phbdmu->done_qbuffer[(doneq_index & 0xFF)+1].addressLow;
/* check if command done with no error*/
srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0));/*frame must be 32 bytes aligned*/
- error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE;
+ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1) ? TRUE : FALSE;
CHIP_REG_WRITE32(HBD_MessageUnit, 0, outboundlist_read_pointer, doneq_index);
if (poll_srb != NULL)
poll_srb_done = (srb == poll_srb) ? 1:0;
@@ -3406,7 +3424,7 @@ static void arcmsr_get_hba_config(struct AdapterControlBlock *acb)
size_t iop_firm_version = offsetof(struct HBA_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/
size_t iop_device_map = offsetof(struct HBA_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
int i;
-
+
CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
if(!arcmsr_hba_wait_msgint_ready(acb)) {
printf("arcmsr%d: wait 'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit);
@@ -3448,6 +3466,7 @@ static void arcmsr_get_hba_config(struct AdapterControlBlock *acb)
*/
static void arcmsr_get_hbb_config(struct AdapterControlBlock *acb)
{
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
char *acb_firm_model = acb->firm_model;
char *acb_firm_version = acb->firm_version;
char *acb_device_map = acb->device_map;
@@ -3455,8 +3474,8 @@ static void arcmsr_get_hbb_config(struct AdapterControlBlock *acb)
size_t iop_firm_version = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/
size_t iop_device_map = offsetof(struct HBB_RWBUFFER, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
int i;
-
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_GET_CONFIG);
+
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_GET_CONFIG);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf( "arcmsr%d: wait" "'get adapter firmware miscellaneous data' timeout \n", acb->pci_unit);
}
@@ -3504,7 +3523,7 @@ static void arcmsr_get_hbc_config(struct AdapterControlBlock *acb)
size_t iop_firm_version = offsetof(struct HBC_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/
size_t iop_device_map = offsetof(struct HBC_MessageUnit,msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
int i;
-
+
CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell, ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE);
if(!arcmsr_hbc_wait_msgint_ready(acb)) {
@@ -3554,7 +3573,7 @@ static void arcmsr_get_hbd_config(struct AdapterControlBlock *acb)
size_t iop_firm_version = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_VERS_OFFSET]); /*firm_version,17,68-83*/
size_t iop_device_map = offsetof(struct HBD_MessageUnit, msgcode_rwbuffer[ARCMSR_FW_DEVMAP_OFFSET]);
int i;
-
+
if(CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell) & ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE)
CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE_CLEAR);
CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_msgaddr0, ARCMSR_INBOUND_MESG0_GET_CONFIG);
@@ -3582,10 +3601,10 @@ static void arcmsr_get_hbd_config(struct AdapterControlBlock *acb)
i++;
}
printf("Areca RAID adapter%d: %s F/W version %s \n", acb->pci_unit, acb->firm_model, acb->firm_version);
- acb->firm_request_len = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_request_len, 1, 04-07*/
- acb->firm_numbers_queue = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_numbers_queue, 2, 08-11*/
- acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/
- acb->firm_ide_channels = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[5]); /*firm_ide_channels, 4, 16-19*/
+ acb->firm_request_len = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[1]); /*firm_request_len, 1, 04-07*/
+ acb->firm_numbers_queue = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[2]); /*firm_numbers_queue, 2, 08-11*/
+ acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/
+ acb->firm_ide_channels = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/
acb->firm_cfg_version = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */
if(acb->firm_numbers_queue > ARCMSR_MAX_HBD_POSTQUEUE)
acb->maxOutstanding = ARCMSR_MAX_HBD_POSTQUEUE - 1;
@@ -3624,7 +3643,7 @@ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb)
static void arcmsr_wait_firmware_ready( struct AdapterControlBlock *acb)
{
int timeout=0;
-
+
switch (acb->adapter_type) {
case ACB_ADAPTER_TYPE_A: {
while ((CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_msgaddr1) & ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK) == 0)
@@ -3639,7 +3658,8 @@ static void arcmsr_wait_firmware_ready( struct AdapterControlBlock *acb)
}
break;
case ACB_ADAPTER_TYPE_B: {
- while ((CHIP_REG_READ32(HBB_DOORBELL, 0, iop2drv_doorbell) & ARCMSR_MESSAGE_FIRMWARE_OK) == 0)
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+ while ((READ_CHIP_REG32(0, phbbmu->iop2drv_doorbell) & ARCMSR_MESSAGE_FIRMWARE_OK) == 0)
{
if (timeout++ > 2000) /* (2000*15)/1000 = 30 sec */
{
@@ -3648,7 +3668,7 @@ static void arcmsr_wait_firmware_ready( struct AdapterControlBlock *acb)
}
UDELAY(15000); /* wait 15 milli-seconds */
}
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_END_OF_INTERRUPT);
}
break;
case ACB_ADAPTER_TYPE_C: {
@@ -3695,8 +3715,9 @@ static void arcmsr_clear_doorbell_queue_buffer( struct AdapterControlBlock *acb)
}
break;
case ACB_ADAPTER_TYPE_B: {
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt and message state*/
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK);
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+ WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt and message state*/
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK);
/* let IOP know data has been read */
}
break;
@@ -3728,7 +3749,7 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterControlBlock *acb)
unsigned long srb_phyaddr;
u_int32_t srb_phyaddr_hi32;
u_int32_t srb_phyaddr_lo32;
-
+
/*
********************************************************************
** here we need to tell iop 331 our freesrb.HighPart
@@ -3759,11 +3780,11 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterControlBlock *acb)
case ACB_ADAPTER_TYPE_B: {
u_int32_t post_queue_phyaddr;
struct HBB_MessageUnit *phbbmu;
-
+
phbbmu = (struct HBB_MessageUnit *)acb->pmu;
phbbmu->postq_index = 0;
phbbmu->doneq_index = 0;
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_SET_POST_WINDOW);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_SET_POST_WINDOW);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf( "arcmsr%d: 'set window of post command Q' timeout\n", acb->pci_unit);
return FALSE;
@@ -3775,12 +3796,12 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterControlBlock *acb)
CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[2], post_queue_phyaddr); /* postQ size (256+8)*4 */
CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3], post_queue_phyaddr+1056); /* doneQ size (256+8)*4 */
CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4], 1056); /* srb maxQ size must be --> [(256+8)*4] */
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_SET_CONFIG);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_SET_CONFIG);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf( "arcmsr%d: 'set command Q window' timeout \n", acb->pci_unit);
return FALSE;
}
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell, ARCMSR_MESSAGE_START_DRIVER_MODE);
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_START_DRIVER_MODE);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf( "arcmsr%d: 'start diver mode' timeout \n", acb->pci_unit);
return FALSE;
@@ -3803,7 +3824,7 @@ static u_int32_t arcmsr_iop_confirm(struct AdapterControlBlock *acb)
case ACB_ADAPTER_TYPE_D: {
u_int32_t post_queue_phyaddr, done_queue_phyaddr;
struct HBD_MessageUnit0 *phbdmu;
-
+
phbdmu = (struct HBD_MessageUnit0 *)acb->pmu;
phbdmu->postq_index = 0;
phbdmu->doneq_index = 0x40FF;
@@ -3839,7 +3860,8 @@ static void arcmsr_enable_eoi_mode(struct AdapterControlBlock *acb)
case ACB_ADAPTER_TYPE_D:
break;
case ACB_ADAPTER_TYPE_B: {
- CHIP_REG_WRITE32(HBB_DOORBELL, 0, drv2iop_doorbell,ARCMSR_MESSAGE_ACTIVE_EOI_MODE);
+ struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu;
+ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_MESSAGE_ACTIVE_EOI_MODE);
if(!arcmsr_hbb_wait_msgint_ready(acb)) {
printf( "arcmsr%d: 'iop enable eoi mode' timeout \n", acb->pci_unit);
return;
@@ -3855,7 +3877,7 @@ static void arcmsr_enable_eoi_mode(struct AdapterControlBlock *acb)
static void arcmsr_iop_init(struct AdapterControlBlock *acb)
{
u_int32_t intmask_org;
-
+
/* disable all outbound interrupt */
intmask_org = arcmsr_disable_allintr(acb);
arcmsr_wait_firmware_ready(acb);
@@ -3880,7 +3902,7 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_segment_t *segs, int nseg, in
struct CommandControlBlock *srb_tmp;
u_int32_t i;
unsigned long srb_phyaddr = (unsigned long)segs->ds_addr;
-
+
acb->srb_phyaddr.phyaddr = srb_phyaddr;
srb_tmp = (struct CommandControlBlock *)acb->uncacheptr;
for(i=0; i < ARCMSR_MAX_FREESRB_NUM; i++) {
@@ -3983,6 +4005,12 @@ static u_int32_t arcmsr_initialize(device_t dev)
max_coherent_size = ARCMSR_SRBS_POOL_SIZE + (sizeof(struct HBB_MessageUnit));
}
break;
+ case PCIDevVenIDARC1203: {
+ acb->adapter_type = ACB_ADAPTER_TYPE_B;
+ acb->adapter_bus_speed = ACB_BUS_SPEED_6G;
+ max_coherent_size = ARCMSR_SRBS_POOL_SIZE + (sizeof(struct HBB_MessageUnit));
+ }
+ break;
case PCIDevVenIDARC1110:
case PCIDevVenIDARC1120:
case PCIDevVenIDARC1130:
@@ -4018,47 +4046,47 @@ static u_int32_t arcmsr_initialize(device_t dev)
#else
if(bus_dma_tag_create( /*PCI parent*/ NULL,
#endif
- /*alignemnt*/ 1,
- /*boundary*/ 0,
- /*lowaddr*/ BUS_SPACE_MAXADDR,
- /*highaddr*/ BUS_SPACE_MAXADDR,
- /*filter*/ NULL,
- /*filterarg*/ NULL,
- /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT,
- /*nsegments*/ BUS_SPACE_UNRESTRICTED,
- /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
- /*flags*/ 0,
+ /*alignemnt*/ 1,
+ /*boundary*/ 0,
+ /*lowaddr*/ BUS_SPACE_MAXADDR,
+ /*highaddr*/ BUS_SPACE_MAXADDR,
+ /*filter*/ NULL,
+ /*filterarg*/ NULL,
+ /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT,
+ /*nsegments*/ BUS_SPACE_UNRESTRICTED,
+ /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
+ /*flags*/ 0,
#if __FreeBSD_version >= 501102
- /*lockfunc*/ NULL,
- /*lockarg*/ NULL,
+ /*lockfunc*/ NULL,
+ /*lockarg*/ NULL,
#endif
- &acb->parent_dmat) != 0)
+ &acb->parent_dmat) != 0)
{
printf("arcmsr%d: parent_dmat bus_dma_tag_create failure!\n", device_get_unit(dev));
return ENOMEM;
}
/* Create a single tag describing a region large enough to hold all of the s/g lists we will need. */
- if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat,
- /*alignment*/ 1,
- /*boundary*/ 0,
+ if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat,
+ /*alignment*/ 1,
+ /*boundary*/ 0,
#ifdef PAE
- /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT,
+ /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT,
#else
- /*lowaddr*/ BUS_SPACE_MAXADDR,
+ /*lowaddr*/ BUS_SPACE_MAXADDR,
#endif
- /*highaddr*/ BUS_SPACE_MAXADDR,
- /*filter*/ NULL,
- /*filterarg*/ NULL,
- /*maxsize*/ ARCMSR_MAX_SG_ENTRIES * PAGE_SIZE * ARCMSR_MAX_FREESRB_NUM,
- /*nsegments*/ ARCMSR_MAX_SG_ENTRIES,
- /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
- /*flags*/ 0,
+ /*highaddr*/ BUS_SPACE_MAXADDR,
+ /*filter*/ NULL,
+ /*filterarg*/ NULL,
+ /*maxsize*/ ARCMSR_MAX_SG_ENTRIES * PAGE_SIZE * ARCMSR_MAX_FREESRB_NUM,
+ /*nsegments*/ ARCMSR_MAX_SG_ENTRIES,
+ /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
+ /*flags*/ 0,
#if __FreeBSD_version >= 501102
- /*lockfunc*/ busdma_lock_mutex,
- /*lockarg*/ &acb->isr_lock,
+ /*lockfunc*/ busdma_lock_mutex,
+ /*lockarg*/ &acb->isr_lock,
#endif
- &acb->dm_segs_dmat) != 0)
+ &acb->dm_segs_dmat) != 0)
{
bus_dma_tag_destroy(acb->parent_dmat);
printf("arcmsr%d: dm_segs_dmat bus_dma_tag_create failure!\n", device_get_unit(dev));
@@ -4066,22 +4094,22 @@ static u_int32_t arcmsr_initialize(device_t dev)
}
/* DMA tag for our srb structures.... Allocate the freesrb memory */
- if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat,
- /*alignment*/ 0x20,
- /*boundary*/ 0,
- /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT,
- /*highaddr*/ BUS_SPACE_MAXADDR,
- /*filter*/ NULL,
- /*filterarg*/ NULL,
- /*maxsize*/ max_coherent_size,
- /*nsegments*/ 1,
- /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
- /*flags*/ 0,
+ if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat,
+ /*alignment*/ 0x20,
+ /*boundary*/ 0,
+ /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT,
+ /*highaddr*/ BUS_SPACE_MAXADDR,
+ /*filter*/ NULL,
+ /*filterarg*/ NULL,
+ /*maxsize*/ max_coherent_size,
+ /*nsegments*/ 1,
+ /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT,
+ /*flags*/ 0,
#if __FreeBSD_version >= 501102
- /*lockfunc*/ NULL,
- /*lockarg*/ NULL,
+ /*lockfunc*/ NULL,
+ /*lockarg*/ NULL,
#endif
- &acb->srb_dmat) != 0)
+ &acb->srb_dmat) != 0)
{
bus_dma_tag_destroy(acb->dm_segs_dmat);
bus_dma_tag_destroy(acb->parent_dmat);
@@ -4142,10 +4170,15 @@ static u_int32_t arcmsr_initialize(device_t dev)
struct CommandControlBlock *freesrb;
u_int32_t rid[]={ PCIR_BAR(0), PCIR_BAR(2) };
vm_offset_t mem_base[]={0,0};
+ u_long size;
+ if (vendor_dev_id == PCIDevVenIDARC1203)
+ size = sizeof(struct HBB_DOORBELL_1203);
+ else
+ size = sizeof(struct HBB_DOORBELL);
for(i=0; i < 2; i++) {
if(i == 0) {
acb->sys_res_arcmsr[i] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid[i],
- 0ul, ~0ul, sizeof(struct HBB_DOORBELL), RF_ACTIVE);
+ 0ul, ~0ul, size, RF_ACTIVE);
} else {
acb->sys_res_arcmsr[i] = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid[i],
0ul, ~0ul, sizeof(struct HBB_RWBUFFER), RF_ACTIVE);
@@ -4174,6 +4207,17 @@ static u_int32_t arcmsr_initialize(device_t dev)
phbbmu = (struct HBB_MessageUnit *)acb->pmu;
phbbmu->hbb_doorbell = (struct HBB_DOORBELL *)mem_base[0];
phbbmu->hbb_rwbuffer = (struct HBB_RWBUFFER *)mem_base[1];
+ if (vendor_dev_id == PCIDevVenIDARC1203) {
+ phbbmu->drv2iop_doorbell = offsetof(struct HBB_DOORBELL_1203, drv2iop_doorbell);
+ phbbmu->drv2iop_doorbell_mask = offsetof(struct HBB_DOORBELL_1203, drv2iop_doorbell_mask);
+ phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL_1203, iop2drv_doorbell);
+ phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL_1203, iop2drv_doorbell_mask);
+ } else {
+ phbbmu->drv2iop_doorbell = offsetof(struct HBB_DOORBELL, drv2iop_doorbell);
+ phbbmu->drv2iop_doorbell_mask = offsetof(struct HBB_DOORBELL, drv2iop_doorbell_mask);
+ phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL, iop2drv_doorbell);
+ phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL, iop2drv_doorbell_mask);
+ }
}
break;
case ACB_ADAPTER_TYPE_C: {
@@ -4264,7 +4308,7 @@ static int arcmsr_attach(device_t dev)
struct cam_devq *devq; /* Device Queue to use for this SIM */
struct resource *irqres;
int rid;
-
+
if(acb == NULL) {
printf("arcmsr%d: cannot allocate softc\n", unit);
return (ENOMEM);
@@ -4300,7 +4344,7 @@ static int arcmsr_attach(device_t dev)
*/
devq = cam_simq_alloc(acb->maxOutstanding);
if(devq == NULL) {
- arcmsr_free_resource(acb);
+ arcmsr_free_resource(acb);
bus_release_resource(dev, SYS_RES_IRQ, 0, acb->irqres);
arcmsr_mutex_destroy(acb);
printf("arcmsr%d: cam_simq_alloc failure!\n", unit);
@@ -4377,7 +4421,7 @@ static int arcmsr_probe(device_t dev)
char x_type[]={"unknown"};
char *type;
int raid6 = 1;
-
+
if (pci_get_vendor(dev) != PCI_VENDOR_ID_ARECA) {
return (ENXIO);
}
@@ -4420,6 +4464,7 @@ static int arcmsr_probe(device_t dev)
type = "SAS 6G";
break;
case PCIDevVenIDARC1214:
+ case PCIDevVenIDARC1203:
type = "SATA 6G";
break;
default:
@@ -4444,7 +4489,7 @@ static int arcmsr_shutdown(device_t dev)
u_int32_t intmask_org;
struct CommandControlBlock *srb;
struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev);
-
+
/* stop adapter background rebuild */
ARCMSR_LOCK_ACQUIRE(&acb->isr_lock);
/* disable all outbound interrupt */
@@ -4484,7 +4529,7 @@ static int arcmsr_detach(device_t dev)
{
struct AdapterControlBlock *acb=(struct AdapterControlBlock *)device_get_softc(dev);
int i;
-
+
callout_stop(&acb->devmap_callout);
bus_teardown_intr(dev, acb->irqres, acb->ih);
arcmsr_shutdown(dev);
diff --git a/sys/dev/arcmsr/arcmsr.h b/sys/dev/arcmsr/arcmsr.h
index 018b401..aa613ad 100644
--- a/sys/dev/arcmsr/arcmsr.h
+++ b/sys/dev/arcmsr/arcmsr.h
@@ -99,6 +99,7 @@
#define PCI_DEVICE_ID_ARECA_1170 0x1170 /* Device ID */
#define PCI_DEVICE_ID_ARECA_1200 0x1200 /* Device ID */
#define PCI_DEVICE_ID_ARECA_1201 0x1201 /* Device ID */
+#define PCI_DEVICE_ID_ARECA_1203 0x1203 /* Device ID */
#define PCI_DEVICE_ID_ARECA_1210 0x1210 /* Device ID */
#define PCI_DEVICE_ID_ARECA_1212 0x1212 /* Device ID */
#define PCI_DEVICE_ID_ARECA_1214 0x1214 /* Device ID */
@@ -131,6 +132,7 @@
#define PCIDevVenIDARC1170 0x117017D3 /* Vendor Device ID */
#define PCIDevVenIDARC1200 0x120017D3 /* Vendor Device ID */
#define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */
+#define PCIDevVenIDARC1203 0x120317D3 /* Vendor Device ID */
#define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */
#define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */
#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */
@@ -188,6 +190,8 @@
*/
#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r))
#define CHIP_REG_WRITE32(s, b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d)
+#define READ_CHIP_REG32(b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], r)
+#define WRITE_CHIP_REG32(b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], r, d)
/*
**********************************************************************************
** IOCTL CONTROL Mail Box
@@ -301,6 +305,11 @@ struct CMD_MESSAGE_FIELD {
#define ARCMSR_IOP2DRV_DOORBELL 0x00020408 /* window of "instruction flags" from iop to driver */
#define ARCMSR_IOP2DRV_DOORBELL_MASK 0x0002040C
+#define ARCMSR_IOP2DRV_DOORBELL_1203 0x00021870 /* window of "instruction flags" from iop to driver */
+#define ARCMSR_IOP2DRV_DOORBELL_MASK_1203 0x00021874
+#define ARCMSR_DRV2IOP_DOORBELL_1203 0x00021878 /* window of "instruction flags" from driver to iop */
+#define ARCMSR_DRV2IOP_DOORBELL_MASK_1203 0x0002187C
+
/* ARECA FLAG LANGUAGE */
#define ARCMSR_IOP2DRV_DATA_WRITE_OK 0x00000001 /* ioctl transfer */
#define ARCMSR_IOP2DRV_DATA_READ_OK 0x00000002 /* ioctl transfer */
@@ -486,6 +495,14 @@ struct HBA_MessageUnit
**
*********************************************************************
*/
+struct HBB_DOORBELL_1203
+{
+ u_int8_t doorbell_reserved[ARCMSR_IOP2DRV_DOORBELL_1203]; /*reserved */
+ u_int32_t iop2drv_doorbell; /*offset 0x00021870:00,01,02,03: window of "instruction flags" from iop to driver */
+ u_int32_t iop2drv_doorbell_mask; /* 04,05,06,07: doorbell mask */
+ u_int32_t drv2iop_doorbell; /* 08,09,10,11: window of "instruction flags" from driver to iop */
+ u_int32_t drv2iop_doorbell_mask; /* 12,13,14,15: doorbell mask */
+};
struct HBB_DOORBELL
{
u_int8_t doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */
@@ -520,6 +537,10 @@ struct HBB_MessageUnit
int32_t doneq_index; /* done queue index */
struct HBB_DOORBELL *hbb_doorbell;
struct HBB_RWBUFFER *hbb_rwbuffer;
+ bus_size_t drv2iop_doorbell; /* window of "instruction flags" from driver to iop */
+ bus_size_t drv2iop_doorbell_mask; /* doorbell mask */
+ bus_size_t iop2drv_doorbell; /* window of "instruction flags" from iop to driver */
+ bus_size_t iop2drv_doorbell_mask; /* doorbell mask */
};
/*
diff --git a/sys/dev/ath/ath_hal/ah.c b/sys/dev/ath/ath_hal/ah.c
index 4eb7fb6..a0baa69 100644
--- a/sys/dev/ath/ath_hal/ah.c
+++ b/sys/dev/ath/ath_hal/ah.c
@@ -145,6 +145,9 @@ ath_hal_mac_name(struct ath_hal *ah)
case AR_SREV_VERSION_QCA9565:
/* XXX should say QCA, not AR */
return "9565";
+ case AR_SREV_VERSION_QCA9530:
+ /* XXX should say QCA, not AR */
+ return "9530";
}
return "????";
}
@@ -1428,15 +1431,15 @@ ath_hal_EepromDataRead(struct ath_hal *ah, u_int off, uint16_t *data)
* This is the unmapped frequency which is programmed into the hardware.
*/
int
-ath_hal_mhz2ieee_2ghz(struct ath_hal *ah, HAL_CHANNEL_INTERNAL *ichan)
+ath_hal_mhz2ieee_2ghz(struct ath_hal *ah, int freq)
{
- if (ichan->channel == 2484)
+ if (freq == 2484)
return 14;
- if (ichan->channel < 2484)
- return ((int) ichan->channel - 2407) / 5;
+ if (freq < 2484)
+ return ((int) freq - 2407) / 5;
else
- return 15 + ((ichan->channel - 2512) / 20);
+ return 15 + ((freq - 2512) / 20);
}
/*
diff --git a/sys/dev/ath/ath_hal/ah_devid.h b/sys/dev/ath/ath_hal/ah_devid.h
index 1e4d473..a5006a0 100644
--- a/sys/dev/ath/ath_hal/ah_devid.h
+++ b/sys/dev/ath/ath_hal/ah_devid.h
@@ -94,6 +94,7 @@
#define AR9300_DEVID_QCA9565 0x0036
#define AR9300_DEVID_AR1111_PCIE 0x0037
#define AR9300_DEVID_QCA955X 0x0039
+#define AR9300_DEVID_QCA953X 0x003d /* Honey Bee */
#define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */
#define AR_SUBVENDOR_ID_NEW_A 0x7065 /* Update device to new RD */
diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h
index 0c855d4..a4c7656 100644
--- a/sys/dev/ath/ath_hal/ah_internal.h
+++ b/sys/dev/ath/ath_hal/ah_internal.h
@@ -1031,7 +1031,7 @@ ath_hal_getantennaallowed(struct ath_hal *ah,
/*
* Map the given 2GHz channel to an IEEE number.
*/
-extern int ath_hal_mhz2ieee_2ghz(struct ath_hal *, HAL_CHANNEL_INTERNAL *);
+extern int ath_hal_mhz2ieee_2ghz(struct ath_hal *, int freq);
/*
* Clear the channel survey data.
diff --git a/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h b/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h
index 8d0a39a..00ceeb8 100644
--- a/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h
+++ b/sys/dev/ath/ath_hal/ar9003/ar9300_devid.h
@@ -54,6 +54,7 @@
#define AR_SREV_VERSION_AR9340 0x300
#define AR_SREV_VERSION_QCA9550 0x400
#define AR_SREV_VERSION_AR9485 0x240
+#define AR_SREV_VERSION_QCA9530 0x500
#define AR_SREV_REVISION_AR9380_10 0 /* AR9380 1.0 */
#define AR_SREV_REVISION_AR9380_20 2 /* AR9380 2.0/2.1 */
diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c
index 36c3dff..af0f779 100644
--- a/sys/dev/ath/if_ath_tx_ht.c
+++ b/sys/dev/ath/if_ath_tx_ht.c
@@ -585,7 +585,7 @@ ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni,
}
}
-#if 0
+#ifdef ATH_DEBUG
static void
ath_rateseries_print(struct ath_softc *sc, HAL_11N_RATE_SERIES *series)
{
@@ -627,8 +627,9 @@ ath_buf_set_rate(struct ath_softc *sc, struct ieee80211_node *ni,
ath_rateseries_setup(sc, ni, bf, series);
-#if 0
- ath_rateseries_print(sc, series);
+#ifdef ATH_DEBUG
+ if (sc->sc_debug & ATH_DEBUG_XMIT)
+ ath_rateseries_print(sc, series);
#endif
/* Set rate scenario */
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index 23a9efe..b3553ca 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -198,34 +198,34 @@ enum {
CXGBE_BUSY = (1 << 9),
/* port flags */
- DOOMED = (1 << 0),
- PORT_INIT_DONE = (1 << 1),
- PORT_SYSCTL_CTX = (1 << 2),
HAS_TRACEQ = (1 << 3),
+
+ /* VI flags */
+ DOOMED = (1 << 0),
+ VI_INIT_DONE = (1 << 1),
+ VI_SYSCTL_CTX = (1 << 2),
INTR_RXQ = (1 << 4), /* All NIC rxq's take interrupts */
INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */
- INTR_NM_RXQ = (1 << 6), /* All netmap rxq's take interrupts */
- INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ | INTR_NM_RXQ),
+ INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ),
+ VI_NETMAP = (1 << 6),
/* adapter debug_flags */
DF_DUMP_MBOX = (1 << 0),
};
-#define IS_DOOMED(pi) ((pi)->flags & DOOMED)
-#define SET_DOOMED(pi) do {(pi)->flags |= DOOMED;} while (0)
+#define IS_DOOMED(vi) ((vi)->flags & DOOMED)
+#define SET_DOOMED(vi) do {(vi)->flags |= DOOMED;} while (0)
#define IS_BUSY(sc) ((sc)->flags & CXGBE_BUSY)
#define SET_BUSY(sc) do {(sc)->flags |= CXGBE_BUSY;} while (0)
#define CLR_BUSY(sc) do {(sc)->flags &= ~CXGBE_BUSY;} while (0)
-struct port_info {
+struct vi_info {
device_t dev;
- struct adapter *adapter;
+ struct port_info *pi;
struct ifnet *ifp;
struct ifmedia media;
- struct mtx pi_lock;
- char lockname[16];
unsigned long flags;
int if_flags;
@@ -234,13 +234,11 @@ struct port_info {
int16_t xact_addr_filt;/* index of exact MAC address filter */
uint16_t rss_size; /* size of VI's RSS table slice */
uint16_t rss_base; /* start of VI's RSS table slice */
- uint8_t lport; /* associated offload logical port */
- int8_t mdio_addr;
- uint8_t port_type;
- uint8_t mod_type;
- uint8_t port_id;
- uint8_t tx_chan;
- uint8_t rx_chan_map; /* rx MPS channel bitmap */
+
+ eventhandler_tag vlan_c;
+
+ int nintr;
+ int first_intr;
/* These need to be int as they are used in sysctl */
int ntxq; /* # of tx queues */
@@ -254,24 +252,41 @@ struct port_info {
int nofldrxq; /* # of offload rx queues */
int first_ofld_rxq; /* index of first offload rx queue */
#endif
-#ifdef DEV_NETMAP
- int nnmtxq; /* # of netmap tx queues */
- int first_nm_txq; /* index of first netmap tx queue */
- int nnmrxq; /* # of netmap rx queues */
- int first_nm_rxq; /* index of first netmap rx queue */
-
- struct ifnet *nm_ifp;
- struct ifmedia nm_media;
- int nmif_flags;
- uint16_t nm_viid;
- int16_t nm_xact_addr_filt;
- uint16_t nm_rss_size; /* size of netmap VI's RSS table slice */
-#endif
int tmr_idx;
int pktc_idx;
int qsize_rxq;
int qsize_txq;
+ struct timeval last_refreshed;
+ struct fw_vi_stats_vf stats;
+
+ struct callout tick;
+ struct sysctl_ctx_list ctx; /* from ifconfig up to driver detach */
+
+ uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */
+};
+
+struct port_info {
+ device_t dev;
+ struct adapter *adapter;
+
+ struct vi_info *vi;
+ int nvi;
+ int up_vis;
+ int uld_vis;
+
+ struct mtx pi_lock;
+ char lockname[16];
+ unsigned long flags;
+
+ uint8_t lport; /* associated offload logical port */
+ int8_t mdio_addr;
+ uint8_t port_type;
+ uint8_t mod_type;
+ uint8_t port_id;
+ uint8_t tx_chan;
+ uint8_t rx_chan_map; /* rx MPS channel bitmap */
+
int linkdnrc;
struct link_config link_cfg;
@@ -280,14 +295,11 @@ struct port_info {
u_int tnl_cong_drops;
u_int tx_parse_error;
- eventhandler_tag vlan_c;
-
struct callout tick;
- struct sysctl_ctx_list ctx; /* from ifconfig up to driver detach */
-
- uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */
};
+#define IS_MAIN_VI(vi) ((vi) == &((vi)->pi->vi[0]))
+
/* Where the cluster came from, how it has been carved up. */
struct cluster_layout {
int8_t zidx;
@@ -603,7 +615,7 @@ struct sge_wrq {
#ifdef DEV_NETMAP
struct sge_nm_rxq {
- struct port_info *pi;
+ struct vi_info *vi;
struct iq_desc *iq_desc;
uint16_t iq_abs_id;
@@ -760,7 +772,6 @@ struct adapter {
struct tid_info tids;
uint16_t doorbells;
- int open_device_map;
#ifdef TCP_OFFLOAD
int offload_map; /* ports with IFCAP_TOE enabled */
int active_ulds; /* ULDs activated on this adapter */
@@ -870,24 +881,27 @@ struct adapter {
} \
} while (0)
-#define for_each_txq(pi, iter, q) \
- for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \
- iter < pi->ntxq; ++iter, ++q)
-#define for_each_rxq(pi, iter, q) \
- for (q = &pi->adapter->sge.rxq[pi->first_rxq], iter = 0; \
- iter < pi->nrxq; ++iter, ++q)
-#define for_each_ofld_txq(pi, iter, q) \
- for (q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq], iter = 0; \
- iter < pi->nofldtxq; ++iter, ++q)
-#define for_each_ofld_rxq(pi, iter, q) \
- for (q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq], iter = 0; \
- iter < pi->nofldrxq; ++iter, ++q)
-#define for_each_nm_txq(pi, iter, q) \
- for (q = &pi->adapter->sge.nm_txq[pi->first_nm_txq], iter = 0; \
- iter < pi->nnmtxq; ++iter, ++q)
-#define for_each_nm_rxq(pi, iter, q) \
- for (q = &pi->adapter->sge.nm_rxq[pi->first_nm_rxq], iter = 0; \
- iter < pi->nnmrxq; ++iter, ++q)
+#define for_each_txq(vi, iter, q) \
+ for (q = &vi->pi->adapter->sge.txq[vi->first_txq], iter = 0; \
+ iter < vi->ntxq; ++iter, ++q)
+#define for_each_rxq(vi, iter, q) \
+ for (q = &vi->pi->adapter->sge.rxq[vi->first_rxq], iter = 0; \
+ iter < vi->nrxq; ++iter, ++q)
+#define for_each_ofld_txq(vi, iter, q) \
+ for (q = &vi->pi->adapter->sge.ofld_txq[vi->first_ofld_txq], iter = 0; \
+ iter < vi->nofldtxq; ++iter, ++q)
+#define for_each_ofld_rxq(vi, iter, q) \
+ for (q = &vi->pi->adapter->sge.ofld_rxq[vi->first_ofld_rxq], iter = 0; \
+ iter < vi->nofldrxq; ++iter, ++q)
+#define for_each_nm_txq(vi, iter, q) \
+ for (q = &vi->pi->adapter->sge.nm_txq[vi->first_txq], iter = 0; \
+ iter < vi->ntxq; ++iter, ++q)
+#define for_each_nm_rxq(vi, iter, q) \
+ for (q = &vi->pi->adapter->sge.nm_rxq[vi->first_rxq], iter = 0; \
+ iter < vi->nrxq; ++iter, ++q)
+#define for_each_vi(_pi, _iter, _vi) \
+ for ((_vi) = (_pi)->vi, (_iter) = 0; (_iter) < (_pi)->nvi; \
+ ++(_iter), ++(_vi))
#define IDXINCR(idx, incr, wrap) do { \
idx = wrap - idx > incr ? idx + incr : incr - (wrap - idx); \
@@ -979,7 +993,7 @@ static inline void
t4_os_set_hw_addr(struct adapter *sc, int idx, uint8_t hw_addr[])
{
- bcopy(hw_addr, sc->port[idx]->hw_addr, ETHER_ADDR_LEN);
+ bcopy(hw_addr, sc->port[idx]->vi[0].hw_addr, ETHER_ADDR_LEN);
}
static inline bool
@@ -1015,13 +1029,17 @@ int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t);
int t4_register_an_handler(struct adapter *, an_handler_t);
int t4_register_fw_msg_handler(struct adapter *, int, fw_msg_handler_t);
int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);
-int begin_synchronized_op(struct adapter *, struct port_info *, int, char *);
+int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *);
+void doom_vi(struct adapter *, struct vi_info *);
void end_synchronized_op(struct adapter *, int);
int update_mac_settings(struct ifnet *, int);
int adapter_full_init(struct adapter *);
int adapter_full_uninit(struct adapter *);
-int port_full_init(struct port_info *);
-int port_full_uninit(struct port_info *);
+uint64_t cxgbe_get_counter(struct ifnet *, ift_counter);
+int vi_full_init(struct vi_info *);
+int vi_full_uninit(struct vi_info *);
+void vi_sysctls(struct vi_info *);
+void vi_tick(void *);
#ifdef DEV_NETMAP
/* t4_netmap.c */
@@ -1043,8 +1061,8 @@ void t4_sge_sysctls(struct adapter *, struct sysctl_ctx_list *,
int t4_destroy_dma_tag(struct adapter *);
int t4_setup_adapter_queues(struct adapter *);
int t4_teardown_adapter_queues(struct adapter *);
-int t4_setup_port_queues(struct port_info *);
-int t4_teardown_port_queues(struct port_info *);
+int t4_setup_vi_queues(struct vi_info *);
+int t4_teardown_vi_queues(struct vi_info *);
void t4_intr_all(void *);
void t4_intr(void *);
void t4_intr_err(void *);
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index 7954188..b72c502 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -5723,11 +5723,11 @@ int __devinit t4_port_init(struct port_info *p, int mbox, int pf, int vf)
if (ret < 0)
return ret;
- p->viid = ret;
+ p->vi[0].viid = ret;
p->tx_chan = j;
p->rx_chan_map = get_mps_bg_map(adap, j);
p->lport = j;
- p->rss_size = rss_size;
+ p->vi[0].rss_size = rss_size;
t4_os_set_hw_addr(adap, p->port_id, addr);
ret = ntohl(c.u.info.lstatus_to_modtype);
@@ -5740,13 +5740,13 @@ int __devinit t4_port_init(struct port_info *p, int mbox, int pf, int vf)
param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) |
- V_FW_PARAMS_PARAM_YZ(p->viid);
+ V_FW_PARAMS_PARAM_YZ(p->vi[0].viid);
ret = t4_query_params(adap, mbox, pf, vf, 1, &param, &val);
if (ret)
- p->rss_base = 0xffff;
+ p->vi[0].rss_base = 0xffff;
else {
/* MPASS((val >> 16) == rss_size); */
- p->rss_base = val & 0xffff;
+ p->vi[0].rss_base = val & 0xffff;
}
return 0;
diff --git a/sys/dev/cxgbe/iw_cxgbe/provider.c b/sys/dev/cxgbe/iw_cxgbe/provider.c
index 6b1dfa1..d7ce079 100644
--- a/sys/dev/cxgbe/iw_cxgbe/provider.c
+++ b/sys/dev/cxgbe/iw_cxgbe/provider.c
@@ -296,7 +296,7 @@ c4iw_query_gid(struct ib_device *ibdev, u8 port, int index, union ib_gid *gid)
if (port == 0 || port > sc->params.nports)
return (-EINVAL);
pi = sc->port[port - 1];
- memcpy(&gid->raw[0], pi->hw_addr, sizeof(pi->hw_addr));
+ memcpy(&gid->raw[0], pi->vi[0].hw_addr, ETHER_ADDR_LEN);
return (0);
}
@@ -309,7 +309,8 @@ c4iw_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
CTR3(KTR_IW_CXGBE, "%s ibdev %p, props %p", __func__, ibdev, props);
memset(props, 0, sizeof *props);
- memcpy(&props->sys_image_guid, sc->port[0]->hw_addr, 6);
+ memcpy(&props->sys_image_guid, sc->port[0]->vi[0].hw_addr,
+ ETHER_ADDR_LEN);
props->hw_ver = sc->params.chipid;
props->fw_ver = sc->params.fw_vers;
props->device_cap_flags = dev->device_cap_flags;
@@ -352,7 +353,7 @@ c4iw_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr *props)
if (port > sc->params.nports)
return (-EINVAL);
pi = sc->port[port - 1];
- ifp = pi->ifp;
+ ifp = pi->vi[0].ifp;
memset(props, 0, sizeof(struct ib_port_attr));
props->max_mtu = IB_MTU_4096;
@@ -397,7 +398,7 @@ c4iw_register_device(struct c4iw_dev *dev)
BUG_ON(!sc->port[0]);
strlcpy(ibdev->name, device_get_nameunit(sc->dev), sizeof(ibdev->name));
memset(&ibdev->node_guid, 0, sizeof(ibdev->node_guid));
- memcpy(&ibdev->node_guid, sc->port[0]->hw_addr, 6);
+ memcpy(&ibdev->node_guid, sc->port[0]->vi[0].hw_addr, ETHER_ADDR_LEN);
ibdev->owner = THIS_MODULE;
dev->device_cap_flags = IB_DEVICE_LOCAL_DMA_LKEY | IB_DEVICE_MEM_WINDOW;
if (fastreg_support)
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 473d5eb..edac709 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -106,6 +106,22 @@ static driver_t cxgbe_driver = {
sizeof(struct port_info)
};
+/* T4 VI (vcxgbe) interface */
+static int vcxgbe_probe(device_t);
+static int vcxgbe_attach(device_t);
+static int vcxgbe_detach(device_t);
+static device_method_t vcxgbe_methods[] = {
+ DEVMETHOD(device_probe, vcxgbe_probe),
+ DEVMETHOD(device_attach, vcxgbe_attach),
+ DEVMETHOD(device_detach, vcxgbe_detach),
+ { 0, 0 }
+};
+static driver_t vcxgbe_driver = {
+ "vcxgbe",
+ vcxgbe_methods,
+ sizeof(struct vi_info)
+};
+
static d_ioctl_t t4_ioctl;
static d_open_t t4_open;
static d_close_t t4_close;
@@ -142,6 +158,13 @@ static driver_t cxl_driver = {
sizeof(struct port_info)
};
+/* T5 VI (vcxl) interface */
+static driver_t vcxl_driver = {
+ "vcxl",
+ vcxgbe_methods,
+ sizeof(struct vi_info)
+};
+
static struct cdevsw t5_cdevsw = {
.d_version = D_VERSION,
.d_flags = 0,
@@ -156,7 +179,6 @@ static void cxgbe_init(void *);
static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t);
static int cxgbe_transmit(struct ifnet *, struct mbuf *);
static void cxgbe_qflush(struct ifnet *);
-static uint64_t cxgbe_get_counter(struct ifnet *, ift_counter);
static int cxgbe_media_change(struct ifnet *);
static void cxgbe_media_status(struct ifnet *, struct ifmediareq *);
@@ -327,6 +349,19 @@ TUNABLE_INT("hw.cxgbe.fcoecaps_allowed", &t4_fcoecaps_allowed);
static int t5_write_combine = 0;
TUNABLE_INT("hw.cxl.write_combine", &t5_write_combine);
+static int t4_num_vis = 1;
+TUNABLE_INT("hw.cxgbe.num_vis", &t4_num_vis);
+
+/* Functions used by extra VIs to obtain unique MAC addresses for each VI. */
+static int vi_mac_funcs[] = {
+ FW_VI_FUNC_OFLD,
+ FW_VI_FUNC_IWARP,
+ FW_VI_FUNC_OPENISCSI,
+ FW_VI_FUNC_OPENFCOE,
+ FW_VI_FUNC_FOISCSI,
+ FW_VI_FUNC_FOFCOE,
+};
+
struct intrs_and_queues {
uint16_t intr_type; /* INTx, MSI, or MSI-X */
uint16_t nirq; /* Total # of vectors */
@@ -370,7 +405,7 @@ static int validate_mt_off_len(struct adapter *, int, uint32_t, int,
uint32_t *);
static void memwin_info(struct adapter *, int, uint32_t *, uint32_t *);
static uint32_t position_memwin(struct adapter *, int, uint32_t);
-static int cfg_itype_and_nqueues(struct adapter *, int, int,
+static int cfg_itype_and_nqueues(struct adapter *, int, int, int,
struct intrs_and_queues *);
static int prep_firmware(struct adapter *);
static int partition_resources(struct adapter *, const struct firmware *,
@@ -380,8 +415,8 @@ static int get_params__post_init(struct adapter *);
static int set_params__post_init(struct adapter *);
static void t4_set_desc(struct adapter *);
static void build_medialist(struct port_info *, struct ifmedia *);
-static int cxgbe_init_synchronized(struct port_info *);
-static int cxgbe_uninit_synchronized(struct port_info *);
+static int cxgbe_init_synchronized(struct vi_info *);
+static int cxgbe_uninit_synchronized(struct vi_info *);
static int setup_intr_handlers(struct adapter *);
static void quiesce_txq(struct adapter *, struct sge_txq *);
static void quiesce_wrq(struct adapter *, struct sge_wrq *);
@@ -393,6 +428,7 @@ static int t4_free_irq(struct adapter *, struct irq *);
static void reg_block_dump(struct adapter *, uint8_t *, unsigned int,
unsigned int);
static void t4_get_regs(struct adapter *, struct t4_regdump *, uint8_t *);
+static void vi_refresh_stats(struct adapter *, struct vi_info *);
static void cxgbe_refresh_stats(struct adapter *, struct port_info *);
static void cxgbe_tick(void *);
static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t);
@@ -400,8 +436,8 @@ static int cpl_not_handled(struct sge_iq *, const struct rss_header *,
struct mbuf *);
static int an_not_handled(struct sge_iq *, const struct rsp_ctrl *);
static int fw_msg_not_handled(struct adapter *, const __be64 *);
-static int t4_sysctls(struct adapter *);
-static int cxgbe_sysctls(struct port_info *);
+static void t4_sysctls(struct adapter *);
+static void cxgbe_sysctls(struct port_info *);
static int sysctl_int_array(SYSCTL_HANDLER_ARGS);
static int sysctl_bitfield(SYSCTL_HANDLER_ARGS);
static int sysctl_btphy(SYSCTL_HANDLER_ARGS);
@@ -459,7 +495,7 @@ static int read_i2c(struct adapter *, struct t4_i2c_data *);
static int set_sched_class(struct adapter *, struct t4_sched_params *);
static int set_sched_queue(struct adapter *, struct t4_sched_queue *);
#ifdef TCP_OFFLOAD
-static int toe_capability(struct port_info *, int);
+static int toe_capability(struct vi_info *, int);
#endif
static int mod_event(module_t, int, void *);
@@ -604,7 +640,7 @@ static int
t4_attach(device_t dev)
{
struct adapter *sc;
- int rc = 0, i, n10g, n1g, rqidx, tqidx;
+ int rc = 0, i, j, n10g, n1g, rqidx, tqidx;
struct intrs_and_queues iaq;
struct sge *s;
#ifdef TCP_OFFLOAD
@@ -613,6 +649,7 @@ t4_attach(device_t dev)
#ifdef DEV_NETMAP
int nm_rqidx, nm_tqidx;
#endif
+ int num_vis;
sc = device_get_softc(dev);
sc->dev = dev;
@@ -646,7 +683,7 @@ t4_attach(device_t dev)
mtx_init(&sc->sfl_lock, "starving freelists", 0, MTX_DEF);
TAILQ_INIT(&sc->sfl);
- callout_init(&sc->sfl_callout, 1);
+ callout_init_mtx(&sc->sfl_callout, &sc->sfl_lock, 0);
mtx_init(&sc->regwin_lock, "register and memory window", 0, MTX_DEF);
@@ -731,6 +768,27 @@ t4_attach(device_t dev)
goto done; /* error message displayed already */
/*
+ * Number of VIs to create per-port. The first VI is the
+ * "main" regular VI for the port. The second VI is used for
+ * netmap if present, and any remaining VIs are used for
+ * additional virtual interfaces.
+ *
+ * Limit the number of VIs per port to the number of available
+ * MAC addresses per port.
+ */
+ if (t4_num_vis >= 1)
+ num_vis = t4_num_vis;
+ else
+ num_vis = 1;
+#ifdef DEV_NETMAP
+ num_vis++;
+#endif
+ if (num_vis > nitems(vi_mac_funcs)) {
+ num_vis = nitems(vi_mac_funcs);
+ device_printf(dev, "Number of VIs limited to %d\n", num_vis);
+ }
+
+ /*
* First pass over all the ports - allocate VIs and initialize some
* basic parameters like mac address, port type, etc. We also figure
* out whether a port is 10G or 1G and use that information when
@@ -739,6 +797,7 @@ t4_attach(device_t dev)
n10g = n1g = 0;
for_each_port(sc, i) {
struct port_info *pi;
+ struct vi_info *vi;
pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK);
sc->port[i] = pi;
@@ -746,12 +805,19 @@ t4_attach(device_t dev)
/* These must be set before t4_port_init */
pi->adapter = sc;
pi->port_id = i;
+ pi->nvi = num_vis;
+ pi->vi = malloc(sizeof(struct vi_info) * num_vis, M_CXGBE,
+ M_ZERO | M_WAITOK);
- /* Allocate the vi and initialize parameters like mac addr */
+ /*
+ * Allocate the "main" VI and initialize parameters
+ * like mac addr.
+ */
rc = -t4_port_init(pi, sc->mbox, sc->pf, 0);
if (rc != 0) {
device_printf(dev, "unable to initialize port %d: %d\n",
i, rc);
+ free(pi->vi, M_CXGBE);
free(pi, M_CXGBE);
sc->port[i] = NULL;
goto done;
@@ -765,6 +831,7 @@ t4_attach(device_t dev)
rc = -t4_link_start(sc, sc->mbox, pi->tx_chan, &pi->link_cfg);
if (rc != 0) {
device_printf(dev, "port %d l1cfg failed: %d\n", i, rc);
+ free(pi->vi, M_CXGBE);
free(pi, M_CXGBE);
sc->port[i] = NULL;
goto done;
@@ -777,19 +844,25 @@ t4_attach(device_t dev)
if (is_10G_port(pi) || is_40G_port(pi)) {
n10g++;
- pi->tmr_idx = t4_tmr_idx_10g;
- pi->pktc_idx = t4_pktc_idx_10g;
+ for_each_vi(pi, j, vi) {
+ vi->tmr_idx = t4_tmr_idx_10g;
+ vi->pktc_idx = t4_pktc_idx_10g;
+ }
} else {
n1g++;
- pi->tmr_idx = t4_tmr_idx_1g;
- pi->pktc_idx = t4_pktc_idx_1g;
+ for_each_vi(pi, j, vi) {
+ vi->tmr_idx = t4_tmr_idx_1g;
+ vi->pktc_idx = t4_pktc_idx_1g;
+ }
}
- pi->xact_addr_filt = -1;
pi->linkdnrc = -1;
- pi->qsize_rxq = t4_qsize_rxq;
- pi->qsize_txq = t4_qsize_txq;
+ for_each_vi(pi, j, vi) {
+ vi->qsize_rxq = t4_qsize_rxq;
+ vi->qsize_txq = t4_qsize_txq;
+ vi->pi = pi;
+ }
pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbe" : "cxl", -1);
if (pi->dev == NULL) {
@@ -798,13 +871,17 @@ t4_attach(device_t dev)
rc = ENXIO;
goto done;
}
+ pi->vi[0].dev = pi->dev;
device_set_softc(pi->dev, pi);
}
/*
* Interrupt type, # of interrupts, # of rx/tx queues, etc.
*/
- rc = cfg_itype_and_nqueues(sc, n10g, n1g, &iaq);
+#ifdef DEV_NETMAP
+ num_vis--;
+#endif
+ rc = cfg_itype_and_nqueues(sc, n10g, n1g, num_vis, &iaq);
if (rc != 0)
goto done; /* error message displayed already */
@@ -814,6 +891,10 @@ t4_attach(device_t dev)
s = &sc->sge;
s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g;
s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g;
+ if (num_vis > 1) {
+ s->nrxq += (n10g + n1g) * (num_vis - 1);
+ s->ntxq += (n10g + n1g) * (num_vis - 1);
+ }
s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */
s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */
s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */
@@ -821,6 +902,10 @@ t4_attach(device_t dev)
if (is_offload(sc)) {
s->nofldrxq = n10g * iaq.nofldrxq10g + n1g * iaq.nofldrxq1g;
s->nofldtxq = n10g * iaq.nofldtxq10g + n1g * iaq.nofldtxq1g;
+ if (num_vis > 1) {
+ s->nofldrxq += (n10g + n1g) * (num_vis - 1);
+ s->nofldtxq += (n10g + n1g) * (num_vis - 1);
+ }
s->neq += s->nofldtxq + s->nofldrxq;
s->niq += s->nofldrxq;
@@ -871,57 +956,68 @@ t4_attach(device_t dev)
#endif
for_each_port(sc, i) {
struct port_info *pi = sc->port[i];
+ struct vi_info *vi;
if (pi == NULL)
continue;
- pi->first_rxq = rqidx;
- pi->first_txq = tqidx;
- if (is_10G_port(pi) || is_40G_port(pi)) {
- pi->flags |= iaq.intr_flags_10g;
- pi->nrxq = iaq.nrxq10g;
- pi->ntxq = iaq.ntxq10g;
- } else {
- pi->flags |= iaq.intr_flags_1g;
- pi->nrxq = iaq.nrxq1g;
- pi->ntxq = iaq.ntxq1g;
- }
+ for_each_vi(pi, j, vi) {
+#ifdef DEV_NETMAP
+ if (j == 1) {
+ vi->flags |= VI_NETMAP | INTR_RXQ;
+ vi->first_rxq = nm_rqidx;
+ vi->first_txq = nm_tqidx;
+ if (is_10G_port(pi) || is_40G_port(pi)) {
+ vi->nrxq = iaq.nnmrxq10g;
+ vi->ntxq = iaq.nnmtxq10g;
+ } else {
+ vi->nrxq = iaq.nnmrxq1g;
+ vi->ntxq = iaq.nnmtxq1g;
+ }
+ nm_rqidx += vi->nrxq;
+ nm_tqidx += vi->ntxq;
+ continue;
+ }
+#endif
- if (pi->ntxq > 1)
- pi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0;
- else
- pi->rsrv_noflowq = 0;
+ vi->first_rxq = rqidx;
+ vi->first_txq = tqidx;
+ if (is_10G_port(pi) || is_40G_port(pi)) {
+ vi->flags |= iaq.intr_flags_10g & INTR_RXQ;
+ vi->nrxq = j == 0 ? iaq.nrxq10g : 1;
+ vi->ntxq = j == 0 ? iaq.ntxq10g : 1;
+ } else {
+ vi->flags |= iaq.intr_flags_1g & INTR_RXQ;
+ vi->nrxq = j == 0 ? iaq.nrxq1g : 1;
+ vi->ntxq = j == 0 ? iaq.ntxq1g : 1;
+ }
+
+ if (vi->ntxq > 1)
+ vi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0;
+ else
+ vi->rsrv_noflowq = 0;
+
+ rqidx += vi->nrxq;
+ tqidx += vi->ntxq;
- rqidx += pi->nrxq;
- tqidx += pi->ntxq;
#ifdef TCP_OFFLOAD
- if (is_offload(sc)) {
- pi->first_ofld_rxq = ofld_rqidx;
- pi->first_ofld_txq = ofld_tqidx;
+ if (!is_offload(sc))
+ continue;
+ vi->first_ofld_rxq = ofld_rqidx;
+ vi->first_ofld_txq = ofld_tqidx;
if (is_10G_port(pi) || is_40G_port(pi)) {
- pi->nofldrxq = iaq.nofldrxq10g;
- pi->nofldtxq = iaq.nofldtxq10g;
+ vi->flags |= iaq.intr_flags_10g & INTR_OFLD_RXQ;
+ vi->nofldrxq = j == 0 ? iaq.nofldrxq10g : 1;
+ vi->nofldtxq = j == 0 ? iaq.nofldtxq10g : 1;
} else {
- pi->nofldrxq = iaq.nofldrxq1g;
- pi->nofldtxq = iaq.nofldtxq1g;
+ vi->flags |= iaq.intr_flags_1g & INTR_OFLD_RXQ;
+ vi->nofldrxq = j == 0 ? iaq.nofldrxq1g : 1;
+ vi->nofldtxq = j == 0 ? iaq.nofldtxq1g : 1;
}
- ofld_rqidx += pi->nofldrxq;
- ofld_tqidx += pi->nofldtxq;
- }
+ ofld_rqidx += vi->nofldrxq;
+ ofld_tqidx += vi->nofldtxq;
#endif
-#ifdef DEV_NETMAP
- pi->first_nm_rxq = nm_rqidx;
- pi->first_nm_txq = nm_tqidx;
- if (is_10G_port(pi) || is_40G_port(pi)) {
- pi->nnmrxq = iaq.nnmrxq10g;
- pi->nnmtxq = iaq.nnmtxq10g;
- } else {
- pi->nnmrxq = iaq.nnmrxq1g;
- pi->nnmtxq = iaq.nnmtxq1g;
}
- nm_rqidx += pi->nnmrxq;
- nm_tqidx += pi->nnmtxq;
-#endif
}
rc = setup_intr_handlers(sc);
@@ -996,11 +1092,12 @@ t4_detach(device_t dev)
for (i = 0; i < MAX_NPORTS; i++) {
pi = sc->port[i];
if (pi) {
- t4_free_vi(sc, sc->mbox, sc->pf, 0, pi->viid);
+ t4_free_vi(sc, sc->mbox, sc->pf, 0, pi->vi[0].viid);
if (pi->dev)
device_delete_child(dev, pi->dev);
mtx_destroy(&pi->pi_lock);
+ free(pi->vi, M_CXGBE);
free(pi, M_CXGBE);
}
}
@@ -1052,6 +1149,7 @@ t4_detach(device_t dev)
mtx_destroy(&sc->sc_lock);
}
+ callout_drain(&sc->sfl_callout);
if (mtx_initialized(&sc->tids.ftid_lock))
mtx_destroy(&sc->tids.ftid_lock);
if (mtx_initialized(&sc->sfl_lock))
@@ -1084,12 +1182,13 @@ cxgbe_probe(device_t dev)
#define T4_CAP_ENABLE (T4_CAP)
static int
-cxgbe_attach(device_t dev)
+cxgbe_vi_attach(device_t dev, struct vi_info *vi)
{
- struct port_info *pi = device_get_softc(dev);
struct ifnet *ifp;
- char *s;
- int n, o;
+ struct sbuf *sb;
+
+ vi->xact_addr_filt = -1;
+ callout_init(&vi->tick, 1);
/* Allocate an ifnet and set it up */
ifp = if_alloc(IFT_ETHER);
@@ -1097,10 +1196,8 @@ cxgbe_attach(device_t dev)
device_printf(dev, "Cannot allocate ifnet\n");
return (ENOMEM);
}
- pi->ifp = ifp;
- ifp->if_softc = pi;
-
- callout_init(&pi->tick, 1);
+ vi->ifp = ifp;
+ ifp->if_softc = vi;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@@ -1113,7 +1210,7 @@ cxgbe_attach(device_t dev)
ifp->if_capabilities = T4_CAP;
#ifdef TCP_OFFLOAD
- if (is_offload(pi->adapter))
+ if (vi->nofldrxq != 0)
ifp->if_capabilities |= IFCAP_TOE;
#endif
ifp->if_capenable = T4_CAP_ENABLE;
@@ -1124,99 +1221,121 @@ cxgbe_attach(device_t dev)
ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS;
ifp->if_hw_tsomaxsegsize = 65536;
- /* Initialize ifmedia for this port */
- ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change,
+ /* Initialize ifmedia for this VI */
+ ifmedia_init(&vi->media, IFM_IMASK, cxgbe_media_change,
cxgbe_media_status);
- build_medialist(pi, &pi->media);
+ build_medialist(vi->pi, &vi->media);
- pi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp,
+ vi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp,
EVENTHANDLER_PRI_ANY);
- ether_ifattach(ifp, pi->hw_addr);
+ ether_ifattach(ifp, vi->hw_addr);
- n = 128;
- s = malloc(n, M_CXGBE, M_WAITOK);
- o = snprintf(s, n, "%d txq, %d rxq (NIC)", pi->ntxq, pi->nrxq);
- MPASS(n > o);
+ sb = sbuf_new_auto();
+ sbuf_printf(sb, "%d txq, %d rxq (NIC)", vi->ntxq, vi->nrxq);
#ifdef TCP_OFFLOAD
- if (is_offload(pi->adapter)) {
- o += snprintf(s + o, n - o, "; %d txq, %d rxq (TOE)",
- pi->nofldtxq, pi->nofldrxq);
- MPASS(n > o);
- }
-#endif
-#ifdef DEV_NETMAP
- o += snprintf(s + o, n - o, "; %d txq, %d rxq (netmap)", pi->nnmtxq,
- pi->nnmrxq);
- MPASS(n > o);
+ if (ifp->if_capabilities & IFCAP_TOE)
+ sbuf_printf(sb, "; %d txq, %d rxq (TOE)",
+ vi->nofldtxq, vi->nofldrxq);
#endif
- device_printf(dev, "%s\n", s);
- free(s, M_CXGBE);
+ sbuf_finish(sb);
+ device_printf(dev, "%s\n", sbuf_data(sb));
+ sbuf_delete(sb);
+
+ vi_sysctls(vi);
+
+ return (0);
+}
+
+static int
+cxgbe_attach(device_t dev)
+{
+ struct port_info *pi = device_get_softc(dev);
+ struct vi_info *vi;
+ int i, rc;
+
+ callout_init_mtx(&pi->tick, &pi->pi_lock, 0);
+ rc = cxgbe_vi_attach(dev, &pi->vi[0]);
+ if (rc)
+ return (rc);
+
+ for_each_vi(pi, i, vi) {
+ if (i == 0)
+ continue;
#ifdef DEV_NETMAP
- /* nm_media handled here to keep implementation private to this file */
- ifmedia_init(&pi->nm_media, IFM_IMASK, cxgbe_media_change,
- cxgbe_media_status);
- build_medialist(pi, &pi->nm_media);
- create_netmap_ifnet(pi); /* logs errors it something fails */
+ if (vi->flags & VI_NETMAP) {
+ /*
+ * media handled here to keep
+ * implementation private to this file
+ */
+ ifmedia_init(&vi->media, IFM_IMASK, cxgbe_media_change,
+ cxgbe_media_status);
+ build_medialist(pi, &vi->media);
+ vi->dev = device_add_child(dev, is_t4(pi->adapter) ?
+ "ncxgbe" : "ncxl", device_get_unit(dev));
+ } else
#endif
+ vi->dev = device_add_child(dev, is_t4(pi->adapter) ?
+ "vcxgbe" : "vcxl", -1);
+ if (vi->dev == NULL) {
+ device_printf(dev, "failed to add VI %d\n", i);
+ continue;
+ }
+ device_set_softc(vi->dev, vi);
+ }
+
cxgbe_sysctls(pi);
+ bus_generic_attach(dev);
+
return (0);
}
+static void
+cxgbe_vi_detach(struct vi_info *vi)
+{
+ struct ifnet *ifp = vi->ifp;
+
+ ether_ifdetach(ifp);
+
+ if (vi->vlan_c)
+ EVENTHANDLER_DEREGISTER(vlan_config, vi->vlan_c);
+
+ /* Let detach proceed even if these fail. */
+ cxgbe_uninit_synchronized(vi);
+ callout_drain(&vi->tick);
+ vi_full_uninit(vi);
+
+ ifmedia_removeall(&vi->media);
+ if_free(vi->ifp);
+ vi->ifp = NULL;
+}
+
static int
cxgbe_detach(device_t dev)
{
struct port_info *pi = device_get_softc(dev);
struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->ifp;
+ int rc;
- /* Tell if_ioctl and if_init that the port is going away */
- ADAPTER_LOCK(sc);
- SET_DOOMED(pi);
- wakeup(&sc->flags);
- while (IS_BUSY(sc))
- mtx_sleep(&sc->flags, &sc->sc_lock, 0, "t4detach", 0);
- SET_BUSY(sc);
-#ifdef INVARIANTS
- sc->last_op = "t4detach";
- sc->last_op_thr = curthread;
- sc->last_op_flags = 0;
-#endif
- ADAPTER_UNLOCK(sc);
+ /* Detach the extra VIs first. */
+ rc = bus_generic_detach(dev);
+ if (rc)
+ return (rc);
+ device_delete_children(dev);
+
+ doom_vi(sc, &pi->vi[0]);
if (pi->flags & HAS_TRACEQ) {
sc->traceq = -1; /* cloner should not create ifnet */
t4_tracer_port_detach(sc);
}
- if (pi->vlan_c)
- EVENTHANDLER_DEREGISTER(vlan_config, pi->vlan_c);
-
- PORT_LOCK(pi);
- ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
- callout_stop(&pi->tick);
- PORT_UNLOCK(pi);
+ cxgbe_vi_detach(&pi->vi[0]);
callout_drain(&pi->tick);
- /* Let detach proceed even if these fail. */
- cxgbe_uninit_synchronized(pi);
- port_full_uninit(pi);
-
- ifmedia_removeall(&pi->media);
- ether_ifdetach(pi->ifp);
- if_free(pi->ifp);
-
-#ifdef DEV_NETMAP
- /* XXXNM: equivalent of cxgbe_uninit_synchronized to ifdown nm_ifp */
- destroy_netmap_ifnet(pi);
-#endif
-
- ADAPTER_LOCK(sc);
- CLR_BUSY(sc);
- wakeup(&sc->flags);
- ADAPTER_UNLOCK(sc);
+ end_synchronized_op(sc, 0);
return (0);
}
@@ -1224,12 +1343,12 @@ cxgbe_detach(device_t dev)
static void
cxgbe_init(void *arg)
{
- struct port_info *pi = arg;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = arg;
+ struct adapter *sc = vi->pi->adapter;
- if (begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4init") != 0)
+ if (begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4init") != 0)
return;
- cxgbe_init_synchronized(pi);
+ cxgbe_init_synchronized(vi);
end_synchronized_op(sc, 0);
}
@@ -1237,8 +1356,8 @@ static int
cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
{
int rc = 0, mtu, flags, can_sleep;
- struct port_info *pi = ifp->if_softc;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = ifp->if_softc;
+ struct adapter *sc = vi->pi->adapter;
struct ifreq *ifr = (struct ifreq *)data;
uint32_t mask;
@@ -1248,11 +1367,11 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO))
return (EINVAL);
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4mtu");
+ rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4mtu");
if (rc)
return (rc);
ifp->if_mtu = mtu;
- if (pi->flags & PORT_INIT_DONE) {
+ if (vi->flags & VI_INIT_DONE) {
t4_update_fl_bufsize(ifp);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
rc = update_mac_settings(ifp, XGMAC_MTU);
@@ -1263,14 +1382,14 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
case SIOCSIFFLAGS:
can_sleep = 0;
redo_sifflags:
- rc = begin_synchronized_op(sc, pi,
+ rc = begin_synchronized_op(sc, vi,
can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg");
if (rc)
return (rc);
if (ifp->if_flags & IFF_UP) {
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
- flags = pi->if_flags;
+ flags = vi->if_flags;
if ((ifp->if_flags ^ flags) &
(IFF_PROMISC | IFF_ALLMULTI)) {
if (can_sleep == 1) {
@@ -1287,23 +1406,23 @@ redo_sifflags:
can_sleep = 1;
goto redo_sifflags;
}
- rc = cxgbe_init_synchronized(pi);
+ rc = cxgbe_init_synchronized(vi);
}
- pi->if_flags = ifp->if_flags;
+ vi->if_flags = ifp->if_flags;
} else if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
if (can_sleep == 0) {
end_synchronized_op(sc, LOCK_HELD);
can_sleep = 1;
goto redo_sifflags;
}
- rc = cxgbe_uninit_synchronized(pi);
+ rc = cxgbe_uninit_synchronized(vi);
}
end_synchronized_op(sc, can_sleep ? 0 : LOCK_HELD);
break;
case SIOCADDMULTI:
case SIOCDELMULTI: /* these two are called with a mutex held :-( */
- rc = begin_synchronized_op(sc, pi, HOLD_LOCK, "t4multi");
+ rc = begin_synchronized_op(sc, vi, HOLD_LOCK, "t4multi");
if (rc)
return (rc);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
@@ -1312,7 +1431,7 @@ redo_sifflags:
break;
case SIOCSIFCAP:
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4cap");
+ rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4cap");
if (rc)
return (rc);
@@ -1374,7 +1493,7 @@ redo_sifflags:
struct sge_rxq *rxq;
ifp->if_capenable ^= IFCAP_LRO;
- for_each_rxq(pi, i, rxq) {
+ for_each_rxq(vi, i, rxq) {
if (ifp->if_capenable & IFCAP_LRO)
rxq->iq.flags |= IQ_LRO_ENABLED;
else
@@ -1386,7 +1505,7 @@ redo_sifflags:
if (mask & IFCAP_TOE) {
int enable = (ifp->if_capenable ^ mask) & IFCAP_TOE;
- rc = toe_capability(pi, enable);
+ rc = toe_capability(vi, enable);
if (rc != 0)
goto fail;
@@ -1417,7 +1536,7 @@ fail:
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
- ifmedia_ioctl(ifp, ifr, &pi->media, cmd);
+ ifmedia_ioctl(ifp, ifr, &vi->media, cmd);
break;
case SIOCGI2C: {
@@ -1434,10 +1553,10 @@ fail:
rc = EINVAL;
break;
}
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4i2c");
+ rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4i2c");
if (rc)
return (rc);
- rc = -t4_i2c_rd(sc, sc->mbox, pi->port_id, i2c.dev_addr,
+ rc = -t4_i2c_rd(sc, sc->mbox, vi->pi->port_id, i2c.dev_addr,
i2c.offset, i2c.len, &i2c.data[0]);
end_synchronized_op(sc, 0);
if (rc == 0)
@@ -1455,7 +1574,8 @@ fail:
static int
cxgbe_transmit(struct ifnet *ifp, struct mbuf *m)
{
- struct port_info *pi = ifp->if_softc;
+ struct vi_info *vi = ifp->if_softc;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
struct sge_txq *txq;
void *items[1];
@@ -1477,10 +1597,10 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m)
}
/* Select a txq. */
- txq = &sc->sge.txq[pi->first_txq];
+ txq = &sc->sge.txq[vi->first_txq];
if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE)
- txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi->rsrv_noflowq)) +
- pi->rsrv_noflowq);
+ txq += ((m->m_pkthdr.flowid % (vi->ntxq - vi->rsrv_noflowq)) +
+ vi->rsrv_noflowq);
items[0] = m;
rc = mp_ring_enqueue(txq->r, items, 1, 4096);
@@ -1493,13 +1613,13 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m)
static void
cxgbe_qflush(struct ifnet *ifp)
{
- struct port_info *pi = ifp->if_softc;
+ struct vi_info *vi = ifp->if_softc;
struct sge_txq *txq;
int i;
- /* queues do not exist if !PORT_INIT_DONE. */
- if (pi->flags & PORT_INIT_DONE) {
- for_each_txq(pi, i, txq) {
+ /* queues do not exist if !VI_INIT_DONE. */
+ if (vi->flags & VI_INIT_DONE) {
+ for_each_txq(vi, i, txq) {
TXQ_LOCK(txq);
txq->eq.flags &= ~EQ_ENABLED;
TXQ_UNLOCK(txq);
@@ -1513,12 +1633,66 @@ cxgbe_qflush(struct ifnet *ifp)
}
static uint64_t
+vi_get_counter(struct ifnet *ifp, ift_counter c)
+{
+ struct vi_info *vi = ifp->if_softc;
+ struct fw_vi_stats_vf *s = &vi->stats;
+
+ vi_refresh_stats(vi->pi->adapter, vi);
+
+ switch (c) {
+ case IFCOUNTER_IPACKETS:
+ return (s->rx_bcast_frames + s->rx_mcast_frames +
+ s->rx_ucast_frames);
+ case IFCOUNTER_IERRORS:
+ return (s->rx_err_frames);
+ case IFCOUNTER_OPACKETS:
+ return (s->tx_bcast_frames + s->tx_mcast_frames +
+ s->tx_ucast_frames + s->tx_offload_frames);
+ case IFCOUNTER_OERRORS:
+ return (s->tx_drop_frames);
+ case IFCOUNTER_IBYTES:
+ return (s->rx_bcast_bytes + s->rx_mcast_bytes +
+ s->rx_ucast_bytes);
+ case IFCOUNTER_OBYTES:
+ return (s->tx_bcast_bytes + s->tx_mcast_bytes +
+ s->tx_ucast_bytes + s->tx_offload_bytes);
+ case IFCOUNTER_IMCASTS:
+ return (s->rx_mcast_frames);
+ case IFCOUNTER_OMCASTS:
+ return (s->tx_mcast_frames);
+ case IFCOUNTER_OQDROPS: {
+ uint64_t drops;
+
+ drops = 0;
+ if ((vi->flags & (VI_INIT_DONE | VI_NETMAP)) == VI_INIT_DONE) {
+ int i;
+ struct sge_txq *txq;
+
+ for_each_txq(vi, i, txq)
+ drops += counter_u64_fetch(txq->r->drops);
+ }
+
+ return (drops);
+
+ }
+
+ default:
+ return (if_get_counter_default(ifp, c));
+ }
+}
+
+uint64_t
cxgbe_get_counter(struct ifnet *ifp, ift_counter c)
{
- struct port_info *pi = ifp->if_softc;
+ struct vi_info *vi = ifp->if_softc;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
struct port_stats *s = &pi->stats;
+ if (pi->nvi > 1)
+ return (vi_get_counter(ifp, c));
+
cxgbe_refresh_stats(sc, pi);
switch (c) {
@@ -1556,11 +1730,11 @@ cxgbe_get_counter(struct ifnet *ifp, ift_counter c)
uint64_t drops;
drops = s->tx_drop;
- if (pi->flags & PORT_INIT_DONE) {
+ if (vi->flags & VI_INIT_DONE) {
int i;
struct sge_txq *txq;
- for_each_txq(pi, i, txq)
+ for_each_txq(vi, i, txq)
drops += counter_u64_fetch(txq->r->drops);
}
@@ -1576,9 +1750,9 @@ cxgbe_get_counter(struct ifnet *ifp, ift_counter c)
static int
cxgbe_media_change(struct ifnet *ifp)
{
- struct port_info *pi = ifp->if_softc;
+ struct vi_info *vi = ifp->if_softc;
- device_printf(pi->dev, "%s unimplemented.\n", __func__);
+ device_printf(vi->dev, "%s unimplemented.\n", __func__);
return (EOPNOTSUPP);
}
@@ -1586,20 +1760,12 @@ cxgbe_media_change(struct ifnet *ifp)
static void
cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
{
- struct port_info *pi = ifp->if_softc;
- struct ifmedia *media = NULL;
+ struct vi_info *vi = ifp->if_softc;
+ struct port_info *pi = vi->pi;
struct ifmedia_entry *cur;
int speed = pi->link_cfg.speed;
- if (ifp == pi->ifp)
- media = &pi->media;
-#ifdef DEV_NETMAP
- else if (ifp == pi->nm_ifp)
- media = &pi->nm_media;
-#endif
- MPASS(media != NULL);
-
- cur = media->ifm_cur;
+ cur = vi->media.ifm_cur;
ifmr->ifm_status = IFM_AVALID;
if (!pi->link_cfg.link_ok)
@@ -1625,6 +1791,84 @@ cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
speed));
}
+static int
+vcxgbe_probe(device_t dev)
+{
+ char buf[128];
+ struct vi_info *vi = device_get_softc(dev);
+
+ snprintf(buf, sizeof(buf), "port %d vi %td", vi->pi->port_id,
+ vi - vi->pi->vi);
+ device_set_desc_copy(dev, buf);
+
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+vcxgbe_attach(device_t dev)
+{
+ struct vi_info *vi;
+ struct port_info *pi;
+ struct adapter *sc;
+ int func, index, rc;
+ u32 param, val;
+
+ vi = device_get_softc(dev);
+ pi = vi->pi;
+ sc = pi->adapter;
+
+ index = vi - pi->vi;
+ KASSERT(index < nitems(vi_mac_funcs),
+ ("%s: VI %s doesn't have a MAC func", __func__,
+ device_get_nameunit(dev)));
+ func = vi_mac_funcs[index];
+ rc = t4_alloc_vi_func(sc, sc->mbox, pi->tx_chan, sc->pf, 0, 1,
+ vi->hw_addr, &vi->rss_size, func, 0);
+ if (rc < 0) {
+ device_printf(dev, "Failed to allocate virtual interface "
+ "for port %d: %d\n", pi->port_id, -rc);
+ return (-rc);
+ }
+ vi->viid = rc;
+
+ param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
+ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) |
+ V_FW_PARAMS_PARAM_YZ(vi->viid);
+ rc = t4_query_params(sc, sc->mbox, sc->pf, 0, 1, &param, &val);
+ if (rc)
+ vi->rss_base = 0xffff;
+ else {
+ /* MPASS((val >> 16) == rss_size); */
+ vi->rss_base = val & 0xffff;
+ }
+
+ rc = cxgbe_vi_attach(dev, vi);
+ if (rc) {
+ t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid);
+ return (rc);
+ }
+ return (0);
+}
+
+static int
+vcxgbe_detach(device_t dev)
+{
+ struct vi_info *vi;
+ struct adapter *sc;
+
+ vi = device_get_softc(dev);
+ sc = vi->pi->adapter;
+
+ doom_vi(sc, vi);
+
+ cxgbe_vi_detach(vi);
+ t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid);
+
+ end_synchronized_op(sc, 0);
+
+ return (0);
+}
+
void
t4_fatal_err(struct adapter *sc)
{
@@ -1946,7 +2190,7 @@ position_memwin(struct adapter *sc, int n, uint32_t addr)
}
static int
-cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g,
+cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis,
struct intrs_and_queues *iaq)
{
int rc, itype, navail, nrxq10g, nrxq1g, n;
@@ -2001,7 +2245,9 @@ restart:
*/
iaq->nirq = T4_EXTRA_INTR;
iaq->nirq += n10g * (nrxq10g + nofldrxq10g + nnmrxq10g);
+ iaq->nirq += n10g * 2 * (num_vis - 1);
iaq->nirq += n1g * (nrxq1g + nofldrxq1g + nnmrxq1g);
+ iaq->nirq += n1g * 2 * (num_vis - 1);
if (iaq->nirq <= navail &&
(itype != INTR_MSI || powerof2(iaq->nirq))) {
iaq->intr_flags_10g = INTR_ALL;
@@ -2022,6 +2268,7 @@ restart:
if (nrxq10g >= nofldrxq10g) {
iaq->intr_flags_10g = INTR_RXQ;
iaq->nirq += n10g * nrxq10g;
+ iaq->nirq += n10g * (num_vis - 1);
#ifdef DEV_NETMAP
iaq->nnmrxq10g = min(nnmrxq10g, nrxq10g);
#endif
@@ -2035,6 +2282,7 @@ restart:
if (nrxq1g >= nofldrxq1g) {
iaq->intr_flags_1g = INTR_RXQ;
iaq->nirq += n1g * nrxq1g;
+ iaq->nirq += n1g * (num_vis - 1);
#ifdef DEV_NETMAP
iaq->nnmrxq1g = min(nnmrxq1g, nrxq1g);
#endif
@@ -2051,12 +2299,12 @@ restart:
/*
* Next best option: an interrupt vector for errors, one for the
- * firmware event queue, and at least one per port. At this
+ * firmware event queue, and at least one per VI. At this
* point we know we'll have to downsize nrxq and/or nofldrxq
* and/or nnmrxq to fit what's available to us.
*/
iaq->nirq = T4_EXTRA_INTR;
- iaq->nirq += n10g + n1g;
+ iaq->nirq += (n10g + n1g) * num_vis;
if (iaq->nirq <= navail) {
int leftover = navail - iaq->nirq;
@@ -3027,25 +3275,14 @@ int
update_mac_settings(struct ifnet *ifp, int flags)
{
int rc = 0;
- struct port_info *pi = ifp->if_softc;
+ struct vi_info *vi = ifp->if_softc;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
int mtu = -1, promisc = -1, allmulti = -1, vlanex = -1;
- uint16_t viid = 0xffff;
- int16_t *xact_addr_filt = NULL;
ASSERT_SYNCHRONIZED_OP(sc);
KASSERT(flags, ("%s: not told what to update.", __func__));
- if (ifp == pi->ifp) {
- viid = pi->viid;
- xact_addr_filt = &pi->xact_addr_filt;
- }
-#ifdef DEV_NETMAP
- else if (ifp == pi->nm_ifp) {
- viid = pi->nm_viid;
- xact_addr_filt = &pi->nm_xact_addr_filt;
- }
-#endif
if (flags & XGMAC_MTU)
mtu = ifp->if_mtu;
@@ -3059,8 +3296,8 @@ update_mac_settings(struct ifnet *ifp, int flags)
vlanex = ifp->if_capenable & IFCAP_VLAN_HWTAGGING ? 1 : 0;
if (flags & (XGMAC_MTU|XGMAC_PROMISC|XGMAC_ALLMULTI|XGMAC_VLANEX)) {
- rc = -t4_set_rxmode(sc, sc->mbox, viid, mtu, promisc, allmulti,
- 1, vlanex, false);
+ rc = -t4_set_rxmode(sc, sc->mbox, vi->viid, mtu, promisc,
+ allmulti, 1, vlanex, false);
if (rc) {
if_printf(ifp, "set_rxmode (%x) failed: %d\n", flags,
rc);
@@ -3072,14 +3309,14 @@ update_mac_settings(struct ifnet *ifp, int flags)
uint8_t ucaddr[ETHER_ADDR_LEN];
bcopy(IF_LLADDR(ifp), ucaddr, sizeof(ucaddr));
- rc = t4_change_mac(sc, sc->mbox, viid, *xact_addr_filt, ucaddr,
- true, true);
+ rc = t4_change_mac(sc, sc->mbox, vi->viid, vi->xact_addr_filt,
+ ucaddr, true, true);
if (rc < 0) {
rc = -rc;
if_printf(ifp, "change_mac failed: %d\n", rc);
return (rc);
} else {
- *xact_addr_filt = rc;
+ vi->xact_addr_filt = rc;
rc = 0;
}
}
@@ -3101,8 +3338,8 @@ update_mac_settings(struct ifnet *ifp, int flags)
i++;
if (i == FW_MAC_EXACT_CHUNK) {
- rc = t4_alloc_mac_filt(sc, sc->mbox, viid, del,
- i, mcaddr, NULL, &hash, 0);
+ rc = t4_alloc_mac_filt(sc, sc->mbox, vi->viid,
+ del, i, mcaddr, NULL, &hash, 0);
if (rc < 0) {
rc = -rc;
for (j = 0; j < i; j++) {
@@ -3122,7 +3359,7 @@ update_mac_settings(struct ifnet *ifp, int flags)
}
}
if (i > 0) {
- rc = t4_alloc_mac_filt(sc, sc->mbox, viid, del, i,
+ rc = t4_alloc_mac_filt(sc, sc->mbox, vi->viid, del, i,
mcaddr, NULL, &hash, 0);
if (rc < 0) {
rc = -rc;
@@ -3140,7 +3377,7 @@ update_mac_settings(struct ifnet *ifp, int flags)
}
}
- rc = -t4_set_addr_hash(sc, sc->mbox, viid, 0, hash, 0);
+ rc = -t4_set_addr_hash(sc, sc->mbox, vi->viid, 0, hash, 0);
if (rc != 0)
if_printf(ifp, "failed to set mc address hash: %d", rc);
mcfail:
@@ -3154,7 +3391,7 @@ mcfail:
* {begin|end}_synchronized_op must be called from the same thread.
*/
int
-begin_synchronized_op(struct adapter *sc, struct port_info *pi, int flags,
+begin_synchronized_op(struct adapter *sc, struct vi_info *vi, int flags,
char *wmesg)
{
int rc, pri;
@@ -3162,7 +3399,8 @@ begin_synchronized_op(struct adapter *sc, struct port_info *pi, int flags,
#ifdef WITNESS
/* the caller thinks it's ok to sleep, but is it really? */
if (flags & SLEEP_OK)
- pause("t4slptst", 1);
+ WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
+ "begin_synchronized_op");
#endif
if (INTR_OK)
@@ -3173,7 +3411,7 @@ begin_synchronized_op(struct adapter *sc, struct port_info *pi, int flags,
ADAPTER_LOCK(sc);
for (;;) {
- if (pi && IS_DOOMED(pi)) {
+ if (vi && IS_DOOMED(vi)) {
rc = ENXIO;
goto done;
}
@@ -3210,6 +3448,29 @@ done:
}
/*
+ * Tell if_ioctl and if_init that the VI is going away. This is
+ * special variant of begin_synchronized_op and must be paired with a
+ * call to end_synchronized_op.
+ */
+void
+doom_vi(struct adapter *sc, struct vi_info *vi)
+{
+
+ ADAPTER_LOCK(sc);
+ SET_DOOMED(vi);
+ wakeup(&sc->flags);
+ while (IS_BUSY(sc))
+ mtx_sleep(&sc->flags, &sc->sc_lock, 0, "t4detach", 0);
+ SET_BUSY(sc);
+#ifdef INVARIANTS
+ sc->last_op = "t4detach";
+ sc->last_op_thr = curthread;
+ sc->last_op_flags = 0;
+#endif
+ ADAPTER_UNLOCK(sc);
+}
+
+/*
* {begin|end}_synchronized_op must be called from the same thread.
*/
void
@@ -3228,34 +3489,32 @@ end_synchronized_op(struct adapter *sc, int flags)
}
static int
-cxgbe_init_synchronized(struct port_info *pi)
+cxgbe_init_synchronized(struct vi_info *vi)
{
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->ifp;
+ struct ifnet *ifp = vi->ifp;
int rc = 0, i;
struct sge_txq *txq;
ASSERT_SYNCHRONIZED_OP(sc);
- if (isset(&sc->open_device_map, pi->port_id)) {
- KASSERT(ifp->if_drv_flags & IFF_DRV_RUNNING,
- ("mismatch between open_device_map and if_drv_flags"));
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING)
return (0); /* already running */
- }
if (!(sc->flags & FULL_INIT_DONE) &&
((rc = adapter_full_init(sc)) != 0))
return (rc); /* error message displayed already */
- if (!(pi->flags & PORT_INIT_DONE) &&
- ((rc = port_full_init(pi)) != 0))
+ if (!(vi->flags & VI_INIT_DONE) &&
+ ((rc = vi_full_init(vi)) != 0))
return (rc); /* error message displayed already */
rc = update_mac_settings(ifp, XGMAC_ALL);
if (rc)
goto done; /* error message displayed already */
- rc = -t4_enable_vi(sc, sc->mbox, pi->viid, true, true);
+ rc = -t4_enable_vi(sc, sc->mbox, vi->viid, true, true);
if (rc != 0) {
if_printf(ifp, "enable_vi failed: %d\n", rc);
goto done;
@@ -3266,7 +3525,7 @@ cxgbe_init_synchronized(struct port_info *pi)
* if this changes.
*/
- for_each_txq(pi, i, txq) {
+ for_each_txq(vi, i, txq) {
TXQ_LOCK(txq);
txq->eq.flags |= EQ_ENABLED;
TXQ_UNLOCK(txq);
@@ -3275,8 +3534,8 @@ cxgbe_init_synchronized(struct port_info *pi)
/*
* The first iq of the first port to come up is used for tracing.
*/
- if (sc->traceq < 0) {
- sc->traceq = sc->sge.rxq[pi->first_rxq].iq.abs_id;
+ if (sc->traceq < 0 && IS_MAIN_VI(vi)) {
+ sc->traceq = sc->sge.rxq[vi->first_rxq].iq.abs_id;
t4_write_reg(sc, is_t4(sc) ? A_MPS_TRC_RSS_CONTROL :
A_MPS_T5_TRC_RSS_CONTROL, V_RSSCONTROL(pi->tx_chan) |
V_QUEUENUMBER(sc->traceq));
@@ -3284,15 +3543,18 @@ cxgbe_init_synchronized(struct port_info *pi)
}
/* all ok */
- setbit(&sc->open_device_map, pi->port_id);
PORT_LOCK(pi);
ifp->if_drv_flags |= IFF_DRV_RUNNING;
- PORT_UNLOCK(pi);
+ pi->up_vis++;
- callout_reset(&pi->tick, hz, cxgbe_tick, pi);
+ if (pi->nvi > 1)
+ callout_reset(&vi->tick, hz, vi_tick, vi);
+ else
+ callout_reset(&pi->tick, hz, cxgbe_tick, pi);
+ PORT_UNLOCK(pi);
done:
if (rc != 0)
- cxgbe_uninit_synchronized(pi);
+ cxgbe_uninit_synchronized(vi);
return (rc);
}
@@ -3301,18 +3563,19 @@ done:
* Idempotent.
*/
static int
-cxgbe_uninit_synchronized(struct port_info *pi)
+cxgbe_uninit_synchronized(struct vi_info *vi)
{
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->ifp;
+ struct ifnet *ifp = vi->ifp;
int rc, i;
struct sge_txq *txq;
ASSERT_SYNCHRONIZED_OP(sc);
- if (!(pi->flags & PORT_INIT_DONE)) {
+ if (!(vi->flags & VI_INIT_DONE)) {
KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING),
- ("uninited port is running"));
+ ("uninited VI is running"));
return (0);
}
@@ -3323,21 +3586,33 @@ cxgbe_uninit_synchronized(struct port_info *pi)
* holding in its RAM (for an offloaded connection) even after the VI is
* disabled.
*/
- rc = -t4_enable_vi(sc, sc->mbox, pi->viid, false, false);
+ rc = -t4_enable_vi(sc, sc->mbox, vi->viid, false, false);
if (rc) {
if_printf(ifp, "disable_vi failed: %d\n", rc);
return (rc);
}
- for_each_txq(pi, i, txq) {
+ for_each_txq(vi, i, txq) {
TXQ_LOCK(txq);
txq->eq.flags &= ~EQ_ENABLED;
TXQ_UNLOCK(txq);
}
- clrbit(&sc->open_device_map, pi->port_id);
PORT_LOCK(pi);
+ if (pi->nvi == 1)
+ callout_stop(&pi->tick);
+ else
+ callout_stop(&vi->tick);
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+ PORT_UNLOCK(pi);
+ return (0);
+ }
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ pi->up_vis--;
+ if (pi->up_vis > 0) {
+ PORT_UNLOCK(pi);
+ return (0);
+ }
PORT_UNLOCK(pi);
pi->link_cfg.link_ok = 0;
@@ -3355,10 +3630,11 @@ cxgbe_uninit_synchronized(struct port_info *pi)
static int
setup_intr_handlers(struct adapter *sc)
{
- int rc, rid, p, q;
+ int rc, rid, p, q, v;
char s[8];
struct irq *irq;
struct port_info *pi;
+ struct vi_info *vi;
struct sge_rxq *rxq;
#ifdef TCP_OFFLOAD
struct sge_ofld_rxq *ofld_rxq;
@@ -3395,44 +3671,55 @@ setup_intr_handlers(struct adapter *sc)
for_each_port(sc, p) {
pi = sc->port[p];
-
- if (pi->flags & INTR_RXQ) {
- for_each_rxq(pi, q, rxq) {
- snprintf(s, sizeof(s), "%d.%d", p, q);
- rc = t4_alloc_irq(sc, irq, rid, t4_intr, rxq,
- s);
- if (rc != 0)
- return (rc);
- irq++;
- rid++;
+ for_each_vi(pi, v, vi) {
+ vi->first_intr = rid - 1;
+#ifdef DEV_NETMAP
+ if (vi->flags & VI_NETMAP) {
+ for_each_nm_rxq(vi, q, nm_rxq) {
+ snprintf(s, sizeof(s), "%d-%d", p, q);
+ rc = t4_alloc_irq(sc, irq, rid,
+ t4_nm_intr, nm_rxq, s);
+ if (rc != 0)
+ return (rc);
+ irq++;
+ rid++;
+ vi->nintr++;
+ }
+ continue;
+ }
+#endif
+ if (vi->flags & INTR_RXQ) {
+ for_each_rxq(vi, q, rxq) {
+ if (v == 0)
+ snprintf(s, sizeof(s), "%d.%d",
+ p, q);
+ else
+ snprintf(s, sizeof(s),
+ "%d(%d).%d", p, v, q);
+ rc = t4_alloc_irq(sc, irq, rid,
+ t4_intr, rxq, s);
+ if (rc != 0)
+ return (rc);
+ irq++;
+ rid++;
+ vi->nintr++;
+ }
}
- }
#ifdef TCP_OFFLOAD
- if (pi->flags & INTR_OFLD_RXQ) {
- for_each_ofld_rxq(pi, q, ofld_rxq) {
- snprintf(s, sizeof(s), "%d,%d", p, q);
- rc = t4_alloc_irq(sc, irq, rid, t4_intr,
- ofld_rxq, s);
- if (rc != 0)
- return (rc);
- irq++;
- rid++;
+ if (vi->flags & INTR_OFLD_RXQ) {
+ for_each_ofld_rxq(vi, q, ofld_rxq) {
+ snprintf(s, sizeof(s), "%d,%d", p, q);
+ rc = t4_alloc_irq(sc, irq, rid,
+ t4_intr, ofld_rxq, s);
+ if (rc != 0)
+ return (rc);
+ irq++;
+ rid++;
+ vi->nintr++;
+ }
}
- }
#endif
-#ifdef DEV_NETMAP
- if (pi->flags & INTR_NM_RXQ) {
- for_each_nm_rxq(pi, q, nm_rxq) {
- snprintf(s, sizeof(s), "%d-%d", p, q);
- rc = t4_alloc_irq(sc, irq, rid, t4_nm_intr,
- nm_rxq, s);
- if (rc != 0)
- return (rc);
- irq++;
- rid++;
- }
}
-#endif
}
MPASS(irq == &sc->irq[sc->intr_count]);
@@ -3563,10 +3850,10 @@ hashen_to_hashconfig(int hashen)
#endif
int
-port_full_init(struct port_info *pi)
+vi_full_init(struct vi_info *vi)
{
- struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->ifp;
+ struct adapter *sc = vi->pi->adapter;
+ struct ifnet *ifp = vi->ifp;
uint16_t *rss;
struct sge_rxq *rxq;
int rc, i, j, hashen;
@@ -3579,36 +3866,44 @@ port_full_init(struct port_info *pi)
#endif
ASSERT_SYNCHRONIZED_OP(sc);
- KASSERT((pi->flags & PORT_INIT_DONE) == 0,
- ("%s: PORT_INIT_DONE already", __func__));
+ KASSERT((vi->flags & VI_INIT_DONE) == 0,
+ ("%s: VI_INIT_DONE already", __func__));
- sysctl_ctx_init(&pi->ctx);
- pi->flags |= PORT_SYSCTL_CTX;
+ sysctl_ctx_init(&vi->ctx);
+ vi->flags |= VI_SYSCTL_CTX;
/*
- * Allocate tx/rx/fl queues for this port.
+ * Allocate tx/rx/fl queues for this VI.
*/
- rc = t4_setup_port_queues(pi);
+ rc = t4_setup_vi_queues(vi);
if (rc != 0)
goto done; /* error message displayed already */
+#ifdef DEV_NETMAP
+ /* Netmap VIs configure RSS when netmap is enabled. */
+ if (vi->flags & VI_NETMAP) {
+ vi->flags |= VI_INIT_DONE;
+ return (0);
+ }
+#endif
+
/*
- * Setup RSS for this port. Save a copy of the RSS table for later use.
+ * Setup RSS for this VI. Save a copy of the RSS table for later use.
*/
- if (pi->nrxq > pi->rss_size) {
+ if (vi->nrxq > vi->rss_size) {
if_printf(ifp, "nrxq (%d) > hw RSS table size (%d); "
- "some queues will never receive traffic.\n", pi->nrxq,
- pi->rss_size);
- } else if (pi->rss_size % pi->nrxq) {
+ "some queues will never receive traffic.\n", vi->nrxq,
+ vi->rss_size);
+ } else if (vi->rss_size % vi->nrxq) {
if_printf(ifp, "nrxq (%d), hw RSS table size (%d); "
- "expect uneven traffic distribution.\n", pi->nrxq,
- pi->rss_size);
+ "expect uneven traffic distribution.\n", vi->nrxq,
+ vi->rss_size);
}
#ifdef RSS
MPASS(RSS_KEYSIZE == 40);
- if (pi->nrxq != nbuckets) {
+ if (vi->nrxq != nbuckets) {
if_printf(ifp, "nrxq (%d) != kernel RSS buckets (%d);"
- "performance will be impacted.\n", pi->nrxq, nbuckets);
+ "performance will be impacted.\n", vi->nrxq, nbuckets);
}
rss_getkey((void *)&raw_rss_key[0]);
@@ -3617,24 +3912,24 @@ port_full_init(struct port_info *pi)
}
t4_write_rss_key(sc, (void *)&rss_key[0], -1);
#endif
- rss = malloc(pi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO | M_WAITOK);
- for (i = 0; i < pi->rss_size;) {
+ rss = malloc(vi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO | M_WAITOK);
+ for (i = 0; i < vi->rss_size;) {
#ifdef RSS
j = rss_get_indirection_to_bucket(i);
- j %= pi->nrxq;
- rxq = &sc->sge.rxq[pi->first_rxq + j];
+ j %= vi->nrxq;
+ rxq = &sc->sge.rxq[vi->first_rxq + j];
rss[i++] = rxq->iq.abs_id;
#else
- for_each_rxq(pi, j, rxq) {
+ for_each_rxq(vi, j, rxq) {
rss[i++] = rxq->iq.abs_id;
- if (i == pi->rss_size)
+ if (i == vi->rss_size)
break;
}
#endif
}
- rc = -t4_config_rss_range(sc, sc->mbox, pi->viid, 0, pi->rss_size, rss,
- pi->rss_size);
+ rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss,
+ vi->rss_size);
if (rc != 0) {
if_printf(ifp, "rss_config failed: %d\n", rc);
goto done;
@@ -3682,17 +3977,17 @@ port_full_init(struct port_info *pi)
F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN |
F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_UDPEN;
#endif
- rc = -t4_config_vi_rss(sc, sc->mbox, pi->viid, hashen, rss[0]);
+ rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, hashen, rss[0]);
if (rc != 0) {
if_printf(ifp, "rss hash/defaultq config failed: %d\n", rc);
goto done;
}
- pi->rss = rss;
- pi->flags |= PORT_INIT_DONE;
+ vi->rss = rss;
+ vi->flags |= VI_INIT_DONE;
done:
if (rc != 0)
- port_full_uninit(pi);
+ vi_full_uninit(vi);
return (rc);
}
@@ -3701,8 +3996,9 @@ done:
* Idempotent.
*/
int
-port_full_uninit(struct port_info *pi)
+vi_full_uninit(struct vi_info *vi)
{
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
int i;
struct sge_rxq *rxq;
@@ -3712,38 +4008,47 @@ port_full_uninit(struct port_info *pi)
struct sge_wrq *ofld_txq;
#endif
- if (pi->flags & PORT_INIT_DONE) {
+ if (vi->flags & VI_INIT_DONE) {
/* Need to quiesce queues. */
+#ifdef DEV_NETMAP
+ if (vi->flags & VI_NETMAP)
+ goto skip;
+#endif
- quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]);
+ /* XXX: Only for the first VI? */
+ if (IS_MAIN_VI(vi))
+ quiesce_wrq(sc, &sc->sge.ctrlq[pi->port_id]);
- for_each_txq(pi, i, txq) {
+ for_each_txq(vi, i, txq) {
quiesce_txq(sc, txq);
}
#ifdef TCP_OFFLOAD
- for_each_ofld_txq(pi, i, ofld_txq) {
+ for_each_ofld_txq(vi, i, ofld_txq) {
quiesce_wrq(sc, ofld_txq);
}
#endif
- for_each_rxq(pi, i, rxq) {
+ for_each_rxq(vi, i, rxq) {
quiesce_iq(sc, &rxq->iq);
quiesce_fl(sc, &rxq->fl);
}
#ifdef TCP_OFFLOAD
- for_each_ofld_rxq(pi, i, ofld_rxq) {
+ for_each_ofld_rxq(vi, i, ofld_rxq) {
quiesce_iq(sc, &ofld_rxq->iq);
quiesce_fl(sc, &ofld_rxq->fl);
}
#endif
- free(pi->rss, M_CXGBE);
+ free(vi->rss, M_CXGBE);
}
+#ifdef DEV_NETMAP
+skip:
+#endif
- t4_teardown_port_queues(pi);
- pi->flags &= ~PORT_INIT_DONE;
+ t4_teardown_vi_queues(vi);
+ vi->flags &= ~VI_INIT_DONE;
return (0);
}
@@ -3801,9 +4106,9 @@ quiesce_fl(struct adapter *sc, struct sge_fl *fl)
FL_LOCK(fl);
fl->flags |= FL_DOOMED;
FL_UNLOCK(fl);
+ callout_stop(&sc->sfl_callout);
mtx_unlock(&sc->sfl_lock);
- callout_drain(&sc->sfl_callout);
KASSERT((fl->flags & FL_STARVING) == 0,
("%s: still starving", __func__));
}
@@ -4536,6 +4841,99 @@ t4_get_regs(struct adapter *sc, struct t4_regdump *regs, uint8_t *buf)
reg_block_dump(sc, buf, reg_ranges[i], reg_ranges[i + 1]);
}
+#define A_PL_INDIR_CMD 0x1f8
+
+#define S_PL_AUTOINC 31
+#define M_PL_AUTOINC 0x1U
+#define V_PL_AUTOINC(x) ((x) << S_PL_AUTOINC)
+#define G_PL_AUTOINC(x) (((x) >> S_PL_AUTOINC) & M_PL_AUTOINC)
+
+#define S_PL_VFID 20
+#define M_PL_VFID 0xffU
+#define V_PL_VFID(x) ((x) << S_PL_VFID)
+#define G_PL_VFID(x) (((x) >> S_PL_VFID) & M_PL_VFID)
+
+#define S_PL_ADDR 0
+#define M_PL_ADDR 0xfffffU
+#define V_PL_ADDR(x) ((x) << S_PL_ADDR)
+#define G_PL_ADDR(x) (((x) >> S_PL_ADDR) & M_PL_ADDR)
+
+#define A_PL_INDIR_DATA 0x1fc
+
+static uint64_t
+read_vf_stat(struct adapter *sc, unsigned int viid, int reg)
+{
+ u32 stats[2];
+
+ mtx_assert(&sc->regwin_lock, MA_OWNED);
+ t4_write_reg(sc, A_PL_INDIR_CMD, V_PL_AUTOINC(1) |
+ V_PL_VFID(G_FW_VIID_VIN(viid)) | V_PL_ADDR(VF_MPS_REG(reg)));
+ stats[0] = t4_read_reg(sc, A_PL_INDIR_DATA);
+ stats[1] = t4_read_reg(sc, A_PL_INDIR_DATA);
+ return (((uint64_t)stats[1]) << 32 | stats[0]);
+}
+
+static void
+t4_get_vi_stats(struct adapter *sc, unsigned int viid,
+ struct fw_vi_stats_vf *stats)
+{
+
+#define GET_STAT(name) \
+ read_vf_stat(sc, viid, A_MPS_VF_STAT_##name##_L)
+
+ stats->tx_bcast_bytes = GET_STAT(TX_VF_BCAST_BYTES);
+ stats->tx_bcast_frames = GET_STAT(TX_VF_BCAST_FRAMES);
+ stats->tx_mcast_bytes = GET_STAT(TX_VF_MCAST_BYTES);
+ stats->tx_mcast_frames = GET_STAT(TX_VF_MCAST_FRAMES);
+ stats->tx_ucast_bytes = GET_STAT(TX_VF_UCAST_BYTES);
+ stats->tx_ucast_frames = GET_STAT(TX_VF_UCAST_FRAMES);
+ stats->tx_drop_frames = GET_STAT(TX_VF_DROP_FRAMES);
+ stats->tx_offload_bytes = GET_STAT(TX_VF_OFFLOAD_BYTES);
+ stats->tx_offload_frames = GET_STAT(TX_VF_OFFLOAD_FRAMES);
+ stats->rx_bcast_bytes = GET_STAT(RX_VF_BCAST_BYTES);
+ stats->rx_bcast_frames = GET_STAT(RX_VF_BCAST_FRAMES);
+ stats->rx_mcast_bytes = GET_STAT(RX_VF_MCAST_BYTES);
+ stats->rx_mcast_frames = GET_STAT(RX_VF_MCAST_FRAMES);
+ stats->rx_ucast_bytes = GET_STAT(RX_VF_UCAST_BYTES);
+ stats->rx_ucast_frames = GET_STAT(RX_VF_UCAST_FRAMES);
+ stats->rx_err_frames = GET_STAT(RX_VF_ERR_FRAMES);
+
+#undef GET_STAT
+}
+
+static void
+t4_clr_vi_stats(struct adapter *sc, unsigned int viid)
+{
+ int reg;
+
+ t4_write_reg(sc, A_PL_INDIR_CMD, V_PL_AUTOINC(1) |
+ V_PL_VFID(G_FW_VIID_VIN(viid)) |
+ V_PL_ADDR(VF_MPS_REG(A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L)));
+ for (reg = A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L;
+ reg <= A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H; reg += 4)
+ t4_write_reg(sc, A_PL_INDIR_DATA, 0);
+}
+
+static void
+vi_refresh_stats(struct adapter *sc, struct vi_info *vi)
+{
+ struct timeval tv;
+ const struct timeval interval = {0, 250000}; /* 250ms */
+
+ if (!(vi->flags & VI_INIT_DONE))
+ return;
+
+ getmicrotime(&tv);
+ timevalsub(&tv, &interval);
+ if (timevalcmp(&tv, &vi->last_refreshed, <))
+ return;
+
+ mtx_lock(&sc->regwin_lock);
+ t4_get_vi_stats(sc, vi->viid, &vi->stats);
+ getmicrotime(&vi->last_refreshed);
+ mtx_unlock(&sc->regwin_lock);
+}
+
static void
cxgbe_refresh_stats(struct adapter *sc, struct port_info *pi)
{
@@ -4569,18 +4967,22 @@ cxgbe_tick(void *arg)
{
struct port_info *pi = arg;
struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->ifp;
-
- PORT_LOCK(pi);
- if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
- PORT_UNLOCK(pi);
- return; /* without scheduling another callout */
- }
+ PORT_LOCK_ASSERT_OWNED(pi);
cxgbe_refresh_stats(sc, pi);
callout_schedule(&pi->tick, hz);
- PORT_UNLOCK(pi);
+}
+
+void
+vi_tick(void *arg)
+{
+ struct vi_info *vi = arg;
+ struct adapter *sc = vi->pi->adapter;
+
+ vi_refresh_stats(sc, vi);
+
+ callout_schedule(&vi->tick, hz);
}
static void
@@ -4687,7 +5089,7 @@ t4_register_fw_msg_handler(struct adapter *sc, int type, fw_msg_handler_t h)
return (0);
}
-static int
+static void
t4_sysctls(struct adapter *sc)
{
struct sysctl_ctx_list *ctx;
@@ -4992,91 +5394,99 @@ t4_sysctls(struct adapter *sc)
CTLFLAG_RW, &sc->tt.tx_align, 0, "chop and align payload");
}
#endif
-
-
- return (0);
}
-static int
-cxgbe_sysctls(struct port_info *pi)
+void
+vi_sysctls(struct vi_info *vi)
{
struct sysctl_ctx_list *ctx;
struct sysctl_oid *oid;
struct sysctl_oid_list *children;
- struct adapter *sc = pi->adapter;
- ctx = device_get_sysctl_ctx(pi->dev);
+ ctx = device_get_sysctl_ctx(vi->dev);
/*
- * dev.cxgbe.X.
+ * dev.[nv](cxgbe|cxl).X.
*/
- oid = device_get_sysctl_tree(pi->dev);
+ oid = device_get_sysctl_tree(vi->dev);
children = SYSCTL_CHILDREN(oid);
- SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "linkdnrc", CTLTYPE_STRING |
- CTLFLAG_RD, pi, 0, sysctl_linkdnrc, "A", "reason why link is down");
- if (pi->port_type == FW_PORT_TYPE_BT_XAUI) {
- SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature",
- CTLTYPE_INT | CTLFLAG_RD, pi, 0, sysctl_btphy, "I",
- "PHY temperature (in Celsius)");
- SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fw_version",
- CTLTYPE_INT | CTLFLAG_RD, pi, 1, sysctl_btphy, "I",
- "PHY firmware version");
- }
+ SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "viid", CTLFLAG_RD, NULL,
+ vi->viid, "VI identifer");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nrxq", CTLFLAG_RD,
- &pi->nrxq, 0, "# of rx queues");
+ &vi->nrxq, 0, "# of rx queues");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "ntxq", CTLFLAG_RD,
- &pi->ntxq, 0, "# of tx queues");
+ &vi->ntxq, 0, "# of tx queues");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_rxq", CTLFLAG_RD,
- &pi->first_rxq, 0, "index of first rx queue");
+ &vi->first_rxq, 0, "index of first rx queue");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD,
- &pi->first_txq, 0, "index of first tx queue");
+ &vi->first_txq, 0, "index of first tx queue");
+
+ if (vi->flags & VI_NETMAP)
+ return;
+
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", CTLTYPE_INT |
- CTLFLAG_RW, pi, 0, sysctl_noflowq, "IU",
+ CTLFLAG_RW, vi, 0, sysctl_noflowq, "IU",
"Reserve queue 0 for non-flowid packets");
#ifdef TCP_OFFLOAD
- if (is_offload(sc)) {
+ if (vi->nofldrxq != 0) {
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldrxq", CTLFLAG_RD,
- &pi->nofldrxq, 0,
+ &vi->nofldrxq, 0,
"# of rx queues for offloaded TCP connections");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldtxq", CTLFLAG_RD,
- &pi->nofldtxq, 0,
+ &vi->nofldtxq, 0,
"# of tx queues for offloaded TCP connections");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_rxq",
- CTLFLAG_RD, &pi->first_ofld_rxq, 0,
+ CTLFLAG_RD, &vi->first_ofld_rxq, 0,
"index of first TOE rx queue");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq",
- CTLFLAG_RD, &pi->first_ofld_txq, 0,
+ CTLFLAG_RD, &vi->first_ofld_txq, 0,
"index of first TOE tx queue");
}
#endif
-#ifdef DEV_NETMAP
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nnmrxq", CTLFLAG_RD,
- &pi->nnmrxq, 0, "# of rx queues for netmap");
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nnmtxq", CTLFLAG_RD,
- &pi->nnmtxq, 0, "# of tx queues for netmap");
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_nm_rxq",
- CTLFLAG_RD, &pi->first_nm_rxq, 0,
- "index of first netmap rx queue");
- SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_nm_txq",
- CTLFLAG_RD, &pi->first_nm_txq, 0,
- "index of first netmap tx queue");
-#endif
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx",
- CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_holdoff_tmr_idx, "I",
+ CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_holdoff_tmr_idx, "I",
"holdoff timer index");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pktc_idx",
- CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_holdoff_pktc_idx, "I",
+ CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_holdoff_pktc_idx, "I",
"holdoff packet counter index");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "qsize_rxq",
- CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_qsize_rxq, "I",
+ CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_qsize_rxq, "I",
"rx queue size");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "qsize_txq",
- CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_qsize_txq, "I",
+ CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_qsize_txq, "I",
"tx queue size");
+}
+
+static void
+cxgbe_sysctls(struct port_info *pi)
+{
+ struct sysctl_ctx_list *ctx;
+ struct sysctl_oid *oid;
+ struct sysctl_oid_list *children;
+ struct adapter *sc = pi->adapter;
+
+ ctx = device_get_sysctl_ctx(pi->dev);
+
+ /*
+ * dev.cxgbe.X.
+ */
+ oid = device_get_sysctl_tree(pi->dev);
+ children = SYSCTL_CHILDREN(oid);
+
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "linkdnrc", CTLTYPE_STRING |
+ CTLFLAG_RD, pi, 0, sysctl_linkdnrc, "A", "reason why link is down");
+ if (pi->port_type == FW_PORT_TYPE_BT_XAUI) {
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature",
+ CTLTYPE_INT | CTLFLAG_RD, pi, 0, sysctl_btphy, "I",
+ "PHY temperature (in Celsius)");
+ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fw_version",
+ CTLTYPE_INT | CTLFLAG_RD, pi, 1, sysctl_btphy, "I",
+ "PHY firmware version");
+ }
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_settings",
CTLTYPE_STRING | CTLFLAG_RW, pi, PAUSE_TX, sysctl_pause_settings,
@@ -5240,8 +5650,6 @@ cxgbe_sysctls(struct port_info *pi)
"# of buffer-group 3 truncated packets");
#undef SYSCTL_ADD_T4_PORTSTAT
-
- return (0);
}
static int
@@ -5292,7 +5700,7 @@ sysctl_btphy(SYSCTL_HANDLER_ARGS)
u_int v;
int rc;
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4btt");
+ rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4btt");
if (rc)
return (rc);
/* XXX: magic numbers */
@@ -5311,18 +5719,18 @@ sysctl_btphy(SYSCTL_HANDLER_ARGS)
static int
sysctl_noflowq(SYSCTL_HANDLER_ARGS)
{
- struct port_info *pi = arg1;
+ struct vi_info *vi = arg1;
int rc, val;
- val = pi->rsrv_noflowq;
+ val = vi->rsrv_noflowq;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc != 0 || req->newptr == NULL)
return (rc);
- if ((val >= 1) && (pi->ntxq > 1))
- pi->rsrv_noflowq = 1;
+ if ((val >= 1) && (vi->ntxq > 1))
+ vi->rsrv_noflowq = 1;
else
- pi->rsrv_noflowq = 0;
+ vi->rsrv_noflowq = 0;
return (rc);
}
@@ -5330,8 +5738,8 @@ sysctl_noflowq(SYSCTL_HANDLER_ARGS)
static int
sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS)
{
- struct port_info *pi = arg1;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = arg1;
+ struct adapter *sc = vi->pi->adapter;
int idx, rc, i;
struct sge_rxq *rxq;
#ifdef TCP_OFFLOAD
@@ -5339,7 +5747,7 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS)
#endif
uint8_t v;
- idx = pi->tmr_idx;
+ idx = vi->tmr_idx;
rc = sysctl_handle_int(oidp, &idx, 0, req);
if (rc != 0 || req->newptr == NULL)
@@ -5348,13 +5756,13 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS)
if (idx < 0 || idx >= SGE_NTIMERS)
return (EINVAL);
- rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK,
+ rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
"t4tmr");
if (rc)
return (rc);
- v = V_QINTR_TIMER_IDX(idx) | V_QINTR_CNT_EN(pi->pktc_idx != -1);
- for_each_rxq(pi, i, rxq) {
+ v = V_QINTR_TIMER_IDX(idx) | V_QINTR_CNT_EN(vi->pktc_idx != -1);
+ for_each_rxq(vi, i, rxq) {
#ifdef atomic_store_rel_8
atomic_store_rel_8(&rxq->iq.intr_params, v);
#else
@@ -5362,7 +5770,7 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS)
#endif
}
#ifdef TCP_OFFLOAD
- for_each_ofld_rxq(pi, i, ofld_rxq) {
+ for_each_ofld_rxq(vi, i, ofld_rxq) {
#ifdef atomic_store_rel_8
atomic_store_rel_8(&ofld_rxq->iq.intr_params, v);
#else
@@ -5370,7 +5778,7 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS)
#endif
}
#endif
- pi->tmr_idx = idx;
+ vi->tmr_idx = idx;
end_synchronized_op(sc, LOCK_HELD);
return (0);
@@ -5379,11 +5787,11 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS)
static int
sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS)
{
- struct port_info *pi = arg1;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = arg1;
+ struct adapter *sc = vi->pi->adapter;
int idx, rc;
- idx = pi->pktc_idx;
+ idx = vi->pktc_idx;
rc = sysctl_handle_int(oidp, &idx, 0, req);
if (rc != 0 || req->newptr == NULL)
@@ -5392,15 +5800,15 @@ sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS)
if (idx < -1 || idx >= SGE_NCOUNTERS)
return (EINVAL);
- rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK,
+ rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
"t4pktc");
if (rc)
return (rc);
- if (pi->flags & PORT_INIT_DONE)
+ if (vi->flags & VI_INIT_DONE)
rc = EBUSY; /* cannot be changed once the queues are created */
else
- pi->pktc_idx = idx;
+ vi->pktc_idx = idx;
end_synchronized_op(sc, LOCK_HELD);
return (rc);
@@ -5409,11 +5817,11 @@ sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS)
static int
sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS)
{
- struct port_info *pi = arg1;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = arg1;
+ struct adapter *sc = vi->pi->adapter;
int qsize, rc;
- qsize = pi->qsize_rxq;
+ qsize = vi->qsize_rxq;
rc = sysctl_handle_int(oidp, &qsize, 0, req);
if (rc != 0 || req->newptr == NULL)
@@ -5422,15 +5830,15 @@ sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS)
if (qsize < 128 || (qsize & 7))
return (EINVAL);
- rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK,
+ rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
"t4rxqs");
if (rc)
return (rc);
- if (pi->flags & PORT_INIT_DONE)
+ if (vi->flags & VI_INIT_DONE)
rc = EBUSY; /* cannot be changed once the queues are created */
else
- pi->qsize_rxq = qsize;
+ vi->qsize_rxq = qsize;
end_synchronized_op(sc, LOCK_HELD);
return (rc);
@@ -5439,11 +5847,11 @@ sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS)
static int
sysctl_qsize_txq(SYSCTL_HANDLER_ARGS)
{
- struct port_info *pi = arg1;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = arg1;
+ struct adapter *sc = vi->pi->adapter;
int qsize, rc;
- qsize = pi->qsize_txq;
+ qsize = vi->qsize_txq;
rc = sysctl_handle_int(oidp, &qsize, 0, req);
if (rc != 0 || req->newptr == NULL)
@@ -5452,15 +5860,15 @@ sysctl_qsize_txq(SYSCTL_HANDLER_ARGS)
if (qsize < 128 || qsize > 65536)
return (EINVAL);
- rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK,
+ rc = begin_synchronized_op(sc, vi, HOLD_LOCK | SLEEP_OK | INTR_OK,
"t4txqs");
if (rc)
return (rc);
- if (pi->flags & PORT_INIT_DONE)
+ if (vi->flags & VI_INIT_DONE)
rc = EBUSY; /* cannot be changed once the queues are created */
else
- pi->qsize_txq = qsize;
+ vi->qsize_txq = qsize;
end_synchronized_op(sc, LOCK_HELD);
return (rc);
@@ -5508,7 +5916,8 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARGS)
if (n & ~(PAUSE_TX | PAUSE_RX))
return (EINVAL); /* some other bit is set too */
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4PAUSE");
+ rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK,
+ "t4PAUSE");
if (rc)
return (rc);
if ((lc->requested_fc & (PAUSE_TX | PAUSE_RX)) != n) {
@@ -8024,6 +8433,7 @@ static int
set_sched_queue(struct adapter *sc, struct t4_sched_queue *p)
{
struct port_info *pi = NULL;
+ struct vi_info *vi;
struct sge_txq *txq;
uint32_t fw_mnem, fw_queue, fw_class;
int i, rc;
@@ -8042,8 +8452,10 @@ set_sched_queue(struct adapter *sc, struct t4_sched_queue *p)
goto done;
}
+ /* XXX: Only supported for the main VI. */
pi = sc->port[p->port];
- if (!in_range(p->queue, 0, pi->ntxq - 1) || !in_range(p->cl, 0, 7)) {
+ vi = &pi->vi[0];
+ if (!in_range(p->queue, 0, vi->ntxq - 1) || !in_range(p->cl, 0, 7)) {
rc = EINVAL;
goto done;
}
@@ -8061,7 +8473,7 @@ set_sched_queue(struct adapter *sc, struct t4_sched_queue *p)
* on a single specified TX queue.
*/
if (p->queue >= 0) {
- txq = &sc->sge.txq[pi->first_txq + p->queue];
+ txq = &sc->sge.txq[vi->first_txq + p->queue];
fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id));
rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue,
&fw_class);
@@ -8072,7 +8484,7 @@ set_sched_queue(struct adapter *sc, struct t4_sched_queue *p)
* Change the scheduling on all the TX queues for the
* interface.
*/
- for_each_txq(pi, i, txq) {
+ for_each_txq(vi, i, txq) {
fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id));
rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue,
&fw_class);
@@ -8124,26 +8536,29 @@ void
t4_os_portmod_changed(const struct adapter *sc, int idx)
{
struct port_info *pi = sc->port[idx];
+ struct vi_info *vi;
+ struct ifnet *ifp;
+ int v;
static const char *mod_str[] = {
NULL, "LR", "SR", "ER", "TWINAX", "active TWINAX", "LRM"
};
- build_medialist(pi, &pi->media);
-#ifdef DEV_NETMAP
- build_medialist(pi, &pi->nm_media);
-#endif
+ for_each_vi(pi, v, vi) {
+ build_medialist(pi, &vi->media);
+ }
+ ifp = pi->vi[0].ifp;
if (pi->mod_type == FW_PORT_MOD_TYPE_NONE)
- if_printf(pi->ifp, "transceiver unplugged.\n");
+ if_printf(ifp, "transceiver unplugged.\n");
else if (pi->mod_type == FW_PORT_MOD_TYPE_UNKNOWN)
- if_printf(pi->ifp, "unknown transceiver inserted.\n");
+ if_printf(ifp, "unknown transceiver inserted.\n");
else if (pi->mod_type == FW_PORT_MOD_TYPE_NOTSUPPORTED)
- if_printf(pi->ifp, "unsupported transceiver inserted.\n");
+ if_printf(ifp, "unsupported transceiver inserted.\n");
else if (pi->mod_type > 0 && pi->mod_type < nitems(mod_str)) {
- if_printf(pi->ifp, "%s transceiver inserted.\n",
+ if_printf(ifp, "%s transceiver inserted.\n",
mod_str[pi->mod_type]);
} else {
- if_printf(pi->ifp, "transceiver (type %d) inserted.\n",
+ if_printf(ifp, "transceiver (type %d) inserted.\n",
pi->mod_type);
}
}
@@ -8152,16 +8567,27 @@ void
t4_os_link_changed(struct adapter *sc, int idx, int link_stat, int reason)
{
struct port_info *pi = sc->port[idx];
- struct ifnet *ifp = pi->ifp;
+ struct vi_info *vi;
+ struct ifnet *ifp;
+ int v;
- if (link_stat) {
+ if (link_stat)
pi->linkdnrc = -1;
- ifp->if_baudrate = IF_Mbps(pi->link_cfg.speed);
- if_link_state_change(ifp, LINK_STATE_UP);
- } else {
+ else {
if (reason >= 0)
pi->linkdnrc = reason;
- if_link_state_change(ifp, LINK_STATE_DOWN);
+ }
+ for_each_vi(pi, v, vi) {
+ ifp = vi->ifp;
+ if (ifp == NULL)
+ continue;
+
+ if (link_stat) {
+ ifp->if_baudrate = IF_Mbps(pi->link_cfg.speed);
+ if_link_state_change(ifp, LINK_STATE_UP);
+ } else {
+ if_link_state_change(ifp, LINK_STATE_DOWN);
+ }
}
}
@@ -8281,9 +8707,10 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
rc = read_i2c(sc, (struct t4_i2c_data *)data);
break;
case CHELSIO_T4_CLEAR_STATS: {
- int i;
+ int i, v;
u_int port_id = *(uint32_t *)data;
struct port_info *pi;
+ struct vi_info *vi;
if (port_id >= sc->params.nports)
return (EINVAL);
@@ -8292,46 +8719,64 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag,
/* MAC stats */
t4_clr_port_stats(sc, pi->tx_chan);
pi->tx_parse_error = 0;
+ mtx_lock(&sc->regwin_lock);
+ for_each_vi(pi, v, vi) {
+ if (vi->flags & VI_INIT_DONE)
+ t4_clr_vi_stats(sc, vi->viid);
+ }
+ mtx_unlock(&sc->regwin_lock);
- if (pi->flags & PORT_INIT_DONE) {
- struct sge_rxq *rxq;
- struct sge_txq *txq;
- struct sge_wrq *wrq;
+ /*
+ * Since this command accepts a port, clear stats for
+ * all VIs on this port.
+ */
+ for_each_vi(pi, v, vi) {
+ if (vi->flags & VI_INIT_DONE) {
+ struct sge_rxq *rxq;
+ struct sge_txq *txq;
+ struct sge_wrq *wrq;
- for_each_rxq(pi, i, rxq) {
+ if (vi->flags & VI_NETMAP)
+ continue;
+
+ for_each_rxq(vi, i, rxq) {
#if defined(INET) || defined(INET6)
- rxq->lro.lro_queued = 0;
- rxq->lro.lro_flushed = 0;
+ rxq->lro.lro_queued = 0;
+ rxq->lro.lro_flushed = 0;
#endif
- rxq->rxcsum = 0;
- rxq->vlan_extraction = 0;
- }
+ rxq->rxcsum = 0;
+ rxq->vlan_extraction = 0;
+ }
- for_each_txq(pi, i, txq) {
- txq->txcsum = 0;
- txq->tso_wrs = 0;
- txq->vlan_insertion = 0;
- txq->imm_wrs = 0;
- txq->sgl_wrs = 0;
- txq->txpkt_wrs = 0;
- txq->txpkts0_wrs = 0;
- txq->txpkts1_wrs = 0;
- txq->txpkts0_pkts = 0;
- txq->txpkts1_pkts = 0;
- mp_ring_reset_stats(txq->r);
- }
+ for_each_txq(vi, i, txq) {
+ txq->txcsum = 0;
+ txq->tso_wrs = 0;
+ txq->vlan_insertion = 0;
+ txq->imm_wrs = 0;
+ txq->sgl_wrs = 0;
+ txq->txpkt_wrs = 0;
+ txq->txpkts0_wrs = 0;
+ txq->txpkts1_wrs = 0;
+ txq->txpkts0_pkts = 0;
+ txq->txpkts1_pkts = 0;
+ mp_ring_reset_stats(txq->r);
+ }
#ifdef TCP_OFFLOAD
- /* nothing to clear for each ofld_rxq */
+ /* nothing to clear for each ofld_rxq */
- for_each_ofld_txq(pi, i, wrq) {
- wrq->tx_wrs_direct = 0;
- wrq->tx_wrs_copied = 0;
- }
+ for_each_ofld_txq(vi, i, wrq) {
+ wrq->tx_wrs_direct = 0;
+ wrq->tx_wrs_copied = 0;
+ }
#endif
- wrq = &sc->sge.ctrlq[pi->port_id];
- wrq->tx_wrs_direct = 0;
- wrq->tx_wrs_copied = 0;
+
+ if (IS_MAIN_VI(vi)) {
+ wrq = &sc->sge.ctrlq[pi->port_id];
+ wrq->tx_wrs_direct = 0;
+ wrq->tx_wrs_copied = 0;
+ }
+ }
}
break;
}
@@ -8359,8 +8804,8 @@ void
t4_iscsi_init(struct ifnet *ifp, unsigned int tag_mask,
const unsigned int *pgsz_order)
{
- struct port_info *pi = ifp->if_softc;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = ifp->if_softc;
+ struct adapter *sc = vi->pi->adapter;
t4_write_reg(sc, A_ULP_RX_ISCSI_TAGMASK, tag_mask);
t4_write_reg(sc, A_ULP_RX_ISCSI_PSZ, V_HPZ0(pgsz_order[0]) |
@@ -8369,9 +8814,10 @@ t4_iscsi_init(struct ifnet *ifp, unsigned int tag_mask,
}
static int
-toe_capability(struct port_info *pi, int enable)
+toe_capability(struct vi_info *vi, int enable)
{
int rc;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
ASSERT_SYNCHRONIZED_OP(sc);
@@ -8380,19 +8826,32 @@ toe_capability(struct port_info *pi, int enable)
return (ENODEV);
if (enable) {
+ if ((vi->ifp->if_capenable & IFCAP_TOE) != 0) {
+ /* TOE is already enabled. */
+ return (0);
+ }
+
/*
* We need the port's queues around so that we're able to send
* and receive CPLs to/from the TOE even if the ifnet for this
* port has never been UP'd administratively.
*/
- if (!(pi->flags & PORT_INIT_DONE)) {
- rc = cxgbe_init_synchronized(pi);
+ if (!(vi->flags & VI_INIT_DONE)) {
+ rc = cxgbe_init_synchronized(vi);
+ if (rc)
+ return (rc);
+ }
+ if (!(pi->vi[0].flags & VI_INIT_DONE)) {
+ rc = cxgbe_init_synchronized(&pi->vi[0]);
if (rc)
return (rc);
}
- if (isset(&sc->offload_map, pi->port_id))
+ if (isset(&sc->offload_map, pi->port_id)) {
+ /* TOE is enabled on another VI of this port. */
+ pi->uld_vis++;
return (0);
+ }
if (!uld_active(sc, ULD_TOM)) {
rc = t4_activate_uld(sc, ULD_TOM);
@@ -8415,9 +8874,12 @@ toe_capability(struct port_info *pi, int enable)
if (!uld_active(sc, ULD_ISCSI))
(void) t4_activate_uld(sc, ULD_ISCSI);
+ pi->uld_vis++;
setbit(&sc->offload_map, pi->port_id);
} else {
- if (!isset(&sc->offload_map, pi->port_id))
+ pi->uld_vis--;
+
+ if (!isset(&sc->offload_map, pi->port_id) || pi->uld_vis > 0)
return (0);
KASSERT(uld_active(sc, ULD_TOM),
@@ -8733,6 +9195,7 @@ done_unload:
static devclass_t t4_devclass, t5_devclass;
static devclass_t cxgbe_devclass, cxl_devclass;
+static devclass_t vcxgbe_devclass, vcxl_devclass;
DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, mod_event, 0);
MODULE_VERSION(t4nex, 1);
@@ -8754,3 +9217,9 @@ MODULE_VERSION(cxgbe, 1);
DRIVER_MODULE(cxl, t5nex, cxl_driver, cxl_devclass, 0, 0);
MODULE_VERSION(cxl, 1);
+
+DRIVER_MODULE(vcxgbe, cxgbe, vcxgbe_driver, vcxgbe_devclass, 0, 0);
+MODULE_VERSION(vcxgbe, 1);
+
+DRIVER_MODULE(vcxl, cxl, vcxl_driver, vcxl_devclass, 0, 0);
+MODULE_VERSION(vcxl, 1);
diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c
index a4afb8a..f01a43c 100644
--- a/sys/dev/cxgbe/t4_netmap.c
+++ b/sys/dev/cxgbe/t4_netmap.c
@@ -33,10 +33,11 @@ __FBSDID("$FreeBSD$");
#ifdef DEV_NETMAP
#include <sys/param.h>
+#include <sys/bus.h>
#include <sys/eventhandler.h>
#include <sys/lock.h>
-#include <sys/types.h>
#include <sys/mbuf.h>
+#include <sys/module.h>
#include <sys/selinfo.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@@ -92,28 +93,51 @@ static int cxgbe_nm_ioctl(struct ifnet *, unsigned long, caddr_t);
static int cxgbe_nm_transmit(struct ifnet *, struct mbuf *);
static void cxgbe_nm_qflush(struct ifnet *);
-static int cxgbe_nm_init_synchronized(struct port_info *);
-static int cxgbe_nm_uninit_synchronized(struct port_info *);
+static int cxgbe_nm_init_synchronized(struct vi_info *);
+static int cxgbe_nm_uninit_synchronized(struct vi_info *);
+
+/* T4 netmap VI (ncxgbe) interface */
+static int ncxgbe_probe(device_t);
+static int ncxgbe_attach(device_t);
+static int ncxgbe_detach(device_t);
+static device_method_t ncxgbe_methods[] = {
+ DEVMETHOD(device_probe, ncxgbe_probe),
+ DEVMETHOD(device_attach, ncxgbe_attach),
+ DEVMETHOD(device_detach, ncxgbe_detach),
+ { 0, 0 }
+};
+static driver_t ncxgbe_driver = {
+ "ncxgbe",
+ ncxgbe_methods,
+ sizeof(struct vi_info)
+};
+
+/* T5 netmap VI (ncxl) interface */
+static driver_t ncxl_driver = {
+ "ncxl",
+ ncxgbe_methods,
+ sizeof(struct vi_info)
+};
static void
cxgbe_nm_init(void *arg)
{
- struct port_info *pi = arg;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = arg;
+ struct adapter *sc = vi->pi->adapter;
- if (begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4nminit") != 0)
+ if (begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4nminit") != 0)
return;
- cxgbe_nm_init_synchronized(pi);
+ cxgbe_nm_init_synchronized(vi);
end_synchronized_op(sc, 0);
return;
}
static int
-cxgbe_nm_init_synchronized(struct port_info *pi)
+cxgbe_nm_init_synchronized(struct vi_info *vi)
{
- struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->nm_ifp;
+ struct adapter *sc = vi->pi->adapter;
+ struct ifnet *ifp = vi->ifp;
int rc = 0;
ASSERT_SYNCHRONIZED_OP(sc);
@@ -125,8 +149,8 @@ cxgbe_nm_init_synchronized(struct port_info *pi)
((rc = adapter_full_init(sc)) != 0))
return (rc); /* error message displayed already */
- if (!(pi->flags & PORT_INIT_DONE) &&
- ((rc = port_full_init(pi)) != 0))
+ if (!(vi->flags & VI_INIT_DONE) &&
+ ((rc = vi_full_init(vi)) != 0))
return (rc); /* error message displayed already */
rc = update_mac_settings(ifp, XGMAC_ALL);
@@ -134,20 +158,22 @@ cxgbe_nm_init_synchronized(struct port_info *pi)
return (rc); /* error message displayed already */
ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ callout_reset(&vi->tick, hz, vi_tick, vi);
return (rc);
}
static int
-cxgbe_nm_uninit_synchronized(struct port_info *pi)
+cxgbe_nm_uninit_synchronized(struct vi_info *vi)
{
#ifdef INVARIANTS
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
#endif
- struct ifnet *ifp = pi->nm_ifp;
+ struct ifnet *ifp = vi->ifp;
ASSERT_SYNCHRONIZED_OP(sc);
+ callout_stop(&vi->tick);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
return (0);
@@ -157,12 +183,12 @@ static int
cxgbe_nm_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
{
int rc = 0, mtu, flags;
- struct port_info *pi = ifp->if_softc;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = ifp->if_softc;
+ struct adapter *sc = vi->pi->adapter;
struct ifreq *ifr = (struct ifreq *)data;
uint32_t mask;
- MPASS(pi->nm_ifp == ifp);
+ MPASS(vi->ifp == ifp);
switch (cmd) {
case SIOCSIFMTU:
@@ -170,7 +196,7 @@ cxgbe_nm_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO))
return (EINVAL);
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4nmtu");
+ rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4nmtu");
if (rc)
return (rc);
ifp->if_mtu = mtu;
@@ -180,29 +206,29 @@ cxgbe_nm_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
break;
case SIOCSIFFLAGS:
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4nflg");
+ rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4nflg");
if (rc)
return (rc);
if (ifp->if_flags & IFF_UP) {
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
- flags = pi->nmif_flags;
+ flags = vi->if_flags;
if ((ifp->if_flags ^ flags) &
(IFF_PROMISC | IFF_ALLMULTI)) {
rc = update_mac_settings(ifp,
XGMAC_PROMISC | XGMAC_ALLMULTI);
}
} else
- rc = cxgbe_nm_init_synchronized(pi);
- pi->nmif_flags = ifp->if_flags;
+ rc = cxgbe_nm_init_synchronized(vi);
+ vi->if_flags = ifp->if_flags;
} else if (ifp->if_drv_flags & IFF_DRV_RUNNING)
- rc = cxgbe_nm_uninit_synchronized(pi);
+ rc = cxgbe_nm_uninit_synchronized(vi);
end_synchronized_op(sc, 0);
break;
case SIOCADDMULTI:
case SIOCDELMULTI: /* these two are called with a mutex held :-( */
- rc = begin_synchronized_op(sc, pi, HOLD_LOCK, "t4nmulti");
+ rc = begin_synchronized_op(sc, vi, HOLD_LOCK, "t4nmulti");
if (rc)
return (rc);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
@@ -228,7 +254,7 @@ cxgbe_nm_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
- ifmedia_ioctl(ifp, ifr, &pi->nm_media, cmd);
+ ifmedia_ioctl(ifp, ifr, &vi->media, cmd);
break;
default:
@@ -254,19 +280,19 @@ cxgbe_nm_qflush(struct ifnet *ifp)
}
static int
-alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong)
+alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong)
{
int rc, cntxt_id, i;
__be32 v;
- struct adapter *sc = pi->adapter;
- struct netmap_adapter *na = NA(pi->nm_ifp);
+ struct adapter *sc = vi->pi->adapter;
+ struct netmap_adapter *na = NA(vi->ifp);
struct fw_iq_cmd c;
MPASS(na != NULL);
MPASS(nm_rxq->iq_desc != NULL);
MPASS(nm_rxq->fl_desc != NULL);
- bzero(nm_rxq->iq_desc, pi->qsize_rxq * IQ_ESIZE);
+ bzero(nm_rxq->iq_desc, vi->qsize_rxq * IQ_ESIZE);
bzero(nm_rxq->fl_desc, na->num_rx_desc * EQ_ESIZE + spg_len);
bzero(&c, sizeof(c));
@@ -275,7 +301,7 @@ alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong)
V_FW_IQ_CMD_VFN(0));
c.alloc_to_len16 = htobe32(F_FW_IQ_CMD_ALLOC | F_FW_IQ_CMD_IQSTART |
FW_LEN16(c));
- if (pi->flags & INTR_NM_RXQ) {
+ if (vi->flags & INTR_RXQ) {
KASSERT(nm_rxq->intr_idx < sc->intr_count,
("%s: invalid direct intr_idx %d", __func__,
nm_rxq->intr_idx));
@@ -287,13 +313,13 @@ alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong)
}
c.type_to_iqandstindex = htobe32(v |
V_FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) |
- V_FW_IQ_CMD_VIID(pi->nm_viid) |
+ V_FW_IQ_CMD_VIID(vi->viid) |
V_FW_IQ_CMD_IQANUD(X_UPDATEDELIVERY_INTERRUPT));
- c.iqdroprss_to_iqesize = htobe16(V_FW_IQ_CMD_IQPCIECH(pi->tx_chan) |
+ c.iqdroprss_to_iqesize = htobe16(V_FW_IQ_CMD_IQPCIECH(vi->pi->tx_chan) |
F_FW_IQ_CMD_IQGTSMODE |
V_FW_IQ_CMD_IQINTCNTTHRESH(0) |
V_FW_IQ_CMD_IQESIZE(ilog2(IQ_ESIZE) - 4));
- c.iqsize = htobe16(pi->qsize_rxq);
+ c.iqsize = htobe16(vi->qsize_rxq);
c.iqaddr = htobe64(nm_rxq->iq_ba);
if (cong >= 0) {
c.iqns_to_fl0congen = htobe32(F_FW_IQ_CMD_IQFLINTCONGEN |
@@ -319,7 +345,7 @@ alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong)
}
nm_rxq->iq_cidx = 0;
- MPASS(nm_rxq->iq_sidx == pi->qsize_rxq - spg_len / IQ_ESIZE);
+ MPASS(nm_rxq->iq_sidx == vi->qsize_rxq - spg_len / IQ_ESIZE);
nm_rxq->iq_gen = F_RSPD_GEN;
nm_rxq->iq_cntxt_id = be16toh(c.iqid);
nm_rxq->iq_abs_id = be16toh(c.physiqid);
@@ -380,9 +406,9 @@ alloc_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int cong)
}
static int
-free_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq)
+free_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq)
{
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
int rc;
rc = -t4_iq_free(sc, sc->mbox, sc->pf, 0, FW_IQ_TYPE_FL_INT_CAP,
@@ -394,12 +420,12 @@ free_nm_rxq_hwq(struct port_info *pi, struct sge_nm_rxq *nm_rxq)
}
static int
-alloc_nm_txq_hwq(struct port_info *pi, struct sge_nm_txq *nm_txq)
+alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq *nm_txq)
{
int rc, cntxt_id;
size_t len;
- struct adapter *sc = pi->adapter;
- struct netmap_adapter *na = NA(pi->nm_ifp);
+ struct adapter *sc = vi->pi->adapter;
+ struct netmap_adapter *na = NA(vi->ifp);
struct fw_eq_eth_cmd c;
MPASS(na != NULL);
@@ -415,10 +441,10 @@ alloc_nm_txq_hwq(struct port_info *pi, struct sge_nm_txq *nm_txq)
c.alloc_to_len16 = htobe32(F_FW_EQ_ETH_CMD_ALLOC |
F_FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c));
c.autoequiqe_to_viid = htobe32(F_FW_EQ_ETH_CMD_AUTOEQUIQE |
- F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(pi->nm_viid));
+ F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(vi->viid));
c.fetchszm_to_iqid =
htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) |
- V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO |
+ V_FW_EQ_ETH_CMD_PCIECHN(vi->pi->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO |
V_FW_EQ_ETH_CMD_IQID(sc->sge.nm_rxq[nm_txq->iqidx].iq_cntxt_id));
c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
@@ -427,7 +453,7 @@ alloc_nm_txq_hwq(struct port_info *pi, struct sge_nm_txq *nm_txq)
rc = -t4_wr_mbox(sc, sc->mbox, &c, sizeof(c), &c);
if (rc != 0) {
- device_printf(pi->dev,
+ device_printf(vi->dev,
"failed to create netmap egress queue: %d\n", rc);
return (rc);
}
@@ -467,9 +493,9 @@ alloc_nm_txq_hwq(struct port_info *pi, struct sge_nm_txq *nm_txq)
}
static int
-free_nm_txq_hwq(struct port_info *pi, struct sge_nm_txq *nm_txq)
+free_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq *nm_txq)
{
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
int rc;
rc = -t4_eth_eq_free(sc, sc->mbox, sc->pf, 0, nm_txq->cntxt_id);
@@ -480,7 +506,7 @@ free_nm_txq_hwq(struct port_info *pi, struct sge_nm_txq *nm_txq)
}
static int
-cxgbe_netmap_on(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
+cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp,
struct netmap_adapter *na)
{
struct netmap_slot *slot;
@@ -492,7 +518,7 @@ cxgbe_netmap_on(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
ASSERT_SYNCHRONIZED_OP(sc);
- if ((pi->flags & PORT_INIT_DONE) == 0 ||
+ if ((vi->flags & VI_INIT_DONE) == 0 ||
(ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return (EAGAIN);
@@ -511,8 +537,8 @@ cxgbe_netmap_on(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
/* Must set caps before calling netmap_reset */
nm_set_native_flags(na);
- for_each_nm_rxq(pi, i, nm_rxq) {
- alloc_nm_rxq_hwq(pi, nm_rxq, tnl_cong(pi, nm_cong_drop));
+ for_each_nm_rxq(vi, i, nm_rxq) {
+ alloc_nm_rxq_hwq(vi, nm_rxq, tnl_cong(vi->pi, nm_cong_drop));
nm_rxq->fl_hwidx = hwidx;
slot = netmap_reset(na, NR_RX, i, 0);
MPASS(slot != NULL); /* XXXNM: error check, not assert */
@@ -535,28 +561,28 @@ cxgbe_netmap_on(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
nm_rxq->fl_db_val | V_PIDX(j));
}
- for_each_nm_txq(pi, i, nm_txq) {
- alloc_nm_txq_hwq(pi, nm_txq);
+ for_each_nm_txq(vi, i, nm_txq) {
+ alloc_nm_txq_hwq(vi, nm_txq);
slot = netmap_reset(na, NR_TX, i, 0);
MPASS(slot != NULL); /* XXXNM: error check, not assert */
}
- rss = malloc(pi->nm_rss_size * sizeof (*rss), M_CXGBE, M_ZERO |
+ rss = malloc(vi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO |
M_WAITOK);
- for (i = 0; i < pi->nm_rss_size;) {
- for_each_nm_rxq(pi, j, nm_rxq) {
+ for (i = 0; i < vi->rss_size;) {
+ for_each_nm_rxq(vi, j, nm_rxq) {
rss[i++] = nm_rxq->iq_abs_id;
- if (i == pi->nm_rss_size)
+ if (i == vi->rss_size)
break;
}
}
- rc = -t4_config_rss_range(sc, sc->mbox, pi->nm_viid, 0, pi->nm_rss_size,
- rss, pi->nm_rss_size);
+ rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size,
+ rss, vi->rss_size);
if (rc != 0)
if_printf(ifp, "netmap rss_config failed: %d\n", rc);
free(rss, M_CXGBE);
- rc = -t4_enable_vi(sc, sc->mbox, pi->nm_viid, true, true);
+ rc = -t4_enable_vi(sc, sc->mbox, vi->viid, true, true);
if (rc != 0)
if_printf(ifp, "netmap enable_vi failed: %d\n", rc);
@@ -564,7 +590,7 @@ cxgbe_netmap_on(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
}
static int
-cxgbe_netmap_off(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
+cxgbe_netmap_off(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp,
struct netmap_adapter *na)
{
int rc, i;
@@ -573,12 +599,15 @@ cxgbe_netmap_off(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
ASSERT_SYNCHRONIZED_OP(sc);
- rc = -t4_enable_vi(sc, sc->mbox, pi->nm_viid, false, false);
+ if ((vi->flags & VI_INIT_DONE) == 0)
+ return (0);
+
+ rc = -t4_enable_vi(sc, sc->mbox, vi->viid, false, false);
if (rc != 0)
if_printf(ifp, "netmap disable_vi failed: %d\n", rc);
nm_clear_native_flags(na);
- for_each_nm_txq(pi, i, nm_txq) {
+ for_each_nm_txq(vi, i, nm_txq) {
struct sge_qstat *spg = (void *)&nm_txq->desc[nm_txq->sidx];
/* Wait for hw pidx to catch up ... */
@@ -589,10 +618,10 @@ cxgbe_netmap_off(struct adapter *sc, struct port_info *pi, struct ifnet *ifp,
while (spg->pidx != spg->cidx)
pause("nmcidx", 1);
- free_nm_txq_hwq(pi, nm_txq);
+ free_nm_txq_hwq(vi, nm_txq);
}
- for_each_nm_rxq(pi, i, nm_rxq) {
- free_nm_rxq_hwq(pi, nm_rxq);
+ for_each_nm_rxq(vi, i, nm_rxq) {
+ free_nm_rxq_hwq(vi, nm_rxq);
}
return (rc);
@@ -602,17 +631,17 @@ static int
cxgbe_netmap_reg(struct netmap_adapter *na, int on)
{
struct ifnet *ifp = na->ifp;
- struct port_info *pi = ifp->if_softc;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = ifp->if_softc;
+ struct adapter *sc = vi->pi->adapter;
int rc;
- rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4nmreg");
+ rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4nmreg");
if (rc != 0)
return (rc);
if (on)
- rc = cxgbe_netmap_on(sc, pi, ifp, na);
+ rc = cxgbe_netmap_on(sc, vi, ifp, na);
else
- rc = cxgbe_netmap_off(sc, pi, ifp, na);
+ rc = cxgbe_netmap_off(sc, vi, ifp, na);
end_synchronized_op(sc, 0);
return (rc);
@@ -861,9 +890,9 @@ cxgbe_netmap_txsync(struct netmap_kring *kring, int flags)
{
struct netmap_adapter *na = kring->na;
struct ifnet *ifp = na->ifp;
- struct port_info *pi = ifp->if_softc;
- struct adapter *sc = pi->adapter;
- struct sge_nm_txq *nm_txq = &sc->sge.nm_txq[pi->first_nm_txq + kring->ring_id];
+ struct vi_info *vi = ifp->if_softc;
+ struct adapter *sc = vi->pi->adapter;
+ struct sge_nm_txq *nm_txq = &sc->sge.nm_txq[vi->first_txq + kring->ring_id];
const u_int head = kring->rhead;
u_int reclaimed = 0;
int n, d, npkt_remaining, ndesc_remaining, txcsum;
@@ -926,9 +955,9 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int flags)
struct netmap_adapter *na = kring->na;
struct netmap_ring *ring = kring->ring;
struct ifnet *ifp = na->ifp;
- struct port_info *pi = ifp->if_softc;
- struct adapter *sc = pi->adapter;
- struct sge_nm_rxq *nm_rxq = &sc->sge.nm_rxq[pi->first_nm_rxq + kring->ring_id];
+ struct vi_info *vi = ifp->if_softc;
+ struct adapter *sc = vi->pi->adapter;
+ struct sge_nm_rxq *nm_rxq = &sc->sge.nm_rxq[vi->first_rxq + kring->ring_id];
u_int const head = kring->rhead;
u_int n;
int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR;
@@ -994,54 +1023,64 @@ cxgbe_netmap_rxsync(struct netmap_kring *kring, int flags)
return (0);
}
-/*
- * Create an ifnet solely for netmap use and register it with the kernel.
- */
-int
-create_netmap_ifnet(struct port_info *pi)
+static int
+ncxgbe_probe(device_t dev)
+{
+ char buf[128];
+ struct vi_info *vi = device_get_softc(dev);
+
+ snprintf(buf, sizeof(buf), "port %d netmap vi", vi->pi->port_id);
+ device_set_desc_copy(dev, buf);
+
+ return (BUS_PROBE_DEFAULT);
+}
+
+static int
+ncxgbe_attach(device_t dev)
{
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi;
+ struct port_info *pi;
+ struct adapter *sc;
struct netmap_adapter na;
struct ifnet *ifp;
- device_t dev = pi->dev;
- uint8_t mac[ETHER_ADDR_LEN];
int rc;
- if (pi->nnmtxq <= 0 || pi->nnmrxq <= 0)
- return (0);
- MPASS(pi->nm_ifp == NULL);
+ vi = device_get_softc(dev);
+ pi = vi->pi;
+ sc = pi->adapter;
/*
* Allocate a virtual interface exclusively for netmap use. Give it the
* MAC address normally reserved for use by a TOE interface. (The TOE
* driver on FreeBSD doesn't use it).
*/
- rc = t4_alloc_vi_func(sc, sc->mbox, pi->tx_chan, sc->pf, 0, 1, &mac[0],
- &pi->nm_rss_size, FW_VI_FUNC_OFLD, 0);
+ rc = t4_alloc_vi_func(sc, sc->mbox, pi->tx_chan, sc->pf, 0, 1,
+ vi->hw_addr, &vi->rss_size, FW_VI_FUNC_OFLD, 0);
if (rc < 0) {
device_printf(dev, "unable to allocate netmap virtual "
"interface for port %d: %d\n", pi->port_id, -rc);
return (-rc);
}
- pi->nm_viid = rc;
- pi->nm_xact_addr_filt = -1;
+ vi->viid = rc;
+ vi->xact_addr_filt = -1;
+ callout_init(&vi->tick, 1);
ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
device_printf(dev, "Cannot allocate netmap ifnet\n");
return (ENOMEM);
}
- pi->nm_ifp = ifp;
- ifp->if_softc = pi;
+ vi->ifp = ifp;
+ ifp->if_softc = vi;
- if_initname(ifp, is_t4(pi->adapter) ? "ncxgbe" : "ncxl",
- device_get_unit(dev));
+ if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_init = cxgbe_nm_init;
ifp->if_ioctl = cxgbe_nm_ioctl;
ifp->if_transmit = cxgbe_nm_transmit;
ifp->if_qflush = cxgbe_nm_qflush;
+ ifp->if_get_counter = cxgbe_get_counter;
/*
* netmap(4) says "netmap does not use features such as checksum
@@ -1057,20 +1096,24 @@ create_netmap_ifnet(struct port_info *pi)
ifp->if_capenable = 0;
ifp->if_hwassist = 0;
- /* nm_media has already been setup by the caller */
+ /* vi->media has already been setup by the caller */
+
+ ether_ifattach(ifp, vi->hw_addr);
+
+ device_printf(dev, "%d txq, %d rxq (netmap)\n", vi->ntxq, vi->nrxq);
- ether_ifattach(ifp, mac);
+ vi_sysctls(vi);
/*
* Register with netmap in the kernel.
*/
bzero(&na, sizeof(na));
- na.ifp = pi->nm_ifp;
+ na.ifp = ifp;
na.na_flags = NAF_BDG_MAYSLEEP;
/* Netmap doesn't know about the space reserved for the status page. */
- na.num_tx_desc = pi->qsize_txq - spg_len / EQ_ESIZE;
+ na.num_tx_desc = vi->qsize_txq - spg_len / EQ_ESIZE;
/*
* The freelist's cidx/pidx drives netmap's rx cidx/pidx. So
@@ -1078,30 +1121,39 @@ create_netmap_ifnet(struct port_info *pi)
* freelist, and not the number of entries in the iq. (These two are
* not exactly the same due to the space taken up by the status page).
*/
- na.num_rx_desc = (pi->qsize_rxq / 8) * 8;
+ na.num_rx_desc = (vi->qsize_rxq / 8) * 8;
na.nm_txsync = cxgbe_netmap_txsync;
na.nm_rxsync = cxgbe_netmap_rxsync;
na.nm_register = cxgbe_netmap_reg;
- na.num_tx_rings = pi->nnmtxq;
- na.num_rx_rings = pi->nnmrxq;
+ na.num_tx_rings = vi->ntxq;
+ na.num_rx_rings = vi->nrxq;
netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */
return (0);
}
-int
-destroy_netmap_ifnet(struct port_info *pi)
+static int
+ncxgbe_detach(device_t dev)
{
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi;
+ struct adapter *sc;
- if (pi->nm_ifp == NULL)
- return (0);
+ vi = device_get_softc(dev);
+ sc = vi->pi->adapter;
+
+ doom_vi(sc, vi);
- netmap_detach(pi->nm_ifp);
- ifmedia_removeall(&pi->nm_media);
- ether_ifdetach(pi->nm_ifp);
- if_free(pi->nm_ifp);
- t4_free_vi(sc, sc->mbox, sc->pf, 0, pi->nm_viid);
+ netmap_detach(vi->ifp);
+ ether_ifdetach(vi->ifp);
+ cxgbe_nm_uninit_synchronized(vi);
+ callout_drain(&vi->tick);
+ vi_full_uninit(vi);
+ ifmedia_removeall(&vi->media);
+ if_free(vi->ifp);
+ vi->ifp = NULL;
+ t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid);
+
+ end_synchronized_op(sc, 0);
return (0);
}
@@ -1130,9 +1182,9 @@ void
t4_nm_intr(void *arg)
{
struct sge_nm_rxq *nm_rxq = arg;
- struct port_info *pi = nm_rxq->pi;
- struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->nm_ifp;
+ struct vi_info *vi = nm_rxq->vi;
+ struct adapter *sc = vi->pi->adapter;
+ struct ifnet *ifp = vi->ifp;
struct netmap_adapter *na = NA(ifp);
struct netmap_kring *kring = &na->rx_rings[nm_rxq->nid];
struct netmap_ring *ring = kring->ring;
@@ -1232,4 +1284,12 @@ t4_nm_intr(void *arg)
V_INGRESSQID((u32)nm_rxq->iq_cntxt_id) |
V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx)));
}
+
+static devclass_t ncxgbe_devclass, ncxl_devclass;
+
+DRIVER_MODULE(ncxgbe, cxgbe, ncxgbe_driver, ncxgbe_devclass, 0, 0);
+MODULE_VERSION(ncxgbe, 1);
+
+DRIVER_MODULE(ncxl, cxl, ncxl_driver, ncxl_devclass, 0, 0);
+MODULE_VERSION(ncxl, 1);
#endif
diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c
index ea0bd7a..743a399 100644
--- a/sys/dev/cxgbe/t4_sge.c
+++ b/sys/dev/cxgbe/t4_sge.c
@@ -172,44 +172,44 @@ static int alloc_ring(struct adapter *, size_t, bus_dma_tag_t *, bus_dmamap_t *,
bus_addr_t *, void **);
static int free_ring(struct adapter *, bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
void *);
-static int alloc_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *,
+static int alloc_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *,
int, int);
-static int free_iq_fl(struct port_info *, struct sge_iq *, struct sge_fl *);
+static int free_iq_fl(struct vi_info *, struct sge_iq *, struct sge_fl *);
static void add_fl_sysctls(struct sysctl_ctx_list *, struct sysctl_oid *,
struct sge_fl *);
static int alloc_fwq(struct adapter *);
static int free_fwq(struct adapter *);
static int alloc_mgmtq(struct adapter *);
static int free_mgmtq(struct adapter *);
-static int alloc_rxq(struct port_info *, struct sge_rxq *, int, int,
+static int alloc_rxq(struct vi_info *, struct sge_rxq *, int, int,
struct sysctl_oid *);
-static int free_rxq(struct port_info *, struct sge_rxq *);
+static int free_rxq(struct vi_info *, struct sge_rxq *);
#ifdef TCP_OFFLOAD
-static int alloc_ofld_rxq(struct port_info *, struct sge_ofld_rxq *, int, int,
+static int alloc_ofld_rxq(struct vi_info *, struct sge_ofld_rxq *, int, int,
struct sysctl_oid *);
-static int free_ofld_rxq(struct port_info *, struct sge_ofld_rxq *);
+static int free_ofld_rxq(struct vi_info *, struct sge_ofld_rxq *);
#endif
#ifdef DEV_NETMAP
-static int alloc_nm_rxq(struct port_info *, struct sge_nm_rxq *, int, int,
+static int alloc_nm_rxq(struct vi_info *, struct sge_nm_rxq *, int, int,
struct sysctl_oid *);
-static int free_nm_rxq(struct port_info *, struct sge_nm_rxq *);
-static int alloc_nm_txq(struct port_info *, struct sge_nm_txq *, int, int,
+static int free_nm_rxq(struct vi_info *, struct sge_nm_rxq *);
+static int alloc_nm_txq(struct vi_info *, struct sge_nm_txq *, int, int,
struct sysctl_oid *);
-static int free_nm_txq(struct port_info *, struct sge_nm_txq *);
+static int free_nm_txq(struct vi_info *, struct sge_nm_txq *);
#endif
static int ctrl_eq_alloc(struct adapter *, struct sge_eq *);
-static int eth_eq_alloc(struct adapter *, struct port_info *, struct sge_eq *);
+static int eth_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *);
#ifdef TCP_OFFLOAD
-static int ofld_eq_alloc(struct adapter *, struct port_info *, struct sge_eq *);
+static int ofld_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *);
#endif
-static int alloc_eq(struct adapter *, struct port_info *, struct sge_eq *);
+static int alloc_eq(struct adapter *, struct vi_info *, struct sge_eq *);
static int free_eq(struct adapter *, struct sge_eq *);
-static int alloc_wrq(struct adapter *, struct port_info *, struct sge_wrq *,
+static int alloc_wrq(struct adapter *, struct vi_info *, struct sge_wrq *,
struct sysctl_oid *);
static int free_wrq(struct adapter *, struct sge_wrq *);
-static int alloc_txq(struct port_info *, struct sge_txq *, int,
+static int alloc_txq(struct vi_info *, struct sge_txq *, int,
struct sysctl_oid *);
-static int free_txq(struct port_info *, struct sge_txq *);
+static int free_txq(struct vi_info *, struct sge_txq *);
static void oneseg_dma_callback(void *, bus_dma_segment_t *, int, int);
static inline void ring_fl_db(struct adapter *, struct sge_fl *);
static int refill_fl(struct adapter *, struct sge_fl *, int);
@@ -834,51 +834,25 @@ t4_teardown_adapter_queues(struct adapter *sc)
}
static inline int
-port_intr_count(struct port_info *pi)
+first_vector(struct vi_info *vi)
{
- int rc = 0;
-
- if (pi->flags & INTR_RXQ)
- rc += pi->nrxq;
-#ifdef TCP_OFFLOAD
- if (pi->flags & INTR_OFLD_RXQ)
- rc += pi->nofldrxq;
-#endif
-#ifdef DEV_NETMAP
- if (pi->flags & INTR_NM_RXQ)
- rc += pi->nnmrxq;
-#endif
- return (rc);
-}
-
-static inline int
-first_vector(struct port_info *pi)
-{
- struct adapter *sc = pi->adapter;
- int rc = T4_EXTRA_INTR, i;
+ struct adapter *sc = vi->pi->adapter;
if (sc->intr_count == 1)
return (0);
- for_each_port(sc, i) {
- if (i == pi->port_id)
- break;
-
- rc += port_intr_count(sc->port[i]);
- }
-
- return (rc);
+ return (vi->first_intr);
}
/*
* Given an arbitrary "index," come up with an iq that can be used by other
- * queues (of this port) for interrupt forwarding, SGE egress updates, etc.
+ * queues (of this VI) for interrupt forwarding, SGE egress updates, etc.
* The iq returned is guaranteed to be something that takes direct interrupts.
*/
static struct sge_iq *
-port_intr_iq(struct port_info *pi, int idx)
+vi_intr_iq(struct vi_info *vi, int idx)
{
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
struct sge *s = &sc->sge;
struct sge_iq *iq = NULL;
int nintr, i;
@@ -886,43 +860,37 @@ port_intr_iq(struct port_info *pi, int idx)
if (sc->intr_count == 1)
return (&sc->sge.fwq);
- nintr = port_intr_count(pi);
+ KASSERT(!(vi->flags & VI_NETMAP),
+ ("%s: called on netmap VI", __func__));
+ nintr = vi->nintr;
KASSERT(nintr != 0,
- ("%s: pi %p has no exclusive interrupts, total interrupts = %d",
- __func__, pi, sc->intr_count));
-#ifdef DEV_NETMAP
- /* Exclude netmap queues as they can't take anyone else's interrupts */
- if (pi->flags & INTR_NM_RXQ)
- nintr -= pi->nnmrxq;
- KASSERT(nintr > 0,
- ("%s: pi %p has nintr %d after netmap adjustment of %d", __func__,
- pi, nintr, pi->nnmrxq));
-#endif
+ ("%s: vi %p has no exclusive interrupts, total interrupts = %d",
+ __func__, vi, sc->intr_count));
i = idx % nintr;
- if (pi->flags & INTR_RXQ) {
- if (i < pi->nrxq) {
- iq = &s->rxq[pi->first_rxq + i].iq;
+ if (vi->flags & INTR_RXQ) {
+ if (i < vi->nrxq) {
+ iq = &s->rxq[vi->first_rxq + i].iq;
goto done;
}
- i -= pi->nrxq;
+ i -= vi->nrxq;
}
#ifdef TCP_OFFLOAD
- if (pi->flags & INTR_OFLD_RXQ) {
- if (i < pi->nofldrxq) {
- iq = &s->ofld_rxq[pi->first_ofld_rxq + i].iq;
+ if (vi->flags & INTR_OFLD_RXQ) {
+ if (i < vi->nofldrxq) {
+ iq = &s->ofld_rxq[vi->first_ofld_rxq + i].iq;
goto done;
}
- i -= pi->nofldrxq;
+ i -= vi->nofldrxq;
}
#endif
- panic("%s: pi %p, intr_flags 0x%lx, idx %d, total intr %d\n", __func__,
- pi, pi->flags & INTR_ALL, idx, nintr);
+ panic("%s: vi %p, intr_flags 0x%lx, idx %d, total intr %d\n", __func__,
+ vi, vi->flags & INTR_ALL, idx, nintr);
done:
MPASS(iq != NULL);
KASSERT(iq->flags & IQ_INTR,
- ("%s: iq %p (port %p, intr_flags 0x%lx, idx %d)", __func__, iq, pi,
- pi->flags & INTR_ALL, idx));
+ ("%s: iq %p (vi %p, intr_flags 0x%lx, idx %d)", __func__, iq, vi,
+ vi->flags & INTR_ALL, idx));
return (iq);
}
@@ -949,7 +917,7 @@ mtu_to_max_payload(struct adapter *sc, int mtu, const int toe)
}
int
-t4_setup_port_queues(struct port_info *pi)
+t4_setup_vi_queues(struct vi_info *vi)
{
int rc = 0, i, j, intr_idx, iqid;
struct sge_rxq *rxq;
@@ -964,14 +932,43 @@ t4_setup_port_queues(struct port_info *pi)
struct sge_nm_txq *nm_txq;
#endif
char name[16];
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
- struct ifnet *ifp = pi->ifp;
- struct sysctl_oid *oid = device_get_sysctl_tree(pi->dev);
+ struct ifnet *ifp = vi->ifp;
+ struct sysctl_oid *oid = device_get_sysctl_tree(vi->dev);
struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid);
int maxp, mtu = ifp->if_mtu;
/* Interrupt vector to start from (when using multiple vectors) */
- intr_idx = first_vector(pi);
+ intr_idx = first_vector(vi);
+
+#ifdef DEV_NETMAP
+ if (vi->flags & VI_NETMAP) {
+ /*
+ * We don't have buffers to back the netmap rx queues
+ * right now so we create the queues in a way that
+ * doesn't set off any congestion signal in the chip.
+ */
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq",
+ CTLFLAG_RD, NULL, "rx queues");
+ for_each_nm_rxq(vi, i, nm_rxq) {
+ rc = alloc_nm_rxq(vi, nm_rxq, intr_idx, i, oid);
+ if (rc != 0)
+ goto done;
+ intr_idx++;
+ }
+
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "txq",
+ CTLFLAG_RD, NULL, "tx queues");
+ for_each_nm_txq(vi, i, nm_txq) {
+ iqid = vi->first_rxq + (i % vi->nrxq);
+ rc = alloc_nm_txq(vi, nm_txq, iqid, i, oid);
+ if (rc != 0)
+ goto done;
+ }
+ goto done;
+ }
+#endif
/*
* First pass over all NIC and TOE rx queues:
@@ -979,21 +976,21 @@ t4_setup_port_queues(struct port_info *pi)
* b) allocate queue iff it will take direct interrupts.
*/
maxp = mtu_to_max_payload(sc, mtu, 0);
- if (pi->flags & INTR_RXQ) {
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "rxq",
+ if (vi->flags & INTR_RXQ) {
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq",
CTLFLAG_RD, NULL, "rx queues");
}
- for_each_rxq(pi, i, rxq) {
+ for_each_rxq(vi, i, rxq) {
- init_iq(&rxq->iq, sc, pi->tmr_idx, pi->pktc_idx, pi->qsize_rxq);
+ init_iq(&rxq->iq, sc, vi->tmr_idx, vi->pktc_idx, vi->qsize_rxq);
snprintf(name, sizeof(name), "%s rxq%d-fl",
- device_get_nameunit(pi->dev), i);
- init_fl(sc, &rxq->fl, pi->qsize_rxq / 8, maxp, name);
+ device_get_nameunit(vi->dev), i);
+ init_fl(sc, &rxq->fl, vi->qsize_rxq / 8, maxp, name);
- if (pi->flags & INTR_RXQ) {
+ if (vi->flags & INTR_RXQ) {
rxq->iq.flags |= IQ_INTR;
- rc = alloc_rxq(pi, rxq, intr_idx, i, oid);
+ rc = alloc_rxq(vi, rxq, intr_idx, i, oid);
if (rc != 0)
goto done;
intr_idx++;
@@ -1001,40 +998,23 @@ t4_setup_port_queues(struct port_info *pi)
}
#ifdef TCP_OFFLOAD
maxp = mtu_to_max_payload(sc, mtu, 1);
- if (is_offload(sc) && pi->flags & INTR_OFLD_RXQ) {
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "ofld_rxq",
+ if (vi->flags & INTR_OFLD_RXQ) {
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq",
CTLFLAG_RD, NULL,
"rx queues for offloaded TCP connections");
}
- for_each_ofld_rxq(pi, i, ofld_rxq) {
+ for_each_ofld_rxq(vi, i, ofld_rxq) {
- init_iq(&ofld_rxq->iq, sc, pi->tmr_idx, pi->pktc_idx,
- pi->qsize_rxq);
+ init_iq(&ofld_rxq->iq, sc, vi->tmr_idx, vi->pktc_idx,
+ vi->qsize_rxq);
snprintf(name, sizeof(name), "%s ofld_rxq%d-fl",
- device_get_nameunit(pi->dev), i);
- init_fl(sc, &ofld_rxq->fl, pi->qsize_rxq / 8, maxp, name);
+ device_get_nameunit(vi->dev), i);
+ init_fl(sc, &ofld_rxq->fl, vi->qsize_rxq / 8, maxp, name);
- if (pi->flags & INTR_OFLD_RXQ) {
+ if (vi->flags & INTR_OFLD_RXQ) {
ofld_rxq->iq.flags |= IQ_INTR;
- rc = alloc_ofld_rxq(pi, ofld_rxq, intr_idx, i, oid);
- if (rc != 0)
- goto done;
- intr_idx++;
- }
- }
-#endif
-#ifdef DEV_NETMAP
- /*
- * We don't have buffers to back the netmap rx queues right now so we
- * create the queues in a way that doesn't set off any congestion signal
- * in the chip.
- */
- if (pi->flags & INTR_NM_RXQ) {
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "nm_rxq",
- CTLFLAG_RD, NULL, "rx queues for netmap");
- for_each_nm_rxq(pi, i, nm_rxq) {
- rc = alloc_nm_rxq(pi, nm_rxq, intr_idx, i, oid);
+ rc = alloc_ofld_rxq(vi, ofld_rxq, intr_idx, i, oid);
if (rc != 0)
goto done;
intr_idx++;
@@ -1047,88 +1027,73 @@ t4_setup_port_queues(struct port_info *pi)
* their interrupts are allocated now.
*/
j = 0;
- if (!(pi->flags & INTR_RXQ)) {
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "rxq",
+ if (!(vi->flags & INTR_RXQ)) {
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq",
CTLFLAG_RD, NULL, "rx queues");
- for_each_rxq(pi, i, rxq) {
+ for_each_rxq(vi, i, rxq) {
MPASS(!(rxq->iq.flags & IQ_INTR));
- intr_idx = port_intr_iq(pi, j)->abs_id;
+ intr_idx = vi_intr_iq(vi, j)->abs_id;
- rc = alloc_rxq(pi, rxq, intr_idx, i, oid);
+ rc = alloc_rxq(vi, rxq, intr_idx, i, oid);
if (rc != 0)
goto done;
j++;
}
}
#ifdef TCP_OFFLOAD
- if (is_offload(sc) && !(pi->flags & INTR_OFLD_RXQ)) {
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "ofld_rxq",
+ if (vi->nofldrxq != 0 && !(vi->flags & INTR_OFLD_RXQ)) {
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq",
CTLFLAG_RD, NULL,
"rx queues for offloaded TCP connections");
- for_each_ofld_rxq(pi, i, ofld_rxq) {
+ for_each_ofld_rxq(vi, i, ofld_rxq) {
MPASS(!(ofld_rxq->iq.flags & IQ_INTR));
- intr_idx = port_intr_iq(pi, j)->abs_id;
+ intr_idx = vi_intr_iq(vi, j)->abs_id;
- rc = alloc_ofld_rxq(pi, ofld_rxq, intr_idx, i, oid);
+ rc = alloc_ofld_rxq(vi, ofld_rxq, intr_idx, i, oid);
if (rc != 0)
goto done;
j++;
}
}
#endif
-#ifdef DEV_NETMAP
- if (!(pi->flags & INTR_NM_RXQ))
- CXGBE_UNIMPLEMENTED(__func__);
-#endif
/*
* Now the tx queues. Only one pass needed.
*/
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "txq", CTLFLAG_RD,
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "txq", CTLFLAG_RD,
NULL, "tx queues");
j = 0;
- for_each_txq(pi, i, txq) {
- iqid = port_intr_iq(pi, j)->cntxt_id;
+ for_each_txq(vi, i, txq) {
+ iqid = vi_intr_iq(vi, j)->cntxt_id;
snprintf(name, sizeof(name), "%s txq%d",
- device_get_nameunit(pi->dev), i);
- init_eq(&txq->eq, EQ_ETH, pi->qsize_txq, pi->tx_chan, iqid,
+ device_get_nameunit(vi->dev), i);
+ init_eq(&txq->eq, EQ_ETH, vi->qsize_txq, pi->tx_chan, iqid,
name);
- rc = alloc_txq(pi, txq, i, oid);
+ rc = alloc_txq(vi, txq, i, oid);
if (rc != 0)
goto done;
j++;
}
#ifdef TCP_OFFLOAD
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "ofld_txq",
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_txq",
CTLFLAG_RD, NULL, "tx queues for offloaded TCP connections");
- for_each_ofld_txq(pi, i, ofld_txq) {
+ for_each_ofld_txq(vi, i, ofld_txq) {
struct sysctl_oid *oid2;
- iqid = port_intr_iq(pi, j)->cntxt_id;
+ iqid = vi_intr_iq(vi, j)->cntxt_id;
snprintf(name, sizeof(name), "%s ofld_txq%d",
- device_get_nameunit(pi->dev), i);
- init_eq(&ofld_txq->eq, EQ_OFLD, pi->qsize_txq, pi->tx_chan,
+ device_get_nameunit(vi->dev), i);
+ init_eq(&ofld_txq->eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan,
iqid, name);
snprintf(name, sizeof(name), "%d", i);
- oid2 = SYSCTL_ADD_NODE(&pi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+ oid2 = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
name, CTLFLAG_RD, NULL, "offload tx queue");
- rc = alloc_wrq(sc, pi, ofld_txq, oid2);
- if (rc != 0)
- goto done;
- j++;
- }
-#endif
-#ifdef DEV_NETMAP
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "nm_txq",
- CTLFLAG_RD, NULL, "tx queues for netmap use");
- for_each_nm_txq(pi, i, nm_txq) {
- iqid = pi->first_nm_rxq + (j % pi->nnmrxq);
- rc = alloc_nm_txq(pi, nm_txq, iqid, i, oid);
+ rc = alloc_wrq(sc, vi, ofld_txq, oid2);
if (rc != 0)
goto done;
j++;
@@ -1138,17 +1103,19 @@ t4_setup_port_queues(struct port_info *pi)
/*
* Finally, the control queue.
*/
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "ctrlq", CTLFLAG_RD,
+ if (!IS_MAIN_VI(vi))
+ goto done;
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ctrlq", CTLFLAG_RD,
NULL, "ctrl queue");
ctrlq = &sc->sge.ctrlq[pi->port_id];
- iqid = port_intr_iq(pi, 0)->cntxt_id;
- snprintf(name, sizeof(name), "%s ctrlq", device_get_nameunit(pi->dev));
+ iqid = vi_intr_iq(vi, 0)->cntxt_id;
+ snprintf(name, sizeof(name), "%s ctrlq", device_get_nameunit(vi->dev));
init_eq(&ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, pi->tx_chan, iqid, name);
- rc = alloc_wrq(sc, pi, ctrlq, oid);
+ rc = alloc_wrq(sc, vi, ctrlq, oid);
done:
if (rc)
- t4_teardown_port_queues(pi);
+ t4_teardown_vi_queues(vi);
return (rc);
}
@@ -1157,9 +1124,10 @@ done:
* Idempotent
*/
int
-t4_teardown_port_queues(struct port_info *pi)
+t4_teardown_vi_queues(struct vi_info *vi)
{
int i;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
struct sge_rxq *rxq;
struct sge_txq *txq;
@@ -1173,63 +1141,69 @@ t4_teardown_port_queues(struct port_info *pi)
#endif
/* Do this before freeing the queues */
- if (pi->flags & PORT_SYSCTL_CTX) {
- sysctl_ctx_free(&pi->ctx);
- pi->flags &= ~PORT_SYSCTL_CTX;
+ if (vi->flags & VI_SYSCTL_CTX) {
+ sysctl_ctx_free(&vi->ctx);
+ vi->flags &= ~VI_SYSCTL_CTX;
+ }
+
+#ifdef DEV_NETMAP
+ if (vi->flags & VI_NETMAP) {
+ for_each_nm_txq(vi, i, nm_txq) {
+ free_nm_txq(vi, nm_txq);
+ }
+
+ for_each_nm_rxq(vi, i, nm_rxq) {
+ free_nm_rxq(vi, nm_rxq);
+ }
+ return (0);
}
+#endif
/*
* Take down all the tx queues first, as they reference the rx queues
* (for egress updates, etc.).
*/
- free_wrq(sc, &sc->sge.ctrlq[pi->port_id]);
+ if (IS_MAIN_VI(vi))
+ free_wrq(sc, &sc->sge.ctrlq[pi->port_id]);
- for_each_txq(pi, i, txq) {
- free_txq(pi, txq);
+ for_each_txq(vi, i, txq) {
+ free_txq(vi, txq);
}
#ifdef TCP_OFFLOAD
- for_each_ofld_txq(pi, i, ofld_txq) {
+ for_each_ofld_txq(vi, i, ofld_txq) {
free_wrq(sc, ofld_txq);
}
#endif
-#ifdef DEV_NETMAP
- for_each_nm_txq(pi, i, nm_txq)
- free_nm_txq(pi, nm_txq);
-#endif
/*
* Then take down the rx queues that forward their interrupts, as they
* reference other rx queues.
*/
- for_each_rxq(pi, i, rxq) {
+ for_each_rxq(vi, i, rxq) {
if ((rxq->iq.flags & IQ_INTR) == 0)
- free_rxq(pi, rxq);
+ free_rxq(vi, rxq);
}
#ifdef TCP_OFFLOAD
- for_each_ofld_rxq(pi, i, ofld_rxq) {
+ for_each_ofld_rxq(vi, i, ofld_rxq) {
if ((ofld_rxq->iq.flags & IQ_INTR) == 0)
- free_ofld_rxq(pi, ofld_rxq);
+ free_ofld_rxq(vi, ofld_rxq);
}
#endif
-#ifdef DEV_NETMAP
- for_each_nm_rxq(pi, i, nm_rxq)
- free_nm_rxq(pi, nm_rxq);
-#endif
/*
* Then take down the rx queues that take direct interrupts.
*/
- for_each_rxq(pi, i, rxq) {
+ for_each_rxq(vi, i, rxq) {
if (rxq->iq.flags & IQ_INTR)
- free_rxq(pi, rxq);
+ free_rxq(vi, rxq);
}
#ifdef TCP_OFFLOAD
- for_each_ofld_rxq(pi, i, ofld_rxq) {
+ for_each_ofld_rxq(vi, i, ofld_rxq) {
if (ofld_rxq->iq.flags & IQ_INTR)
- free_ofld_rxq(pi, ofld_rxq);
+ free_ofld_rxq(vi, ofld_rxq);
}
#endif
@@ -1892,8 +1866,8 @@ t4_wrq_tx_locked(struct adapter *sc, struct sge_wrq *wrq, struct wrqe *wr)
void
t4_update_fl_bufsize(struct ifnet *ifp)
{
- struct port_info *pi = ifp->if_softc;
- struct adapter *sc = pi->adapter;
+ struct vi_info *vi = ifp->if_softc;
+ struct adapter *sc = vi->pi->adapter;
struct sge_rxq *rxq;
#ifdef TCP_OFFLOAD
struct sge_ofld_rxq *ofld_rxq;
@@ -1902,7 +1876,7 @@ t4_update_fl_bufsize(struct ifnet *ifp)
int i, maxp, mtu = ifp->if_mtu;
maxp = mtu_to_max_payload(sc, mtu, 0);
- for_each_rxq(pi, i, rxq) {
+ for_each_rxq(vi, i, rxq) {
fl = &rxq->fl;
FL_LOCK(fl);
@@ -1911,7 +1885,7 @@ t4_update_fl_bufsize(struct ifnet *ifp)
}
#ifdef TCP_OFFLOAD
maxp = mtu_to_max_payload(sc, mtu, 1);
- for_each_ofld_rxq(pi, i, ofld_rxq) {
+ for_each_ofld_rxq(vi, i, ofld_rxq) {
fl = &ofld_rxq->fl;
FL_LOCK(fl);
@@ -2333,7 +2307,8 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx)
struct sge_txq *txq = r->cookie;
struct sge_eq *eq = &txq->eq;
struct ifnet *ifp = txq->ifp;
- struct port_info *pi = (void *)ifp->if_softc;
+ struct vi_info *vi = ifp->if_softc;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
u_int total, remaining; /* # of packets */
u_int available, dbdiff; /* # of hardware descriptors */
@@ -2561,12 +2536,13 @@ free_ring(struct adapter *sc, bus_dma_tag_t tag, bus_dmamap_t map,
* the abs_id of the ingress queue to which its interrupts should be forwarded.
*/
static int
-alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
+alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl,
int intr_idx, int cong)
{
int rc, i, cntxt_id;
size_t len;
struct fw_iq_cmd c;
+ struct port_info *pi = vi->pi;
struct adapter *sc = iq->adapter;
__be32 v = 0;
@@ -2597,7 +2573,7 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
c.type_to_iqandstindex = htobe32(v |
V_FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) |
- V_FW_IQ_CMD_VIID(pi->viid) |
+ V_FW_IQ_CMD_VIID(vi->viid) |
V_FW_IQ_CMD_IQANUD(X_UPDATEDELIVERY_INTERRUPT));
c.iqdroprss_to_iqesize = htobe16(V_FW_IQ_CMD_IQPCIECH(pi->tx_chan) |
F_FW_IQ_CMD_IQGTSMODE |
@@ -2749,7 +2725,7 @@ alloc_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl,
}
static int
-free_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl)
+free_iq_fl(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl)
{
int rc;
struct adapter *sc = iq->adapter;
@@ -2758,7 +2734,7 @@ free_iq_fl(struct port_info *pi, struct sge_iq *iq, struct sge_fl *fl)
if (sc == NULL)
return (0); /* nothing to do */
- dev = pi ? pi->dev : sc->dev;
+ dev = vi ? vi->dev : sc->dev;
if (iq->flags & IQ_ALLOCATED) {
rc = -t4_iq_free(sc, sc->mbox, sc->pf, 0,
@@ -2840,7 +2816,7 @@ alloc_fwq(struct adapter *sc)
init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE);
fwq->flags |= IQ_INTR; /* always */
intr_idx = sc->intr_count > 1 ? 1 : 0;
- rc = alloc_iq_fl(sc->port[0], fwq, NULL, intr_idx, -1);
+ rc = alloc_iq_fl(&sc->port[0]->vi[0], fwq, NULL, intr_idx, -1);
if (rc != 0) {
device_printf(sc->dev,
"failed to create firmware event queue: %d\n", rc);
@@ -2915,15 +2891,15 @@ tnl_cong(struct port_info *pi, int drop)
}
static int
-alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx,
+alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int intr_idx, int idx,
struct sysctl_oid *oid)
{
int rc;
struct sysctl_oid_list *children;
char name[16];
- rc = alloc_iq_fl(pi, &rxq->iq, &rxq->fl, intr_idx,
- tnl_cong(pi, cong_drop));
+ rc = alloc_iq_fl(vi, &rxq->iq, &rxq->fl, intr_idx,
+ tnl_cong(vi->pi, cong_drop));
if (rc != 0)
return (rc);
@@ -2932,55 +2908,55 @@ alloc_rxq(struct port_info *pi, struct sge_rxq *rxq, int intr_idx, int idx,
* fill it up a bit more.
*/
FL_LOCK(&rxq->fl);
- refill_fl(pi->adapter, &rxq->fl, 128);
+ refill_fl(vi->pi->adapter, &rxq->fl, 128);
FL_UNLOCK(&rxq->fl);
#if defined(INET) || defined(INET6)
rc = tcp_lro_init(&rxq->lro);
if (rc != 0)
return (rc);
- rxq->lro.ifp = pi->ifp; /* also indicates LRO init'ed */
+ rxq->lro.ifp = vi->ifp; /* also indicates LRO init'ed */
- if (pi->ifp->if_capenable & IFCAP_LRO)
+ if (vi->ifp->if_capenable & IFCAP_LRO)
rxq->iq.flags |= IQ_LRO_ENABLED;
#endif
- rxq->ifp = pi->ifp;
+ rxq->ifp = vi->ifp;
children = SYSCTL_CHILDREN(oid);
snprintf(name, sizeof(name), "%d", idx);
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "abs_id",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.abs_id, 0, sysctl_uint16, "I",
"absolute id of the queue");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cntxt_id",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cntxt_id",
CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cntxt_id, 0, sysctl_uint16, "I",
"SGE context id of the queue");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx",
CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cidx, 0, sysctl_uint16, "I",
"consumer index");
#if defined(INET) || defined(INET6)
- SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD,
+ SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD,
&rxq->lro.lro_queued, 0, NULL);
- SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_flushed", CTLFLAG_RD,
+ SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "lro_flushed", CTLFLAG_RD,
&rxq->lro.lro_flushed, 0, NULL);
#endif
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "rxcsum", CTLFLAG_RD,
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "rxcsum", CTLFLAG_RD,
&rxq->rxcsum, "# of times hardware assisted with checksum");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "vlan_extraction",
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vlan_extraction",
CTLFLAG_RD, &rxq->vlan_extraction,
"# of times hardware extracted 802.1Q tag");
- add_fl_sysctls(&pi->ctx, oid, &rxq->fl);
+ add_fl_sysctls(&vi->ctx, oid, &rxq->fl);
return (rc);
}
static int
-free_rxq(struct port_info *pi, struct sge_rxq *rxq)
+free_rxq(struct vi_info *vi, struct sge_rxq *rxq)
{
int rc;
@@ -2991,7 +2967,7 @@ free_rxq(struct port_info *pi, struct sge_rxq *rxq)
}
#endif
- rc = free_iq_fl(pi, &rxq->iq, &rxq->fl);
+ rc = free_iq_fl(vi, &rxq->iq, &rxq->fl);
if (rc == 0)
bzero(rxq, sizeof(*rxq));
@@ -3000,46 +2976,46 @@ free_rxq(struct port_info *pi, struct sge_rxq *rxq)
#ifdef TCP_OFFLOAD
static int
-alloc_ofld_rxq(struct port_info *pi, struct sge_ofld_rxq *ofld_rxq,
+alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq,
int intr_idx, int idx, struct sysctl_oid *oid)
{
int rc;
struct sysctl_oid_list *children;
char name[16];
- rc = alloc_iq_fl(pi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx,
- pi->rx_chan_map);
+ rc = alloc_iq_fl(vi, &ofld_rxq->iq, &ofld_rxq->fl, intr_idx,
+ vi->pi->rx_chan_map);
if (rc != 0)
return (rc);
children = SYSCTL_CHILDREN(oid);
snprintf(name, sizeof(name), "%d", idx);
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
NULL, "rx queue");
children = SYSCTL_CHILDREN(oid);
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "abs_id",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "abs_id",
CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.abs_id, 0, sysctl_uint16,
"I", "absolute id of the queue");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cntxt_id",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cntxt_id",
CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.cntxt_id, 0, sysctl_uint16,
"I", "SGE context id of the queue");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx",
CTLTYPE_INT | CTLFLAG_RD, &ofld_rxq->iq.cidx, 0, sysctl_uint16, "I",
"consumer index");
- add_fl_sysctls(&pi->ctx, oid, &ofld_rxq->fl);
+ add_fl_sysctls(&vi->ctx, oid, &ofld_rxq->fl);
return (rc);
}
static int
-free_ofld_rxq(struct port_info *pi, struct sge_ofld_rxq *ofld_rxq)
+free_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq)
{
int rc;
- rc = free_iq_fl(pi, &ofld_rxq->iq, &ofld_rxq->fl);
+ rc = free_iq_fl(vi, &ofld_rxq->iq, &ofld_rxq->fl);
if (rc == 0)
bzero(ofld_rxq, sizeof(*ofld_rxq));
@@ -3049,7 +3025,7 @@ free_ofld_rxq(struct port_info *pi, struct sge_ofld_rxq *ofld_rxq)
#ifdef DEV_NETMAP
static int
-alloc_nm_rxq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int intr_idx,
+alloc_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int intr_idx,
int idx, struct sysctl_oid *oid)
{
int rc;
@@ -3057,12 +3033,12 @@ alloc_nm_rxq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int intr_idx,
struct sysctl_ctx_list *ctx;
char name[16];
size_t len;
- struct adapter *sc = pi->adapter;
- struct netmap_adapter *na = NA(pi->nm_ifp);
+ struct adapter *sc = vi->pi->adapter;
+ struct netmap_adapter *na = NA(vi->ifp);
MPASS(na != NULL);
- len = pi->qsize_rxq * IQ_ESIZE;
+ len = vi->qsize_rxq * IQ_ESIZE;
rc = alloc_ring(sc, len, &nm_rxq->iq_desc_tag, &nm_rxq->iq_desc_map,
&nm_rxq->iq_ba, (void **)&nm_rxq->iq_desc);
if (rc != 0)
@@ -3074,16 +3050,16 @@ alloc_nm_rxq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int intr_idx,
if (rc != 0)
return (rc);
- nm_rxq->pi = pi;
+ nm_rxq->vi = vi;
nm_rxq->nid = idx;
nm_rxq->iq_cidx = 0;
- nm_rxq->iq_sidx = pi->qsize_rxq - spg_len / IQ_ESIZE;
+ nm_rxq->iq_sidx = vi->qsize_rxq - spg_len / IQ_ESIZE;
nm_rxq->iq_gen = F_RSPD_GEN;
nm_rxq->fl_pidx = nm_rxq->fl_cidx = 0;
nm_rxq->fl_sidx = na->num_rx_desc;
nm_rxq->intr_idx = intr_idx;
- ctx = &pi->ctx;
+ ctx = &vi->ctx;
children = SYSCTL_CHILDREN(oid);
snprintf(name, sizeof(name), "%d", idx);
@@ -3119,9 +3095,9 @@ alloc_nm_rxq(struct port_info *pi, struct sge_nm_rxq *nm_rxq, int intr_idx,
static int
-free_nm_rxq(struct port_info *pi, struct sge_nm_rxq *nm_rxq)
+free_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq)
{
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
free_ring(sc, nm_rxq->iq_desc_tag, nm_rxq->iq_desc_map, nm_rxq->iq_ba,
nm_rxq->iq_desc);
@@ -3132,13 +3108,14 @@ free_nm_rxq(struct port_info *pi, struct sge_nm_rxq *nm_rxq)
}
static int
-alloc_nm_txq(struct port_info *pi, struct sge_nm_txq *nm_txq, int iqidx, int idx,
+alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq, int iqidx, int idx,
struct sysctl_oid *oid)
{
int rc;
size_t len;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
- struct netmap_adapter *na = NA(pi->nm_ifp);
+ struct netmap_adapter *na = NA(vi->ifp);
char name[16];
struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid);
@@ -3153,19 +3130,20 @@ alloc_nm_txq(struct port_info *pi, struct sge_nm_txq *nm_txq, int iqidx, int idx
nm_txq->nid = idx;
nm_txq->iqidx = iqidx;
nm_txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) |
- V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf));
+ V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) |
+ V_TXPKT_VF(vi->viid));
snprintf(name, sizeof(name), "%d", idx);
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
NULL, "netmap tx queue");
children = SYSCTL_CHILDREN(oid);
- SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
+ SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
&nm_txq->cntxt_id, 0, "SGE context id of the queue");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx",
CTLTYPE_INT | CTLFLAG_RD, &nm_txq->cidx, 0, sysctl_uint16, "I",
"consumer index");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "pidx",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "pidx",
CTLTYPE_INT | CTLFLAG_RD, &nm_txq->pidx, 0, sysctl_uint16, "I",
"producer index");
@@ -3173,9 +3151,9 @@ alloc_nm_txq(struct port_info *pi, struct sge_nm_txq *nm_txq, int iqidx, int idx
}
static int
-free_nm_txq(struct port_info *pi, struct sge_nm_txq *nm_txq)
+free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_txq)
{
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
free_ring(sc, nm_txq->desc_tag, nm_txq->desc_map, nm_txq->ba,
nm_txq->desc);
@@ -3229,7 +3207,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq)
}
static int
-eth_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
+eth_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq)
{
int rc, cntxt_id;
struct fw_eq_eth_cmd c;
@@ -3243,7 +3221,7 @@ eth_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
c.alloc_to_len16 = htobe32(F_FW_EQ_ETH_CMD_ALLOC |
F_FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c));
c.autoequiqe_to_viid = htobe32(F_FW_EQ_ETH_CMD_AUTOEQUIQE |
- F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(pi->viid));
+ F_FW_EQ_ETH_CMD_AUTOEQUEQE | V_FW_EQ_ETH_CMD_VIID(vi->viid));
c.fetchszm_to_iqid =
htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) |
V_FW_EQ_ETH_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_ETH_CMD_FETCHRO |
@@ -3255,7 +3233,7 @@ eth_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
rc = -t4_wr_mbox(sc, sc->mbox, &c, sizeof(c), &c);
if (rc != 0) {
- device_printf(pi->dev,
+ device_printf(vi->dev,
"failed to create Ethernet egress queue: %d\n", rc);
return (rc);
}
@@ -3273,7 +3251,7 @@ eth_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
#ifdef TCP_OFFLOAD
static int
-ofld_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
+ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq)
{
int rc, cntxt_id;
struct fw_eq_ofld_cmd c;
@@ -3298,7 +3276,7 @@ ofld_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
rc = -t4_wr_mbox(sc, sc->mbox, &c, sizeof(c), &c);
if (rc != 0) {
- device_printf(pi->dev,
+ device_printf(vi->dev,
"failed to create egress queue for TCP offload: %d\n", rc);
return (rc);
}
@@ -3316,7 +3294,7 @@ ofld_eq_alloc(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
#endif
static int
-alloc_eq(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
+alloc_eq(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq)
{
int rc, qsize;
size_t len;
@@ -3340,12 +3318,12 @@ alloc_eq(struct adapter *sc, struct port_info *pi, struct sge_eq *eq)
break;
case EQ_ETH:
- rc = eth_eq_alloc(sc, pi, eq);
+ rc = eth_eq_alloc(sc, vi, eq);
break;
#ifdef TCP_OFFLOAD
case EQ_OFLD:
- rc = ofld_eq_alloc(sc, pi, eq);
+ rc = ofld_eq_alloc(sc, vi, eq);
break;
#endif
@@ -3428,14 +3406,14 @@ free_eq(struct adapter *sc, struct sge_eq *eq)
}
static int
-alloc_wrq(struct adapter *sc, struct port_info *pi, struct sge_wrq *wrq,
+alloc_wrq(struct adapter *sc, struct vi_info *vi, struct sge_wrq *wrq,
struct sysctl_oid *oid)
{
int rc;
- struct sysctl_ctx_list *ctx = pi ? &pi->ctx : &sc->ctx;
+ struct sysctl_ctx_list *ctx = vi ? &vi->ctx : &sc->ctx;
struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid);
- rc = alloc_eq(sc, pi, &wrq->eq);
+ rc = alloc_eq(sc, vi, &wrq->eq);
if (rc)
return (rc);
@@ -3476,10 +3454,11 @@ free_wrq(struct adapter *sc, struct sge_wrq *wrq)
}
static int
-alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx,
+alloc_txq(struct vi_info *vi, struct sge_txq *txq, int idx,
struct sysctl_oid *oid)
{
int rc;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
struct sge_eq *eq = &txq->eq;
char name[16];
@@ -3492,7 +3471,7 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx,
return (rc);
}
- rc = alloc_eq(sc, pi, eq);
+ rc = alloc_eq(sc, vi, eq);
if (rc != 0) {
mp_ring_free(txq->r);
txq->r = NULL;
@@ -3502,69 +3481,70 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx,
/* Can't fail after this point. */
TASK_INIT(&txq->tx_reclaim_task, 0, tx_reclaim, eq);
- txq->ifp = pi->ifp;
+ txq->ifp = vi->ifp;
txq->gl = sglist_alloc(TX_SGL_SEGS, M_WAITOK);
txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) |
- V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf));
+ V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_VF_VLD(1) |
+ V_TXPKT_VF(vi->viid));
txq->sdesc = malloc(eq->sidx * sizeof(struct tx_sdesc), M_CXGBE,
M_ZERO | M_WAITOK);
snprintf(name, sizeof(name), "%d", idx);
- oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
+ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD,
NULL, "tx queue");
children = SYSCTL_CHILDREN(oid);
- SYSCTL_ADD_UINT(&pi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
+ SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD,
&eq->cntxt_id, 0, "SGE context id of the queue");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx",
CTLTYPE_INT | CTLFLAG_RD, &eq->cidx, 0, sysctl_uint16, "I",
"consumer index");
- SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "pidx",
+ SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "pidx",
CTLTYPE_INT | CTLFLAG_RD, &eq->pidx, 0, sysctl_uint16, "I",
"producer index");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txcsum", CTLFLAG_RD,
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txcsum", CTLFLAG_RD,
&txq->txcsum, "# of times hardware assisted with checksum");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "vlan_insertion",
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "vlan_insertion",
CTLFLAG_RD, &txq->vlan_insertion,
"# of times hardware inserted 802.1Q tag");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "tso_wrs", CTLFLAG_RD,
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "tso_wrs", CTLFLAG_RD,
&txq->tso_wrs, "# of TSO work requests");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "imm_wrs", CTLFLAG_RD,
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "imm_wrs", CTLFLAG_RD,
&txq->imm_wrs, "# of work requests with immediate data");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "sgl_wrs", CTLFLAG_RD,
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "sgl_wrs", CTLFLAG_RD,
&txq->sgl_wrs, "# of work requests with direct SGL");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txpkt_wrs", CTLFLAG_RD,
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkt_wrs", CTLFLAG_RD,
&txq->txpkt_wrs, "# of txpkt work requests (one pkt/WR)");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txpkts0_wrs",
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts0_wrs",
CTLFLAG_RD, &txq->txpkts0_wrs,
"# of txpkts (type 0) work requests");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txpkts1_wrs",
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts1_wrs",
CTLFLAG_RD, &txq->txpkts1_wrs,
"# of txpkts (type 1) work requests");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txpkts0_pkts",
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts0_pkts",
CTLFLAG_RD, &txq->txpkts0_pkts,
"# of frames tx'd using type0 txpkts work requests");
- SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "txpkts1_pkts",
+ SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txpkts1_pkts",
CTLFLAG_RD, &txq->txpkts1_pkts,
"# of frames tx'd using type1 txpkts work requests");
- SYSCTL_ADD_COUNTER_U64(&pi->ctx, children, OID_AUTO, "r_enqueues",
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "r_enqueues",
CTLFLAG_RD, &txq->r->enqueues,
"# of enqueues to the mp_ring for this queue");
- SYSCTL_ADD_COUNTER_U64(&pi->ctx, children, OID_AUTO, "r_drops",
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "r_drops",
CTLFLAG_RD, &txq->r->drops,
"# of drops in the mp_ring for this queue");
- SYSCTL_ADD_COUNTER_U64(&pi->ctx, children, OID_AUTO, "r_starts",
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "r_starts",
CTLFLAG_RD, &txq->r->starts,
"# of normal consumer starts in the mp_ring for this queue");
- SYSCTL_ADD_COUNTER_U64(&pi->ctx, children, OID_AUTO, "r_stalls",
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "r_stalls",
CTLFLAG_RD, &txq->r->stalls,
"# of consumer stalls in the mp_ring for this queue");
- SYSCTL_ADD_COUNTER_U64(&pi->ctx, children, OID_AUTO, "r_restarts",
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "r_restarts",
CTLFLAG_RD, &txq->r->restarts,
"# of consumer restarts in the mp_ring for this queue");
- SYSCTL_ADD_COUNTER_U64(&pi->ctx, children, OID_AUTO, "r_abdications",
+ SYSCTL_ADD_COUNTER_U64(&vi->ctx, children, OID_AUTO, "r_abdications",
CTLFLAG_RD, &txq->r->abdications,
"# of consumer abdications in the mp_ring for this queue");
@@ -3572,10 +3552,10 @@ alloc_txq(struct port_info *pi, struct sge_txq *txq, int idx,
}
static int
-free_txq(struct port_info *pi, struct sge_txq *txq)
+free_txq(struct vi_info *vi, struct sge_txq *txq)
{
int rc;
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
struct sge_eq *eq = &txq->eq;
rc = free_eq(sc, eq);
@@ -3755,7 +3735,7 @@ refill_sfl(void *arg)
struct adapter *sc = arg;
struct sge_fl *fl, *fl_temp;
- mtx_lock(&sc->sfl_lock);
+ mtx_assert(&sc->sfl_lock, MA_OWNED);
TAILQ_FOREACH_SAFE(fl, &sc->sfl, link, fl_temp) {
FL_LOCK(fl);
refill_fl(sc, fl, 64);
@@ -3768,7 +3748,6 @@ refill_sfl(void *arg)
if (!TAILQ_EMPTY(&sc->sfl))
callout_schedule(&sc->sfl_callout, hz / 5);
- mtx_unlock(&sc->sfl_lock);
}
static int
diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c
index fae7979..d3841aa 100644
--- a/sys/dev/cxgbe/tom/t4_connect.c
+++ b/sys/dev/cxgbe/tom/t4_connect.c
@@ -233,7 +233,7 @@ static uint32_t
calc_opt2a(struct socket *so, struct toepcb *toep)
{
struct tcpcb *tp = so_sototcpcb(so);
- struct port_info *pi = toep->port;
+ struct port_info *pi = toep->vi->pi;
struct adapter *sc = pi->adapter;
uint32_t opt2;
@@ -321,7 +321,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
struct toepcb *toep = NULL;
struct wrqe *wr = NULL;
struct ifnet *rt_ifp = rt->rt_ifp;
- struct port_info *pi;
+ struct vi_info *vi;
int mtu_idx, rscale, qid_atid, rc, isipv6;
struct inpcb *inp = sotoinpcb(so);
struct tcpcb *tp = intotcpcb(inp);
@@ -332,17 +332,17 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
("%s: dest addr %p has family %u", __func__, nam, nam->sa_family));
if (rt_ifp->if_type == IFT_ETHER)
- pi = rt_ifp->if_softc;
+ vi = rt_ifp->if_softc;
else if (rt_ifp->if_type == IFT_L2VLAN) {
struct ifnet *ifp = VLAN_COOKIE(rt_ifp);
- pi = ifp->if_softc;
+ vi = ifp->if_softc;
} else if (rt_ifp->if_type == IFT_IEEE8023ADLAG)
DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */
else
DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP);
- toep = alloc_toepcb(pi, -1, -1, M_NOWAIT);
+ toep = alloc_toepcb(vi, -1, -1, M_NOWAIT);
if (toep == NULL)
DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM);
@@ -350,7 +350,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
if (toep->tid < 0)
DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM);
- toep->l2te = t4_l2t_get(pi, rt_ifp,
+ toep->l2te = t4_l2t_get(vi->pi, rt_ifp,
rt->rt_flags & RTF_GATEWAY ? rt->rt_gateway : nam);
if (toep->l2te == NULL)
DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM);
@@ -398,13 +398,13 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
if (is_t4(sc)) {
INIT_TP_WR(cpl, 0);
- cpl->params = select_ntuple(pi, toep->l2te);
+ cpl->params = select_ntuple(vi, toep->l2te);
} else {
struct cpl_t5_act_open_req6 *c5 = (void *)cpl;
INIT_TP_WR(c5, 0);
c5->iss = htobe32(tp->iss);
- c5->params = select_ntuple(pi, toep->l2te);
+ c5->params = select_ntuple(vi, toep->l2te);
}
OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ6,
qid_atid));
@@ -414,7 +414,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
cpl->peer_port = inp->inp_fport;
cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0];
cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8];
- cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale,
+ cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale,
toep->rx_credits, toep->ulp_mode);
cpl->opt2 = calc_opt2a(so, toep);
} else {
@@ -422,19 +422,19 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
if (is_t4(sc)) {
INIT_TP_WR(cpl, 0);
- cpl->params = select_ntuple(pi, toep->l2te);
+ cpl->params = select_ntuple(vi, toep->l2te);
} else {
struct cpl_t5_act_open_req *c5 = (void *)cpl;
INIT_TP_WR(c5, 0);
c5->iss = htobe32(tp->iss);
- c5->params = select_ntuple(pi, toep->l2te);
+ c5->params = select_ntuple(vi, toep->l2te);
}
OPCODE_TID(cpl) = htobe32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ,
qid_atid));
inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port,
&cpl->peer_ip, &cpl->peer_port);
- cpl->opt0 = calc_opt0(so, pi, toep->l2te, mtu_idx, rscale,
+ cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale,
toep->rx_credits, toep->ulp_mode);
cpl->opt2 = calc_opt2a(so, toep);
}
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index efd683b..c91c994 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -104,9 +104,10 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp)
struct wrqe *wr;
struct fw_flowc_wr *flowc;
unsigned int nparams = ftxp ? 8 : 6, flowclen;
- struct port_info *pi = toep->port;
+ struct vi_info *vi = toep->vi;
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
- unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN;
+ unsigned int pfvf = G_FW_VIID_PFN(vi->viid) << S_FW_VIID_PFN;
struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx];
KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT),
@@ -513,7 +514,7 @@ write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen,
if (txalign > 0) {
struct tcpcb *tp = intotcpcb(toep->inp);
- if (plen < 2 * tp->t_maxseg || is_10G_port(toep->port))
+ if (plen < 2 * tp->t_maxseg || is_10G_port(toep->vi->pi))
txwr->lsodisable_to_flags |=
htobe32(F_FW_OFLD_TX_DATA_WR_LSODISABLE);
else
diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c
index 127abe0..187a9f8 100644
--- a/sys/dev/cxgbe/tom/t4_listen.c
+++ b/sys/dev/cxgbe/tom/t4_listen.c
@@ -72,7 +72,7 @@ static void free_stid(struct adapter *, struct listen_ctx *);
/* lctx services */
static struct listen_ctx *alloc_lctx(struct adapter *, struct inpcb *,
- struct port_info *);
+ struct vi_info *);
static int free_lctx(struct adapter *, struct listen_ctx *);
static void hold_lctx(struct listen_ctx *);
static void listen_hash_add(struct adapter *, struct listen_ctx *);
@@ -80,7 +80,7 @@ static struct listen_ctx *listen_hash_find(struct adapter *, struct inpcb *);
static struct listen_ctx *listen_hash_del(struct adapter *, struct inpcb *);
static struct inpcb *release_lctx(struct adapter *, struct listen_ctx *);
-static inline void save_qids_in_mbuf(struct mbuf *, struct port_info *);
+static inline void save_qids_in_mbuf(struct mbuf *, struct vi_info *);
static inline void get_qids_from_mbuf(struct mbuf *m, int *, int *);
static void send_reset_synqe(struct toedev *, struct synq_entry *);
@@ -187,7 +187,7 @@ free_stid(struct adapter *sc, struct listen_ctx *lctx)
}
static struct listen_ctx *
-alloc_lctx(struct adapter *sc, struct inpcb *inp, struct port_info *pi)
+alloc_lctx(struct adapter *sc, struct inpcb *inp, struct vi_info *vi)
{
struct listen_ctx *lctx;
@@ -214,8 +214,8 @@ alloc_lctx(struct adapter *sc, struct inpcb *inp, struct port_info *pi)
}
}
- lctx->ctrlq = &sc->sge.ctrlq[pi->port_id];
- lctx->ofld_rxq = &sc->sge.ofld_rxq[pi->first_ofld_rxq];
+ lctx->ctrlq = &sc->sge.ctrlq[vi->pi->port_id];
+ lctx->ofld_rxq = &sc->sge.ofld_rxq[vi->first_ofld_rxq];
refcount_init(&lctx->refcount, 1);
TAILQ_INIT(&lctx->synq);
@@ -346,7 +346,8 @@ send_reset_synqe(struct toedev *tod, struct synq_entry *synqe)
struct adapter *sc = tod->tod_softc;
struct mbuf *m = synqe->syn;
struct ifnet *ifp = m->m_pkthdr.rcvif;
- struct port_info *pi = ifp->if_softc;
+ struct vi_info *vi = ifp->if_softc;
+ struct port_info *pi = vi->pi;
struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx];
struct wrqe *wr;
struct fw_flowc_wr *flowc;
@@ -355,7 +356,7 @@ send_reset_synqe(struct toedev *tod, struct synq_entry *synqe)
struct sge_wrq *ofld_txq;
struct sge_ofld_rxq *ofld_rxq;
const int nparams = 6;
- unsigned int pfvf = G_FW_VIID_PFN(pi->viid) << S_FW_VIID_PFN;
+ unsigned int pfvf = G_FW_VIID_PFN(vi->viid) << S_FW_VIID_PFN;
INP_WLOCK_ASSERT(synqe->lctx->inp);
@@ -495,17 +496,18 @@ destroy_server(struct adapter *sc, struct listen_ctx *lctx)
/*
* Start a listening server by sending a passive open request to HW.
*
- * Can't take adapter lock here and access to sc->flags, sc->open_device_map,
+ * Can't take adapter lock here and access to sc->flags,
* sc->offload_map, if_capenable are all race prone.
*/
int
t4_listen_start(struct toedev *tod, struct tcpcb *tp)
{
struct adapter *sc = tod->tod_softc;
+ struct vi_info *vi;
struct port_info *pi;
struct inpcb *inp = tp->t_inpcb;
struct listen_ctx *lctx;
- int i, rc;
+ int i, rc, v;
INP_WLOCK_ASSERT(inp);
@@ -527,12 +529,9 @@ t4_listen_start(struct toedev *tod, struct tcpcb *tp)
("%s: TOM not initialized", __func__));
#endif
- if ((sc->open_device_map & sc->offload_map) == 0)
- goto done; /* no port that's UP with IFCAP_TOE enabled */
-
/*
- * Find a running port with IFCAP_TOE (4 or 6). We'll use the first
- * such port's queues to send the passive open and receive the reply to
+ * Find a running VI with IFCAP_TOE (4 or 6). We'll use the first
+ * such VI's queues to send the passive open and receive the reply to
* it.
*
* XXX: need a way to mark a port in use by offload. if_cxgbe should
@@ -540,18 +539,20 @@ t4_listen_start(struct toedev *tod, struct tcpcb *tp)
* attempts to disable IFCAP_TOE on that port too?).
*/
for_each_port(sc, i) {
- if (isset(&sc->open_device_map, i) &&
- sc->port[i]->ifp->if_capenable & IFCAP_TOE)
- break;
+ pi = sc->port[i];
+ for_each_vi(pi, v, vi) {
+ if (vi->ifp->if_drv_flags & IFF_DRV_RUNNING &&
+ vi->ifp->if_capenable & IFCAP_TOE)
+ goto found;
+ }
}
- KASSERT(i < sc->params.nports,
- ("%s: no running port with TOE capability enabled.", __func__));
- pi = sc->port[i];
+ goto done; /* no port that's UP with IFCAP_TOE enabled */
+found:
if (listen_hash_find(sc, inp) != NULL)
goto done; /* already setup */
- lctx = alloc_lctx(sc, inp, pi);
+ lctx = alloc_lctx(sc, inp, vi);
if (lctx == NULL) {
log(LOG_ERR,
"%s: listen request ignored, %s couldn't allocate lctx\n",
@@ -822,7 +823,7 @@ done_with_synqe(struct adapter *sc, struct synq_entry *synqe)
{
struct listen_ctx *lctx = synqe->lctx;
struct inpcb *inp = lctx->inp;
- struct port_info *pi = synqe->syn->m_pkthdr.rcvif->if_softc;
+ struct vi_info *vi = synqe->syn->m_pkthdr.rcvif->if_softc;
struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx];
INP_WLOCK_ASSERT(inp);
@@ -832,7 +833,7 @@ done_with_synqe(struct adapter *sc, struct synq_entry *synqe)
if (inp)
INP_WUNLOCK(inp);
remove_tid(sc, synqe->tid);
- release_tid(sc, synqe->tid, &sc->sge.ctrlq[pi->port_id]);
+ release_tid(sc, synqe->tid, &sc->sge.ctrlq[vi->pi->port_id]);
t4_l2t_release(e);
release_synqe(synqe); /* removed from synq list */
}
@@ -943,12 +944,12 @@ t4_offload_socket(struct toedev *tod, void *arg, struct socket *so)
}
static inline void
-save_qids_in_mbuf(struct mbuf *m, struct port_info *pi)
+save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi)
{
uint32_t txqid, rxqid;
- txqid = (arc4random() % pi->nofldtxq) + pi->first_ofld_txq;
- rxqid = (arc4random() % pi->nofldrxq) + pi->first_ofld_rxq;
+ txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq;
+ rxqid = (arc4random() % vi->nofldrxq) + vi->first_ofld_rxq;
m->m_pkthdr.flowid = (txqid << 16) | (rxqid & 0xffff);
}
@@ -1172,11 +1173,12 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
struct tcphdr th;
struct tcpopt to;
struct port_info *pi;
+ struct vi_info *vi;
struct ifnet *hw_ifp, *ifp;
struct l2t_entry *e = NULL;
int rscale, mtu_idx, rx_credits, rxqid, ulp_mode;
struct synq_entry *synqe = NULL;
- int reject_reason;
+ int reject_reason, v;
uint16_t vid;
#ifdef INVARIANTS
unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl)));
@@ -1193,7 +1195,26 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
t4opt_to_tcpopt(&cpl->tcpopt, &to);
pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))];
- hw_ifp = pi->ifp; /* the cxgbeX ifnet */
+
+ /*
+ * Use the MAC index to lookup the associated VI. If this SYN
+ * didn't match a perfect MAC filter, punt.
+ */
+ if (!(be16toh(cpl->l2info) & F_SYN_XACT_MATCH)) {
+ m_freem(m);
+ m = NULL;
+ REJECT_PASS_ACCEPT();
+ }
+ for_each_vi(pi, v, vi) {
+ if (vi->xact_addr_filt == G_SYN_MAC_IDX(be16toh(cpl->l2info)))
+ goto found;
+ }
+ m_freem(m);
+ m = NULL;
+ REJECT_PASS_ACCEPT();
+
+found:
+ hw_ifp = vi->ifp; /* the (v)cxgbeX ifnet */
m->m_pkthdr.rcvif = hw_ifp;
tod = TOEDEV(hw_ifp);
@@ -1292,7 +1313,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ);
SOCKBUF_UNLOCK(&so->so_rcv);
- save_qids_in_mbuf(m, pi);
+ save_qids_in_mbuf(m, vi);
get_qids_from_mbuf(m, NULL, &rxqid);
if (is_t4(sc))
@@ -1307,7 +1328,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss,
synqe->flags |= TPF_SYNQE_TCPDDP;
} else
ulp_mode = ULP_MODE_NONE;
- rpl->opt0 = calc_opt0(so, pi, e, mtu_idx, rscale, rx_credits, ulp_mode);
+ rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode);
rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode);
synqe->tid = tid;
@@ -1432,7 +1453,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_header *rss,
struct mbuf *m)
{
struct adapter *sc = iq->adapter;
- struct port_info *pi;
+ struct vi_info *vi;
struct ifnet *ifp;
const struct cpl_pass_establish *cpl = (const void *)(rss + 1);
#if defined(KTR) || defined(INVARIANTS)
@@ -1480,16 +1501,16 @@ do_pass_establish(struct sge_iq *iq, const struct rss_header *rss,
}
ifp = synqe->syn->m_pkthdr.rcvif;
- pi = ifp->if_softc;
- KASSERT(pi->adapter == sc,
- ("%s: pi %p, sc %p mismatch", __func__, pi, sc));
+ vi = ifp->if_softc;
+ KASSERT(vi->pi->adapter == sc,
+ ("%s: vi %p, sc %p mismatch", __func__, vi, sc));
get_qids_from_mbuf(synqe->syn, &txqid, &rxqid);
KASSERT(rxqid == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0],
("%s: CPL arrived on unexpected rxq. %d %d", __func__, rxqid,
(int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0])));
- toep = alloc_toepcb(pi, txqid, rxqid, M_NOWAIT);
+ toep = alloc_toepcb(vi, txqid, rxqid, M_NOWAIT);
if (toep == NULL) {
reset:
/*
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c
index d0a2488..bcf322e 100644
--- a/sys/dev/cxgbe/tom/t4_tom.c
+++ b/sys/dev/cxgbe/tom/t4_tom.c
@@ -107,8 +107,9 @@ static eventhandler_tag ifaddr_evhandler;
static struct timeout_task clip_task;
struct toepcb *
-alloc_toepcb(struct port_info *pi, int txqid, int rxqid, int flags)
+alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags)
{
+ struct port_info *pi = vi->pi;
struct adapter *sc = pi->adapter;
struct toepcb *toep;
int tx_credits, txsd_total, len;
@@ -130,18 +131,18 @@ alloc_toepcb(struct port_info *pi, int txqid, int rxqid, int flags)
howmany((sizeof(struct fw_ofld_tx_data_wr) + 1), 16);
if (txqid < 0)
- txqid = (arc4random() % pi->nofldtxq) + pi->first_ofld_txq;
- KASSERT(txqid >= pi->first_ofld_txq &&
- txqid < pi->first_ofld_txq + pi->nofldtxq,
- ("%s: txqid %d for port %p (first %d, n %d)", __func__, txqid, pi,
- pi->first_ofld_txq, pi->nofldtxq));
+ txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq;
+ KASSERT(txqid >= vi->first_ofld_txq &&
+ txqid < vi->first_ofld_txq + vi->nofldtxq,
+ ("%s: txqid %d for vi %p (first %d, n %d)", __func__, txqid, vi,
+ vi->first_ofld_txq, vi->nofldtxq));
if (rxqid < 0)
- rxqid = (arc4random() % pi->nofldrxq) + pi->first_ofld_rxq;
- KASSERT(rxqid >= pi->first_ofld_rxq &&
- rxqid < pi->first_ofld_rxq + pi->nofldrxq,
- ("%s: rxqid %d for port %p (first %d, n %d)", __func__, rxqid, pi,
- pi->first_ofld_rxq, pi->nofldrxq));
+ rxqid = (arc4random() % vi->nofldrxq) + vi->first_ofld_rxq;
+ KASSERT(rxqid >= vi->first_ofld_rxq &&
+ rxqid < vi->first_ofld_rxq + vi->nofldrxq,
+ ("%s: rxqid %d for vi %p (first %d, n %d)", __func__, rxqid, vi,
+ vi->first_ofld_rxq, vi->nofldrxq));
len = offsetof(struct toepcb, txsd) +
txsd_total * sizeof(struct ofld_tx_sdesc);
@@ -151,7 +152,7 @@ alloc_toepcb(struct port_info *pi, int txqid, int rxqid, int flags)
return (NULL);
toep->td = sc->tom_softc;
- toep->port = pi;
+ toep->vi = vi;
toep->tx_total = tx_credits;
toep->tx_credits = tx_credits;
toep->ofld_txq = &sc->sge.ofld_txq[txqid];
@@ -512,7 +513,7 @@ extern int always_keepalive;
* socket so could be a listening socket too.
*/
uint64_t
-calc_opt0(struct socket *so, struct port_info *pi, struct l2t_entry *e,
+calc_opt0(struct socket *so, struct vi_info *vi, struct l2t_entry *e,
int mtu_idx, int rscale, int rx_credits, int ulp_mode)
{
uint64_t opt0;
@@ -536,20 +537,20 @@ calc_opt0(struct socket *so, struct port_info *pi, struct l2t_entry *e,
if (e != NULL)
opt0 |= V_L2T_IDX(e->idx);
- if (pi != NULL) {
- opt0 |= V_SMAC_SEL(VIID_SMACIDX(pi->viid));
- opt0 |= V_TX_CHAN(pi->tx_chan);
+ if (vi != NULL) {
+ opt0 |= V_SMAC_SEL(VIID_SMACIDX(vi->viid));
+ opt0 |= V_TX_CHAN(vi->pi->tx_chan);
}
return htobe64(opt0);
}
uint64_t
-select_ntuple(struct port_info *pi, struct l2t_entry *e)
+select_ntuple(struct vi_info *vi, struct l2t_entry *e)
{
- struct adapter *sc = pi->adapter;
+ struct adapter *sc = vi->pi->adapter;
struct tp_params *tp = &sc->params.tp;
- uint16_t viid = pi->viid;
+ uint16_t viid = vi->viid;
uint64_t ntuple = 0;
/*
@@ -965,7 +966,8 @@ t4_tom_activate(struct adapter *sc)
{
struct tom_data *td;
struct toedev *tod;
- int i, rc;
+ struct vi_info *vi;
+ int i, rc, v;
ASSERT_SYNCHRONIZED_OP(sc);
@@ -1024,8 +1026,11 @@ t4_tom_activate(struct adapter *sc)
tod->tod_offload_socket = t4_offload_socket;
tod->tod_ctloutput = t4_ctloutput;
- for_each_port(sc, i)
- TOEDEV(sc->port[i]->ifp) = &td->tod;
+ for_each_port(sc, i) {
+ for_each_vi(sc->port[i], v, vi) {
+ TOEDEV(vi->ifp) = &td->tod;
+ }
+ }
sc->tom_softc = td;
register_toedev(sc->tom_softc);
diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h
index 0160935..f24e147 100644
--- a/sys/dev/cxgbe/tom/t4_tom.h
+++ b/sys/dev/cxgbe/tom/t4_tom.h
@@ -96,7 +96,7 @@ struct toepcb {
u_int flags; /* miscellaneous flags */
struct tom_data *td;
struct inpcb *inp; /* backpointer to host stack's PCB */
- struct port_info *port; /* physical port */
+ struct vi_info *vi; /* virtual interface */
struct sge_wrq *ofld_txq;
struct sge_ofld_rxq *ofld_rxq;
struct sge_wrq *ctrlq;
@@ -221,7 +221,7 @@ td_adapter(struct tom_data *td)
}
/* t4_tom.c */
-struct toepcb *alloc_toepcb(struct port_info *, int, int, int);
+struct toepcb *alloc_toepcb(struct vi_info *, int, int, int);
void free_toepcb(struct toepcb *);
void offload_socket(struct socket *, struct toepcb *);
void undo_offload_socket(struct socket *);
@@ -234,9 +234,9 @@ void release_tid(struct adapter *, int, struct sge_wrq *);
int find_best_mtu_idx(struct adapter *, struct in_conninfo *, int);
u_long select_rcv_wnd(struct socket *);
int select_rcv_wscale(void);
-uint64_t calc_opt0(struct socket *, struct port_info *, struct l2t_entry *,
+uint64_t calc_opt0(struct socket *, struct vi_info *, struct l2t_entry *,
int, int, int, int);
-uint64_t select_ntuple(struct port_info *, struct l2t_entry *);
+uint64_t select_ntuple(struct vi_info *, struct l2t_entry *);
void set_tcpddp_ulp_mode(struct toepcb *);
int negative_advice(int);
struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *);
diff --git a/sys/dev/drm2/i915/i915_debug.c b/sys/dev/drm2/i915/i915_debug.c
index 43d67f8..121daec 100644
--- a/sys/dev/drm2/i915/i915_debug.c
+++ b/sys/dev/drm2/i915/i915_debug.c
@@ -294,14 +294,11 @@ static int i915_gem_gtt_info(struct drm_device *dev, struct sbuf *m, void *data)
static int i915_gem_pageflip_info(struct drm_device *dev, struct sbuf *m, void *data)
{
struct intel_crtc *crtc;
- struct drm_i915_gem_object *obj;
- struct intel_unpin_work *work;
- char pipe;
- char plane;
list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) {
- pipe = pipe_name(crtc->pipe);
- plane = plane_name(crtc->plane);
+ const char pipe = pipe_name(crtc->pipe);
+ const char plane = plane_name(crtc->plane);
+ struct intel_unpin_work *work;
mtx_lock(&dev->event_lock);
work = crtc->unpin_work;
@@ -323,12 +320,12 @@ static int i915_gem_pageflip_info(struct drm_device *dev, struct sbuf *m, void *
sbuf_printf(m, "%d prepares\n", work->pending);
if (work->old_fb_obj) {
- obj = work->old_fb_obj;
+ struct drm_i915_gem_object *obj = work->old_fb_obj;
if (obj)
sbuf_printf(m, "Old framebuffer gtt_offset 0x%08x\n", obj->gtt_offset);
}
if (work->pending_flip_obj) {
- obj = work->pending_flip_obj;
+ struct drm_i915_gem_object *obj = work->pending_flip_obj;
if (obj)
sbuf_printf(m, "New framebuffer gtt_offset 0x%08x\n", obj->gtt_offset);
}
@@ -390,7 +387,8 @@ static int i915_gem_request_info(struct drm_device *dev, struct sbuf *m, void *d
return 0;
}
-static void i915_ring_seqno_info(struct sbuf *m, struct intel_ring_buffer *ring)
+static void i915_ring_seqno_info(struct sbuf *m,
+ struct intel_ring_buffer *ring)
{
if (ring->get_seqno) {
sbuf_printf(m, "Current sequence (%s): %d\n",
@@ -496,9 +494,9 @@ static int i915_interrupt_info(struct drm_device *dev, struct sbuf *m, void *dat
atomic_read(&dev_priv->irq_received));
for (i = 0; i < I915_NUM_RINGS; i++) {
if (IS_GEN6(dev) || IS_GEN7(dev)) {
- sbuf_printf(m, "Graphics Interrupt mask (%s): %08x\n",
- dev_priv->rings[i].name,
- I915_READ_IMR(&dev_priv->rings[i]));
+ sbuf_printf(m,
+ "Graphics Interrupt mask (%s): %08x\n",
+ dev_priv->rings[i].name, I915_READ_IMR(&dev_priv->rings[i]));
}
i915_ring_seqno_info(m, &dev_priv->rings[i]);
}
@@ -678,8 +676,6 @@ static int i915_error_state(struct drm_device *dev, struct sbuf *m,
return 0;
}
- error = dev_priv->first_error;
-
sbuf_printf(m, "Time: %jd s %jd us\n", (intmax_t)error->time.tv_sec,
(intmax_t)error->time.tv_usec);
sbuf_printf(m, "PCI ID: 0x%04x\n", dev->pci_device);
@@ -767,7 +763,7 @@ static int i915_error_state(struct drm_device *dev, struct sbuf *m,
}
static int
-i915_error_state_w(struct drm_device *dev, const char *str, void *unused)
+i915_error_state_write(struct drm_device *dev, const char *str, void *unused)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct drm_i915_error_state *error;
@@ -782,8 +778,7 @@ i915_error_state_w(struct drm_device *dev, const char *str, void *unused)
return (0);
}
-static int
-i915_rstdby_delays(struct drm_device *dev, struct sbuf *m, void *unused)
+static int i915_rstdby_delays(struct drm_device *dev, struct sbuf *m, void *unused)
{
drm_i915_private_t *dev_priv = dev->dev_private;
u16 crstanddelay;
@@ -795,8 +790,7 @@ i915_rstdby_delays(struct drm_device *dev, struct sbuf *m, void *unused)
DRM_UNLOCK(dev);
- sbuf_printf(m, "w/ctx: %d, w/o ctx: %d\n",
- (crstanddelay >> 8) & 0x3f, (crstanddelay & 0x3f));
+ sbuf_printf(m, "w/ctx: %d, w/o ctx: %d\n", (crstanddelay >> 8) & 0x3f, (crstanddelay & 0x3f));
return 0;
}
@@ -928,8 +922,7 @@ static int i915_inttoext_table(struct drm_device *dev, struct sbuf *m, void *unu
static int ironlake_drpc_info(struct drm_device *dev, struct sbuf *m)
{
drm_i915_private_t *dev_priv = dev->dev_private;
- u32 rgvmodectl;
- u32 rstdbyctl;
+ u32 rgvmodectl, rstdbyctl;
u16 crstandvid;
if (sx_xlock_sig(&dev->dev_struct_lock))
@@ -1309,10 +1302,9 @@ static int i915_context_status(struct drm_device *dev, struct sbuf *m, void *dat
static int i915_gen6_forcewake_count_info(struct drm_device *dev, struct sbuf *m,
void *data)
{
- struct drm_i915_private *dev_priv;
+ struct drm_i915_private *dev_priv = dev->dev_private;
unsigned forcewake_count;
- dev_priv = dev->dev_private;
mtx_lock(&dev_priv->gt_lock);
forcewake_count = dev_priv->forcewake_count;
mtx_unlock(&dev_priv->gt_lock);
@@ -1349,12 +1341,11 @@ static const char *swizzle_string(unsigned swizzle)
static int i915_swizzle_info(struct drm_device *dev, struct sbuf *m, void *data)
{
- struct drm_i915_private *dev_priv;
+ struct drm_i915_private *dev_priv = dev->dev_private;
int ret;
- dev_priv = dev->dev_private;
ret = sx_xlock_sig(&dev->dev_struct_lock);
- if (ret != 0)
+ if (ret)
return -EINTR;
sbuf_printf(m, "bit6 swizzle for X-tiling = %s\n",
@@ -1390,14 +1381,13 @@ static int i915_swizzle_info(struct drm_device *dev, struct sbuf *m, void *data)
static int i915_ppgtt_info(struct drm_device *dev, struct sbuf *m, void *data)
{
- struct drm_i915_private *dev_priv;
+ struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring;
int i, ret;
- dev_priv = dev->dev_private;
ret = sx_xlock_sig(&dev->dev_struct_lock);
- if (ret != 0)
+ if (ret)
return -EINTR;
if (INTEL_INFO(dev)->gen == 6)
sbuf_printf(m, "GFX_MODE: 0x%08x\n", I915_READ(GFX_MODE));
@@ -1426,18 +1416,17 @@ static int i915_ppgtt_info(struct drm_device *dev, struct sbuf *m, void *data)
static int i915_dpio_info(struct drm_device *dev, struct sbuf *m, void *data)
{
- struct drm_i915_private *dev_priv;
+ struct drm_i915_private *dev_priv = dev->dev_private;
int ret;
+
if (!IS_VALLEYVIEW(dev)) {
sbuf_printf(m, "unsupported\n");
return 0;
}
- dev_priv = dev->dev_private;
-
ret = sx_xlock_sig(&dev->mode_config.mutex);
- if (ret != 0)
+ if (ret)
return -EINTR;
sbuf_printf(m, "DPIO_CTL: 0x%08x\n", I915_READ(DPIO_CTL));
@@ -1473,12 +1462,10 @@ static int i915_dpio_info(struct drm_device *dev, struct sbuf *m, void *data)
static int
i915_debug_set_wedged(SYSCTL_HANDLER_ARGS)
{
- struct drm_device *dev;
- drm_i915_private_t *dev_priv;
+ struct drm_device *dev = arg1;
+ drm_i915_private_t *dev_priv = dev->dev_private;
int error, wedged;
- dev = arg1;
- dev_priv = dev->dev_private;
if (dev_priv == NULL)
return (EBUSY);
wedged = dev_priv->mm.wedged;
@@ -1493,12 +1480,10 @@ i915_debug_set_wedged(SYSCTL_HANDLER_ARGS)
static int
i915_max_freq(SYSCTL_HANDLER_ARGS)
{
- struct drm_device *dev;
- drm_i915_private_t *dev_priv;
+ struct drm_device *dev = arg1;
+ drm_i915_private_t *dev_priv = dev->dev_private;
int error, max_freq;
- dev = arg1;
- dev_priv = dev->dev_private;
if (dev_priv == NULL)
return (EBUSY);
max_freq = dev_priv->max_delay * 50;
@@ -1517,12 +1502,10 @@ i915_max_freq(SYSCTL_HANDLER_ARGS)
static int
i915_cache_sharing(SYSCTL_HANDLER_ARGS)
{
- struct drm_device *dev;
- drm_i915_private_t *dev_priv;
+ struct drm_device *dev = arg1;
+ drm_i915_private_t *dev_priv = dev->dev_private;
int error, snpcr, cache_sharing;
- dev = arg1;
- dev_priv = dev->dev_private;
if (dev_priv == NULL)
return (EBUSY);
DRM_LOCK(dev);
@@ -1549,12 +1532,10 @@ i915_cache_sharing(SYSCTL_HANDLER_ARGS)
static int
i915_stop_rings(SYSCTL_HANDLER_ARGS)
{
- struct drm_device *dev;
- drm_i915_private_t *dev_priv;
+ struct drm_device *dev = arg1;
+ drm_i915_private_t *dev_priv = dev->dev_private;
int error, val;
- dev = arg1;
- dev_priv = dev->dev_private;
if (dev_priv == NULL)
return (EBUSY);
DRM_LOCK(dev);
@@ -1582,12 +1563,9 @@ static struct i915_info_sysctl_list {
{"i915_gem_objects", i915_gem_object_info, NULL, 0},
{"i915_gem_gtt", i915_gem_gtt_info, NULL, 0},
{"i915_gem_pinned", i915_gem_gtt_info, NULL, 0, (void *)PINNED_LIST},
- {"i915_gem_active", i915_gem_object_list_info, NULL, 0,
- (void *)ACTIVE_LIST},
- {"i915_gem_flushing", i915_gem_object_list_info, NULL, 0,
- (void *)FLUSHING_LIST},
- {"i915_gem_inactive", i915_gem_object_list_info, NULL, 0,
- (void *)INACTIVE_LIST},
+ {"i915_gem_active", i915_gem_object_list_info, NULL, 0, (void *)ACTIVE_LIST},
+ {"i915_gem_flushing", i915_gem_object_list_info, NULL, 0, (void *)FLUSHING_LIST},
+ {"i915_gem_inactive", i915_gem_object_list_info, NULL, 0, (void *)INACTIVE_LIST},
{"i915_gem_pageflip", i915_gem_pageflip_info, NULL, 0},
{"i915_gem_request", i915_gem_request_info, NULL, 0},
{"i915_gem_seqno", i915_gem_seqno_info, NULL, 0},
@@ -1596,7 +1574,7 @@ static struct i915_info_sysctl_list {
{"i915_gem_hws", i915_hws_info, NULL, 0, (void *)RCS},
{"i915_gem_hws_blt", i915_hws_info, NULL, 0, (void *)BCS},
{"i915_gem_hws_bsd", i915_hws_info, NULL, 0, (void *)VCS},
- {"i915_error_state", i915_error_state, i915_error_state_w, 0},
+ {"i915_error_state", i915_error_state, i915_error_state_write, 0},
{"i915_rstdby_delays", i915_rstdby_delays, NULL, 0},
{"i915_cur_delayinfo", i915_cur_delayinfo, NULL, 0},
{"i915_delayfreq_table", i915_delayfreq_table, NULL, 0},
diff --git a/sys/dev/drm2/i915/i915_dma.c b/sys/dev/drm2/i915/i915_dma.c
index 2d0f57d..ad2c147 100644
--- a/sys/dev/drm2/i915/i915_dma.c
+++ b/sys/dev/drm2/i915/i915_dma.c
@@ -542,8 +542,7 @@ static int i915_dispatch_batchbuffer(struct drm_device * dev,
return ret;
if (INTEL_INFO(dev)->gen >= 4) {
- OUT_RING(MI_BATCH_BUFFER_START | (2 << 6) |
- MI_BATCH_NON_SECURE_I965);
+ OUT_RING(MI_BATCH_BUFFER_START | (2 << 6) | MI_BATCH_NON_SECURE_I965);
OUT_RING(batch->start);
} else {
OUT_RING(MI_BATCH_BUFFER_START | (2 << 6));
@@ -724,7 +723,8 @@ int i915_cmdbuffer(struct drm_device *dev, void *data,
cliprects = malloc(cmdbuf->num_cliprects *
sizeof(struct drm_clip_rect), DRM_MEM_DMA, M_WAITOK | M_ZERO);
ret = -copyin(cmdbuf->cliprects, cliprects,
- cmdbuf->num_cliprects * sizeof(struct drm_clip_rect));
+ cmdbuf->num_cliprects *
+ sizeof(struct drm_clip_rect));
if (ret != 0)
goto fail_clip_free;
}
@@ -1325,7 +1325,7 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
*/
int i915_driver_load(struct drm_device *dev, unsigned long flags)
{
- struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_i915_private *dev_priv;
const struct intel_device_info *info;
unsigned long base, size;
int ret = 0, mmio_bar;
diff --git a/sys/dev/drm2/i915/i915_drm.h b/sys/dev/drm2/i915/i915_drm.h
index 968bba5..deae206 100644
--- a/sys/dev/drm2/i915/i915_drm.h
+++ b/sys/dev/drm2/i915/i915_drm.h
@@ -133,10 +133,10 @@ typedef struct _drm_i915_sarea {
* over the lifetime of the client, though it doesn't in our current
* implementation.
*/
- unsigned int front_bo_handle;
- unsigned int back_bo_handle;
- unsigned int third_bo_handle;
- unsigned int depth_bo_handle;
+ __u32 front_bo_handle;
+ __u32 back_bo_handle;
+ __u32 third_bo_handle;
+ __u32 depth_bo_handle;
} drm_i915_sarea_t;
/* due to userspace building against these headers we need some compat here */
@@ -421,7 +421,7 @@ typedef struct drm_i915_mmio {
} drm_i915_mmio_t;
typedef struct drm_i915_hws_addr {
- uint64_t addr;
+ __u64 addr;
} drm_i915_hws_addr_t;
/*
@@ -461,12 +461,12 @@ struct drm_i915_gem_init {
* Beginning offset in the GTT to be managed by the DRM memory
* manager.
*/
- uint64_t gtt_start;
+ __u64 gtt_start;
/**
* Ending offset in the GTT to be managed by the DRM memory
* manager.
*/
- uint64_t gtt_end;
+ __u64 gtt_end;
};
struct drm_i915_gem_create {
@@ -475,82 +475,82 @@ struct drm_i915_gem_create {
*
* The (page-aligned) allocated size for the object will be returned.
*/
- uint64_t size;
+ __u64 size;
/**
* Returned handle for the object.
*
* Object handles are nonzero.
*/
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
};
struct drm_i915_gem_pread {
/** Handle for the object being read. */
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
/** Offset into the object to read from */
- uint64_t offset;
+ __u64 offset;
/** Length of data to read */
- uint64_t size;
+ __u64 size;
/** Pointer to write the data into. */
- uint64_t data_ptr; /* void *, but pointers are not 32/64 compatible */
+ __u64 data_ptr; /* void *, but pointers are not 32/64 compatible */
};
struct drm_i915_gem_pwrite {
/** Handle for the object being written to. */
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
/** Offset into the object to write to */
- uint64_t offset;
+ __u64 offset;
/** Length of data to write */
- uint64_t size;
+ __u64 size;
/** Pointer to read the data from. */
- uint64_t data_ptr; /* void *, but pointers are not 32/64 compatible */
+ __u64 data_ptr; /* void *, but pointers are not 32/64 compatible */
};
struct drm_i915_gem_mmap {
/** Handle for the object being mapped. */
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
/** Offset in the object to map. */
- uint64_t offset;
+ __u64 offset;
/**
* Length of data to map.
*
* The value will be page-aligned.
*/
- uint64_t size;
+ __u64 size;
/** Returned pointer the data was mapped at */
- uint64_t addr_ptr; /* void *, but pointers are not 32/64 compatible */
+ __u64 addr_ptr; /* void *, but pointers are not 32/64 compatible */
};
struct drm_i915_gem_mmap_gtt {
/** Handle for the object being mapped. */
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
/**
* Fake offset to use for subsequent mmap call
*
* This is a fixed-size type for 32/64 compatibility.
*/
- uint64_t offset;
+ __u64 offset;
};
struct drm_i915_gem_set_domain {
/** Handle for the object */
- uint32_t handle;
+ __u32 handle;
/** New read domains */
- uint32_t read_domains;
+ __u32 read_domains;
/** New write domain */
- uint32_t write_domain;
+ __u32 write_domain;
};
struct drm_i915_gem_sw_finish {
/** Handle for the object */
- uint32_t handle;
+ __u32 handle;
};
struct drm_i915_gem_relocation_entry {
@@ -562,16 +562,16 @@ struct drm_i915_gem_relocation_entry {
* a relocation list for state buffers and not re-write it per
* exec using the buffer.
*/
- uint32_t target_handle;
+ __u32 target_handle;
/**
* Value to be added to the offset of the target buffer to make up
* the relocation entry.
*/
- uint32_t delta;
+ __u32 delta;
/** Offset in the buffer the relocation entry will be written into */
- uint64_t offset;
+ __u64 offset;
/**
* Offset value of the target buffer that the relocation entry was last
@@ -581,12 +581,12 @@ struct drm_i915_gem_relocation_entry {
* and writing the relocation. This value is written back out by
* the execbuffer ioctl when the relocation is written.
*/
- uint64_t presumed_offset;
+ __u64 presumed_offset;
/**
* Target memory domains read by this operation.
*/
- uint32_t read_domains;
+ __u32 read_domains;
/**
* Target memory domains written by this operation.
@@ -595,7 +595,7 @@ struct drm_i915_gem_relocation_entry {
* execbuffer operation, so that where there are conflicts,
* the application will get -EINVAL back.
*/
- uint32_t write_domain;
+ __u32 write_domain;
};
/** @{
@@ -626,24 +626,24 @@ struct drm_i915_gem_exec_object {
* User's handle for a buffer to be bound into the GTT for this
* operation.
*/
- uint32_t handle;
+ __u32 handle;
/** Number of relocations to be performed on this buffer */
- uint32_t relocation_count;
+ __u32 relocation_count;
/**
* Pointer to array of struct drm_i915_gem_relocation_entry containing
* the relocations to be performed in this buffer.
*/
- uint64_t relocs_ptr;
+ __u64 relocs_ptr;
/** Required alignment in graphics aperture */
- uint64_t alignment;
+ __u64 alignment;
/**
* Returned value of the updated offset of the object, for future
* presumed_offset writes.
*/
- uint64_t offset;
+ __u64 offset;
};
struct drm_i915_gem_execbuffer {
@@ -657,17 +657,17 @@ struct drm_i915_gem_execbuffer {
* a buffer is performing refer to buffers that have already appeared
* in the validate list.
*/
- uint64_t buffers_ptr;
- uint32_t buffer_count;
+ __u64 buffers_ptr;
+ __u32 buffer_count;
/** Offset in the batchbuffer to start execution from. */
- uint32_t batch_start_offset;
+ __u32 batch_start_offset;
/** Bytes used in batchbuffer from batch_start_offset */
- uint32_t batch_len;
- uint32_t DR1;
- uint32_t DR4;
- uint32_t num_cliprects;
- uint64_t cliprects_ptr; /* struct drm_clip_rect *cliprects */
+ __u32 batch_len;
+ __u32 DR1;
+ __u32 DR4;
+ __u32 num_cliprects;
+ __u64 cliprects_ptr; /* struct drm_clip_rect *cliprects */
};
struct drm_i915_gem_exec_object2 {
@@ -675,47 +675,47 @@ struct drm_i915_gem_exec_object2 {
* User's handle for a buffer to be bound into the GTT for this
* operation.
*/
- uint32_t handle;
+ __u32 handle;
/** Number of relocations to be performed on this buffer */
- uint32_t relocation_count;
+ __u32 relocation_count;
/**
* Pointer to array of struct drm_i915_gem_relocation_entry containing
* the relocations to be performed in this buffer.
*/
- uint64_t relocs_ptr;
+ __u64 relocs_ptr;
/** Required alignment in graphics aperture */
- uint64_t alignment;
+ __u64 alignment;
/**
* Returned value of the updated offset of the object, for future
* presumed_offset writes.
*/
- uint64_t offset;
+ __u64 offset;
#define EXEC_OBJECT_NEEDS_FENCE (1<<0)
- uint64_t flags;
- uint64_t rsvd1; /* now used for context info */
- uint64_t rsvd2;
+ __u64 flags;
+ __u64 rsvd1; /* now used for context info */
+ __u64 rsvd2;
};
struct drm_i915_gem_execbuffer2 {
/**
* List of gem_exec_object2 structs
*/
- uint64_t buffers_ptr;
- uint32_t buffer_count;
+ __u64 buffers_ptr;
+ __u32 buffer_count;
/** Offset in the batchbuffer to start execution from. */
- uint32_t batch_start_offset;
+ __u32 batch_start_offset;
/** Bytes used in batchbuffer from batch_start_offset */
- uint32_t batch_len;
- uint32_t DR1;
- uint32_t DR4;
- uint32_t num_cliprects;
+ __u32 batch_len;
+ __u32 DR1;
+ __u32 DR4;
+ __u32 num_cliprects;
/** This is a struct drm_clip_rect *cliprects */
- uint64_t cliprects_ptr;
+ __u64 cliprects_ptr;
#define I915_EXEC_RING_MASK (7<<0)
#define I915_EXEC_DEFAULT (0<<0)
#define I915_EXEC_RENDER (1<<0)
@@ -732,9 +732,9 @@ struct drm_i915_gem_execbuffer2 {
#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */
#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */
- uint64_t flags;
- uint64_t rsvd1;
- uint64_t rsvd2;
+ __u64 flags;
+ __u64 rsvd1;
+ __u64 rsvd2;
};
/** Resets the SO write offset registers for transform feedback on gen7. */
@@ -748,28 +748,28 @@ struct drm_i915_gem_execbuffer2 {
struct drm_i915_gem_pin {
/** Handle of the buffer to be pinned. */
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
/** alignment required within the aperture */
- uint64_t alignment;
+ __u64 alignment;
/** Returned GTT offset of the buffer. */
- uint64_t offset;
+ __u64 offset;
};
struct drm_i915_gem_unpin {
/** Handle of the buffer to be unpinned. */
- uint32_t handle;
- uint32_t pad;
+ __u32 handle;
+ __u32 pad;
};
struct drm_i915_gem_busy {
/** Handle of the buffer to check for busy */
- uint32_t handle;
+ __u32 handle;
/** Return busy status (1 if busy, 0 if idle) */
- uint32_t busy;
+ __u32 busy;
};
#define I915_TILING_NONE 0
@@ -789,7 +789,7 @@ struct drm_i915_gem_busy {
struct drm_i915_gem_set_tiling {
/** Handle of the buffer to have its tiling state updated */
- uint32_t handle;
+ __u32 handle;
/**
* Tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
@@ -803,55 +803,55 @@ struct drm_i915_gem_set_tiling {
*
* Buffer contents become undefined when changing tiling_mode.
*/
- uint32_t tiling_mode;
+ __u32 tiling_mode;
/**
* Stride in bytes for the object when in I915_TILING_X or
* I915_TILING_Y.
*/
- uint32_t stride;
+ __u32 stride;
/**
* Returned address bit 6 swizzling required for CPU access through
* mmap mapping.
*/
- uint32_t swizzle_mode;
+ __u32 swizzle_mode;
};
struct drm_i915_gem_get_tiling {
/** Handle of the buffer to get tiling state for. */
- uint32_t handle;
+ __u32 handle;
/**
* Current tiling mode for the object (I915_TILING_NONE, I915_TILING_X,
* I915_TILING_Y).
*/
- uint32_t tiling_mode;
+ __u32 tiling_mode;
/**
* Returned address bit 6 swizzling required for CPU access through
* mmap mapping.
*/
- uint32_t swizzle_mode;
+ __u32 swizzle_mode;
};
struct drm_i915_gem_get_aperture {
/** Total size of the aperture used by i915_gem_execbuffer, in bytes */
- uint64_t aper_size;
+ __u64 aper_size;
/**
* Available space in the aperture used by i915_gem_execbuffer, in
* bytes
*/
- uint64_t aper_available_size;
+ __u64 aper_available_size;
};
struct drm_i915_get_pipe_from_crtc_id {
- /** ID of CRTC being requested **/
- uint32_t crtc_id;
+ /** ID of CRTC being requested **/
+ __u32 crtc_id;
- /** pipe of requested CRTC **/
- uint32_t pipe;
+ /** pipe of requested CRTC **/
+ __u32 pipe;
};
#define I915_MADV_WILLNEED 0
@@ -860,15 +860,15 @@ struct drm_i915_get_pipe_from_crtc_id {
struct drm_i915_gem_madvise {
/** Handle of the buffer to change the backing store advice */
- uint32_t handle;
+ __u32 handle;
/* Advice: either the buffer will be needed again in the near future,
* or wont be and could be discarded under memory pressure.
*/
- uint32_t madv;
+ __u32 madv;
/** Whether the backing store still exists. */
- uint32_t retained;
+ __u32 retained;
};
#define I915_OVERLAY_TYPE_MASK 0xff
@@ -896,44 +896,44 @@ struct drm_i915_gem_madvise {
struct drm_intel_overlay_put_image {
/* various flags and src format description */
- uint32_t flags;
+ __u32 flags;
/* source picture description */
- uint32_t bo_handle;
+ __u32 bo_handle;
/* stride values and offsets are in bytes, buffer relative */
- uint16_t stride_Y; /* stride for packed formats */
- uint16_t stride_UV;
- uint32_t offset_Y; /* offset for packet formats */
- uint32_t offset_U;
- uint32_t offset_V;
+ __u16 stride_Y; /* stride for packed formats */
+ __u16 stride_UV;
+ __u32 offset_Y; /* offset for packet formats */
+ __u32 offset_U;
+ __u32 offset_V;
/* in pixels */
- uint16_t src_width;
- uint16_t src_height;
+ __u16 src_width;
+ __u16 src_height;
/* to compensate the scaling factors for partially covered surfaces */
- uint16_t src_scan_width;
- uint16_t src_scan_height;
+ __u16 src_scan_width;
+ __u16 src_scan_height;
/* output crtc description */
- uint32_t crtc_id;
- uint16_t dst_x;
- uint16_t dst_y;
- uint16_t dst_width;
- uint16_t dst_height;
+ __u32 crtc_id;
+ __u16 dst_x;
+ __u16 dst_y;
+ __u16 dst_width;
+ __u16 dst_height;
};
/* flags */
#define I915_OVERLAY_UPDATE_ATTRS (1<<0)
#define I915_OVERLAY_UPDATE_GAMMA (1<<1)
struct drm_intel_overlay_attrs {
- uint32_t flags;
- uint32_t color_key;
- int32_t brightness;
- uint32_t contrast;
- uint32_t saturation;
- uint32_t gamma0;
- uint32_t gamma1;
- uint32_t gamma2;
- uint32_t gamma3;
- uint32_t gamma4;
- uint32_t gamma5;
+ __u32 flags;
+ __u32 color_key;
+ __s32 brightness;
+ __u32 contrast;
+ __u32 saturation;
+ __u32 gamma0;
+ __u32 gamma1;
+ __u32 gamma2;
+ __u32 gamma3;
+ __u32 gamma4;
+ __u32 gamma5;
};
/*
@@ -961,22 +961,22 @@ struct drm_intel_overlay_attrs {
#define I915_SET_COLORKEY_DESTINATION (1<<1)
#define I915_SET_COLORKEY_SOURCE (1<<2)
struct drm_intel_sprite_colorkey {
- uint32_t plane_id;
- uint32_t min_value;
- uint32_t channel_mask;
- uint32_t max_value;
- uint32_t flags;
+ __u32 plane_id;
+ __u32 min_value;
+ __u32 channel_mask;
+ __u32 max_value;
+ __u32 flags;
};
struct drm_i915_gem_context_create {
/* output: id of new context*/
- uint32_t ctx_id;
- uint32_t pad;
+ __u32 ctx_id;
+ __u32 pad;
};
struct drm_i915_gem_context_destroy {
- uint32_t ctx_id;
- uint32_t pad;
+ __u32 ctx_id;
+ __u32 pad;
};
#endif /* _I915_DRM_H_ */
diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c
index f22d2b3..43bcea0 100644
--- a/sys/dev/hwpmc/hwpmc_core.c
+++ b/sys/dev/hwpmc/hwpmc_core.c
@@ -579,7 +579,9 @@ struct iap_event_descr {
#define IAP_F_CAS (1 << 11) /* CPU: Atom Silvermont */
#define IAP_F_HWX (1 << 12) /* CPU: Haswell Xeon */
#define IAP_F_BW (1 << 13) /* CPU: Broadwell */
-#define IAP_F_FM (1 << 14) /* Fixed mask */
+#define IAP_F_BWX (1 << 14) /* CPU: Broadwell Xeon */
+#define IAP_F_SL (1 << 15) /* CPU: Skylake */
+#define IAP_F_FM (1 << 18) /* Fixed mask */
#define IAP_F_ALLCPUSCORE2 \
(IAP_F_CC | IAP_F_CC2 | IAP_F_CC2E | IAP_F_CA)
@@ -623,11 +625,12 @@ static struct iap_event_descr iap_events[] = {
IAP_F_SBX | IAP_F_CAS),
IAPDESCR(03H_02H, 0x03, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
- IAP_F_CAS | IAP_F_HWX),
+ IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(03H_04H, 0x03, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O |
IAP_F_CAS),
IAPDESCR(03H_08H, 0x03, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB |
- IAP_F_SBX | IAP_F_CAS | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_CAS | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB |
IAP_F_SBX | IAP_F_CAS),
IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS),
@@ -648,9 +651,11 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW |
+ IAP_F_BWX),
IAPDESCR(05H_02H, 0x05, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_WM | IAP_F_SB |
- IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(05H_03H, 0x05, 0x03, IAP_F_FM | IAP_F_I7O | IAP_F_CAS),
IAPDESCR(06H_00H, 0x06, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2 |
@@ -664,7 +669,7 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(07H_00H, 0x07, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2),
IAPDESCR(07H_01H, 0x07, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX |
- IAP_F_HW | IAP_F_HWX),
+ IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(07H_02H, 0x07, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(07H_03H, 0x07, 0x03, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(07H_06H, 0x07, 0x06, IAP_F_FM | IAP_F_CA),
@@ -672,9 +677,11 @@ static struct iap_event_descr iap_events[] = {
IAP_F_SBX),
IAPDESCR(08H_01H, 0x08, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(08H_02H, 0x08, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(08H_04H, 0x08, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX),
IAPDESCR(08H_05H, 0x08, 0x05, IAP_F_FM | IAP_F_CA),
@@ -682,11 +689,11 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(08H_07H, 0x08, 0x07, IAP_F_FM | IAP_F_CA),
IAPDESCR(08H_08H, 0x08, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(08H_09H, 0x08, 0x09, IAP_F_FM | IAP_F_CA),
- IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
- IAP_F_SBX | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(08H_10H, 0x08, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
+ IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(08H_40H, 0x08, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX),
IAPDESCR(08H_60H, 0x08, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
IAPDESCR(08H_80H, 0x08, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX),
@@ -705,23 +712,25 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(0BH_10H, 0x0B, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(0CH_01H, 0x0C, 0x01, IAP_F_FM | IAP_F_CC2 | IAP_F_I7 |
- IAP_F_WM),
+ IAP_F_WM | IAP_F_SL),
IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2),
IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA),
- IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW |
- IAP_F_IB | IAP_F_IBX | IAP_F_HWX),
+ IAPDESCR(0DH_03H, 0x0D, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW |
+ IAP_F_IB | IAP_F_IBX | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
+ IAPDESCR(0DH_80H, 0x0D, 0x00, IAP_F_FM | IAP_F_SL),
IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
- IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(0EH_02H, 0x0E, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL),
IAPDESCR(0EH_10H, 0x0E, 0x10, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(0EH_20H, 0x0E, 0x20, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(0EH_40H, 0x0E, 0x40, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(0FH_01H, 0x0F, 0x01, IAP_F_FM | IAP_F_I7),
IAPDESCR(0FH_02H, 0x0F, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
@@ -771,7 +780,8 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(14H_00H, 0x14, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2),
IAPDESCR(14H_01H, 0x14, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 |
- IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
+ IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(14H_02H, 0x14, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(17H_01H, 0x17, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
@@ -798,7 +808,7 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(24H, 0x24, IAP_M_CORE | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2),
IAPDESCR(24H_01H, 0x24, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
- IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
+ IAP_F_IB | IAP_F_SBX | IAP_F_IBX ),
IAPDESCR(24H_02H, 0x24, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(24H_03H, 0x24, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
@@ -812,29 +822,40 @@ static struct iap_event_descr iap_events[] = {
IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
IAPDESCR(24H_20H, 0x24, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
- IAPDESCR(24H_21H, 0x24, 0x21, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_22H, 0x24, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_24H, 0x24, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_27H, 0x24, 0x27, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(24H_21H, 0x24, 0x21, IAP_F_FM | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(24H_22H, 0x24, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(24H_24H, 0x24, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(24H_27H, 0x24, 0x27, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
- IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(24H_38H, 0x24, 0x00, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(24H_3FH, 0x24, 0x00, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
- IAPDESCR(24H_41H, 0x24, 0x41, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_42H, 0x24, 0x42, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_44H, 0x24, 0x44, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_50H, 0x24, 0x50, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(24H_41H, 0x24, 0x41, IAP_F_FM | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(24H_42H, 0x24, 0x42, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(24H_44H, 0x24, 0x44, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(24H_50H, 0x24, 0x50, IAP_F_FM | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(24H_80H, 0x24, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
+ IAPDESCR(24H_AAH, 0x24, 0xAA, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB |
IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
- IAPDESCR(24H_E1H, 0x24, 0xE1, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_E7H, 0x24, 0xE7, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_AAH, 0x24, 0xAA, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(24H_3FH, 0x24, 0x3F, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(24H_D8H, 0x24, 0x00, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(24H_E1H, 0x24, 0xE1, IAP_F_FM | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX |
+ IAP_F_SL),
+ IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX |
+ IAP_F_SL),
+ IAPDESCR(24H_E7H, 0x24, 0xE7, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(24H_EFH, 0x24, 0x00, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX |
+ IAP_F_SL),
IAPDESCR(24H_FFH, 0x24, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW |
IAP_F_HWX),
@@ -867,7 +888,7 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(27H_10H, 0x27, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(27H_20H, 0x27, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(27H_40H, 0x27, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(27H_50H, 0x27, 0x50, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(27H_50H, 0x27, 0x50, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(27H_80H, 0x27, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(27H_E0H, 0x27, 0xE0, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(27H_F0H, 0x27, 0xF0, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
@@ -895,10 +916,10 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(2EH_02H, 0x2E, 0x02, IAP_F_FM | IAP_F_WM),
IAPDESCR(2EH_41H, 0x2E, 0x41, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 |
IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
- IAP_F_CAS | IAP_F_HWX),
+ IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(2EH_4FH, 0x2E, 0x4F, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 |
IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
- IAP_F_CAS | IAP_F_HWX),
+ IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH,
IAP_F_ALLCPUSCORE2),
@@ -914,11 +935,11 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(3CH_00H, 0x3C, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX |
- IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(3CH_01H, 0x3C, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX |
- IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
- IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2),
+ IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(3CH_02H, 0x3C, 0x02, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_SL),
IAPDESCR(3DH_01H, 0x3D, 0x01, IAP_F_FM | IAP_F_I7O),
@@ -959,22 +980,24 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(48H_00H, 0x48, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(48H_01H, 0x48, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(48H_02H, 0x48, 0x02, IAP_F_FM | IAP_F_I7O),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(48H_02H, 0x48, 0x02, IAP_F_FM | IAP_F_I7O | IAP_F_SL),
IAPDESCR(49H_00H, 0x49, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(49H_01H, 0x49, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX |
- IAP_F_HW | IAP_F_HWX),
+ IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(49H_02H, 0x49, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX |
- IAP_F_HW | IAP_F_HWX),
+ IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(49H_04H, 0x49, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(49H_10H, 0x49, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(49H_10H, 0x49, 0x1, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(49H_40H, 0x49, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX),
IAPDESCR(49H_60H, 0x49, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
IAPDESCR(49H_80H, 0x49, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7 | IAP_F_HW |
@@ -988,9 +1011,9 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(4CH_00H, 0x4C, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(4CH_01H, 0x4C, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
IAPDESCR(4CH_02H, 0x4C, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(4DH_01H, 0x4D, 0x01, IAP_F_FM | IAP_F_I7O),
@@ -1004,10 +1027,11 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(4FH_02H, 0x4F, 0x02, IAP_F_FM | IAP_F_I7O),
IAPDESCR(4FH_04H, 0x4F, 0x04, IAP_F_FM | IAP_F_I7O),
IAPDESCR(4FH_08H, 0x4F, 0x08, IAP_F_FM | IAP_F_I7O),
- IAPDESCR(4FH_10H, 0x4F, 0x10, IAP_F_FM | IAP_F_WM),
+ IAPDESCR(4FH_10H, 0x4F, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(51H_01H, 0x51, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(51H_02H, 0x51, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_SBX),
IAPDESCR(51H_04H, 0x51, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
@@ -1020,15 +1044,15 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(53H_01H, 0x53, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(58H_01H, 0x58, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(58H_02H, 0x58, 0x02, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(58H_04H, 0x58, 0x04, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(58H_08H, 0x58, 0x08, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
- IAPDESCR(59H_20H, 0x59, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
+ IAPDESCR(59H_20H, 0x59, 0x1, IAP_F_SB | IAP_F_SBX),
IAPDESCR(59H_40H, 0x59, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
IAPDESCR(59H_80H, 0x59, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
@@ -1038,27 +1062,32 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(5BH_4FH, 0x5B, 0x4F, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
IAPDESCR(5CH_01H, 0x5C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(5CH_02H, 0x5C, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(5EH_01H, 0x5E, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(5FH_01H, 0x5F, 0x01, IAP_F_FM | IAP_F_IB ), /* IB not in manual */
IAPDESCR(5FH_04H, 0x5F, 0x04, IAP_F_IBX | IAP_F_IB),
IAPDESCR(60H, 0x60, IAP_M_AGENT | IAP_M_CORE, IAP_F_ALLCPUSCORE2),
IAPDESCR(60H_01H, 0x60, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(60H_02H, 0x60, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(60H_04H, 0x60, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(60H_08H, 0x60, 0x08, IAP_F_FM | IAP_F_WM | IAP_F_I7O |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(60H_02H, 0x60, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB |
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(60H_04H, 0x60, 0x01, IAP_F_FM |IAP_F_I7O |
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(60H_08H, 0x60, 0x01, IAP_F_FM |IAP_F_I7O |
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(60H_10H, 0x7, 0x00, IAP_F_SL),
IAPDESCR(61H, 0x61, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2),
+
IAPDESCR(61H_00H, 0x61, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(62H, 0x62, IAP_M_AGENT, IAP_F_ALLCPUSCORE2),
@@ -1068,9 +1097,11 @@ static struct iap_event_descr iap_events[] = {
IAP_F_CA | IAP_F_CC2),
IAPDESCR(63H, 0x63, IAP_M_CORE, IAP_F_CC),
IAPDESCR(63H_01H, 0x63, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX ),
IAPDESCR(63H_02H, 0x63, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(64H, 0x64, IAP_M_CORE, IAP_F_CA | IAP_F_CC2),
IAPDESCR(64H_40H, 0x64, 0x40, IAP_F_FM | IAP_F_CC),
@@ -1112,29 +1143,27 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(78H, 0x78, IAP_M_CORE | IAP_M_SNOOPTYPE, IAP_F_CA | IAP_F_CC2),
IAPDESCR(79H_02H, 0x79, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(79H_04H, 0x79, 0x04, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(79H_08H, 0x79, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(79H_10H, 0x79, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(79H_04H, 0x79, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(79H_08H, 0x79, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(79H_10H, 0x79, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB |
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
- IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(79H_18H, 0x79, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(79H_20H, 0x79, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB |
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
- IAPDESCR(79H_20H, 0x79, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(79H_24H, 0x79, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
- IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(79H_30H, 0x79, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB |
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
- IAPDESCR(79H_30H, 0x79, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
- IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(7AH, 0x7A, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2),
@@ -1151,10 +1180,11 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(80H_01H, 0x80, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_CAS),
IAPDESCR(80H_02H, 0x80, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_I7 |
IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
- IAP_F_CAS | IAP_F_HWX),
+ IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(80H_03H, 0x80, 0x03, IAP_F_FM | IAP_F_CA | IAP_F_I7 |
IAP_F_WM | IAP_F_CAS),
- IAPDESCR(80H_04H, 0x80, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB | IAP_F_IBX),
+ IAPDESCR(80H_04H, 0x80, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB |
+ IAP_F_IBX | IAP_F_SL), /* SL may have a spec bug two with same entry no cmask */
IAPDESCR(81H_00H, 0x81, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(81H_01H, 0x81, 0x01, IAP_F_FM | IAP_F_I7O),
@@ -1167,20 +1197,23 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(82H_12H, 0x82, 0x12, IAP_F_FM | IAP_F_CC2),
IAPDESCR(82H_40H, 0x82, 0x40, IAP_F_FM | IAP_F_CC2),
- IAPDESCR(83H_01H, 0x83, 0x01, IAP_F_FM | IAP_F_I7O),
- IAPDESCR(83H_02H, 0x83, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
+ IAPDESCR(83H_01H, 0x83, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SL),
+ IAPDESCR(83H_02H, 0x83, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SL),
IAPDESCR(85H_00H, 0x85, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(85H_01H, 0x85, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(85H_02H, 0x85, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(85H_04H, 0x85, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(85H_0EH, 0x85, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(85H_0EH, 0x85, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
IAPDESCR(85H_10H, 0x85, 0x10, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(85H_20H, 0x85, 0x20, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(85H_20H, 0x85, 0x20, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(85H_40H, 0x85, 0x40, IAP_F_FM | IAP_F_I7O | IAP_F_HW | IAP_F_HWX),
IAPDESCR(85H_60H, 0x85, 0x60, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
IAPDESCR(85H_80H, 0x85, 0x80, IAP_F_FM | IAP_F_WM | IAP_F_I7O),
@@ -1189,7 +1222,8 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(87H_00H, 0x87, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(87H_01H, 0x87, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(87H_02H, 0x87, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(87H_04H, 0x87, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
@@ -1197,18 +1231,19 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(87H_0FH, 0x87, 0x0F, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(88H_00H, 0x88, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
- IAPDESCR(88H_01H, 0x88, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(88H_02H, 0x88, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(88H_04H, 0x88, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(88H_01H, 0x88, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(88H_02H, 0x88, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(88H_04H, 0x88, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(88H_07H, 0x88, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(88H_08H, 0x88, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(88H_10H, 0x88, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(88H_20H, 0x88, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(88H_08H, 0x88, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(88H_10H, 0x88, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(88H_20H, 0x88, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(88H_30H, 0x88, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(88H_40H, 0x88, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(88H_7FH, 0x88, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(88H_40H, 0x88, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(88H_41H, 0x88, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(88H_7FH, 0x88, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(88H_80H, 0x88, 0x0, IAP_F_FM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(88H_81H, 0x88, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
IAPDESCR(88H_82H, 0x88, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_IB |
@@ -1222,21 +1257,22 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(88H_A0H, 0x88, 0xA0, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
IAPDESCR(88H_FFH, 0x88, 0xFF, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(89H_00H, 0x89, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
- IAPDESCR(89H_01H, 0x89, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(89H_01H, 0x89, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(89H_02H, 0x89, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(89H_04H, 0x89, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(89H_04H, 0x89, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(89H_07H, 0x89, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(89H_08H, 0x89, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(89H_10H, 0x89, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(89H_20H, 0x89, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(89H_08H, 0x89, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(89H_10H, 0x89, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(89H_20H, 0x89, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(89H_30H, 0x89, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(89H_40H, 0x89, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(89H_7FH, 0x89, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(89H_40H, 0x89, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(89H_41H, 0x89, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(89H_7FH, 0x89, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(89H_80H, 0x89, 0x0, IAP_F_FM | IAP_F_BW | IAP_F_BWX),
IAPDESCR(89H_81H, 0x89, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
IAPDESCR(89H_82H, 0x89, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_IB |
@@ -1250,7 +1286,7 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(89H_A0H, 0x89, 0xA0, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
IAPDESCR(89H_FFH, 0x89, 0xFF, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(8AH_00H, 0x8A, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(8BH_00H, 0x8B, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
@@ -1268,43 +1304,53 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(97H_00H, 0x97, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(98H_00H, 0x98, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
- IAPDESCR(9CH_01H, 0x9C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(9CH_01H, 0x9C, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A0H_00H, 0xA0, 0x00, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(A1H_01H, 0xA1, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A1H_02H, 0xA1, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A1H_04H, 0xA1, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A1H_08H, 0xA1, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A1H_0CH, 0xA1, 0x0C, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX),
IAPDESCR(A1H_10H, 0xA1, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A1H_20H, 0xA1, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | /* No desc in IB for this*/
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A1H_30H, 0xA1, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX),
IAPDESCR(A1H_40H, 0xA1, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A1H_80H, 0xA1, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A2H_00H, 0xA2, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(A2H_01H, 0xA2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A2H_02H, 0xA2, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_SBX),
IAPDESCR(A2H_04H, 0xA2, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(A2H_08H, 0xA2, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(A2H_10H, 0xA2, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(A2H_20H, 0xA2, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_SBX),
IAPDESCR(A2H_40H, 0xA2, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
@@ -1312,17 +1358,30 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(A2H_80H, 0xA2, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_SBX),
- IAPDESCR(A3H_01H, 0xA3, 0x01, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(A3H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB),
- IAPDESCR(A3H_05H, 0xA3, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_IBX | IAP_F_HW | IAP_F_IB | IAP_F_HWX),
- IAPDESCR(A3H_0CH, 0xA3, 0x08, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
-
- IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
+ IAPDESCR(A3H_01H, 0xA3, 0x02, IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW |
+ IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW |
+ IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(A3H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_SL),
+ IAPDESCR(A3H_05H, 0xA3, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
+ IAPDESCR(A3H_06H, 0xA3, 0x06, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_IBX | IAP_F_HW | IAP_F_IB | IAP_F_HWX |
+ IAP_F_SL),
+ IAPDESCR(A3H_0CH, 0xA3, 0x0C, IAP_F_FM | IAP_F_HW | IAP_F_HW | IAP_F_SL),
+ IAPDESCR(A3H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(A3H_14H, 0xA3, 0x14, IAP_F_FM | IAP_F_SL),
+
+ IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL),
+ IAPDESCR(A6H_02H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(A6H_04H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(A6H_08H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(A6H_10H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(A6H_40H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL),
+
+ IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM ),
IAPDESCR(A8H_01H, 0xA8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IBX |
- IAP_F_IB |IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IB |IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX |
+ IAP_F_SL),
IAPDESCR(AAH_01H, 0xAA, 0x01, IAP_F_FM | IAP_F_CC2),
IAPDESCR(AAH_02H, 0xAA, 0x02, IAP_F_FM | IAP_F_CA),
@@ -1332,35 +1391,40 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(ABH_01H, 0xAB, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
IAPDESCR(ABH_02H, 0xAB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX),
- IAPDESCR(ACH_02H, 0xAC, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
+ IAPDESCR(ACH_02H, 0xAC, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_SL),
IAPDESCR(ACH_08H, 0xAC, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX),
IAPDESCR(ACH_0AH, 0xAC, 0x0A, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
IAPDESCR(AEH_01H, 0xAE, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(B0H_00H, 0xB0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(B0H_01H, 0xB0, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(B0H_02H, 0xB0, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(B0H_04H, 0xB0, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_I7O |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(B0H_08H, 0xB0, 0x08, IAP_F_FM | IAP_F_WM | IAP_F_I7O |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(B0H_10H, 0xB0, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_I7O),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(B0H_10H, 0xB0, 0x10, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SL),
IAPDESCR(B0H_20H, 0xB0, 0x20, IAP_F_FM | IAP_F_I7O),
IAPDESCR(B0H_40H, 0xB0, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
- IAPDESCR(B0H_80H, 0xB0, 0x80, IAP_F_FM | IAP_F_CA | IAP_F_WM | IAP_F_I7O),
+ IAPDESCR(B0H_80H, 0xB0, 0x80, IAP_F_FM | IAP_F_CA | IAP_F_WM | IAP_F_I7O | IAP_F_SL),
IAPDESCR(B1H_00H, 0xB1, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(B1H_01H, 0xB1, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
- IAPDESCR(B1H_02H, 0xB1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(B1H_02H, 0xB1, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(B1H_04H, 0xB1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(B1H_08H, 0xB1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
@@ -1399,7 +1463,7 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(B7H_01H, 0xB7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS |
- IAP_F_HWX),
+ IAP_F_HWX |IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(B7H_02H, 0xB7, 0x02, IAP_F_CAS),
IAPDESCR(B8H_01H, 0xB8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
@@ -1410,19 +1474,20 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(BAH_02H, 0xBA, 0x02, IAP_F_FM | IAP_F_I7O),
IAPDESCR(BBH_01H, 0xBB, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
-
- IAPDESCR(BCH_11H, 0xBC, 0x11, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(BCH_12H, 0xBC, 0x12, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(BCH_14H, 0xBC, 0x14, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(BCH_18H, 0xBC, 0x18, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(BCH_21H, 0xBC, 0x21, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(BCH_22H, 0xBC, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(BCH_24H, 0xBC, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+
+ IAPDESCR(BCH_11H, 0xBC, 0x11, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(BCH_12H, 0xBC, 0x12, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(BCH_14H, 0xBC, 0x14, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(BCH_18H, 0xBC, 0x18, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(BCH_21H, 0xBC, 0x21, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(BCH_22H, 0xBC, 0x22, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(BCH_24H, 0xBC, 0x24, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(BCH_28H, 0xBC, 0x28, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
IAPDESCR(BDH_01H, 0xBD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL), /* spec bug SL? */
IAPDESCR(BDH_20H, 0xBD, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
@@ -1430,12 +1495,12 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 |
IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
- IAP_F_CAS | IAP_F_HWX),
- IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
+ IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(C0H_01H, 0xC0, 0x0a, IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C0H_02H, 0xC0, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM | IAP_F_SB),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_BW | IAP_F_BWX),
IAPDESCR(C0H_04H, 0xC0, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM),
IAPDESCR(C0H_08H, 0xC0, 0x08, IAP_F_FM | IAP_F_CC2E),
@@ -1444,22 +1509,23 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(C1H_01H, 0xC1, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(C1H_02H, 0xC1, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
IAPDESCR(C1H_08H, 0xC1, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(C1H_10H, 0xC1, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(C1H_20H, 0xC1, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX),
- IAPDESCR(C1H_40H, 0xC1, 0x40, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(C1H_3FH, 0xC1, 0x00, IAP_F_FM | IAP_F_SL),
+ IAPDESCR(C1H_40H, 0xC1, 0x40, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(C1H_80H, 0xC1, 0x80, IAP_F_IB | IAP_F_IBX),
IAPDESCR(C1H_FEH, 0xC1, 0xFE, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(C2H_00H, 0xC2, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(C2H_01H, 0xC2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C2H_02H, 0xC2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C2H_04H, 0xC2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM),
IAPDESCR(C2H_07H, 0xC2, 0x07, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
@@ -1469,41 +1535,41 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(C3H_00H, 0xC3, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(C3H_01H, 0xC3, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM | IAP_F_CAS),
+ IAP_F_I7 | IAP_F_WM | IAP_F_CAS | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C3H_02H, 0xC3, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
- IAP_F_CAS | IAP_F_HWX),
+ IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C3H_04H, 0xC3, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C3H_08H, 0xC3, 0x08, IAP_F_CAS),
IAPDESCR(C3H_10H, 0xC3, 0x10, IAP_F_FM | IAP_F_I7O),
IAPDESCR(C3H_20H, 0xC3, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(C4H_00H, 0xC4, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_01H, 0xC4, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_02H, 0xC4, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_04H, 0xC4, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_08H, 0xC4, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW |
- IAP_F_HWX),
+ IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_0CH, 0xC4, 0x0C, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(C4H_0FH, 0xC4, 0x0F, IAP_F_FM | IAP_F_CA),
IAPDESCR(C4H_10H, 0xC4, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_20H, 0xC4, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_40H, 0xC4, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C4H_7EH, 0xC4, 0x7E, IAP_F_CAS),
IAPDESCR(C4H_BFH, 0xC4, 0xBF, IAP_F_CAS),
IAPDESCR(C4H_EBH, 0xC4, 0xEB, IAP_F_CAS),
@@ -1515,17 +1581,18 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(C5H_00H, 0xC5, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB |
- IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_SL),
IAPDESCR(C5H_04H, 0xC5, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB |
- IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX |
+ IAP_F_SL),
IAPDESCR(C5H_10H, 0xC5, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX),
IAPDESCR(C5H_20H, 0xC5, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL),
IAPDESCR(C5H_7EH, 0xC5, 0x7E, IAP_F_CAS),
IAPDESCR(C5H_BFH, 0xC5, 0xBF, IAP_F_CAS),
IAPDESCR(C5H_EBH, 0xC5, 0xEB, IAP_F_CAS),
@@ -1536,21 +1603,23 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(C5H_FEH, 0xC5, 0xFE, IAP_F_CAS),
IAPDESCR(C6H_00H, 0xC6, 0x00, IAP_F_FM | IAP_F_CC),
- IAPDESCR(C6H_01H, 0xC6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
+ /* For SL C6_01 needs EV_SEL? 0x11, 0x12, 0x13, 0x14, 0x15? */
+ IAPDESCR(C6H_01H, 0xC6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SL),
IAPDESCR(C6H_02H, 0xC6, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
IAPDESCR(C7H_00H, 0xC7, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(C7H_01H, 0xC7, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SL),
IAPDESCR(C7H_02H, 0xC7, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SL),
IAPDESCR(C7H_04H, 0xC7, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SL),
IAPDESCR(C7H_08H, 0xC7, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SL),
IAPDESCR(C7H_10H, 0xC7, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM),
+ IAP_F_I7 | IAP_F_WM | IAP_F_SL),
IAPDESCR(C7H_1FH, 0xC7, 0x1F, IAP_F_FM | IAP_F_CA | IAP_F_CC2),
+ IAPDESCR(C7H_20H, 0xC7, 0x0, IAP_F_FM | IAP_F_SL),
IAPDESCR(C8H_00H, 0xC8, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(C8H_20H, 0xC8, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
@@ -1560,21 +1629,24 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(CAH_00H, 0xCA, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(CAH_01H, 0xCA, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS),
IAPDESCR(CAH_02H, 0xCA, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(CAH_04H, 0xCA, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(CAH_08H, 0xCA, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(CAH_10H, 0xCA, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(CAH_1EH, 0xCA, 0x1E, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(CAH_20H, 0xCA, 0x20, IAP_F_CAS),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
+ IAPDESCR(CAH_1EH, 0xCA, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB |
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(CAH_20H, 0xCA, 0x0, IAP_F_FM | IAP_F_CAS | IAP_F_BW | IAP_F_BWX),
IAPDESCR(CAH_3FH, 0xCA, 0x3F, IAP_F_CAS),
IAPDESCR(CAH_50H, 0xCA, 0x50, IAP_F_CAS),
IAPDESCR(CBH_01H, 0xCB, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
- IAP_F_I7 | IAP_F_WM | IAP_F_CAS),
+ IAP_F_I7 | IAP_F_WM | IAP_F_CAS | IAP_F_SL),
IAPDESCR(CBH_02H, 0xCB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM),
IAPDESCR(CBH_04H, 0xCB, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
@@ -1594,11 +1666,12 @@ static struct iap_event_descr iap_events[] = {
IAP_F_I7 | IAP_F_WM),
IAPDESCR(CCH_03H, 0xCC, 0x03, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(CCH_20H, 0xCC, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(CDH_00H, 0xCD, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(CDH_01H, 0xCD, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX |
+ IAP_F_SL),
IAPDESCR(CDH_02H, 0xCD, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB |
IAP_F_SBX | IAP_F_IBX),
@@ -1609,45 +1682,50 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(D0H_00H, 0xD0, 0x00, IAP_F_FM | IAP_F_CC),
IAPDESCR(D0H_01H, 0xD0, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(D0H_11H, 0xD0, 0x11, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D0H_12H, 0xD0, 0x12, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(D0H_21H, 0xD0, 0x21, IAP_F_FM | IAP_F_SB | IAP_F_SBX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(D0H_21H, 0xD0, 0x21, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_BW | IAP_F_BWX |
+ IAP_F_SL),
IAPDESCR(D0H_41H, 0xD0, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D0H_42H, 0xD0, 0x42, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D0H_81H, 0xD0, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D0H_82H, 0xD0, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D1H_01H, 0xD1, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB |
- IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW |
+ IAP_F_BWX | IAP_F_SL),
IAPDESCR(D1H_02H, 0xD1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D1H_04H, 0xD1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D1H_08H, 0xD1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
- IAPDESCR(D1H_10H, 0xD1, 0x10, IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
+ IAPDESCR(D1H_10H, 0xD1, 0x10, IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D1H_20H, 0xD1, 0x20, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB |
- IAP_F_HW | IAP_F_HWX),
+ IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D1H_40H, 0xD1, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D2H_01H, 0xD2, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D2H_02H, 0xD2, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D2H_04H, 0xD2, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D2H_08H, 0xD2, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(D2H_0FH, 0xD2, 0x0F, IAP_F_FM | IAP_F_CA | IAP_F_CC2 |
IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_IB |
IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
@@ -1655,7 +1733,7 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(D2H_10H, 0xD2, 0x10, IAP_F_FM | IAP_F_CC2E),
IAPDESCR(D3H_01H, 0xD3, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_SBX |
- IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(D3H_03H, 0xD3, 0x03, IAP_F_IBX),
IAPDESCR(D3H_04H, 0xD3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), /* Not defined for IBX */
IAPDESCR(D3H_0CH, 0xD3, 0x0C, IAP_F_IBX),
@@ -1717,7 +1795,7 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(E6H_00H, 0xE6, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CC2),
IAPDESCR(E6H_01H, 0xE6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 |
- IAP_F_WM | IAP_F_SBX | IAP_F_CAS),
+ IAP_F_WM | IAP_F_SBX | IAP_F_CAS | IAP_F_SL),
IAPDESCR(E6H_02H, 0xE6, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM),
IAPDESCR(E6H_08H, 0xE6, 0x08, IAP_F_CAS),
IAPDESCR(E6H_10H, 0xE6, 0x10, IAP_F_CAS),
@@ -1734,30 +1812,41 @@ static struct iap_event_descr iap_events[] = {
IAPDESCR(F0H_00H, 0xF0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2),
IAPDESCR(F0H_01H, 0xF0, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F0H_02H, 0xF0, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F0H_04H, 0xF0, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F0H_08H, 0xF0, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F0H_10H, 0xF0, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F0H_20H, 0xF0, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F0H_40H, 0xF0, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(F0H_80H, 0xF0, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F1H_01H, 0xF1, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB |
- IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(F1H_02H, 0xF1, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX),
IAPDESCR(F1H_04H, 0xF1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX ),
IAPDESCR(F1H_07H, 0xF1, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
- IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX),
+ IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX |
+ IAP_F_BW | IAP_F_BWX | IAP_F_SL),
IAPDESCR(F2H_01H, 0xF2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
@@ -1765,7 +1854,7 @@ static struct iap_event_descr iap_events[] = {
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
IAPDESCR(F2H_04H, 0xF2, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
- IAPDESCR(F2H_05H, 0xF2, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
+ IAPDESCR(F2H_05H, 0xF2, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX),
IAPDESCR(F2H_06H, 0xF2, 0x06, IAP_F_FM | IAP_F_HW | IAP_F_HWX),
IAPDESCR(F2H_08H, 0xF2, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM |
IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX),
@@ -2083,7 +2172,9 @@ iap_allocate_pmc(int cpu, int ri, struct pmc *pm,
if (iap_event_corei7_ok_on_counter(ev, ri) == 0)
return (EINVAL);
break;
+ case PMC_CPU_INTEL_SKYLAKE:
case PMC_CPU_INTEL_BROADWELL:
+ case PMC_CPU_INTEL_BROADWELL_XEON:
case PMC_CPU_INTEL_SANDYBRIDGE:
case PMC_CPU_INTEL_SANDYBRIDGE_XEON:
case PMC_CPU_INTEL_IVYBRIDGE:
@@ -2116,6 +2207,12 @@ iap_allocate_pmc(int cpu, int ri, struct pmc *pm,
case PMC_CPU_INTEL_ATOM_SILVERMONT:
cpuflag = IAP_F_CAS;
break;
+ case PMC_CPU_INTEL_SKYLAKE:
+ cpuflag = IAP_F_SL;
+ break;
+ case PMC_CPU_INTEL_BROADWELL_XEON:
+ cpuflag = IAP_F_BWX;
+ break;
case PMC_CPU_INTEL_BROADWELL:
cpuflag = IAP_F_BW;
break;
diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c
index ce49f54..dc52cce 100644
--- a/sys/dev/hwpmc/hwpmc_intel.c
+++ b/sys/dev/hwpmc/hwpmc_intel.c
@@ -179,10 +179,21 @@ pmc_intel_initialize(void)
cputype = PMC_CPU_INTEL_IVYBRIDGE_XEON;
nclasses = 3;
break;
+ case 0x4e:
+ case 0x5e:
+ cputype = PMC_CPU_INTEL_SKYLAKE;
+ nclasses = 3;
+ break;
case 0x3D:
+ case 0x47:
cputype = PMC_CPU_INTEL_BROADWELL;
nclasses = 3;
break;
+ case 0x4f:
+ case 0x56:
+ cputype = PMC_CPU_INTEL_BROADWELL_XEON;
+ nclasses = 3;
+ break;
case 0x3F: /* Per Intel document 325462-045US 09/2014. */
case 0x46: /* Per Intel document 325462-045US 09/2014. */
/* Should 46 be XEON. probably its own? */
@@ -232,6 +243,8 @@ pmc_intel_initialize(void)
case PMC_CPU_INTEL_ATOM:
case PMC_CPU_INTEL_ATOM_SILVERMONT:
case PMC_CPU_INTEL_BROADWELL:
+ case PMC_CPU_INTEL_BROADWELL_XEON:
+ case PMC_CPU_INTEL_SKYLAKE:
case PMC_CPU_INTEL_CORE:
case PMC_CPU_INTEL_CORE2:
case PMC_CPU_INTEL_CORE2EXTREME:
@@ -326,6 +339,8 @@ pmc_intel_finalize(struct pmc_mdep *md)
case PMC_CPU_INTEL_ATOM:
case PMC_CPU_INTEL_ATOM_SILVERMONT:
case PMC_CPU_INTEL_BROADWELL:
+ case PMC_CPU_INTEL_BROADWELL_XEON:
+ case PMC_CPU_INTEL_SKYLAKE:
case PMC_CPU_INTEL_CORE:
case PMC_CPU_INTEL_CORE2:
case PMC_CPU_INTEL_CORE2EXTREME:
diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h
index 696eea8..864ec95 100644
--- a/sys/dev/hwpmc/pmc_events.h
+++ b/sys/dev/hwpmc/pmc_events.h
@@ -540,8 +540,10 @@ __PMC_EV(IAP, EVENT_0BH_10H) \
__PMC_EV(IAP, EVENT_0CH_01H) \
__PMC_EV(IAP, EVENT_0CH_02H) \
__PMC_EV(IAP, EVENT_0CH_03H) \
+__PMC_EV(IAP, EVENT_0DH_01H) \
__PMC_EV(IAP, EVENT_0DH_03H) \
__PMC_EV(IAP, EVENT_0DH_40H) \
+__PMC_EV(IAP, EVENT_0DH_80H) \
__PMC_EV(IAP, EVENT_0EH_01H) \
__PMC_EV(IAP, EVENT_0EH_02H) \
__PMC_EV(IAP, EVENT_0EH_10H) \
@@ -621,6 +623,8 @@ __PMC_EV(IAP, EVENT_24H_22H) \
__PMC_EV(IAP, EVENT_24H_24H) \
__PMC_EV(IAP, EVENT_24H_27H) \
__PMC_EV(IAP, EVENT_24H_30H) \
+__PMC_EV(IAP, EVENT_24H_38H) \
+__PMC_EV(IAP, EVENT_24H_3FH) \
__PMC_EV(IAP, EVENT_24H_40H) \
__PMC_EV(IAP, EVENT_24H_41H) \
__PMC_EV(IAP, EVENT_24H_42H) \
@@ -628,13 +632,15 @@ __PMC_EV(IAP, EVENT_24H_44H) \
__PMC_EV(IAP, EVENT_24H_50H) \
__PMC_EV(IAP, EVENT_24H_80H) \
__PMC_EV(IAP, EVENT_24H_AAH) \
-__PMC_EV(IAP, EVENT_24H_3FH) \
__PMC_EV(IAP, EVENT_24H_BFH) \
__PMC_EV(IAP, EVENT_24H_C0H) \
+__PMC_EV(IAP, EVENT_24H_D8H) \
__PMC_EV(IAP, EVENT_24H_E1H) \
__PMC_EV(IAP, EVENT_24H_E2H) \
__PMC_EV(IAP, EVENT_24H_E4H) \
__PMC_EV(IAP, EVENT_24H_E7H) \
+__PMC_EV(IAP, EVENT_24H_EFH) \
+__PMC_EV(IAP, EVENT_24H_F7H) \
__PMC_EV(IAP, EVENT_24H_F8H) \
__PMC_EV(IAP, EVENT_24H_FFH) \
__PMC_EV(IAP, EVENT_25H) \
@@ -719,10 +725,10 @@ __PMC_EV(IAP, EVENT_48H_00H) \
__PMC_EV(IAP, EVENT_48H_01H) \
__PMC_EV(IAP, EVENT_48H_02H) \
__PMC_EV(IAP, EVENT_49H_00H) \
-__PMC_EV(IAP, EVENT_49H_0EH) \
__PMC_EV(IAP, EVENT_49H_01H) \
__PMC_EV(IAP, EVENT_49H_02H) \
__PMC_EV(IAP, EVENT_49H_04H) \
+__PMC_EV(IAP, EVENT_49H_0EH) \
__PMC_EV(IAP, EVENT_49H_10H) \
__PMC_EV(IAP, EVENT_49H_20H) \
__PMC_EV(IAP, EVENT_49H_40H) \
@@ -773,6 +779,7 @@ __PMC_EV(IAP, EVENT_60H_01H) \
__PMC_EV(IAP, EVENT_60H_02H) \
__PMC_EV(IAP, EVENT_60H_04H) \
__PMC_EV(IAP, EVENT_60H_08H) \
+__PMC_EV(IAP, EVENT_60H_10H) \
__PMC_EV(IAP, EVENT_61H) \
__PMC_EV(IAP, EVENT_61H_00H) \
__PMC_EV(IAP, EVENT_62H) \
@@ -801,10 +808,10 @@ __PMC_EV(IAP, EVENT_79H_02H) \
__PMC_EV(IAP, EVENT_79H_04H) \
__PMC_EV(IAP, EVENT_79H_08H) \
__PMC_EV(IAP, EVENT_79H_10H) \
-__PMC_EV(IAP, EVENT_79H_20H) \
-__PMC_EV(IAP, EVENT_79H_30H) \
__PMC_EV(IAP, EVENT_79H_18H) \
+__PMC_EV(IAP, EVENT_79H_20H) \
__PMC_EV(IAP, EVENT_79H_24H) \
+__PMC_EV(IAP, EVENT_79H_30H) \
__PMC_EV(IAP, EVENT_79H_3CH) \
__PMC_EV(IAP, EVENT_7AH) \
__PMC_EV(IAP, EVENT_7BH) \
@@ -924,11 +931,20 @@ __PMC_EV(IAP, EVENT_A3H_01H) \
__PMC_EV(IAP, EVENT_A3H_02H) \
__PMC_EV(IAP, EVENT_A3H_04H) \
__PMC_EV(IAP, EVENT_A3H_05H) \
+__PMC_EV(IAP, EVENT_A3H_06H) \
__PMC_EV(IAP, EVENT_A3H_08H) \
__PMC_EV(IAP, EVENT_A3H_0CH) \
+__PMC_EV(IAP, EVENT_A3H_10H) \
+__PMC_EV(IAP, EVENT_A3H_14H) \
__PMC_EV(IAP, EVENT_A6H_01H) \
+__PMC_EV(IAP, EVENT_A6H_02H) \
+__PMC_EV(IAP, EVENT_A6H_04H) \
+__PMC_EV(IAP, EVENT_A6H_08H) \
+__PMC_EV(IAP, EVENT_A6H_10H) \
+__PMC_EV(IAP, EVENT_A6H_40H) \
__PMC_EV(IAP, EVENT_A7H_01H) \
__PMC_EV(IAP, EVENT_A8H_01H) \
+__PMC_EV(IAP, EVENT_A8H_02H) \
__PMC_EV(IAP, EVENT_AAH_01H) \
__PMC_EV(IAP, EVENT_AAH_02H) \
__PMC_EV(IAP, EVENT_AAH_03H) \
@@ -1007,6 +1023,7 @@ __PMC_EV(IAP, EVENT_C1H_02H) \
__PMC_EV(IAP, EVENT_C1H_08H) \
__PMC_EV(IAP, EVENT_C1H_10H) \
__PMC_EV(IAP, EVENT_C1H_20H) \
+__PMC_EV(IAP, EVENT_C1H_3FH) \
__PMC_EV(IAP, EVENT_C1H_40H) \
__PMC_EV(IAP, EVENT_C1H_80H) \
__PMC_EV(IAP, EVENT_C1H_FEH) \
@@ -1067,6 +1084,7 @@ __PMC_EV(IAP, EVENT_C7H_04H) \
__PMC_EV(IAP, EVENT_C7H_08H) \
__PMC_EV(IAP, EVENT_C7H_10H) \
__PMC_EV(IAP, EVENT_C7H_1FH) \
+__PMC_EV(IAP, EVENT_C7H_20H) \
__PMC_EV(IAP, EVENT_C8H_00H) \
__PMC_EV(IAP, EVENT_C8H_20H) \
__PMC_EV(IAP, EVENT_C9H_00H) \
@@ -1558,7 +1576,566 @@ __PMC_EV_ALIAS("MS_DECODED.MS_ENTRY", IAP_EVENT_E7H_01H)
* Aliases for Broadwell PMC events.
*/
#define __PMC_EV_ALIAS_BROADWELL() \
-__PMC_EV_ALIAS_INTEL_ARCHITECTURAL()
+__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \
+__PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \
+__PMC_EV_ALIAS("LD_BLOCKS.NO_SR", IAP_EVENT_03H_08H) \
+__PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \
+__PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES", IAP_EVENT_05H_02H) \
+__PMC_EV_ALIAS("LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", IAP_EVENT_07H_01H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_08H_01H)\
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_4K", IAP_EVENT_08H_02H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_DURATION", IAP_EVENT_08H_10H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT_4K", IAP_EVENT_08H_20H) \
+__PMC_EV_ALIAS("INT_MISC.RECOVERY_CYCLES", IAP_EVENT_0DH_03H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.ANY", IAP_EVENT_0EH_01H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.FLAGS_MERGE", IAP_EVENT_0EH_10H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.SLOW_LEA", IAP_EVENT_0EH_20H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.SINGLE_MUL", IAP_EVENT_0EH_40H) \
+__PMC_EV_ALIAS("ARITH.FPU_DIV_ACTIVE", IAP_EVENT_14H_01H) \
+__PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_MISS", IAP_EVENT_24H_21H) \
+__PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_HIT", IAP_EVENT_24H_41H) \
+__PMC_EV_ALIAS("L2_RQSTS.L2_PF_HIT", IAP_EVENT_24H_50H) \
+__PMC_EV_ALIAS("L2_RQSTS.L2_PF_MISS", IAP_EVENT_24H_30H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_DATA_RD", IAP_EVENT_24H_E1H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_RFO", IAP_EVENT_24H_E2H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_CODE_RD", IAP_EVENT_24H_E4H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_PF", IAP_EVENT_24H_F8H) \
+__PMC_EV_ALIAS("L2_DEMAND_RQSTS.WB_HIT", IAP_EVENT_27H_50H) \
+__PMC_EV_ALIAS("LONGEST_LAT_CACHE.REFERENCE", IAP_EVENT_2EH_4FH) \
+__PMC_EV_ALIAS("LONGEST_LAT_CACHE.MISS", IAP_EVENT_2EH_41H) \
+__PMC_EV_ALIAS("CPU_CLK_UNHALTED.THREAD_P", IAP_EVENT_3CH_00H) \
+__PMC_EV_ALIAS("CPU_CLK_THREAD_UNHALTED.REF_XCLK", IAP_EVENT_3CH_01H) \
+__PMC_EV_ALIAS("L1D_PEND_MISS.PENDING", IAP_EVENT_48H_01H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.MISS_CAUSES_A_WALK", \
+ IAP_EVENT_49H_01H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED_4K", \
+ IAP_EVENT_49H_02H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_DURATION", IAP_EVENT_49H_10H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT_4K", IAP_EVENT_49H_20H) \
+__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \
+__PMC_EV_ALIAS("EPT.WALK_CYCLES", IAP_EVENT_4FH_10H) \
+__PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.INT_NOT_ELIMINATED", \
+ IAP_EVENT_58H_04H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_NOT_ELIMINATED", \
+ IAP_EVENT_58H_08H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.INT_ELIMINATED", IAP_EVENT_58H_01H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_ELIMINATED", IAP_EVENT_58H_02H) \
+__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_01H) \
+__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_02H) \
+__PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \
+ IAP_EVENT_60H_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", \
+ IAP_EVENT_60H_02H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", \
+ IAP_EVENT_60H_04H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", \
+ IAP_EVENT_60H_08H) \
+__PMC_EV_ALIAS("LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION", \
+ IAP_EVENT_63H_01H) \
+__PMC_EV_ALIAS("LOCK_CYCLES.CACHE_LOCK_DURATION", IAP_EVENT_63H_02H) \
+__PMC_EV_ALIAS("IDQ.EMPTY", IAP_EVENT_79H_02H) \
+__PMC_EV_ALIAS("IDQ.MITE_UOPS", IAP_EVENT_79H_04H) \
+__PMC_EV_ALIAS("IDQ.DSB_UOPS", IAP_EVENT_79H_08H) \
+__PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \
+__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \
+__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \
+__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \
+__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_ANY_UOPS", IAP_EVENT_79H_24H) \
+__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \
+__PMC_EV_ALIAS("ICACHE.MISSES", IAP_EVENT_80H_02H) \
+__PMC_EV_ALIAS("ITLB_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_85H_01H) \
+__PMC_EV_ALIAS("ITLB_MISSES.WALK_COMPLETED_4K", IAP_EVENT_85H_02H) \
+__PMC_EV_ALIAS("ITLB_MISSES.WALK_DURATION", IAP_EVENT_85H_10H) \
+__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_4K", IAP_EVENT_85H_20H) \
+__PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT", IAP_EVENT_88H_02H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NON_CALL", IAP_EVENT_88H_04H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.ALL_BRANCHES", IAP_EVENT_88H_FFH) \
+__PMC_EV_ALIAS("BR_MISP_EXE.COND", IAP_EVENT_89H_01H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NON_CALL", IAP_EVENT_89H_04H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_08H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_10H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_20H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN", IAP_EVENT_89H_40H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN", IAP_EVENT_89H_80H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.ALL_BRANCHES", IAP_EVENT_89H_FFH) \
+__PMC_EV_ALIAS("IDQ_UOPS_NOT_DELIVERED.CORE", IAP_EVENT_9CH_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_0", IAP_EVENT_A1H_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_1", IAP_EVENT_A1H_02H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_2", IAP_EVENT_A1H_04H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_3", IAP_EVENT_A1H_08H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_4", IAP_EVENT_A1H_10H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_5", IAP_EVENT_A1H_20H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_6", IAP_EVENT_A1H_40H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_7", IAP_EVENT_A1H_80H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.ANY", IAP_EVENT_A2H_01H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.RS", IAP_EVENT_A2H_04H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.SB", IAP_EVENT_A2H_08H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.ROB", IAP_EVENT_A2H_10H) \
+__PMC_EV_ALIAS("LSD.UOPS", IAP_EVENT_A8H_01H) \
+__PMC_EV_ALIAS("ITLB.ITLB_FLUSH", IAP_EVENT_AEH_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_DATA_RD", IAP_EVENT_B0H_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_CODE_RD", IAP_EVENT_B0H_02H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_RFO", IAP_EVENT_B0H_04H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.ALL_DATA_RD", IAP_EVENT_B0H_08H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED.THREAD", IAP_EVENT_B1H_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED.CORE", IAP_EVENT_B1H_02H) \
+__PMC_EV_ALIAS("OFF_CORE_RESPONSE_0", IAP_EVENT_B7H_01H) \
+__PMC_EV_ALIAS("OFF_CORE_RESPONSE_1", IAP_EVENT_BBH_01H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_L1", IAP_EVENT_BCH_11H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_L1", IAP_EVENT_BCH_21H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_L2", IAP_EVENT_BCH_12H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_L2", IAP_EVENT_BCH_22H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_L3", IAP_EVENT_BCH_14H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_L3", IAP_EVENT_BCH_24H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_MEMORY", IAP_EVENT_BCH_18H) \
+__PMC_EV_ALIAS("INST_RETIRED.ANY_P", IAP_EVENT_C0H_00H) \
+__PMC_EV_ALIAS("INST_RETIRED.PREC_DIST", IAP_EVENT_C0H_01H) \
+__PMC_EV_ALIAS("INST_RETIRED.X87", IAP_EVENT_C0H_02H) \
+__PMC_EV_ALIAS("OTHER_ASSISTS.AVX_TO_SSE", IAP_EVENT_C1H_08H) \
+__PMC_EV_ALIAS("OTHER_ASSISTS.SSE_TO_AVX", IAP_EVENT_C1H_10H) \
+__PMC_EV_ALIAS("OTHER_ASSISTS.ANY_WB_ASSIST", IAP_EVENT_C1H_40H) \
+__PMC_EV_ALIAS("UOPS_RETIRED.ALL", IAP_EVENT_C2H_01H) \
+__PMC_EV_ALIAS("UOPS_RETIRED.RETIRE_SLOTS", IAP_EVENT_C2H_02H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.MEMORY_ORDERING", IAP_EVENT_C3H_02H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.MASKMOV", IAP_EVENT_C3H_20H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_00H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_RETURN", IAP_EVENT_C4H_08H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NOT_TAKEN", IAP_EVENT_C4H_10H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_TAKEN", IAP_EVENT_C4H_20H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.FAR_BRANCH", IAP_EVENT_C4H_40H) \
+__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \
+__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \
+__PMC_EV_ALIAS("BR_MISP_U_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \
+__PMC_EV_ALIAS("FP_ASSIST.X87_OUTPUT", IAP_EVENT_CAH_02H) \
+__PMC_EV_ALIAS("FP_ASSIST.X87_INPUT", IAP_EVENT_CAH_04H) \
+__PMC_EV_ALIAS("FP_ASSIST.SIMD_OUTPUT", IAP_EVENT_CAH_08H) \
+__PMC_EV_ALIAS("FP_ASSIST.SIMD_INPUT", IAP_EVENT_CAH_10H) \
+__PMC_EV_ALIAS("FP_ASSIST.ANY", IAP_EVENT_CAH_1EH) \
+__PMC_EV_ALIAS("ROB_MISC_EVENTS.LBR_INSERTS", IAP_EVENT_CCH_20H) \
+__PMC_EV_ALIAS("MEM_TRANS_RETIRED.LOAD_LATENCY", IAP_EVENT_CDH_01H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_LOADS", IAP_EVENT_D0H_11H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_STORES", IAP_EVENT_D0H_12H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.LOCK_LOADS", IAP_EVENT_D0H_21H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_HIT", IAP_EVENT_D1H_01H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_HIT", IAP_EVENT_D1H_02H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L3_HIT", IAP_EVENT_D1H_04H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_MISS", IAP_EVENT_D1H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_MISS", IAP_EVENT_D1H_10H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L3_MISS", IAP_EVENT_D1H_20H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.HIT_LFB", IAP_EVENT_D1H_40H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS", \
+ IAP_EVENT_D2H_01H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT", \
+ IAP_EVENT_D2H_02H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM", \
+ IAP_EVENT_D2H_04H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \
+ IAP_EVENT_D2H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \
+ IAP_EVENT_D3H_01H) \
+__PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \
+__PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) \
+__PMC_EV_ALIAS("L2_TRANS.CODE_RD", IAP_EVENT_F0H_04H) \
+__PMC_EV_ALIAS("L2_TRANS.ALL_PF", IAP_EVENT_F0H_08H) \
+__PMC_EV_ALIAS("L2_TRANS.L1D_WB", IAP_EVENT_F0H_10H) \
+__PMC_EV_ALIAS("L2_TRANS.L2_FILL", IAP_EVENT_F0H_20H) \
+__PMC_EV_ALIAS("L2_TRANS.L2_WB", IAP_EVENT_F0H_40H) \
+__PMC_EV_ALIAS("L2_TRANS.ALL_REQUESTS", IAP_EVENT_F0H_80H) \
+__PMC_EV_ALIAS("L2_LINES_IN.I", IAP_EVENT_F1H_01H) \
+__PMC_EV_ALIAS("L2_LINES_IN.S", IAP_EVENT_F1H_02H) \
+__PMC_EV_ALIAS("L2_LINES_IN.E", IAP_EVENT_F1H_04H) \
+__PMC_EV_ALIAS("L2_LINES_IN.ALL", IAP_EVENT_F1H_07H) \
+__PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_05H)
+
+/*
+ * Aliases for Broadwell XEON PMC events.
+ */
+#define __PMC_EV_ALIAS_BROADWELL_XEON() \
+__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \
+__PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \
+__PMC_EV_ALIAS("LD_BLOCKS.NO_SR", IAP_EVENT_03H_08H) \
+__PMC_EV_ALIAS("MISALIGN_MEM_REF.LOADS", IAP_EVENT_05H_01H) \
+__PMC_EV_ALIAS("MISALIGN_MEM_REF.STORES", IAP_EVENT_05H_02H) \
+__PMC_EV_ALIAS("LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", IAP_EVENT_07H_01H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_08H_01H)\
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED_4K", IAP_EVENT_08H_02H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_DURATION", IAP_EVENT_08H_10H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT_4K", IAP_EVENT_08H_20H) \
+__PMC_EV_ALIAS("INT_MISC.RECOVERY_CYCLES", IAP_EVENT_0DH_03H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.ANY", IAP_EVENT_0EH_01H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.FLAGS_MERGE", IAP_EVENT_0EH_10H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.SLOW_LEA", IAP_EVENT_0EH_20H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.SINGLE_MUL", IAP_EVENT_0EH_40H) \
+__PMC_EV_ALIAS("ARITH.FPU_DIV_ACTIVE", IAP_EVENT_14H_01H) /**/ \
+__PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_MISS", IAP_EVENT_24H_21H) \
+__PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_HIT", IAP_EVENT_24H_41H) \
+__PMC_EV_ALIAS("L2_RQSTS.L2_PF_HIT", IAP_EVENT_24H_50H) \
+__PMC_EV_ALIAS("L2_RQSTS.L2_PF_MISS", IAP_EVENT_24H_30H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_DATA_RD", IAP_EVENT_24H_E1H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_RFO", IAP_EVENT_24H_E2H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_CODE_RD", IAP_EVENT_24H_E4H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_PF", IAP_EVENT_24H_F8H) \
+__PMC_EV_ALIAS("L2_DEMAND_RQSTS.WB_HIT", IAP_EVENT_27H_50H) \
+__PMC_EV_ALIAS("LONGEST_LAT_CACHE.REFERENCE", IAP_EVENT_2EH_4FH) \
+__PMC_EV_ALIAS("LONGEST_LAT_CACHE.MISS", IAP_EVENT_2EH_41H) \
+__PMC_EV_ALIAS("CPU_CLK_UNHALTED.THREAD_P", IAP_EVENT_3CH_00H) \
+__PMC_EV_ALIAS("CPU_CLK_THREAD_UNHALTED.REF_XCLK", IAP_EVENT_3CH_01H) \
+__PMC_EV_ALIAS("L1D_PEND_MISS.PENDING", IAP_EVENT_48H_01H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.MISS_CAUSES_A_WALK", \
+ IAP_EVENT_49H_01H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED_4K", \
+ IAP_EVENT_49H_02H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_DURATION", IAP_EVENT_49H_10H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT_4K", IAP_EVENT_49H_20H) \
+__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_02H) \
+__PMC_EV_ALIAS("EPT.WALK_CYCLES", IAP_EVENT_4FH_10H) \
+__PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.INT_NOT_ELIMINATED", \
+ IAP_EVENT_58H_04H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_NOT_ELIMINATED", \
+ IAP_EVENT_58H_08H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.INT_ELIMINATED", IAP_EVENT_58H_01H) \
+__PMC_EV_ALIAS("MOVE_ELIMINATION.SMID_ELIMINATED", IAP_EVENT_58H_02H) \
+__PMC_EV_ALIAS("CPL_CYCLES.RING0", IAP_EVENT_5CH_01H) \
+__PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_02H) \
+__PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \
+ IAP_EVENT_60H_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", \
+ IAP_EVENT_60H_02H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", \
+ IAP_EVENT_60H_04H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", \
+ IAP_EVENT_60H_08H) \
+__PMC_EV_ALIAS("LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION", \
+ IAP_EVENT_63H_01H) \
+__PMC_EV_ALIAS("LOCK_CYCLES.CACHE_LOCK_DURATION", IAP_EVENT_63H_02H) \
+__PMC_EV_ALIAS("IDQ.EMPTY", IAP_EVENT_79H_02H) \
+__PMC_EV_ALIAS("IDQ.MITE_UOPS", IAP_EVENT_79H_04H) \
+__PMC_EV_ALIAS("IDQ.DSB_UOPS", IAP_EVENT_79H_08H) \
+__PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \
+__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \
+__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \
+__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \
+__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_ANY_UOPS", IAP_EVENT_79H_24H) \
+__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \
+__PMC_EV_ALIAS("ICACHE.MISSES", IAP_EVENT_80H_02H) \
+__PMC_EV_ALIAS("ITLB_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_85H_01H) \
+__PMC_EV_ALIAS("ITLB_MISSES.WALK_COMPLETED_4K", IAP_EVENT_85H_02H) \
+__PMC_EV_ALIAS("ITLB_MISSES.WALK_DURATION", IAP_EVENT_85H_10H) \
+__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT_4K", IAP_EVENT_85H_20H) \
+__PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.COND", IAP_EVENT_88H_01H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT", IAP_EVENT_88H_02H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NON_CALL", IAP_EVENT_88H_04H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.RETURN_NEAR", IAP_EVENT_88H_08H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_88H_10H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_88H_20H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.NONTAKEN", IAP_EVENT_88H_40H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.TAKEN", IAP_EVENT_88H_80H) \
+__PMC_EV_ALIAS("BR_INST_EXEC.ALL_BRANCHES", IAP_EVENT_88H_FFH) \
+__PMC_EV_ALIAS("BR_MISP_EXE.COND", IAP_EVENT_89H_01H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NON_CALL", IAP_EVENT_89H_04H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.RETURN_NEAR", IAP_EVENT_89H_08H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.DIRECT_NEAR_CALL", IAP_EVENT_89H_10H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.INDIRECT_NEAR_CALL", IAP_EVENT_89H_20H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.NONTAKEN", IAP_EVENT_89H_40H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.TAKEN", IAP_EVENT_89H_80H) \
+__PMC_EV_ALIAS("BR_MISP_EXEC.ALL_BRANCHES", IAP_EVENT_89H_FFH) \
+__PMC_EV_ALIAS("IDQ_UOPS_NOT_DELIVERED.CORE", IAP_EVENT_9CH_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_0", IAP_EVENT_A1H_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_1", IAP_EVENT_A1H_02H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_2", IAP_EVENT_A1H_04H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_3", IAP_EVENT_A1H_08H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_4", IAP_EVENT_A1H_10H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_5", IAP_EVENT_A1H_20H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_6", IAP_EVENT_A1H_40H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_7", IAP_EVENT_A1H_80H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.ANY", IAP_EVENT_A2H_01H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.RS", IAP_EVENT_A2H_04H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.SB", IAP_EVENT_A2H_08H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.ROB", IAP_EVENT_A2H_10H) \
+__PMC_EV_ALIAS("LSD.UOPS", IAP_EVENT_A8H_01H) \
+__PMC_EV_ALIAS("ITLB.ITLB_FLUSH", IAP_EVENT_AEH_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_DATA_RD", IAP_EVENT_B0H_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_CODE_RD", IAP_EVENT_B0H_02H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_RFO", IAP_EVENT_B0H_04H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.ALL_DATA_RD", IAP_EVENT_B0H_08H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED.THREAD", IAP_EVENT_B1H_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED.CORE", IAP_EVENT_B1H_02H) \
+__PMC_EV_ALIAS("OFF_CORE_RESPONSE_0", IAP_EVENT_B7H_01H) \
+__PMC_EV_ALIAS("OFF_CORE_RESPONSE_1", IAP_EVENT_BBH_01H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_L1", IAP_EVENT_BCH_11H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_L1", IAP_EVENT_BCH_21H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_L2", IAP_EVENT_BCH_12H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_L2", IAP_EVENT_BCH_22H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_L3", IAP_EVENT_BCH_14H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.ITLB_L3", IAP_EVENT_BCH_24H) \
+__PMC_EV_ALIAS("PAGE_WALKER_LOADS.DTLB_MEMORY", IAP_EVENT_BCH_18H) \
+__PMC_EV_ALIAS("INST_RETIRED.ANY_P", IAP_EVENT_C0H_00H) \
+__PMC_EV_ALIAS("INST_RETIRED.PREC_DIST", IAP_EVENT_C0H_01H) \
+__PMC_EV_ALIAS("INST_RETIRED.X87", IAP_EVENT_C0H_02H) \
+__PMC_EV_ALIAS("OTHER_ASSISTS.AVX_TO_SSE", IAP_EVENT_C1H_08H) \
+__PMC_EV_ALIAS("OTHER_ASSISTS.SSE_TO_AVX", IAP_EVENT_C1H_10H) \
+__PMC_EV_ALIAS("OTHER_ASSISTS.ANY_WB_ASSIST", IAP_EVENT_C1H_40H) \
+__PMC_EV_ALIAS("UOPS_RETIRED.ALL", IAP_EVENT_C2H_01H) \
+__PMC_EV_ALIAS("UOPS_RETIRED.RETIRE_SLOTS", IAP_EVENT_C2H_02H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.MEMORY_ORDERING", IAP_EVENT_C3H_02H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.MASKMOV", IAP_EVENT_C3H_20H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_00H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_RETURN", IAP_EVENT_C4H_08H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NOT_TAKEN", IAP_EVENT_C4H_10H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_TAKEN", IAP_EVENT_C4H_20H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.FAR_BRANCH", IAP_EVENT_C4H_40H) \
+__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \
+__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \
+__PMC_EV_ALIAS("BR_MISP_U_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \
+__PMC_EV_ALIAS("FP_ASSIST.X87_OUTPUT", IAP_EVENT_CAH_02H) \
+__PMC_EV_ALIAS("FP_ASSIST.X87_INPUT", IAP_EVENT_CAH_04H) \
+__PMC_EV_ALIAS("FP_ASSIST.SIMD_OUTPUT", IAP_EVENT_CAH_08H) \
+__PMC_EV_ALIAS("FP_ASSIST.SIMD_INPUT", IAP_EVENT_CAH_10H) \
+__PMC_EV_ALIAS("FP_ASSIST.ANY", IAP_EVENT_CAH_1EH) \
+__PMC_EV_ALIAS("ROB_MISC_EVENTS.LBR_INSERTS", IAP_EVENT_CCH_20H) \
+__PMC_EV_ALIAS("MEM_TRANS_RETIRED.LOAD_LATENCY", IAP_EVENT_CDH_01H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_LOADS", IAP_EVENT_D0H_11H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_STORES", IAP_EVENT_D0H_12H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.LOCK_LOADS", IAP_EVENT_D0H_21H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_HIT", IAP_EVENT_D1H_01H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_HIT", IAP_EVENT_D1H_02H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L3_HIT", IAP_EVENT_D1H_04H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_MISS", IAP_EVENT_D1H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_MISS", IAP_EVENT_D1H_10H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L3_MISS", IAP_EVENT_D1H_20H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.HIT_LFB", IAP_EVENT_D1H_40H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS", \
+ IAP_EVENT_D2H_01H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT", \
+ IAP_EVENT_D2H_02H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM", \
+ IAP_EVENT_D2H_04H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE", \
+ IAP_EVENT_D2H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM", \
+ IAP_EVENT_D3H_01H) \
+__PMC_EV_ALIAS("L2_TRANS.DEMAND_DATA_RD", IAP_EVENT_F0H_01H) \
+__PMC_EV_ALIAS("L2_TRANS.RFO", IAP_EVENT_F0H_02H) \
+__PMC_EV_ALIAS("L2_TRANS.CODE_RD", IAP_EVENT_F0H_04H) \
+__PMC_EV_ALIAS("L2_TRANS.ALL_PF", IAP_EVENT_F0H_08H) \
+__PMC_EV_ALIAS("L2_TRANS.L1D_WB", IAP_EVENT_F0H_10H) \
+__PMC_EV_ALIAS("L2_TRANS.L2_FILL", IAP_EVENT_F0H_20H) \
+__PMC_EV_ALIAS("L2_TRANS.L2_WB", IAP_EVENT_F0H_40H) \
+__PMC_EV_ALIAS("L2_TRANS.ALL_REQUESTS", IAP_EVENT_F0H_80H) \
+__PMC_EV_ALIAS("L2_LINES_IN.I", IAP_EVENT_F1H_01H) \
+__PMC_EV_ALIAS("L2_LINES_IN.S", IAP_EVENT_F1H_02H) \
+__PMC_EV_ALIAS("L2_LINES_IN.E", IAP_EVENT_F1H_04H) \
+__PMC_EV_ALIAS("L2_LINES_IN.ALL", IAP_EVENT_F1H_07H) \
+__PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_05H)
+
+/*
+ * Alisases for Skylake
+ */
+#define __PMC_EV_ALIAS_SKYLAKE() \
+__PMC_EV_ALIAS_INTEL_ARCHITECTURAL() \
+__PMC_EV_ALIAS("LD_BLOCKS.STORE_FORWARD", IAP_EVENT_03H_02H) \
+__PMC_EV_ALIAS("LD_BLOCKS.NO_SR", IAP_EVENT_03H_08H) \
+__PMC_EV_ALIAS("LD_BLOCKS_PARTIAL.ADDRESS_ALIAS", IAP_EVENT_07H_01H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_08H_01H)\
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_COMPLETED", IAP_EVENT_08H_0EH) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.WALK_PENDING", IAP_EVENT_08H_10H) \
+__PMC_EV_ALIAS("DTLB_LOAD_MISSES.STLB_HIT", IAP_EVENT_08H_20H) \
+__PMC_EV_ALIAS("INT_MISC.RECOVERY_CYCLES", IAP_EVENT_0DH_01H) \
+__PMC_EV_ALIAS("INT_MISC.CLEAR_RESTEER_CYCLES", IAP_EVENT_0DH_80H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.ANY", IAP_EVENT_0EH_01H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.VECTORS_WIDTH_MISMATCH", IAP_EVENT_0EH_02H) \
+__PMC_EV_ALIAS("UOPS_ISSUED.SLOW_LEA", IAP_EVENT_0EH_20H) \
+__PMC_EV_ALIAS("ARITH.FPU_DIV_ACTIVE", IAP_EVENT_14H_01H) \
+__PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_MISS", IAP_EVENT_24H_21H) \
+__PMC_EV_ALIAS("L2_RQSTS.RFO_MISS", IAP_EVENT_24H_22H) \
+__PMC_EV_ALIAS("L2_RQSTS.CODE_RD_MISS", IAP_EVENT_24H_24H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_MISS", IAP_EVENT_24H_27H) \
+__PMC_EV_ALIAS("L2_RQSTS.PF_MISS", IAP_EVENT_24H_38H) \
+__PMC_EV_ALIAS("L2_RQSTS.MISS", IAP_EVENT_24H_3FH) \
+__PMC_EV_ALIAS("L2_RQSTS.DEMAND_DATA_RD_HIT", IAP_EVENT_24H_41H) \
+__PMC_EV_ALIAS("L2_RQSTS.RFO_HIT", IAP_EVENT_24H_42H) \
+__PMC_EV_ALIAS("L2_RQSTS.CODE_RD_HIT", IAP_EVENT_24H_44H) \
+__PMC_EV_ALIAS("L2_RQSTS.PF_HIT", IAP_EVENT_24H_D8H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_DATA_RD", IAP_EVENT_24H_E1H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_RFO", IAP_EVENT_24H_E2H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_CODE_RD", IAP_EVENT_24H_E4H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_REFERENCES", IAP_EVENT_24H_F7H) \
+__PMC_EV_ALIAS("L2_RQSTS.ALL_PF", IAP_EVENT_24H_F8H) \
+__PMC_EV_ALIAS("L2_RQSTS.REFERENCES", IAP_EVENT_24H_EFH) \
+__PMC_EV_ALIAS("LONGEST_LAT_CACHE.REFERENCE", IAP_EVENT_2EH_4FH) \
+__PMC_EV_ALIAS("LONGEST_LAT_CACHE.MISS", IAP_EVENT_2EH_41H) \
+__PMC_EV_ALIAS("CPU_CLK_UNHALTED.THREAD_P", IAP_EVENT_3CH_00H) \
+__PMC_EV_ALIAS("CPU_CLK_THREAD_UNHALTED.REF_XCLK", IAP_EVENT_3CH_01H) \
+__PMC_EV_ALIAS("CPU_CLK_THREAD_UNHALTED.ONE_THREAD_ACTIVE", \
+ IAP_EVENT_3CH_02H) \
+__PMC_EV_ALIAS("L1D_PEND_MISS.PENDING", IAP_EVENT_48H_01H) \
+__PMC_EV_ALIAS("L1D_PEND_MISS.FB_FULL", IAP_EVENT_48H_02H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.MISS_CAUSES_A_WALK", \
+ IAP_EVENT_49H_01H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_COMPLETED", IAP_EVENT_49H_0EH) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.WALK_PENDING", IAP_EVENT_49H_10H) \
+__PMC_EV_ALIAS("DTLB_STORE_MISSES.STLB_HIT", IAP_EVENT_49H_20H) \
+__PMC_EV_ALIAS("LOAD_HIT_PRE.HW_PF", IAP_EVENT_4CH_01H) \
+__PMC_EV_ALIAS("EPT.WALK_CYCLES", IAP_EVENT_4FH_10H) \
+__PMC_EV_ALIAS("L1D.REPLACEMENT", IAP_EVENT_51H_01H) \
+__PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \
+ IAP_EVENT_60H_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", \
+ IAP_EVENT_60H_02H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", \
+ IAP_EVENT_60H_04H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD", \
+ IAP_EVENT_60H_08H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.L3_MISS_DEMAND_DATA_RD", \
+ IAP_EVENT_60H_10H) \
+__PMC_EV_ALIAS("LOCK_CYCLES.CACHE_LOCK_DURATION", IAP_EVENT_63H_02H) \
+__PMC_EV_ALIAS("IDQ.MITE_UOPS", IAP_EVENT_79H_04H) \
+__PMC_EV_ALIAS("IDQ.DSB_UOPS", IAP_EVENT_79H_08H) \
+__PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \
+__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \
+__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \
+__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \
+__PMC_EV_ALIAS("ICACHE_16B.IFDATA_STALL", IAP_EVENT_80H_04H) \
+__PMC_EV_ALIAS("ICACHE_64B.IFTAG_HIT", IAP_EVENT_83H_01H) \
+__PMC_EV_ALIAS("ICACHE_64B.IFTAG_MISS", IAP_EVENT_83H_02H) \
+__PMC_EV_ALIAS("ITLB_MISSES.MISS_CAUSES_A_WALK", IAP_EVENT_85H_01H) \
+__PMC_EV_ALIAS("ITLB_MISSES.WALK_COMPLETED", IAP_EVENT_85H_0EH) \
+__PMC_EV_ALIAS("ITLB_MISSES.WALK_PENDING", IAP_EVENT_85H_10H) \
+__PMC_EV_ALIAS("ITLB_MISSES.STLB_HIT", IAP_EVENT_85H_20H) \
+__PMC_EV_ALIAS("ILD_STALL.LCP", IAP_EVENT_87H_01H) \
+__PMC_EV_ALIAS("IDQ_UOPS_NOT_DELIVERED.CORE", IAP_EVENT_9CH_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_0", IAP_EVENT_A1H_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_1", IAP_EVENT_A1H_02H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_2", IAP_EVENT_A1H_04H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_3", IAP_EVENT_A1H_08H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_4", IAP_EVENT_A1H_10H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_5", IAP_EVENT_A1H_20H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_6", IAP_EVENT_A1H_40H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED_PORT.PORT_7", IAP_EVENT_A1H_80H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.ANY", IAP_EVENT_A2H_01H) \
+__PMC_EV_ALIAS("RESOURCE_STALLS.SB", IAP_EVENT_A2H_08H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.CYCLES_L2_MISS", IAP_EVENT_A3H_01H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.CYCLES_L3_MISS", IAP_EVENT_A3H_02H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.STALLS_TOTAL", IAP_EVENT_A3H_04H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.STALLS_L2_MISS", IAP_EVENT_A3H_05H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.STALLS_L3_MISS", IAP_EVENT_A3H_06H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.CYCLES_L1D_MISS", IAP_EVENT_A3H_08H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.STALLS_L1D_MISS", IAP_EVENT_A3H_0CH) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.CYCLES_MEM_ANY", IAP_EVENT_A3H_10H) \
+__PMC_EV_ALIAS("CYCLE_ACTIVITY.STALLS_MEM_ANY", IAP_EVENT_A3H_14H) \
+__PMC_EV_ALIAS("EXE_ACTIVITY.EXE_BOUND_0_PORTS", IAP_EVENT_A6H_01H) \
+__PMC_EV_ALIAS("EXE_ACTIVITY.1_PORTS_UTIL", IAP_EVENT_A6H_02H) \
+__PMC_EV_ALIAS("EXE_ACTIVITY.2_PORTS_UTIL", IAP_EVENT_A6H_04H) \
+__PMC_EV_ALIAS("EXE_ACTIVITY.3_PORTS_UTIL", IAP_EVENT_A6H_08H) \
+__PMC_EV_ALIAS("EXE_ACTIVITY.4_PORTS_UTIL", IAP_EVENT_A6H_10H) \
+__PMC_EV_ALIAS("EXE_ACTIVITY.BOUND_ON_STORES", IAP_EVENT_A6H_40H) \
+__PMC_EV_ALIAS("LSD.UOPS", IAP_EVENT_A8H_01H) \
+__PMC_EV_ALIAS("DSB2MITE_SWITCHES.PENALTY_CYCLES", IAP_EVENT_ABH_02H) \
+__PMC_EV_ALIAS("ITLB.ITLB_FLUSH", IAP_EVENT_AEH_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_DATA_RD", IAP_EVENT_B0H_01H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_CODE_RD", IAP_EVENT_B0H_02H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.DEMAND_RFO", IAP_EVENT_B0H_04H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.ALL_DATA_RD", IAP_EVENT_B0H_08H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.L3_MISS_DEMAND_DATA_RD", \
+ IAP_EVENT_B0H_10H) \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS.ALL_REQUESTS", IAP_EVENT_B0H_80H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED.THREAD", IAP_EVENT_B1H_01H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED.CORE", IAP_EVENT_B1H_02H) \
+__PMC_EV_ALIAS("UOPS_EXECUTED.X87", IAP_EVENT_B1H_10H) \
+__PMC_EV_ALIAS("OFF_CORE_REQUEST_BUFFER.SQ_FULL", IAP_EVENT_B2H_01H) \
+__PMC_EV_ALIAS("OFF_CORE_RESPONSE_0", IAP_EVENT_B7H_01H) \
+__PMC_EV_ALIAS("OFF_CORE_RESPONSE_1", IAP_EVENT_BBH_01H) \
+__PMC_EV_ALIAS("TLB_FLUSH.DTLB_THREAD", IAP_EVENT_BDH_01H) \
+__PMC_EV_ALIAS("INST_RETIRED.ANY_P", IAP_EVENT_C0H_00H) \
+__PMC_EV_ALIAS("INST_RETIRED.PREC_DIST", IAP_EVENT_C0H_01H) \
+__PMC_EV_ALIAS("OTHER_ASSISTS.ANY", IAP_EVENT_C1H_3FH) \
+__PMC_EV_ALIAS("UOPS_RETIRED.STALL_CYCLES", IAP_EVENT_C2H_01H) \
+__PMC_EV_ALIAS("UOPS_RETIRED.RETIRE_SLOTS", IAP_EVENT_C2H_02H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.MEMORY_ORDERING", IAP_EVENT_C3H_02H) \
+__PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_00H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_RETURN", IAP_EVENT_C4H_08H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NOT_TAKEN", IAP_EVENT_C4H_10H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_TAKEN", IAP_EVENT_C4H_20H) \
+__PMC_EV_ALIAS("BR_INST_RETIRED.FAR_BRANCH", IAP_EVENT_C4H_40H) \
+__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \
+__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \
+__PMC_EV_ALIAS("BR_MISP_U_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \
+__PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_TAKEN", IAP_EVENT_C5H_20H) \
+__PMC_EV_ALIAS("FRONTEND_RETIRED.DSB_MISS", IAP_EVENT_C6H_01H) \
+__PMC_EV_ALIAS("FP_ARIT_INST_RETIRED.SCALAR_DOUBLE", IAP_EVENT_C7H_01H) \
+__PMC_EV_ALIAS("FP_ARIT_INST_RETIRED.SCALAR_SINGLE", IAP_EVENT_C7H_02H) \
+__PMC_EV_ALIAS("FP_ARIT_INST_RETIRED.128B_PACKED_DOUBLE", \
+ IAP_EVENT_C7H_04H) \
+__PMC_EV_ALIAS("FP_ARIT_INST_RETIRED.128B_PACKED_SINGLE", \
+ IAP_EVENT_C7H_08H) \
+__PMC_EV_ALIAS("FP_ARIT_INST_RETIRED.256B_PACKED_DOUBLE", \
+ IAP_EVENT_C7H_10H) \
+__PMC_EV_ALIAS("FP_ARIT_INST_RETIRED.256B_PACKED_SINGLE", \
+ IAP_EVENT_C7H_20H) \
+__PMC_EV_ALIAS("FP_ASSIST.ANY", IAP_EVENT_CAH_1EH) \
+__PMC_EV_ALIAS("HW_INTERRUPTS.RECEIVED", IAP_EVENT_CBH_01H) \
+__PMC_EV_ALIAS("MEM_TRANS_RETIRED.LOAD_LATENCY", IAP_EVENT_CDH_01H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_LOADS", IAP_EVENT_D0H_11H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.STLB_MISS_STORES", IAP_EVENT_D0H_12H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.LOCK_LOADS", IAP_EVENT_D0H_21H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_LOADS", IAP_EVENT_D0H_41H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.SPLIT_STORES", IAP_EVENT_D0H_42H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_LOADS", IAP_EVENT_D0H_81H) \
+__PMC_EV_ALIAS("MEM_UOPS_RETIRED.ALL_STORES", IAP_EVENT_D0H_82H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_HIT", IAP_EVENT_D1H_01H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_HIT", IAP_EVENT_D1H_02H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L3_HIT", IAP_EVENT_D1H_04H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L1_MISS", IAP_EVENT_D1H_08H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L2_MISS", IAP_EVENT_D1H_10H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.L3_MISS", IAP_EVENT_D1H_20H) \
+__PMC_EV_ALIAS("MEM_LOAD_UOPS_RETIRED.FB_HIT", IAP_EVENT_D1H_40H) \
+__PMC_EV_ALIAS("MEM_LOAD_L3_HIT_RETIRED.XSNP_MISS", \
+ IAP_EVENT_D2H_01H) \
+__PMC_EV_ALIAS("MEM_LOAD_L3_HIT_RETIRED.XSNP_HIT", \
+ IAP_EVENT_D2H_02H) \
+__PMC_EV_ALIAS("MEM_LOAD_L3_HIT_RETIRED.XSNP_HITM", \
+ IAP_EVENT_D2H_04H) \
+__PMC_EV_ALIAS("MEM_LOAD_L3_HIT_RETIRED.XSNP_NONE", \
+ IAP_EVENT_D2H_08H) \
+__PMC_EV_ALIAS("BACLEARS.ANY", IAP_EVENT_E6H_01H) \
+__PMC_EV_ALIAS("L2_TRANS.L2_WB", IAP_EVENT_F0H_40H) \
+__PMC_EV_ALIAS("L2_LINES_IN.ALL", IAP_EVENT_F1H_07H)
/*
* Aliases for Core PMC events.
@@ -2666,7 +3243,7 @@ __PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_02H) \
__PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \
__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \
IAP_EVENT_60H_01H) \
-__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD", \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", \
IAP_EVENT_60H_02H) \
__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", \
IAP_EVENT_60H_04H) \
@@ -2682,7 +3259,6 @@ __PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \
__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \
__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \
__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \
-__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_4_UOPS", IAP_EVENT_79H_18H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_ANY_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_4_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \
@@ -2771,7 +3347,7 @@ __PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_TAKEN", IAP_EVENT_C4H_20H) \
__PMC_EV_ALIAS("BR_INST_RETIRED.FAR_BRANCH", IAP_EVENT_C4H_40H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \
-__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_04H) \
+__PMC_EV_ALIAS("BR_MISP_U_RETIRED.CONDITIONAL", IAP_EVENT_C5H_04H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_TAKEN", IAP_EVENT_C5H_20H) \
__PMC_EV_ALIAS("FP_ASSIST.X87_OUTPUT", IAP_EVENT_CAH_02H) \
__PMC_EV_ALIAS("FP_ASSIST.X87_INPUT", IAP_EVENT_CAH_04H) \
@@ -2892,7 +3468,7 @@ __PMC_EV_ALIAS("CPL_CYCLES.RING123", IAP_EVENT_5CH_02H) \
__PMC_EV_ALIAS("RS_EVENTS.EMPTY_CYCLES", IAP_EVENT_5EH_01H) \
__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD", \
IAP_EVENT_60H_01H) \
-__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD", \
+__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD", \
IAP_EVENT_60H_02H) \
__PMC_EV_ALIAS("OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO", \
IAP_EVENT_60H_04H) \
@@ -2908,7 +3484,6 @@ __PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \
__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \
__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \
__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \
-__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_4_UOPS", IAP_EVENT_79H_18H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_ANY_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_4_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \
@@ -2997,7 +3572,7 @@ __PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_TAKEN", IAP_EVENT_C4H_20H) \
__PMC_EV_ALIAS("BR_INST_RETIRED.FAR_BRANCH", IAP_EVENT_C4H_40H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \
-__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_04H) \
+__PMC_EV_ALIAS("BR_MISP_U_RETIRED.CONDITIONAL", IAP_EVENT_C5H_04H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_TAKEN", IAP_EVENT_C5H_20H) \
__PMC_EV_ALIAS("FP_ASSIST.X87_OUTPUT", IAP_EVENT_CAH_02H) \
__PMC_EV_ALIAS("FP_ASSIST.X87_INPUT", IAP_EVENT_CAH_04H) \
@@ -3134,7 +3709,6 @@ __PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \
__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \
__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \
__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \
-__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_4_UOPS", IAP_EVENT_79H_18H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_ANY_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_4_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \
@@ -3219,7 +3793,7 @@ __PMC_EV_ALIAS("BR_INST_RETIRED.FAR_BRANCH", IAP_EVENT_C4H_40H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_CALL", IAP_EVENT_C5H_02H) \
-__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \
+__PMC_EV_ALIAS("BR_MISP_U_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.NOT_TAKEN", IAP_EVENT_C5H_10H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.TAKEN", IAP_EVENT_C5H_20H) \
__PMC_EV_ALIAS("FP_ASSIST.X87_OUTPUT", IAP_EVENT_CAH_02H) \
@@ -3361,7 +3935,6 @@ __PMC_EV_ALIAS("IDQ.MS_DSB_UOPS", IAP_EVENT_79H_10H) \
__PMC_EV_ALIAS("IDQ.MS_MITE_UOPS", IAP_EVENT_79H_20H) \
__PMC_EV_ALIAS("IDQ.MS_UOPS", IAP_EVENT_79H_30H) \
__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_ANY_UOPS", IAP_EVENT_79H_18H) \
-__PMC_EV_ALIAS("IDQ.ALL_DSB_CYCLES_4_UOPS", IAP_EVENT_79H_18H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_ANY_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.ALL_MITE_CYCLES_4_UOPS", IAP_EVENT_79H_24H) \
__PMC_EV_ALIAS("IDQ.MITE_ALL_UOPS", IAP_EVENT_79H_3CH) \
@@ -3446,7 +4019,7 @@ __PMC_EV_ALIAS("BR_INST_RETIRED.FAR_BRANCH", IAP_EVENT_C4H_40H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_CALL", IAP_EVENT_C5H_02H) \
-__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \
+__PMC_EV_ALIAS("BR_MISP_U_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.NOT_TAKEN", IAP_EVENT_C5H_10H) \
__PMC_EV_ALIAS("BR_MISP_RETIRED.TAKEN", IAP_EVENT_C5H_20H) \
__PMC_EV_ALIAS("FP_ASSIST.X87_OUTPUT", IAP_EVENT_CAH_02H) \
@@ -4236,7 +4809,31 @@ __PMC_EV(UCP, EVENT_86H_01H)
/*
* Aliases for Broadwell uncore PMC events
*/
-#define __PMC_EV_ALIAS_BROADWELLUC()
+#define __PMC_EV_ALIAS_BROADWELLUC() \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.MISS", UCP_EVENT_22H_01H) \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.INVAL", UCP_EVENT_22H_02H) \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.HIT", UCP_EVENT_22H_04H) \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.HITM", UCP_EVENT_22H_08H) \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.INVAL_M", UCP_EVENT_22H_10H) \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.EXTERNAL_FILTER", \
+ UCP_EVENT_22H_20H) \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.XCORE_FILTER", UCP_EVENT_22H_40H) \
+__PMC_EV_ALIAS("UNC_CBO_XSNP_RESPONSE.EVICTION_FILTER", \
+ UCP_EVENT_22H_80H) \
+__PMC_EV_ALIAS("UNC_CBO_CACHE_LOOKUP.M", UCP_EVENT_34H_01H) \
+__PMC_EV_ALIAS("UNC_CBO_CACHE_LOOKUP.ES", UCP_EVENT_34H_06H) \
+__PMC_EV_ALIAS("UNC_CBO_CACHE_LOOKUP.I", UCP_EVENT_34H_08H) \
+__PMC_EV_ALIAS("UNC_CBO_CACHE_LOOKUP.READ_FILTER", UCP_EVENT_34H_10H) \
+__PMC_EV_ALIAS("UNC_CBO_CACHE_LOOKUP.WRITE_FILTER", UCP_EVENT_34H_20H) \
+__PMC_EV_ALIAS("UNC_CBO_CACHE_LOOKUP.EXTSNP_FILTER", UCP_EVENT_34H_40H) \
+__PMC_EV_ALIAS("UNC_CBO_CACHE_LOOKUP.ANY_REQUEST_FILTER", \
+ UCP_EVENT_34H_80H) \
+__PMC_EV_ALIAS("UNC_ARB_TRK_OCCUPANCY.ALL", UCP_EVENT_80H_01H) \
+__PMC_EV_ALIAS("UNC_ARB_TRK_REQUEST.ALL", UCP_EVENT_81H_01H) \
+__PMC_EV_ALIAS("UNC_ARB_TRK_REQUEST.WRITES", UCP_EVENT_81H_20H) \
+__PMC_EV_ALIAS("UNC_ARB_TRK_REQUEST.EVICTIONS", UCP_EVENT_81H_80H) \
+__PMC_EV_ALIAS("UNC_ARB_COH_TRK_OCCUPANCY.ALL", UCP_EVENT_83H_01H) \
+__PMC_EV_ALIAS("UNC_ARB_COH_TRK_REQUEST.ALL", UCP_EVENT_84H_01H)
#define __PMC_EV_ALIAS_COREI7UC() \
__PMC_EV_ALIAS("GQ_CYCLES_FULL.READ_TRACKER", UCP_EVENT_00H_01H) \
diff --git a/sys/dev/ioat/ioat.c b/sys/dev/ioat/ioat.c
index 8245adf..00cf337 100644
--- a/sys/dev/ioat/ioat.c
+++ b/sys/dev/ioat/ioat.c
@@ -141,6 +141,7 @@ static driver_t ioat_pci_driver = {
static devclass_t ioat_devclass;
DRIVER_MODULE(ioat, pci, ioat_pci_driver, ioat_devclass, 0, 0);
+MODULE_VERSION(ioat, 1);
/*
* Private data structures
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index 7b5b399..a140ddb 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -277,6 +277,9 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults)
case ISP_HA_FC_2500:
btype = "2532";
break;
+ case ISP_HA_FC_2600:
+ btype = "2031";
+ break;
default:
break;
}
@@ -655,8 +658,10 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults)
ISP_WRITE(isp, isp->isp_respinrp, 0);
ISP_WRITE(isp, isp->isp_respoutrp, 0);
if (IS_24XX(isp)) {
- ISP_WRITE(isp, BIU2400_PRI_REQINP, 0);
- ISP_WRITE(isp, BIU2400_PRI_REQOUTP, 0);
+ if (!IS_26XX(isp)) {
+ ISP_WRITE(isp, BIU2400_PRI_REQINP, 0);
+ ISP_WRITE(isp, BIU2400_PRI_REQOUTP, 0);
+ }
ISP_WRITE(isp, BIU2400_ATIO_RSPINP, 0);
ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, 0);
}
@@ -761,6 +766,7 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults)
code_org = ISP_CODE_ORG;
}
+ isp->isp_loaded_fw = 0;
if (dodnld && IS_24XX(isp)) {
const uint32_t *ptr = isp->isp_mdvec->dv_ispfw;
int wordload;
@@ -956,8 +962,17 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults)
ISP_RESET0(isp);
return;
}
+ } else if (IS_26XX(isp)) {
+ MBSINIT(&mbs, MBOX_LOAD_FLASH_FIRMWARE, MBLOGALL, 5000000);
+ mbs.ibitm = 0x01;
+ mbs.obitm = 0x07;
+ isp_mboxcmd(isp, &mbs);
+ if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
+ isp_prt(isp, ISP_LOGERR, "Flash F/W load failed");
+ ISP_RESET0(isp);
+ return;
+ }
} else {
- isp->isp_loaded_fw = 0;
isp_prt(isp, ISP_LOGDEBUG2, "skipping f/w download");
}
@@ -966,7 +981,6 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults)
*/
if (isp->isp_loaded_fw) {
MBSINIT(&mbs, MBOX_VERIFY_CHECKSUM, MBLOGNONE, 0);
- mbs.param[0] = MBOX_VERIFY_CHECKSUM;
if (IS_24XX(isp)) {
mbs.param[1] = code_org >> 16;
mbs.param[2] = code_org;
@@ -998,9 +1012,6 @@ isp_reset(ispsoftc_t *isp, int do_load_defaults)
} else {
mbs.param[3] = 1;
}
- if (IS_25XX(isp)) {
- mbs.ibits |= 0x10;
- }
} else if (IS_2322(isp)) {
mbs.param[1] = code_org;
if (isp->isp_loaded_fw) {
@@ -1861,16 +1872,16 @@ isp_fibre_init(ispsoftc_t *isp)
icbp->icb_idelaytimer = 10;
}
icbp->icb_zfwoptions = fcp->isp_zfwoptions;
- if (isp->isp_confopts & ISP_CFG_ONEGB) {
+ if (isp->isp_confopts & ISP_CFG_1GB) {
icbp->icb_zfwoptions &= ~ICBZOPT_RATE_MASK;
- icbp->icb_zfwoptions |= ICBZOPT_RATE_ONEGB;
- } else if (isp->isp_confopts & ISP_CFG_TWOGB) {
+ icbp->icb_zfwoptions |= ICBZOPT_RATE_1GB;
+ } else if (isp->isp_confopts & ISP_CFG_2GB) {
icbp->icb_zfwoptions &= ~ICBZOPT_RATE_MASK;
- icbp->icb_zfwoptions |= ICBZOPT_RATE_TWOGB;
+ icbp->icb_zfwoptions |= ICBZOPT_RATE_2GB;
} else {
switch (icbp->icb_zfwoptions & ICBZOPT_RATE_MASK) {
- case ICBZOPT_RATE_ONEGB:
- case ICBZOPT_RATE_TWOGB:
+ case ICBZOPT_RATE_1GB:
+ case ICBZOPT_RATE_2GB:
case ICBZOPT_RATE_AUTO:
break;
default:
@@ -2122,18 +2133,26 @@ isp_fibre_init_2400(ispsoftc_t *isp)
break;
}
+ if (IS_26XX(isp)) {
+ /* We don't support MSI-X yet, so set this unconditionally. */
+ icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHR;
+ icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHA;
+ }
+
if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) {
icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24;
}
icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_AUTO;
- if (isp->isp_confopts & ISP_CFG_ONEGB) {
- icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_ONEGB;
- } else if (isp->isp_confopts & ISP_CFG_TWOGB) {
- icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_TWOGB;
- } else if (isp->isp_confopts & ISP_CFG_FOURGB) {
- icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_FOURGB;
- } else if (IS_25XX(isp) && (isp->isp_confopts & ISP_CFG_EIGHTGB)) {
- icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_EIGHTGB;
+ if (isp->isp_confopts & ISP_CFG_1GB) {
+ icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_1GB;
+ } else if (isp->isp_confopts & ISP_CFG_2GB) {
+ icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_2GB;
+ } else if (isp->isp_confopts & ISP_CFG_4GB) {
+ icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_4GB;
+ } else if (isp->isp_confopts & ISP_CFG_8GB) {
+ icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_8GB;
+ } else if (isp->isp_confopts & ISP_CFG_16GB) {
+ icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_16GB;
} else {
icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO;
}
@@ -2810,6 +2829,8 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
fcp = FCPARAM(isp, chan);
+ if (fcp->isp_loopstate < LOOP_HAVE_LINK)
+ return (-1);
if (fcp->isp_loopstate >= LOOP_LTEST_DONE)
return (0);
@@ -2825,15 +2846,13 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay)
if (fcp->isp_fwstate == FW_READY) {
break;
}
+ if (fcp->isp_loopstate < LOOP_TESTING_LINK)
+ goto abort;
GET_NANOTIME(&hrb);
if ((NANOTIME_SUB(&hrb, &hra) / 1000 + 1000 >= usdelay))
break;
ISP_SLEEP(isp, 1000);
}
-
- /*
- * If we haven't gone to 'ready' state, return.
- */
if (fcp->isp_fwstate != FW_READY) {
isp_prt(isp, ISP_LOG_SANCFG,
"Chan %d Firmware is not ready (%s)",
@@ -2938,6 +2957,12 @@ not_on_fabric:
}
}
+ if (fcp->isp_loopstate < LOOP_TESTING_LINK) {
+abort:
+ isp_prt(isp, ISP_LOG_SANCFG,
+ "Chan %d FC link test aborted", chan);
+ return (1);
+ }
fcp->isp_loopstate = LOOP_LTEST_DONE;
isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGCONFIG,
"Chan %d WWPN %016jx WWNN %016jx",
@@ -2968,12 +2993,10 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
fcportdb_t *lp;
uint16_t dbidx;
- if (fcp->isp_loopstate < LOOP_FSCAN_DONE) {
+ if (fcp->isp_loopstate < LOOP_FSCAN_DONE)
return (-1);
- }
- if (fcp->isp_loopstate > LOOP_SYNCING_PDB) {
+ if (fcp->isp_loopstate >= LOOP_READY)
return (0);
- }
isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC PDB sync", chan);
@@ -3025,12 +3048,12 @@ isp_pdb_sync(ispsoftc_t *isp, int chan)
}
}
- /*
- * If we get here, we've for sure seen not only a valid loop
- * but know what is or isn't on it, so mark this for usage
- * in isp_start.
- */
- fcp->loop_seen_once = 1;
+ if (fcp->isp_loopstate < LOOP_SYNCING_PDB) {
+ isp_prt(isp, ISP_LOG_SANCFG,
+ "Chan %d FC PDB sync aborted", chan);
+ return (1);
+ }
+
fcp->isp_loopstate = LOOP_READY;
isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC PDB sync done", chan);
return (0);
@@ -3154,12 +3177,11 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
uint16_t handles[LOCAL_LOOP_LIM];
uint16_t handle;
- if (fcp->isp_loopstate < LOOP_LTEST_DONE) {
+ if (fcp->isp_loopstate < LOOP_LTEST_DONE)
return (-1);
- }
- if (fcp->isp_loopstate > LOOP_SCANNING_LOOP) {
+ if (fcp->isp_loopstate >= LOOP_LSCAN_DONE)
return (0);
- }
+
isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC loop scan", chan);
fcp->isp_loopstate = LOOP_SCANNING_LOOP;
if (TOPO_IS_FABRIC(fcp->isp_topo)) {
@@ -3214,8 +3236,8 @@ isp_scan_loop(ispsoftc_t *isp, int chan)
if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) {
abort:
isp_prt(isp, ISP_LOG_SANCFG,
- "Chan %d FC loop scan done (abort)", chan);
- return (-1);
+ "Chan %d FC loop scan aborted", chan);
+ return (1);
}
if (node_wwn == INI_NONE) {
continue;
@@ -3424,12 +3446,11 @@ isp_scan_fabric(ispsoftc_t *isp, int chan)
int portidx, portlim, r;
sns_gid_ft_rsp_t *rs0, *rs1;
- if (fcp->isp_loopstate < LOOP_LSCAN_DONE) {
+ if (fcp->isp_loopstate < LOOP_LSCAN_DONE)
return (-1);
- }
- if (fcp->isp_loopstate > LOOP_SCANNING_FABRIC) {
+ if (fcp->isp_loopstate >= LOOP_FSCAN_DONE)
return (0);
- }
+
isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC fabric scan", chan);
fcp->isp_loopstate = LOOP_SCANNING_FABRIC;
if (!TOPO_IS_FABRIC(fcp->isp_topo)) {
@@ -3450,8 +3471,8 @@ fail:
abort:
FC_SCRATCH_RELEASE(isp, chan);
isp_prt(isp, ISP_LOG_SANCFG,
- "Chan %d FC fabric scan done (abort)", chan);
- return (-1);
+ "Chan %d FC fabric scan aborted", chan);
+ return (1);
}
/*
@@ -3478,11 +3499,11 @@ abort:
if (r > 0) {
fcp->isp_loopstate = LOOP_FSCAN_DONE;
FC_SCRATCH_RELEASE(isp, chan);
- return (0);
+ return (-1);
} else if (r < 0) {
fcp->isp_loopstate = LOOP_LTEST_DONE; /* try again */
FC_SCRATCH_RELEASE(isp, chan);
- return (0);
+ return (-1);
}
MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN, chan);
@@ -3504,7 +3525,7 @@ abort:
rs1->snscb_cthdr.ct_explanation);
FC_SCRATCH_RELEASE(isp, chan);
fcp->isp_loopstate = LOOP_FSCAN_DONE;
- return (0);
+ return (-1);
}
/* Check our buffer was big enough to get the full list. */
@@ -5657,11 +5678,10 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
fcp = FCPARAM(isp, chan);
int topo = fcp->isp_topo;
- if (fcp->role == ISP_ROLE_NONE) {
+ if (fcp->role == ISP_ROLE_NONE)
continue;
- }
-
- fcp->isp_loopstate = LOOP_NIL;
+ if (fcp->isp_loopstate > LOOP_HAVE_LINK)
+ fcp->isp_loopstate = LOOP_HAVE_LINK;
ISP_SET_SENDMARKER(isp, chan, 1);
isp_async(isp, ISPASYNC_LIP, chan);
#ifdef ISP_TARGET_MODE
@@ -5714,6 +5734,9 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
fcp = FCPARAM(isp, chan);
if (fcp->role == ISP_ROLE_NONE)
continue;
+ fcp->isp_linkstate = 1;
+ if (fcp->isp_loopstate < LOOP_HAVE_LINK)
+ fcp->isp_loopstate = LOOP_HAVE_LINK;
ISP_SET_SENDMARKER(isp, chan, 1);
isp_async(isp, ISPASYNC_LOOP_UP, chan);
#ifdef ISP_TARGET_MODE
@@ -5734,6 +5757,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
if (fcp->role == ISP_ROLE_NONE)
continue;
ISP_SET_SENDMARKER(isp, chan, 1);
+ fcp->isp_linkstate = 0;
fcp->isp_loopstate = LOOP_NIL;
isp_async(isp, ISPASYNC_LOOP_DOWN, chan);
#ifdef ISP_TARGET_MODE
@@ -5754,7 +5778,8 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
if (fcp->role == ISP_ROLE_NONE)
continue;
ISP_SET_SENDMARKER(isp, chan, 1);
- fcp->isp_loopstate = LOOP_NIL;
+ if (fcp->isp_loopstate > LOOP_HAVE_LINK)
+ fcp->isp_loopstate = LOOP_HAVE_LINK;
isp_async(isp, ISPASYNC_LOOP_RESET, chan);
#ifdef ISP_TARGET_MODE
if (isp_target_async(isp, chan, mbox)) {
@@ -5797,6 +5822,8 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
continue;
if (fcp->isp_loopstate > LOOP_LTEST_DONE)
fcp->isp_loopstate = LOOP_LTEST_DONE;
+ else if (fcp->isp_loopstate < LOOP_HAVE_LINK)
+ fcp->isp_loopstate = LOOP_HAVE_LINK;
isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan,
ISPASYNC_CHANGE_PDB, nphdl, nlstate, reason);
}
@@ -5820,6 +5847,8 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
break;
if (fcp->isp_loopstate > LOOP_LTEST_DONE)
fcp->isp_loopstate = LOOP_LTEST_DONE;
+ else if (fcp->isp_loopstate < LOOP_HAVE_LINK)
+ fcp->isp_loopstate = LOOP_HAVE_LINK;
isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan,
ISPASYNC_CHANGE_SNS, portid);
break;
@@ -5867,7 +5896,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
break;
}
ISP_SET_SENDMARKER(isp, chan, 1);
- FCPARAM(isp, chan)->isp_loopstate = LOOP_NIL;
+ FCPARAM(isp, chan)->isp_loopstate = LOOP_HAVE_LINK;
isp_async(isp, ISPASYNC_CHANGE_NOTIFY, chan, ISPASYNC_CHANGE_OTHER);
break;
case ASYNC_P2P_INIT_ERR:
@@ -5939,16 +5968,29 @@ isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *opt
if (fcp->role == ISP_ROLE_NONE)
continue;
c = (chan == 0) ? 127 : (chan - 1);
- if (rid.ridacq_map[c / 16] & (1 << (c % 16))) {
- fcp->isp_loopstate = LOOP_NIL;
+ if (rid.ridacq_map[c / 16] & (1 << (c % 16)) ||
+ chan == 0) {
+ fcp->isp_loopstate = LOOP_HAVE_LINK;
isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
chan, ISPASYNC_CHANGE_OTHER);
+ } else {
+ fcp->isp_loopstate = LOOP_NIL;
+ isp_async(isp, ISPASYNC_LOOP_DOWN,
+ chan);
}
}
} else {
- FCPARAM(isp, rid.ridacq_vp_index)->isp_loopstate = LOOP_NIL;
- isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
- rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER);
+ fcparam *fcp = FCPARAM(isp, rid.ridacq_vp_index);
+ if (rid.ridacq_vp_status == RIDACQ_STS_COMPLETE ||
+ rid.ridacq_vp_status == RIDACQ_STS_CHANGED) {
+ fcp->isp_loopstate = LOOP_HAVE_LINK;
+ isp_async(isp, ISPASYNC_CHANGE_NOTIFY,
+ rid.ridacq_vp_index, ISPASYNC_CHANGE_OTHER);
+ } else {
+ fcp->isp_loopstate = LOOP_NIL;
+ isp_async(isp, ISPASYNC_LOOP_DOWN,
+ rid.ridacq_vp_index);
+ }
}
return (1);
case RQSTYPE_ATIO:
@@ -6805,7 +6847,7 @@ static const char *scsi_mbcmd_names[] = {
static const uint32_t mbpfc[] = {
ISP_FC_OPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */
ISP_FC_OPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */
- ISP_FC_OPMAP(0x0f, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */
+ ISP_FC_OPMAP_HALF(0x07, 0xff, 0x00, 0x03), /* 0x02: MBOX_EXEC_FIRMWARE */
ISP_FC_OPMAP(0xdf, 0x01), /* 0x03: MBOX_DUMP_RAM */
ISP_FC_OPMAP(0x07, 0x07), /* 0x04: MBOX_WRITE_RAM_WORD */
ISP_FC_OPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */
@@ -7579,6 +7621,8 @@ isp_setdfltfcparm(ispsoftc_t *isp, int chan)
fcp->isp_wwnn_nvram = DEFAULT_NODEWWN(isp, chan);
fcp->isp_wwpn_nvram = DEFAULT_PORTWWN(isp, chan);
fcp->isp_fwoptions = 0;
+ fcp->isp_xfwoptions = 0;
+ fcp->isp_zfwoptions = 0;
fcp->isp_lasthdl = NIL_HANDLE;
if (IS_24XX(isp)) {
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c
index 5d4c116..35ca7fe 100644
--- a/sys/dev/isp/isp_freebsd.c
+++ b/sys/dev/isp/isp_freebsd.c
@@ -50,13 +50,13 @@ __FBSDID("$FreeBSD$");
MODULE_VERSION(isp, 1);
MODULE_DEPEND(isp, cam, 1, 1, 1);
int isp_announced = 0;
-int isp_fabric_hysteresis = 5;
int isp_loop_down_limit = 60; /* default loop down limit */
int isp_quickboot_time = 7; /* don't wait more than N secs for loop up */
int isp_gone_device_time = 30; /* grace time before reporting device lost */
static const char prom3[] = "Chan %d [%u] PortID 0x%06x Departed because of %s";
-static void isp_freeze_loopdown(ispsoftc_t *, int, char *);
+static void isp_freeze_loopdown(ispsoftc_t *, int);
+static void isp_loop_changed(ispsoftc_t *isp, int chan);
static d_ioctl_t ispioctl;
static void isp_intr_enable(void *);
static void isp_cam_async(void *, uint32_t, struct cam_path *, void *);
@@ -64,8 +64,6 @@ static void isp_poll(struct cam_sim *);
static timeout_t isp_watchdog;
static timeout_t isp_gdt;
static task_fn_t isp_gdt_task;
-static timeout_t isp_ldt;
-static task_fn_t isp_ldt_task;
static void isp_kthread(void *);
static void isp_action(struct cam_sim *, union ccb *);
static int isp_timer_count;
@@ -168,25 +166,13 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq, int chan)
fc->isp = isp;
fc->ready = 1;
- callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0);
callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0);
- TASK_INIT(&fc->ltask, 1, isp_ldt_task, fc);
TASK_INIT(&fc->gtask, 1, isp_gdt_task, fc);
-
- /*
- * We start by being "loop down" if we have an initiator role
- */
- if (fcp->role & ISP_ROLE_INITIATOR) {
- isp_freeze_loopdown(isp, chan, "isp_attach");
- callout_reset(&fc->ldt, isp_quickboot_time * hz, isp_ldt, fc);
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Starting Initial Loop Down Timer @ %lu", (unsigned long) time_uptime);
- }
+ isp_loop_changed(isp, chan);
ISP_UNLOCK(isp);
if (THREAD_CREATE(isp_kthread, fc, &fc->kproc, 0, 0, "%s: fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) {
xpt_free_path(fc->path);
ISP_LOCK(isp);
- if (callout_active(&fc->ldt))
- callout_stop(&fc->ldt);
xpt_bus_deregister(cam_sim_path(fc->sim));
ISP_UNLOCK(isp);
cam_sim_free(fc->sim, FALSE);
@@ -377,13 +363,13 @@ isp_detach(ispsoftc_t *isp)
}
static void
-isp_freeze_loopdown(ispsoftc_t *isp, int chan, char *msg)
+isp_freeze_loopdown(ispsoftc_t *isp, int chan)
{
if (IS_FC(isp)) {
struct isp_fc *fc = ISP_FC_PC(isp, chan);
if (fc->simqfrozen == 0) {
isp_prt(isp, ISP_LOGDEBUG0,
- "Chan %d %s -- freeze simq (loopdown)", chan, msg);
+ "Chan %d Freeze simq (loopdown)", chan);
fc->simqfrozen = SIMQFRZ_LOOPDOWN;
#if __FreeBSD_version >= 1000039
xpt_hold_boot();
@@ -391,7 +377,7 @@ isp_freeze_loopdown(ispsoftc_t *isp, int chan, char *msg)
xpt_freeze_simq(fc->sim, 1);
} else {
isp_prt(isp, ISP_LOGDEBUG0,
- "Chan %d %s -- mark frozen (loopdown)", chan, msg);
+ "Chan %d Mark simq frozen (loopdown)", chan);
fc->simqfrozen |= SIMQFRZ_LOOPDOWN;
}
}
@@ -405,7 +391,8 @@ isp_unfreeze_loopdown(ispsoftc_t *isp, int chan)
int wasfrozen = fc->simqfrozen & SIMQFRZ_LOOPDOWN;
fc->simqfrozen &= ~SIMQFRZ_LOOPDOWN;
if (wasfrozen && fc->simqfrozen == 0) {
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d releasing simq", __func__, chan);
+ isp_prt(isp, ISP_LOGDEBUG0,
+ "Chan %d Release simq", chan);
xpt_release_simq(fc->sim, 1);
#if __FreeBSD_version >= 1000039
xpt_release_boot();
@@ -481,7 +468,7 @@ ispioctl(struct cdev *dev, u_long c, caddr_t addr, int flags, struct thread *td)
break;
}
ISP_LOCK(isp);
- if (isp_fc_runstate(isp, chan, 5 * 1000000)) {
+ if (isp_fc_runstate(isp, chan, 5 * 1000000) != LOOP_READY) {
retval = EIO;
} else {
retval = 0;
@@ -3270,41 +3257,59 @@ isp_gdt_task(void *arg, int pending)
}
/*
- * Loop Down Timer Function- when loop goes down, a timer is started and
- * and after it expires we come here and take all probational devices that
- * the OS knows about and the tell the OS that they've gone away.
- *
+ * When loop goes down we remember the time and freeze CAM command queue.
+ * During some time period we are trying to reprobe the loop. But if we
+ * fail, we tell the OS that devices have gone away and drop the freeze.
+ *
* We don't clear the devices out of our port database because, when loop
* come back up, we have to do some actual cleanup with the chip at that
* point (implicit PLOGO, e.g., to get the chip's port database state right).
*/
static void
-isp_ldt(void *arg)
+isp_loop_changed(ispsoftc_t *isp, int chan)
{
- struct isp_fc *fc = arg;
- taskqueue_enqueue(taskqueue_thread, &fc->ltask);
+ fcparam *fcp = FCPARAM(isp, chan);
+ struct isp_fc *fc = ISP_FC_PC(isp, chan);
+
+ if (fc->loop_down_time)
+ return;
+ isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop changed", chan);
+ if (fcp->role & ISP_ROLE_INITIATOR)
+ isp_freeze_loopdown(isp, chan);
+ fc->loop_dead = 0;
+ fc->loop_down_time = time_uptime;
+ wakeup(fc);
}
static void
-isp_ldt_task(void *arg, int pending)
+isp_loop_up(ispsoftc_t *isp, int chan)
{
- struct isp_fc *fc = arg;
- ispsoftc_t *isp = fc->isp;
- int chan = fc - isp->isp_osinfo.pc.fc;
+ struct isp_fc *fc = ISP_FC_PC(isp, chan);
+
+ isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop is up", chan);
+ fc->loop_seen_once = 1;
+ fc->loop_dead = 0;
+ fc->loop_down_time = 0;
+ isp_unfreeze_loopdown(isp, chan);
+}
+
+static void
+isp_loop_dead(ispsoftc_t *isp, int chan)
+{
+ fcparam *fcp = FCPARAM(isp, chan);
+ struct isp_fc *fc = ISP_FC_PC(isp, chan);
fcportdb_t *lp;
struct ac_contract ac;
struct ac_device_changed *adc;
int dbidx, i;
- ISP_LOCK(isp);
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop Down Timer expired @ %lu", chan, (unsigned long) time_uptime);
- callout_deactivate(&fc->ldt);
+ isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Chan %d Loop is dead", chan);
/*
* Notify to the OS all targets who we now consider have departed.
*/
for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) {
- lp = &FCPARAM(isp, chan)->portdb[dbidx];
+ lp = &fcp->portdb[dbidx];
if (lp->state == FC_PORTDB_STATE_NIL)
continue;
@@ -3347,14 +3352,8 @@ isp_ldt_task(void *arg, int pending)
}
isp_unfreeze_loopdown(isp, chan);
- /*
- * The loop down timer has expired. Wake up the kthread
- * to notice that fact (or make it false).
- */
fc->loop_dead = 1;
- fc->loop_down_time = fc->loop_down_limit+1;
- wakeup(fc);
- ISP_UNLOCK(isp);
+ fc->loop_down_time = 0;
}
static void
@@ -3363,15 +3362,18 @@ isp_kthread(void *arg)
struct isp_fc *fc = arg;
ispsoftc_t *isp = fc->isp;
int chan = fc - isp->isp_osinfo.pc.fc;
- int slp = 0;
+ int slp = 0, d;
+ int lb, lim;
mtx_lock(&isp->isp_osinfo.lock);
while (isp->isp_osinfo.is_exiting == 0) {
- int lb, lim;
-
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d checking FC state", __func__, chan);
+ isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
+ "Chan %d Checking FC state", chan);
lb = isp_fc_runstate(isp, chan, 250000);
+ isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
+ "Chan %d FC got to %s state", chan,
+ isp_fc_loop_statename(lb));
/*
* Our action is different based upon whether we're supporting
@@ -3381,87 +3383,44 @@ isp_kthread(void *arg)
*
* If not, we simply just wait for loop to come up.
*/
- if (lb && (FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR)) {
- /*
- * Increment loop down time by the last sleep interval
- */
- fc->loop_down_time += slp;
-
- if (lb < 0) {
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d FC loop not up (down count %d)", __func__, chan, fc->loop_down_time);
- } else {
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d FC got to %d (down count %d)", __func__, chan, lb, fc->loop_down_time);
- }
-
+ if (lb == LOOP_READY || lb < 0) {
+ slp = 0;
+ } else {
/*
* If we've never seen loop up and we've waited longer
* than quickboot time, or we've seen loop up but we've
* waited longer than loop_down_limit, give up and go
* to sleep until loop comes up.
*/
- if (FCPARAM(isp, chan)->loop_seen_once == 0) {
+ if (fc->loop_seen_once == 0)
lim = isp_quickboot_time;
- } else {
+ else
lim = fc->loop_down_limit;
- }
- if (fc->loop_down_time >= lim) {
- isp_freeze_loopdown(isp, chan, "loop limit hit");
+ d = time_uptime - fc->loop_down_time;
+ if (d >= lim)
slp = 0;
- } else if (fc->loop_down_time < 10) {
+ else if (d < 10)
slp = 1;
- } else if (fc->loop_down_time < 30) {
+ else if (d < 30)
slp = 5;
- } else if (fc->loop_down_time < 60) {
+ else if (d < 60)
slp = 10;
- } else if (fc->loop_down_time < 120) {
+ else if (d < 120)
slp = 20;
- } else {
- slp = 30;
- }
-
- } else if (lb) {
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d FC Loop Down", __func__, chan);
- fc->loop_down_time += slp;
- if (fc->loop_down_time > 300)
- slp = 0;
else
- slp = 60;
- } else {
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d FC state OK", __func__, chan);
- fc->loop_down_time = 0;
- slp = 0;
+ slp = 30;
}
-
- /*
- * If this is past the first loop up or the loop is dead and if we'd frozen the simq, unfreeze it
- * now so that CAM can start sending us commands.
- *
- * If the FC state isn't okay yet, they'll hit that in isp_start which will freeze the queue again
- * or kill the commands, as appropriate.
- */
-
- if (FCPARAM(isp, chan)->loop_seen_once || fc->loop_dead) {
- isp_unfreeze_loopdown(isp, chan);
+ if (slp == 0) {
+ if (lb == LOOP_READY)
+ isp_loop_up(isp, chan);
+ else
+ isp_loop_dead(isp, chan);
}
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d sleep time %d", __func__, chan, slp);
-
+ isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
+ "Chan %d sleep for %d seconds", chan, slp);
msleep(fc, &isp->isp_osinfo.lock, PRIBIO, "ispf", slp * hz);
-
- /*
- * If slp is zero, we're waking up for the first time after
- * things have been okay. In this case, we set a deferral state
- * for all commands and delay hysteresis seconds before starting
- * the FC state evaluation. This gives the loop/fabric a chance
- * to settle.
- */
- if (slp == 0 && fc->hysteresis) {
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "%s: Chan %d sleep hysteresis ticks %d", __func__, chan, fc->hysteresis * hz);
- mtx_unlock(&isp->isp_osinfo.lock);
- pause("ispt", fc->hysteresis * hz);
- mtx_lock(&isp->isp_osinfo.lock);
- }
}
fc->num_threads -= 1;
mtx_unlock(&isp->isp_osinfo.lock);
@@ -3471,7 +3430,7 @@ isp_kthread(void *arg)
static void
isp_action(struct cam_sim *sim, union ccb *ccb)
{
- int bus, tgt, ts, error, lim;
+ int bus, tgt, ts, error;
ispsoftc_t *isp;
struct ccb_trans_settings *cts;
@@ -3535,26 +3494,13 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
break;
case CMD_RQLATER:
/*
- * We get this result for FC devices if the loop state isn't ready yet
- * or if the device in question has gone zombie on us.
- *
- * If we've never seen Loop UP at all, we requeue this request and wait
- * for the initial loop up delay to expire.
+ * We get this result if the loop isn't ready
+ * or if the device in question has gone zombie.
*/
- lim = ISP_FC_PC(isp, bus)->loop_down_limit;
- if (FCPARAM(isp, bus)->loop_seen_once == 0 || ISP_FC_PC(isp, bus)->loop_down_time >= lim) {
- if (FCPARAM(isp, bus)->loop_seen_once == 0) {
- isp_prt(isp, ISP_LOGDEBUG0,
- "%d.%jx loop not seen yet @ %lu",
- XS_TGT(ccb), (uintmax_t)XS_LUN(ccb),
- (unsigned long) time_uptime);
- } else {
- isp_prt(isp, ISP_LOGDEBUG0,
- "%d.%jx downtime (%d) > lim (%d)",
- XS_TGT(ccb), (uintmax_t)XS_LUN(ccb),
- ISP_FC_PC(isp, bus)->loop_down_time,
- lim);
- }
+ if (ISP_FC_PC(isp, bus)->loop_dead) {
+ isp_prt(isp, ISP_LOGDEBUG0,
+ "%d.%jx loop is dead",
+ XS_TGT(ccb), (uintmax_t)XS_LUN(ccb));
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
isp_done((struct ccb_scsiio *) ccb);
break;
@@ -4260,49 +4206,20 @@ isp_async(ispsoftc_t *isp, ispasync_t cmd, ...)
msg = "LOOP Reset";
/* FALLTHROUGH */
case ISPASYNC_LOOP_DOWN:
- {
if (msg == NULL)
msg = "LOOP Down";
va_start(ap, cmd);
bus = va_arg(ap, int);
va_end(ap);
-
- FCPARAM(isp, bus)->isp_linkstate = 0;
-
- fc = ISP_FC_PC(isp, bus);
- if (cmd == ISPASYNC_LOOP_DOWN && fc->ready) {
- /*
- * We don't do any simq freezing if we are only in target mode
- */
- if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
- if (fc->path) {
- isp_freeze_loopdown(isp, bus, msg);
- }
- }
- if (!callout_active(&fc->ldt)) {
- callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc);
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Starting Loop Down Timer @ %lu", (unsigned long) time_uptime);
- }
- }
isp_fcp_reset_crn(isp, bus, /*tgt*/0, /*tgt_set*/ 0);
-
- isp_prt(isp, ISP_LOGINFO, "Chan %d: %s", bus, msg);
+ isp_loop_changed(isp, bus);
+ isp_prt(isp, ISP_LOGINFO, "Chan %d %s", bus, msg);
break;
- }
case ISPASYNC_LOOP_UP:
va_start(ap, cmd);
bus = va_arg(ap, int);
va_end(ap);
- fc = ISP_FC_PC(isp, bus);
- /*
- * Now we just note that Loop has come up. We don't
- * actually do anything because we're waiting for a
- * Change Notify before activating the FC cleanup
- * thread to look at the state of the loop again.
- */
- FCPARAM(isp, bus)->isp_linkstate = 1;
- fc->loop_dead = 0;
- fc->loop_down_time = 0;
+ isp_loop_changed(isp, bus);
isp_prt(isp, ISP_LOGINFO, "Chan %d Loop UP", bus);
break;
case ISPASYNC_DEV_ARRIVED:
@@ -4435,18 +4352,7 @@ changed:
msg = "Other Change Notify";
isp_prt(isp, ISP_LOGINFO, "Chan %d %s", bus, msg);
}
-
- /*
- * If the loop down timer is running, cancel it.
- */
- if (fc->ready && callout_active(&fc->ldt)) {
- isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0, "Stopping Loop Down Timer @ %lu", (unsigned long) time_uptime);
- callout_stop(&fc->ldt);
- }
- if (FCPARAM(isp, bus)->role & ISP_ROLE_INITIATOR) {
- isp_freeze_loopdown(isp, bus, msg);
- }
- wakeup(fc);
+ isp_loop_changed(isp, bus);
break;
}
#ifdef ISP_TARGET_MODE
@@ -4644,91 +4550,52 @@ isp_uninit(ispsoftc_t *isp)
ISP_DISABLE_INTS(isp);
}
-/*
- * When we want to get the 'default' WWNs (when lacking NVRAM), we pick them
- * up from our platform default (defww{p|n}n) and morph them based upon
- * channel.
- *
- * When we want to get the 'active' WWNs, we get NVRAM WWNs and then morph them
- * based upon channel.
- */
-
uint64_t
isp_default_wwn(ispsoftc_t * isp, int chan, int isactive, int iswwnn)
{
uint64_t seed;
struct isp_fc *fc = ISP_FC_PC(isp, chan);
- /*
- * If we're asking for a active WWN, the default overrides get
- * returned, otherwise the NVRAM value is picked.
- *
- * If we're asking for a default WWN, we just pick the default override.
- */
+ /* First try to use explicitly configured WWNs. */
+ seed = iswwnn ? fc->def_wwnn : fc->def_wwpn;
+ if (seed)
+ return (seed);
+
+ /* Otherwise try to use WWNs from NVRAM. */
if (isactive) {
- seed = iswwnn ? fc->def_wwnn : fc->def_wwpn;
- if (seed) {
- return (seed);
- }
- seed = iswwnn ? FCPARAM(isp, chan)->isp_wwnn_nvram : FCPARAM(isp, chan)->isp_wwpn_nvram;
- if (seed) {
+ seed = iswwnn ? FCPARAM(isp, chan)->isp_wwnn_nvram :
+ FCPARAM(isp, chan)->isp_wwpn_nvram;
+ if (seed)
return (seed);
- }
- return (0x400000007F000009ull);
}
- seed = iswwnn ? fc->def_wwnn : fc->def_wwpn;
-
- /*
- * For channel zero just return what we have. For either ACTIVE or
- * DEFAULT cases, we depend on default override of NVRAM values for
- * channel zero.
- */
- if (chan == 0) {
- return (seed);
+ /* If still no WWNs, try to steal them from the first channel. */
+ if (chan > 0) {
+ seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn :
+ ISP_FC_PC(isp, 0)->def_wwpn;
+ if (seed == 0) {
+ seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram :
+ FCPARAM(isp, 0)->isp_wwpn_nvram;
+ }
}
- /*
- * For other channels, we are doing one of three things:
- *
- * 1. If what we have now is non-zero, return it. Otherwise we morph
- * values from channel 0. 2. If we're here for a WWPN we synthesize
- * it if Channel 0's wwpn has a type 2 NAA. 3. If we're here for a
- * WWNN we synthesize it if Channel 0's wwnn has a type 2 NAA.
- */
-
- if (seed) {
- return (seed);
+ /* If still nothing -- improvise. */
+ if (seed == 0) {
+ seed = 0x400000007F000000ull + device_get_unit(isp->isp_dev);
+ if (!iswwnn)
+ seed ^= 0x0100000000000000ULL;
}
- seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : ISP_FC_PC(isp, 0)->def_wwpn;
- if (seed == 0)
- seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram : FCPARAM(isp, 0)->isp_wwpn_nvram;
- if (((seed >> 60) & 0xf) == 2) {
+ /* For additional channels we have to improvise even more. */
+ if (!iswwnn && chan > 0) {
/*
- * The type 2 NAA fields for QLogic cards appear be laid out
- * thusly:
- *
- * bits 63..60 NAA == 2 bits 59..57 unused/zero bit 56
- * port (1) or node (0) WWN distinguishor bit 48
- * physical port on dual-port chips (23XX/24XX)
- *
- * This is somewhat nutty, particularly since bit 48 is
- * irrelevant as they assign separate serial numbers to
- * different physical ports anyway.
- *
* We'll stick our channel number plus one first into bits
* 57..59 and thence into bits 52..55 which allows for 8 bits
- * of channel which is comfortably more than our maximum
- * (126) now.
+ * of channel which is enough for our maximum of 255 channels.
*/
- seed &= ~0x0FF0000000000000ULL;
- if (iswwnn == 0) {
- seed |= ((uint64_t) (chan + 1) & 0xf) << 56;
- seed |= ((uint64_t) ((chan + 1) >> 4) & 0xf) << 52;
- }
- } else {
- seed = 0;
+ seed ^= 0x0100000000000000ULL;
+ seed ^= ((uint64_t) (chan + 1) & 0xf) << 56;
+ seed ^= ((uint64_t) ((chan + 1) >> 4) & 0xf) << 52;
}
return (seed);
}
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h
index 8712cec..9a9093a 100644
--- a/sys/dev/isp/isp_freebsd.h
+++ b/sys/dev/isp/isp_freebsd.h
@@ -38,6 +38,7 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
+#include <sys/rman.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
@@ -228,9 +229,9 @@ struct isp_fc {
bus_dmamap_t tdmap;
uint64_t def_wwpn;
uint64_t def_wwnn;
- uint32_t loop_down_time;
- uint32_t loop_down_limit;
- uint32_t gone_device_time;
+ time_t loop_down_time;
+ int loop_down_limit;
+ int gone_device_time;
/*
* Per target/lun info- just to keep a per-ITL nexus crn count
*/
@@ -239,15 +240,13 @@ struct isp_fc {
uint32_t
simqfrozen : 3,
default_id : 8,
- hysteresis : 8,
def_role : 2, /* default role */
gdt_running : 1,
loop_dead : 1,
+ loop_seen_once : 1,
fcbsy : 1,
ready : 1;
- struct callout ldt; /* loop down timer */
struct callout gdt; /* gone device timer */
- struct task ltask;
struct task gtask;
#ifdef ISP_TARGET_MODE
struct tslist lun_hash[LUN_HASH_SIZE];
@@ -288,9 +287,9 @@ struct isposinfo {
/*
* DMA related sdtuff
*/
- bus_space_tag_t bus_tag;
+ struct resource * regs;
+ struct resource * regs2;
bus_dma_tag_t dmat;
- bus_space_handle_t bus_handle;
bus_dma_tag_t cdmat;
bus_dmamap_t cdmap;
@@ -363,8 +362,8 @@ struct isposinfo {
#define FCP_NEXT_CRN isp_fcp_next_crn
#define isp_lock isp_osinfo.lock
-#define isp_bus_tag isp_osinfo.bus_tag
-#define isp_bus_handle isp_osinfo.bus_handle
+#define isp_regs isp_osinfo.regs
+#define isp_regs2 isp_osinfo.regs2
/*
* Locking macros...
@@ -432,8 +431,7 @@ case SYNC_RESULT: \
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \
break; \
case SYNC_REG: \
- bus_space_barrier(isp->isp_osinfo.bus_tag, \
- isp->isp_osinfo.bus_handle, offset, size, \
+ bus_barrier(isp->isp_osinfo.regs, offset, size, \
BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \
break; \
default: \
@@ -465,8 +463,7 @@ case SYNC_RESULT: \
isp->isp_osinfo.cdmap, BUS_DMASYNC_POSTWRITE); \
break; \
case SYNC_REG: \
- bus_space_barrier(isp->isp_osinfo.bus_tag, \
- isp->isp_osinfo.bus_handle, offset, size, \
+ bus_barrier(isp->isp_osinfo.regs, offset, size, \
BUS_SPACE_BARRIER_WRITE); \
break; \
default: \
@@ -698,7 +695,6 @@ extern uint64_t isp_default_wwn(ispsoftc_t *, int, int, int);
* driver global data
*/
extern int isp_announced;
-extern int isp_fabric_hysteresis;
extern int isp_loop_down_limit;
extern int isp_gone_device_time;
extern int isp_quickboot_time;
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c
index 6003d00..ec99244 100644
--- a/sys/dev/isp/isp_library.c
+++ b/sys/dev/isp/isp_library.c
@@ -394,33 +394,31 @@ isp_print_bytes(ispsoftc_t *isp, const char *msg, int amt, void *arg)
int
isp_fc_runstate(ispsoftc_t *isp, int chan, int tval)
{
- fcparam *fcp;
+ fcparam *fcp = FCPARAM(isp, chan);
+ int res;
- fcp = FCPARAM(isp, chan);
- if (fcp->role == ISP_ROLE_NONE) {
- return (0);
- }
- if (isp_control(isp, ISPCTL_FCLINK_TEST, chan, tval) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: linktest failed for channel %d", chan);
+again:
+ if (fcp->role == ISP_ROLE_NONE)
return (-1);
- }
- if (isp_control(isp, ISPCTL_SCAN_LOOP, chan) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: scan loop failed on channel %d", chan);
- return (LOOP_LTEST_DONE);
- }
- if (isp_control(isp, ISPCTL_SCAN_FABRIC, chan) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: scan fabric failed on channel %d", chan);
- return (LOOP_LSCAN_DONE);
- }
- if (isp_control(isp, ISPCTL_PDB_SYNC, chan) != 0) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: pdb_sync failed on channel %d", chan);
- return (LOOP_FSCAN_DONE);
- }
- if (fcp->isp_loopstate != LOOP_READY) {
- isp_prt(isp, ISP_LOG_SANCFG, "isp_fc_runstate: not ready again on channel %d", chan);
- return (-1);
- }
- return (0);
+ res = isp_control(isp, ISPCTL_FCLINK_TEST, chan, tval);
+ if (res > 0)
+ goto again;
+ if (res < 0)
+ return (fcp->isp_loopstate);
+ res = isp_control(isp, ISPCTL_SCAN_LOOP, chan);
+ if (res > 0)
+ goto again;
+ if (res < 0)
+ return (fcp->isp_loopstate);
+ res = isp_control(isp, ISPCTL_SCAN_FABRIC, chan);
+ if (res > 0)
+ goto again;
+ if (res < 0)
+ return (fcp->isp_loopstate);
+ res = isp_control(isp, ISPCTL_PDB_SYNC, chan);
+ if (res > 0)
+ goto again;
+ return (fcp->isp_loopstate);
}
/*
@@ -545,6 +543,7 @@ isp_fc_loop_statename(int state)
{
switch (state) {
case LOOP_NIL: return "NIL";
+ case LOOP_HAVE_LINK: return "Have Link";
case LOOP_TESTING_LINK: return "Testing Link";
case LOOP_LTEST_DONE: return "Link Test Done";
case LOOP_SCANNING_LOOP: return "Scanning Loop";
@@ -1403,7 +1402,9 @@ isp_put_icb_2400(ispsoftc_t *isp, isp_icb_2400_t *src, isp_icb_2400_t *dst)
for (i = 0; i < 4; i++) {
ISP_IOXPUT_16(isp, src->icb_priaddr[i], &dst->icb_priaddr[i]);
}
- for (i = 0; i < 4; i++) {
+ ISP_IOXPUT_16(isp, src->icb_msixresp, &dst->icb_msixresp);
+ ISP_IOXPUT_16(isp, src->icb_msixatio, &dst->icb_msixatio);
+ for (i = 0; i < 2; i++) {
ISP_IOXPUT_16(isp, src->icb_reserved1[i], &dst->icb_reserved1[i]);
}
ISP_IOXPUT_16(isp, src->icb_atio_in, &dst->icb_atio_in);
@@ -1416,9 +1417,14 @@ isp_put_icb_2400(ispsoftc_t *isp, isp_icb_2400_t *src, isp_icb_2400_t *dst)
ISP_IOXPUT_32(isp, src->icb_fwoptions1, &dst->icb_fwoptions1);
ISP_IOXPUT_32(isp, src->icb_fwoptions2, &dst->icb_fwoptions2);
ISP_IOXPUT_32(isp, src->icb_fwoptions3, &dst->icb_fwoptions3);
- for (i = 0; i < 12; i++) {
+ ISP_IOXPUT_16(isp, src->icb_qos, &dst->icb_qos);
+ for (i = 0; i < 3; i++)
ISP_IOXPUT_16(isp, src->icb_reserved2[i], &dst->icb_reserved2[i]);
- }
+ for (i = 0; i < 3; i++)
+ ISP_IOXPUT_16(isp, src->icb_enodemac[i], &dst->icb_enodemac[i]);
+ ISP_IOXPUT_16(isp, src->icb_disctime, &dst->icb_disctime);
+ for (i = 0; i < 4; i++)
+ ISP_IOXPUT_16(isp, src->icb_reserved3[i], &dst->icb_reserved3[i]);
}
void
diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c
index 87fbb8d..bd0ceea 100644
--- a/sys/dev/isp/isp_pci.c
+++ b/sys/dev/isp/isp_pci.c
@@ -59,6 +59,8 @@ static uint32_t isp_pci_rd_reg_1080(ispsoftc_t *, int);
static void isp_pci_wr_reg_1080(ispsoftc_t *, int, uint32_t);
static uint32_t isp_pci_rd_reg_2400(ispsoftc_t *, int);
static void isp_pci_wr_reg_2400(ispsoftc_t *, int, uint32_t);
+static uint32_t isp_pci_rd_reg_2600(ispsoftc_t *, int);
+static void isp_pci_wr_reg_2600(ispsoftc_t *, int, uint32_t);
static int isp_pci_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *);
static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *);
static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *);
@@ -172,6 +174,18 @@ static struct ispmdvec mdvec_2500 = {
NULL
};
+static struct ispmdvec mdvec_2600 = {
+ isp_pci_rd_isr_2400,
+ isp_pci_rd_reg_2600,
+ isp_pci_wr_reg_2600,
+ isp_pci_mbxdma,
+ isp_pci_dmasetup,
+ isp_common_dmateardown,
+ isp_pci_reset0,
+ isp_pci_reset1,
+ NULL
+};
+
#ifndef PCIM_CMD_INVEN
#define PCIM_CMD_INVEN 0x10
#endif
@@ -276,6 +290,10 @@ static struct ispmdvec mdvec_2500 = {
#define PCI_PRODUCT_QLOGIC_ISP5432 0x5432
#endif
+#ifndef PCI_PRODUCT_QLOGIC_ISP2031
+#define PCI_PRODUCT_QLOGIC_ISP2031 0x2031
+#endif
+
#define PCI_QLOGIC_ISP5432 \
((PCI_PRODUCT_QLOGIC_ISP5432 << 16) | PCI_VENDOR_QLOGIC)
@@ -327,14 +345,14 @@ static struct ispmdvec mdvec_2500 = {
#define PCI_QLOGIC_ISP6322 \
((PCI_PRODUCT_QLOGIC_ISP6322 << 16) | PCI_VENDOR_QLOGIC)
+#define PCI_QLOGIC_ISP2031 \
+ ((PCI_PRODUCT_QLOGIC_ISP2031 << 16) | PCI_VENDOR_QLOGIC)
+
/*
* Odd case for some AMI raid cards... We need to *not* attach to this.
*/
#define AMI_RAID_SUBVENDOR_ID 0x101e
-#define IO_MAP_REG 0x10
-#define MEM_MAP_REG 0x14
-
#define PCI_DFLT_LTNCY 0x40
#define PCI_DFLT_LNSZ 0x10
@@ -348,10 +366,13 @@ struct isp_pcisoftc {
ispsoftc_t pci_isp;
device_t pci_dev;
struct resource * regs;
+ struct resource * regs2;
void * irq;
int iqd;
int rtp;
int rgd;
+ int rtp2;
+ int rgd2;
void * ih;
int16_t pci_poff[_NREG_BLKS];
bus_dma_tag_t dmat;
@@ -434,6 +455,9 @@ isp_pci_probe(device_t dev)
case PCI_QLOGIC_ISP6322:
device_set_desc(dev, "Qlogic ISP 6322 PCI FC-AL Adapter");
break;
+ case PCI_QLOGIC_ISP2031:
+ device_set_desc(dev, "Qlogic ISP 2031 PCI FC-AL Adapter");
+ break;
default:
return (ENXIO);
}
@@ -485,31 +509,6 @@ isp_get_generic_options(device_t dev, ispsoftc_t *isp)
}
static void
-isp_get_pci_options(device_t dev, int *m1, int *m2)
-{
- int tval;
- /*
- * Which we should try first - memory mapping or i/o mapping?
- *
- * We used to try memory first followed by i/o on alpha, otherwise
- * the reverse, but we should just try memory first all the time now.
- */
- *m1 = PCIM_CMD_MEMEN;
- *m2 = PCIM_CMD_PORTEN;
-
- tval = 0;
- if (resource_int_value(device_get_name(dev), device_get_unit(dev), "prefer_iomap", &tval) == 0 && tval != 0) {
- *m1 = PCIM_CMD_PORTEN;
- *m2 = PCIM_CMD_MEMEN;
- }
- tval = 0;
- if (resource_int_value(device_get_name(dev), device_get_unit(dev), "prefer_memmap", &tval) == 0 && tval != 0) {
- *m1 = PCIM_CMD_MEMEN;
- *m2 = PCIM_CMD_PORTEN;
- }
-}
-
-static void
isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
{
const char *sptr;
@@ -638,16 +637,6 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
}
}
- tval = 0;
- snprintf(name, sizeof(name), "%shysteresis", prefix);
- (void) resource_int_value(device_get_name(dev), device_get_unit(dev),
- "name", &tval);
- if (tval >= 0 && tval < 256) {
- ISP_FC_PC(isp, chan)->hysteresis = tval;
- } else {
- ISP_FC_PC(isp, chan)->hysteresis = isp_fabric_hysteresis;
- }
-
tval = -1;
snprintf(name, sizeof(name), "%sloop_down_limit", prefix);
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
@@ -672,7 +661,7 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
static int
isp_pci_attach(device_t dev)
{
- int i, m1, m2, locksetup = 0;
+ int i, locksetup = 0;
uint32_t data, cmd, linesz, did;
struct isp_pcisoftc *pcs;
ispsoftc_t *isp;
@@ -699,33 +688,10 @@ isp_pci_attach(device_t dev)
isp_nvports = 0;
isp_get_generic_options(dev, isp);
- /*
- * Get PCI options- which in this case are just mapping preferences.
- */
- isp_get_pci_options(dev, &m1, &m2);
-
linesz = PCI_DFLT_LNSZ;
- pcs->irq = pcs->regs = NULL;
+ pcs->irq = pcs->regs = pcs->regs2 = NULL;
pcs->rgd = pcs->rtp = pcs->iqd = 0;
- pcs->rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT;
- pcs->rgd = (m1 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG;
- pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE);
- if (pcs->regs == NULL) {
- pcs->rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT;
- pcs->rgd = (m2 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG;
- pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE);
- }
- if (pcs->regs == NULL) {
- device_printf(dev, "unable to map any ports\n");
- goto bad;
- }
- if (bootverbose) {
- device_printf(dev, "using %s space register mapping\n", (pcs->rgd == IO_MAP_REG)? "I/O" : "Memory");
- }
- isp->isp_bus_tag = rman_get_bustag(pcs->regs);
- isp->isp_bus_handle = rman_get_bushandle(pcs->regs);
-
pcs->pci_dev = dev;
pcs->pci_poff[BIU_BLOCK >> _BLK_REG_SHFT] = BIU_REGS_OFF;
pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS_OFF;
@@ -833,6 +799,13 @@ isp_pci_attach(device_t dev)
isp->isp_type = ISP_HA_FC_2500;
pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF;
break;
+ case PCI_QLOGIC_ISP2031:
+ did = 0x2600;
+ isp->isp_nchan += isp_nvports;
+ isp->isp_mdvec = &mdvec_2600;
+ isp->isp_type = ISP_HA_FC_2600;
+ pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF;
+ break;
default:
device_printf(dev, "unknown device type\n");
goto bad;
@@ -840,6 +813,38 @@ isp_pci_attach(device_t dev)
}
isp->isp_revision = pci_get_revid(dev);
+ if (IS_26XX(isp)) {
+ pcs->rtp = SYS_RES_MEMORY;
+ pcs->rgd = PCIR_BAR(0);
+ pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd,
+ RF_ACTIVE);
+ pcs->rtp2 = SYS_RES_MEMORY;
+ pcs->rgd2 = PCIR_BAR(4);
+ pcs->regs2 = bus_alloc_resource_any(dev, pcs->rtp2, &pcs->rgd2,
+ RF_ACTIVE);
+ } else {
+ pcs->rtp = SYS_RES_MEMORY;
+ pcs->rgd = PCIR_BAR(1);
+ pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd,
+ RF_ACTIVE);
+ if (pcs->regs == NULL) {
+ pcs->rtp = SYS_RES_IOPORT;
+ pcs->rgd = PCIR_BAR(0);
+ pcs->regs = bus_alloc_resource_any(dev, pcs->rtp,
+ &pcs->rgd, RF_ACTIVE);
+ }
+ }
+ if (pcs->regs == NULL) {
+ device_printf(dev, "Unable to map any ports\n");
+ goto bad;
+ }
+ if (bootverbose) {
+ device_printf(dev, "Using %s space register mapping\n",
+ (pcs->rtp == SYS_RES_IOPORT)? "I/O" : "Memory");
+ }
+ isp->isp_regs = pcs->regs;
+ isp->isp_regs2 = pcs->regs2;
+
if (IS_FC(isp)) {
psize = sizeof (fcparam);
xsize = sizeof (struct isp_fc);
@@ -988,9 +993,10 @@ bad:
if (pcs->msicount) {
pci_release_msi(dev);
}
- if (pcs->regs) {
+ if (pcs->regs)
(void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs);
- }
+ if (pcs->regs2)
+ (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2);
if (pcs->pci_isp.isp_param) {
free(pcs->pci_isp.isp_param, M_DEVBUF);
pcs->pci_isp.isp_param = NULL;
@@ -1029,6 +1035,8 @@ isp_pci_detach(device_t dev)
pci_release_msi(dev);
}
(void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs);
+ if (pcs->regs2)
+ (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2);
/*
* XXX: THERE IS A LOT OF LEAKAGE HERE
*/
@@ -1047,15 +1055,12 @@ isp_pci_detach(device_t dev)
(((struct isp_pcisoftc *)a)->pci_poff[((x) & _BLK_REG_MASK) >> \
_BLK_REG_SHFT] + ((x) & 0xfff))
-#define BXR2(isp, off) \
- bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off)
-#define BXW2(isp, off, v) \
- bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, off, v)
-#define BXR4(isp, off) \
- bus_space_read_4(isp->isp_bus_tag, isp->isp_bus_handle, off)
-#define BXW4(isp, off, v) \
- bus_space_write_4(isp->isp_bus_tag, isp->isp_bus_handle, off, v)
-
+#define BXR2(isp, off) bus_read_2((isp)->isp_regs, (off))
+#define BXW2(isp, off, v) bus_write_2((isp)->isp_regs, (off), (v))
+#define BXR4(isp, off) bus_read_4((isp)->isp_regs, (off))
+#define BXW4(isp, off, v) bus_write_4((isp)->isp_regs, (off), (v))
+#define B2R4(isp, off) bus_read_4((isp)->isp_regs2, (off))
+#define B2W4(isp, off, v) bus_write_4((isp)->isp_regs2, (off), (v))
static ISP_INLINE int
isp_pci_rd_debounced(ispsoftc_t *isp, int off, uint16_t *rp)
@@ -1318,20 +1323,19 @@ isp_pci_rd_reg_2400(ispsoftc_t *isp, int regoff)
case MBOX_BLOCK:
return (BXR2(isp, IspVirt2Off(isp, regoff)));
case SXP_BLOCK:
- isp_prt(isp, ISP_LOGWARN, "SXP_BLOCK read at 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "SXP_BLOCK read at 0x%x", regoff);
return (0xffffffff);
case RISC_BLOCK:
- isp_prt(isp, ISP_LOGWARN, "RISC_BLOCK read at 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "RISC_BLOCK read at 0x%x", regoff);
return (0xffffffff);
case DMA_BLOCK:
- isp_prt(isp, ISP_LOGWARN, "DMA_BLOCK read at 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "DMA_BLOCK read at 0x%x", regoff);
return (0xffffffff);
default:
- isp_prt(isp, ISP_LOGWARN, "unknown block read at 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "unknown block read at 0x%x", regoff);
return (0xffffffff);
}
-
switch (regoff) {
case BIU2400_FLASH_ADDR:
case BIU2400_FLASH_DATA:
@@ -1359,8 +1363,8 @@ isp_pci_rd_reg_2400(ispsoftc_t *isp, int regoff)
rv = BXR4(isp, IspVirt2Off(isp, regoff)) >> 16;
break;
default:
- isp_prt(isp, ISP_LOGERR,
- "isp_pci_rd_reg_2400: unknown offset %x", regoff);
+ isp_prt(isp, ISP_LOGERR, "unknown register read at 0x%x",
+ regoff);
rv = 0xffffffff;
break;
}
@@ -1380,17 +1384,16 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int regoff, uint32_t val)
MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1);
return;
case SXP_BLOCK:
- isp_prt(isp, ISP_LOGWARN, "SXP_BLOCK write at 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "SXP_BLOCK write at 0x%x", regoff);
return;
case RISC_BLOCK:
- isp_prt(isp, ISP_LOGWARN, "RISC_BLOCK write at 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "RISC_BLOCK write at 0x%x", regoff);
return;
case DMA_BLOCK:
- isp_prt(isp, ISP_LOGWARN, "DMA_BLOCK write at 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "DMA_BLOCK write at 0x%x", regoff);
return;
default:
- isp_prt(isp, ISP_LOGWARN, "unknown block write at 0x%x",
- regoff);
+ isp_prt(isp, ISP_LOGERR, "unknown block write at 0x%x", regoff);
break;
}
@@ -1425,10 +1428,83 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int regoff, uint32_t val)
MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 4, -1);
break;
default:
- isp_prt(isp, ISP_LOGERR,
- "isp_pci_wr_reg_2400: bad offset 0x%x", regoff);
+ isp_prt(isp, ISP_LOGERR, "unknown register write at 0x%x",
+ regoff);
+ break;
+ }
+}
+
+static uint32_t
+isp_pci_rd_reg_2600(ispsoftc_t *isp, int regoff)
+{
+ uint32_t rv;
+
+ switch (regoff) {
+ case BIU2400_PRI_REQINP:
+ case BIU2400_PRI_REQOUTP:
+ isp_prt(isp, ISP_LOGERR, "unknown register read at 0x%x",
+ regoff);
+ rv = 0xffffffff;
+ break;
+ case BIU2400_REQINP:
+ rv = B2R4(isp, 0x00);
+ break;
+ case BIU2400_REQOUTP:
+ rv = B2R4(isp, 0x04);
+ break;
+ case BIU2400_RSPINP:
+ rv = B2R4(isp, 0x08);
+ break;
+ case BIU2400_RSPOUTP:
+ rv = B2R4(isp, 0x0c);
+ break;
+ case BIU2400_ATIO_RSPINP:
+ rv = B2R4(isp, 0x10);
+ break;
+ case BIU2400_ATIO_RSPOUTP:
+ rv = B2R4(isp, 0x14);
break;
+ default:
+ rv = isp_pci_rd_reg_2400(isp, regoff);
+ break;
+ }
+ return (rv);
+}
+
+static void
+isp_pci_wr_reg_2600(ispsoftc_t *isp, int regoff, uint32_t val)
+{
+ int off;
+
+ switch (regoff) {
+ case BIU2400_PRI_REQINP:
+ case BIU2400_PRI_REQOUTP:
+ isp_prt(isp, ISP_LOGERR, "unknown register write at 0x%x",
+ regoff);
+ return;
+ case BIU2400_REQINP:
+ off = 0x00;
+ break;
+ case BIU2400_REQOUTP:
+ off = 0x04;
+ break;
+ case BIU2400_RSPINP:
+ off = 0x08;
+ break;
+ case BIU2400_RSPOUTP:
+ off = 0x0c;
+ break;
+ case BIU2400_ATIO_RSPINP:
+ off = 0x10;
+ break;
+ case BIU2400_ATIO_RSPOUTP:
+ off = 0x14;
+ break;
+ default:
+ isp_pci_wr_reg_2400(isp, regoff, val);
+ return;
}
+ B2W4(isp, off, val);
}
diff --git a/sys/dev/isp/isp_sbus.c b/sys/dev/isp/isp_sbus.c
index cb8f169..2abfc64 100644
--- a/sys/dev/isp/isp_sbus.c
+++ b/sys/dev/isp/isp_sbus.c
@@ -180,8 +180,7 @@ isp_sbus_attach(device_t dev)
sbs->sbus_poff[RISC_BLOCK >> _BLK_REG_SHFT] = SBUS_RISC_REGS_OFF;
sbs->sbus_poff[DMA_BLOCK >> _BLK_REG_SHFT] = DMA_REGS_OFF;
isp = &sbs->sbus_isp;
- isp->isp_bus_tag = rman_get_bustag(sbs->regs);
- isp->isp_bus_handle = rman_get_bushandle(sbs->regs);
+ isp->isp_regs = sbs->regs;
isp->isp_mdvec = &sbs->sbus_mdvec;
isp->isp_bustype = ISP_BT_SBUS;
isp->isp_type = ISP_HA_SCSI_UNKNOWN;
@@ -367,16 +366,15 @@ isp_sbus_detach(device_t dev)
(((struct isp_sbussoftc *)a)->sbus_poff[((x) & _BLK_REG_MASK) >> \
_BLK_REG_SHFT] + ((x) & 0xff))
-#define BXR2(sbc, off) \
- bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off)
+#define BXR2(isp, off) bus_read_2((isp)->isp_regs, (off))
static int
isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info)
{
uint16_t isr, sema;
- isr = BXR2(sbc, IspVirt2Off(isp, BIU_ISR));
- sema = BXR2(sbc, IspVirt2Off(isp, BIU_SEMA));
+ isr = BXR2(isp, IspVirt2Off(isp, BIU_ISR));
+ sema = BXR2(isp, IspVirt2Off(isp, BIU_SEMA));
isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema);
isr &= INT_PENDING_MASK(isp);
sema &= BIU_SEMA_LOCK;
@@ -385,7 +383,7 @@ isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info
}
*isrp = isr;
if ((*semap = sema) != 0)
- *info = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0));
+ *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0));
return (1);
}
@@ -396,7 +394,7 @@ isp_sbus_rd_reg(ispsoftc_t *isp, int regoff)
struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp;
int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT];
offset += (regoff & 0xff);
- rval = bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, offset);
+ rval = BXR2(isp, offset);
isp_prt(isp, ISP_LOGDEBUG3,
"isp_sbus_rd_reg(off %x) = %x", regoff, rval);
return (rval);
@@ -410,7 +408,7 @@ isp_sbus_wr_reg(ispsoftc_t *isp, int regoff, uint32_t val)
offset += (regoff & 0xff);
isp_prt(isp, ISP_LOGDEBUG3,
"isp_sbus_wr_reg(off %x) = %x", regoff, val);
- bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, offset, val);
+ bus_write_2(isp->isp_regs, offset, val);
MEMORYBARRIER(isp, SYNC_REG, offset, 2, -1);
}
diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h
index d724679..a89228b 100644
--- a/sys/dev/isp/ispmbox.h
+++ b/sys/dev/isp/ispmbox.h
@@ -122,6 +122,7 @@
#define MBOX_GET_TARGET_STATUS 0x0056
/* These are for the ISP2X00 FC cards */
+#define MBOX_LOAD_FLASH_FIRMWARE 0x0003
#define MBOX_WRITE_FC_SERDES_REG 0x0003 /* FC only */
#define MBOX_READ_FC_SERDES_REG 0x0004 /* FC only */
#define MBOX_GET_IO_STATUS 0x0012
@@ -1007,9 +1008,9 @@ typedef struct {
#define ICBXOPT_TIMER_MASK 0x7
#define ICBZOPT_RATE_MASK 0xC000
-#define ICBZOPT_RATE_ONEGB 0x0000
+#define ICBZOPT_RATE_1GB 0x0000
#define ICBZOPT_RATE_AUTO 0x8000
-#define ICBZOPT_RATE_TWOGB 0x4000
+#define ICBZOPT_RATE_2GB 0x4000
#define ICBZOPT_50_OHM 0x2000
#define ICBZOPT_NO_LOCAL_PLOGI 0x0080
#define ICBZOPT_ENA_OOF 0x0040 /* out of order frame handling */
@@ -1058,14 +1059,14 @@ typedef struct {
#define ICB2400_OPT3_ENA_ETH_RESP 0x08000000
#define ICB2400_OPT3_ENA_ETH_ATIO 0x04000000
#define ICB2400_OPT3_ENA_MFCF 0x00020000
-#define ICB2400_OPT3_SKIP_FOURGB 0x00010000
+#define ICB2400_OPT3_SKIP_4GB 0x00010000
#define ICB2400_OPT3_RATE_MASK 0x0000E000
-#define ICB2400_OPT3_RATE_ONEGB 0x00000000
-#define ICB2400_OPT3_RATE_TWOGB 0x00002000
+#define ICB2400_OPT3_RATE_1GB 0x00000000
+#define ICB2400_OPT3_RATE_2GB 0x00002000
#define ICB2400_OPT3_RATE_AUTO 0x00004000
-#define ICB2400_OPT3_RATE_FOURGB 0x00006000
-#define ICB2400_OPT3_RATE_EIGHTGB 0x00008000
-#define ICB2400_OPT3_RATE_SIXTEENGB 0x0000A000
+#define ICB2400_OPT3_RATE_4GB 0x00006000
+#define ICB2400_OPT3_RATE_8GB 0x00008000
+#define ICB2400_OPT3_RATE_16GB 0x0000A000
#define ICB2400_OPT3_ENA_OOF_XFRDY 0x00000200
#define ICB2400_OPT3_NO_N2N_LOGI 0x00000100
#define ICB2400_OPT3_NO_LOCAL_PLOGI 0x00000080
diff --git a/sys/dev/isp/ispvar.h b/sys/dev/isp/ispvar.h
index 9b4156a..0c42642 100644
--- a/sys/dev/isp/ispvar.h
+++ b/sys/dev/isp/ispvar.h
@@ -438,10 +438,9 @@ typedef struct {
int isp_loopstate; /* Loop State */
int isp_topo; /* Connection Type */
- uint32_t : 3,
+ uint32_t : 4,
fctape_enabled : 1,
sendmarker : 1,
- loop_seen_once : 1,
role : 2,
isp_portid : 24; /* S_ID */
@@ -490,14 +489,15 @@ typedef struct {
#define FW_NON_PART 7
#define LOOP_NIL 0
-#define LOOP_TESTING_LINK 1
-#define LOOP_LTEST_DONE 2
-#define LOOP_SCANNING_LOOP 3
-#define LOOP_LSCAN_DONE 4
-#define LOOP_SCANNING_FABRIC 5
-#define LOOP_FSCAN_DONE 6
-#define LOOP_SYNCING_PDB 7
-#define LOOP_READY 8
+#define LOOP_HAVE_LINK 1
+#define LOOP_TESTING_LINK 2
+#define LOOP_LTEST_DONE 3
+#define LOOP_SCANNING_LOOP 4
+#define LOOP_LSCAN_DONE 5
+#define LOOP_SCANNING_FABRIC 6
+#define LOOP_FSCAN_DONE 7
+#define LOOP_SYNCING_PDB 8
+#define LOOP_READY 9
#define TOPO_NL_PORT 0
#define TOPO_FL_PORT 1
@@ -653,8 +653,8 @@ struct ispsoftc {
#define ISP_CFG_NPORT 0x04 /* prefer {N/F}-Port connection */
#define ISP_CFG_NPORT_ONLY 0x08 /* insist on {N/F}-Port connection */
#define ISP_CFG_LPORT_ONLY 0x0c /* insist on {N/F}L-Port connection */
-#define ISP_CFG_ONEGB 0x10 /* force 1GB connection (23XX only) */
-#define ISP_CFG_TWOGB 0x20 /* force 2GB connection (23XX only) */
+#define ISP_CFG_1GB 0x10 /* force 1GB connection (23XX only) */
+#define ISP_CFG_2GB 0x20 /* force 2GB connection (23XX only) */
#define ISP_CFG_NORELOAD 0x80 /* don't download f/w */
#define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */
#define ISP_CFG_NOFCTAPE 0x100 /* disable FC-Tape */
@@ -662,9 +662,9 @@ struct ispsoftc {
#define ISP_CFG_OWNFSZ 0x400 /* override NVRAM frame size */
#define ISP_CFG_OWNLOOPID 0x800 /* override NVRAM loopid */
#define ISP_CFG_OWNEXCTHROTTLE 0x1000 /* override NVRAM execution throttle */
-#define ISP_CFG_FOURGB 0x2000 /* force 4GB connection (24XX only) */
-#define ISP_CFG_EIGHTGB 0x4000 /* force 8GB connection (25XX only) */
-#define ISP_CFG_SIXTEENGB 0x8000 /* force 16GB connection (82XX only) */
+#define ISP_CFG_4GB 0x2000 /* force 4GB connection (24XX only) */
+#define ISP_CFG_8GB 0x4000 /* force 8GB connection (25XX only) */
+#define ISP_CFG_16GB 0x8000 /* force 16GB connection (82XX only) */
/*
* For each channel, the outer layers should know what role that channel
@@ -764,6 +764,7 @@ struct ispsoftc {
#define ISP_HA_FC_2322 0x50
#define ISP_HA_FC_2400 0x60
#define ISP_HA_FC_2500 0x70
+#define ISP_HA_FC_2600 0x80
#define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI)
#define IS_1020(isp) (isp->isp_type < ISP_HA_SCSI_1240)
@@ -789,6 +790,7 @@ struct ispsoftc {
#define IS_2322(isp) ((isp)->isp_type == ISP_HA_FC_2322)
#define IS_24XX(isp) ((isp)->isp_type >= ISP_HA_FC_2400)
#define IS_25XX(isp) ((isp)->isp_type >= ISP_HA_FC_2500)
+#define IS_26XX(isp) ((isp)->isp_type >= ISP_HA_FC_2600)
/*
* DMA related macros
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index c19f7fe..a47066e 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -99,6 +99,8 @@
#include <vm/swap_pager.h>
#include <vm/uma.h>
+#include <machine/bus.h>
+
#define MD_MODVER 1
#define MD_SHUTDOWN 0x10000 /* Tell worker thread to terminate. */
@@ -446,7 +448,7 @@ g_md_start(struct bio *bp)
#define MD_MALLOC_MOVE_CMP 5
static int
-md_malloc_move(vm_page_t **mp, int *ma_offs, unsigned sectorsize,
+md_malloc_move_ma(vm_page_t **mp, int *ma_offs, unsigned sectorsize,
void *ptr, u_char fill, int op)
{
struct sf_buf *sf;
@@ -508,7 +510,7 @@ md_malloc_move(vm_page_t **mp, int *ma_offs, unsigned sectorsize,
}
break;
default:
- KASSERT(0, ("md_malloc_move unknown op %d\n", op));
+ KASSERT(0, ("md_malloc_move_ma unknown op %d\n", op));
break;
}
if (error != 0)
@@ -531,10 +533,68 @@ md_malloc_move(vm_page_t **mp, int *ma_offs, unsigned sectorsize,
}
static int
+md_malloc_move_vlist(bus_dma_segment_t **pvlist, int *pma_offs,
+ unsigned len, void *ptr, u_char fill, int op)
+{
+ bus_dma_segment_t *vlist;
+ uint8_t *p, *end, first;
+ off_t *uc;
+ int ma_offs, seg_len;
+
+ vlist = *pvlist;
+ ma_offs = *pma_offs;
+ uc = ptr;
+
+ for (; len != 0; len -= seg_len) {
+ seg_len = imin(vlist->ds_len - ma_offs, len);
+ p = (uint8_t *)(uintptr_t)vlist->ds_addr + ma_offs;
+ switch (op) {
+ case MD_MALLOC_MOVE_ZERO:
+ bzero(p, seg_len);
+ break;
+ case MD_MALLOC_MOVE_FILL:
+ memset(p, fill, seg_len);
+ break;
+ case MD_MALLOC_MOVE_READ:
+ bcopy(ptr, p, seg_len);
+ cpu_flush_dcache(p, seg_len);
+ break;
+ case MD_MALLOC_MOVE_WRITE:
+ bcopy(p, ptr, seg_len);
+ break;
+ case MD_MALLOC_MOVE_CMP:
+ end = p + seg_len;
+ first = *uc = *p;
+ /* Confirm all following bytes match the first */
+ while (++p < end) {
+ if (*p != first)
+ return (EDOOFUS);
+ }
+ break;
+ default:
+ KASSERT(0, ("md_malloc_move_vlist unknown op %d\n", op));
+ break;
+ }
+
+ ma_offs += seg_len;
+ if (ma_offs == vlist->ds_len) {
+ ma_offs = 0;
+ vlist++;
+ }
+ ptr = (uint8_t *)ptr + seg_len;
+ }
+ *pvlist = vlist;
+ *pma_offs = ma_offs;
+
+ return (0);
+}
+
+static int
mdstart_malloc(struct md_s *sc, struct bio *bp)
{
u_char *dst;
vm_page_t *m;
+ bus_dma_segment_t *vlist;
int i, error, error1, ma_offs, notmapped;
off_t secno, nsec, uc;
uintptr_t sp, osp;
@@ -549,10 +609,16 @@ mdstart_malloc(struct md_s *sc, struct bio *bp)
}
notmapped = (bp->bio_flags & BIO_UNMAPPED) != 0;
+ vlist = (bp->bio_flags & BIO_VLIST) != 0 ?
+ (bus_dma_segment_t *)bp->bio_data : NULL;
if (notmapped) {
m = bp->bio_ma;
ma_offs = bp->bio_ma_offset;
dst = NULL;
+ KASSERT(vlist == NULL, ("vlists cannot be unmapped"));
+ } else if (vlist != NULL) {
+ ma_offs = bp->bio_ma_offset;
+ dst = NULL;
} else {
dst = bp->bio_data;
}
@@ -568,23 +634,36 @@ mdstart_malloc(struct md_s *sc, struct bio *bp)
} else if (bp->bio_cmd == BIO_READ) {
if (osp == 0) {
if (notmapped) {
- error = md_malloc_move(&m, &ma_offs,
+ error = md_malloc_move_ma(&m, &ma_offs,
sc->sectorsize, NULL, 0,
MD_MALLOC_MOVE_ZERO);
+ } else if (vlist != NULL) {
+ error = md_malloc_move_vlist(&vlist,
+ &ma_offs, sc->sectorsize, NULL, 0,
+ MD_MALLOC_MOVE_ZERO);
} else
bzero(dst, sc->sectorsize);
} else if (osp <= 255) {
if (notmapped) {
- error = md_malloc_move(&m, &ma_offs,
+ error = md_malloc_move_ma(&m, &ma_offs,
sc->sectorsize, NULL, osp,
MD_MALLOC_MOVE_FILL);
+ } else if (vlist != NULL) {
+ error = md_malloc_move_vlist(&vlist,
+ &ma_offs, sc->sectorsize, NULL, osp,
+ MD_MALLOC_MOVE_FILL);
} else
memset(dst, osp, sc->sectorsize);
} else {
if (notmapped) {
- error = md_malloc_move(&m, &ma_offs,
+ error = md_malloc_move_ma(&m, &ma_offs,
sc->sectorsize, (void *)osp, 0,
MD_MALLOC_MOVE_READ);
+ } else if (vlist != NULL) {
+ error = md_malloc_move_vlist(&vlist,
+ &ma_offs, sc->sectorsize,
+ (void *)osp, 0,
+ MD_MALLOC_MOVE_READ);
} else {
bcopy((void *)osp, dst, sc->sectorsize);
cpu_flush_dcache(dst, sc->sectorsize);
@@ -594,10 +673,15 @@ mdstart_malloc(struct md_s *sc, struct bio *bp)
} else if (bp->bio_cmd == BIO_WRITE) {
if (sc->flags & MD_COMPRESS) {
if (notmapped) {
- error1 = md_malloc_move(&m, &ma_offs,
+ error1 = md_malloc_move_ma(&m, &ma_offs,
sc->sectorsize, &uc, 0,
MD_MALLOC_MOVE_CMP);
i = error1 == 0 ? sc->sectorsize : 0;
+ } else if (vlist != NULL) {
+ error1 = md_malloc_move_vlist(&vlist,
+ &ma_offs, sc->sectorsize, &uc, 0,
+ MD_MALLOC_MOVE_CMP);
+ i = error1 == 0 ? sc->sectorsize : 0;
} else {
uc = dst[0];
for (i = 1; i < sc->sectorsize; i++) {
@@ -622,10 +706,15 @@ mdstart_malloc(struct md_s *sc, struct bio *bp)
break;
}
if (notmapped) {
- error = md_malloc_move(&m,
+ error = md_malloc_move_ma(&m,
&ma_offs, sc->sectorsize,
(void *)sp, 0,
MD_MALLOC_MOVE_WRITE);
+ } else if (vlist != NULL) {
+ error = md_malloc_move_vlist(
+ &vlist, &ma_offs,
+ sc->sectorsize, (void *)sp,
+ 0, MD_MALLOC_MOVE_WRITE);
} else {
bcopy(dst, (void *)sp,
sc->sectorsize);
@@ -633,10 +722,15 @@ mdstart_malloc(struct md_s *sc, struct bio *bp)
error = s_write(sc->indir, secno, sp);
} else {
if (notmapped) {
- error = md_malloc_move(&m,
+ error = md_malloc_move_ma(&m,
&ma_offs, sc->sectorsize,
(void *)osp, 0,
MD_MALLOC_MOVE_WRITE);
+ } else if (vlist != NULL) {
+ error = md_malloc_move_vlist(
+ &vlist, &ma_offs,
+ sc->sectorsize, (void *)osp,
+ 0, MD_MALLOC_MOVE_WRITE);
} else {
bcopy(dst, (void *)osp,
sc->sectorsize);
@@ -652,26 +746,78 @@ mdstart_malloc(struct md_s *sc, struct bio *bp)
if (error != 0)
break;
secno++;
- if (!notmapped)
+ if (!notmapped && vlist == NULL)
dst += sc->sectorsize;
}
bp->bio_resid = 0;
return (error);
}
+static void
+mdcopyto_vlist(void *src, bus_dma_segment_t *vlist, off_t offset, off_t len)
+{
+ off_t seg_len;
+
+ while (offset >= vlist->ds_len) {
+ offset -= vlist->ds_len;
+ vlist++;
+ }
+
+ while (len != 0) {
+ seg_len = omin(len, vlist->ds_len - offset);
+ bcopy(src, (void *)(uintptr_t)(vlist->ds_addr + offset),
+ seg_len);
+ offset = 0;
+ src = (uint8_t *)src + seg_len;
+ len -= seg_len;
+ vlist++;
+ }
+}
+
+static void
+mdcopyfrom_vlist(bus_dma_segment_t *vlist, off_t offset, void *dst, off_t len)
+{
+ off_t seg_len;
+
+ while (offset >= vlist->ds_len) {
+ offset -= vlist->ds_len;
+ vlist++;
+ }
+
+ while (len != 0) {
+ seg_len = omin(len, vlist->ds_len - offset);
+ bcopy((void *)(uintptr_t)(vlist->ds_addr + offset), dst,
+ seg_len);
+ offset = 0;
+ dst = (uint8_t *)dst + seg_len;
+ len -= seg_len;
+ vlist++;
+ }
+}
+
static int
mdstart_preload(struct md_s *sc, struct bio *bp)
{
+ uint8_t *p;
+ p = sc->pl_ptr + bp->bio_offset;
switch (bp->bio_cmd) {
case BIO_READ:
- bcopy(sc->pl_ptr + bp->bio_offset, bp->bio_data,
- bp->bio_length);
+ if ((bp->bio_flags & BIO_VLIST) != 0) {
+ mdcopyto_vlist(p, (bus_dma_segment_t *)bp->bio_data,
+ bp->bio_ma_offset, bp->bio_length);
+ } else {
+ bcopy(p, bp->bio_data, bp->bio_length);
+ }
cpu_flush_dcache(bp->bio_data, bp->bio_length);
break;
case BIO_WRITE:
- bcopy(bp->bio_data, sc->pl_ptr + bp->bio_offset,
- bp->bio_length);
+ if ((bp->bio_flags & BIO_VLIST) != 0) {
+ mdcopyfrom_vlist((bus_dma_segment_t *)bp->bio_data,
+ bp->bio_ma_offset, p, bp->bio_length);
+ } else {
+ bcopy(bp->bio_data, p, bp->bio_length);
+ }
break;
}
bp->bio_resid = 0;
@@ -684,16 +830,23 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
int error;
struct uio auio;
struct iovec aiov;
+ struct iovec *piov;
struct mount *mp;
struct vnode *vp;
struct buf *pb;
+ bus_dma_segment_t *vlist;
struct thread *td;
- off_t end, zerosize;
+ off_t len, zerosize;
+ int ma_offs;
switch (bp->bio_cmd) {
case BIO_READ:
+ auio.uio_rw = UIO_READ;
+ break;
case BIO_WRITE:
case BIO_DELETE:
+ auio.uio_rw = UIO_WRITE;
+ break;
case BIO_FLUSH:
break;
default:
@@ -702,6 +855,9 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
td = curthread;
vp = sc->vnode;
+ pb = NULL;
+ piov = NULL;
+ ma_offs = bp->bio_ma_offset;
/*
* VNODE I/O
@@ -720,73 +876,66 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
return (error);
}
- bzero(&auio, sizeof(auio));
+ auio.uio_offset = (vm_ooffset_t)bp->bio_offset;
+ auio.uio_resid = bp->bio_length;
+ auio.uio_segflg = UIO_SYSSPACE;
+ auio.uio_td = td;
- /*
- * Special case for BIO_DELETE. On the surface, this is very
- * similar to BIO_WRITE, except that we write from our own
- * fixed-length buffer, so we have to loop. The net result is
- * that the two cases end up having very little in common.
- */
if (bp->bio_cmd == BIO_DELETE) {
+ /*
+ * Emulate BIO_DELETE by writing zeros.
+ */
zerosize = ZERO_REGION_SIZE -
(ZERO_REGION_SIZE % sc->sectorsize);
- auio.uio_iov = &aiov;
- auio.uio_iovcnt = 1;
- auio.uio_offset = (vm_ooffset_t)bp->bio_offset;
- auio.uio_segflg = UIO_SYSSPACE;
- auio.uio_rw = UIO_WRITE;
- auio.uio_td = td;
- end = bp->bio_offset + bp->bio_length;
- (void) vn_start_write(vp, &mp, V_WAIT);
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- error = 0;
- while (auio.uio_offset < end) {
- aiov.iov_base = __DECONST(void *, zero_region);
- aiov.iov_len = end - auio.uio_offset;
- if (aiov.iov_len > zerosize)
- aiov.iov_len = zerosize;
- auio.uio_resid = aiov.iov_len;
- error = VOP_WRITE(vp, &auio,
- sc->flags & MD_ASYNC ? 0 : IO_SYNC, sc->cred);
- if (error != 0)
- break;
+ auio.uio_iovcnt = howmany(bp->bio_length, zerosize);
+ piov = malloc(sizeof(*piov) * auio.uio_iovcnt, M_MD, M_WAITOK);
+ auio.uio_iov = piov;
+ len = bp->bio_length;
+ while (len > 0) {
+ piov->iov_base = __DECONST(void *, zero_region);
+ piov->iov_len = len;
+ if (len > zerosize)
+ piov->iov_len = zerosize;
+ len -= piov->iov_len;
+ piov++;
}
- VOP_UNLOCK(vp, 0);
- vn_finished_write(mp);
- bp->bio_resid = end - auio.uio_offset;
- return (error);
- }
-
- if ((bp->bio_flags & BIO_UNMAPPED) == 0) {
- pb = NULL;
- aiov.iov_base = bp->bio_data;
- } else {
- KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd",
- (uintmax_t)bp->bio_length));
+ piov = auio.uio_iov;
+ } else if ((bp->bio_flags & BIO_VLIST) != 0) {
+ piov = malloc(sizeof(*piov) * bp->bio_ma_n, M_MD, M_WAITOK);
+ auio.uio_iov = piov;
+ vlist = (bus_dma_segment_t *)bp->bio_data;
+ len = bp->bio_length;
+ while (len > 0) {
+ piov->iov_base = (void *)(uintptr_t)(vlist->ds_addr +
+ ma_offs);
+ piov->iov_len = vlist->ds_len - ma_offs;
+ if (piov->iov_len > len)
+ piov->iov_len = len;
+ len -= piov->iov_len;
+ ma_offs = 0;
+ vlist++;
+ piov++;
+ }
+ auio.uio_iovcnt = piov - auio.uio_iov;
+ piov = auio.uio_iov;
+ } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
pb = getpbuf(&md_vnode_pbuf_freecnt);
pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n);
- aiov.iov_base = (void *)((vm_offset_t)pb->b_data +
- bp->bio_ma_offset);
+ aiov.iov_base = (void *)((vm_offset_t)pb->b_data + ma_offs);
+ aiov.iov_len = bp->bio_length;
+ auio.uio_iov = &aiov;
+ auio.uio_iovcnt = 1;
+ } else {
+ aiov.iov_base = bp->bio_data;
+ aiov.iov_len = bp->bio_length;
+ auio.uio_iov = &aiov;
+ auio.uio_iovcnt = 1;
}
- aiov.iov_len = bp->bio_length;
- auio.uio_iov = &aiov;
- auio.uio_iovcnt = 1;
- auio.uio_offset = (vm_ooffset_t)bp->bio_offset;
- auio.uio_segflg = UIO_SYSSPACE;
- if (bp->bio_cmd == BIO_READ)
- auio.uio_rw = UIO_READ;
- else if (bp->bio_cmd == BIO_WRITE)
- auio.uio_rw = UIO_WRITE;
- else
- panic("wrong BIO_OP in mdstart_vnode");
- auio.uio_resid = bp->bio_length;
- auio.uio_td = td;
/*
* When reading set IO_DIRECT to try to avoid double-caching
* the data. When writing IO_DIRECT is not optimal.
*/
- if (bp->bio_cmd == BIO_READ) {
+ if (auio.uio_rw == UIO_READ) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_READ(vp, &auio, IO_DIRECT, sc->cred);
VOP_UNLOCK(vp, 0);
@@ -798,10 +947,15 @@ mdstart_vnode(struct md_s *sc, struct bio *bp)
VOP_UNLOCK(vp, 0);
vn_finished_write(mp);
}
- if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
+
+ if (pb) {
pmap_qremove((vm_offset_t)pb->b_data, bp->bio_ma_n);
relpbuf(pb, &md_vnode_pbuf_freecnt);
}
+
+ if (piov != NULL)
+ free(piov, M_MD);
+
bp->bio_resid = auio.uio_resid;
return (error);
}
@@ -812,6 +966,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
vm_page_t m;
u_char *p;
vm_pindex_t i, lastp;
+ bus_dma_segment_t *vlist;
int rv, ma_offs, offs, len, lastend;
switch (bp->bio_cmd) {
@@ -824,7 +979,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
}
p = bp->bio_data;
- ma_offs = (bp->bio_flags & BIO_UNMAPPED) == 0 ? 0 : bp->bio_ma_offset;
+ ma_offs = (bp->bio_flags & (BIO_UNMAPPED|BIO_VLIST)) != 0 ?
+ bp->bio_ma_offset : 0;
+ vlist = (bp->bio_flags & BIO_VLIST) != 0 ?
+ (bus_dma_segment_t *)bp->bio_data : NULL;
/*
* offs is the offset at which to start operating on the
@@ -864,6 +1022,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
pmap_copy_pages(&m, offs, bp->bio_ma,
ma_offs, len);
+ } else if ((bp->bio_flags & BIO_VLIST) != 0) {
+ physcopyout_vlist(VM_PAGE_TO_PHYS(m) + offs,
+ vlist, ma_offs, len);
+ cpu_flush_dcache(p, len);
} else {
physcopyout(VM_PAGE_TO_PHYS(m) + offs, p, len);
cpu_flush_dcache(p, len);
@@ -880,6 +1042,9 @@ mdstart_swap(struct md_s *sc, struct bio *bp)
if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
pmap_copy_pages(bp->bio_ma, ma_offs, &m,
offs, len);
+ } else if ((bp->bio_flags & BIO_VLIST) != 0) {
+ physcopyin_vlist(vlist, ma_offs,
+ VM_PAGE_TO_PHYS(m) + offs, len);
} else {
physcopyin(p, VM_PAGE_TO_PHYS(m) + offs, len);
}
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c
index 289eeab..bb60fa9 100644
--- a/sys/dev/mii/rgephy.c
+++ b/sys/dev/mii/rgephy.c
@@ -90,6 +90,7 @@ static void rgephy_reset(struct mii_softc *);
static int rgephy_linkup(struct mii_softc *);
static void rgephy_loop(struct mii_softc *);
static void rgephy_load_dspcode(struct mii_softc *);
+static void rgephy_disable_eee(struct mii_softc *);
static const struct mii_phydesc rgephys[] = {
MII_PHY_DESC(REALTEK, RTL8169S),
@@ -517,10 +518,9 @@ rgephy_reset(struct mii_softc *sc)
switch (sc->mii_mpd_rev) {
case RGEPHY_8211F:
pcr = PHY_READ(sc, RGEPHY_F_MII_PCR1);
- if ((pcr & RGEPHY_F_PCR1_MDI_MM) != 0) {
- pcr &= ~RGEPHY_F_PCR1_MDI_MM;
- PHY_WRITE(sc, RGEPHY_F_MII_PCR1, pcr);
- }
+ pcr &= ~(RGEPHY_F_PCR1_MDI_MM | RGEPHY_F_PCR1_ALDPS_EN);
+ PHY_WRITE(sc, RGEPHY_F_MII_PCR1, pcr);
+ rgephy_disable_eee(sc);
break;
case RGEPHY_8211C:
if ((sc->mii_flags & MIIF_PHYPRIV0) == 0) {
@@ -548,3 +548,29 @@ rgephy_reset(struct mii_softc *sc)
DELAY(1000);
rgephy_load_dspcode(sc);
}
+
+static void
+rgephy_disable_eee(struct mii_softc *sc)
+{
+ uint16_t anar;
+
+ PHY_WRITE(sc, RGEPHY_F_EPAGSR, 0x0000);
+ PHY_WRITE(sc, MII_MMDACR, MMDACR_FN_ADDRESS |
+ (MMDACR_DADDRMASK & RGEPHY_F_MMD_DEV_7));
+ PHY_WRITE(sc, MII_MMDAADR, RGEPHY_F_MMD_EEEAR);
+ PHY_WRITE(sc, MII_MMDACR, MMDACR_FN_DATANPI |
+ (MMDACR_DADDRMASK & RGEPHY_F_MMD_DEV_7));
+ PHY_WRITE(sc, MII_MMDAADR, 0x0000);
+ PHY_WRITE(sc, MII_MMDACR, 0x0000);
+ /*
+ * XXX
+ * Restart auto-negotiation to take changes effect.
+ * This may result in link establishment.
+ */
+ anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA;
+ PHY_WRITE(sc, RGEPHY_MII_ANAR, anar);
+ PHY_WRITE(sc, RGEPHY_MII_1000CTL, RGEPHY_1000CTL_AHD |
+ RGEPHY_1000CTL_AFD);
+ PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_RESET |
+ RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG);
+}
diff --git a/sys/dev/mii/rgephyreg.h b/sys/dev/mii/rgephyreg.h
index 2a00517..7c24a1f 100644
--- a/sys/dev/mii/rgephyreg.h
+++ b/sys/dev/mii/rgephyreg.h
@@ -183,4 +183,20 @@
#define RGEPHY_F_SSR_MDI 0x0002 /* MDI/MDIX */
#define RGEPHY_F_SSR_JABBER 0x0001 /* Jabber */
+/* RTL8211F */
+#define RGEPHY_F_EPAGSR 0x1F /* Extension page select register */
+
+/* RTL8211F */
+#define RGEPHY_F_MMD_DEV_7 0x07
+
+/* RTL8211F MMD device 7 */
+#define RGEPHY_F_MMD_EEEAR 0x3C /* EEE advertisement */
+#define EEEAR_1000T 0x0004 /* adv. 1000baseT EEE */
+#define EEEAR_100TX 0x0002 /* adv. 100baseTX EEE */
+
+/* RTL8211F MMD device 7 */
+#define RGEPHY_F_MMD_EEELPAR 0x3D /* EEE link partner abilities */
+#define EEELPAR_1000T 0x0004 /* link partner 1000baseT EEE capable */
+#define EEELPAR_100TX 0x0002 /* link partner 100baseTX EEE capable */
+
#endif /* _DEV_RGEPHY_MIIREG_H_ */
diff --git a/sys/dev/ntb/if_ntb/if_ntb.c b/sys/dev/ntb/if_ntb/if_ntb.c
index a532d2b..b28502f 100644
--- a/sys/dev/ntb/if_ntb/if_ntb.c
+++ b/sys/dev/ntb/if_ntb/if_ntb.c
@@ -1342,7 +1342,7 @@ ntb_set_mw(struct ntb_transport_ctx *nt, int num_mw, size_t size)
return (EINVAL);
xlat_size = roundup(size, mw->xlat_align_size);
- buff_size = roundup(size, mw->xlat_align);
+ buff_size = xlat_size;
/* No need to re-setup */
if (mw->xlat_size == xlat_size)
@@ -1358,10 +1358,10 @@ ntb_set_mw(struct ntb_transport_ctx *nt, int num_mw, size_t size)
mw->virt_addr = contigmalloc(mw->buff_size, M_NTB_IF, M_ZERO, 0,
mw->addr_limit, mw->xlat_align, 0);
if (mw->virt_addr == NULL) {
+ ntb_printf(0, "Unable to allocate MW buffer of size %zu/%zu\n",
+ mw->buff_size, mw->xlat_size);
mw->xlat_size = 0;
mw->buff_size = 0;
- printf("ntb: Unable to allocate MW buffer of size %zu\n",
- mw->xlat_size);
return (ENOMEM);
}
/* TODO: replace with bus_space_* functions */
diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index 5edc720..ff1cd81 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -430,6 +430,27 @@ ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells,
return (0);
}
+/*
+ * Get interrupt parent for given node.
+ * Returns 0 if interrupt parent doesn't exist.
+ */
+phandle_t
+ofw_bus_find_iparent(phandle_t node)
+{
+ phandle_t iparent;
+
+ if (OF_searchencprop(node, "interrupt-parent", &iparent,
+ sizeof(iparent)) == -1) {
+ for (iparent = node; iparent != 0;
+ iparent = OF_parent(iparent)) {
+ if (OF_hasprop(iparent, "interrupt-controller"))
+ break;
+ }
+ iparent = OF_xref_from_node(iparent);
+ }
+ return (iparent);
+}
+
int
ofw_bus_intr_to_rl(device_t dev, phandle_t node,
struct resource_list *rl, int *rlen)
@@ -442,18 +463,11 @@ ofw_bus_intr_to_rl(device_t dev, phandle_t node,
nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr),
(void **)&intr);
if (nintr > 0) {
- if (OF_searchencprop(node, "interrupt-parent", &iparent,
- sizeof(iparent)) == -1) {
- for (iparent = node; iparent != 0;
- iparent = OF_parent(iparent)) {
- if (OF_hasprop(iparent, "interrupt-controller"))
- break;
- }
- if (iparent == 0) {
- device_printf(dev, "No interrupt-parent found, "
- "assuming direct parent\n");
- iparent = OF_parent(node);
- }
+ iparent = ofw_bus_find_iparent(node);
+ if (iparent == 0) {
+ device_printf(dev, "No interrupt-parent found, "
+ "assuming direct parent\n");
+ iparent = OF_parent(node);
iparent = OF_xref_from_node(iparent);
}
if (OF_searchencprop(OF_node_from_xref(iparent),
diff --git a/sys/dev/ofw/ofw_bus_subr.h b/sys/dev/ofw/ofw_bus_subr.h
index c59a75d..dffc952 100644
--- a/sys/dev/ofw/ofw_bus_subr.h
+++ b/sys/dev/ofw/ofw_bus_subr.h
@@ -82,7 +82,7 @@ const char *ofw_bus_get_status(device_t dev);
int ofw_bus_status_okay(device_t dev);
/* Helper to get node's interrupt parent */
-void ofw_bus_find_iparent(phandle_t);
+phandle_t ofw_bus_find_iparent(phandle_t);
/* Helper routine for checking compat prop */
int ofw_bus_is_compatible(device_t, const char *);
diff --git a/sys/dev/patm/genrtab/Makefile b/sys/dev/patm/genrtab/Makefile
index 721fe0a..907b29d 100644
--- a/sys/dev/patm/genrtab/Makefile
+++ b/sys/dev/patm/genrtab/Makefile
@@ -7,7 +7,6 @@ PROG= genrtab
INTERNALPROG=
WARNS?= 5
MAN=
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.prog.mk>
diff --git a/sys/dev/sfxge/common/ef10_tlv_layout.h b/sys/dev/sfxge/common/ef10_tlv_layout.h
index e413a5d..e2c7082 100644
--- a/sys/dev/sfxge/common/ef10_tlv_layout.h
+++ b/sys/dev/sfxge/common/ef10_tlv_layout.h
@@ -194,7 +194,9 @@ struct tlv_port_mac {
/* Static VPD.
*
* This is the portion of VPD which is set at manufacturing time and not
- * expected to change. It is formatted as a standard PCI VPD block.
+ * expected to change. It is formatted as a standard PCI VPD block. There are
+ * global and per-pf TLVs for this, the global TLV is new for Medford and is
+ * used in preference to the per-pf TLV.
*/
#define TLV_TAG_PF_STATIC_VPD(pf) (0x00030000 + (pf))
@@ -205,11 +207,21 @@ struct tlv_pf_static_vpd {
uint8_t bytes[];
};
+#define TLV_TAG_GLOBAL_STATIC_VPD (0x001f0000)
+
+struct tlv_global_static_vpd {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t bytes[];
+};
+
/* Dynamic VPD.
*
* This is the portion of VPD which may be changed (e.g. by firmware updates).
- * It is formatted as a standard PCI VPD block.
+ * It is formatted as a standard PCI VPD block. There are global and per-pf TLVs
+ * for this, the global TLV is new for Medford and is used in preference to the
+ * per-pf TLV.
*/
#define TLV_TAG_PF_DYNAMIC_VPD(pf) (0x10030000 + (pf))
@@ -220,11 +232,21 @@ struct tlv_pf_dynamic_vpd {
uint8_t bytes[];
};
+#define TLV_TAG_GLOBAL_DYNAMIC_VPD (0x10200000)
+
+struct tlv_global_dynamic_vpd {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t bytes[];
+};
+
/* "DBI" PCI config space changes.
*
* This is a set of edits made to the default PCI config space values before
- * the device is allowed to enumerate.
+ * the device is allowed to enumerate. There are global and per-pf TLVs for
+ * this, the global TLV is new for Medford and is used in preference to the
+ * per-pf TLV.
*/
#define TLV_TAG_PF_DBI(pf) (0x00040000 + (pf))
@@ -240,6 +262,19 @@ struct tlv_pf_dbi {
};
+#define TLV_TAG_GLOBAL_DBI (0x00210000)
+
+struct tlv_global_dbi {
+ uint32_t tag;
+ uint32_t length;
+ struct {
+ uint16_t addr;
+ uint16_t byte_enables;
+ uint32_t value;
+ } items[];
+};
+
+
/* Partition subtype codes.
*
* A subtype may optionally be stored for each type of partition present in
@@ -289,7 +324,7 @@ struct tlv_pcie_config {
int16_t max_pf_number; /**< Largest PF RID (lower PFs may be hidden) */
uint16_t pf_aper; /**< BIU aperture for PF BAR2 */
uint16_t vf_aper; /**< BIU aperture for VF BAR0 */
- uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */
+ uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */
#define TLV_MAX_PF_DEFAULT (-1) /* Use FW default for largest PF RID */
#define TLV_APER_DEFAULT (0xFFFF) /* Use FW default for a given aperture */
};
@@ -305,13 +340,13 @@ struct tlv_per_pf_pcie_config {
uint32_t tag;
uint32_t length;
uint8_t vfs_total;
- uint8_t port_allocation;
+ uint8_t port_allocation;
uint16_t vectors_per_pf;
uint16_t vectors_per_vf;
uint8_t pf_bar0_aperture;
uint8_t pf_bar2_aperture;
uint8_t vf_bar0_aperture;
- uint8_t vf_base;
+ uint8_t vf_base;
uint16_t supp_pagesz;
uint16_t msix_vec_base;
};
@@ -320,7 +355,8 @@ struct tlv_per_pf_pcie_config {
/* Development ONLY. This is a single TLV tag for all the gubbins
* that can be set through the MC command-line other than the PCIe
* settings. This is a temporary measure. */
-#define TLV_TAG_TMP_GUBBINS (0x10090000)
+#define TLV_TAG_TMP_GUBBINS (0x10090000) /* legacy symbol - do not use */
+#define TLV_TAG_TMP_GUBBINS_HUNT TLV_TAG_TMP_GUBBINS
struct tlv_tmp_gubbins {
uint32_t tag;
@@ -330,7 +366,7 @@ struct tlv_tmp_gubbins {
uint64_t tx1_tags; /* Bitmap */
uint64_t dl_tags; /* Bitmap */
uint32_t flags;
-#define TLV_DPCPU_TX_STRIPE (1) /* TX striping is on */
+#define TLV_DPCPU_TX_STRIPE (1) /* No longer used, has no effect */
#define TLV_DPCPU_BIU_TAGS (2) /* Use BIU tag manager */
#define TLV_DPCPU_TX0_TAGS (4) /* tx0_tags is valid */
#define TLV_DPCPU_TX1_TAGS (8) /* tx1_tags is valid */
@@ -393,16 +429,16 @@ struct tlv_firmware_options {
};
/* Voltage settings
- *
+ *
* Intended for boards with A0 silicon where the core voltage may
- * need tweaking. Most likely set once when the pass voltage is
+ * need tweaking. Most likely set once when the pass voltage is
* determined. */
#define TLV_TAG_0V9_SETTINGS (0x000c0000)
struct tlv_0v9_settings {
uint32_t tag;
- uint32_t length;
+ uint32_t length;
uint16_t flags; /* Boards with high 0v9 settings may need active cooling */
#define TLV_TAG_0V9_REQUIRES_FAN (1)
uint16_t target_voltage; /* In millivolts */
@@ -411,17 +447,18 @@ struct tlv_0v9_settings {
uint16_t warn_low; /* In millivolts */
uint16_t warn_high; /* In millivolts */
uint16_t panic_low; /* In millivolts */
- uint16_t panic_high; /* In millivolts */
+ uint16_t panic_high; /* In millivolts */
};
/* Clock configuration */
-#define TLV_TAG_CLOCK_CONFIG (0x000d0000)
+#define TLV_TAG_CLOCK_CONFIG (0x000d0000) /* legacy symbol - do not use */
+#define TLV_TAG_CLOCK_CONFIG_HUNT TLV_TAG_CLOCK_CONFIG
struct tlv_clock_config {
uint32_t tag;
- uint32_t length;
+ uint32_t length;
uint16_t clk_sys; /* MHz */
uint16_t clk_dpcpu; /* MHz */
uint16_t clk_icore; /* MHz */
@@ -460,7 +497,8 @@ struct tlv_global_mac {
uint16_t reserved2;
};
-#define TLV_TAG_ATB_0V9_TARGET (0x000f0000)
+#define TLV_TAG_ATB_0V9_TARGET (0x000f0000) /* legacy symbol - do not use */
+#define TLV_TAG_ATB_0V9_TARGET_HUNT TLV_TAG_ATB_0V9_TARGET
/* The target value for the 0v9 power rail measured on-chip at the
* analogue test bus */
@@ -485,7 +523,7 @@ struct tlv_pcie_config_r2 {
uint16_t visible_pfs; /**< Bitmap of visible PFs */
uint16_t pf_aper; /**< BIU aperture for PF BAR2 */
uint16_t vf_aper; /**< BIU aperture for VF BAR0 */
- uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */
+ uint16_t int_aper; /**< BIU aperture for PF BAR4 and VF BAR2 */
};
/* Dynamic port mode.
@@ -688,4 +726,42 @@ struct tlv_ocsd {
#define TLV_OCSD_ENABLED 1 /* Default */
};
+/* Descriptor cache config.
+ *
+ * Sets the sizes of the TX and RX descriptor caches as a power of 2. It also
+ * sets the total number of VIs. When the number of VIs is reduced VIs are taken
+ * away from the highest numbered port first, so a vi_count of 1024 means 1024
+ * VIs on the first port and 0 on the second (on a Torino).
+ */
+
+#define TLV_TAG_DESCRIPTOR_CACHE_CONFIG (0x101d0000)
+
+struct tlv_descriptor_cache_config {
+ uint32_t tag;
+ uint32_t length;
+ uint8_t rx_desc_cache_size;
+ uint8_t tx_desc_cache_size;
+ uint16_t vi_count;
+};
+#define TLV_DESC_CACHE_DEFAULT (0xff)
+#define TLV_VI_COUNT_DEFAULT (0xffff)
+
+/* RX event merging config (read batching).
+ *
+ * Sets the global maximum number of events for the merging bins, and the
+ * global timeout configuration for the bins.
+ */
+
+#define TLV_TAG_RX_EVENT_MERGING_CONFIG (0x101e0000)
+
+struct tlv_rx_event_merging_config {
+ uint32_t tag;
+ uint32_t length;
+ uint32_t max_events;
+#define TLV_RX_EVENT_MERGING_CONFIG_MAX_EVENTS_MAX ((1 << 4) - 1)
+ uint32_t timeout_ns;
+};
+#define TLV_RX_EVENT_MERGING_MAX_EVENTS_DEFAULT 7
+#define TLV_RX_EVENT_MERGING_TIMEOUT_NS_DEFAULT 8740
+
#endif /* CI_MGMT_TLV_LAYOUT_H */
diff --git a/sys/dev/sfxge/common/efsys.h b/sys/dev/sfxge/common/efsys.h
index 0a7b1ad..be73ea1 100644
--- a/sys/dev/sfxge/common/efsys.h
+++ b/sys/dev/sfxge/common/efsys.h
@@ -225,6 +225,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#define __deref_out_bcount_opt(n)
#define __checkReturn
+#define __success(_x)
#define __drv_when(_p, _c)
@@ -244,6 +245,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map,
#endif
#define EFSYS_OPT_MCDI 1
+#define EFSYS_OPT_MCDI_LOGGING 0
#define EFSYS_OPT_MAC_FALCON_GMAC 0
#define EFSYS_OPT_MAC_FALCON_XMAC 0
diff --git a/sys/dev/sfxge/common/efx.h b/sys/dev/sfxge/common/efx.h
index 3435951..671c84a 100644
--- a/sys/dev/sfxge/common/efx.h
+++ b/sys/dev/sfxge/common/efx.h
@@ -40,11 +40,21 @@
extern "C" {
#endif
-#define EFX_STATIC_ASSERT(_cond) ((void)sizeof(char[(_cond) ? 1 : -1]))
+#define EFX_STATIC_ASSERT(_cond) \
+ ((void)sizeof(char[(_cond) ? 1 : -1]))
-#define EFX_ARRAY_SIZE(_array) (sizeof(_array) / sizeof((_array)[0]))
+#define EFX_ARRAY_SIZE(_array) \
+ (sizeof(_array) / sizeof((_array)[0]))
-#define EFX_FIELD_OFFSET(_type, _field) ((size_t) &(((_type *)0)->_field))
+#define EFX_FIELD_OFFSET(_type, _field) \
+ ((size_t) &(((_type *)0)->_field))
+
+/* Return codes */
+
+typedef __success(return == 0) int efx_rc_t;
+
+
+/* Chip families */
typedef enum efx_family_e {
EFX_FAMILY_INVALID,
@@ -54,13 +64,13 @@ typedef enum efx_family_e {
EFX_FAMILY_NTYPES
} efx_family_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_family(
__in uint16_t venid,
__in uint16_t devid,
__out efx_family_t *efp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_infer_family(
__in efsys_bar_t *esbp,
__out efx_family_t *efp);
@@ -75,11 +85,9 @@ efx_infer_family(
#define EFX_PCI_DEVID_HUNTINGTON_PF_UNINIT 0x0901
#define EFX_PCI_DEVID_FARMINGDALE 0x0903 /* SFC9120 PF */
-#define EFX_PCI_DEVID_HUNTINGTON 0x0913 /* SFL9122 PF */
#define EFX_PCI_DEVID_GREENPORT 0x0923 /* SFC9140 PF */
#define EFX_PCI_DEVID_FARMINGDALE_VF 0x1903 /* SFC9120 VF */
-#define EFX_PCI_DEVID_HUNTINGTON_VF 0x1913 /* SFL9122 VF */
#define EFX_PCI_DEVID_GREENPORT_VF 0x1923 /* SFC9140 VF */
@@ -124,7 +132,7 @@ typedef struct efx_nic_s efx_nic_t;
#define EFX_NIC_FUNC_TRUSTED 0x00000004
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_create(
__in efx_family_t family,
__in efsys_identifier_t *esip,
@@ -132,34 +140,34 @@ efx_nic_create(
__in efsys_lock_t *eslp,
__deref_out efx_nic_t **enpp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_probe(
__in efx_nic_t *enp);
#if EFSYS_OPT_PCIE_TUNE
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_pcie_tune(
__in efx_nic_t *enp,
unsigned int nlanes);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_pcie_extended_sync(
__in efx_nic_t *enp);
#endif /* EFSYS_OPT_PCIE_TUNE */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_init(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_reset(
__in efx_nic_t *enp);
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_register_test(
__in efx_nic_t *enp);
@@ -191,20 +199,33 @@ typedef enum efx_mcdi_exception_e {
EFX_MCDI_EXCEPTION_MC_BADASSERT,
} efx_mcdi_exception_t;
+#if EFSYS_OPT_MCDI_LOGGING
+typedef enum efx_log_msg_e
+{
+ EFX_LOG_INVALID,
+ EFX_LOG_MCDI_REQUEST,
+ EFX_LOG_MCDI_RESPONSE,
+} efx_log_msg_t;
+#endif /* EFSYS_OPT_MCDI_LOGGING */
+
typedef struct efx_mcdi_transport_s {
void *emt_context;
efsys_mem_t *emt_dma_mem;
void (*emt_execute)(void *, efx_mcdi_req_t *);
void (*emt_ev_cpl)(void *);
void (*emt_exception)(void *, efx_mcdi_exception_t);
+#if EFSYS_OPT_MCDI_LOGGING
+ void (*emt_logger)(void *, efx_log_msg_t,
+ void *, size_t, void *, size_t);
+#endif /* EFSYS_OPT_MCDI_LOGGING */
} efx_mcdi_transport_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_init(
__in efx_nic_t *enp,
__in const efx_mcdi_transport_t *mtp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_reboot(
__in efx_nic_t *enp);
@@ -246,7 +267,7 @@ typedef enum efx_intr_type_e {
#define EFX_INTR_SIZE (sizeof (efx_oword_t))
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -266,7 +287,7 @@ efx_intr_disable_unlocked(
#define EFX_INTR_NEVQS 32
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level);
@@ -418,17 +439,17 @@ typedef enum efx_link_mode_e {
#define EFX_MAC_PDU_MIN 60
#define EFX_MAC_PDU_MAX EFX_MAC_PDU(EFX_MAC_SDU_MAX)
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_pdu_set(
__in efx_nic_t *enp,
__in size_t pdu);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_addr_set(
__in efx_nic_t *enp,
__in uint8_t *addr);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_filter_set(
__in efx_nic_t *enp,
__in boolean_t all_unicst,
@@ -436,13 +457,13 @@ efx_mac_filter_set(
__in boolean_t all_mulcst,
__in boolean_t brdcst);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_multicast_list_set(
__in efx_nic_t *enp,
__in_ecount(6*count) uint8_t const *addrs,
__in int count);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_filter_default_rxq_set(
__in efx_nic_t *enp,
__in efx_rxq_t *erp,
@@ -452,12 +473,12 @@ extern void
efx_mac_filter_default_rxq_clear(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_drain(
__in efx_nic_t *enp,
__in boolean_t enabled);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp);
@@ -465,7 +486,7 @@ efx_mac_up(
#define EFX_FCNTL_RESPOND 0x00000001
#define EFX_FCNTL_GENERATE 0x00000002
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_fcntl_set(
__in efx_nic_t *enp,
__in unsigned int fcntl,
@@ -479,7 +500,7 @@ efx_mac_fcntl_get(
#define EFX_MAC_HASH_BITS (1 << 8)
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_pktfilter_init(
__in efx_nic_t *enp);
@@ -487,26 +508,26 @@ extern void
efx_pktfilter_fini(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_pktfilter_set(
__in efx_nic_t *enp,
__in boolean_t unicst,
__in boolean_t brdcst);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_hash_set(
__in efx_nic_t *enp,
__in_ecount(EFX_MAC_HASH_BITS) unsigned int const *bucket);
#if EFSYS_OPT_MCAST_FILTER_LIST
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_pktfilter_mcast_list_set(
__in efx_nic_t *enp,
__in uint8_t const *addrs,
__in int count);
#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_pktfilter_mcast_all(
__in efx_nic_t *enp);
@@ -536,24 +557,24 @@ efx_mac_stat_name(
* Thus, drivers should zero this buffer before use, so that not-understood
* statistics read back as zero.
*/
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_stats_upload(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_stats_periodic(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__in uint16_t period_ms,
__in boolean_t events);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
- __out_opt uint32_t *generationp);
+ __inout_opt uint32_t *generationp);
#endif /* EFSYS_OPT_MAC_STATS */
@@ -577,7 +598,7 @@ efx_mon_name(
#endif /* EFSYS_OPT_NAMES */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mon_init(
__in efx_nic_t *enp);
@@ -684,11 +705,11 @@ efx_mon_stat_name(
#endif /* EFSYS_OPT_NAMES */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mon_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values);
+ __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values);
#endif /* EFSYS_OPT_MON_STATS */
@@ -707,7 +728,7 @@ efx_mon_fini(
#define MAXMMD ((1 << 5) - 1)
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_verify(
__in efx_nic_t *enp);
@@ -721,14 +742,14 @@ typedef enum efx_phy_led_mode_e {
EFX_PHY_LED_NMODES
} efx_phy_led_mode_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_led_set(
__in efx_nic_t *enp,
__in efx_phy_led_mode_t mode);
#endif /* EFSYS_OPT_PHY_LED_CONTROL */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_port_init(
__in efx_nic_t *enp);
@@ -786,7 +807,7 @@ efx_loopback_mask(
__in efx_loopback_kind_t loopback_kind,
__out efx_qword_t *maskp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_port_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
@@ -803,7 +824,7 @@ efx_loopback_type_name(
#endif /* EFSYS_OPT_LOOPBACK */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_port_poll(
__in efx_nic_t *enp,
__out_opt efx_link_mode_t *link_modep);
@@ -839,7 +860,7 @@ efx_phy_adv_cap_get(
__in uint32_t flag,
__out uint32_t *maskp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_adv_cap_set(
__in efx_nic_t *enp,
__in uint32_t mask);
@@ -849,7 +870,7 @@ efx_phy_lp_cap_get(
__in efx_nic_t *enp,
__out uint32_t *maskp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip);
@@ -942,11 +963,11 @@ efx_phy_stat_name(
#define EFX_PHY_STATS_SIZE 0x100
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_PHY_NSTATS) uint32_t *stat);
+ __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat);
#endif /* EFSYS_OPT_PHY_STATS */
@@ -963,14 +984,14 @@ efx_phy_prop_name(
#define EFX_PHY_PROP_DEFAULT 0x00000001
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
__in uint32_t flags,
__out uint32_t *valp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -1030,16 +1051,16 @@ typedef enum efx_bist_value_e {
EFX_BIST_NVALUES,
} efx_bist_value_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_bist_enable_offline(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_bist_poll(
__in efx_nic_t *enp,
__in efx_bist_type_t type,
@@ -1151,6 +1172,7 @@ typedef struct efx_nic_cfg_s {
boolean_t enc_hw_tx_insert_vlan_enabled;
/* Datapath firmware vadapter/vport/vswitch support */
boolean_t enc_datapath_cap_evb;
+ boolean_t enc_rx_disable_scatter_supported;
/* External port identifier */
uint8_t enc_external_port;
} efx_nic_cfg_t;
@@ -1184,7 +1206,7 @@ typedef struct efx_drv_limits_s
uint32_t edl_max_pio_alloc_count;
} efx_drv_limits_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_set_drv_limits(
__inout efx_nic_t *enp,
__in efx_drv_limits_t *edlp);
@@ -1194,14 +1216,14 @@ typedef enum efx_nic_region_e {
EFX_REGION_PIO_WRITE_VI, /* Memory BAR WC mapping */
} efx_nic_region_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_get_bar_region(
__in efx_nic_t *enp,
__in efx_nic_region_t region,
__out uint32_t *offsetp,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_get_vi_pool(
__in efx_nic_t *enp,
__out uint32_t *evq_countp,
@@ -1230,48 +1252,48 @@ typedef struct efx_vpd_value_s {
#define EFX_VPD_KEYWORD(x, y) ((x) | ((y) << 8))
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_init(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__inout efx_vpd_value_t *evvp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_set(
__in efx_nic_t *enp,
__inout_bcount(size) caddr_t data,
__in size_t size,
__in efx_vpd_value_t *evvp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_next(
__in efx_nic_t *enp,
__inout_bcount(size) caddr_t data,
@@ -1279,7 +1301,7 @@ efx_vpd_next(
__out efx_vpd_value_t *evvp,
__inout unsigned int *contp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -1311,25 +1333,25 @@ typedef enum efx_nvram_type_e {
EFX_NVRAM_NTYPES,
} efx_nvram_type_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_init(
__in efx_nic_t *enp);
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_test(
__in efx_nic_t *enp);
#endif /* EFSYS_OPT_DIAG */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_size(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_rw_start(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1340,14 +1362,14 @@ efx_nvram_rw_finish(
__in efx_nic_t *enp,
__in efx_nvram_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_get_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out uint32_t *subtypep,
__out_ecount(4) uint16_t version[4]);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_read_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1355,26 +1377,26 @@ efx_nvram_read_chunk(
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__in_ecount(4) uint16_t version[4]);
/* Validate contents of TLV formatted partition */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_tlv_validate(
__in efx_nic_t *enp,
__in uint32_t partn,
__in_bcount(partn_size) caddr_t partn_data,
__in size_t partn_size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_erase(
__in efx_nic_t *enp,
__in efx_nvram_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nvram_write_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1390,13 +1412,13 @@ efx_nvram_fini(
#if EFSYS_OPT_BOOTCFG
-extern int
+extern efx_rc_t
efx_bootcfg_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size);
-extern int
+extern efx_rc_t
efx_bootcfg_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -1446,34 +1468,34 @@ typedef union efx_lightsout_offload_param_u {
} elop_ns;
} efx_lightsout_offload_param_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_wol_init(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_wol_filter_clear(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_wol_filter_add(
__in efx_nic_t *enp,
__in efx_wol_type_t type,
__in efx_wol_param_t *paramp,
__out uint32_t *filter_idp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_wol_filter_remove(
__in efx_nic_t *enp,
__in uint32_t filter_id);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_lightsout_offload_add(
__in efx_nic_t *enp,
__in efx_lightsout_offload_type_t type,
__in efx_lightsout_offload_param_t *paramp,
__out uint32_t *filter_idp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_lightsout_offload_remove(
__in efx_nic_t *enp,
__in efx_lightsout_offload_type_t type,
@@ -1503,14 +1525,14 @@ typedef void
__in boolean_t negate,
__out efx_qword_t *eqp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_sram_test(
__in efx_nic_t *enp,
__in efx_pattern_type_t type);
#endif /* EFSYS_OPT_DIAG */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_sram_buf_tbl_set(
__in efx_nic_t *enp,
__in uint32_t id,
@@ -1579,7 +1601,7 @@ typedef enum efx_ev_qstat_e {
#endif /* EFSYS_OPT_QSTATS */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_ev_init(
__in efx_nic_t *enp);
@@ -1593,7 +1615,7 @@ efx_ev_fini(
#define EFX_EVQ_SIZE(_nevs) ((_nevs) * sizeof (efx_qword_t))
#define EFX_EVQ_NBUFS(_nevs) (EFX_EVQ_SIZE(_nevs) / EFX_BUF_SIZE)
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -1768,12 +1790,12 @@ efx_ev_qpoll(
__in const efx_ev_callbacks_t *eecp,
__in_opt void *arg);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count);
@@ -1802,7 +1824,7 @@ efx_ev_qdestroy(
/* RX */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_init(
__inout efx_nic_t *enp);
@@ -1811,7 +1833,7 @@ efx_rx_fini(
__in efx_nic_t *enp);
#if EFSYS_OPT_RX_HDR_SPLIT
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_hdr_split_enable(
__in efx_nic_t *enp,
__in unsigned int hdr_buf_size,
@@ -1820,7 +1842,7 @@ efx_rx_hdr_split_enable(
#endif /* EFSYS_OPT_RX_HDR_SPLIT */
#if EFSYS_OPT_RX_SCATTER
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_scatter_enable(
__in efx_nic_t *enp,
__in unsigned int buf_size);
@@ -1855,31 +1877,31 @@ typedef enum efx_rx_scale_support_e {
EFX_RX_SCALE_SHARED /* Read-only key/indirection table */
} efx_rx_scale_support_t;
- extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_hash_support_get(
__in efx_nic_t *enp,
__out efx_rx_hash_support_t *supportp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_scale_support_get(
__in efx_nic_t *enp,
__out efx_rx_scale_support_t *supportp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_scale_mode_set(
__in efx_nic_t *enp,
__in efx_rx_hash_alg_t alg,
__in efx_rx_hash_type_t type,
__in boolean_t insert);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_scale_tbl_set(
__in efx_nic_t *enp,
__in_ecount(n) unsigned int *table,
__in size_t n);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
@@ -1893,7 +1915,7 @@ efx_psuedo_hdr_hash_get(
#endif /* EFSYS_OPT_RX_SCALE */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_psuedo_hdr_pkt_length_get(
__in efx_nic_t *enp,
__in uint8_t *buffer,
@@ -1915,7 +1937,7 @@ typedef enum efx_rxq_type_e {
EFX_RXQ_NTYPES
} efx_rxq_type_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -1952,7 +1974,7 @@ efx_rx_qpush(
__in unsigned int added,
__inout unsigned int *pushedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_rx_qflush(
__in efx_rxq_t *erp);
@@ -1981,7 +2003,7 @@ typedef enum efx_tx_qstat_e {
#endif /* EFSYS_OPT_QSTATS */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_init(
__in efx_nic_t *enp);
@@ -2004,7 +2026,7 @@ efx_tx_fini(
#define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -2017,7 +2039,7 @@ efx_tx_qcreate(
__deref_out efx_txq_t **etpp,
__out unsigned int *addedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qpost(
__in efx_txq_t *etp,
__in_ecount(n) efx_buffer_t *eb,
@@ -2025,7 +2047,7 @@ efx_tx_qpost(
__in unsigned int completed,
__inout unsigned int *addedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns);
@@ -2036,7 +2058,7 @@ efx_tx_qpush(
__in unsigned int added,
__in unsigned int pushed);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qflush(
__in efx_txq_t *etp);
@@ -2044,7 +2066,7 @@ extern void
efx_tx_qenable(
__in efx_txq_t *etp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qpio_enable(
__in efx_txq_t *etp);
@@ -2052,21 +2074,21 @@ extern void
efx_tx_qpio_disable(
__in efx_txq_t *etp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qpio_write(
__in efx_txq_t *etp,
__in_ecount(buf_length) uint8_t *buffer,
__in size_t buf_length,
__in size_t pio_buf_offset);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qpio_post(
__in efx_txq_t *etp,
__in size_t pkt_length,
__in unsigned int completed,
__inout unsigned int *addedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_tx_qdesc_post(
__in efx_txq_t *etp,
__in_ecount(n) efx_desc_t *ed,
@@ -2206,7 +2228,7 @@ typedef struct efx_filter_spec_s {
#define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff
#define EFX_FILTER_SPEC_VID_UNSPEC 0xffff
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_init(
__in efx_nic_t *enp);
@@ -2214,21 +2236,21 @@ extern void
efx_filter_fini(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_insert(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_remove(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_restore(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_supported_filters(
__in efx_nic_t *enp,
__out uint32_t *list,
@@ -2246,14 +2268,14 @@ efx_filter_spec_init_tx(
__inout efx_filter_spec_t *spec,
__in efx_txq_t *etp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_spec_set_ipv4_local(
__inout efx_filter_spec_t *spec,
__in uint8_t proto,
__in uint32_t host,
__in uint16_t port);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_spec_set_ipv4_full(
__inout efx_filter_spec_t *spec,
__in uint8_t proto,
@@ -2262,17 +2284,17 @@ efx_filter_spec_set_ipv4_full(
__in uint32_t rhost,
__in uint16_t rport);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_spec_set_eth_local(
__inout efx_filter_spec_t *spec,
__in uint16_t vid,
__in const uint8_t *addr);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_spec_set_uc_def(
__inout efx_filter_spec_t *spec);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_spec_set_mc_def(
__inout efx_filter_spec_t *spec);
diff --git a/sys/dev/sfxge/common/efx_bootcfg.c b/sys/dev/sfxge/common/efx_bootcfg.c
index 330f69d..97e829d 100644
--- a/sys/dev/sfxge/common/efx_bootcfg.c
+++ b/sys/dev/sfxge/common/efx_bootcfg.c
@@ -64,7 +64,7 @@ efx_bootcfg_csum(
return (checksum);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_bootcfg_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -73,7 +73,7 @@ efx_bootcfg_verify(
{
size_t offset = 0;
size_t used = 0;
- int rc;
+ efx_rc_t rc;
/* Start parsing tags immediatly after the checksum */
for (offset = 1; offset < size; ) {
@@ -125,12 +125,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- int
+ efx_rc_t
efx_bootcfg_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
@@ -139,7 +139,7 @@ efx_bootcfg_read(
uint8_t *payload = NULL;
size_t used_bytes;
size_t sector_length;
- int rc;
+ efx_rc_t rc;
rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &sector_length);
if (rc != 0)
@@ -238,12 +238,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- int
+ efx_rc_t
efx_bootcfg_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -256,7 +256,7 @@ efx_bootcfg_write(
size_t used_bytes;
size_t offset;
size_t remaining;
- int rc;
+ efx_rc_t rc;
rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &sector_length);
if (rc != 0)
@@ -342,7 +342,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_check.h b/sys/dev/sfxge/common/efx_check.h
index 9e590a4..e3a6827 100644
--- a/sys/dev/sfxge/common/efx_check.h
+++ b/sys/dev/sfxge/common/efx_check.h
@@ -146,6 +146,13 @@
# error "HUNTINGTON requires MCDI"
#endif
+/* Support MCDI logging */
+#if EFSYS_OPT_MCDI_LOGGING
+# if !EFSYS_OPT_MCDI
+# error "MCDI_LOGGING requires MCDI"
+# endif
+#endif /* EFSYS_OPT_MCDI_LOGGING */
+
/* Support LM87 monitor */
#if EFSYS_OPT_MON_LM87
# if !EFSYS_OPT_FALCON
diff --git a/sys/dev/sfxge/common/efx_ev.c b/sys/dev/sfxge/common/efx_ev.c
index 9669fc4..ffbe8dc 100644
--- a/sys/dev/sfxge/common/efx_ev.c
+++ b/sys/dev/sfxge/common/efx_ev.c
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_init(
__in efx_nic_t *enp);
@@ -64,7 +64,7 @@ static void
falconsiena_ev_fini(
__in efx_nic_t *enp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -77,7 +77,7 @@ static void
falconsiena_ev_qdestroy(
__in efx_evq_t *eep);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count);
@@ -94,7 +94,7 @@ falconsiena_ev_qpost(
__in efx_evq_t *eep,
__in uint16_t data);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us);
@@ -155,12 +155,12 @@ static efx_ev_ops_t __efx_ev_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_init(
__in efx_nic_t *enp)
{
efx_ev_ops_t *eevop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -208,7 +208,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
enp->en_eevop = NULL;
enp->en_mod_flags &= ~EFX_MOD_EV;
@@ -235,7 +235,7 @@ efx_ev_fini(
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -247,7 +247,7 @@ efx_ev_qcreate(
efx_ev_ops_t *eevop = enp->en_eevop;
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_evq_t *eep;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
@@ -279,7 +279,7 @@ fail2:
EFSYS_PROBE(fail2);
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -301,14 +301,14 @@ efx_ev_qdestroy(
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count)
{
efx_nic_t *enp = eep->ee_enp;
efx_ev_ops_t *eevop = enp->en_eevop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
@@ -325,7 +325,7 @@ efx_ev_qprime(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -409,14 +409,14 @@ efx_ev_qpost(
eevop->eevo_qpost(eep, data);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us)
{
efx_nic_t *enp = eep->ee_enp;
efx_ev_ops_t *eevop = enp->en_eevop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
@@ -426,7 +426,7 @@ efx_ev_qmoderate(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -448,7 +448,7 @@ efx_ev_qstats_update(
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_init(
__in efx_nic_t *enp)
{
@@ -990,7 +990,7 @@ falconsiena_ev_mcdi(
#if EFSYS_OPT_MON_STATS
efx_mon_stat_t id;
efx_mon_stat_value_t value;
- int rc;
+ efx_rc_t rc;
if ((rc = mcdi_mon_ev(enp, eqp, &id, &value)) == 0)
should_abort = eecp->eec_monitor(arg, id, value);
@@ -1047,7 +1047,7 @@ out:
#endif /* EFSYS_OPT_MCDI */
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count)
@@ -1220,7 +1220,7 @@ falconsiena_ev_qpost(
EFX_BAR_WRITEO(enp, FR_AZ_DRV_EV_REG, &oword);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us)
@@ -1229,7 +1229,7 @@ falconsiena_ev_qmoderate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
unsigned int locked;
efx_dword_t dword;
- int rc;
+ efx_rc_t rc;
if (us > encp->enc_evq_timer_max_us) {
rc = EINVAL;
@@ -1274,12 +1274,12 @@ falconsiena_ev_qmoderate(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -1291,7 +1291,7 @@ falconsiena_ev_qcreate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t size;
efx_oword_t oword;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS));
EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS));
@@ -1352,7 +1352,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_filter.c b/sys/dev/sfxge/common/efx_filter.c
index 7ae7ea5..9841715 100644
--- a/sys/dev/sfxge/common/efx_filter.c
+++ b/sys/dev/sfxge/common/efx_filter.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_init(
__in efx_nic_t *enp);
@@ -50,22 +50,22 @@ static void
falconsiena_filter_fini(
__in efx_nic_t *enp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_restore(
__in efx_nic_t *enp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_add(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec,
__in boolean_t may_replace);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_delete(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_supported_filters(
__in efx_nic_t *enp,
__out uint32_t *list,
@@ -109,7 +109,7 @@ static efx_filter_ops_t __efx_filter_hunt_ops = {
};
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_filter_insert(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec)
@@ -123,7 +123,7 @@ efx_filter_insert(
return (efop->efo_add(enp, spec, B_FALSE));
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_filter_remove(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec)
@@ -141,11 +141,11 @@ efx_filter_remove(
return (efop->efo_delete(enp, spec));
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_filter_restore(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
@@ -155,17 +155,17 @@ efx_filter_restore(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_filter_init(
__in efx_nic_t *enp)
{
efx_filter_ops_t *efop;
- int rc;
+ efx_rc_t rc;
/* Check that efx_filter_spec_t is 64 bytes. */
EFX_STATIC_ASSERT(sizeof (efx_filter_spec_t) == 64);
@@ -209,7 +209,7 @@ efx_filter_init(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
enp->en_efop = NULL;
enp->en_mod_flags &= ~EFX_MOD_FILTER;
@@ -230,13 +230,13 @@ efx_filter_fini(
enp->en_mod_flags &= ~EFX_MOD_FILTER;
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_filter_supported_filters(
__in efx_nic_t *enp,
__out uint32_t *list,
__out size_t *length)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -249,12 +249,12 @@ efx_filter_supported_filters(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_filter_reconfigure(
__in efx_nic_t *enp,
__in_ecount(6) uint8_t const *mac_addr,
@@ -265,7 +265,7 @@ efx_filter_reconfigure(
__in_ecount(6*count) uint8_t const *addrs,
__in int count)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -282,7 +282,7 @@ efx_filter_reconfigure(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -324,7 +324,7 @@ efx_filter_spec_init_tx(
/*
* Specify IPv4 host, transport protocol and port in a filter specification
*/
-__checkReturn int
+__checkReturn efx_rc_t
efx_filter_spec_set_ipv4_local(
__inout efx_filter_spec_t *spec,
__in uint8_t proto,
@@ -346,7 +346,7 @@ efx_filter_spec_set_ipv4_local(
/*
* Specify IPv4 hosts, transport protocol and ports in a filter specification
*/
-__checkReturn int
+__checkReturn efx_rc_t
efx_filter_spec_set_ipv4_full(
__inout efx_filter_spec_t *spec,
__in uint8_t proto,
@@ -373,7 +373,7 @@ efx_filter_spec_set_ipv4_full(
/*
* Specify local Ethernet address and/or VID in filter specification
*/
-__checkReturn int
+__checkReturn efx_rc_t
efx_filter_spec_set_eth_local(
__inout efx_filter_spec_t *spec,
__in uint16_t vid,
@@ -399,7 +399,7 @@ efx_filter_spec_set_eth_local(
/*
* Specify matching otherwise-unmatched unicast in a filter specification
*/
-__checkReturn int
+__checkReturn efx_rc_t
efx_filter_spec_set_uc_def(
__inout efx_filter_spec_t *spec)
{
@@ -412,7 +412,7 @@ efx_filter_spec_set_uc_def(
/*
* Specify matching otherwise-unmatched multicast in a filter specification
*/
-__checkReturn int
+__checkReturn efx_rc_t
efx_filter_spec_set_mc_def(
__inout efx_filter_spec_t *spec)
{
@@ -442,12 +442,12 @@ efx_filter_spec_set_mc_def(
*/
#define FILTER_CTL_SRCH_MAX 200
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_spec_from_gen_spec(
__out falconsiena_filter_spec_t *fs_spec,
__in efx_filter_spec_t *gen_spec)
{
- int rc;
+ efx_rc_t rc;
boolean_t is_full = B_FALSE;
if (gen_spec->efs_flags & EFX_FILTER_FLAG_TX)
@@ -591,7 +591,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -909,14 +909,14 @@ falconsiena_filter_build(
return (key);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_push_entry(
__inout efx_nic_t *enp,
__in falconsiena_filter_type_t type,
__in int index,
__in efx_oword_t *eop)
{
- int rc;
+ efx_rc_t rc;
switch (type) {
case EFX_FS_FILTER_RX_TCP_FULL:
@@ -986,7 +986,7 @@ falconsiena_filter_equal(
return (B_TRUE);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_search(
__in falconsiena_filter_tbl_t *fsftp,
__in falconsiena_filter_spec_t *spec,
@@ -1069,14 +1069,14 @@ falconsiena_filter_tbl_clear(
EFSYS_UNLOCK(enp->en_eslp, state);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_init(
__in efx_nic_t *enp)
{
falconsiena_filter_t *fsfp;
falconsiena_filter_tbl_t *fsftp;
int tbl_id;
- int rc;
+ efx_rc_t rc;
EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (falconsiena_filter_t), fsfp);
@@ -1158,7 +1158,7 @@ fail2:
falconsiena_filter_fini(enp);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1202,7 +1202,7 @@ falconsiena_filter_fini(
}
/* Restore filter state after a reset */
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_restore(
__in efx_nic_t *enp)
{
@@ -1213,7 +1213,7 @@ falconsiena_filter_restore(
efx_oword_t filter;
int filter_idx;
int state;
- int rc;
+ efx_rc_t rc;
EFSYS_LOCK(enp->en_eslp, state);
@@ -1245,20 +1245,20 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
EFSYS_UNLOCK(enp->en_eslp, state);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_add(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec,
__in boolean_t may_replace)
{
- int rc;
+ efx_rc_t rc;
falconsiena_filter_spec_t fs_spec;
falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
falconsiena_filter_tbl_id_t tbl_id;
@@ -1331,21 +1331,20 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_delete(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec)
{
- int rc;
+ efx_rc_t rc;
falconsiena_filter_spec_t fs_spec;
falconsiena_filter_t *fsfp = enp->en_filter.ef_falconsiena_filter;
falconsiena_filter_tbl_id_t tbl_id;
falconsiena_filter_tbl_t *fsftp;
- falconsiena_filter_spec_t *saved_spec;
efx_oword_t filter;
int filter_idx;
unsigned int depth;
@@ -1369,8 +1368,6 @@ falconsiena_filter_delete(
if (rc != 0)
goto fail2;
- saved_spec = &fsftp->fsft_spec[filter_idx];
-
falconsiena_filter_clear_entry(enp, fsftp, filter_idx);
if (fsftp->fsft_used == 0)
falconsiena_filter_reset_search_depth(fsfp, tbl_id);
@@ -1383,13 +1380,13 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#define MAX_SUPPORTED 4
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_filter_supported_filters(
__in efx_nic_t *enp,
__out uint32_t *list,
@@ -1397,7 +1394,7 @@ falconsiena_filter_supported_filters(
{
int index = 0;
uint32_t rx_matches[MAX_SUPPORTED];
- int rc;
+ efx_rc_t rc;
if (list == NULL) {
rc = EINVAL;
diff --git a/sys/dev/sfxge/common/efx_impl.h b/sys/dev/sfxge/common/efx_impl.h
index 6f72d5f..8f60532 100644
--- a/sys/dev/sfxge/common/efx_impl.h
+++ b/sys/dev/sfxge/common/efx_impl.h
@@ -92,44 +92,44 @@ typedef enum efx_mac_type_e {
} efx_mac_type_t;
typedef struct efx_ev_ops_s {
- int (*eevo_init)(efx_nic_t *);
+ efx_rc_t (*eevo_init)(efx_nic_t *);
void (*eevo_fini)(efx_nic_t *);
- int (*eevo_qcreate)(efx_nic_t *, unsigned int,
+ efx_rc_t (*eevo_qcreate)(efx_nic_t *, unsigned int,
efsys_mem_t *, size_t, uint32_t,
efx_evq_t *);
void (*eevo_qdestroy)(efx_evq_t *);
- int (*eevo_qprime)(efx_evq_t *, unsigned int);
+ efx_rc_t (*eevo_qprime)(efx_evq_t *, unsigned int);
void (*eevo_qpost)(efx_evq_t *, uint16_t);
- int (*eevo_qmoderate)(efx_evq_t *, unsigned int);
+ efx_rc_t (*eevo_qmoderate)(efx_evq_t *, unsigned int);
#if EFSYS_OPT_QSTATS
void (*eevo_qstats_update)(efx_evq_t *, efsys_stat_t *);
#endif
} efx_ev_ops_t;
typedef struct efx_tx_ops_s {
- int (*etxo_init)(efx_nic_t *);
+ efx_rc_t (*etxo_init)(efx_nic_t *);
void (*etxo_fini)(efx_nic_t *);
- int (*etxo_qcreate)(efx_nic_t *,
+ efx_rc_t (*etxo_qcreate)(efx_nic_t *,
unsigned int, unsigned int,
efsys_mem_t *, size_t,
uint32_t, uint16_t,
efx_evq_t *, efx_txq_t *,
unsigned int *);
void (*etxo_qdestroy)(efx_txq_t *);
- int (*etxo_qpost)(efx_txq_t *, efx_buffer_t *,
+ efx_rc_t (*etxo_qpost)(efx_txq_t *, efx_buffer_t *,
unsigned int, unsigned int,
unsigned int *);
void (*etxo_qpush)(efx_txq_t *, unsigned int, unsigned int);
- int (*etxo_qpace)(efx_txq_t *, unsigned int);
- int (*etxo_qflush)(efx_txq_t *);
+ efx_rc_t (*etxo_qpace)(efx_txq_t *, unsigned int);
+ efx_rc_t (*etxo_qflush)(efx_txq_t *);
void (*etxo_qenable)(efx_txq_t *);
- int (*etxo_qpio_enable)(efx_txq_t *);
+ efx_rc_t (*etxo_qpio_enable)(efx_txq_t *);
void (*etxo_qpio_disable)(efx_txq_t *);
- int (*etxo_qpio_write)(efx_txq_t *,uint8_t *, size_t,
+ efx_rc_t (*etxo_qpio_write)(efx_txq_t *,uint8_t *, size_t,
size_t);
- int (*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int,
+ efx_rc_t (*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int,
unsigned int *);
- int (*etxo_qdesc_post)(efx_txq_t *, efx_desc_t *,
+ efx_rc_t (*etxo_qdesc_post)(efx_txq_t *, efx_desc_t *,
unsigned int, unsigned int,
unsigned int *);
void (*etxo_qdesc_dma_create)(efx_txq_t *, efsys_dma_addr_t,
@@ -147,29 +147,29 @@ typedef struct efx_tx_ops_s {
} efx_tx_ops_t;
typedef struct efx_rx_ops_s {
- int (*erxo_init)(efx_nic_t *);
+ efx_rc_t (*erxo_init)(efx_nic_t *);
void (*erxo_fini)(efx_nic_t *);
#if EFSYS_OPT_RX_HDR_SPLIT
- int (*erxo_hdr_split_enable)(efx_nic_t *, unsigned int,
+ efx_rc_t (*erxo_hdr_split_enable)(efx_nic_t *, unsigned int,
unsigned int);
#endif
#if EFSYS_OPT_RX_SCATTER
- int (*erxo_scatter_enable)(efx_nic_t *, unsigned int);
+ efx_rc_t (*erxo_scatter_enable)(efx_nic_t *, unsigned int);
#endif
#if EFSYS_OPT_RX_SCALE
- int (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t,
+ efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t,
efx_rx_hash_type_t, boolean_t);
- int (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t);
- int (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *,
+ efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t);
+ efx_rc_t (*erxo_scale_tbl_set)(efx_nic_t *, unsigned int *,
size_t);
#endif
void (*erxo_qpost)(efx_rxq_t *, efsys_dma_addr_t *, size_t,
unsigned int, unsigned int,
unsigned int);
void (*erxo_qpush)(efx_rxq_t *, unsigned int, unsigned int *);
- int (*erxo_qflush)(efx_rxq_t *);
+ efx_rc_t (*erxo_qflush)(efx_rxq_t *);
void (*erxo_qenable)(efx_rxq_t *);
- int (*erxo_qcreate)(efx_nic_t *enp, unsigned int,
+ efx_rc_t (*erxo_qcreate)(efx_nic_t *enp, unsigned int,
unsigned int, efx_rxq_type_t,
efsys_mem_t *, size_t, uint32_t,
efx_evq_t *, efx_rxq_t *);
@@ -177,54 +177,54 @@ typedef struct efx_rx_ops_s {
} efx_rx_ops_t;
typedef struct efx_mac_ops_s {
- int (*emo_reset)(efx_nic_t *); /* optional */
- int (*emo_poll)(efx_nic_t *, efx_link_mode_t *);
- int (*emo_up)(efx_nic_t *, boolean_t *);
- int (*emo_addr_set)(efx_nic_t *);
- int (*emo_reconfigure)(efx_nic_t *);
- int (*emo_multicast_list_set)(efx_nic_t *);
- int (*emo_filter_default_rxq_set)(efx_nic_t *,
+ efx_rc_t (*emo_reset)(efx_nic_t *); /* optional */
+ efx_rc_t (*emo_poll)(efx_nic_t *, efx_link_mode_t *);
+ efx_rc_t (*emo_up)(efx_nic_t *, boolean_t *);
+ efx_rc_t (*emo_addr_set)(efx_nic_t *);
+ efx_rc_t (*emo_reconfigure)(efx_nic_t *);
+ efx_rc_t (*emo_multicast_list_set)(efx_nic_t *);
+ efx_rc_t (*emo_filter_default_rxq_set)(efx_nic_t *,
efx_rxq_t *, boolean_t);
void (*emo_filter_default_rxq_clear)(efx_nic_t *);
#if EFSYS_OPT_LOOPBACK
- int (*emo_loopback_set)(efx_nic_t *, efx_link_mode_t,
+ efx_rc_t (*emo_loopback_set)(efx_nic_t *, efx_link_mode_t,
efx_loopback_type_t);
#endif /* EFSYS_OPT_LOOPBACK */
#if EFSYS_OPT_MAC_STATS
- int (*emo_stats_upload)(efx_nic_t *, efsys_mem_t *);
- int (*emo_stats_periodic)(efx_nic_t *, efsys_mem_t *,
+ efx_rc_t (*emo_stats_upload)(efx_nic_t *, efsys_mem_t *);
+ efx_rc_t (*emo_stats_periodic)(efx_nic_t *, efsys_mem_t *,
uint16_t, boolean_t);
- int (*emo_stats_update)(efx_nic_t *, efsys_mem_t *,
+ efx_rc_t (*emo_stats_update)(efx_nic_t *, efsys_mem_t *,
efsys_stat_t *, uint32_t *);
#endif /* EFSYS_OPT_MAC_STATS */
} efx_mac_ops_t;
typedef struct efx_phy_ops_s {
- int (*epo_power)(efx_nic_t *, boolean_t); /* optional */
- int (*epo_reset)(efx_nic_t *);
- int (*epo_reconfigure)(efx_nic_t *);
- int (*epo_verify)(efx_nic_t *);
- int (*epo_uplink_check)(efx_nic_t *,
+ efx_rc_t (*epo_power)(efx_nic_t *, boolean_t); /* optional */
+ efx_rc_t (*epo_reset)(efx_nic_t *);
+ efx_rc_t (*epo_reconfigure)(efx_nic_t *);
+ efx_rc_t (*epo_verify)(efx_nic_t *);
+ efx_rc_t (*epo_uplink_check)(efx_nic_t *,
boolean_t *); /* optional */
- int (*epo_downlink_check)(efx_nic_t *, efx_link_mode_t *,
+ efx_rc_t (*epo_downlink_check)(efx_nic_t *, efx_link_mode_t *,
unsigned int *, uint32_t *);
- int (*epo_oui_get)(efx_nic_t *, uint32_t *);
+ efx_rc_t (*epo_oui_get)(efx_nic_t *, uint32_t *);
#if EFSYS_OPT_PHY_STATS
- int (*epo_stats_update)(efx_nic_t *, efsys_mem_t *,
+ efx_rc_t (*epo_stats_update)(efx_nic_t *, efsys_mem_t *,
uint32_t *);
#endif /* EFSYS_OPT_PHY_STATS */
#if EFSYS_OPT_PHY_PROPS
#if EFSYS_OPT_NAMES
const char *(*epo_prop_name)(efx_nic_t *, unsigned int);
#endif /* EFSYS_OPT_PHY_PROPS */
- int (*epo_prop_get)(efx_nic_t *, unsigned int, uint32_t,
+ efx_rc_t (*epo_prop_get)(efx_nic_t *, unsigned int, uint32_t,
uint32_t *);
- int (*epo_prop_set)(efx_nic_t *, unsigned int, uint32_t);
+ efx_rc_t (*epo_prop_set)(efx_nic_t *, unsigned int, uint32_t);
#endif /* EFSYS_OPT_PHY_PROPS */
#if EFSYS_OPT_BIST
- int (*epo_bist_enable_offline)(efx_nic_t *);
- int (*epo_bist_start)(efx_nic_t *, efx_bist_type_t);
- int (*epo_bist_poll)(efx_nic_t *, efx_bist_type_t,
+ efx_rc_t (*epo_bist_enable_offline)(efx_nic_t *);
+ efx_rc_t (*epo_bist_start)(efx_nic_t *, efx_bist_type_t);
+ efx_rc_t (*epo_bist_poll)(efx_nic_t *, efx_bist_type_t,
efx_bist_result_t *, uint32_t *,
unsigned long *, size_t);
void (*epo_bist_stop)(efx_nic_t *, efx_bist_type_t);
@@ -233,19 +233,19 @@ typedef struct efx_phy_ops_s {
#if EFSYS_OPT_FILTER
typedef struct efx_filter_ops_s {
- int (*efo_init)(efx_nic_t *);
- void (*efo_fini)(efx_nic_t *);
- int (*efo_restore)(efx_nic_t *);
- int (*efo_add)(efx_nic_t *, efx_filter_spec_t *,
- boolean_t may_replace);
- int (*efo_delete)(efx_nic_t *, efx_filter_spec_t *);
- int (*efo_supported_filters)(efx_nic_t *, uint32_t *, size_t *);
- int (*efo_reconfigure)(efx_nic_t *, uint8_t const *, boolean_t,
+ efx_rc_t (*efo_init)(efx_nic_t *);
+ void (*efo_fini)(efx_nic_t *);
+ efx_rc_t (*efo_restore)(efx_nic_t *);
+ efx_rc_t (*efo_add)(efx_nic_t *, efx_filter_spec_t *,
+ boolean_t may_replace);
+ efx_rc_t (*efo_delete)(efx_nic_t *, efx_filter_spec_t *);
+ efx_rc_t (*efo_supported_filters)(efx_nic_t *, uint32_t *, size_t *);
+ efx_rc_t (*efo_reconfigure)(efx_nic_t *, uint8_t const *, boolean_t,
boolean_t, boolean_t, boolean_t,
uint8_t const *, int);
} efx_filter_ops_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_filter_reconfigure(
__in efx_nic_t *enp,
__in_ecount(6) uint8_t const *mac_addr,
@@ -259,13 +259,14 @@ efx_filter_reconfigure(
#endif /* EFSYS_OPT_FILTER */
typedef struct efx_pktfilter_ops_s {
- int (*epfo_set)(efx_nic_t *,
+ efx_rc_t (*epfo_set)(efx_nic_t *,
boolean_t unicst,
boolean_t brdcast);
#if EFSYS_OPT_MCAST_FILTER_LIST
- int (*epfo_mcast_list_set)(efx_nic_t *, uint8_t const *addrs, int count);
+ efx_rc_t (*epfo_mcast_list_set)(efx_nic_t *,
+ uint8_t const *addrs, int count);
#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
- int (*epfo_mcast_all)(efx_nic_t *);
+ efx_rc_t (*epfo_mcast_all)(efx_nic_t *);
} efx_pktfilter_ops_t;
typedef struct efx_port_s {
@@ -324,11 +325,11 @@ typedef struct efx_port_s {
} efx_port_t;
typedef struct efx_mon_ops_s {
- int (*emo_reset)(efx_nic_t *);
- int (*emo_reconfigure)(efx_nic_t *);
+ efx_rc_t (*emo_reset)(efx_nic_t *);
+ efx_rc_t (*emo_reconfigure)(efx_nic_t *);
#if EFSYS_OPT_MON_STATS
- int (*emo_stats_update)(efx_nic_t *, efsys_mem_t *,
- efx_mon_stat_value_t *);
+ efx_rc_t (*emo_stats_update)(efx_nic_t *, efsys_mem_t *,
+ efx_mon_stat_value_t *);
#endif /* EFSYS_OPT_MON_STATS */
} efx_mon_ops_t;
@@ -338,11 +339,11 @@ typedef struct efx_mon_s {
} efx_mon_t;
typedef struct efx_intr_ops_s {
- int (*eio_init)(efx_nic_t *, efx_intr_type_t, efsys_mem_t *);
+ efx_rc_t (*eio_init)(efx_nic_t *, efx_intr_type_t, efsys_mem_t *);
void (*eio_enable)(efx_nic_t *);
void (*eio_disable)(efx_nic_t *);
void (*eio_disable_unlocked)(efx_nic_t *);
- int (*eio_trigger)(efx_nic_t *, unsigned int);
+ efx_rc_t (*eio_trigger)(efx_nic_t *, unsigned int);
void (*eio_fini)(efx_nic_t *);
} efx_intr_ops_t;
@@ -354,19 +355,19 @@ typedef struct efx_intr_s {
} efx_intr_t;
typedef struct efx_nic_ops_s {
- int (*eno_probe)(efx_nic_t *);
- int (*eno_set_drv_limits)(efx_nic_t *, efx_drv_limits_t*);
- int (*eno_reset)(efx_nic_t *);
- int (*eno_init)(efx_nic_t *);
- int (*eno_get_vi_pool)(efx_nic_t *, uint32_t *);
- int (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t,
+ efx_rc_t (*eno_probe)(efx_nic_t *);
+ efx_rc_t (*eno_set_drv_limits)(efx_nic_t *, efx_drv_limits_t*);
+ efx_rc_t (*eno_reset)(efx_nic_t *);
+ efx_rc_t (*eno_init)(efx_nic_t *);
+ efx_rc_t (*eno_get_vi_pool)(efx_nic_t *, uint32_t *);
+ efx_rc_t (*eno_get_bar_region)(efx_nic_t *, efx_nic_region_t,
uint32_t *, size_t *);
#if EFSYS_OPT_DIAG
- int (*eno_sram_test)(efx_nic_t *, efx_sram_pattern_fn_t);
- int (*eno_register_test)(efx_nic_t *);
+ efx_rc_t (*eno_sram_test)(efx_nic_t *, efx_sram_pattern_fn_t);
+ efx_rc_t (*eno_register_test)(efx_nic_t *);
#endif /* EFSYS_OPT_DIAG */
- void (*eno_fini)(efx_nic_t *);
- void (*eno_unprobe)(efx_nic_t *);
+ void (*eno_fini)(efx_nic_t *);
+ void (*eno_unprobe)(efx_nic_t *);
} efx_nic_ops_t;
#ifndef EFX_TXQ_LIMIT_TARGET
@@ -452,15 +453,16 @@ falconsiena_filter_tbl_clear(
#if EFSYS_OPT_MCDI
typedef struct efx_mcdi_ops_s {
- int (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *);
+ efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *);
void (*emco_request_copyin)(efx_nic_t *, efx_mcdi_req_t *,
unsigned int, boolean_t, boolean_t);
boolean_t (*emco_request_poll)(efx_nic_t *);
void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *);
- int (*emco_poll_reboot)(efx_nic_t *);
+ efx_rc_t (*emco_poll_reboot)(efx_nic_t *);
void (*emco_fini)(efx_nic_t *);
- int (*emco_fw_update_supported)(efx_nic_t *, boolean_t *);
- int (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *);
+ efx_rc_t (*emco_fw_update_supported)(efx_nic_t *, boolean_t *);
+ efx_rc_t (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *);
+ efx_rc_t (*emco_link_control_supported)(efx_nic_t *, boolean_t *);
} efx_mcdi_ops_t;
typedef struct efx_mcdi_s {
@@ -474,49 +476,52 @@ typedef struct efx_mcdi_s {
#if EFSYS_OPT_NVRAM
typedef struct efx_nvram_ops_s {
#if EFSYS_OPT_DIAG
- int (*envo_test)(efx_nic_t *);
+ efx_rc_t (*envo_test)(efx_nic_t *);
#endif /* EFSYS_OPT_DIAG */
- int (*envo_size)(efx_nic_t *, efx_nvram_type_t, size_t *);
- int (*envo_get_version)(efx_nic_t *, efx_nvram_type_t,
- uint32_t *, uint16_t *);
- int (*envo_rw_start)(efx_nic_t *, efx_nvram_type_t, size_t *);
- int (*envo_read_chunk)(efx_nic_t *, efx_nvram_type_t,
- unsigned int, caddr_t, size_t);
- int (*envo_erase)(efx_nic_t *, efx_nvram_type_t);
- int (*envo_write_chunk)(efx_nic_t *, efx_nvram_type_t,
- unsigned int, caddr_t, size_t);
- void (*envo_rw_finish)(efx_nic_t *, efx_nvram_type_t);
- int (*envo_set_version)(efx_nic_t *, efx_nvram_type_t, uint16_t *);
+ efx_rc_t (*envo_size)(efx_nic_t *, efx_nvram_type_t, size_t *);
+ efx_rc_t (*envo_get_version)(efx_nic_t *, efx_nvram_type_t,
+ uint32_t *, uint16_t *);
+ efx_rc_t (*envo_rw_start)(efx_nic_t *, efx_nvram_type_t, size_t *);
+ efx_rc_t (*envo_read_chunk)(efx_nic_t *, efx_nvram_type_t,
+ unsigned int, caddr_t, size_t);
+ efx_rc_t (*envo_erase)(efx_nic_t *, efx_nvram_type_t);
+ efx_rc_t (*envo_write_chunk)(efx_nic_t *, efx_nvram_type_t,
+ unsigned int, caddr_t, size_t);
+ void (*envo_rw_finish)(efx_nic_t *, efx_nvram_type_t);
+ efx_rc_t (*envo_set_version)(efx_nic_t *, efx_nvram_type_t,
+ uint16_t *);
} efx_nvram_ops_t;
#endif /* EFSYS_OPT_NVRAM */
#if EFSYS_OPT_VPD
typedef struct efx_vpd_ops_s {
- int (*evpdo_init)(efx_nic_t *);
- int (*evpdo_size)(efx_nic_t *, size_t *);
- int (*evpdo_read)(efx_nic_t *, caddr_t, size_t);
- int (*evpdo_verify)(efx_nic_t *, caddr_t, size_t);
- int (*evpdo_reinit)(efx_nic_t *, caddr_t, size_t);
- int (*evpdo_get)(efx_nic_t *, caddr_t, size_t, efx_vpd_value_t *);
- int (*evpdo_set)(efx_nic_t *, caddr_t, size_t, efx_vpd_value_t *);
- int (*evpdo_next)(efx_nic_t *, caddr_t, size_t, efx_vpd_value_t *,
- unsigned int *);
- int (*evpdo_write)(efx_nic_t *, caddr_t, size_t);
- void (*evpdo_fini)(efx_nic_t *);
+ efx_rc_t (*evpdo_init)(efx_nic_t *);
+ efx_rc_t (*evpdo_size)(efx_nic_t *, size_t *);
+ efx_rc_t (*evpdo_read)(efx_nic_t *, caddr_t, size_t);
+ efx_rc_t (*evpdo_verify)(efx_nic_t *, caddr_t, size_t);
+ efx_rc_t (*evpdo_reinit)(efx_nic_t *, caddr_t, size_t);
+ efx_rc_t (*evpdo_get)(efx_nic_t *, caddr_t, size_t,
+ efx_vpd_value_t *);
+ efx_rc_t (*evpdo_set)(efx_nic_t *, caddr_t, size_t,
+ efx_vpd_value_t *);
+ efx_rc_t (*evpdo_next)(efx_nic_t *, caddr_t, size_t,
+ efx_vpd_value_t *, unsigned int *);
+ efx_rc_t (*evpdo_write)(efx_nic_t *, caddr_t, size_t);
+ void (*evpdo_fini)(efx_nic_t *);
} efx_vpd_ops_t;
#endif /* EFSYS_OPT_VPD */
#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_partitions(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size,
__out unsigned int *npartnp);
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_metadata(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -525,20 +530,21 @@ efx_mcdi_nvram_metadata(
__out_bcount_opt(size) char *descp,
__in size_t size);
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_info(
__in efx_nic_t *enp,
__in uint32_t partn,
__out_opt size_t *sizep,
__out_opt uint32_t *addressp,
- __out_opt uint32_t *erase_sizep);
+ __out_opt uint32_t *erase_sizep,
+ __out_opt uint32_t *write_sizep);
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_update_start(
__in efx_nic_t *enp,
__in uint32_t partn);
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_read(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -546,14 +552,14 @@ efx_mcdi_nvram_read(
__out_bcount(size) caddr_t data,
__in size_t size);
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_erase(
__in efx_nic_t *enp,
__in uint32_t partn,
__in uint32_t offset,
__in size_t size);
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_write(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -561,7 +567,7 @@ efx_mcdi_nvram_write(
__out_bcount(size) caddr_t data,
__in size_t size);
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_update_finish(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -569,7 +575,7 @@ efx_mcdi_nvram_update_finish(
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_test(
__in efx_nic_t *enp,
__in uint32_t partn);
@@ -1044,11 +1050,11 @@ struct efx_txq_s {
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_biu_test(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mac_select(
__in efx_nic_t *enp);
@@ -1059,7 +1065,7 @@ efx_mac_multicast_hash_compute(
__out efx_oword_t *hash_low,
__out efx_oword_t *hash_high);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_phy_probe(
__in efx_nic_t *enp);
@@ -1071,25 +1077,25 @@ efx_phy_unprobe(
/* VPD utility functions */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_hunk_length(
__in_bcount(size) caddr_t data,
__in size_t size,
__out size_t *lengthp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_hunk_verify(
__in_bcount(size) caddr_t data,
__in size_t size,
__out_opt boolean_t *cksummedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_hunk_reinit(
__in_bcount(size) caddr_t data,
__in size_t size,
__in boolean_t wantpid);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_hunk_get(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -1098,7 +1104,7 @@ efx_vpd_hunk_get(
__out unsigned int *payloadp,
__out uint8_t *paylenp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_hunk_next(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -1108,7 +1114,7 @@ efx_vpd_hunk_next(
__out_opt uint8_t *paylenp,
__inout unsigned int *contp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_vpd_hunk_set(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -1127,13 +1133,13 @@ typedef struct efx_register_set_s {
efx_oword_t mask;
} efx_register_set_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_test_registers(
__in efx_nic_t *enp,
__in efx_register_set_t *rsp,
__in size_t count);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_nic_test_tables(
__in efx_nic_t *enp,
__in efx_register_set_t *rsp,
@@ -1144,14 +1150,14 @@ efx_nic_test_tables(
#if EFSYS_OPT_MCDI
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_set_workaround(
__in efx_nic_t *enp,
__in uint32_t type,
__in boolean_t enabled,
__out_opt uint32_t *flagsp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_get_workarounds(
__in efx_nic_t *enp,
__out_opt uint32_t *implementedp,
diff --git a/sys/dev/sfxge/common/efx_intr.c b/sys/dev/sfxge/common/efx_intr.c
index d40f57f..48ec3cb 100644
--- a/sys/dev/sfxge/common/efx_intr.c
+++ b/sys/dev/sfxge/common/efx_intr.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -58,7 +58,7 @@ static void
falconsiena_intr_disable_unlocked(
__in efx_nic_t *enp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level);
@@ -113,7 +113,7 @@ static efx_intr_ops_t __efx_intr_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -121,7 +121,7 @@ efx_intr_init(
{
efx_intr_t *eip = &(enp->en_intr);
efx_intr_ops_t *eiop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
@@ -174,7 +174,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -235,7 +235,7 @@ efx_intr_disable_unlocked(
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level)
@@ -336,7 +336,7 @@ efx_intr_fatal(
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -417,7 +417,7 @@ falconsiena_intr_disable_unlocked(
&oword, B_FALSE);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level)
@@ -426,7 +426,7 @@ falconsiena_intr_trigger(
efx_oword_t oword;
unsigned int count;
uint32_t sel;
- int rc;
+ efx_rc_t rc;
/* bug16757: No event queues can be initialized */
EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_EV));
@@ -480,7 +480,7 @@ falconsiena_intr_trigger(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_mac.c b/sys/dev/sfxge/common/efx_mac.c
index a701797..50f9333 100644
--- a/sys/dev/sfxge/common/efx_mac.c
+++ b/sys/dev/sfxge/common/efx_mac.c
@@ -46,9 +46,9 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_mac_multicast_list_set(
- __in efx_nic_t *enp);
+ __in efx_nic_t *enp);
#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
@@ -166,7 +166,7 @@ static efx_mac_ops_t *__efx_mac_ops[] = {
#endif
};
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_pdu_set(
__in efx_nic_t *enp,
__in size_t pdu)
@@ -174,7 +174,7 @@ efx_mac_pdu_set(
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
uint32_t old_pdu;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -205,12 +205,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_addr_set(
__in efx_nic_t *enp,
__in uint8_t *addr)
@@ -219,7 +219,7 @@ efx_mac_addr_set(
efx_mac_ops_t *emop = epp->ep_emop;
uint8_t old_addr[6];
uint32_t oui;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -250,12 +250,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_filter_set(
__in efx_nic_t *enp,
__in boolean_t all_unicst,
@@ -269,7 +269,7 @@ efx_mac_filter_set(
boolean_t old_mulcst;
boolean_t old_all_mulcst;
boolean_t old_brdcst;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -290,7 +290,7 @@ efx_mac_filter_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
epp->ep_all_unicst = old_all_unicst;
epp->ep_mulcst = old_mulcst;
@@ -300,14 +300,14 @@ fail1:
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_drain(
__in efx_nic_t *enp,
__in boolean_t enabled)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -334,19 +334,19 @@ efx_mac_drain(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -357,12 +357,12 @@ efx_mac_up(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_fcntl_set(
__in efx_nic_t *enp,
__in unsigned int fcntl,
@@ -374,7 +374,7 @@ efx_mac_fcntl_set(
unsigned int old_fcntl;
boolean_t old_autoneg;
unsigned int old_adv_cap;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -432,7 +432,7 @@ fail2:
epp->ep_adv_cap_mask = old_adv_cap;
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -468,7 +468,7 @@ efx_mac_fcntl_get(
* Then efx_port_t.ep_multicst_hash could be made Falcon/Siena specific as
* well.
*/
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_hash_set(
__in efx_nic_t *enp,
__in_ecount(EFX_MAC_HASH_BITS) unsigned int const *bucket)
@@ -477,7 +477,7 @@ efx_mac_hash_set(
efx_mac_ops_t *emop = epp->ep_emop;
efx_oword_t old_hash[2];
unsigned int index;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -504,14 +504,14 @@ efx_mac_hash_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
memcpy(epp->ep_multicst_hash, old_hash, sizeof (old_hash));
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_multicast_list_set(
__in efx_nic_t *enp,
__in_ecount(6*count) uint8_t const *addrs,
@@ -521,7 +521,7 @@ efx_mac_multicast_list_set(
efx_mac_ops_t *emop = epp->ep_emop;
uint8_t *old_mulcst_addr_list = NULL;
uint32_t old_mulcst_addr_count;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -581,13 +581,13 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_filter_default_rxq_set(
__in efx_nic_t *enp,
__in efx_rxq_t *erp,
@@ -595,7 +595,7 @@ efx_mac_filter_default_rxq_set(
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -609,7 +609,7 @@ efx_mac_filter_default_rxq_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -733,14 +733,14 @@ efx_mac_stat_name(
#endif /* EFSYS_OPT_NAMES */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_stats_upload(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -759,12 +759,12 @@ efx_mac_stats_upload(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_stats_periodic(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
@@ -773,7 +773,7 @@ efx_mac_stats_periodic(
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -793,22 +793,22 @@ efx_mac_stats_periodic(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *essp,
- __out_opt uint32_t *generationp)
+ __inout_opt uint32_t *generationp)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -823,7 +823,7 @@ efx_mac_stats_update(
#endif /* EFSYS_OPT_MAC_STATS */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mac_select(
__in efx_nic_t *enp)
{
@@ -904,7 +904,7 @@ chosen:
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -943,14 +943,14 @@ falconsiena_mac_multicast_hash_compute(
}
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_mac_multicast_list_set(
- __in efx_nic_t *enp)
+ __in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
efx_oword_t old_hash[2];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -968,7 +968,7 @@ falconsiena_mac_multicast_list_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
memcpy(epp->ep_multicst_hash, old_hash, sizeof (old_hash));
diff --git a/sys/dev/sfxge/common/efx_mcdi.c b/sys/dev/sfxge/common/efx_mcdi.c
index e1c4b45..5f440a4 100644
--- a/sys/dev/sfxge/common/efx_mcdi.c
+++ b/sys/dev/sfxge/common/efx_mcdi.c
@@ -53,6 +53,8 @@ static efx_mcdi_ops_t __efx_mcdi_siena_ops = {
siena_mcdi_fw_update_supported, /* emco_fw_update_supported */
siena_mcdi_macaddr_change_supported,
/* emco_macaddr_change_supported */
+ siena_mcdi_link_control_supported,
+ /* emco_link_control_supported */
};
#endif /* EFSYS_OPT_SIENA */
@@ -69,19 +71,21 @@ static efx_mcdi_ops_t __efx_mcdi_hunt_ops = {
hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */
hunt_mcdi_macaddr_change_supported,
/* emco_macaddr_change_supported */
+ hunt_mcdi_link_control_supported,
+ /* emco_link_control_supported */
};
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_init(
__in efx_nic_t *enp,
__in const efx_mcdi_transport_t *emtp)
{
efx_mcdi_ops_t *emcop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0);
@@ -136,7 +140,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
enp->en_mcdi.em_emcop = NULL;
enp->en_mcdi.em_emtp = NULL;
@@ -285,7 +289,7 @@ efx_mcdi_request_abort(
return (aborted);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_request_errcode(
__in unsigned int err)
{
@@ -378,7 +382,7 @@ efx_mcdi_raise_exception(
emtp->emt_exception(emtp->emt_context, exception);
}
-static int
+static efx_rc_t
efx_mcdi_poll_reboot(
__in efx_nic_t *enp)
{
@@ -464,9 +468,8 @@ efx_mcdi_ev_cpl(
} else {
emrp->emr_out_length_used = outlen;
emrp->emr_rc = 0;
-
- emcop->emco_request_copyout(enp, emrp);
}
+ emcop->emco_request_copyout(enp, emrp);
emtp->emt_ev_cpl(emtp->emt_context);
}
@@ -524,7 +527,7 @@ efx_mcdi_ev_death(
emtp->emt_ev_cpl(emtp->emt_context);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_version(
__in efx_nic_t *enp,
__out_ecount_opt(4) uint16_t versionp[4],
@@ -540,7 +543,7 @@ efx_mcdi_version(
uint16_t version[4];
uint32_t build;
efx_mcdi_boot_t status;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI);
@@ -635,19 +638,19 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_do_reboot(
__in efx_nic_t *enp,
__in boolean_t after_assertion)
{
uint8_t payload[MAX(MC_CMD_REBOOT_IN_LEN, MC_CMD_REBOOT_OUT_LEN)];
efx_mcdi_req_t req;
- int rc;
+ efx_rc_t rc;
/*
* We could require the caller to have caused en_mod_flags=0 to
@@ -685,26 +688,26 @@ out:
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_reboot(
__in efx_nic_t *enp)
{
return (efx_mcdi_do_reboot(enp, B_FALSE));
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_exit_assertion_handler(
__in efx_nic_t *enp)
{
return (efx_mcdi_do_reboot(enp, B_TRUE));
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_read_assertion(
__in efx_nic_t *enp)
{
@@ -716,7 +719,7 @@ efx_mcdi_read_assertion(
unsigned int index;
unsigned int ofst;
int retry;
- int rc;
+ efx_rc_t rc;
/*
* Before we attempt to chat to the MC, we should verify that the MC
@@ -795,7 +798,7 @@ out:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -805,7 +808,7 @@ fail1:
* Internal routines for for specific MCDI requests.
*/
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_drv_attach(
__in efx_nic_t *enp,
__in boolean_t attach)
@@ -815,7 +818,7 @@ efx_mcdi_drv_attach(
uint8_t payload[MAX(MC_CMD_DRV_ATTACH_IN_LEN,
MC_CMD_DRV_ATTACH_EXT_OUT_LEN)];
uint32_t flags;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_DRV_ATTACH;
@@ -878,12 +881,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_get_board_cfg(
__in efx_nic_t *enp,
__out_opt uint32_t *board_typep,
@@ -894,7 +897,7 @@ efx_mcdi_get_board_cfg(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_BOARD_CFG_IN_LEN,
MC_CMD_GET_BOARD_CFG_OUT_LENMIN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_BOARD_CFG;
@@ -959,12 +962,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_get_resource_limits(
__in efx_nic_t *enp,
__out_opt uint32_t *nevqp,
@@ -974,7 +977,7 @@ efx_mcdi_get_resource_limits(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_RESOURCE_LIMITS_IN_LEN,
MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS;
@@ -1007,12 +1010,12 @@ efx_mcdi_get_resource_limits(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_get_phy_cfg(
__in efx_nic_t *enp)
{
@@ -1021,7 +1024,7 @@ efx_mcdi_get_phy_cfg(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_PHY_CFG_IN_LEN,
MC_CMD_GET_PHY_CFG_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_PHY_CFG;
@@ -1113,19 +1116,19 @@ efx_mcdi_get_phy_cfg(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_firmware_update_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp)
{
efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
- int rc;
+ efx_rc_t rc;
if (emcop != NULL && emcop->emco_fw_update_supported != NULL) {
if ((rc = emcop->emco_fw_update_supported(enp, supportedp))
@@ -1139,18 +1142,18 @@ efx_mcdi_firmware_update_supported(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_macaddr_change_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp)
{
efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
- int rc;
+ efx_rc_t rc;
if (emcop != NULL && emcop->emco_macaddr_change_supported != NULL) {
if ((rc = emcop->emco_macaddr_change_supported(enp, supportedp))
@@ -1164,7 +1167,32 @@ efx_mcdi_macaddr_change_supported(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+ __checkReturn efx_rc_t
+efx_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+ efx_rc_t rc;
+
+ if (emcop != NULL && emcop->emco_link_control_supported != NULL) {
+ if ((rc = emcop->emco_link_control_supported(enp, supportedp))
+ != 0)
+ goto fail1;
+ } else {
+ /* Earlier devices always supported link control */
+ *supportedp = B_TRUE;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1177,12 +1205,12 @@ fail1:
* where memory BIST tests can be run and not much else can interfere or happen.
* A reboot is required to exit this mode.
*/
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_bist_enable_offline(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(MC_CMD_ENABLE_OFFLINE_BIST_IN_LEN == 0);
EFX_STATIC_ASSERT(MC_CMD_ENABLE_OFFLINE_BIST_OUT_LEN == 0);
@@ -1203,13 +1231,13 @@ efx_mcdi_bist_enable_offline(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type)
@@ -1217,7 +1245,7 @@ efx_mcdi_bist_start(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_START_BIST_IN_LEN,
MC_CMD_START_BIST_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_START_BIST;
@@ -1264,7 +1292,7 @@ efx_mcdi_bist_start(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1273,14 +1301,14 @@ fail1:
/* Enable logging of some events (e.g. link state changes) */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_log_ctrl(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_LOG_CTRL_IN_LEN,
MC_CMD_LOG_CTRL_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_LOG_CTRL;
@@ -1303,7 +1331,7 @@ efx_mcdi_log_ctrl(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1320,7 +1348,7 @@ typedef enum efx_stats_action_e
EFX_STATS_DISABLE,
} efx_stats_action_t;
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_mac_stats(
__in efx_nic_t *enp,
__in_opt efsys_mem_t *esmp,
@@ -1334,7 +1362,7 @@ efx_mcdi_mac_stats(
int enable = (action == EFX_STATS_ENABLE_NOEVENTS);
int events = (action == EFX_STATS_ENABLE_EVENTS);
int disable = (action == EFX_STATS_DISABLE);
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_MAC_STATS;
@@ -1388,16 +1416,16 @@ efx_mcdi_mac_stats(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_mac_stats_clear(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_mac_stats(enp, NULL, EFX_STATS_CLEAR)) != 0)
goto fail1;
@@ -1405,17 +1433,17 @@ efx_mcdi_mac_stats_clear(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_mac_stats_upload(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp)
{
- int rc;
+ efx_rc_t rc;
/*
* The MC DMAs aggregate statistics for our convenience, so we can
@@ -1428,19 +1456,19 @@ efx_mcdi_mac_stats_upload(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_mac_stats_periodic(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__in uint16_t period,
__in boolean_t events)
{
- int rc;
+ efx_rc_t rc;
/*
* The MC DMAs aggregate statistics for our convenience, so we can
@@ -1461,7 +1489,7 @@ efx_mcdi_mac_stats_periodic(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1476,7 +1504,7 @@ fail1:
* function. So if you have 3 vfs on pf 0 the 3 vfs will return (pf=0,vf=0),
* (pf=0,vf=1), (pf=0,vf=2) aand the pf will return (pf=0, vf=0xffff).
*/
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_get_function_info(
__in efx_nic_t *enp,
__out uint32_t *pfp,
@@ -1485,7 +1513,7 @@ efx_mcdi_get_function_info(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_FUNCTION_INFO_IN_LEN,
MC_CMD_GET_FUNCTION_INFO_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_FUNCTION_INFO;
@@ -1515,12 +1543,12 @@ efx_mcdi_get_function_info(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_privilege_mask(
__in efx_nic_t *enp,
__in uint32_t pf,
@@ -1530,7 +1558,7 @@ efx_mcdi_privilege_mask(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_PRIVILEGE_MASK_IN_LEN,
MC_CMD_PRIVILEGE_MASK_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_PRIVILEGE_MASK;
@@ -1562,14 +1590,14 @@ efx_mcdi_privilege_mask(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_set_workaround(
__in efx_nic_t *enp,
__in uint32_t type,
@@ -1579,7 +1607,7 @@ efx_mcdi_set_workaround(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_WORKAROUND_IN_LEN,
MC_CMD_WORKAROUND_EXT_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_WORKAROUND;
@@ -1608,13 +1636,13 @@ efx_mcdi_set_workaround(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_get_workarounds(
__in efx_nic_t *enp,
__out_opt uint32_t *implementedp,
@@ -1622,7 +1650,7 @@ efx_mcdi_get_workarounds(
{
efx_mcdi_req_t req;
uint8_t payload[MC_CMD_GET_WORKAROUNDS_OUT_LEN];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_WORKAROUNDS;
@@ -1650,7 +1678,7 @@ efx_mcdi_get_workarounds(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_mcdi.h b/sys/dev/sfxge/common/efx_mcdi.h
index ea02248..9129e11 100644
--- a/sys/dev/sfxge/common/efx_mcdi.h
+++ b/sys/dev/sfxge/common/efx_mcdi.h
@@ -94,7 +94,7 @@ efx_mcdi_ev_death(
__in efx_nic_t *enp,
__in int rc);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_request_errcode(
__in unsigned int err);
@@ -110,80 +110,85 @@ typedef enum efx_mcdi_boot_e {
EFX_MCDI_BOOT_ROM,
} efx_mcdi_boot_t;
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_version(
__in efx_nic_t *enp,
__out_ecount_opt(4) uint16_t versionp[4],
__out_opt uint32_t *buildp,
__out_opt efx_mcdi_boot_t *statusp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_read_assertion(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_exit_assertion_handler(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_drv_attach(
__in efx_nic_t *enp,
__in boolean_t attach);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_get_board_cfg(
__in efx_nic_t *enp,
__out_opt uint32_t *board_typep,
__out_opt efx_dword_t *capabilitiesp,
__out_ecount_opt(6) uint8_t mac_addrp[6]);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_get_phy_cfg(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_firmware_update_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_macaddr_change_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+efx_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
#if EFSYS_OPT_BIST
#if EFSYS_OPT_HUNTINGTON
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_bist_enable_offline(
__in efx_nic_t *enp);
#endif /* EFSYS_OPT_HUNTINGTON */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type);
#endif /* EFSYS_OPT_BIST */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_get_resource_limits(
__in efx_nic_t *enp,
__out_opt uint32_t *nevqp,
__out_opt uint32_t *nrxqp,
__out_opt uint32_t *ntxqp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_log_ctrl(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_mac_stats_clear(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_mac_stats_upload(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_mac_stats_periodic(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
@@ -192,7 +197,7 @@ efx_mcdi_mac_stats_periodic(
#if EFSYS_OPT_LOOPBACK
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_get_loopback_modes(
__in efx_nic_t *enp);
#endif /* EFSYS_OPT_LOOPBACK */
diff --git a/sys/dev/sfxge/common/efx_mon.c b/sys/dev/sfxge/common/efx_mon.c
index c5b356d..3574e8a 100644
--- a/sys/dev/sfxge/common/efx_mon.c
+++ b/sys/dev/sfxge/common/efx_mon.c
@@ -148,14 +148,14 @@ static efx_mon_ops_t *__efx_mon_ops[] = {
#endif
};
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mon_init(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_mon_t *emp = &(enp->en_mon);
efx_mon_ops_t *emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -205,7 +205,7 @@ fail2:
enp->en_mod_flags &= ~EFX_MOD_MON;
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -303,11 +303,11 @@ efx_mon_stat_name(
#endif /* EFSYS_OPT_NAMES */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mon_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values)
+ __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values)
{
efx_mon_t *emp = &(enp->en_mon);
efx_mon_ops_t *emop = emp->em_emop;
@@ -326,7 +326,7 @@ efx_mon_fini(
{
efx_mon_t *emp = &(enp->en_mon);
efx_mon_ops_t *emop = emp->em_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -337,7 +337,7 @@ efx_mon_fini(
if (emop->emo_reset != NULL) {
rc = emop->emo_reset(enp);
if (rc != 0)
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
}
emp->em_type = EFX_MON_INVALID;
diff --git a/sys/dev/sfxge/common/efx_nic.c b/sys/dev/sfxge/common/efx_nic.c
index b5ad65e..96d0649 100644
--- a/sys/dev/sfxge/common/efx_nic.c
+++ b/sys/dev/sfxge/common/efx_nic.c
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
#include "efx_regs.h"
#include "efx_impl.h"
- __checkReturn int
+ __checkReturn efx_rc_t
efx_family(
__in uint16_t venid,
__in uint16_t devid,
@@ -76,13 +76,11 @@ efx_family(
case EFX_PCI_DEVID_FARMINGDALE:
case EFX_PCI_DEVID_GREENPORT:
- case EFX_PCI_DEVID_HUNTINGTON:
*efp = EFX_FAMILY_HUNTINGTON;
return (0);
case EFX_PCI_DEVID_FARMINGDALE_VF:
case EFX_PCI_DEVID_GREENPORT_VF:
- case EFX_PCI_DEVID_HUNTINGTON_VF:
*efp = EFX_FAMILY_HUNTINGTON;
return (0);
#endif
@@ -100,7 +98,7 @@ efx_family(
* the hardware family by inspecting the hardware. Obviously the caller
* must be damn sure they're really talking to a supported device.
*/
- __checkReturn int
+ __checkReturn efx_rc_t
efx_infer_family(
__in efsys_bar_t *esbp,
__out efx_family_t *efp)
@@ -108,7 +106,7 @@ efx_infer_family(
efx_family_t family;
efx_oword_t oword;
unsigned int portnum;
- int rc;
+ efx_rc_t rc;
EFSYS_BAR_READO(esbp, FR_AZ_CS_DEBUG_REG_OFST, &oword, B_TRUE);
portnum = EFX_OWORD_FIELD(oword, FRF_CZ_CS_PORT_NUM);
@@ -151,7 +149,7 @@ efx_infer_family(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -159,12 +157,12 @@ fail1:
#define EFX_BIU_MAGIC0 0x01234567
#define EFX_BIU_MAGIC1 0xfedcba98
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_biu_test(
__in efx_nic_t *enp)
{
efx_oword_t oword;
- int rc;
+ efx_rc_t rc;
/*
* Write magic values to scratch registers 0 and 1, then
@@ -222,7 +220,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -284,7 +282,7 @@ static efx_nic_ops_t __efx_nic_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_create(
__in efx_family_t family,
__in efsys_identifier_t *esip,
@@ -293,7 +291,7 @@ efx_nic_create(
__deref_out efx_nic_t **enpp)
{
efx_nic_t *enp;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(family, >, EFX_FAMILY_INVALID);
EFSYS_ASSERT3U(family, <, EFX_FAMILY_NTYPES);
@@ -371,17 +369,17 @@ fail2:
EFSYS_KMEM_FREE(esip, sizeof (efx_nic_t), enp);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_probe(
__in efx_nic_t *enp)
{
efx_nic_ops_t *enop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
#if EFSYS_OPT_MCDI
@@ -406,14 +404,14 @@ fail2:
enop->eno_unprobe(enp);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#if EFSYS_OPT_PCIE_TUNE
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_pcie_tune(
__in efx_nic_t *enp,
unsigned int nlanes)
@@ -429,7 +427,7 @@ efx_nic_pcie_tune(
return (ENOTSUP);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_pcie_extended_sync(
__in efx_nic_t *enp)
{
@@ -447,13 +445,13 @@ efx_nic_pcie_extended_sync(
#endif /* EFSYS_OPT_PCIE_TUNE */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_set_drv_limits(
__inout efx_nic_t *enp,
__in efx_drv_limits_t *edlp)
{
efx_nic_ops_t *enop = enp->en_enop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -466,12 +464,12 @@ efx_nic_set_drv_limits(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_get_bar_region(
__in efx_nic_t *enp,
__in efx_nic_region_t region,
@@ -479,7 +477,7 @@ efx_nic_get_bar_region(
__out size_t *sizep)
{
efx_nic_ops_t *enop = enp->en_enop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -500,13 +498,13 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_get_vi_pool(
__in efx_nic_t *enp,
__out uint32_t *evq_countp,
@@ -515,7 +513,7 @@ efx_nic_get_vi_pool(
{
efx_nic_ops_t *enop = enp->en_enop;
efx_nic_cfg_t *encp = &enp->en_nic_cfg;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -540,18 +538,18 @@ efx_nic_get_vi_pool(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_init(
__in efx_nic_t *enp)
{
efx_nic_ops_t *enop = enp->en_enop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -571,7 +569,7 @@ efx_nic_init(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -641,13 +639,13 @@ efx_nic_destroy(
EFSYS_KMEM_FREE(esip, sizeof (efx_nic_t), enp);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_reset(
__in efx_nic_t *enp)
{
efx_nic_ops_t *enop = enp->en_enop;
unsigned int mod_flags;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE);
@@ -678,7 +676,7 @@ efx_nic_reset(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -694,12 +692,12 @@ efx_nic_cfg_get(
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_register_test(
__in efx_nic_t *enp)
{
efx_nic_ops_t *enop = enp->en_enop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -711,12 +709,12 @@ efx_nic_register_test(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_test_registers(
__in efx_nic_t *enp,
__in efx_register_set_t *rsp,
@@ -726,7 +724,7 @@ efx_nic_test_registers(
efx_oword_t original;
efx_oword_t reg;
efx_oword_t buf;
- int rc;
+ efx_rc_t rc;
while (count > 0) {
/* This function is only suitable for registers */
@@ -785,7 +783,7 @@ efx_nic_test_registers(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
/* Restore the old value */
EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE);
@@ -793,7 +791,7 @@ fail1:
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nic_test_tables(
__in efx_nic_t *enp,
__in efx_register_set_t *rsp,
@@ -805,7 +803,7 @@ efx_nic_test_tables(
unsigned int address;
efx_oword_t reg;
efx_oword_t buf;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES);
func = __efx_sram_pattern_fns[pattern];
@@ -844,7 +842,7 @@ efx_nic_test_tables(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -955,7 +953,7 @@ efx_loopback_mask(
*maskp = mask;
}
-__checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_get_loopback_modes(
__in efx_nic_t *enp)
{
@@ -965,7 +963,7 @@ efx_mcdi_get_loopback_modes(
MC_CMD_GET_LOOPBACK_MODES_OUT_LEN)];
efx_qword_t mask;
efx_qword_t modes;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_LOOPBACK_MODES;
@@ -1032,7 +1030,7 @@ efx_mcdi_get_loopback_modes(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_nvram.c b/sys/dev/sfxge/common/efx_nvram.c
index 82bb1d9..4d58f69 100644
--- a/sys/dev/sfxge/common/efx_nvram.c
+++ b/sys/dev/sfxge/common/efx_nvram.c
@@ -93,12 +93,12 @@ static efx_nvram_ops_t __efx_nvram_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_init(
__in efx_nic_t *enp)
{
efx_nvram_ops_t *envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -135,19 +135,19 @@ efx_nvram_init(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_test(
__in efx_nic_t *enp)
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM);
@@ -158,21 +158,21 @@ efx_nvram_test(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_DIAG */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_size(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *sizep)
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM);
@@ -185,12 +185,12 @@ efx_nvram_size(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_get_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -198,7 +198,7 @@ efx_nvram_get_version(
__out_ecount(4) uint16_t version[4])
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -212,19 +212,19 @@ efx_nvram_get_version(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_rw_start(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out_opt size_t *chunk_sizep)
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM);
@@ -242,12 +242,12 @@ efx_nvram_rw_start(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_read_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -256,7 +256,7 @@ efx_nvram_read_chunk(
__in size_t size)
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM);
@@ -272,18 +272,18 @@ efx_nvram_read_chunk(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_erase(
__in efx_nic_t *enp,
__in efx_nvram_type_t type)
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM);
@@ -299,12 +299,12 @@ efx_nvram_erase(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_write_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -313,7 +313,7 @@ efx_nvram_write_chunk(
__in size_t size)
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM);
@@ -329,7 +329,7 @@ efx_nvram_write_chunk(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -354,14 +354,14 @@ efx_nvram_rw_finish(
enp->en_nvram_locked = EFX_NVRAM_INVALID;
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__in_ecount(4) uint16_t version[4])
{
efx_nvram_ops_t *envop = enp->en_envop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -382,7 +382,7 @@ efx_nvram_set_version(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -409,7 +409,7 @@ efx_nvram_fini(
* Internal MCDI request handling
*/
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_partitions(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
@@ -420,7 +420,7 @@ efx_mcdi_nvram_partitions(
uint8_t payload[MAX(MC_CMD_NVRAM_PARTITIONS_IN_LEN,
MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX)];
unsigned int npartn;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_PARTITIONS;
@@ -465,12 +465,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_metadata(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -482,7 +482,7 @@ efx_mcdi_nvram_metadata(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_METADATA_IN_LEN,
MC_CMD_NVRAM_METADATA_OUT_LENMAX)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_METADATA;
@@ -556,30 +556,31 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_info(
__in efx_nic_t *enp,
__in uint32_t partn,
__out_opt size_t *sizep,
__out_opt uint32_t *addressp,
- __out_opt uint32_t *erase_sizep)
+ __out_opt uint32_t *erase_sizep,
+ __out_opt uint32_t *write_sizep)
{
uint8_t payload[MAX(MC_CMD_NVRAM_INFO_IN_LEN,
- MC_CMD_NVRAM_INFO_OUT_LEN)];
+ MC_CMD_NVRAM_INFO_V2_OUT_LEN)];
efx_mcdi_req_t req;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_INFO;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_NVRAM_INFO_IN_LEN;
req.emr_out_buf = payload;
- req.emr_out_length = MC_CMD_NVRAM_INFO_OUT_LEN;
+ req.emr_out_length = MC_CMD_NVRAM_INFO_V2_OUT_LEN;
MCDI_IN_SET_DWORD(req, NVRAM_INFO_IN_TYPE, partn);
@@ -604,17 +605,24 @@ efx_mcdi_nvram_info(
if (erase_sizep)
*erase_sizep = MCDI_OUT_DWORD(req, NVRAM_INFO_OUT_ERASESIZE);
+ if (write_sizep) {
+ *write_sizep =
+ (req.emr_out_length_used <
+ MC_CMD_NVRAM_INFO_V2_OUT_LEN) ?
+ 0 : MCDI_OUT_DWORD(req, NVRAM_INFO_V2_OUT_WRITESIZE);
+ }
+
return (0);
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_update_start(
__in efx_nic_t *enp,
__in uint32_t partn)
@@ -622,7 +630,7 @@ efx_mcdi_nvram_update_start(
uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_START_IN_LEN,
MC_CMD_NVRAM_UPDATE_START_OUT_LEN)];
efx_mcdi_req_t req;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_UPDATE_START;
@@ -643,12 +651,12 @@ efx_mcdi_nvram_update_start(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_read(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -659,7 +667,7 @@ efx_mcdi_nvram_read(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_READ_IN_LEN,
MC_CMD_NVRAM_READ_OUT_LENMAX)];
- int rc;
+ efx_rc_t rc;
if (size > MC_CMD_NVRAM_READ_OUT_LENMAX) {
rc = EINVAL;
@@ -698,12 +706,12 @@ efx_mcdi_nvram_read(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_erase(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -713,7 +721,7 @@ efx_mcdi_nvram_erase(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_ERASE_IN_LEN,
MC_CMD_NVRAM_ERASE_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_ERASE;
@@ -736,12 +744,12 @@ efx_mcdi_nvram_erase(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_write(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -752,7 +760,7 @@ efx_mcdi_nvram_write(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_WRITE_IN_LENMAX,
MC_CMD_NVRAM_WRITE_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
if (size > MC_CMD_NVRAM_WRITE_IN_LENMAX) {
rc = EINVAL;
@@ -785,12 +793,12 @@ efx_mcdi_nvram_write(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_update_finish(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -799,7 +807,7 @@ efx_mcdi_nvram_update_finish(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_IN_LEN,
MC_CMD_NVRAM_UPDATE_FINISH_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_UPDATE_FINISH;
@@ -821,14 +829,14 @@ efx_mcdi_nvram_update_finish(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
efx_mcdi_nvram_test(
__in efx_nic_t *enp,
__in uint32_t partn)
@@ -837,7 +845,7 @@ efx_mcdi_nvram_test(
uint8_t payload[MAX(MC_CMD_NVRAM_TEST_IN_LEN,
MC_CMD_NVRAM_TEST_OUT_LEN)];
int result;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_TEST;
@@ -876,7 +884,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_phy.c b/sys/dev/sfxge/common/efx_phy.c
index 5d18dc7..0742208 100644
--- a/sys/dev/sfxge/common/efx_phy.c
+++ b/sys/dev/sfxge/common/efx_phy.c
@@ -296,14 +296,14 @@ static efx_phy_ops_t __efx_phy_hunt_ops = {
};
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_probe(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_phy_ops_t *epop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -372,7 +372,7 @@ efx_phy_probe(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
epp->ep_port = 0;
epp->ep_phy_type = 0;
@@ -380,7 +380,7 @@ fail1:
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_verify(
__in efx_nic_t *enp)
{
@@ -395,7 +395,7 @@ efx_phy_verify(
#if EFSYS_OPT_PHY_LED_CONTROL
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_led_set(
__in efx_nic_t *enp,
__in efx_phy_led_mode_t mode)
@@ -404,7 +404,7 @@ efx_phy_led_set(
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
uint32_t mask;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -432,7 +432,7 @@ done:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -465,7 +465,7 @@ efx_phy_adv_cap_get(
}
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_adv_cap_set(
__in efx_nic_t *enp,
__in uint32_t mask)
@@ -473,7 +473,7 @@ efx_phy_adv_cap_set(
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
uint32_t old_mask;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -509,7 +509,7 @@ fail2:
}
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -527,7 +527,7 @@ efx_phy_lp_cap_get(
*maskp = epp->ep_lp_cap_mask;
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip)
@@ -627,11 +627,11 @@ efx_phy_stat_name(
#endif /* EFSYS_OPT_NAMES */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_PHY_NSTATS) uint32_t *stat)
+ __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat)
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
@@ -662,7 +662,7 @@ efx_phy_prop_name(
}
#endif /* EFSYS_OPT_NAMES */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -678,7 +678,7 @@ efx_phy_prop_get(
return (epop->epo_prop_get(enp, id, flags, valp));
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -696,13 +696,13 @@ efx_phy_prop_set(
#if EFSYS_OPT_BIST
- __checkReturn int
+ __checkReturn efx_rc_t
efx_bist_enable_offline(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -719,20 +719,20 @@ efx_bist_enable_offline(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type)
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -755,12 +755,12 @@ efx_bist_start(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_bist_poll(
__in efx_nic_t *enp,
__in efx_bist_type_t type,
@@ -771,7 +771,7 @@ efx_bist_poll(
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -794,7 +794,7 @@ efx_bist_poll(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_port.c b/sys/dev/sfxge/common/efx_port.c
index a750c15..e74cfe6 100644
--- a/sys/dev/sfxge/common/efx_port.c
+++ b/sys/dev/sfxge/common/efx_port.c
@@ -36,13 +36,13 @@ __FBSDID("$FreeBSD$");
#include "efx_types.h"
#include "efx_impl.h"
- __checkReturn int
+ __checkReturn efx_rc_t
efx_port_init(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -94,14 +94,14 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
enp->en_mod_flags &= ~EFX_MOD_PORT;
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_port_poll(
__in efx_nic_t *enp,
__out_opt efx_link_mode_t *link_modep)
@@ -109,7 +109,7 @@ efx_port_poll(
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
efx_link_mode_t ignore_link_mode;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -126,14 +126,14 @@ efx_port_poll(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#if EFSYS_OPT_LOOPBACK
- __checkReturn int
+ __checkReturn efx_rc_t
efx_port_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
@@ -142,7 +142,7 @@ efx_port_loopback_set(
efx_port_t *epp = &(enp->en_port);
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -168,7 +168,7 @@ efx_port_loopback_set(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_regs_ef10.h b/sys/dev/sfxge/common/efx_regs_ef10.h
index 8401726..c5ee15d 100644
--- a/sys/dev/sfxge/common/efx_regs_ef10.h
+++ b/sys/dev/sfxge/common/efx_regs_ef10.h
@@ -37,6 +37,13 @@
extern "C" {
#endif
+/**************************************************************************
+ * NOTE: the line below marks the start of the autogenerated section
+ * EF10 registers and descriptors
+ *
+ **************************************************************************
+ */
+
/*
* BIU_HW_REV_ID_REG(32bit):
*
@@ -182,29 +189,6 @@ extern "C" {
#define ERF_DZ_TX_DESC_LWORD_LBN 0
#define ERF_DZ_TX_DESC_LWORD_WIDTH 32
-/*
- * The workaround for bug 35388 requires multiplexing writes through
- * the ERF_DZ_TX_DESC_WPTR address.
- * TX_DESC_UPD: 0ppppppppppp (bit 11 lost)
- * EVQ_RPTR: 1000hhhhhhhh, 1001llllllll (split into high and low bits)
- * EVQ_TMR: 11mmvvvvvvvv (bits 8:13 of value lost)
- */
-#define ER_DD_EVQ_INDIRECT_OFST (ER_DZ_TX_DESC_UPD_REG_OFST + 2 * 4)
-#define ER_DD_EVQ_INDIRECT_STEP ER_DZ_TX_DESC_UPD_REG_STEP
-#define ERF_DD_EVQ_IND_RPTR_FLAGS_LBN 8
-#define ERF_DD_EVQ_IND_RPTR_FLAGS_WIDTH 4
-#define EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH 8
-#define EFE_DD_EVQ_IND_RPTR_FLAGS_LOW 9
-#define ERF_DD_EVQ_IND_RPTR_LBN 0
-#define ERF_DD_EVQ_IND_RPTR_WIDTH 8
-#define ERF_DD_EVQ_IND_TIMER_FLAGS_LBN 10
-#define ERF_DD_EVQ_IND_TIMER_FLAGS_WIDTH 2
-#define EFE_DD_EVQ_IND_TIMER_FLAGS 3
-#define ERF_DD_EVQ_IND_TIMER_MODE_LBN 8
-#define ERF_DD_EVQ_IND_TIMER_MODE_WIDTH 2
-#define ERF_DD_EVQ_IND_TIMER_VAL_LBN 0
-#define ERF_DD_EVQ_IND_TIMER_VAL_WIDTH 8
-
/* ES_DRIVER_EV */
#define ESF_DZ_DRV_CODE_LBN 60
@@ -242,1310 +226,6 @@ extern "C" {
#define ESF_DZ_EV_DATA_WIDTH 60
-/* ES_FF_UMSG_CPU2DL_DESC_FETCH */
-#define ESF_DZ_C2DDF_DSCR_CACHE_RPTR_LBN 208
-#define ESF_DZ_C2DDF_DSCR_CACHE_RPTR_WIDTH 6
-#define ESF_DZ_C2DDF_QID_LBN 160
-#define ESF_DZ_C2DDF_QID_WIDTH 11
-#define ESF_DZ_C2DDF_DSCR_BASE_PAGE_ID_LBN 64
-#define ESF_DZ_C2DDF_DSCR_BASE_PAGE_ID_WIDTH 18
-#define ESF_DZ_C2DDF_DSCR_HW_RPTR_LBN 48
-#define ESF_DZ_C2DDF_DSCR_HW_RPTR_WIDTH 12
-#define ESF_DZ_C2DDF_DSCR_HW_WPTR_LBN 32
-#define ESF_DZ_C2DDF_DSCR_HW_WPTR_WIDTH 12
-#define ESF_DZ_C2DDF_OID_LBN 16
-#define ESF_DZ_C2DDF_OID_WIDTH 12
-#define ESF_DZ_C2DDF_DSCR_SIZE_LBN 13
-#define ESF_DZ_C2DDF_DSCR_SIZE_WIDTH 3
-#define ESE_DZ_C2DDF_DSCR_SIZE_512 7
-#define ESE_DZ_C2DDF_DSCR_SIZE_1K 6
-#define ESE_DZ_C2DDF_DSCR_SIZE_2K 5
-#define ESE_DZ_C2DDF_DSCR_SIZE_4K 4
-#define ESF_DZ_C2DDF_BIU_ARGS_LBN 0
-#define ESF_DZ_C2DDF_BIU_ARGS_WIDTH 13
-
-
-/* ES_FF_UMSG_CPU2DL_DESC_PUSH */
-#define ESF_DZ_C2DDP_DSCR_HW_RPTR_LBN 224
-#define ESF_DZ_C2DDP_DSCR_HW_RPTR_WIDTH 12
-#define ESF_DZ_C2DDP_DESC_DW0_LBN 128
-#define ESF_DZ_C2DDP_DESC_DW0_WIDTH 32
-#define ESF_DZ_C2DDP_DESC_DW1_LBN 160
-#define ESF_DZ_C2DDP_DESC_DW1_WIDTH 32
-#define ESF_DZ_C2DDP_DESC_LBN 128
-#define ESF_DZ_C2DDP_DESC_WIDTH 64
-#define ESF_DZ_C2DDP_QID_LBN 64
-#define ESF_DZ_C2DDP_QID_WIDTH 11
-#define ESF_DZ_C2DDP_DSCR_HW_WPTR_LBN 32
-#define ESF_DZ_C2DDP_DSCR_HW_WPTR_WIDTH 12
-#define ESF_DZ_C2DDP_OID_LBN 16
-#define ESF_DZ_C2DDP_OID_WIDTH 12
-#define ESF_DZ_C2DDP_DSCR_SIZE_LBN 0
-#define ESF_DZ_C2DDP_DSCR_SIZE_WIDTH 3
-#define ESE_DZ_C2DDF_DSCR_SIZE_512 7
-#define ESE_DZ_C2DDF_DSCR_SIZE_1K 6
-#define ESE_DZ_C2DDF_DSCR_SIZE_2K 5
-#define ESE_DZ_C2DDF_DSCR_SIZE_4K 4
-
-
-/* ES_FF_UMSG_CPU2DL_GPRD */
-#define ESF_DZ_C2DG_ENCODED_HOST_ADDR_DW0_LBN 64
-#define ESF_DZ_C2DG_ENCODED_HOST_ADDR_DW0_WIDTH 32
-#define ESF_DZ_C2DG_ENCODED_HOST_ADDR_DW1_LBN 96
-#define ESF_DZ_C2DG_ENCODED_HOST_ADDR_DW1_WIDTH 16
-#define ESF_DZ_C2DG_ENCODED_HOST_ADDR_LBN 64
-#define ESF_DZ_C2DG_ENCODED_HOST_ADDR_WIDTH 48
-#define ESF_DZ_C2DG_SMC_ADDR_LBN 16
-#define ESF_DZ_C2DG_SMC_ADDR_WIDTH 16
-#define ESF_DZ_C2DG_BIU_ARGS_LBN 0
-#define ESF_DZ_C2DG_BIU_ARGS_WIDTH 14
-
-
-/* ES_FF_UMSG_CPU2EV_SOFT */
-#define ESF_DZ_C2ES_TBD_LBN 0
-#define ESF_DZ_C2ES_TBD_WIDTH 1
-
-
-/* ES_FF_UMSG_CPU2EV_TXCMPLT */
-#define ESF_DZ_C2ET_EV_SOFT2_LBN 48
-#define ESF_DZ_C2ET_EV_SOFT2_WIDTH 16
-#define ESF_DZ_C2ET_EV_CODE_LBN 42
-#define ESF_DZ_C2ET_EV_CODE_WIDTH 4
-#define ESF_DZ_C2ET_EV_OVERRIDE_HOLDOFF_LBN 41
-#define ESF_DZ_C2ET_EV_OVERRIDE_HOLDOFF_WIDTH 1
-#define ESF_DZ_C2ET_EV_DROP_EVENT_LBN 40
-#define ESF_DZ_C2ET_EV_DROP_EVENT_WIDTH 1
-#define ESF_DZ_C2ET_EV_CAN_MERGE_LBN 39
-#define ESF_DZ_C2ET_EV_CAN_MERGE_WIDTH 1
-#define ESF_DZ_C2ET_EV_SOFT1_LBN 32
-#define ESF_DZ_C2ET_EV_SOFT1_WIDTH 7
-#define ESF_DZ_C2ET_DSCR_IDX_LBN 16
-#define ESF_DZ_C2ET_DSCR_IDX_WIDTH 16
-#define ESF_DZ_C2ET_EV_QID_LBN 5
-#define ESF_DZ_C2ET_EV_QID_WIDTH 11
-#define ESF_DZ_C2ET_EV_QLABEL_LBN 0
-#define ESF_DZ_C2ET_EV_QLABEL_WIDTH 5
-
-
-/* ES_FF_UMSG_CPU2RXDP_INGR_BUFOP */
-#define ESF_DZ_C2RIB_EV_DISABLE_LBN 191
-#define ESF_DZ_C2RIB_EV_DISABLE_WIDTH 1
-#define ESF_DZ_C2RIB_EV_SOFT_LBN 188
-#define ESF_DZ_C2RIB_EV_SOFT_WIDTH 3
-#define ESF_DZ_C2RIB_EV_DESC_PTR_LBN 176
-#define ESF_DZ_C2RIB_EV_DESC_PTR_WIDTH 12
-#define ESF_DZ_C2RIB_EV_ARG1_LBN 160
-#define ESF_DZ_C2RIB_EV_ARG1_WIDTH 16
-#define ESF_DZ_C2RIB_ENCODED_HOST_ADDR_DW0_LBN 64
-#define ESF_DZ_C2RIB_ENCODED_HOST_ADDR_DW0_WIDTH 32
-#define ESF_DZ_C2RIB_ENCODED_HOST_ADDR_DW1_LBN 96
-#define ESF_DZ_C2RIB_ENCODED_HOST_ADDR_DW1_WIDTH 16
-#define ESF_DZ_C2RIB_ENCODED_HOST_ADDR_LBN 64
-#define ESF_DZ_C2RIB_ENCODED_HOST_ADDR_WIDTH 48
-#define ESF_DZ_C2RIB_BIU_ARGS_LBN 16
-#define ESF_DZ_C2RIB_BIU_ARGS_WIDTH 13
-#define ESF_DZ_C2RIB_EV_QID_LBN 5
-#define ESF_DZ_C2RIB_EV_QID_WIDTH 11
-#define ESF_DZ_C2RIB_EV_QLABEL_LBN 0
-#define ESF_DZ_C2RIB_EV_QLABEL_WIDTH 5
-
-
-/* ES_FF_UMSG_CPU2RXDP_INGR_PDISP */
-#define ESF_DZ_C2RIP_BUF_LEN_LBN 240
-#define ESF_DZ_C2RIP_BUF_LEN_WIDTH 16
-#define ESF_DZ_C2RIP_ENCODED_HOST_ADDR_DW0_LBN 192
-#define ESF_DZ_C2RIP_ENCODED_HOST_ADDR_DW0_WIDTH 32
-#define ESF_DZ_C2RIP_ENCODED_HOST_ADDR_DW1_LBN 224
-#define ESF_DZ_C2RIP_ENCODED_HOST_ADDR_DW1_WIDTH 16
-#define ESF_DZ_C2RIP_ENCODED_HOST_ADDR_LBN 192
-#define ESF_DZ_C2RIP_ENCODED_HOST_ADDR_WIDTH 48
-#define ESF_DZ_C2RIP_EV_DISABLE_LBN 191
-#define ESF_DZ_C2RIP_EV_DISABLE_WIDTH 1
-#define ESF_DZ_C2RIP_EV_SOFT_LBN 188
-#define ESF_DZ_C2RIP_EV_SOFT_WIDTH 3
-#define ESF_DZ_C2RIP_EV_DESC_PTR_LBN 176
-#define ESF_DZ_C2RIP_EV_DESC_PTR_WIDTH 12
-#define ESF_DZ_C2RIP_EV_ARG1_LBN 160
-#define ESF_DZ_C2RIP_EV_ARG1_WIDTH 16
-#define ESF_DZ_C2RIP_UPD_CRC_MODE_LBN 157
-#define ESF_DZ_C2RIP_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_FCOE 4
-#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
-#define ESE_DZ_C2RIP_ISCSI_HDR 2
-#define ESE_DZ_C2RIP_FCOE 1
-#define ESE_DZ_C2RIP_OFF 0
-#define ESF_DZ_C2RIP_BIU_ARGS_LBN 144
-#define ESF_DZ_C2RIP_BIU_ARGS_WIDTH 13
-#define ESF_DZ_C2RIP_EV_QID_LBN 133
-#define ESF_DZ_C2RIP_EV_QID_WIDTH 11
-#define ESF_DZ_C2RIP_EV_QLABEL_LBN 128
-#define ESF_DZ_C2RIP_EV_QLABEL_WIDTH 5
-#define ESF_DZ_C2RIP_PEDIT_DELTA_LBN 104
-#define ESF_DZ_C2RIP_PEDIT_DELTA_WIDTH 8
-#define ESF_DZ_C2RIP_PYLOAD_OFST_LBN 96
-#define ESF_DZ_C2RIP_PYLOAD_OFST_WIDTH 8
-#define ESF_DZ_C2RIP_L4_HDR_OFST_LBN 88
-#define ESF_DZ_C2RIP_L4_HDR_OFST_WIDTH 8
-#define ESF_DZ_C2RIP_L3_HDR_OFST_LBN 80
-#define ESF_DZ_C2RIP_L3_HDR_OFST_WIDTH 8
-#define ESF_DZ_C2RIP_IS_UDP_LBN 69
-#define ESF_DZ_C2RIP_IS_UDP_WIDTH 1
-#define ESF_DZ_C2RIP_IS_TCP_LBN 68
-#define ESF_DZ_C2RIP_IS_TCP_WIDTH 1
-#define ESF_DZ_C2RIP_IS_IPV6_LBN 67
-#define ESF_DZ_C2RIP_IS_IPV6_WIDTH 1
-#define ESF_DZ_C2RIP_IS_IPV4_LBN 66
-#define ESF_DZ_C2RIP_IS_IPV4_WIDTH 1
-#define ESF_DZ_C2RIP_IS_FCOE_LBN 65
-#define ESF_DZ_C2RIP_IS_FCOE_WIDTH 1
-#define ESF_DZ_C2RIP_PARSE_INCOMP_LBN 64
-#define ESF_DZ_C2RIP_PARSE_INCOMP_WIDTH 1
-#define ESF_DZ_C2RIP_FINFO_WRD3_LBN 48
-#define ESF_DZ_C2RIP_FINFO_WRD3_WIDTH 16
-#define ESF_DZ_C2RIP_FINFO_WRD2_LBN 32
-#define ESF_DZ_C2RIP_FINFO_WRD2_WIDTH 16
-#define ESF_DZ_C2RIP_FINFO_WRD1_LBN 16
-#define ESF_DZ_C2RIP_FINFO_WRD1_WIDTH 16
-#define ESF_DZ_C2RIP_FINFO_SRCDST_LBN 0
-#define ESF_DZ_C2RIP_FINFO_SRCDST_WIDTH 16
-
-
-/* ES_FF_UMSG_CPU2RXDP_INGR_SOFT */
-#define ESF_DZ_C2RIS_SOFT3_LBN 48
-#define ESF_DZ_C2RIS_SOFT3_WIDTH 16
-#define ESF_DZ_C2RIS_SOFT2_LBN 32
-#define ESF_DZ_C2RIS_SOFT2_WIDTH 16
-#define ESF_DZ_C2RIS_SOFT1_LBN 16
-#define ESF_DZ_C2RIS_SOFT1_WIDTH 16
-#define ESF_DZ_C2RIS_SOFT0_LBN 0
-#define ESF_DZ_C2RIS_SOFT0_WIDTH 16
-
-
-/* ES_FF_UMSG_CPU2SMC_BUFLKUP */
-#define ESF_DZ_C2SB_PAGE_ID_LBN 16
-#define ESF_DZ_C2SB_PAGE_ID_WIDTH 18
-#define ESF_DZ_C2SB_EXP_PAGE_ID_LBN 0
-#define ESF_DZ_C2SB_EXP_PAGE_ID_WIDTH 12
-
-
-/* ES_FF_UMSG_CPU2SMC_DESCOP */
-#define ESF_DZ_C2SD_LEN_LBN 112
-#define ESF_DZ_C2SD_LEN_WIDTH 14
-#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_DW0_LBN 64
-#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_DW0_WIDTH 32
-#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_DW1_LBN 96
-#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_DW1_WIDTH 16
-#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_LBN 64
-#define ESF_DZ_C2SD_ENCODED_HOST_ADDR_WIDTH 48
-#define ESF_DZ_C2SD_OFFSET_LBN 80
-#define ESF_DZ_C2SD_OFFSET_WIDTH 8
-#define ESF_DZ_C2SD_QID_LBN 32
-#define ESF_DZ_C2SD_QID_WIDTH 11
-#define ESF_DZ_C2SD_CONT_LBN 16
-#define ESF_DZ_C2SD_CONT_WIDTH 1
-#define ESF_DZ_C2SD_TYPE_LBN 0
-#define ESF_DZ_C2SD_TYPE_WIDTH 1
-
-
-/* ES_FF_UMSG_CPU2SMC_GPOP */
-#define ESF_DZ_C2SG_DATA_DW0_LBN 64
-#define ESF_DZ_C2SG_DATA_DW0_WIDTH 32
-#define ESF_DZ_C2SG_DATA_DW1_LBN 96
-#define ESF_DZ_C2SG_DATA_DW1_WIDTH 32
-#define ESF_DZ_C2SG_DATA_LBN 64
-#define ESF_DZ_C2SG_DATA_WIDTH 64
-#define ESF_DZ_C2SG_SOFT_LBN 48
-#define ESF_DZ_C2SG_SOFT_WIDTH 4
-#define ESF_DZ_C2SG_REFLECT_LBN 32
-#define ESF_DZ_C2SG_REFLECT_WIDTH 1
-#define ESF_DZ_C2SG_ADDR_LBN 0
-#define ESF_DZ_C2SG_ADDR_WIDTH 16
-
-
-/* ES_FF_UMSG_CPU2TXDP_DMA_BUFREQ */
-#define ESF_DZ_C2TDB_BUF_LEN_LBN 176
-#define ESF_DZ_C2TDB_BUF_LEN_WIDTH 16
-#define ESF_DZ_C2TDB_ENCODED_HOST_ADDR_DW0_LBN 128
-#define ESF_DZ_C2TDB_ENCODED_HOST_ADDR_DW0_WIDTH 32
-#define ESF_DZ_C2TDB_ENCODED_HOST_ADDR_DW1_LBN 160
-#define ESF_DZ_C2TDB_ENCODED_HOST_ADDR_DW1_WIDTH 16
-#define ESF_DZ_C2TDB_ENCODED_HOST_ADDR_LBN 128
-#define ESF_DZ_C2TDB_ENCODED_HOST_ADDR_WIDTH 48
-#define ESF_DZ_C2TDB_SOFT_LBN 112
-#define ESF_DZ_C2TDB_SOFT_WIDTH 14
-#define ESF_DZ_C2TDB_DESC_IDX_LBN 96
-#define ESF_DZ_C2TDB_DESC_IDX_WIDTH 16
-#define ESF_DZ_C2TDB_UPD_CRC_MODE_LBN 93
-#define ESF_DZ_C2TDB_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_FCOE 4
-#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
-#define ESE_DZ_C2RIP_ISCSI_HDR 2
-#define ESE_DZ_C2RIP_FCOE 1
-#define ESE_DZ_C2RIP_OFF 0
-#define ESF_DZ_C2TDB_BIU_ARGS_LBN 80
-#define ESF_DZ_C2TDB_BIU_ARGS_WIDTH 13
-#define ESF_DZ_C2TDB_CONT_LBN 64
-#define ESF_DZ_C2TDB_CONT_WIDTH 1
-#define ESF_DZ_C2TDB_FINFO_WRD3_LBN 48
-#define ESF_DZ_C2TDB_FINFO_WRD3_WIDTH 16
-#define ESF_DZ_C2TDB_FINFO_WRD2_LBN 32
-#define ESF_DZ_C2TDB_FINFO_WRD2_WIDTH 16
-#define ESF_DZ_C2TDB_FINFO_WRD1_LBN 16
-#define ESF_DZ_C2TDB_FINFO_WRD1_WIDTH 16
-#define ESF_DZ_C2TDB_FINFO_SRCDST_LBN 0
-#define ESF_DZ_C2TDB_FINFO_SRCDST_WIDTH 16
-
-
-/* ES_FF_UMSG_CPU2TXDP_DMA_PKTABORT */
-#define ESF_DZ_C2TDP_SOFT_LBN 48
-#define ESF_DZ_C2TDP_SOFT_WIDTH 14
-#define ESF_DZ_C2TDP_DESC_IDX_LBN 32
-#define ESF_DZ_C2TDP_DESC_IDX_WIDTH 16
-#define ESF_DZ_C2TDP_BIU_ARGS_LBN 16
-#define ESF_DZ_C2TDP_BIU_ARGS_WIDTH 14
-
-
-/* ES_FF_UMSG_CPU2TXDP_DMA_SOFT */
-#define ESF_DZ_C2TDS_SOFT3_LBN 48
-#define ESF_DZ_C2TDS_SOFT3_WIDTH 16
-#define ESF_DZ_C2TDS_SOFT2_LBN 32
-#define ESF_DZ_C2TDS_SOFT2_WIDTH 16
-#define ESF_DZ_C2TDS_SOFT1_LBN 16
-#define ESF_DZ_C2TDS_SOFT1_WIDTH 16
-#define ESF_DZ_C2TDS_SOFT0_LBN 0
-#define ESF_DZ_C2TDS_SOFT0_WIDTH 16
-
-
-/* ES_FF_UMSG_CPU2TXDP_EGR */
-#define ESF_DZ_C2TE_RMON_SOFT_LBN 240
-#define ESF_DZ_C2TE_RMON_SOFT_WIDTH 1
-#define ESF_DZ_C2TE_VLAN_PRIO_LBN 224
-#define ESF_DZ_C2TE_VLAN_PRIO_WIDTH 3
-#define ESF_DZ_C2TE_VLAN_LBN 208
-#define ESF_DZ_C2TE_VLAN_WIDTH 1
-#define ESF_DZ_C2TE_QID_LBN 192
-#define ESF_DZ_C2TE_QID_WIDTH 11
-#define ESF_DZ_C2TE_PEDIT_DELTA_LBN 168
-#define ESF_DZ_C2TE_PEDIT_DELTA_WIDTH 8
-#define ESF_DZ_C2TE_PYLOAD_OFST_LBN 160
-#define ESF_DZ_C2TE_PYLOAD_OFST_WIDTH 8
-#define ESF_DZ_C2TE_L4_HDR_OFST_LBN 152
-#define ESF_DZ_C2TE_L4_HDR_OFST_WIDTH 8
-#define ESF_DZ_C2TE_L3_HDR_OFST_LBN 144
-#define ESF_DZ_C2TE_L3_HDR_OFST_WIDTH 8
-#define ESF_DZ_C2TE_IS_UDP_LBN 133
-#define ESF_DZ_C2TE_IS_UDP_WIDTH 1
-#define ESF_DZ_C2TE_IS_TCP_LBN 132
-#define ESF_DZ_C2TE_IS_TCP_WIDTH 1
-#define ESF_DZ_C2TE_IS_IPV6_LBN 131
-#define ESF_DZ_C2TE_IS_IPV6_WIDTH 1
-#define ESF_DZ_C2TE_IS_IPV4_LBN 130
-#define ESF_DZ_C2TE_IS_IPV4_WIDTH 1
-#define ESF_DZ_C2TE_IS_FCOE_LBN 129
-#define ESF_DZ_C2TE_IS_FCOE_WIDTH 1
-#define ESF_DZ_C2TE_PARSE_INCOMP_LBN 128
-#define ESF_DZ_C2TE_PARSE_INCOMP_WIDTH 1
-#define ESF_DZ_C2TE_UPD_CRC_MODE_LBN 98
-#define ESF_DZ_C2TE_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_FCOE 4
-#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
-#define ESE_DZ_C2RIP_ISCSI_HDR 2
-#define ESE_DZ_C2RIP_FCOE 1
-#define ESE_DZ_C2RIP_OFF 0
-#define ESF_DZ_C2TE_UPD_TCPUDPCSUM_MODE_LBN 97
-#define ESF_DZ_C2TE_UPD_TCPUDPCSUM_MODE_WIDTH 1
-#define ESF_DZ_C2TE_UPD_IPCSUM_MODE_LBN 96
-#define ESF_DZ_C2TE_UPD_IPCSUM_MODE_WIDTH 1
-#define ESF_DZ_C2TE_PKT_LEN_LBN 64
-#define ESF_DZ_C2TE_PKT_LEN_WIDTH 16
-#define ESF_DZ_C2TE_FINFO_WRD3_LBN 48
-#define ESF_DZ_C2TE_FINFO_WRD3_WIDTH 16
-#define ESF_DZ_C2TE_FINFO_WRD2_LBN 32
-#define ESF_DZ_C2TE_FINFO_WRD2_WIDTH 16
-#define ESF_DZ_C2TE_FINFO_WRD1_LBN 16
-#define ESF_DZ_C2TE_FINFO_WRD1_WIDTH 16
-#define ESF_DZ_C2TE_FINFO_SRCDST_LBN 0
-#define ESF_DZ_C2TE_FINFO_SRCDST_WIDTH 16
-
-
-/* ES_FF_UMSG_CPU2TXDP_EGR_SOFT */
-#define ESF_DZ_C2TES_SOFT3_LBN 48
-#define ESF_DZ_C2TES_SOFT3_WIDTH 16
-#define ESF_DZ_C2TES_SOFT2_LBN 32
-#define ESF_DZ_C2TES_SOFT2_WIDTH 16
-#define ESF_DZ_C2TES_SOFT1_LBN 16
-#define ESF_DZ_C2TES_SOFT1_WIDTH 16
-#define ESF_DZ_C2TES_SOFT0_LBN 0
-#define ESF_DZ_C2TES_SOFT0_WIDTH 16
-
-
-/* ES_FF_UMSG_DL2CPU_DESC_FETCH */
-#define ESF_DZ_D2CDF_REFL_DSCR_HW_WPTR_LBN 64
-#define ESF_DZ_D2CDF_REFL_DSCR_HW_WPTR_WIDTH 12
-#define ESF_DZ_D2CDF_FAIL_LBN 48
-#define ESF_DZ_D2CDF_FAIL_WIDTH 1
-#define ESF_DZ_D2CDF_QID_LBN 32
-#define ESF_DZ_D2CDF_QID_WIDTH 11
-#define ESF_DZ_D2CDF_NUM_DESC_LBN 16
-#define ESF_DZ_D2CDF_NUM_DESC_WIDTH 7
-#define ESF_DZ_D2CDF_NEW_DSCR_HW_RPTR_LBN 0
-#define ESF_DZ_D2CDF_NEW_DSCR_HW_RPTR_WIDTH 12
-
-
-/* ES_FF_UMSG_DL2CPU_GPRD */
-#define ESF_DZ_D2CG_BIU_ARGS_LBN 0
-#define ESF_DZ_D2CG_BIU_ARGS_WIDTH 14
-
-
-/* ES_FF_UMSG_DPCPU_PACER_TXQ_D_R_I_REQ */
-#define ESF_DZ_FRM_LEN_LBN 16
-#define ESF_DZ_FRM_LEN_WIDTH 15
-#define ESF_DZ_TXQ_ID_LBN 0
-#define ESF_DZ_TXQ_ID_WIDTH 10
-
-
-/* ES_FF_UMSG_PACER_BKT_TBL_RD_REQ */
-#define ESF_DZ_BKT_ID_LBN 0
-#define ESF_DZ_BKT_ID_WIDTH 10
-
-
-/* ES_FF_UMSG_PACER_BKT_TBL_RD_RSP */
-#define ESF_DZ_DUE_TIME_LBN 80
-#define ESF_DZ_DUE_TIME_WIDTH 16
-#define ESF_DZ_LAST_FILL_TIME_LBN 64
-#define ESF_DZ_LAST_FILL_TIME_WIDTH 16
-#define ESF_DZ_RATE_REC_LBN 48
-#define ESF_DZ_RATE_REC_WIDTH 16
-#define ESF_DZ_RATE_LBN 32
-#define ESF_DZ_RATE_WIDTH 16
-#define ESF_DZ_FILL_LEVEL_LBN 16
-#define ESF_DZ_FILL_LEVEL_WIDTH 16
-#define ESF_DZ_IDLE_LBN 15
-#define ESF_DZ_IDLE_WIDTH 1
-#define ESF_DZ_USED_LBN 14
-#define ESF_DZ_USED_WIDTH 1
-#define ESF_DZ_MAX_FILL_REG_LBN 12
-#define ESF_DZ_MAX_FILL_REG_WIDTH 2
-#define ESF_DZ_BKT_ID_LBN 0
-#define ESF_DZ_BKT_ID_WIDTH 10
-
-
-/* ES_FF_UMSG_PACER_BKT_TBL_WR_REQ */
-#define ESF_DZ_RATE_REC_LBN 48
-#define ESF_DZ_RATE_REC_WIDTH 16
-#define ESF_DZ_RATE_LBN 32
-#define ESF_DZ_RATE_WIDTH 16
-#define ESF_DZ_FILL_LEVEL_LBN 16
-#define ESF_DZ_FILL_LEVEL_WIDTH 16
-#define ESF_DZ_IDLE_LBN 15
-#define ESF_DZ_IDLE_WIDTH 1
-#define ESF_DZ_USED_LBN 14
-#define ESF_DZ_USED_WIDTH 1
-#define ESF_DZ_MAX_FILL_REG_LBN 12
-#define ESF_DZ_MAX_FILL_REG_WIDTH 2
-#define ESF_DZ_BKT_ID_LBN 0
-#define ESF_DZ_BKT_ID_WIDTH 10
-
-
-/* ES_FF_UMSG_PACER_TXQ_TBL_RD_REQ */
-#define ESF_DZ_TXQ_ID_LBN 0
-#define ESF_DZ_TXQ_ID_WIDTH 10
-
-
-/* ES_FF_UMSG_PACER_TXQ_TBL_RD_RSP */
-#define ESF_DZ_MAX_BKT2_LBN 112
-#define ESF_DZ_MAX_BKT2_WIDTH 10
-#define ESF_DZ_MAX_BKT1_LBN 96
-#define ESF_DZ_MAX_BKT1_WIDTH 10
-#define ESF_DZ_MAX_BKT0_LBN 80
-#define ESF_DZ_MAX_BKT0_WIDTH 10
-#define ESF_DZ_MIN_BKT_LBN 64
-#define ESF_DZ_MIN_BKT_WIDTH 10
-#define ESF_DZ_LABEL_LBN 48
-#define ESF_DZ_LABEL_WIDTH 4
-#define ESF_DZ_PQ_FLAGS_LBN 32
-#define ESF_DZ_PQ_FLAGS_WIDTH 3
-#define ESF_DZ_DSBL_LBN 16
-#define ESF_DZ_DSBL_WIDTH 1
-#define ESF_DZ_TXQ_ID_LBN 0
-#define ESF_DZ_TXQ_ID_WIDTH 10
-
-
-/* ES_FF_UMSG_PACER_TXQ_TBL_WR_REQ */
-#define ESF_DZ_MAX_BKT2_LBN 112
-#define ESF_DZ_MAX_BKT2_WIDTH 10
-#define ESF_DZ_MAX_BKT1_LBN 96
-#define ESF_DZ_MAX_BKT1_WIDTH 10
-#define ESF_DZ_MAX_BKT0_LBN 80
-#define ESF_DZ_MAX_BKT0_WIDTH 10
-#define ESF_DZ_MIN_BKT_LBN 64
-#define ESF_DZ_MIN_BKT_WIDTH 10
-#define ESF_DZ_LABEL_LBN 48
-#define ESF_DZ_LABEL_WIDTH 4
-#define ESF_DZ_PQ_FLAGS_LBN 32
-#define ESF_DZ_PQ_FLAGS_WIDTH 3
-#define ESF_DZ_DSBL_LBN 16
-#define ESF_DZ_DSBL_WIDTH 1
-#define ESF_DZ_TXQ_ID_LBN 0
-#define ESF_DZ_TXQ_ID_WIDTH 10
-
-
-/* ES_FF_UMSG_PE */
-#define ESF_DZ_PE_PKT_OFST_LBN 47
-#define ESF_DZ_PE_PKT_OFST_WIDTH 17
-#define ESF_DZ_PE_PEDIT_DELTA_LBN 40
-#define ESF_DZ_PE_PEDIT_DELTA_WIDTH 8
-#define ESF_DZ_PE_PYLOAD_OFST_LBN 32
-#define ESF_DZ_PE_PYLOAD_OFST_WIDTH 8
-#define ESF_DZ_PE_L4_HDR_OFST_LBN 24
-#define ESF_DZ_PE_L4_HDR_OFST_WIDTH 8
-#define ESF_DZ_PE_L3_HDR_OFST_LBN 16
-#define ESF_DZ_PE_L3_HDR_OFST_WIDTH 8
-#define ESF_DZ_PE_HAVE_UDP_HDR_LBN 5
-#define ESF_DZ_PE_HAVE_UDP_HDR_WIDTH 1
-#define ESF_DZ_PE_HAVE_TCP_HDR_LBN 4
-#define ESF_DZ_PE_HAVE_TCP_HDR_WIDTH 1
-#define ESF_DZ_PE_HAVE_IPV6_HDR_LBN 3
-#define ESF_DZ_PE_HAVE_IPV6_HDR_WIDTH 1
-#define ESF_DZ_PE_HAVE_IPV4_HDR_LBN 2
-#define ESF_DZ_PE_HAVE_IPV4_HDR_WIDTH 1
-#define ESF_DZ_PE_HAVE_FCOE_LBN 1
-#define ESF_DZ_PE_HAVE_FCOE_WIDTH 1
-#define ESF_DZ_PE_PARSE_INCOMP_LBN 0
-#define ESF_DZ_PE_PARSE_INCOMP_WIDTH 1
-
-
-/* ES_FF_UMSG_RXDP_EGR2CPU_SOFT */
-#define ESF_DZ_RE2CS_SOFT3_LBN 48
-#define ESF_DZ_RE2CS_SOFT3_WIDTH 16
-#define ESF_DZ_RE2CS_SOFT2_LBN 32
-#define ESF_DZ_RE2CS_SOFT2_WIDTH 16
-#define ESF_DZ_RE2CS_SOFT1_LBN 16
-#define ESF_DZ_RE2CS_SOFT1_WIDTH 16
-#define ESF_DZ_RE2CS_SOFT0_LBN 0
-#define ESF_DZ_RE2CS_SOFT0_WIDTH 16
-
-
-/* ES_FF_UMSG_RXDP_INGR2CPU */
-#define ESF_DZ_RI2C_QUEUE_ID_LBN 224
-#define ESF_DZ_RI2C_QUEUE_ID_WIDTH 11
-#define ESF_DZ_RI2C_LEN_LBN 208
-#define ESF_DZ_RI2C_LEN_WIDTH 16
-#define ESF_DZ_RI2C_L4_CLASS_LBN 205
-#define ESF_DZ_RI2C_L4_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_L3_CLASS_LBN 202
-#define ESF_DZ_RI2C_L3_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_ETHTAG_CLASS_LBN 199
-#define ESF_DZ_RI2C_ETHTAG_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_ETHBASE_CLASS_LBN 196
-#define ESF_DZ_RI2C_ETHBASE_CLASS_WIDTH 3
-#define ESF_DZ_RI2C_MAC_CLASS_LBN 195
-#define ESF_DZ_RI2C_MAC_CLASS_WIDTH 1
-#define ESF_DZ_RI2C_PKT_OFST_LBN 176
-#define ESF_DZ_RI2C_PKT_OFST_WIDTH 16
-#define ESF_DZ_RI2C_PEDIT_DELTA_LBN 168
-#define ESF_DZ_RI2C_PEDIT_DELTA_WIDTH 8
-#define ESF_DZ_RI2C_PYLOAD_OFST_LBN 160
-#define ESF_DZ_RI2C_PYLOAD_OFST_WIDTH 8
-#define ESF_DZ_RI2C_L4_HDR_OFST_LBN 152
-#define ESF_DZ_RI2C_L4_HDR_OFST_WIDTH 8
-#define ESF_DZ_RI2C_L3_HDR_OFST_LBN 144
-#define ESF_DZ_RI2C_L3_HDR_OFST_WIDTH 8
-#define ESF_DZ_RI2C_HAVE_UDP_HDR_LBN 133
-#define ESF_DZ_RI2C_HAVE_UDP_HDR_WIDTH 1
-#define ESF_DZ_RI2C_HAVE_TCP_HDR_LBN 132
-#define ESF_DZ_RI2C_HAVE_TCP_HDR_WIDTH 1
-#define ESF_DZ_RI2C_HAVE_IPV6_HDR_LBN 131
-#define ESF_DZ_RI2C_HAVE_IPV6_HDR_WIDTH 1
-#define ESF_DZ_RI2C_HAVE_IPV4_HDR_LBN 130
-#define ESF_DZ_RI2C_HAVE_IPV4_HDR_WIDTH 1
-#define ESF_DZ_RI2C_HAVE_FCOE_LBN 129
-#define ESF_DZ_RI2C_HAVE_FCOE_WIDTH 1
-#define ESF_DZ_RI2C_PARSE_INCOMP_LBN 128
-#define ESF_DZ_RI2C_PARSE_INCOMP_WIDTH 1
-#define ESF_DZ_RI2C_EFINFO_WRD3_LBN 112
-#define ESF_DZ_RI2C_EFINFO_WRD3_WIDTH 16
-#define ESF_DZ_RI2C_EFINFO_WRD2_LBN 96
-#define ESF_DZ_RI2C_EFINFO_WRD2_WIDTH 16
-#define ESF_DZ_RI2C_EFINFO_WRD1_LBN 80
-#define ESF_DZ_RI2C_EFINFO_WRD1_WIDTH 16
-#define ESF_DZ_RI2C_EFINFO_WRD0_LBN 64
-#define ESF_DZ_RI2C_EFINFO_WRD0_WIDTH 16
-#define ESF_DZ_RI2C_FINFO_WRD3_LBN 48
-#define ESF_DZ_RI2C_FINFO_WRD3_WIDTH 16
-#define ESF_DZ_RI2C_FINFO_WRD2_LBN 32
-#define ESF_DZ_RI2C_FINFO_WRD2_WIDTH 16
-#define ESF_DZ_RI2C_FINFO_WRD1_LBN 16
-#define ESF_DZ_RI2C_FINFO_WRD1_WIDTH 16
-#define ESF_DZ_RI2C_FINFO_SRCDST_LBN 0
-#define ESF_DZ_RI2C_FINFO_SRCDST_WIDTH 16
-
-
-/* ES_FF_UMSG_SMC2CPU_BUFLKUP */
-#define ESF_DZ_S2CB_ENCODED_PAGE_ADDR_DW0_LBN 0
-#define ESF_DZ_S2CB_ENCODED_PAGE_ADDR_DW0_WIDTH 32
-#define ESF_DZ_S2CB_ENCODED_PAGE_ADDR_DW1_LBN 32
-#define ESF_DZ_S2CB_ENCODED_PAGE_ADDR_DW1_WIDTH 16
-#define ESF_DZ_S2CB_ENCODED_PAGE_ADDR_LBN 0
-#define ESF_DZ_S2CB_ENCODED_PAGE_ADDR_WIDTH 48
-#define ESF_DZ_S2CB_FAIL_LBN 32
-#define ESF_DZ_S2CB_FAIL_WIDTH 1
-
-
-/* ES_FF_UMSG_SMC2CPU_DESCRD */
-#define ESF_DZ_S2CD_BUF_LEN_LBN 112
-#define ESF_DZ_S2CD_BUF_LEN_WIDTH 14
-#define ESF_DZ_S2CD_ENCODED_HOST_ADDR_DW0_LBN 64
-#define ESF_DZ_S2CD_ENCODED_HOST_ADDR_DW0_WIDTH 32
-#define ESF_DZ_S2CD_ENCODED_HOST_ADDR_DW1_LBN 96
-#define ESF_DZ_S2CD_ENCODED_HOST_ADDR_DW1_WIDTH 16
-#define ESF_DZ_S2CD_ENCODED_HOST_ADDR_LBN 64
-#define ESF_DZ_S2CD_ENCODED_HOST_ADDR_WIDTH 48
-#define ESF_DZ_S2CD_CONT_LBN 16
-#define ESF_DZ_S2CD_CONT_WIDTH 1
-#define ESF_DZ_S2CD_TYPE_LBN 0
-#define ESF_DZ_S2CD_TYPE_WIDTH 1
-
-
-/* ES_FF_UMSG_SMC2CPU_GPRD */
-#define ESF_DZ_S2CG_DATA_DW0_LBN 64
-#define ESF_DZ_S2CG_DATA_DW0_WIDTH 32
-#define ESF_DZ_S2CG_DATA_DW1_LBN 96
-#define ESF_DZ_S2CG_DATA_DW1_WIDTH 32
-#define ESF_DZ_S2CG_DATA_LBN 64
-#define ESF_DZ_S2CG_DATA_WIDTH 64
-#define ESF_DZ_S2CG_SOFT_LBN 48
-#define ESF_DZ_S2CG_SOFT_WIDTH 4
-#define ESF_DZ_S2CG_FAIL_LBN 32
-#define ESF_DZ_S2CG_FAIL_WIDTH 1
-
-
-/* ES_FF_UMSG_TXDP_DMA2CPU_PKTRDY */
-#define ESF_DZ_TD2CP_L4_CLASS_LBN 250
-#define ESF_DZ_TD2CP_L4_CLASS_WIDTH 3
-#define ESF_DZ_TD2CP_L3_CLASS_LBN 247
-#define ESF_DZ_TD2CP_L3_CLASS_WIDTH 3
-#define ESF_DZ_TD2CP_ETHTAG_CLASS_LBN 244
-#define ESF_DZ_TD2CP_ETHTAG_CLASS_WIDTH 3
-#define ESF_DZ_TD2CP_ETHBASE_CLASS_LBN 241
-#define ESF_DZ_TD2CP_ETHBASE_CLASS_WIDTH 3
-#define ESF_DZ_TD2CP_MAC_CLASS_LBN 240
-#define ESF_DZ_TD2CP_MAC_CLASS_WIDTH 1
-#define ESF_DZ_TD2CP_PCIE_ERR_OR_ABORT_LBN 239
-#define ESF_DZ_TD2CP_PCIE_ERR_OR_ABORT_WIDTH 1
-#define ESF_DZ_TD2CP_PKT_ABORT_LBN 238
-#define ESF_DZ_TD2CP_PKT_ABORT_WIDTH 1
-#define ESF_DZ_TD2CP_SOFT_LBN 224
-#define ESF_DZ_TD2CP_SOFT_WIDTH 14
-#define ESF_DZ_TD2CP_DESC_IDX_LBN 208
-#define ESF_DZ_TD2CP_DESC_IDX_WIDTH 16
-#define ESF_DZ_TD2CP_PKT_LEN_LBN 192
-#define ESF_DZ_TD2CP_PKT_LEN_WIDTH 16
-#define ESF_DZ_TD2CP_PKT_OFFST_OR_FIRST_DESC_IDX_LBN 176
-#define ESF_DZ_TD2CP_PKT_OFFST_OR_FIRST_DESC_IDX_WIDTH 7
-#define ESF_DZ_TD2CP_PEDIT_DELTA_LBN 168
-#define ESF_DZ_TD2CP_PEDIT_DELTA_WIDTH 8
-#define ESF_DZ_TD2CP_PYLOAD_OFST_LBN 160
-#define ESF_DZ_TD2CP_PYLOAD_OFST_WIDTH 8
-#define ESF_DZ_TD2CP_L4_HDR_OFST_LBN 152
-#define ESF_DZ_TD2CP_L4_HDR_OFST_WIDTH 8
-#define ESF_DZ_TD2CP_L3_HDR_OFST_LBN 144
-#define ESF_DZ_TD2CP_L3_HDR_OFST_WIDTH 8
-#define ESF_DZ_TD2CP_IS_UDP_LBN 133
-#define ESF_DZ_TD2CP_IS_UDP_WIDTH 1
-#define ESF_DZ_TD2CP_IS_TCP_LBN 132
-#define ESF_DZ_TD2CP_IS_TCP_WIDTH 1
-#define ESF_DZ_TD2CP_IS_IPV6_LBN 131
-#define ESF_DZ_TD2CP_IS_IPV6_WIDTH 1
-#define ESF_DZ_TD2CP_IS_IPV4_LBN 130
-#define ESF_DZ_TD2CP_IS_IPV4_WIDTH 1
-#define ESF_DZ_TD2CP_IS_FCOE_LBN 129
-#define ESF_DZ_TD2CP_IS_FCOE_WIDTH 1
-#define ESF_DZ_TD2CP_PARSE_INCOMP_LBN 128
-#define ESF_DZ_TD2CP_PARSE_INCOMP_WIDTH 1
-#define ESF_DZ_TD2CP_EFINFO_WRD3_LBN 112
-#define ESF_DZ_TD2CP_EFINFO_WRD3_WIDTH 16
-#define ESF_DZ_TD2CP_EFINFO_WRD2_LBN 96
-#define ESF_DZ_TD2CP_EFINFO_WRD2_WIDTH 16
-#define ESF_DZ_TD2CP_EFINFO_WRD1_LBN 80
-#define ESF_DZ_TD2CP_EFINFO_WRD1_WIDTH 16
-#define ESF_DZ_TD2CP_EFINFO_WRD0_LBN 64
-#define ESF_DZ_TD2CP_EFINFO_WRD0_WIDTH 16
-#define ESF_DZ_TD2CP_FINFO_WRD3_LBN 48
-#define ESF_DZ_TD2CP_FINFO_WRD3_WIDTH 16
-#define ESF_DZ_TD2CP_FINFO_WRD2_LBN 32
-#define ESF_DZ_TD2CP_FINFO_WRD2_WIDTH 16
-#define ESF_DZ_TD2CP_FINFO_WRD1_LBN 16
-#define ESF_DZ_TD2CP_FINFO_WRD1_WIDTH 16
-#define ESF_DZ_TD2CP_FINFO_SRCDST_LBN 0
-#define ESF_DZ_TD2CP_FINFO_SRCDST_WIDTH 16
-
-
-/* ES_FF_UMSG_TXDP_DMA2CPU_SOFT */
-#define ESF_DZ_TD2CS_SOFT3_LBN 48
-#define ESF_DZ_TD2CS_SOFT3_WIDTH 16
-#define ESF_DZ_TD2CS_SOFT2_LBN 32
-#define ESF_DZ_TD2CS_SOFT2_WIDTH 16
-#define ESF_DZ_TD2CS_SOFT1_LBN 16
-#define ESF_DZ_TD2CS_SOFT1_WIDTH 16
-#define ESF_DZ_TD2CS_SOFT0_LBN 0
-#define ESF_DZ_TD2CS_SOFT0_WIDTH 16
-
-
-/* ES_FF_UMSG_TXDP_EGR2CPU_SOFT */
-#define ESF_DZ_TE2CS_SOFT3_LBN 48
-#define ESF_DZ_TE2CS_SOFT3_WIDTH 16
-#define ESF_DZ_TE2CS_SOFT2_LBN 32
-#define ESF_DZ_TE2CS_SOFT2_WIDTH 16
-#define ESF_DZ_TE2CS_SOFT1_LBN 16
-#define ESF_DZ_TE2CS_SOFT1_WIDTH 16
-#define ESF_DZ_TE2CS_SOFT0_LBN 0
-#define ESF_DZ_TE2CS_SOFT0_WIDTH 16
-
-
-/* ES_FF_UMSG_VICTL2CPU */
-#define ESF_DZ_V2C_DESC_WORD3_LBN 112
-#define ESF_DZ_V2C_DESC_WORD3_WIDTH 17
-#define ESF_DZ_V2C_DESC_WORD2_LBN 96
-#define ESF_DZ_V2C_DESC_WORD2_WIDTH 16
-#define ESF_DZ_V2C_DESC_WORD1_LBN 80
-#define ESF_DZ_V2C_DESC_WORD1_WIDTH 16
-#define ESF_DZ_V2C_DESC_WORD0_LBN 64
-#define ESF_DZ_V2C_DESC_WORD0_WIDTH 16
-#define ESF_DZ_V2C_NEW_DSCR_WPTR_LBN 32
-#define ESF_DZ_V2C_NEW_DSCR_WPTR_WIDTH 12
-#define ESF_DZ_V2C_DESC_PUSH_LBN 16
-#define ESF_DZ_V2C_DESC_PUSH_WIDTH 1
-
-
-/* ES_LUE_DB_MATCH_ENTRY */
-#define ESF_DZ_LUE_DSCRMNTR_LBN 140
-#define ESF_DZ_LUE_DSCRMNTR_WIDTH 6
-#define ESF_DZ_LUE_MATCH_VAL_DW0_LBN 44
-#define ESF_DZ_LUE_MATCH_VAL_DW0_WIDTH 32
-#define ESF_DZ_LUE_MATCH_VAL_DW1_LBN 76
-#define ESF_DZ_LUE_MATCH_VAL_DW1_WIDTH 32
-#define ESF_DZ_LUE_MATCH_VAL_DW2_LBN 108
-#define ESF_DZ_LUE_MATCH_VAL_DW2_WIDTH 32
-#define ESF_DZ_LUE_MATCH_VAL_LBN 44
-#define ESF_DZ_LUE_MATCH_VAL_WIDTH 96
-#define ESF_DZ_LUE_ME_SOFT_LBN 35
-#define ESF_DZ_LUE_ME_SOFT_WIDTH 9
-#define ESF_DZ_LUE_TX_MCAST_LBN 33
-#define ESF_DZ_LUE_TX_MCAST_WIDTH 2
-#define ESF_DZ_LUE_TX_DOMAIN_LBN 25
-#define ESF_DZ_LUE_TX_DOMAIN_WIDTH 8
-#define ESF_DZ_LUE_RX_MCAST_LBN 24
-#define ESF_DZ_LUE_RX_MCAST_WIDTH 1
-#define ESE_DZ_LUE_MULTI 1
-#define ESE_DZ_LUE_SINGLE 0
-#define ESF_DZ_LUE_RCPNTR_LBN 0
-#define ESF_DZ_LUE_RCPNTR_WIDTH 24
-
-
-/* ES_LUE_DB_NONMATCH_ENTRY */
-#define ESF_DZ_LUE_DSCRMNTR_LBN 140
-#define ESF_DZ_LUE_DSCRMNTR_WIDTH 6
-#define ESF_DZ_LUE_TERMINAL_LBN 139
-#define ESF_DZ_LUE_TERMINAL_WIDTH 1
-#define ESF_DZ_LUE_LAST_LBN 138
-#define ESF_DZ_LUE_LAST_WIDTH 1
-#define ESF_DZ_LUE_NE_SOFT_LBN 137
-#define ESF_DZ_LUE_NE_SOFT_WIDTH 1
-#define ESF_DZ_LUE_RCPNTR_NUM_LBN 134
-#define ESF_DZ_LUE_RCPNTR_NUM_WIDTH 3
-#define ESF_DZ_LUE_RCPNTR0_LBN 110
-#define ESF_DZ_LUE_RCPNTR0_WIDTH 24
-#define ESF_DZ_LUE_RCPNTR1_LBN 86
-#define ESF_DZ_LUE_RCPNTR1_WIDTH 24
-#define ESF_DZ_LUE_RCPNTR2_LBN 62
-#define ESF_DZ_LUE_RCPNTR2_WIDTH 24
-#define ESF_DZ_LUE_RCPNTR3_LBN 38
-#define ESF_DZ_LUE_RCPNTR3_WIDTH 24
-#define ESF_DZ_LUE_RCPNTR4_LBN 14
-#define ESF_DZ_LUE_RCPNTR4_WIDTH 24
-#define ESF_DZ_LUE_RCPNTR_NE_PTR_LBN 0
-#define ESF_DZ_LUE_RCPNTR_NE_PTR_WIDTH 14
-
-
-/* ES_LUE_MC_DIRECT_REQUEST_MSG */
-#define ESF_DZ_MC2L_DR_PAD_DW0_LBN 22
-#define ESF_DZ_MC2L_DR_PAD_DW0_WIDTH 32
-#define ESF_DZ_MC2L_DR_PAD_DW1_LBN 54
-#define ESF_DZ_MC2L_DR_PAD_DW1_WIDTH 32
-#define ESF_DZ_MC2L_DR_PAD_DW2_LBN 86
-#define ESF_DZ_MC2L_DR_PAD_DW2_WIDTH 32
-#define ESF_DZ_MC2L_DR_PAD_DW3_LBN 118
-#define ESF_DZ_MC2L_DR_PAD_DW3_WIDTH 32
-#define ESF_DZ_MC2L_DR_PAD_DW4_LBN 150
-#define ESF_DZ_MC2L_DR_PAD_DW4_WIDTH 18
-#define ESF_DZ_MC2L_DR_PAD_LBN 22
-#define ESF_DZ_MC2L_DR_PAD_WIDTH 146
-#define ESF_DZ_MC2L_DR_ADDR_LBN 8
-#define ESF_DZ_MC2L_DR_ADDR_WIDTH 14
-#define ESF_DZ_MC2L_DR_THREAD_ID_LBN 5
-#define ESF_DZ_MC2L_DR_THREAD_ID_WIDTH 3
-#define ESF_DZ_MC2L_DR_CLIENT_ID_LBN 2
-#define ESF_DZ_MC2L_DR_CLIENT_ID_WIDTH 3
-#define ESF_DZ_MC2L_DR_OP_LBN 0
-#define ESF_DZ_MC2L_DR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MC_DIRECT_RESPONSE_MSG */
-#define ESF_DZ_L2MC_DR_PAD_LBN 146
-#define ESF_DZ_L2MC_DR_PAD_WIDTH 8
-#define ESF_DZ_L2MC_DR_RCPNT_PTR_LBN 132
-#define ESF_DZ_L2MC_DR_RCPNT_PTR_WIDTH 14
-#define ESF_DZ_L2MC_DR_RCPNT4_LBN 108
-#define ESF_DZ_L2MC_DR_RCPNT4_WIDTH 24
-#define ESF_DZ_L2MC_DR_RCPNT3_LBN 84
-#define ESF_DZ_L2MC_DR_RCPNT3_WIDTH 24
-#define ESF_DZ_L2MC_DR_RCPNT2_LBN 60
-#define ESF_DZ_L2MC_DR_RCPNT2_WIDTH 24
-#define ESF_DZ_L2MC_DR_RCPNT1_LBN 36
-#define ESF_DZ_L2MC_DR_RCPNT1_WIDTH 24
-#define ESF_DZ_L2MC_DR_RCPNT0_LBN 12
-#define ESF_DZ_L2MC_DR_RCPNT0_WIDTH 24
-#define ESF_DZ_L2MC_DR_RCPNT_NUM_LBN 9
-#define ESF_DZ_L2MC_DR_RCPNT_NUM_WIDTH 3
-#define ESF_DZ_L2MC_DR_LAST_LBN 8
-#define ESF_DZ_L2MC_DR_LAST_WIDTH 1
-#define ESF_DZ_L2MC_DR_THREAD_ID_LBN 5
-#define ESF_DZ_L2MC_DR_THREAD_ID_WIDTH 3
-#define ESF_DZ_L2MC_DR_CLIENT_ID_LBN 2
-#define ESF_DZ_L2MC_DR_CLIENT_ID_WIDTH 3
-#define ESF_DZ_L2MC_DR_OP_LBN 0
-#define ESF_DZ_L2MC_DR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MC_GP_RD_REQUEST_MSG */
-#define ESF_DZ_MC2L_GPR_PAD_DW0_LBN 22
-#define ESF_DZ_MC2L_GPR_PAD_DW0_WIDTH 32
-#define ESF_DZ_MC2L_GPR_PAD_DW1_LBN 54
-#define ESF_DZ_MC2L_GPR_PAD_DW1_WIDTH 32
-#define ESF_DZ_MC2L_GPR_PAD_DW2_LBN 86
-#define ESF_DZ_MC2L_GPR_PAD_DW2_WIDTH 32
-#define ESF_DZ_MC2L_GPR_PAD_DW3_LBN 118
-#define ESF_DZ_MC2L_GPR_PAD_DW3_WIDTH 32
-#define ESF_DZ_MC2L_GPR_PAD_DW4_LBN 150
-#define ESF_DZ_MC2L_GPR_PAD_DW4_WIDTH 18
-#define ESF_DZ_MC2L_GPR_PAD_LBN 22
-#define ESF_DZ_MC2L_GPR_PAD_WIDTH 146
-#define ESF_DZ_MC2L_GPR_ADDR_LBN 8
-#define ESF_DZ_MC2L_GPR_ADDR_WIDTH 14
-#define ESF_DZ_MC2L_GPR_THREAD_ID_LBN 5
-#define ESF_DZ_MC2L_GPR_THREAD_ID_WIDTH 3
-#define ESF_DZ_MC2L_GPR_CLIENT_ID_LBN 2
-#define ESF_DZ_MC2L_GPR_CLIENT_ID_WIDTH 3
-#define ESF_DZ_MC2L_GPR_OP_LBN 0
-#define ESF_DZ_MC2L_GPR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MC_GP_RD_RESPONSE_MSG */
-#define ESF_DZ_L2MC_GPR_DATA_DW0_LBN 8
-#define ESF_DZ_L2MC_GPR_DATA_DW0_WIDTH 32
-#define ESF_DZ_L2MC_GPR_DATA_DW1_LBN 40
-#define ESF_DZ_L2MC_GPR_DATA_DW1_WIDTH 32
-#define ESF_DZ_L2MC_GPR_DATA_DW2_LBN 72
-#define ESF_DZ_L2MC_GPR_DATA_DW2_WIDTH 32
-#define ESF_DZ_L2MC_GPR_DATA_DW3_LBN 104
-#define ESF_DZ_L2MC_GPR_DATA_DW3_WIDTH 32
-#define ESF_DZ_L2MC_GPR_DATA_DW4_LBN 136
-#define ESF_DZ_L2MC_GPR_DATA_DW4_WIDTH 18
-#define ESF_DZ_L2MC_GPR_DATA_LBN 8
-#define ESF_DZ_L2MC_GPR_DATA_WIDTH 146
-#define ESF_DZ_L2MC_GPR_THREAD_ID_LBN 5
-#define ESF_DZ_L2MC_GPR_THREAD_ID_WIDTH 3
-#define ESF_DZ_L2MC_GPR_CLIENT_ID_LBN 2
-#define ESF_DZ_L2MC_GPR_CLIENT_ID_WIDTH 3
-#define ESF_DZ_L2MC_GPR_OP_LBN 0
-#define ESF_DZ_L2MC_GPR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MC_GP_WR_REQUEST_MSG */
-#define ESF_DZ_MC2L_GPW_DATA_DW0_LBN 22
-#define ESF_DZ_MC2L_GPW_DATA_DW0_WIDTH 32
-#define ESF_DZ_MC2L_GPW_DATA_DW1_LBN 54
-#define ESF_DZ_MC2L_GPW_DATA_DW1_WIDTH 32
-#define ESF_DZ_MC2L_GPW_DATA_DW2_LBN 86
-#define ESF_DZ_MC2L_GPW_DATA_DW2_WIDTH 32
-#define ESF_DZ_MC2L_GPW_DATA_DW3_LBN 118
-#define ESF_DZ_MC2L_GPW_DATA_DW3_WIDTH 32
-#define ESF_DZ_MC2L_GPW_DATA_DW4_LBN 150
-#define ESF_DZ_MC2L_GPW_DATA_DW4_WIDTH 18
-#define ESF_DZ_MC2L_GPW_DATA_LBN 22
-#define ESF_DZ_MC2L_GPW_DATA_WIDTH 146
-#define ESF_DZ_MC2L_GPW_ADDR_LBN 8
-#define ESF_DZ_MC2L_GPW_ADDR_WIDTH 14
-#define ESF_DZ_MC2L_GPW_THREAD_ID_LBN 5
-#define ESF_DZ_MC2L_GPW_THREAD_ID_WIDTH 3
-#define ESF_DZ_MC2L_GPW_CLIENT_ID_LBN 2
-#define ESF_DZ_MC2L_GPW_CLIENT_ID_WIDTH 3
-#define ESF_DZ_MC2L_GPW_OP_LBN 0
-#define ESF_DZ_MC2L_GPW_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MC_MATCH_REQUEST_MSG */
-#define ESF_DZ_MC2L_MR_PAD_LBN 137
-#define ESF_DZ_MC2L_MR_PAD_WIDTH 31
-#define ESF_DZ_MC2L_MR_HASH2_LBN 124
-#define ESF_DZ_MC2L_MR_HASH2_WIDTH 13
-#define ESF_DZ_MC2L_MR_HASH1_LBN 110
-#define ESF_DZ_MC2L_MR_HASH1_WIDTH 14
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW0_LBN 14
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW0_WIDTH 32
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW1_LBN 46
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW1_WIDTH 32
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW2_LBN 78
-#define ESF_DZ_MC2L_MR_MATCH_BITS_DW2_WIDTH 32
-#define ESF_DZ_MC2L_MR_MATCH_BITS_LBN 14
-#define ESF_DZ_MC2L_MR_MATCH_BITS_WIDTH 96
-#define ESF_DZ_MC2L_MR_DSCRMNTR_LBN 8
-#define ESF_DZ_MC2L_MR_DSCRMNTR_WIDTH 6
-#define ESF_DZ_MC2L_MR_THREAD_ID_LBN 5
-#define ESF_DZ_MC2L_MR_THREAD_ID_WIDTH 3
-#define ESF_DZ_MC2L_MR_CLIENT_ID_LBN 2
-#define ESF_DZ_MC2L_MR_CLIENT_ID_WIDTH 3
-#define ESF_DZ_MC2L_MR_OP_LBN 0
-#define ESF_DZ_MC2L_MR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MC_MATCH_RESPONSE_MSG */
-#define ESF_DZ_L2MC_MR_PAD_DW0_LBN 53
-#define ESF_DZ_L2MC_MR_PAD_DW0_WIDTH 32
-#define ESF_DZ_L2MC_MR_PAD_DW1_LBN 85
-#define ESF_DZ_L2MC_MR_PAD_DW1_WIDTH 32
-#define ESF_DZ_L2MC_MR_PAD_DW2_LBN 117
-#define ESF_DZ_L2MC_MR_PAD_DW2_WIDTH 32
-#define ESF_DZ_L2MC_MR_PAD_DW3_LBN 149
-#define ESF_DZ_L2MC_MR_PAD_DW3_WIDTH 5
-#define ESF_DZ_L2MC_MR_PAD_LBN 53
-#define ESF_DZ_L2MC_MR_PAD_WIDTH 101
-#define ESF_DZ_L2MC_MR_LUE_RCPNT_LBN 29
-#define ESF_DZ_L2MC_MR_LUE_RCPNT_WIDTH 24
-#define ESF_DZ_L2MC_MR_RX_MCAST_LBN 28
-#define ESF_DZ_L2MC_MR_RX_MCAST_WIDTH 1
-#define ESF_DZ_L2MC_MR_TX_DOMAIN_LBN 20
-#define ESF_DZ_L2MC_MR_TX_DOMAIN_WIDTH 8
-#define ESF_DZ_L2MC_MR_TX_MCAST_LBN 18
-#define ESF_DZ_L2MC_MR_TX_MCAST_WIDTH 2
-#define ESF_DZ_L2MC_MR_SOFT_LBN 9
-#define ESF_DZ_L2MC_MR_SOFT_WIDTH 9
-#define ESF_DZ_L2MC_MR_MATCH_LBN 8
-#define ESF_DZ_L2MC_MR_MATCH_WIDTH 1
-#define ESF_DZ_L2MC_MR_THREAD_ID_LBN 5
-#define ESF_DZ_L2MC_MR_THREAD_ID_WIDTH 3
-#define ESF_DZ_L2MC_MR_CLIENT_ID_LBN 2
-#define ESF_DZ_L2MC_MR_CLIENT_ID_WIDTH 3
-#define ESF_DZ_L2MC_MR_OP_LBN 0
-#define ESF_DZ_L2MC_MR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_BASE_REQ */
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW0_LBN 8
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW0_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW1_LBN 40
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW1_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW2_LBN 72
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW2_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW3_LBN 104
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW3_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW4_LBN 136
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_DW4_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_LBN 8
-#define ESF_DZ_LUE_HW_REQ_BASE_REQ_MSG_DATA_WIDTH 160
-#define ESF_DZ_LUE_HW_REQ_BASE_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_REQ_BASE_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_REQ_BASE_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_REQ_BASE_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_REQ_BASE_OP_LBN 0
-#define ESF_DZ_LUE_HW_REQ_BASE_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_BASE_RESP */
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW0_LBN 8
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW0_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW1_LBN 40
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW1_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW2_LBN 72
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW2_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW3_LBN 104
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW3_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW4_LBN 136
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_DW4_WIDTH 18
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_LBN 8
-#define ESF_DZ_LUE_HW_RSP_BASE_RSP_DATA_WIDTH 146
-#define ESF_DZ_LUE_HW_RSP_BASE_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_RSP_BASE_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_RSP_BASE_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_RSP_BASE_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_RSP_BASE_OP_LBN 0
-#define ESF_DZ_LUE_HW_RSP_BASE_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_DIRECT_REQ */
-#define ESF_DZ_LUE_HW_REQ_DIR_ADDR_LBN 8
-#define ESF_DZ_LUE_HW_REQ_DIR_ADDR_WIDTH 14
-#define ESF_DZ_LUE_HW_REQ_DIR_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_REQ_DIR_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_REQ_DIR_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_REQ_DIR_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_REQ_DIR_OP_LBN 0
-#define ESF_DZ_LUE_HW_REQ_DIR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_DIRECT_RESP */
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT_PTR_LBN 132
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT_PTR_WIDTH 14
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT4_LBN 108
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT4_WIDTH 24
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT3_LBN 84
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT3_WIDTH 24
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT2_LBN 60
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT2_WIDTH 24
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT1_LBN 36
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT1_WIDTH 24
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT0_LBN 12
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT0_WIDTH 24
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT_NUM_LBN 9
-#define ESF_DZ_LUE_HW_RSP_DIR_RCPNT_NUM_WIDTH 3
-#define ESF_DZ_LUE_HW_RSP_DIR_LAST_LBN 8
-#define ESF_DZ_LUE_HW_RSP_DIR_LAST_WIDTH 1
-#define ESF_DZ_LUE_HW_RSP_DIR_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_RSP_DIR_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_RSP_DIR_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_RSP_DIR_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_RSP_DIR_OP_LBN 0
-#define ESF_DZ_LUE_HW_RSP_DIR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_GP_RD_REQ */
-#define ESF_DZ_LUE_HW_REQ_GPRD_ADDR_LBN 8
-#define ESF_DZ_LUE_HW_REQ_GPRD_ADDR_WIDTH 14
-#define ESF_DZ_LUE_HW_REQ_GPRD_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_REQ_GPRD_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_REQ_GPRD_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_REQ_GPRD_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_REQ_GPRD_OP_LBN 0
-#define ESF_DZ_LUE_HW_REQ_GPRD_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_GP_RD_RESP */
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW0_LBN 8
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW0_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW1_LBN 40
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW1_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW2_LBN 72
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW2_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW3_LBN 104
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW3_WIDTH 32
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW4_LBN 136
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_DW4_WIDTH 18
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_LBN 8
-#define ESF_DZ_LUE_HW_RSP_GPRD_LUE_DATA_WIDTH 146
-#define ESF_DZ_LUE_HW_RSP_GPRD_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_RSP_GPRD_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_RSP_GPRD_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_RSP_GPRD_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_RSP_GPRD_OP_LBN 0
-#define ESF_DZ_LUE_HW_RSP_GPRD_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_GP_WR_REQ */
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW0_LBN 22
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW0_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW1_LBN 54
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW1_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW2_LBN 86
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW2_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW3_LBN 118
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW3_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW4_LBN 150
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_DW4_WIDTH 18
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_LBN 22
-#define ESF_DZ_LUE_HW_REQ_GPWR_LUE_DATA_WIDTH 146
-#define ESF_DZ_LUE_HW_REQ_GPWR_ADDR_LBN 8
-#define ESF_DZ_LUE_HW_REQ_GPWR_ADDR_WIDTH 14
-#define ESF_DZ_LUE_HW_REQ_GPWR_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_REQ_GPWR_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_REQ_GPWR_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_REQ_GPWR_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_REQ_GPWR_OP_LBN 0
-#define ESF_DZ_LUE_HW_REQ_GPWR_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_MATCH_REQ */
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_REQ_COUNT_LBN 137
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_REQ_COUNT_WIDTH 8
-#define ESF_DZ_LUE_HW_REQ_MATCH_HASH2_LBN 124
-#define ESF_DZ_LUE_HW_REQ_MATCH_HASH2_WIDTH 13
-#define ESF_DZ_LUE_HW_REQ_MATCH_HASH1_LBN 110
-#define ESF_DZ_LUE_HW_REQ_MATCH_HASH1_WIDTH 14
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW0_LBN 14
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW0_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW1_LBN 46
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW1_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW2_LBN 78
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_DW2_WIDTH 32
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_LBN 14
-#define ESF_DZ_LUE_HW_REQ_MATCH_MATCH_BITS_WIDTH 96
-#define ESF_DZ_LUE_HW_REQ_MATCH_DSCRMNTR_LBN 8
-#define ESF_DZ_LUE_HW_REQ_MATCH_DSCRMNTR_WIDTH 6
-#define ESF_DZ_LUE_HW_REQ_MATCH_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_REQ_MATCH_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_REQ_MATCH_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_REQ_MATCH_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_REQ_MATCH_OP_LBN 0
-#define ESF_DZ_LUE_HW_REQ_MATCH_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_MSG_MATCH_RESP */
-#define ESF_DZ_LUE_HW_RSP_MATCH_LUE_RCPNT_LBN 29
-#define ESF_DZ_LUE_HW_RSP_MATCH_LUE_RCPNT_WIDTH 24
-#define ESF_DZ_LUE_HW_RSP_MATCH_RX_MCAST_LBN 28
-#define ESF_DZ_LUE_HW_RSP_MATCH_RX_MCAST_WIDTH 1
-#define ESF_DZ_LUE_HW_RSP_MATCH_TX_DOMAIN_LBN 20
-#define ESF_DZ_LUE_HW_RSP_MATCH_TX_DOMAIN_WIDTH 8
-#define ESF_DZ_LUE_HW_RSP_MATCH_TX_MCAST_LBN 18
-#define ESF_DZ_LUE_HW_RSP_MATCH_TX_MCAST_WIDTH 2
-#define ESF_DZ_LUE_HW_RSP_MATCH_SOFT_LBN 9
-#define ESF_DZ_LUE_HW_RSP_MATCH_SOFT_WIDTH 9
-#define ESF_DZ_LUE_HW_RSP_MATCH_MATCH_LBN 8
-#define ESF_DZ_LUE_HW_RSP_MATCH_MATCH_WIDTH 1
-#define ESF_DZ_LUE_HW_RSP_MATCH_THREAD_ID_LBN 5
-#define ESF_DZ_LUE_HW_RSP_MATCH_THREAD_ID_WIDTH 3
-#define ESF_DZ_LUE_HW_RSP_MATCH_CLIENT_ID_LBN 2
-#define ESF_DZ_LUE_HW_RSP_MATCH_CLIENT_ID_WIDTH 3
-#define ESE_DZ_LUE_MC_ID 7
-#define ESE_DZ_LUE_MATCH_REQ_FIFO_ID 3
-#define ESE_DZ_LUE_TX_DICPU_ID 1
-#define ESE_DZ_LUE_RX_DICPU_ID 0
-#define ESF_DZ_LUE_HW_RSP_MATCH_OP_LBN 0
-#define ESF_DZ_LUE_HW_RSP_MATCH_OP_WIDTH 2
-#define ESE_DZ_LUE_GP_WR 3
-#define ESE_DZ_LUE_GP_RD 2
-#define ESE_DZ_LUE_DIR_REQ 1
-#define ESE_DZ_LUE_MATCH_REQ 0
-
-
-/* ES_LUE_RCPNTR_TYPE */
-#define ESF_DZ_LUE_RXQ_LBN 14
-#define ESF_DZ_LUE_RXQ_WIDTH 10
-#define ESF_DZ_LUE_RSS_INFO_LBN 8
-#define ESF_DZ_LUE_RSS_INFO_WIDTH 6
-#define ESF_DZ_LUE_DEST_LBN 5
-#define ESF_DZ_LUE_DEST_WIDTH 3
-#define ESF_DZ_LUE_SOFT_LBN 0
-#define ESF_DZ_LUE_SOFT_WIDTH 5
-
-
-/* ES_LUE_UMSG_LU2DI_HASH_RESP */
-#define ESF_DZ_L2DHR_LASTREC_ENTRY_STATUS_LBN 50
-#define ESF_DZ_L2DHR_LASTREC_ENTRY_STATUS_WIDTH 1
-#define ESF_DZ_L2DHR_MULTITYPE_STATUS_LBN 50
-#define ESF_DZ_L2DHR_MULTITYPE_STATUS_WIDTH 1
-#define ESF_DZ_L2DHR_LASTREC_STATUS_LBN 49
-#define ESF_DZ_L2DHR_LASTREC_STATUS_WIDTH 1
-#define ESF_DZ_L2DHR_MATCH_STATUS_LBN 48
-#define ESF_DZ_L2DHR_MATCH_STATUS_WIDTH 1
-#define ESF_DZ_L2DHR_HASH_LBN 0
-#define ESF_DZ_L2DHR_HASH_WIDTH 32
-
-
-/* ES_LUE_UMSG_LU2DI_RXLU_MULTI_MATCH_RESP */
-#define ESF_DZ_L2DRMMR_SOFT_LBN 112
-#define ESF_DZ_L2DRMMR_SOFT_WIDTH 9
-#define ESF_DZ_L2DRMMR_RCPNTR_PTR_LBN 96
-#define ESF_DZ_L2DRMMR_RCPNTR_PTR_WIDTH 14
-#define ESF_DZ_L2DRMMR_TX_MCAST_LBN 80
-#define ESF_DZ_L2DRMMR_TX_MCAST_WIDTH 2
-#define ESF_DZ_L2DRMMR_MULTITYPE_STATUS_LBN 67
-#define ESF_DZ_L2DRMMR_MULTITYPE_STATUS_WIDTH 1
-#define ESF_DZ_L2DRMMR_LASTREC_ENTRY_STATUS_LBN 66
-#define ESF_DZ_L2DRMMR_LASTREC_ENTRY_STATUS_WIDTH 1
-#define ESF_DZ_L2DRMMR_LASTREC_STATUS_LBN 65
-#define ESF_DZ_L2DRMMR_LASTREC_STATUS_WIDTH 1
-#define ESF_DZ_L2DRMMR_MATCH_STATUS_LBN 64
-#define ESF_DZ_L2DRMMR_MATCH_STATUS_WIDTH 1
-
-
-/* ES_LUE_UMSG_LU2DI_RXLU_MULTI_RECORD_RESP */
-#define ESF_DZ_L2DRMRR_SOFT_LBN 112
-#define ESF_DZ_L2DRMRR_SOFT_WIDTH 9
-#define ESF_DZ_L2DRMRR_RCPNTR_PTR_LBN 96
-#define ESF_DZ_L2DRMRR_RCPNTR_PTR_WIDTH 14
-#define ESF_DZ_L2DRMRR_RCPNTR_NUM_LBN 80
-#define ESF_DZ_L2DRMRR_RCPNTR_NUM_WIDTH 3
-#define ESF_DZ_L2DRMRR_MULTITYPE_STATUS_LBN 67
-#define ESF_DZ_L2DRMRR_MULTITYPE_STATUS_WIDTH 1
-#define ESF_DZ_L2DRMRR_LASTREC_ENTRY_STATUS_LBN 66
-#define ESF_DZ_L2DRMRR_LASTREC_ENTRY_STATUS_WIDTH 1
-#define ESF_DZ_L2DRMRR_LASTREC_STATUS_LBN 65
-#define ESF_DZ_L2DRMRR_LASTREC_STATUS_WIDTH 1
-#define ESF_DZ_L2DRMRR_MATCH_STATUS_LBN 64
-#define ESF_DZ_L2DRMRR_MATCH_STATUS_WIDTH 1
-#define ESF_DZ_L2DRMRR_RCPNTR_SOFT_LBN 48
-#define ESF_DZ_L2DRMRR_RCPNTR_SOFT_WIDTH 6
-#define ESF_DZ_L2DRMRR_RCPNTR_RSS_INFO_LBN 32
-#define ESF_DZ_L2DRMRR_RCPNTR_RSS_INFO_WIDTH 5
-#define ESF_DZ_L2DRMRR_RCPNTR_RXQ_LBN 16
-#define ESF_DZ_L2DRMRR_RCPNTR_RXQ_WIDTH 10
-#define ESF_DZ_L2DRMRR_HOST_LBN 7
-#define ESF_DZ_L2DRMRR_HOST_WIDTH 1
-#define ESF_DZ_L2DRMRR_MC_LBN 6
-#define ESF_DZ_L2DRMRR_MC_WIDTH 1
-#define ESF_DZ_L2DRMRR_PORT0_MAC_LBN 5
-#define ESF_DZ_L2DRMRR_PORT0_MAC_WIDTH 1
-#define ESF_DZ_L2DRMRR_PORT1_MAC_LBN 4
-#define ESF_DZ_L2DRMRR_PORT1_MAC_WIDTH 1
-
-
-/* ES_LUE_UMSG_LU2DI_RXLU_SINGLE_MATCH_RESP */
-#define ESF_DZ_L2DRSMR_MULTITYPE_STATUS_LBN 67
-#define ESF_DZ_L2DRSMR_MULTITYPE_STATUS_WIDTH 1
-#define ESF_DZ_L2DRSMR_LASTREC_ENTRY_STATUS_LBN 66
-#define ESF_DZ_L2DRSMR_LASTREC_ENTRY_STATUS_WIDTH 1
-#define ESF_DZ_L2DRSMR_LASTREC_STATUS_LBN 65
-#define ESF_DZ_L2DRSMR_LASTREC_STATUS_WIDTH 1
-#define ESF_DZ_L2DRSMR_MATCH_STATUS_LBN 64
-#define ESF_DZ_L2DRSMR_MATCH_STATUS_WIDTH 1
-#define ESF_DZ_L2DRSMR_RCPNTR_SOFT_LBN 48
-#define ESF_DZ_L2DRSMR_RCPNTR_SOFT_WIDTH 6
-#define ESF_DZ_L2DRSMR_RCPNTR_RSS_INFO_LBN 32
-#define ESF_DZ_L2DRSMR_RCPNTR_RSS_INFO_WIDTH 5
-#define ESF_DZ_L2DRSMR_RCPNTR_RXQ_LBN 16
-#define ESF_DZ_L2DRSMR_RCPNTR_RXQ_WIDTH 10
-#define ESF_DZ_L2DRSMR_HOST_LBN 7
-#define ESF_DZ_L2DRSMR_HOST_WIDTH 1
-#define ESF_DZ_L2DRSMR_MC_LBN 6
-#define ESF_DZ_L2DRSMR_MC_WIDTH 1
-#define ESF_DZ_L2DRSMR_PORT0_MAC_LBN 5
-#define ESF_DZ_L2DRSMR_PORT0_MAC_WIDTH 1
-#define ESF_DZ_L2DRSMR_PORT1_MAC_LBN 4
-#define ESF_DZ_L2DRSMR_PORT1_MAC_WIDTH 1
-
-
-/* ES_LUE_UMSG_LU2DI_TXLU_MATCH_RESP */
-#define ESF_DZ_L2DTMR_RCPNTR_SOFT_LBN 112
-#define ESF_DZ_L2DTMR_RCPNTR_SOFT_WIDTH 6
-#define ESF_DZ_L2DTMR_RCPNTR_RSS_INFO_LBN 96
-#define ESF_DZ_L2DTMR_RCPNTR_RSS_INFO_WIDTH 5
-#define ESF_DZ_L2DTMR_RCPNTR__RXQ_LBN 80
-#define ESF_DZ_L2DTMR_RCPNTR__RXQ_WIDTH 10
-#define ESF_DZ_L2DTMR_MULTITYPE_STATUS_LBN 67
-#define ESF_DZ_L2DTMR_MULTITYPE_STATUS_WIDTH 1
-#define ESF_DZ_L2DTMR_LASTREC_ENTRY_STATUS_LBN 66
-#define ESF_DZ_L2DTMR_LASTREC_ENTRY_STATUS_WIDTH 1
-#define ESF_DZ_L2DTMR_LASTREC_STATUS_LBN 65
-#define ESF_DZ_L2DTMR_LASTREC_STATUS_WIDTH 1
-#define ESF_DZ_L2DTMR_MATCH_STATUS_LBN 64
-#define ESF_DZ_L2DTMR_MATCH_STATUS_WIDTH 1
-#define ESF_DZ_L2DTMR_ME_SOFT_LBN 48
-#define ESF_DZ_L2DTMR_ME_SOFT_WIDTH 9
-#define ESF_DZ_L2DTMR_TX_MCAST_LBN 32
-#define ESF_DZ_L2DTMR_TX_MCAST_WIDTH 2
-#define ESF_DZ_L2DTMR_TX_DOMAIN_LBN 16
-#define ESF_DZ_L2DTMR_TX_DOMAIN_WIDTH 8
-#define ESF_DZ_L2DTMR_PORT1_MAC_LBN 6
-#define ESF_DZ_L2DTMR_PORT1_MAC_WIDTH 1
-#define ESF_DZ_L2DTMR_PMEM_LBN 6
-#define ESF_DZ_L2DTMR_PMEM_WIDTH 1
-#define ESF_DZ_L2DTMR_PORT0_MAC_LBN 5
-#define ESF_DZ_L2DTMR_PORT0_MAC_WIDTH 1
-
-
/* ES_MC_EVENT */
#define ESF_DZ_MC_CODE_LBN 60
#define ESF_DZ_MC_CODE_WIDTH 4
@@ -1561,45 +241,6 @@ extern "C" {
#define ESF_DZ_MC_SOFT_WIDTH 58
-/* ES_MC_XGMAC_FLTR_RULE_DEF */
-#define ESF_DZ_MC_XFRC_MODE_LBN 416
-#define ESF_DZ_MC_XFRC_MODE_WIDTH 1
-#define ESE_DZ_MC_XFRC_MODE_LAYERED 1
-#define ESE_DZ_MC_XFRC_MODE_SIMPLE 0
-#define ESF_DZ_MC_XFRC_HASH_LBN 384
-#define ESF_DZ_MC_XFRC_HASH_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW0_LBN 256
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW0_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW1_LBN 288
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW1_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW2_LBN 320
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW2_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW3_LBN 352
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_DW3_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_LBN 256
-#define ESF_DZ_MC_XFRC_LAYER4_BYTE_MASK_WIDTH 128
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW0_LBN 128
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW0_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW1_LBN 160
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW1_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW2_LBN 192
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW2_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW3_LBN 224
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_DW3_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_LBN 128
-#define ESF_DZ_MC_XFRC_LAYER3_BYTE_MASK_WIDTH 128
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW0_LBN 0
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW0_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW1_LBN 32
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW1_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW2_LBN 64
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW2_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW3_LBN 96
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_DW3_WIDTH 32
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_LBN 0
-#define ESF_DZ_MC_XFRC_LAYER2_OR_SIMPLE_BYTE_MASK_WIDTH 128
-
-
/* ES_RX_EVENT */
#define ESF_DZ_RX_CODE_LBN 60
#define ESF_DZ_RX_CODE_WIDTH 4
@@ -1654,10 +295,8 @@ extern "C" {
#define ESE_DZ_MAC_CLASS_UCAST 0
#define ESF_DZ_RX_EV_SOFT1_LBN 32
#define ESF_DZ_RX_EV_SOFT1_WIDTH 3
-#define ESF_DZ_RX_EV_RSVD1_LBN 31
-#define ESF_DZ_RX_EV_RSVD1_WIDTH 1
-#define ESF_DZ_RX_ABORT_LBN 30
-#define ESF_DZ_RX_ABORT_WIDTH 1
+#define ESF_DZ_RX_EV_RSVD1_LBN 30
+#define ESF_DZ_RX_EV_RSVD1_WIDTH 2
#define ESF_DZ_RX_ECC_ERR_LBN 29
#define ESF_DZ_RX_ECC_ERR_WIDTH 1
#define ESF_DZ_RX_CRC1_ERR_LBN 28
@@ -1693,601 +332,6 @@ extern "C" {
#define ESF_DZ_RX_KER_BUF_ADDR_WIDTH 48
-/* ES_RX_USER_DESC */
-#define ESF_DZ_RX_USR_RESERVED_LBN 62
-#define ESF_DZ_RX_USR_RESERVED_WIDTH 2
-#define ESF_DZ_RX_USR_BYTE_CNT_LBN 48
-#define ESF_DZ_RX_USR_BYTE_CNT_WIDTH 14
-#define ESF_DZ_RX_USR_BUF_PAGE_SIZE_LBN 44
-#define ESF_DZ_RX_USR_BUF_PAGE_SIZE_WIDTH 4
-#define ESE_DZ_USR_BUF_PAGE_SZ_4MB 10
-#define ESE_DZ_USR_BUF_PAGE_SZ_1MB 8
-#define ESE_DZ_USR_BUF_PAGE_SZ_64KB 4
-#define ESE_DZ_USR_BUF_PAGE_SZ_4KB 0
-#define ESF_DZ_RX_USR_BUF_ID_OFFSET_DW0_LBN 0
-#define ESF_DZ_RX_USR_BUF_ID_OFFSET_DW0_WIDTH 32
-#define ESF_DZ_RX_USR_BUF_ID_OFFSET_DW1_LBN 32
-#define ESF_DZ_RX_USR_BUF_ID_OFFSET_DW1_WIDTH 12
-#define ESF_DZ_RX_USR_BUF_ID_OFFSET_LBN 0
-#define ESF_DZ_RX_USR_BUF_ID_OFFSET_WIDTH 44
-#define ESF_DZ_RX_USR_4KBPS_BUF_ID_LBN 12
-#define ESF_DZ_RX_USR_4KBPS_BUF_ID_WIDTH 32
-#define ESF_DZ_RX_USR_64KBPS_BUF_ID_LBN 16
-#define ESF_DZ_RX_USR_64KBPS_BUF_ID_WIDTH 28
-#define ESF_DZ_RX_USR_1MBPS_BUF_ID_LBN 20
-#define ESF_DZ_RX_USR_1MBPS_BUF_ID_WIDTH 24
-#define ESF_DZ_RX_USR_4MBPS_BUF_ID_LBN 22
-#define ESF_DZ_RX_USR_4MBPS_BUF_ID_WIDTH 22
-#define ESF_DZ_RX_USR_4MBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_RX_USR_4MBPS_BYTE_OFFSET_WIDTH 22
-#define ESF_DZ_RX_USR_1MBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_RX_USR_1MBPS_BYTE_OFFSET_WIDTH 20
-#define ESF_DZ_RX_USR_64KBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_RX_USR_64KBPS_BYTE_OFFSET_WIDTH 16
-#define ESF_DZ_RX_USR_4KBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_RX_USR_4KBPS_BYTE_OFFSET_WIDTH 12
-
-
-/* ES_RX_U_QSTATE_TBL0_ENTRY */
-#define ESF_DZ_RX_U_DC_FILL_LBN 112
-#define ESF_DZ_RX_U_DC_FILL_WIDTH 7
-#define ESF_DZ_RX_U_SOFT7_B1R1_0_LBN 112
-#define ESF_DZ_RX_U_SOFT7_B1R1_0_WIDTH 7
-#define ESF_DZ_RX_U_DSCR_HW_RPTR_LBN 96
-#define ESF_DZ_RX_U_DSCR_HW_RPTR_WIDTH 12
-#define ESF_DZ_RX_U_SOFT12_B1R2_0_LBN 96
-#define ESF_DZ_RX_U_SOFT12_B1R2_0_WIDTH 12
-#define ESF_DZ_RX_U_DC_RPTR_LBN 80
-#define ESF_DZ_RX_U_DC_RPTR_WIDTH 6
-#define ESF_DZ_RX_U_SOFT6_B1R1_0_LBN 80
-#define ESF_DZ_RX_U_SOFT6_B1R1_0_WIDTH 6
-#define ESF_DZ_RX_U_NOTIFY_PENDING_LBN 70
-#define ESF_DZ_RX_U_NOTIFY_PENDING_WIDTH 1
-#define ESF_DZ_RX_U_SOFT1_B1R0_6_LBN 70
-#define ESF_DZ_RX_U_SOFT1_B1R0_6_WIDTH 1
-#define ESF_DZ_RX_U_DATA_ACTIVE_LBN 69
-#define ESF_DZ_RX_U_DATA_ACTIVE_WIDTH 1
-#define ESF_DZ_RX_U_SOFT1_B1R0_5_LBN 69
-#define ESF_DZ_RX_U_SOFT1_B1R0_5_WIDTH 1
-#define ESF_DZ_RX_U_FAST_PATH_LBN 68
-#define ESF_DZ_RX_U_FAST_PATH_WIDTH 1
-#define ESF_DZ_RX_U_SOFT1_B1R0_4_LBN 68
-#define ESF_DZ_RX_U_SOFT1_B1R0_4_WIDTH 1
-#define ESF_DZ_RX_U_CHAIN_LBN 67
-#define ESF_DZ_RX_U_CHAIN_WIDTH 1
-#define ESF_DZ_RX_U_SOFT1_B1R0_3_LBN 67
-#define ESF_DZ_RX_U_SOFT1_B1R0_3_WIDTH 1
-#define ESF_DZ_RX_U_DESC_ACTIVE_LBN 66
-#define ESF_DZ_RX_U_DESC_ACTIVE_WIDTH 1
-#define ESF_DZ_RX_U_SOFT1_B1R0_2_LBN 66
-#define ESF_DZ_RX_U_SOFT1_B1R0_2_WIDTH 1
-#define ESF_DZ_RX_U_TIMESTAMP_LBN 65
-#define ESF_DZ_RX_U_TIMESTAMP_WIDTH 1
-#define ESF_DZ_RX_U_SOFT1_B1R0_1_LBN 65
-#define ESF_DZ_RX_U_SOFT1_B1R0_1_WIDTH 1
-#define ESF_DZ_RX_U_Q_ENABLE_LBN 64
-#define ESF_DZ_RX_U_Q_ENABLE_WIDTH 1
-#define ESF_DZ_RX_U_SOFT1_B1R0_0_LBN 64
-#define ESF_DZ_RX_U_SOFT1_B1R0_0_WIDTH 1
-#define ESF_DZ_RX_U_UPD_CRC_MODE_LBN 29
-#define ESF_DZ_RX_U_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_MPA 5
-#define ESE_DZ_C2RIP_FCOIP_FCOE 4
-#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
-#define ESE_DZ_C2RIP_ISCSI_HDR 2
-#define ESE_DZ_C2RIP_FCOE 1
-#define ESE_DZ_C2RIP_OFF 0
-#define ESF_DZ_RX_U_SOFT16_B0R1_LBN 16
-#define ESF_DZ_RX_U_SOFT16_B0R1_WIDTH 16
-#define ESF_DZ_RX_U_BIU_ARGS_LBN 16
-#define ESF_DZ_RX_U_BIU_ARGS_WIDTH 13
-#define ESF_DZ_RX_U_EV_QID_LBN 5
-#define ESF_DZ_RX_U_EV_QID_WIDTH 11
-#define ESF_DZ_RX_U_SOFT16_B0R0_LBN 0
-#define ESF_DZ_RX_U_SOFT16_B0R0_WIDTH 16
-#define ESF_DZ_RX_U_EV_QLABEL_LBN 0
-#define ESF_DZ_RX_U_EV_QLABEL_WIDTH 5
-
-
-/* ES_RX_U_QSTATE_TBL1_ENTRY */
-#define ESF_DZ_RX_U_DSCR_BASE_PAGE_ID_LBN 64
-#define ESF_DZ_RX_U_DSCR_BASE_PAGE_ID_WIDTH 18
-#define ESF_DZ_RX_U_SOFT18_B1R0_0_LBN 64
-#define ESF_DZ_RX_U_SOFT18_B1R0_0_WIDTH 18
-#define ESF_DZ_RX_U_QST1_SPARE_LBN 53
-#define ESF_DZ_RX_U_QST1_SPARE_WIDTH 11
-#define ESF_DZ_RX_U_SOFT16_B0R3_0_LBN 48
-#define ESF_DZ_RX_U_SOFT16_B0R3_0_WIDTH 16
-#define ESF_DZ_RX_U_NO_FLUSH_LBN 52
-#define ESF_DZ_RX_U_NO_FLUSH_WIDTH 1
-#define ESF_DZ_RX_U_HDR_SPLIT_LBN 51
-#define ESF_DZ_RX_U_HDR_SPLIT_WIDTH 1
-#define ESF_DZ_RX_U_DOORBELL_ENABLED_LBN 50
-#define ESF_DZ_RX_U_DOORBELL_ENABLED_WIDTH 1
-#define ESF_DZ_RX_U_WORK_PENDING_LBN 49
-#define ESF_DZ_RX_U_WORK_PENDING_WIDTH 1
-#define ESF_DZ_RX_U_ERROR_LBN 48
-#define ESF_DZ_RX_U_ERROR_WIDTH 1
-#define ESF_DZ_RX_U_DSCR_SW_WPTR_LBN 32
-#define ESF_DZ_RX_U_DSCR_SW_WPTR_WIDTH 12
-#define ESF_DZ_RX_U_SOFT12_B0R2_0_LBN 32
-#define ESF_DZ_RX_U_SOFT12_B0R2_0_WIDTH 12
-#define ESF_DZ_RX_U_OWNER_ID_LBN 16
-#define ESF_DZ_RX_U_OWNER_ID_WIDTH 12
-#define ESF_DZ_RX_U_SOFT12_B0R1_0_LBN 16
-#define ESF_DZ_RX_U_SOFT12_B0R1_0_WIDTH 12
-#define ESF_DZ_RX_U_DSCR_SIZE_LBN 0
-#define ESF_DZ_RX_U_DSCR_SIZE_WIDTH 3
-#define ESE_DZ_RX_DSCR_SIZE_512 7
-#define ESE_DZ_RX_DSCR_SIZE_1K 6
-#define ESE_DZ_RX_DSCR_SIZE_2K 5
-#define ESE_DZ_RX_DSCR_SIZE_4K 4
-#define ESF_DZ_RX_U_SOFT3_B0R0_0_LBN 0
-#define ESF_DZ_RX_U_SOFT3_B0R0_0_WIDTH 3
-
-
-/* ES_SGMII_DEV_PTNR_ABILITY_1000BX_MD */
-#define ESF_DZ_SGMII_DPA_NXT_PG_LBN 15
-#define ESF_DZ_SGMII_DPA_NXT_PG_WIDTH 1
-#define ESF_DZ_SGMII_DPA_ACK_LBN 14
-#define ESF_DZ_SGMII_DPA_ACK_WIDTH 1
-#define ESF_DZ_SGMII_DPA_REMOTE_FLT_LBN 12
-#define ESF_DZ_SGMII_DPA_REMOTE_FLT_WIDTH 2
-#define ESE_DZ_SGMII_DPA_RF_AN_ERR 3
-#define ESE_DZ_SGMII_DPA_RF_OFFLINE 2
-#define ESE_DZ_SGMII_DPA_RF_LINK_FAIL 1
-#define ESE_DZ_SGMII_DPA_RF_NONE 0
-#define ESF_DZ_SGMII_DPA_PS_LBN 7
-#define ESF_DZ_SGMII_DPA_PS_WIDTH 2
-#define ESF_DZ_SGMII_DPA_HD_LBN 6
-#define ESF_DZ_SGMII_DPA_HD_WIDTH 1
-#define ESF_DZ_SGMII_DPA_FD_LBN 5
-#define ESF_DZ_SGMII_DPA_FD_WIDTH 1
-
-
-/* ES_SGMII_DEV_PTNR_ABILITY_SGMII_MD */
-#define ESF_DZ_SGMII_DPA_CPR_LINK_STATE_LBN 15
-#define ESF_DZ_SGMII_DPA_CPR_LINK_STATE_WIDTH 1
-#define ESF_DZ_SGMII_DPA_ACK_LBN 14
-#define ESF_DZ_SGMII_DPA_ACK_WIDTH 1
-#define ESF_DZ_SGMII_CPR_BPLX_STS_LBN 12
-#define ESF_DZ_SGMII_CPR_BPLX_STS_WIDTH 1
-#define ESF_DZ_SGMII_DPA_COPPER_SPEED_LBN 10
-#define ESF_DZ_SGMII_DPA_COPPER_SPEED_WIDTH 2
-#define ESE_DZ_SGMII_DPA_CPR_1GBS 2
-#define ESE_DZ_SGMII_DPA_CPR_100MBS 1
-#define ESE_DZ_SGMII_DPA_CPR_10MBS 0
-
-
-/* ES_SMC_BUFTBL_CNTRL_ENTRY */
-#define ESF_DZ_SMC_SW_CNTXT_DW0_LBN 16
-#define ESF_DZ_SMC_SW_CNTXT_DW0_WIDTH 32
-#define ESF_DZ_SMC_SW_CNTXT_DW1_LBN 48
-#define ESF_DZ_SMC_SW_CNTXT_DW1_WIDTH 24
-#define ESF_DZ_SMC_SW_CNTXT_LBN 16
-#define ESF_DZ_SMC_SW_CNTXT_WIDTH 56
-#define ESF_DZ_SMC_PAGE_SIZE_LBN 12
-#define ESF_DZ_SMC_PAGE_SIZE_WIDTH 4
-#define ESF_DZ_SMC_OWNER_ID_LBN 0
-#define ESF_DZ_SMC_OWNER_ID_WIDTH 12
-
-
-/* ES_SMC_BUFTBL_TRANSL_ENTRY */
-#define ESF_DZ_SMC_PAGE_INDEX0_DW0_LBN 36
-#define ESF_DZ_SMC_PAGE_INDEX0_DW0_WIDTH 32
-#define ESF_DZ_SMC_PAGE_INDEX0_DW1_LBN 68
-#define ESF_DZ_SMC_PAGE_INDEX0_DW1_WIDTH 4
-#define ESF_DZ_SMC_PAGE_INDEX0_LBN 36
-#define ESF_DZ_SMC_PAGE_INDEX0_WIDTH 36
-#define ESF_DZ_SMC_PAGE_INDEX1_DW0_LBN 0
-#define ESF_DZ_SMC_PAGE_INDEX1_DW0_WIDTH 32
-#define ESF_DZ_SMC_PAGE_INDEX1_DW1_LBN 32
-#define ESF_DZ_SMC_PAGE_INDEX1_DW1_WIDTH 4
-#define ESF_DZ_SMC_PAGE_INDEX1_LBN 0
-#define ESF_DZ_SMC_PAGE_INDEX1_WIDTH 36
-
-
-/* ES_SMC_DSCR_CACHE_ENTRY */
-#define ESF_DZ_SMC_BTE_PAD_LBN 64
-#define ESF_DZ_SMC_BTE_PAD_WIDTH 8
-#define ESF_DZ_SMC_DSCR_DW0_LBN 0
-#define ESF_DZ_SMC_DSCR_DW0_WIDTH 32
-#define ESF_DZ_SMC_DSCR_DW1_LBN 32
-#define ESF_DZ_SMC_DSCR_DW1_WIDTH 32
-#define ESF_DZ_SMC_DSCR_LBN 0
-#define ESF_DZ_SMC_DSCR_WIDTH 64
-
-
-/* ES_SMC_GEN_STORAGE_ENTRY */
-#define ESF_DZ_SMC_DATA_DW0_LBN 0
-#define ESF_DZ_SMC_DATA_DW0_WIDTH 32
-#define ESF_DZ_SMC_DATA_DW1_LBN 32
-#define ESF_DZ_SMC_DATA_DW1_WIDTH 32
-#define ESF_DZ_SMC_DATA_DW2_LBN 64
-#define ESF_DZ_SMC_DATA_DW2_WIDTH 8
-#define ESF_DZ_SMC_DATA_LBN 0
-#define ESF_DZ_SMC_DATA_WIDTH 72
-
-
-/* ES_SMC_MSG_BASE_REQ */
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_DW0_LBN 11
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_DW0_WIDTH 32
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_DW1_LBN 43
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_DW1_WIDTH 32
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_DW2_LBN 75
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_DW2_WIDTH 26
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_LBN 11
-#define ESF_DZ_MC2S_BASE_REQ_MSG_DATA_WIDTH 90
-#define ESF_DZ_MC2S_BASE_SOFT_LBN 7
-#define ESF_DZ_MC2S_BASE_SOFT_WIDTH 4
-#define ESF_DZ_MC2S_BASE_CLIENT_ID_LBN 3
-#define ESF_DZ_MC2S_BASE_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_MC2S_BASE_OP_LBN 0
-#define ESF_DZ_MC2S_BASE_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_RESP_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_RESP_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_RESP_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_RESP_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-#define ESE_DZ_SMC_RESP_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_BUFTBL_LOOKUP_REQ */
-#define ESF_DZ_MC2S_BL_BUF_ID_LBN 28
-#define ESF_DZ_MC2S_BL_BUF_ID_WIDTH 18
-#define ESF_DZ_MC2S_BL_EXP_PAGE_SIZE_LBN 24
-#define ESF_DZ_MC2S_BL_EXP_PAGE_SIZE_WIDTH 4
-#define ESE_DZ_SMC_PAGE_SIZE_4M 10
-#define ESE_DZ_SMC_PAGE_SIZE_1M 8
-#define ESE_DZ_SMC_PAGE_SIZE_64K 4
-#define ESE_DZ_SMC_PAGE_SIZE_4K 0
-#define ESF_DZ_MC2S_BL_EXP_OWNER_ID_LBN 12
-#define ESF_DZ_MC2S_BL_EXP_OWNER_ID_WIDTH 12
-#define ESF_DZ_MC2S_BL_REFLECT_LBN 11
-#define ESF_DZ_MC2S_BL_REFLECT_WIDTH 1
-#define ESF_DZ_MC2S_BL_SOFT_LBN 7
-#define ESF_DZ_MC2S_BL_SOFT_WIDTH 4
-#define ESF_DZ_MC2S_BL_CLIENT_ID_LBN 3
-#define ESF_DZ_MC2S_BL_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_MC2S_BL_OP_LBN 0
-#define ESF_DZ_MC2S_BL_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_BUFTBL_LOOKUP_RESP */
-#define ESF_DZ_S2MC_BL_BUFTBL_ENTRY_DW0_LBN 12
-#define ESF_DZ_S2MC_BL_BUFTBL_ENTRY_DW0_WIDTH 32
-#define ESF_DZ_S2MC_BL_BUFTBL_ENTRY_DW1_LBN 44
-#define ESF_DZ_S2MC_BL_BUFTBL_ENTRY_DW1_WIDTH 4
-#define ESF_DZ_S2MC_BL_BUFTBL_ENTRY_LBN 12
-#define ESF_DZ_S2MC_BL_BUFTBL_ENTRY_WIDTH 36
-#define ESF_DZ_S2MC_BL_FAIL_LBN 11
-#define ESF_DZ_S2MC_BL_FAIL_WIDTH 1
-#define ESF_DZ_S2MC_BL_SOFT_LBN 7
-#define ESF_DZ_S2MC_BL_SOFT_WIDTH 4
-#define ESF_DZ_S2MC_BL_CLIENT_ID_LBN 3
-#define ESF_DZ_S2MC_BL_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_S2MC_BL_OP_LBN 0
-#define ESF_DZ_S2MC_BL_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_DSCR_RD_REQ */
-#define ESF_DZ_MC2S_DR_DSCR_OFST_LBN 24
-#define ESF_DZ_MC2S_DR_DSCR_OFST_WIDTH 6
-#define ESF_DZ_MC2S_DR_QID_LBN 13
-#define ESF_DZ_MC2S_DR_QID_WIDTH 11
-#define ESF_DZ_MC2S_DR_IS_TX_LBN 12
-#define ESF_DZ_MC2S_DR_IS_TX_WIDTH 1
-#define ESF_DZ_MC2S_DR_REFLECT_LBN 11
-#define ESF_DZ_MC2S_DR_REFLECT_WIDTH 1
-#define ESF_DZ_MC2S_DR_SOFT_LBN 7
-#define ESF_DZ_MC2S_DR_SOFT_WIDTH 4
-#define ESF_DZ_MC2S_DR_CLIENT_ID_LBN 3
-#define ESF_DZ_MC2S_DR_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_MC2S_DR_OP_LBN 0
-#define ESF_DZ_MC2S_DR_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_DSCR_RD_RESP */
-#define ESF_DZ_S2MC_DR_DSCR_DW0_LBN 12
-#define ESF_DZ_S2MC_DR_DSCR_DW0_WIDTH 32
-#define ESF_DZ_S2MC_DR_DSCR_DW1_LBN 44
-#define ESF_DZ_S2MC_DR_DSCR_DW1_WIDTH 32
-#define ESF_DZ_S2MC_DR_DSCR_LBN 12
-#define ESF_DZ_S2MC_DR_DSCR_WIDTH 64
-#define ESF_DZ_S2MC_DR_FAIL_LBN 11
-#define ESF_DZ_S2MC_DR_FAIL_WIDTH 1
-#define ESF_DZ_S2MC_DR_SOFT_LBN 7
-#define ESF_DZ_S2MC_DR_SOFT_WIDTH 4
-#define ESF_DZ_S2MC_DR_CLIENT_ID_LBN 3
-#define ESF_DZ_S2MC_DR_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_S2MC_DR_OP_LBN 0
-#define ESF_DZ_S2MC_DR_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_DSCR_WR_REQ */
-#define ESF_DZ_MC2S_DW_DSCR_DW0_LBN 30
-#define ESF_DZ_MC2S_DW_DSCR_DW0_WIDTH 32
-#define ESF_DZ_MC2S_DW_DSCR_DW1_LBN 62
-#define ESF_DZ_MC2S_DW_DSCR_DW1_WIDTH 32
-#define ESF_DZ_MC2S_DW_DSCR_LBN 30
-#define ESF_DZ_MC2S_DW_DSCR_WIDTH 64
-#define ESF_DZ_MC2S_DW_DSCR_OFST_LBN 24
-#define ESF_DZ_MC2S_DW_DSCR_OFST_WIDTH 6
-#define ESF_DZ_MC2S_DW_QID_LBN 13
-#define ESF_DZ_MC2S_DW_QID_WIDTH 11
-#define ESF_DZ_MC2S_DW_IS_TX_LBN 12
-#define ESF_DZ_MC2S_DW_IS_TX_WIDTH 1
-#define ESF_DZ_MC2S_DW_REFLECT_LBN 11
-#define ESF_DZ_MC2S_DW_REFLECT_WIDTH 1
-#define ESF_DZ_MC2S_DW_SOFT_LBN 7
-#define ESF_DZ_MC2S_DW_SOFT_WIDTH 4
-#define ESF_DZ_MC2S_DW_CLIENT_ID_LBN 3
-#define ESF_DZ_MC2S_DW_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_MC2S_DW_OP_LBN 0
-#define ESF_DZ_MC2S_DW_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_DSCR_WR_RESP */
-#define ESF_DZ_S2MC_DW_FAIL_LBN 11
-#define ESF_DZ_S2MC_DW_FAIL_WIDTH 1
-#define ESF_DZ_S2MC_DW_SOFT_LBN 7
-#define ESF_DZ_S2MC_DW_SOFT_WIDTH 4
-#define ESF_DZ_S2MC_DW_CLIENT_ID_LBN 3
-#define ESF_DZ_S2MC_DW_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_S2MC_DW_OP_LBN 0
-#define ESF_DZ_S2MC_DW_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_RD_REQ */
-#define ESF_DZ_MC2S_RD_ADDR_LBN 12
-#define ESF_DZ_MC2S_RD_ADDR_WIDTH 17
-#define ESF_DZ_MC2S_RD_REFLECT_LBN 11
-#define ESF_DZ_MC2S_RD_REFLECT_WIDTH 1
-#define ESF_DZ_MC2S_RD_SOFT_LBN 7
-#define ESF_DZ_MC2S_RD_SOFT_WIDTH 4
-#define ESF_DZ_MC2S_RD_CLIENT_ID_LBN 3
-#define ESF_DZ_MC2S_RD_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_MC2S_RD_OP_LBN 0
-#define ESF_DZ_MC2S_RD_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_RD_RESP */
-#define ESF_DZ_S2MC_RD_DATA_DW0_LBN 12
-#define ESF_DZ_S2MC_RD_DATA_DW0_WIDTH 32
-#define ESF_DZ_S2MC_RD_DATA_DW1_LBN 44
-#define ESF_DZ_S2MC_RD_DATA_DW1_WIDTH 32
-#define ESF_DZ_S2MC_RD_DATA_DW2_LBN 76
-#define ESF_DZ_S2MC_RD_DATA_DW2_WIDTH 8
-#define ESF_DZ_S2MC_RD_DATA_LBN 12
-#define ESF_DZ_S2MC_RD_DATA_WIDTH 72
-#define ESF_DZ_S2MC_RD_FAIL_LBN 11
-#define ESF_DZ_S2MC_RD_FAIL_WIDTH 1
-#define ESF_DZ_S2MC_RD_SOFT_LBN 7
-#define ESF_DZ_S2MC_RD_SOFT_WIDTH 4
-#define ESF_DZ_S2MC_RD_CLIENT_ID_LBN 3
-#define ESF_DZ_S2MC_RD_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_S2MC_RD_OP_LBN 0
-#define ESF_DZ_S2MC_RD_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_RESP */
-#define ESF_DZ_S2MC_BASE_RSP_DATA_DW0_LBN 12
-#define ESF_DZ_S2MC_BASE_RSP_DATA_DW0_WIDTH 32
-#define ESF_DZ_S2MC_BASE_RSP_DATA_DW1_LBN 44
-#define ESF_DZ_S2MC_BASE_RSP_DATA_DW1_WIDTH 32
-#define ESF_DZ_S2MC_BASE_RSP_DATA_DW2_LBN 76
-#define ESF_DZ_S2MC_BASE_RSP_DATA_DW2_WIDTH 8
-#define ESF_DZ_S2MC_BASE_RSP_DATA_LBN 12
-#define ESF_DZ_S2MC_BASE_RSP_DATA_WIDTH 72
-#define ESF_DZ_S2MC_BASE_FAIL_LBN 11
-#define ESF_DZ_S2MC_BASE_FAIL_WIDTH 1
-#define ESF_DZ_S2MC_BASE_SOFT_LBN 7
-#define ESF_DZ_S2MC_BASE_SOFT_WIDTH 4
-#define ESF_DZ_S2MC_BASE_CLIENT_ID_LBN 3
-#define ESF_DZ_S2MC_BASE_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_S2MC_BASE_OP_LBN 0
-#define ESF_DZ_S2MC_BASE_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_WR_REQ */
-#define ESF_DZ_MC2S_WR_DATA_DW0_LBN 29
-#define ESF_DZ_MC2S_WR_DATA_DW0_WIDTH 32
-#define ESF_DZ_MC2S_WR_DATA_DW1_LBN 61
-#define ESF_DZ_MC2S_WR_DATA_DW1_WIDTH 32
-#define ESF_DZ_MC2S_WR_DATA_DW2_LBN 93
-#define ESF_DZ_MC2S_WR_DATA_DW2_WIDTH 8
-#define ESF_DZ_MC2S_WR_DATA_LBN 29
-#define ESF_DZ_MC2S_WR_DATA_WIDTH 72
-#define ESF_DZ_MC2S_WR_ADDR_LBN 12
-#define ESF_DZ_MC2S_WR_ADDR_WIDTH 17
-#define ESF_DZ_MC2S_WR_REFLECT_LBN 11
-#define ESF_DZ_MC2S_WR_REFLECT_WIDTH 1
-#define ESF_DZ_MC2S_WR_SOFT_LBN 7
-#define ESF_DZ_MC2S_WR_SOFT_WIDTH 4
-#define ESF_DZ_MC2S_WR_CLIENT_ID_LBN 3
-#define ESF_DZ_MC2S_WR_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_MC2S_WR_OP_LBN 0
-#define ESF_DZ_MC2S_WR_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
-/* ES_SMC_MSG_WR_RESP */
-#define ESF_DZ_S2MC_WR_FAIL_LBN 11
-#define ESF_DZ_S2MC_WR_FAIL_WIDTH 1
-#define ESF_DZ_S2MC_WR_SOFT_LBN 7
-#define ESF_DZ_S2MC_WR_SOFT_WIDTH 4
-#define ESF_DZ_S2MC_WR_CLIENT_ID_LBN 3
-#define ESF_DZ_S2MC_WR_CLIENT_ID_WIDTH 4
-#define ESE_DZ_SMC_MACRO_ENGINE_ID 15
-#define ESE_DZ_SMC_TX_DICPU_ID 14
-#define ESE_DZ_SMC_RX_DICPU_ID 13
-#define ESE_DZ_SMC_MC_ID 12
-#define ESE_DZ_SMC_DL_ID 10
-#define ESE_DZ_SMC_EV_ID 8
-#define ESE_DZ_SMC_TX_DPCPU1_ID 5
-#define ESE_DZ_SMC_TX_DPCPU0_ID 4
-#define ESE_DZ_SMC_RX_DPCPU_ID 0
-#define ESF_DZ_S2MC_WR_OP_LBN 0
-#define ESF_DZ_S2MC_WR_OP_WIDTH 3
-#define ESE_DZ_SMC_REQ_WR 4
-#define ESE_DZ_SMC_REQ_RD 3
-#define ESE_DZ_SMC_REQ_DSCR_WRITE 2
-#define ESE_DZ_SMC_REQ_DSCR_READ 1
-#define ESE_DZ_SMC_REQ_BUFTBL_LOOKUP 0
-
-
/* ES_TX_CSUM_TSTAMP_DESC */
#define ESF_DZ_TX_DESC_IS_OPT_LBN 63
#define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1
@@ -2296,6 +340,12 @@ extern "C" {
#define ESE_DZ_TX_OPTION_DESC_TSO 7
#define ESE_DZ_TX_OPTION_DESC_VLAN 6
#define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0
+#define ESF_DZ_TX_OPTION_TS_AT_TXDP_LBN 8
+#define ESF_DZ_TX_OPTION_TS_AT_TXDP_WIDTH 1
+#define ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM_LBN 7
+#define ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM_WIDTH 1
+#define ESF_DZ_TX_OPTION_INNER_IP_CSUM_LBN 6
+#define ESF_DZ_TX_OPTION_INNER_IP_CSUM_WIDTH 1
#define ESF_DZ_TX_TIMESTAMP_LBN 5
#define ESF_DZ_TX_TIMESTAMP_WIDTH 1
#define ESF_DZ_TX_OPTION_CRC_MODE_LBN 2
@@ -2323,10 +373,8 @@ extern "C" {
#define ESF_DZ_TX_EV_RSVD_WIDTH 10
#define ESF_DZ_TX_SOFT2_LBN 32
#define ESF_DZ_TX_SOFT2_WIDTH 16
-#define ESF_DZ_TX_CAN_MERGE_LBN 31
-#define ESF_DZ_TX_CAN_MERGE_WIDTH 1
#define ESF_DZ_TX_SOFT1_LBN 24
-#define ESF_DZ_TX_SOFT1_WIDTH 7
+#define ESF_DZ_TX_SOFT1_WIDTH 8
#define ESF_DZ_TX_QLABEL_LBN 16
#define ESF_DZ_TX_QLABEL_WIDTH 5
#define ESF_DZ_TX_DESCR_INDX_LBN 0
@@ -2369,6 +417,10 @@ extern "C" {
#define ESE_DZ_TX_OPTION_DESC_TSO 7
#define ESE_DZ_TX_OPTION_DESC_VLAN 6
#define ESE_DZ_TX_OPTION_DESC_CRC_CSUM 0
+#define ESF_DZ_TX_TSO_OPTION_TYPE_LBN 56
+#define ESF_DZ_TX_TSO_OPTION_TYPE_WIDTH 4
+#define ESE_DZ_TX_TSO_OPTION_DESC_ENCAP 1
+#define ESE_DZ_TX_TSO_OPTION_DESC_NORMAL 0
#define ESF_DZ_TX_TSO_TCP_FLAGS_LBN 48
#define ESF_DZ_TX_TSO_TCP_FLAGS_WIDTH 8
#define ESF_DZ_TX_TSO_IP_ID_LBN 32
@@ -2377,142 +429,6 @@ extern "C" {
#define ESF_DZ_TX_TSO_TCP_SEQNO_WIDTH 32
-/* ES_TX_USER_DESC */
-#define ESF_DZ_TX_USR_TYPE_LBN 63
-#define ESF_DZ_TX_USR_TYPE_WIDTH 1
-#define ESF_DZ_TX_USR_CONT_LBN 62
-#define ESF_DZ_TX_USR_CONT_WIDTH 1
-#define ESF_DZ_TX_USR_BYTE_CNT_LBN 48
-#define ESF_DZ_TX_USR_BYTE_CNT_WIDTH 14
-#define ESF_DZ_TX_USR_BUF_PAGE_SIZE_LBN 44
-#define ESF_DZ_TX_USR_BUF_PAGE_SIZE_WIDTH 4
-#define ESE_DZ_USR_BUF_PAGE_SZ_4MB 10
-#define ESE_DZ_USR_BUF_PAGE_SZ_1MB 8
-#define ESE_DZ_USR_BUF_PAGE_SZ_64KB 4
-#define ESE_DZ_USR_BUF_PAGE_SZ_4KB 0
-#define ESF_DZ_TX_USR_BUF_ID_OFFSET_DW0_LBN 0
-#define ESF_DZ_TX_USR_BUF_ID_OFFSET_DW0_WIDTH 32
-#define ESF_DZ_TX_USR_BUF_ID_OFFSET_DW1_LBN 32
-#define ESF_DZ_TX_USR_BUF_ID_OFFSET_DW1_WIDTH 12
-#define ESF_DZ_TX_USR_BUF_ID_OFFSET_LBN 0
-#define ESF_DZ_TX_USR_BUF_ID_OFFSET_WIDTH 44
-#define ESF_DZ_TX_USR_4KBPS_BUF_ID_LBN 12
-#define ESF_DZ_TX_USR_4KBPS_BUF_ID_WIDTH 32
-#define ESF_DZ_TX_USR_64KBPS_BUF_ID_LBN 16
-#define ESF_DZ_TX_USR_64KBPS_BUF_ID_WIDTH 28
-#define ESF_DZ_TX_USR_1MBPS_BUF_ID_LBN 20
-#define ESF_DZ_TX_USR_1MBPS_BUF_ID_WIDTH 24
-#define ESF_DZ_TX_USR_4MBPS_BUF_ID_LBN 22
-#define ESF_DZ_TX_USR_4MBPS_BUF_ID_WIDTH 22
-#define ESF_DZ_TX_USR_4MBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_TX_USR_4MBPS_BYTE_OFFSET_WIDTH 22
-#define ESF_DZ_TX_USR_1MBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_TX_USR_1MBPS_BYTE_OFFSET_WIDTH 20
-#define ESF_DZ_TX_USR_64KBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_TX_USR_64KBPS_BYTE_OFFSET_WIDTH 16
-#define ESF_DZ_TX_USR_4KBPS_BYTE_OFFSET_LBN 0
-#define ESF_DZ_TX_USR_4KBPS_BYTE_OFFSET_WIDTH 12
-
-
-/* ES_TX_U_QSTATE_TBL0_ENTRY */
-#define ESF_DZ_TX_U_DC_FILL_LBN 112
-#define ESF_DZ_TX_U_DC_FILL_WIDTH 7
-#define ESF_DZ_TX_U_SOFT7_B1R3_LBN 112
-#define ESF_DZ_TX_U_SOFT7_B1R3_WIDTH 7
-#define ESF_DZ_TX_U_DSCR_HW_RPTR_LBN 96
-#define ESF_DZ_TX_U_DSCR_HW_RPTR_WIDTH 12
-#define ESF_DZ_TX_U_SOFT12_B1R2_LBN 96
-#define ESF_DZ_TX_U_SOFT12_B1R2_WIDTH 12
-#define ESF_DZ_TX_U_DC_RPTR_LBN 80
-#define ESF_DZ_TX_U_DC_RPTR_WIDTH 6
-#define ESF_DZ_TX_U_SOFT6_B1R1_LBN 80
-#define ESF_DZ_TX_U_SOFT6_B1R1_WIDTH 6
-#define ESF_DZ_TX_U_CNTAG_LBN 68
-#define ESF_DZ_TX_U_CNTAG_WIDTH 1
-#define ESF_DZ_TX_U_SOFT5_B1R0_LBN 64
-#define ESF_DZ_TX_U_SOFT5_B1R0_WIDTH 5
-#define ESF_DZ_TX_U_TIMESTAMP_LBN 67
-#define ESF_DZ_TX_U_TIMESTAMP_WIDTH 1
-#define ESF_DZ_TX_U_PREFETCH_ACTIVE_LBN 66
-#define ESF_DZ_TX_U_PREFETCH_ACTIVE_WIDTH 1
-#define ESF_DZ_TX_U_PREFETCH_PENDING_LBN 65
-#define ESF_DZ_TX_U_PREFETCH_PENDING_WIDTH 1
-#define ESF_DZ_TX_U_DOORBELL_ENABLED_LBN 64
-#define ESF_DZ_TX_U_DOORBELL_ENABLED_WIDTH 1
-#define ESF_DZ_TX_U_UPD_UDPTCP_CSUM_MODE_LBN 33
-#define ESF_DZ_TX_U_UPD_UDPTCP_CSUM_MODE_WIDTH 1
-#define ESF_DZ_TX_U_SOFT2_B0R2_LBN 32
-#define ESF_DZ_TX_U_SOFT2_B0R2_WIDTH 2
-#define ESF_DZ_TX_U_UPD_IP_CSUM_MODE_LBN 32
-#define ESF_DZ_TX_U_UPD_IP_CSUM_MODE_WIDTH 1
-#define ESF_DZ_TX_U_UPD_CRC_MODE_LBN 29
-#define ESF_DZ_TX_U_UPD_CRC_MODE_WIDTH 3
-#define ESE_DZ_C2RIP_FCOIP_MPA 5
-#define ESE_DZ_C2RIP_FCOIP_FCOE 4
-#define ESE_DZ_C2RIP_ISCSI_HDR_AND_PYLD 3
-#define ESE_DZ_C2RIP_ISCSI_HDR 2
-#define ESE_DZ_C2RIP_FCOE 1
-#define ESE_DZ_C2RIP_OFF 0
-#define ESF_DZ_TX_U_SOFT16_B0R1_LBN 16
-#define ESF_DZ_TX_U_SOFT16_B0R1_WIDTH 16
-#define ESF_DZ_TX_U_BIU_ARGS_LBN 16
-#define ESF_DZ_TX_U_BIU_ARGS_WIDTH 13
-#define ESF_DZ_TX_U_EV_QID_LBN 5
-#define ESF_DZ_TX_U_EV_QID_WIDTH 11
-#define ESF_DZ_TX_U_SOFT16_B0R0_LBN 0
-#define ESF_DZ_TX_U_SOFT16_B0R0_WIDTH 16
-#define ESF_DZ_TX_U_EV_QLABEL_LBN 0
-#define ESF_DZ_TX_U_EV_QLABEL_WIDTH 5
-
-
-/* ES_TX_U_QSTATE_TBL1_ENTRY */
-#define ESF_DZ_TX_U_DSCR_BASE_PAGE_ID_LBN 64
-#define ESF_DZ_TX_U_DSCR_BASE_PAGE_ID_WIDTH 18
-#define ESF_DZ_TX_U_SOFT18_B1R0_LBN 64
-#define ESF_DZ_TX_U_SOFT18_B1R0_WIDTH 18
-#define ESF_DZ_TX_U_SOFT16_B0R3_LBN 48
-#define ESF_DZ_TX_U_SOFT16_B0R3_WIDTH 16
-#define ESF_DZ_TX_U_EMERGENCY_FETCH_FAILED_LBN 56
-#define ESF_DZ_TX_U_EMERGENCY_FETCH_FAILED_WIDTH 1
-#define ESF_DZ_TX_U_PACER_BYPASS_OK_LBN 55
-#define ESF_DZ_TX_U_PACER_BYPASS_OK_WIDTH 1
-#define ESF_DZ_TX_U_STALE_DL_FETCH_LBN 54
-#define ESF_DZ_TX_U_STALE_DL_FETCH_WIDTH 1
-#define ESF_DZ_TX_U_ROLLBACK_IDX_REACHED_LBN 52
-#define ESF_DZ_TX_U_ROLLBACK_IDX_REACHED_WIDTH 1
-#define ESF_DZ_TX_U_ROLLBACK_ACTIVE_LBN 51
-#define ESF_DZ_TX_U_ROLLBACK_ACTIVE_WIDTH 1
-#define ESF_DZ_TX_U_QUEUE_PAUSED_LBN 50
-#define ESF_DZ_TX_U_QUEUE_PAUSED_WIDTH 1
-#define ESF_DZ_TX_U_QUEUE_ENABLED_LBN 49
-#define ESF_DZ_TX_U_QUEUE_ENABLED_WIDTH 1
-#define ESF_DZ_TX_U_FLUSH_PENDING_LBN 48
-#define ESF_DZ_TX_U_FLUSH_PENDING_WIDTH 1
-#define ESF_DZ_TX_U_DSCR_HW_WPTR_LBN 32
-#define ESF_DZ_TX_U_DSCR_HW_WPTR_WIDTH 12
-#define ESF_DZ_TX_U_SOFT12_B0R2_LBN 32
-#define ESF_DZ_TX_U_SOFT12_B0R2_WIDTH 12
-#define ESF_DZ_TX_U_OWNER_ID_LBN 16
-#define ESF_DZ_TX_U_OWNER_ID_WIDTH 12
-#define ESF_DZ_TX_U_SOFT12_B0R1_LBN 16
-#define ESF_DZ_TX_U_SOFT12_B0R1_WIDTH 12
-#define ESF_DZ_TX_U_DSCR_SIZE_LBN 13
-#define ESF_DZ_TX_U_DSCR_SIZE_WIDTH 3
-#define ESF_DZ_TX_U_SOFT3_B0R0_LBN 0
-#define ESF_DZ_TX_U_SOFT3_B0R0_WIDTH 3
-
-
-/* ES_TX_U_QSTATE_TBL2_ENTRY */
-#define ESF_DZ_TX_FINFO_WRD3_LBN 48
-#define ESF_DZ_TX_FINFO_WRD3_WIDTH 16
-#define ESF_DZ_TX_FINFO_WRD2_LBN 32
-#define ESF_DZ_TX_FINFO_WRD2_WIDTH 16
-#define ESF_DZ_TX_FINFO_WRD1_LBN 16
-#define ESF_DZ_TX_FINFO_WRD1_WIDTH 16
-#define ESF_DZ_TX_FINFO_SRCDST_LBN 0
-#define ESF_DZ_TX_FINFO_SRCDST_WIDTH 16
-
-
/* ES_TX_VLAN_DESC */
#define ESF_DZ_TX_DESC_IS_OPT_LBN 63
#define ESF_DZ_TX_DESC_IS_OPT_WIDTH 1
@@ -2529,412 +445,34 @@ extern "C" {
#define ESF_DZ_TX_VLAN_TAG1_WIDTH 16
-/* ES_b2t_cpl_rsp */
-#define ESF_DZ_B2T_CPL_RSP_CPL_ECC_LBN 284
-#define ESF_DZ_B2T_CPL_RSP_CPL_ECC_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_EOT_LBN 283
-#define ESF_DZ_B2T_CPL_RSP_CPL_EOT_WIDTH 1
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW0_LBN 27
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW0_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW1_LBN 59
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW1_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW2_LBN 91
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW2_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW3_LBN 123
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW3_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW4_LBN 155
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW4_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW5_LBN 187
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW5_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW6_LBN 219
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW6_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW7_LBN 251
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_DW7_WIDTH 32
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_LBN 27
-#define ESF_DZ_B2T_CPL_RSP_CPL_DATA_WIDTH 256
-#define ESF_DZ_B2T_CPL_RSP_CPL_ERROR_LBN 26
-#define ESF_DZ_B2T_CPL_RSP_CPL_ERROR_WIDTH 1
-#define ESF_DZ_B2T_CPL_RSP_CPL_LAST_LBN 25
-#define ESF_DZ_B2T_CPL_RSP_CPL_LAST_WIDTH 1
-#define ESF_DZ_B2T_CPL_RSP_CPL_TAG_LBN 19
-#define ESF_DZ_B2T_CPL_RSP_CPL_TAG_WIDTH 6
-#define ESF_DZ_B2T_CPL_RSP_CPL_LEN_LBN 7
-#define ESF_DZ_B2T_CPL_RSP_CPL_LEN_WIDTH 12
-#define ESF_DZ_B2T_CPL_RSP_CPL_ADRS_LBN 0
-#define ESF_DZ_B2T_CPL_RSP_CPL_ADRS_WIDTH 7
-
-
-/* ES_fltr_info_wrd_mac_to_rx */
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED2_LBN 112
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED2_WIDTH 16
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP2_LBN 96
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP2_WIDTH 16
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP1_LBN 80
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP1_WIDTH 16
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP0_LBN 64
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_TIMESTAMP0_WIDTH 16
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED1_LBN 48
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED1_WIDTH 16
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_SA_LBN 32
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_SA_WIDTH 16
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED0_LBN 8
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_RESERVED0_WIDTH 24
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_LBN 7
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_IPSEC_WIDTH 1
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_PRIORITY_LBN 4
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_PRIORITY_WIDTH 3
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_SRC_LBN 0
-#define ESF_DZ_FLTR_INFO_MAC_TO_RX_SRC_WIDTH 4
-
-
-/* ES_fltr_info_wrd_mc_pdma */
-#define ESF_DZ_FLTR_INFO_MC_PDMA_FLTR_OUT_LBN 64
-#define ESF_DZ_FLTR_INFO_MC_PDMA_FLTR_OUT_WIDTH 16
-#define ESE_DZ_FLTR_MULTICAST_VLAN 512
-#define ESE_DZ_FLTR_MAC_VLAN 256
-#define ESE_DZ_FLTR_STRUCTURED7 128
-#define ESE_DZ_FLTR_STRUCTURED6 64
-#define ESE_DZ_FLTR_STRUCTURED5 32
-#define ESE_DZ_FLTR_STRUCTURED4 16
-#define ESE_DZ_FLTR_STRUCTURED3 8
-#define ESE_DZ_FLTR_STRUCTURED2 4
-#define ESE_DZ_FLTR_STRUCTURED1 2
-#define ESE_DZ_FLTR_STRUCTURED0 1
-#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW0_LBN 16
-#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW0_WIDTH 32
-#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW1_LBN 48
-#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_DW1_WIDTH 16
-#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_LBN 16
-#define ESF_DZ_FLTR_INFO_MC_PDMA_TIMESTAMP_WIDTH 48
-#define ESF_DZ_FLTR_INFO_MC_PDMA_DST_LBN 8
-#define ESF_DZ_FLTR_INFO_MC_PDMA_DST_WIDTH 8
-#define ESE_DZ_DST_NCSI 64
-#define ESE_DZ_DST_PORT0 32
-#define ESE_DZ_DST_PORT1 16
-#define ESE_DZ_DST_PORT0_IPSEC 8
-#define ESE_DZ_DST_PORT1_IPSEC 4
-#define ESE_DZ_DST_PM 2
-#define ESE_DZ_DST_TIMESTAMP 1
-#define ESF_DZ_FLTR_INFO_MC_PDMA_PRIORITY_LBN 4
-#define ESF_DZ_FLTR_INFO_MC_PDMA_PRIORITY_WIDTH 4
-#define ESF_DZ_FLTR_INFO_MC_PDMA_SRC_LBN 0
-#define ESF_DZ_FLTR_INFO_MC_PDMA_SRC_WIDTH 4
-
-
-/* ES_fltr_info_wrd_rxdi_to_rxdp */
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_INNER_VLAN_LBN 112
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_INNER_VLAN_WIDTH 16
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OUTER_VLAN_LBN 96
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OUTER_VLAN_WIDTH 16
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH1_LBN 80
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH1_WIDTH 16
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH0_LBN 64
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_THASH0_WIDTH 16
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP1_LBN 48
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP1_WIDTH 16
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP0_LBN 32
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_TIMESTAMP0_WIDTH 16
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_CNP_LBN 31
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_CNP_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IVP_LBN 30
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IVP_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OVP_LBN 29
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_OVP_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST2_LBN 28
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST2_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST1_LBN 27
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST0_LBN 26
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_ST0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RX_QID_LBN 16
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RX_QID_WIDTH 10
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_HOST_LBN 15
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_HOST_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_MC_LBN 14
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_MC_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P0_LBN 13
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P1_LBN 12
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_P1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED1_LBN 11
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_CRF_LBN 10
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_DST_CRF_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED0_LBN 9
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_RESERVED0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_REPLAY_LBN 8
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_REPLAY_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IPSEC_LBN 7
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_IPSEC_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_PRIORITY_LBN 4
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_PRIORITY_WIDTH 3
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_SRC_LBN 0
-#define ESF_DZ_FLTR_INFO_RXDI_TO_RXDP_SRC_WIDTH 4
-
-
-/* ES_fltr_info_wrd_rxdp_to_host */
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED3_LBN 33
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED3_WIDTH 31
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RMON_SOFT_LBN 32
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RMON_SOFT_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED2_LBN 27
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED2_WIDTH 5
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RX_QID_LBN 16
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RX_QID_WIDTH 11
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_HOST_LBN 15
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_HOST_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_MC_LBN 14
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_MC_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P0_LBN 13
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P1_LBN 12
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_P1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED1_LBN 11
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_CRF_LBN 10
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_DST_CRF_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED0_LBN 9
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_RESERVED0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_REPLAY_LBN 8
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_REPLAY_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_IPSEC_LBN 7
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_IPSEC_WIDTH 1
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_PRIORITY_LBN 4
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_PRIORITY_WIDTH 3
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_SRC_LBN 0
-#define ESF_DZ_FLTR_INFO_RXDP_TO_HOST_SRC_WIDTH 4
-
-
-/* ES_fltr_info_wrd_tx_to_mac */
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRV_LBN 63
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRV_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_LB_LBN 62
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_LB_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS0_LBN 61
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS1_LBN 60
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_MS1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_NDI_LBN 59
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_NDI_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED2_LBN 48
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED2_WIDTH 11
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_SA_LBN 32
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_SA_WIDTH 16
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_STACK_ID_LBN 24
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_STACK_ID_WIDTH 8
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_DOMAIN_LBN 16
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_TX_DOMAIN_WIDTH 8
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED1_LBN 14
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED1_WIDTH 2
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P0_LBN 13
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P1_LBN 12
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_P1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP0_LBN 11
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP1_LBN 10
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_IP1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_PM_LBN 9
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_DST_PM_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED0_LBN 8
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_RESERVED0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_LBN 7
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_IPSEC_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRIORITY_LBN 4
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_PRIORITY_WIDTH 3
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_SRC_LBN 0
-#define ESF_DZ_FLTR_INFO_TX_TO_MAC_SRC_WIDTH 4
-
-
-/* ES_fltr_info_wrd_txdi_to_txdp */
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_INNER_VLAN_LBN 112
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_INNER_VLAN_WIDTH 16
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OUTER_VLAN_LBN 96
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OUTER_VLAN_WIDTH 16
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_CNP_LBN 95
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_CNP_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IVP_LBN 94
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IVP_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OVP_LBN 93
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_OVP_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED4_LBN 90
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED4_WIDTH 3
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_QID_LBN 80
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_QID_WIDTH 10
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_LBN 79
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED3_LBN 78
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED3_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MTU_DIV4_LBN 66
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MTU_DIV4_WIDTH 12
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_OP_LBN 64
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_VRI_OP_WIDTH 2
-#define ESE_DZ_VRI_OP_INSERT_REPLACE 3
-#define ESE_DZ_VRI_OP_INSERT_INSERT 2
-#define ESE_DZ_VRI_OP_REPLACE 1
-#define ESE_DZ_VRI_OP_INSERT 0
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRV_LBN 63
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRV_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_LB_LBN 62
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_LB_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS0_LBN 61
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS1_LBN 60
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_MS1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_NDI_LBN 59
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_NDI_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TXDP_CONTEXT_OUT_LBN 48
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TXDP_CONTEXT_OUT_WIDTH 11
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_SA_LBN 32
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_SA_WIDTH 16
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_STACK_ID_LBN 24
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_STACK_ID_WIDTH 8
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_DOMAIN_LBN 16
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_TX_DOMAIN_WIDTH 8
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED1_LBN 14
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED1_WIDTH 2
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P0_LBN 13
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P1_LBN 12
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_P1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP0_LBN 11
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP1_LBN 10
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_IP1_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_PM_LBN 9
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_DST_PM_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED0_LBN 8
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_RESERVED0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_LBN 7
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_IPSEC_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRIORITY_LBN 4
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_PRIORITY_WIDTH 3
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_SRC_LBN 0
-#define ESF_DZ_FLTR_INFO_TXDI_TO_TXDP_SRC_WIDTH 4
-
-
-/* ES_fltr_info_wrd_txdp_to_txdi */
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_VLAN_OP_LBN 62
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_VLAN_OP_WIDTH 2
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED1_LBN 58
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED1_WIDTH 4
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TX_QID_LBN 48
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TX_QID_WIDTH 10
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_INNER_VLAN_LBN 32
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_INNER_VLAN_WIDTH 16
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_OUTER_VLAN_LBN 16
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_OUTER_VLAN_WIDTH 16
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TXDP_CONTEXT_IN_LBN 5
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_TXDP_CONTEXT_IN_WIDTH 11
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED0_LBN 4
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_RESERVED0_WIDTH 1
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_SRC_LBN 0
-#define ESF_DZ_FLTR_INFO_TXDP_TO_TXDI_SRC_WIDTH 4
-
-
-/* ES_nwk_ev_merge_blk_cmd */
-#define ESF_DZ_EV_MERGE_BLK_COMMAND_OP_LBN 28
-#define ESF_DZ_EV_MERGE_BLK_COMMAND_OP_WIDTH 4
-#define ESE_DZ_EV_MERGE_BLK_COMMAND_OP_FLUSH 2
-#define ESE_DZ_EV_MERGE_BLK_COMMAND_OP_ENABLE 1
-#define ESE_DZ_EV_MERGE_BLK_COMMAND_OP_DISABLE 0
-#define ESF_DZ_EV_MERGE_BLK_COMMAND_BUSY_LBN 31
-#define ESF_DZ_EV_MERGE_BLK_COMMAND_BUSY_WIDTH 1
-#define ESF_DZ_EV_MERGE_BLK_COMMAND_EVQ_IDX_LBN 0
-#define ESF_DZ_EV_MERGE_BLK_COMMAND_EVQ_IDX_WIDTH 11
-
-
-/* ES_txpm2ini_cpl_rsp */
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ECC_LBN 284
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ECC_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_EOT_LBN 283
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_EOT_WIDTH 1
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW0_LBN 27
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW0_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW1_LBN 59
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW1_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW2_LBN 91
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW2_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW3_LBN 123
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW3_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW4_LBN 155
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW4_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW5_LBN 187
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW5_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW6_LBN 219
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW6_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW7_LBN 251
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_DW7_WIDTH 32
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_LBN 27
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_DATA_WIDTH 256
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ERROR_LBN 26
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ERROR_WIDTH 1
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LAST_LBN 25
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LAST_WIDTH 1
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_TAG_LBN 19
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_TAG_WIDTH 6
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LEN_LBN 7
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_LEN_WIDTH 12
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ADRS_LBN 0
-#define ESF_DZ_TXPM2INI_CPL_RSP_CPL_ADRS_WIDTH 7
-
-
-
-/* Enum INI_OP */
-#define ESE_DZ_RD_COMPL 0x3
-#define ESE_DZ_NOP 0x2
-#define ESE_DZ_WR 0x1
-#define ESE_DZ_RD 0x0
-
-/* Enum INT_OP */
-#define ESE_DZ_LEGACY 0x2
-#define ESE_DZ_MSI 0x1
-#define ESE_DZ_MSIX 0x0
-
-/* Enum MC_PDMA_BUFFER_ID */
-#define ESE_DZ_MC_PDMA_BUFFER_ALL 4
-#define ESE_DZ_MC_PDMA_BUFFER_RXDP 3
-#define ESE_DZ_MC_PDMA_BUFFER_NCSI 2
-#define ESE_DZ_MC_PDMA_BUFFER_NWPORT1 1
-#define ESE_DZ_MC_PDMA_BUFFER_NWPORT0 0
-
-/* Enum MC_PDMA_INTERFACE_ID */
-#define ESE_DZ_MC_PDMA_INTERFACE_RXDP 3
-#define ESE_DZ_MC_PDMA_INTERFACE_NCSI 2
-#define ESE_DZ_MC_PDMA_INTERFACE_NWPORT1 1
-#define ESE_DZ_MC_PDMA_INTERFACE_NWPORT0 0
-
-/* Enum PKT_STRM_CTL */
-#define ESE_DZ_EOP_TRUNC 0x3
-#define ESE_DZ_EOP_CRC_ERR 0x2
-#define ESE_DZ_EOP 0x1
-#define ESE_DZ_NOOP 0x0
-
-/* Enum PM_EPI_PKT_MARKER */
-#define ESE_DZ_PM_EPI_LST 0x3
-#define ESE_DZ_PM_EPI_OBL 0x2
-#define ESE_DZ_PM_EPI_TBL 0x1
-#define ESE_DZ_PM_EPI_MDL 0x0
-
-/* Enum PM_IPI_TO_PM_MM_COMMAND */
-#define ESE_DZ_FREE_CHAIN 0x3
-#define ESE_DZ_FREE_BUFFER 0x2
-#define ESE_DZ_ADD_BUFFER 0x1
-#define ESE_DZ_PM_MM_NOOP 0x0
-
-/* Enum PM_MA_TO_PM_EPI_COMMAND */
-#define ESE_DZ_FROM_PORT_D 0x4
-#define ESE_DZ_FROM_PORT_C 0x3
-#define ESE_DZ_FROM_PORT_B 0x2
-#define ESE_DZ_FROM_PORT_A 0x1
-#define ESE_DZ_PM_EPI_NOOP 0x0
-
-/* Enum PM_MA_TO_PM_IPI_COMMAND */
-#define ESE_DZ_TO_PORT_D 0x4
-#define ESE_DZ_TO_PORT_C 0x3
-#define ESE_DZ_TO_PORT_B 0x2
-#define ESE_DZ_TO_PORT_A 0x1
-#define ESE_DZ_PM_IPI_NOOP 0x0
+/*************************************************************************
+ * NOTE: the comment line above marks the end of the autogenerated section
+ */
+
+/*
+ * The workaround for bug 35388 requires multiplexing writes through
+ * the ERF_DZ_TX_DESC_WPTR address.
+ * TX_DESC_UPD: 0ppppppppppp (bit 11 lost)
+ * EVQ_RPTR: 1000hhhhhhhh, 1001llllllll (split into high and low bits)
+ * EVQ_TMR: 11mmvvvvvvvv (bits 8:13 of value lost)
+ */
+#define ER_DD_EVQ_INDIRECT_OFST (ER_DZ_TX_DESC_UPD_REG_OFST + 2 * 4)
+#define ER_DD_EVQ_INDIRECT_STEP ER_DZ_TX_DESC_UPD_REG_STEP
+#define ERF_DD_EVQ_IND_RPTR_FLAGS_LBN 8
+#define ERF_DD_EVQ_IND_RPTR_FLAGS_WIDTH 4
+#define EFE_DD_EVQ_IND_RPTR_FLAGS_HIGH 8
+#define EFE_DD_EVQ_IND_RPTR_FLAGS_LOW 9
+#define ERF_DD_EVQ_IND_RPTR_LBN 0
+#define ERF_DD_EVQ_IND_RPTR_WIDTH 8
+#define ERF_DD_EVQ_IND_TIMER_FLAGS_LBN 10
+#define ERF_DD_EVQ_IND_TIMER_FLAGS_WIDTH 2
+#define EFE_DD_EVQ_IND_TIMER_FLAGS 3
+#define ERF_DD_EVQ_IND_TIMER_MODE_LBN 8
+#define ERF_DD_EVQ_IND_TIMER_MODE_WIDTH 2
+#define ERF_DD_EVQ_IND_TIMER_VAL_LBN 0
+#define ERF_DD_EVQ_IND_TIMER_VAL_WIDTH 8
+
+
#ifdef __cplusplus
}
#endif
diff --git a/sys/dev/sfxge/common/efx_regs_mcdi.h b/sys/dev/sfxge/common/efx_regs_mcdi.h
index bd35970..db8651e 100644
--- a/sys/dev/sfxge/common/efx_regs_mcdi.h
+++ b/sys/dev/sfxge/common/efx_regs_mcdi.h
@@ -4451,8 +4451,12 @@
/* MC_CMD_DRV_ATTACH_IN msgrequest */
#define MC_CMD_DRV_ATTACH_IN_LEN 12
-/* new state (0=detached, 1=attached) to set if UPDATE=1 */
+/* new state to set if UPDATE=1 */
#define MC_CMD_DRV_ATTACH_IN_NEW_STATE_OFST 0
+#define MC_CMD_DRV_ATTACH_LBN 0
+#define MC_CMD_DRV_ATTACH_WIDTH 1
+#define MC_CMD_DRV_PREBOOT_LBN 1
+#define MC_CMD_DRV_PREBOOT_WIDTH 1
/* 1 to set new state, or 0 to just report the existing state */
#define MC_CMD_DRV_ATTACH_IN_UPDATE_OFST 4
/* preferred datapath firmware (for Huntington; ignored for Siena) */
@@ -4474,12 +4478,12 @@
/* MC_CMD_DRV_ATTACH_OUT msgresponse */
#define MC_CMD_DRV_ATTACH_OUT_LEN 4
-/* previous or existing state (0=detached, 1=attached) */
+/* previous or existing state, see the bitmask at NEW_STATE */
#define MC_CMD_DRV_ATTACH_OUT_OLD_STATE_OFST 0
/* MC_CMD_DRV_ATTACH_EXT_OUT msgresponse */
#define MC_CMD_DRV_ATTACH_EXT_OUT_LEN 8
-/* previous or existing state (0=detached, 1=attached) */
+/* previous or existing state, see the bitmask at NEW_STATE */
#define MC_CMD_DRV_ATTACH_EXT_OUT_OLD_STATE_OFST 0
/* Flags associated with this function */
#define MC_CMD_DRV_ATTACH_EXT_OUT_FUNC_FLAGS_OFST 4
@@ -4491,6 +4495,10 @@
#define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL 0x1
/* enum: The function can perform privileged operations */
#define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED 0x2
+/* enum: The function does not have an active port associated with it. The port
+ * refers to the Sorrento external FPGA port.
+ */
+#define MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_NO_ACTIVE_PORT 0x3
/***********************************/
@@ -5230,6 +5238,55 @@
#define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_LBN 0
#define MC_CMD_SET_MAC_IN_FLAG_INCLUDE_FCS_WIDTH 1
+/* MC_CMD_SET_MAC_EXT_IN msgrequest */
+#define MC_CMD_SET_MAC_EXT_IN_LEN 32
+/* The MTU is the MTU programmed directly into the XMAC/GMAC (inclusive of
+ * EtherII, VLAN, bug16011 padding).
+ */
+#define MC_CMD_SET_MAC_EXT_IN_MTU_OFST 0
+#define MC_CMD_SET_MAC_EXT_IN_DRAIN_OFST 4
+#define MC_CMD_SET_MAC_EXT_IN_ADDR_OFST 8
+#define MC_CMD_SET_MAC_EXT_IN_ADDR_LEN 8
+#define MC_CMD_SET_MAC_EXT_IN_ADDR_LO_OFST 8
+#define MC_CMD_SET_MAC_EXT_IN_ADDR_HI_OFST 12
+#define MC_CMD_SET_MAC_EXT_IN_REJECT_OFST 16
+#define MC_CMD_SET_MAC_EXT_IN_REJECT_UNCST_LBN 0
+#define MC_CMD_SET_MAC_EXT_IN_REJECT_UNCST_WIDTH 1
+#define MC_CMD_SET_MAC_EXT_IN_REJECT_BRDCST_LBN 1
+#define MC_CMD_SET_MAC_EXT_IN_REJECT_BRDCST_WIDTH 1
+#define MC_CMD_SET_MAC_EXT_IN_FCNTL_OFST 20
+/* enum: Flow control is off. */
+/* MC_CMD_FCNTL_OFF 0x0 */
+/* enum: Respond to flow control. */
+/* MC_CMD_FCNTL_RESPOND 0x1 */
+/* enum: Respond to and Issue flow control. */
+/* MC_CMD_FCNTL_BIDIR 0x2 */
+/* enum: Auto neg flow control. */
+/* MC_CMD_FCNTL_AUTO 0x3 */
+/* enum: Priority flow control (eftest builds only). */
+/* MC_CMD_FCNTL_QBB 0x4 */
+/* enum: Issue flow control. */
+/* MC_CMD_FCNTL_GENERATE 0x5 */
+#define MC_CMD_SET_MAC_EXT_IN_FLAGS_OFST 24
+#define MC_CMD_SET_MAC_EXT_IN_FLAG_INCLUDE_FCS_LBN 0
+#define MC_CMD_SET_MAC_EXT_IN_FLAG_INCLUDE_FCS_WIDTH 1
+/* Select which parameters to configure. A parameter will only be modified if
+ * the corresponding control flag is set. If SET_MAC_ENHANCED is not set in
+ * capabilities then this field is ignored (and all flags are assumed to be
+ * set).
+ */
+#define MC_CMD_SET_MAC_EXT_IN_CONTROL_OFST 28
+#define MC_CMD_SET_MAC_EXT_IN_CFG_MTU_LBN 0
+#define MC_CMD_SET_MAC_EXT_IN_CFG_MTU_WIDTH 1
+#define MC_CMD_SET_MAC_EXT_IN_CFG_DRAIN_LBN 1
+#define MC_CMD_SET_MAC_EXT_IN_CFG_DRAIN_WIDTH 1
+#define MC_CMD_SET_MAC_EXT_IN_CFG_REJECT_LBN 2
+#define MC_CMD_SET_MAC_EXT_IN_CFG_REJECT_WIDTH 1
+#define MC_CMD_SET_MAC_EXT_IN_CFG_FCNTL_LBN 3
+#define MC_CMD_SET_MAC_EXT_IN_CFG_FCNTL_WIDTH 1
+#define MC_CMD_SET_MAC_EXT_IN_CFG_FCS_LBN 4
+#define MC_CMD_SET_MAC_EXT_IN_CFG_FCS_WIDTH 1
+
/* MC_CMD_SET_MAC_OUT msgresponse */
#define MC_CMD_SET_MAC_OUT_LEN 0
@@ -5831,6 +5888,26 @@
#define MC_CMD_NVRAM_INFO_OUT_PHYSDEV_OFST 16
#define MC_CMD_NVRAM_INFO_OUT_PHYSADDR_OFST 20
+/* MC_CMD_NVRAM_INFO_V2_OUT msgresponse */
+#define MC_CMD_NVRAM_INFO_V2_OUT_LEN 28
+#define MC_CMD_NVRAM_INFO_V2_OUT_TYPE_OFST 0
+/* Enum values, see field(s): */
+/* MC_CMD_NVRAM_TYPES/MC_CMD_NVRAM_TYPES_OUT/TYPES */
+#define MC_CMD_NVRAM_INFO_V2_OUT_SIZE_OFST 4
+#define MC_CMD_NVRAM_INFO_V2_OUT_ERASESIZE_OFST 8
+#define MC_CMD_NVRAM_INFO_V2_OUT_FLAGS_OFST 12
+#define MC_CMD_NVRAM_INFO_V2_OUT_PROTECTED_LBN 0
+#define MC_CMD_NVRAM_INFO_V2_OUT_PROTECTED_WIDTH 1
+#define MC_CMD_NVRAM_INFO_V2_OUT_TLV_LBN 1
+#define MC_CMD_NVRAM_INFO_V2_OUT_TLV_WIDTH 1
+#define MC_CMD_NVRAM_INFO_V2_OUT_A_B_LBN 7
+#define MC_CMD_NVRAM_INFO_V2_OUT_A_B_WIDTH 1
+#define MC_CMD_NVRAM_INFO_V2_OUT_PHYSDEV_OFST 16
+#define MC_CMD_NVRAM_INFO_V2_OUT_PHYSADDR_OFST 20
+/* Writes must be multiples of this size. Added to support the MUM on Sorrento.
+ */
+#define MC_CMD_NVRAM_INFO_V2_OUT_WRITESIZE_OFST 24
+
/***********************************/
/* MC_CMD_NVRAM_UPDATE_START
@@ -6214,6 +6291,8 @@
#define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY 0x39
/* enum: CCOM AVREG 1v8 supply (external ADC): mV */
#define MC_CMD_SENSOR_CCOM_AVREG_1V8_SUPPLY_EXTADC 0x3a
+/* enum: CCOM RTS temperature: degC */
+#define MC_CMD_SENSOR_CONTROLLER_RTS 0x3b
/* enum: Not a sensor: reserved for the next page flag */
#define MC_CMD_SENSOR_PAGE1_NEXT 0x3f
/* enum: controller internal temperature sensor voltage on master core
@@ -6942,6 +7021,10 @@
* operations
*/
#define MC_CMD_MUM_OP_QSFP 0xc
+/* enum: Request discrete and SODIMM DDR info (type, size, speed grade, voltage
+ * level) from MUM
+ */
+#define MC_CMD_MUM_OP_READ_DDR_INFO 0xd
/* MC_CMD_MUM_IN_NULL msgrequest */
#define MC_CMD_MUM_IN_NULL_LEN 4
@@ -7127,6 +7210,10 @@
#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_FLAGS_OFST 8
#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_LBN 0
#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_OVERCLOCK_110_WIDTH 1
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_NIC_FROM_FPGA_LBN 1
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_NIC_FROM_FPGA_WIDTH 1
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_REF_FROM_XO_LBN 2
+#define MC_CMD_MUM_IN_PROGRAM_CLOCKS_CLOCK_REF_FROM_XO_WIDTH 1
/* MC_CMD_MUM_IN_FPGA_LOAD msgrequest */
#define MC_CMD_MUM_IN_FPGA_LOAD_LEN 8
@@ -7196,6 +7283,11 @@
#define MC_CMD_MUM_IN_QSFP_POLL_BIST_HDR_OFST 4
#define MC_CMD_MUM_IN_QSFP_POLL_BIST_IDX_OFST 8
+/* MC_CMD_MUM_IN_READ_DDR_INFO msgrequest */
+#define MC_CMD_MUM_IN_READ_DDR_INFO_LEN 4
+/* MUM cmd header */
+/* MC_CMD_MUM_IN_CMD_OFST 0 */
+
/* MC_CMD_MUM_OUT msgresponse */
#define MC_CMD_MUM_OUT_LEN 0
@@ -7338,6 +7430,69 @@
#define MC_CMD_MUM_OUT_QSFP_POLL_BIST_LEN 4
#define MC_CMD_MUM_OUT_QSFP_POLL_BIST_TEST_OFST 0
+/* MC_CMD_MUM_OUT_READ_DDR_INFO msgresponse */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_LENMIN 24
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_LENMAX 248
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_LEN(num) (8+8*(num))
+/* Discrete (soldered) DDR resistor strap info */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_DISCRETE_DDR_INFO_OFST 0
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_VRATIO_LBN 0
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_VRATIO_WIDTH 16
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED1_LBN 16
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED1_WIDTH 16
+/* Number of SODIMM info records */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_NUM_RECORDS_OFST 4
+/* Array of SODIMM info records */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_OFST 8
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_LEN 8
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_LO_OFST 8
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_HI_OFST 12
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_MINNUM 2
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SODIMM_INFO_RECORD_MAXNUM 30
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK_ID_LBN 0
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK_ID_WIDTH 8
+/* enum: SODIMM bank 1 (Top SODIMM for Sorrento) */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK1 0x0
+/* enum: SODIMM bank 2 (Bottom SODDIMM for Sorrento) */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_BANK2 0x1
+/* enum: Total number of SODIMM banks */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_NUM_BANKS 0x2
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_TYPE_LBN 8
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_TYPE_WIDTH 8
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_RANK_LBN 16
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_RANK_WIDTH 4
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_VOLTAGE_LBN 20
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_VOLTAGE_WIDTH 4
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_NOT_POWERED 0x0 /* enum */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_1V25 0x1 /* enum */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_1V35 0x2 /* enum */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_1V5 0x3 /* enum */
+/* enum: Values 5-15 are reserved for future usage */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_1V8 0x4
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SIZE_LBN 24
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SIZE_WIDTH 8
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SPEED_LBN 32
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_SPEED_WIDTH 16
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_STATE_LBN 48
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_STATE_WIDTH 4
+/* enum: No module present */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_ABSENT 0x0
+/* enum: Module present supported and powered on */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_POWERED 0x1
+/* enum: Module present but bad type */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_TYPE 0x2
+/* enum: Module present but incompatible voltage */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_VOLTAGE 0x3
+/* enum: Module present but unknown SPD */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_SPD 0x4
+/* enum: Module present but slot cannot support it */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_PRESENT_BAD_SLOT 0x5
+/* enum: Modules may or may not be present, but cannot establish contact by I2C
+ */
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_NOT_REACHABLE 0x6
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED2_LBN 52
+#define MC_CMD_MUM_OUT_READ_DDR_INFO_RESERVED2_WIDTH 12
+
/* MC_CMD_RESOURCE_SPECIFIER enum */
/* enum: Any */
#define MC_CMD_RESOURCE_INSTANCE_ANY 0xffffffff
@@ -7410,6 +7565,8 @@
#define NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG 0x500
/* enum: Expansion ROM configuration data for port 0 */
#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT0 0x600
+/* enum: Synonym for EXPROM_CONFIG_PORT0 as used in pmap files */
+#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG 0x600
/* enum: Expansion ROM configuration data for port 1 */
#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT1 0x601
/* enum: Expansion ROM configuration data for port 2 */
@@ -7418,6 +7575,8 @@
#define NVRAM_PARTITION_TYPE_EXPROM_CONFIG_PORT3 0x603
/* enum: Non-volatile log output partition */
#define NVRAM_PARTITION_TYPE_LOG 0x700
+/* enum: Non-volatile log output of second core on dual-core device */
+#define NVRAM_PARTITION_TYPE_LOG_SLAVE 0x701
/* enum: Device state dump output partition */
#define NVRAM_PARTITION_TYPE_DUMP 0x800
/* enum: Application license key storage partition */
@@ -7450,6 +7609,20 @@
#define NVRAM_PARTITION_TYPE_MUM_USER_ROM 0xc05
/* enum: MUM fuses and lockbits partition. */
#define NVRAM_PARTITION_TYPE_MUM_FUSELOCK 0xc06
+/* enum: UEFI expansion ROM if separate from PXE */
+#define NVRAM_PARTITION_TYPE_EXPANSION_UEFI 0xd00
+/* enum: Spare partition 0 */
+#define NVRAM_PARTITION_TYPE_SPARE_0 0x1000
+/* enum: Spare partition 1 */
+#define NVRAM_PARTITION_TYPE_SPARE_1 0x1100
+/* enum: Spare partition 2 */
+#define NVRAM_PARTITION_TYPE_SPARE_2 0x1200
+/* enum: Spare partition 3 */
+#define NVRAM_PARTITION_TYPE_SPARE_3 0x1300
+/* enum: Spare partition 4 */
+#define NVRAM_PARTITION_TYPE_SPARE_4 0x1400
+/* enum: Spare partition 5 */
+#define NVRAM_PARTITION_TYPE_SPARE_5 0x1500
/* enum: Start of reserved value range (firmware may use for any purpose) */
#define NVRAM_PARTITION_TYPE_RESERVED_VALUES_MIN 0xff00
/* enum: End of reserved value range (firmware may use for any purpose) */
@@ -7699,6 +7872,8 @@
#define MC_CMD_INIT_RXQ_IN_FLAG_PREFIX_WIDTH 1
#define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_LBN 9
#define MC_CMD_INIT_RXQ_IN_FLAG_DISABLE_SCATTER_WIDTH 1
+#define MC_CMD_INIT_RXQ_IN_FLAG_FORCE_EV_MERGING_LBN 10
+#define MC_CMD_INIT_RXQ_IN_FLAG_FORCE_EV_MERGING_WIDTH 1
/* Owner ID to use if in buffer mode (zero if physical) */
#define MC_CMD_INIT_RXQ_IN_OWNER_ID_OFST 20
/* The port ID associated with the v-adaptor which should contain this DMAQ. */
@@ -7759,6 +7934,8 @@
#define MC_CMD_INIT_RXQ_EXT_IN_PS_BUFF_64K 0x4 /* enum */
#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_LBN 18
#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_WANT_OUTER_CLASSES_WIDTH 1
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_FORCE_EV_MERGING_LBN 19
+#define MC_CMD_INIT_RXQ_EXT_IN_FLAG_FORCE_EV_MERGING_WIDTH 1
/* Owner ID to use if in buffer mode (zero if physical) */
#define MC_CMD_INIT_RXQ_EXT_IN_OWNER_ID_OFST 20
/* The port ID associated with the v-adaptor which should contain this DMAQ. */
@@ -8091,6 +8268,46 @@
#define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_OFST 44
#define MC_CMD_PROXY_CONFIGURE_IN_ALLOWED_MCDI_MASK_LEN 64
+/* MC_CMD_PROXY_CONFIGURE_EXT_IN msgrequest */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_LEN 112
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_FLAGS_OFST 0
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_ENABLE_LBN 0
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_ENABLE_WIDTH 1
+/* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
+ * of blocks, each of the size REQUEST_BLOCK_SIZE.
+ */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_OFST 4
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_LEN 8
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_LO_OFST 4
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BUFF_ADDR_HI_OFST 8
+/* Must be a power of 2 */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_STATUS_BLOCK_SIZE_OFST 12
+/* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
+ * of blocks, each of the size REPLY_BLOCK_SIZE.
+ */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_OFST 16
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_LEN 8
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_LO_OFST 16
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BUFF_ADDR_HI_OFST 20
+/* Must be a power of 2 */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REQUEST_BLOCK_SIZE_OFST 24
+/* Host provides a contiguous memory buffer that contains at least NUM_BLOCKS
+ * of blocks, each of the size STATUS_BLOCK_SIZE. This buffer is only needed if
+ * host intends to complete proxied operations by using MC_CMD_PROXY_CMD.
+ */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_OFST 28
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_LEN 8
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_LO_OFST 28
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BUFF_ADDR_HI_OFST 32
+/* Must be a power of 2, or zero if this buffer is not provided */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_REPLY_BLOCK_SIZE_OFST 36
+/* Applies to all three buffers */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_NUM_BLOCKS_OFST 40
+/* A bit mask defining which MCDI operations may be proxied */
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_ALLOWED_MCDI_MASK_OFST 44
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_ALLOWED_MCDI_MASK_LEN 64
+#define MC_CMD_PROXY_CONFIGURE_EXT_IN_RESERVED_OFST 108
+
/* MC_CMD_PROXY_CONFIGURE_OUT msgresponse */
#define MC_CMD_PROXY_CONFIGURE_OUT_LEN 0
@@ -9439,6 +9656,16 @@
#define MC_CMD_GET_CAPABILITIES_OUT_LEN 20
/* First word of flags. */
#define MC_CMD_GET_CAPABILITIES_OUT_FLAGS1_OFST 0
+#define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_LBN 7
+#define MC_CMD_GET_CAPABILITIES_OUT_DRV_ATTACH_PREBOOT_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_FORCE_EVENT_MERGING_LBN 8
+#define MC_CMD_GET_CAPABILITIES_OUT_RX_FORCE_EVENT_MERGING_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_SET_MAC_ENHANCED_LBN 9
+#define MC_CMD_GET_CAPABILITIES_OUT_SET_MAC_ENHANCED_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_LBN 10
+#define MC_CMD_GET_CAPABILITIES_OUT_UNKNOWN_UCAST_DST_FILTER_ALWAYS_MULTI_RECIPIENT_WIDTH 1
+#define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 11
+#define MC_CMD_GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
#define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_LBN 12
#define MC_CMD_GET_CAPABILITIES_OUT_TX_MAC_SECURITY_FILTERING_WIDTH 1
#define MC_CMD_GET_CAPABILITIES_OUT_ADDITIONAL_RSS_MODES_LBN 13
@@ -9506,6 +9733,8 @@
#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_RX_HDR_SPLIT 0x107
/* enum: RXDP Test firmware image 8 */
#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DISABLE_DL 0x108
+/* enum: RXDP Test firmware image 9 */
+#define MC_CMD_GET_CAPABILITIES_OUT_RXDP_TEST_FW_DOORBELL_DELAY 0x10b
/* TxDPCPU firmware id. */
#define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_OFST 6
#define MC_CMD_GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID_LEN 2
@@ -9851,6 +10080,26 @@
/***********************************/
+/* MC_CMD_VSWITCH_QUERY
+ * read some config of v-switch. For now this command is an empty placeholder.
+ * It may be used to check if a v-switch is connected to a given EVB port (if
+ * not, then the command returns ENOENT).
+ */
+#define MC_CMD_VSWITCH_QUERY 0x63
+#undef MC_CMD_0x63_PRIVILEGE_CTG
+
+#define MC_CMD_0x63_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VSWITCH_QUERY_IN msgrequest */
+#define MC_CMD_VSWITCH_QUERY_IN_LEN 4
+/* The port to which the v-switch is connected. */
+#define MC_CMD_VSWITCH_QUERY_IN_UPSTREAM_PORT_ID_OFST 0
+
+/* MC_CMD_VSWITCH_QUERY_OUT msgresponse */
+#define MC_CMD_VSWITCH_QUERY_OUT_LEN 0
+
+
+/***********************************/
/* MC_CMD_VPORT_ALLOC
* allocate a v-port.
*/
@@ -9887,6 +10136,8 @@
#define MC_CMD_VPORT_ALLOC_IN_FLAGS_OFST 8
#define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_LBN 0
#define MC_CMD_VPORT_ALLOC_IN_FLAG_AUTO_PORT_WIDTH 1
+#define MC_CMD_VPORT_ALLOC_IN_FLAG_VLAN_RESTRICT_LBN 1
+#define MC_CMD_VPORT_ALLOC_IN_FLAG_VLAN_RESTRICT_WIDTH 1
/* The number of VLAN tags to insert/remove. An error will be returned if
* incompatible with the number of VLAN tags specified for the upstream
* v-switch.
@@ -9940,6 +10191,8 @@
#define MC_CMD_VADAPTOR_ALLOC_IN_FLAGS_OFST 8
#define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_LBN 0
#define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_AUTO_VADAPTOR_WIDTH 1
+#define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_LBN 1
+#define MC_CMD_VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED_WIDTH 1
/* The number of VLAN tags to strip on receive */
#define MC_CMD_VADAPTOR_ALLOC_IN_NUM_VLANS_OFST 12
/* The number of VLAN tags to transparently insert/remove. */
@@ -10021,6 +10274,30 @@
/***********************************/
+/* MC_CMD_VADAPTOR_QUERY
+ * read some config of v-adaptor.
+ */
+#define MC_CMD_VADAPTOR_QUERY 0x61
+#undef MC_CMD_0x61_PRIVILEGE_CTG
+
+#define MC_CMD_0x61_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VADAPTOR_QUERY_IN msgrequest */
+#define MC_CMD_VADAPTOR_QUERY_IN_LEN 4
+/* The port to which the v-adaptor is connected. */
+#define MC_CMD_VADAPTOR_QUERY_IN_UPSTREAM_PORT_ID_OFST 0
+
+/* MC_CMD_VADAPTOR_QUERY_OUT msgresponse */
+#define MC_CMD_VADAPTOR_QUERY_OUT_LEN 12
+/* The EVB port flags as defined at MC_CMD_VPORT_ALLOC. */
+#define MC_CMD_VADAPTOR_QUERY_OUT_PORT_FLAGS_OFST 0
+/* The v-adaptor flags as defined at MC_CMD_VADAPTOR_ALLOC. */
+#define MC_CMD_VADAPTOR_QUERY_OUT_VADAPTOR_FLAGS_OFST 4
+/* The number of VLAN tags that may still be added */
+#define MC_CMD_VADAPTOR_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_OFST 8
+
+
+/***********************************/
/* MC_CMD_EVB_PORT_ASSIGN
* assign a port to a PCI function.
*/
@@ -10558,6 +10835,76 @@
/***********************************/
+/* MC_CMD_VPORT_RECONFIGURE
+ * Replace VLAN tags and/or MAC addresses of an existing v-port. If the v-port
+ * has already been passed to another function (v-port's user), then that
+ * function will be reset before applying the changes.
+ */
+#define MC_CMD_VPORT_RECONFIGURE 0xeb
+#undef MC_CMD_0xeb_PRIVILEGE_CTG
+
+#define MC_CMD_0xeb_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_VPORT_RECONFIGURE_IN msgrequest */
+#define MC_CMD_VPORT_RECONFIGURE_IN_LEN 44
+/* The handle of the v-port */
+#define MC_CMD_VPORT_RECONFIGURE_IN_VPORT_ID_OFST 0
+/* Flags requesting what should be changed. */
+#define MC_CMD_VPORT_RECONFIGURE_IN_FLAGS_OFST 4
+#define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_VLAN_TAGS_LBN 0
+#define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_VLAN_TAGS_WIDTH 1
+#define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_MACADDRS_LBN 1
+#define MC_CMD_VPORT_RECONFIGURE_IN_REPLACE_MACADDRS_WIDTH 1
+/* The number of VLAN tags to insert/remove. An error will be returned if
+ * incompatible with the number of VLAN tags specified for the upstream
+ * v-switch.
+ */
+#define MC_CMD_VPORT_RECONFIGURE_IN_NUM_VLAN_TAGS_OFST 8
+/* The actual VLAN tags to insert/remove */
+#define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAGS_OFST 12
+#define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_0_LBN 0
+#define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_0_WIDTH 16
+#define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_1_LBN 16
+#define MC_CMD_VPORT_RECONFIGURE_IN_VLAN_TAG_1_WIDTH 16
+/* The number of MAC addresses to add */
+#define MC_CMD_VPORT_RECONFIGURE_IN_NUM_MACADDRS_OFST 16
+/* MAC addresses to add */
+#define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_OFST 20
+#define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_LEN 6
+#define MC_CMD_VPORT_RECONFIGURE_IN_MACADDRS_NUM 4
+
+/* MC_CMD_VPORT_RECONFIGURE_OUT msgresponse */
+#define MC_CMD_VPORT_RECONFIGURE_OUT_LEN 4
+#define MC_CMD_VPORT_RECONFIGURE_OUT_FLAGS_OFST 0
+#define MC_CMD_VPORT_RECONFIGURE_OUT_RESET_DONE_LBN 0
+#define MC_CMD_VPORT_RECONFIGURE_OUT_RESET_DONE_WIDTH 1
+
+
+/***********************************/
+/* MC_CMD_EVB_PORT_QUERY
+ * read some config of v-port.
+ */
+#define MC_CMD_EVB_PORT_QUERY 0x62
+#undef MC_CMD_0x62_PRIVILEGE_CTG
+
+#define MC_CMD_0x62_PRIVILEGE_CTG SRIOV_CTG_GENERAL
+
+/* MC_CMD_EVB_PORT_QUERY_IN msgrequest */
+#define MC_CMD_EVB_PORT_QUERY_IN_LEN 4
+/* The handle of the v-port */
+#define MC_CMD_EVB_PORT_QUERY_IN_PORT_ID_OFST 0
+
+/* MC_CMD_EVB_PORT_QUERY_OUT msgresponse */
+#define MC_CMD_EVB_PORT_QUERY_OUT_LEN 8
+/* The EVB port flags as defined at MC_CMD_VPORT_ALLOC. */
+#define MC_CMD_EVB_PORT_QUERY_OUT_PORT_FLAGS_OFST 0
+/* The number of VLAN tags that may be used on a v-adaptor connected to this
+ * EVB port.
+ */
+#define MC_CMD_EVB_PORT_QUERY_OUT_NUM_AVAILABLE_VLAN_TAGS_OFST 4
+
+
+/***********************************/
/* MC_CMD_DUMP_BUFTBL_ENTRIES
* Dump buffer table entries, mainly for command client debug use. Dumps
* absolute entries, and does not use chunk handles. All entries must be in
@@ -10601,6 +10948,14 @@
#define MC_CMD_SET_RXDP_CONFIG_IN_DATA_OFST 0
#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_LBN 0
#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_DMA_WIDTH 1
+#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_LEN_LBN 1
+#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_LEN_WIDTH 2
+/* enum: pad to 64 bytes */
+#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64 0x0
+/* enum: pad to 128 bytes (Medford only) */
+#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_128 0x1
+/* enum: pad to 256 bytes (Medford only) */
+#define MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_256 0x2
/* MC_CMD_SET_RXDP_CONFIG_OUT msgresponse */
#define MC_CMD_SET_RXDP_CONFIG_OUT_LEN 0
@@ -10623,6 +10978,10 @@
#define MC_CMD_GET_RXDP_CONFIG_OUT_DATA_OFST 0
#define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_LBN 0
#define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_DMA_WIDTH 1
+#define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_LEN_LBN 1
+#define MC_CMD_GET_RXDP_CONFIG_OUT_PAD_HOST_LEN_WIDTH 2
+/* Enum values, see field(s): */
+/* MC_CMD_SET_RXDP_CONFIG/MC_CMD_SET_RXDP_CONFIG_IN/PAD_HOST_LEN */
/***********************************/
@@ -11508,6 +11867,10 @@
#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP4 0x5
/* enum: DFE Tap5 (0 - max negative, 32 - zero, 63 - max positive) */
#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_TAP5 0x6
+/* enum: DFE DLev */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_DFE_DLEV 0x7
+/* enum: Figure of Merit */
+#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_FOM 0x8
#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_LBN 8
#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_PARAM_LANE_WIDTH 4
#define MC_CMD_PCIE_TUNE_RXEQ_GET_OUT_LANE_0 0x0 /* enum */
@@ -12133,12 +12496,27 @@
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD 0x4 /* enum */
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP 0x8 /* enum */
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS 0x10 /* enum */
-#define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING 0x20 /* enum */
+/* enum: Deprecated. Equivalent to MAC_SPOOFING_TX combined with CHANGE_MAC. */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING 0x20
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST 0x40 /* enum */
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST 0x80 /* enum */
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST 0x100 /* enum */
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST 0x200 /* enum */
#define MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS 0x400 /* enum */
+/* enum: Allows to set the TX packets' source MAC address to any arbitrary MAC
+ * adress.
+ */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX 0x800
+/* enum: Privilege that allows a Function to change the MAC address configured
+ * in its associated vAdapter/vPort.
+ */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC 0x1000
+/* enum: Privilege that allows a Function to install filters that specify VLANs
+ * that are not in the permit list for the associated vPort. This privilege is
+ * primarily to support ESX where vPorts are created that restrict traffic to
+ * only a set of permitted VLANs. See the vPort flag FLAG_VLAN_RESTRICT.
+ */
+#define MC_CMD_PRIVILEGE_MASK_IN_GRP_UNRESTRICTED_VLAN 0x2000
/* enum: Set this bit to indicate that a new privilege mask is to be set,
* otherwise the command will only read the existing mask.
*/
@@ -12396,7 +12774,7 @@
/* Sector type */
#define MC_CMD_XPM_WRITE_SECTOR_IN_TYPE_OFST 4
/* Enum values, see field(s): */
-/* MC_CMD_XPM_READ_SECTOR_OUT/TYPE */
+/* MC_CMD_XPM_READ_SECTOR/MC_CMD_XPM_READ_SECTOR_OUT/TYPE */
/* Sector size */
#define MC_CMD_XPM_WRITE_SECTOR_IN_SIZE_OFST 8
/* Sector data */
@@ -12516,4 +12894,54 @@
/* MC_CMD_XPM_WRITE_TEST_OUT msgresponse */
#define MC_CMD_XPM_WRITE_TEST_OUT_LEN 0
+
+/***********************************/
+/* MC_CMD_EXEC_SIGNED
+ * Check the CMAC of the contents of IMEM and DMEM against the value supplied
+ * and if correct begin execution from the start of IMEM. The caller supplies a
+ * key ID, the length of IMEM and DMEM to validate and the expected CMAC. CMAC
+ * computation runs from the start of IMEM, and from the start of DMEM + 16k,
+ * to match flash booting. The command will respond with EINVAL if the CMAC
+ * does match, otherwise it will respond with success before it jumps to IMEM.
+ */
+#define MC_CMD_EXEC_SIGNED 0x10c
+#undef MC_CMD_0x10c_PRIVILEGE_CTG
+
+#define MC_CMD_0x10c_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_EXEC_SIGNED_IN msgrequest */
+#define MC_CMD_EXEC_SIGNED_IN_LEN 28
+/* the length of code to include in the CMAC */
+#define MC_CMD_EXEC_SIGNED_IN_CODELEN_OFST 0
+/* the length of date to include in the CMAC */
+#define MC_CMD_EXEC_SIGNED_IN_DATALEN_OFST 4
+/* the XPM sector containing the key to use */
+#define MC_CMD_EXEC_SIGNED_IN_KEYSECTOR_OFST 8
+/* the expected CMAC value */
+#define MC_CMD_EXEC_SIGNED_IN_CMAC_OFST 12
+#define MC_CMD_EXEC_SIGNED_IN_CMAC_LEN 16
+
+/* MC_CMD_EXEC_SIGNED_OUT msgresponse */
+#define MC_CMD_EXEC_SIGNED_OUT_LEN 0
+
+
+/***********************************/
+/* MC_CMD_PREPARE_SIGNED
+ * Prepare to upload a signed image. This will scrub the specified length of
+ * the data region, which must be at least as large as the DATALEN supplied to
+ * MC_CMD_EXEC_SIGNED.
+ */
+#define MC_CMD_PREPARE_SIGNED 0x10d
+#undef MC_CMD_0x10d_PRIVILEGE_CTG
+
+#define MC_CMD_0x10d_PRIVILEGE_CTG SRIOV_CTG_ADMIN
+
+/* MC_CMD_PREPARE_SIGNED_IN msgrequest */
+#define MC_CMD_PREPARE_SIGNED_IN_LEN 4
+/* the length of data area to clear */
+#define MC_CMD_PREPARE_SIGNED_IN_DATALEN_OFST 0
+
+/* MC_CMD_PREPARE_SIGNED_OUT msgresponse */
+#define MC_CMD_PREPARE_SIGNED_OUT_LEN 0
+
#endif /* _SIENA_MC_DRIVER_PCOL_H */
diff --git a/sys/dev/sfxge/common/efx_rx.c b/sys/dev/sfxge/common/efx_rx.c
index 3501d6e..2481c86 100644
--- a/sys/dev/sfxge/common/efx_rx.c
+++ b/sys/dev/sfxge/common/efx_rx.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_init(
__in efx_nic_t *enp);
@@ -49,7 +49,7 @@ falconsiena_rx_fini(
__in efx_nic_t *enp);
#if EFSYS_OPT_RX_HDR_SPLIT
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_hdr_split_enable(
__in efx_nic_t *enp,
__in unsigned int hdr_buf_size,
@@ -57,27 +57,27 @@ falconsiena_rx_hdr_split_enable(
#endif /* EFSYS_OPT_RX_HDR_SPLIT */
#if EFSYS_OPT_RX_SCATTER
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scatter_enable(
__in efx_nic_t *enp,
__in unsigned int buf_size);
#endif /* EFSYS_OPT_RX_SCATTER */
#if EFSYS_OPT_RX_SCALE
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scale_mode_set(
__in efx_nic_t *enp,
__in efx_rx_hash_alg_t alg,
__in efx_rx_hash_type_t type,
__in boolean_t insert);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
__in size_t n);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scale_tbl_set(
__in efx_nic_t *enp,
__in_ecount(n) unsigned int *table,
@@ -100,7 +100,7 @@ falconsiena_rx_qpush(
__in unsigned int added,
__inout unsigned int *pushedp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_qflush(
__in efx_rxq_t *erp);
@@ -108,7 +108,7 @@ static void
falconsiena_rx_qenable(
__in efx_rxq_t *erp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -200,12 +200,12 @@ static efx_rx_ops_t __efx_rx_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_init(
__inout efx_nic_t *enp)
{
efx_rx_ops_t *erxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
@@ -259,7 +259,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
enp->en_erxop = NULL;
enp->en_mod_flags &= ~EFX_MOD_RX;
@@ -284,14 +284,14 @@ efx_rx_fini(
}
#if EFSYS_OPT_RX_HDR_SPLIT
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_hdr_split_enable(
__in efx_nic_t *enp,
__in unsigned int hdr_buf_size,
__in unsigned int pld_buf_size)
{
efx_rx_ops_t *erxop = enp->en_erxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -304,19 +304,19 @@ efx_rx_hdr_split_enable(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_HDR_SPLIT */
#if EFSYS_OPT_RX_SCATTER
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_scatter_enable(
__in efx_nic_t *enp,
__in unsigned int buf_size)
{
efx_rx_ops_t *erxop = enp->en_erxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -327,18 +327,18 @@ efx_rx_scatter_enable(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCATTER */
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_hash_support_get(
__in efx_nic_t *enp,
__out efx_rx_hash_support_t *supportp)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -354,17 +354,17 @@ efx_rx_hash_support_get(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_scale_support_get(
__in efx_nic_t *enp,
__out efx_rx_scale_support_t *supportp)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -380,12 +380,12 @@ efx_rx_scale_support_get(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_scale_mode_set(
__in efx_nic_t *enp,
__in efx_rx_hash_alg_t alg,
@@ -393,7 +393,7 @@ efx_rx_scale_mode_set(
__in boolean_t insert)
{
efx_rx_ops_t *erxop = enp->en_erxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -407,20 +407,20 @@ efx_rx_scale_mode_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
__in size_t n)
{
efx_rx_ops_t *erxop = enp->en_erxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -431,21 +431,21 @@ efx_rx_scale_key_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_scale_tbl_set(
__in efx_nic_t *enp,
__in_ecount(n) unsigned int *table,
__in size_t n)
{
efx_rx_ops_t *erxop = enp->en_erxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -456,7 +456,7 @@ efx_rx_scale_tbl_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -493,13 +493,13 @@ efx_rx_qpush(
erxop->erxo_qpush(erp, added, pushedp);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_qflush(
__in efx_rxq_t *erp)
{
efx_nic_t *enp = erp->er_enp;
efx_rx_ops_t *erxop = enp->en_erxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
@@ -509,7 +509,7 @@ efx_rx_qflush(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -526,7 +526,7 @@ efx_rx_qenable(
erxop->erxo_qenable(erp);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_rx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -540,7 +540,7 @@ efx_rx_qcreate(
{
efx_rx_ops_t *erxop = enp->en_erxop;
efx_rxq_t *erp;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
@@ -573,7 +573,7 @@ fail2:
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -623,7 +623,7 @@ efx_rx_qdestroy(
* (16 bits, big-endian, 0 if the packet did not have an inner VLAN tag)
*/
- __checkReturn int
+ __checkReturn efx_rc_t
efx_psuedo_hdr_pkt_length_get(
__in efx_nic_t *enp,
__in uint8_t *buffer,
@@ -678,7 +678,7 @@ efx_psuedo_hdr_hash_get(
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_init(
__in efx_nic_t *enp)
{
@@ -715,7 +715,7 @@ falconsiena_rx_init(
}
#if EFSYS_OPT_RX_HDR_SPLIT
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_hdr_split_enable(
__in efx_nic_t *enp,
__in unsigned int hdr_buf_size,
@@ -724,7 +724,7 @@ falconsiena_rx_hdr_split_enable(
unsigned int nhdr32;
unsigned int npld32;
efx_oword_t oword;
- int rc;
+ efx_rc_t rc;
nhdr32 = hdr_buf_size / 32;
if ((nhdr32 == 0) ||
@@ -762,21 +762,21 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_HDR_SPLIT */
#if EFSYS_OPT_RX_SCATTER
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scatter_enable(
__in efx_nic_t *enp,
__in unsigned int buf_size)
{
unsigned int nbuf32;
efx_oword_t oword;
- int rc;
+ efx_rc_t rc;
nbuf32 = buf_size / 32;
if ((nbuf32 == 0) ||
@@ -806,7 +806,7 @@ falconsiena_rx_scatter_enable(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -880,14 +880,14 @@ fail1:
#if EFSYS_OPT_RX_SCALE
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scale_mode_set(
__in efx_nic_t *enp,
__in efx_rx_hash_alg_t alg,
__in efx_rx_hash_type_t type,
__in boolean_t insert)
{
- int rc;
+ efx_rc_t rc;
switch (alg) {
case EFX_RX_HASHALG_LFSR:
@@ -918,7 +918,7 @@ falconsiena_rx_scale_mode_set(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
EFX_RX_LFSR_HASH(enp, B_FALSE);
@@ -927,7 +927,7 @@ fail1:
#endif
#if EFSYS_OPT_RX_SCALE
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
@@ -936,7 +936,7 @@ falconsiena_rx_scale_key_set(
efx_oword_t oword;
unsigned int byte;
unsigned int offset;
- int rc;
+ efx_rc_t rc;
byte = 0;
@@ -1047,14 +1047,14 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif
#if EFSYS_OPT_RX_SCALE
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_scale_tbl_set(
__in efx_nic_t *enp,
__in_ecount(n) unsigned int *table,
@@ -1062,7 +1062,7 @@ falconsiena_rx_scale_tbl_set(
{
efx_oword_t oword;
int index;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(EFX_RSS_TBL_SIZE == FR_BZ_RX_INDIRECTION_TBL_ROWS);
EFX_STATIC_ASSERT(EFX_MAXRSS == (1 << FRF_BZ_IT_QUEUE_WIDTH));
@@ -1109,7 +1109,7 @@ falconsiena_rx_scale_tbl_set(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1185,7 +1185,7 @@ falconsiena_rx_qpush(
erp->er_index, &dword, B_FALSE);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_qflush(
__in efx_rxq_t *erp)
{
@@ -1223,7 +1223,7 @@ falconsiena_rx_qenable(
erp->er_index, &oword, B_TRUE);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_rx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -1240,7 +1240,7 @@ falconsiena_rx_qcreate(
uint32_t size;
boolean_t split;
boolean_t jumbo;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS ==
(1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH));
@@ -1334,7 +1334,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_sram.c b/sys/dev/sfxge/common/efx_sram.c
index 4bd951b..8624478 100644
--- a/sys/dev/sfxge/common/efx_sram.c
+++ b/sys/dev/sfxge/common/efx_sram.c
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
#include "efx_regs.h"
#include "efx_impl.h"
- __checkReturn int
+ __checkReturn efx_rc_t
efx_sram_buf_tbl_set(
__in efx_nic_t *enp,
__in uint32_t id,
@@ -50,7 +50,7 @@ efx_sram_buf_tbl_set(
efsys_dma_addr_t addr;
efx_oword_t oword;
unsigned int count;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
@@ -158,7 +158,7 @@ fail2:
EFX_BAR_WRITEO(enp, FR_AZ_BUF_TBL_UPD_REG, &oword);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -306,7 +306,7 @@ efx_sram_pattern_fn_t __efx_sram_pattern_fns[] = {
efx_sram_bit_sweep_set
};
- __checkReturn int
+ __checkReturn efx_rc_t
efx_sram_test(
__in efx_nic_t *enp,
__in efx_pattern_type_t type)
diff --git a/sys/dev/sfxge/common/efx_tx.c b/sys/dev/sfxge/common/efx_tx.c
index a2e8769..35fba05 100644
--- a/sys/dev/sfxge/common/efx_tx.c
+++ b/sys/dev/sfxge/common/efx_tx.c
@@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_init(
__in efx_nic_t *enp);
@@ -57,7 +57,7 @@ static void
falconsiena_tx_fini(
__in efx_nic_t *enp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -74,7 +74,7 @@ static void
falconsiena_tx_qdestroy(
__in efx_txq_t *etp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qpost(
__in efx_txq_t *etp,
__in_ecount(n) efx_buffer_t *eb,
@@ -88,12 +88,12 @@ falconsiena_tx_qpush(
__in unsigned int added,
__in unsigned int pushed);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qflush(
__in efx_txq_t *etp);
@@ -101,7 +101,7 @@ static void
falconsiena_tx_qenable(
__in efx_txq_t *etp);
- __checkReturn int
+ __checkReturn efx_rc_t
falconsiena_tx_qdesc_post(
__in efx_txq_t *etp,
__in_ecount(n) efx_desc_t *ed,
@@ -202,12 +202,12 @@ static efx_tx_ops_t __efx_tx_hunt_ops = {
};
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_init(
__in efx_nic_t *enp)
{
efx_tx_ops_t *etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
@@ -263,7 +263,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
enp->en_etxop = NULL;
enp->en_mod_flags &= ~EFX_MOD_TX;
@@ -287,7 +287,7 @@ efx_tx_fini(
enp->en_mod_flags &= ~EFX_MOD_TX;
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -303,7 +303,7 @@ efx_tx_qcreate(
efx_tx_ops_t *etxop = enp->en_etxop;
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_txq_t *etp;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX);
@@ -340,7 +340,7 @@ fail2:
EFSYS_PROBE(fail2);
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -362,7 +362,7 @@ efx_tx_qdestroy(
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_txq_t), etp);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qpost(
__in efx_txq_t *etp,
__in_ecount(n) efx_buffer_t *eb,
@@ -372,7 +372,7 @@ efx_tx_qpost(
{
efx_nic_t *enp = etp->et_enp;
efx_tx_ops_t *etxop = enp->en_etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
@@ -383,7 +383,7 @@ efx_tx_qpost(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -401,14 +401,14 @@ efx_tx_qpush(
etxop->etxo_qpush(etp, added, pushed);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns)
{
efx_nic_t *enp = etp->et_enp;
efx_tx_ops_t *etxop = enp->en_etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
@@ -418,17 +418,17 @@ efx_tx_qpace(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qflush(
__in efx_txq_t *etp)
{
efx_nic_t *enp = etp->et_enp;
efx_tx_ops_t *etxop = enp->en_etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
@@ -438,7 +438,7 @@ efx_tx_qflush(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -454,13 +454,13 @@ efx_tx_qenable(
etxop->etxo_qenable(etp);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qpio_enable(
__in efx_txq_t *etp)
{
efx_nic_t *enp = etp->et_enp;
efx_tx_ops_t *etxop = enp->en_etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
@@ -482,7 +482,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -499,7 +499,7 @@ efx_tx_qpio_disable(
etxop->etxo_qpio_disable(etp);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qpio_write(
__in efx_txq_t *etp,
__in_ecount(buf_length) uint8_t *buffer,
@@ -508,7 +508,7 @@ efx_tx_qpio_write(
{
efx_nic_t *enp = etp->et_enp;
efx_tx_ops_t *etxop = enp->en_etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
@@ -522,11 +522,11 @@ efx_tx_qpio_write(
return (ENOTSUP);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qpio_post(
__in efx_txq_t *etp,
__in size_t pkt_length,
@@ -535,7 +535,7 @@ efx_tx_qpio_post(
{
efx_nic_t *enp = etp->et_enp;
efx_tx_ops_t *etxop = enp->en_etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
@@ -549,11 +549,11 @@ efx_tx_qpio_post(
return (ENOTSUP);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_tx_qdesc_post(
__in efx_txq_t *etp,
__in_ecount(n) efx_desc_t *ed,
@@ -563,7 +563,7 @@ efx_tx_qdesc_post(
{
efx_nic_t *enp = etp->et_enp;
efx_tx_ops_t *etxop = enp->en_etxop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC);
@@ -574,7 +574,7 @@ efx_tx_qdesc_post(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -646,7 +646,7 @@ efx_tx_qstats_update(
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_init(
__in efx_nic_t *enp)
{
@@ -709,7 +709,7 @@ falconsiena_tx_init(
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qpost(
__in efx_txq_t *etp,
__in_ecount(n) efx_buffer_t *eb,
@@ -742,7 +742,7 @@ falconsiena_tx_qpost(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -778,7 +778,7 @@ falconsiena_tx_qpush(
#define EFX_MAX_PACE_VALUE 20
#define EFX_TX_PACE_CLOCK_BASE 104
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns)
@@ -788,7 +788,7 @@ falconsiena_tx_qpace(
efx_oword_t oword;
unsigned int pace_val;
unsigned int timer_period;
- int rc;
+ efx_rc_t rc;
if (ns == 0) {
pace_val = 0;
@@ -816,12 +816,12 @@ falconsiena_tx_qpace(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qflush(
__in efx_txq_t *etp)
{
@@ -865,7 +865,7 @@ falconsiena_tx_qenable(
etp->et_index, &oword, B_TRUE);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_tx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -881,7 +881,7 @@ falconsiena_tx_qcreate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_oword_t oword;
uint32_t size;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(EFX_EV_TX_NLABELS ==
(1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH));
@@ -909,6 +909,8 @@ falconsiena_tx_qcreate(
}
/* Set up the new descriptor queue */
+ *addedp = 0;
+
EFX_POPULATE_OWORD_6(oword,
FRF_AZ_TX_DESCQ_BUF_BASE_ID, id,
FRF_AZ_TX_DESCQ_EVQ_ID, eep->ee_index,
@@ -933,12 +935,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
falconsiena_tx_qdesc_post(
__in efx_txq_t *etp,
__in_ecount(n) efx_desc_t *ed,
@@ -948,7 +950,7 @@ falconsiena_tx_qdesc_post(
{
unsigned int added = *addedp;
unsigned int i;
- int rc;
+ efx_rc_t rc;
if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
rc = ENOSPC;
@@ -975,7 +977,7 @@ falconsiena_tx_qdesc_post(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_vpd.c b/sys/dev/sfxge/common/efx_vpd.c
index 812070a..8c6e993 100644
--- a/sys/dev/sfxge/common/efx_vpd.c
+++ b/sys/dev/sfxge/common/efx_vpd.c
@@ -108,12 +108,12 @@ static efx_vpd_ops_t __efx_vpd_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_init(
__in efx_nic_t *enp)
{
efx_vpd_ops_t *evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -157,18 +157,18 @@ efx_vpd_init(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -179,19 +179,19 @@ efx_vpd_size(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -202,19 +202,19 @@ efx_vpd_read(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -225,19 +225,19 @@ efx_vpd_verify(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -255,12 +255,12 @@ efx_vpd_reinit(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -268,7 +268,7 @@ efx_vpd_get(
__inout efx_vpd_value_t *evvp)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -279,12 +279,12 @@ efx_vpd_get(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_set(
__in efx_nic_t *enp,
__inout_bcount(size) caddr_t data,
@@ -292,7 +292,7 @@ efx_vpd_set(
__in efx_vpd_value_t *evvp)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -303,12 +303,12 @@ efx_vpd_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_next(
__in efx_nic_t *enp,
__inout_bcount(size) caddr_t data,
@@ -317,7 +317,7 @@ efx_vpd_next(
__inout unsigned int *contp)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -328,19 +328,19 @@ efx_vpd_next(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
{
efx_vpd_ops_t *evpdop = enp->en_evpdop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_VPD);
@@ -351,12 +351,12 @@ efx_vpd_write(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_vpd_next_tag(
__in caddr_t data,
__in size_t size,
@@ -369,7 +369,7 @@ efx_vpd_next_tag(
uint8_t name;
uint16_t length;
size_t headlen;
- int rc;
+ efx_rc_t rc;
if (*offsetp >= size) {
rc = EFAULT;
@@ -436,12 +436,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_vpd_next_keyword(
__in_bcount(size) caddr_t tag,
__in size_t size,
@@ -451,7 +451,7 @@ efx_vpd_next_keyword(
{
efx_vpd_keyword_t keyword;
uint8_t length;
- int rc;
+ efx_rc_t rc;
if (pos + 3U > size) {
rc = EFAULT;
@@ -474,12 +474,12 @@ efx_vpd_next_keyword(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_hunk_length(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -488,7 +488,7 @@ efx_vpd_hunk_length(
efx_vpd_tag_t tag;
unsigned int offset;
uint16_t taglen;
- int rc;
+ efx_rc_t rc;
offset = 0;
_NOTE(CONSTANTCONDITION)
@@ -506,12 +506,12 @@ efx_vpd_hunk_length(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_hunk_verify(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -526,7 +526,7 @@ efx_vpd_hunk_verify(
uint8_t keylen;
uint8_t cksum;
boolean_t cksummed = B_FALSE;
- int rc;
+ efx_rc_t rc;
/*
* Parse every tag,keyword in the existing VPD. If the csum is present,
@@ -545,8 +545,10 @@ efx_vpd_hunk_verify(
for (pos = 0; pos != taglen; pos += 3 + keylen) {
/* RV keyword must be the last in the block */
- if (cksummed)
+ if (cksummed) {
+ rc = EFAULT;
goto fail2;
+ }
if ((rc = efx_vpd_next_keyword(data + offset,
taglen, pos, &keyword, &keylen)) != 0)
@@ -589,7 +591,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -610,7 +612,7 @@ static uint8_t __efx_vpd_blank_r[] = {
0x00,
};
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_hunk_reinit(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -620,7 +622,7 @@ efx_vpd_hunk_reinit(
unsigned int pos;
efx_byte_t byte;
uint8_t cksum;
- int rc;
+ efx_rc_t rc;
if (size < 0x100) {
rc = ENOSPC;
@@ -653,12 +655,12 @@ efx_vpd_hunk_reinit(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_hunk_next(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -676,7 +678,7 @@ efx_vpd_hunk_next(
uint16_t taglen;
uint8_t keylen;
uint8_t paylen;
- int rc;
+ efx_rc_t rc;
offset = index = 0;
_NOTE(CONSTANTCONDITION)
@@ -729,12 +731,12 @@ done:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_hunk_get(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -749,7 +751,7 @@ efx_vpd_hunk_get(
unsigned int pos;
uint16_t taglen;
uint8_t keylen;
- int rc;
+ efx_rc_t rc;
offset = 0;
_NOTE(CONSTANTCONDITION)
@@ -791,12 +793,12 @@ efx_vpd_hunk_get(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_vpd_hunk_set(
__in_bcount(size) caddr_t data,
__in size_t size,
@@ -815,7 +817,7 @@ efx_vpd_hunk_set(
uint8_t keylen;
uint8_t cksum;
size_t used;
- int rc;
+ efx_rc_t rc;
switch (evvp->evv_tag) {
case EFX_VPD_ID:
@@ -1005,7 +1007,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/efx_wol.c b/sys/dev/sfxge/common/efx_wol.c
index 2e1b4a1..d0d1fa0 100644
--- a/sys/dev/sfxge/common/efx_wol.c
+++ b/sys/dev/sfxge/common/efx_wol.c
@@ -38,12 +38,12 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_WOL
- __checkReturn int
+ __checkReturn efx_rc_t
efx_wol_init(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -62,19 +62,19 @@ efx_wol_init(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_wol_filter_clear(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_WOL_FILTER_RESET_IN_LEN,
MC_CMD_WOL_FILTER_RESET_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
@@ -100,12 +100,12 @@ efx_wol_filter_clear(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_wol_filter_add(
__in efx_nic_t *enp,
__in efx_wol_type_t type,
@@ -116,7 +116,7 @@ efx_wol_filter_add(
uint8_t payload[MAX(MC_CMD_WOL_FILTER_SET_IN_LEN,
MC_CMD_WOL_FILTER_SET_OUT_LEN)];
efx_byte_t link_mask;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
@@ -222,12 +222,12 @@ efx_wol_filter_add(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_wol_filter_remove(
__in efx_nic_t *enp,
__in uint32_t filter_id)
@@ -235,7 +235,7 @@ efx_wol_filter_remove(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_WOL_FILTER_REMOVE_IN_LEN,
MC_CMD_WOL_FILTER_REMOVE_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
@@ -259,13 +259,13 @@ efx_wol_filter_remove(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_lightsout_offload_add(
__in efx_nic_t *enp,
__in efx_lightsout_offload_type_t type,
@@ -276,7 +276,7 @@ efx_lightsout_offload_add(
uint8_t payload[MAX(MAX(MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_ARP_LEN,
MC_CMD_ADD_LIGHTSOUT_OFFLOAD_IN_NS_LEN),
MC_CMD_ADD_LIGHTSOUT_OFFLOAD_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
@@ -341,13 +341,13 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_lightsout_offload_remove(
__in efx_nic_t *enp,
__in efx_lightsout_offload_type_t type,
@@ -356,7 +356,7 @@ efx_lightsout_offload_remove(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_IN_LEN,
MC_CMD_REMOVE_LIGHTSOUT_OFFLOAD_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_WOL);
@@ -397,7 +397,7 @@ efx_lightsout_offload_remove(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_ev.c b/sys/dev/sfxge/common/hunt_ev.c
index 8e5cf89..b5585bb 100644
--- a/sys/dev/sfxge/common/hunt_ev.c
+++ b/sys/dev/sfxge/common/hunt_ev.c
@@ -89,7 +89,7 @@ hunt_ev_mcdi(
__in_opt void *arg);
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_init_evq(
__in efx_nic_t *enp,
__in unsigned int instance,
@@ -107,7 +107,7 @@ efx_mcdi_init_evq(
int npages;
int i;
int supports_rx_batching;
- int rc;
+ efx_rc_t rc;
npages = EFX_EVQ_NBUFS(nevs);
if (MC_CMD_INIT_EVQ_IN_LEN(npages) > MC_CMD_INIT_EVQ_IN_LENMAX) {
@@ -188,12 +188,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_fini_evq(
__in efx_nic_t *enp,
__in uint32_t instance)
@@ -201,7 +201,7 @@ efx_mcdi_fini_evq(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_FINI_EVQ_IN_LEN,
MC_CMD_FINI_EVQ_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FINI_EVQ;
@@ -222,14 +222,14 @@ efx_mcdi_fini_evq(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_init(
__in efx_nic_t *enp)
{
@@ -244,7 +244,7 @@ hunt_ev_fini(
_NOTE(ARGUNUSED(enp))
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -255,7 +255,7 @@ hunt_ev_qcreate(
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t irq;
- int rc;
+ efx_rc_t rc;
_NOTE(ARGUNUSED(id)) /* buftbl id managed by MC */
EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS));
@@ -293,7 +293,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -309,7 +309,7 @@ hunt_ev_qdestroy(
(void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count)
@@ -350,7 +350,7 @@ hunt_ev_qprime(
return (0);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_driver_event(
__in efx_nic_t *enp,
__in uint32_t evq,
@@ -359,7 +359,7 @@ efx_mcdi_driver_event(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_DRIVER_EVENT_IN_LEN,
MC_CMD_DRIVER_EVENT_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
req.emr_cmd = MC_CMD_DRIVER_EVENT;
req.emr_in_buf = payload;
@@ -384,7 +384,7 @@ efx_mcdi_driver_event(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -405,7 +405,7 @@ hunt_ev_qpost(
(void) efx_mcdi_driver_event(enp, eep->ee_index, event);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us)
@@ -414,7 +414,7 @@ hunt_ev_qmoderate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_dword_t dword;
uint32_t timer_val, mode;
- int rc;
+ efx_rc_t rc;
if (us > encp->enc_evq_timer_max_us) {
rc = EINVAL;
@@ -455,7 +455,7 @@ hunt_ev_qmoderate(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -492,7 +492,9 @@ hunt_ev_rx(
{
efx_nic_t *enp = eep->ee_enp;
uint32_t size;
+#if 0
boolean_t parse_err;
+#endif
uint32_t label;
uint32_t mcast;
uint32_t eth_base_class;
@@ -528,14 +530,21 @@ hunt_ev_rx(
if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_CONT) != 0) {
/*
+ * This may be part of a scattered frame, or it may be a
+ * truncated frame if scatter is disabled on this RXQ.
+ * Overlength frames can be received if e.g. a VF is configured
+ * for 1500 MTU but connected to a port set to 9000 MTU
+ * (see bug56567).
* FIXME: There is not yet any driver that supports scatter on
* Huntington. Scatter support is required for OSX.
*/
- EFSYS_ASSERT(0);
flags |= EFX_PKT_CONT;
}
+#if 0
+ /* TODO What to do if the packet is flagged with parsing error */
parse_err = (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_PARSE_INCOMPLETE) != 0);
+#endif
label = EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_QLABEL);
if (EFX_QWORD_FIELD(*eqp, ESF_DZ_RX_ECRC_ERR) != 0) {
@@ -619,7 +628,9 @@ hunt_ev_rx(
switch (l3_class) {
case ESE_DZ_L3_CLASS_RSVD7: /* Used by firmware for packet overrun */
+#if 0
parse_err = B_TRUE;
+#endif
flags |= EFX_DISCARD;
break;
@@ -830,7 +841,7 @@ hunt_ev_mcdi(
#if EFSYS_OPT_MON_STATS
efx_mon_stat_t id;
efx_mon_stat_value_t value;
- int rc;
+ efx_rc_t rc;
/* Decode monitor stat for MCDI sensor (if supported) */
if ((rc = mcdi_mon_ev(enp, eqp, &id, &value)) == 0) {
diff --git a/sys/dev/sfxge/common/hunt_filter.c b/sys/dev/sfxge/common/hunt_filter.c
index 27af7c3..0666d9d 100644
--- a/sys/dev/sfxge/common/hunt_filter.c
+++ b/sys/dev/sfxge/common/hunt_filter.c
@@ -117,11 +117,11 @@ hunt_filter_set_entry_not_auto_old(
EFSYS_ASSERT(hunt_filter_entry_spec(hftp, index) != NULL);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_init(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
hunt_filter_table_t *hftp;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -161,7 +161,7 @@ hunt_filter_init(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -178,7 +178,7 @@ hunt_filter_fini(
}
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_filter_op_add(
__in efx_nic_t *enp,
__in efx_filter_spec_t *spec,
@@ -189,7 +189,7 @@ efx_mcdi_filter_op_add(
uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN,
MC_CMD_FILTER_OP_OUT_LEN)];
uint32_t match_fields = 0;
- int rc;
+ efx_rc_t rc;
memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FILTER_OP;
@@ -312,13 +312,13 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_filter_op_delete(
__in efx_nic_t *enp,
__in unsigned int filter_op,
@@ -327,7 +327,7 @@ efx_mcdi_filter_op_delete(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN,
MC_CMD_FILTER_OP_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FILTER_OP;
@@ -374,7 +374,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -477,7 +477,7 @@ hunt_filter_is_exclusive(
return (B_FALSE);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_restore(
__in efx_nic_t *enp)
{
@@ -486,7 +486,7 @@ hunt_filter_restore(
hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table;
boolean_t restoring;
int state;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -533,7 +533,7 @@ hunt_filter_restore(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -544,14 +544,14 @@ fail1:
*/
#define EFX_HUNT_FILTER_SEARCH_LIMIT 200
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_filter_add_internal(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec,
__in boolean_t may_replace,
__out_opt uint32_t *filter_id)
{
- int rc;
+ efx_rc_t rc;
hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table;
efx_filter_spec_t *saved_spec;
uint32_t hash;
@@ -723,7 +723,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
if (locked)
EFSYS_UNLOCK(enp->en_eslp, state);
@@ -731,13 +731,13 @@ fail1:
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_add(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec,
__in boolean_t may_replace)
{
- int rc;
+ efx_rc_t rc;
rc = hunt_filter_add_internal(enp, spec, may_replace, NULL);
if (rc != 0)
@@ -746,18 +746,18 @@ hunt_filter_add(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_filter_delete_internal(
__in efx_nic_t *enp,
__in uint32_t filter_id)
{
- int rc;
+ efx_rc_t rc;
hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
efx_filter_spec_t *spec;
int state;
@@ -818,17 +818,17 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_delete(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec)
{
- int rc;
+ efx_rc_t rc;
hunt_filter_table_t *table = enp->en_filter.ef_hunt_filter_table;
efx_filter_spec_t *saved_spec;
unsigned int hash;
@@ -872,7 +872,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
if (locked)
EFSYS_UNLOCK(enp->en_eslp, state);
@@ -880,7 +880,7 @@ fail1:
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_parser_disp_info(
__in efx_nic_t *enp,
__out uint32_t *list,
@@ -889,7 +889,7 @@ efx_mcdi_get_parser_disp_info(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_PARSER_DISP_INFO_IN_LEN,
MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX)];
- int rc;
+ efx_rc_t rc;
uint32_t i;
boolean_t support_unknown_ucast = B_FALSE;
boolean_t support_unknown_mcast = B_FALSE;
@@ -955,18 +955,18 @@ efx_mcdi_get_parser_disp_info(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_supported_filters(
__in efx_nic_t *enp,
__out uint32_t *list,
__out size_t *length)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_get_parser_disp_info(enp, list, length) != 0))
goto fail1;
@@ -974,12 +974,12 @@ hunt_filter_supported_filters(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_filter_unicast_refresh(
__in efx_nic_t *enp,
__in_ecount(6) uint8_t const *addr,
@@ -988,7 +988,7 @@ hunt_filter_unicast_refresh(
{
hunt_filter_table_t *hftp = enp->en_filter.ef_hunt_filter_table;
efx_filter_spec_t spec;
- int rc;
+ efx_rc_t rc;
if (all_unicst == B_TRUE)
goto use_uc_def;
@@ -1028,7 +1028,7 @@ use_uc_def:
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
if (hftp->hft_unicst_filter_set != B_FALSE) {
(void) hunt_filter_delete_internal(enp,
@@ -1040,7 +1040,7 @@ fail1:
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_filter_multicast_refresh(
__in efx_nic_t *enp,
__in boolean_t mulcst,
@@ -1054,7 +1054,7 @@ hunt_filter_multicast_refresh(
efx_filter_spec_t spec;
uint8_t addr[6];
unsigned i;
- int rc;
+ efx_rc_t rc;
if (all_mulcst == B_TRUE)
goto use_mc_def;
@@ -1142,21 +1142,21 @@ use_mc_def:
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_filter_get_workarounds(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &enp->en_nic_cfg;
uint32_t implemented = 0;
uint32_t enabled = 0;
- int rc;
+ efx_rc_t rc;
rc = efx_mcdi_get_workarounds(enp, &implemented, &enabled);
if (rc == 0) {
@@ -1178,7 +1178,7 @@ hunt_filter_get_workarounds(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
@@ -1191,7 +1191,7 @@ fail1:
* return ENOTSUP (Note the filters for the specified addresses are
* still applied in this case).
*/
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_reconfigure(
__in efx_nic_t *enp,
__in_ecount(6) uint8_t const *mac_addr,
@@ -1207,7 +1207,7 @@ hunt_filter_reconfigure(
unsigned i;
int all_unicst_rc;
int all_mulcst_rc;
- int rc;
+ efx_rc_t rc;
if (table->hft_default_rxq == NULL) {
/*
@@ -1316,7 +1316,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
/* Clear auto old flags */
for (i = 0; i < EFX_ARRAY_SIZE(table->hft_entry); i++) {
diff --git a/sys/dev/sfxge/common/hunt_impl.h b/sys/dev/sfxge/common/hunt_impl.h
index 0aa4ae5..075a2b8 100644
--- a/sys/dev/sfxge/common/hunt_impl.h
+++ b/sys/dev/sfxge/common/hunt_impl.h
@@ -55,7 +55,7 @@ extern "C" {
/* EV */
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_init(
__in efx_nic_t *enp);
@@ -63,7 +63,7 @@ hunt_ev_init(
hunt_ev_fini(
__in efx_nic_t *enp);
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -76,7 +76,7 @@ hunt_ev_qcreate(
hunt_ev_qdestroy(
__in efx_evq_t *eep);
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count);
@@ -86,7 +86,7 @@ hunt_ev_qpost(
__in efx_evq_t *eep,
__in uint16_t data);
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us);
@@ -111,7 +111,7 @@ hunt_ev_rxlabel_fini(
/* INTR */
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -129,7 +129,7 @@ hunt_intr_disable(
hunt_intr_disable_unlocked(
__in efx_nic_t *enp);
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level);
@@ -140,38 +140,38 @@ hunt_intr_fini(
/* NIC */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_probe(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_set_drv_limits(
__inout efx_nic_t *enp,
__in efx_drv_limits_t *edlp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_get_vi_pool(
__in efx_nic_t *enp,
__out uint32_t *vi_countp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_get_bar_region(
__in efx_nic_t *enp,
__in efx_nic_region_t region,
__out uint32_t *offsetp,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_reset(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_init(
__in efx_nic_t *enp);
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_register_test(
__in efx_nic_t *enp);
@@ -188,29 +188,29 @@ hunt_nic_unprobe(
/* MAC */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_poll(
__in efx_nic_t *enp,
__out efx_link_mode_t *link_modep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_addr_set(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_reconfigure(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_multicast_list_set(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_filter_default_rxq_set(
__in efx_nic_t *enp,
__in efx_rxq_t *erp,
@@ -222,7 +222,7 @@ hunt_mac_filter_default_rxq_clear(
#if EFSYS_OPT_LOOPBACK
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
@@ -232,12 +232,12 @@ hunt_mac_loopback_set(
#if EFSYS_OPT_MAC_STATS
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
- __out_opt uint32_t *generationp);
+ __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
+ __inout_opt uint32_t *generationp);
#endif /* EFSYS_OPT_MAC_STATS */
@@ -246,7 +246,7 @@ hunt_mac_stats_update(
#if EFSYS_OPT_MCDI
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mcdi_init(
__in efx_nic_t *enp,
__in const efx_mcdi_transport_t *mtp);
@@ -272,36 +272,41 @@ hunt_mcdi_request_copyout(
__in efx_nic_t *enp,
__in efx_mcdi_req_t *emrp);
-extern int
+extern efx_rc_t
hunt_mcdi_poll_reboot(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mcdi_fw_update_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_mcdi_macaddr_change_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+hunt_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
#endif /* EFSYS_OPT_MCDI */
/* NVRAM */
#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_buf_read_tlv(
__in efx_nic_t *enp,
- __in_bcount(partn_size) caddr_t partn_data,
- __in size_t partn_size,
+ __in_bcount(max_seg_size) caddr_t seg_data,
+ __in size_t max_seg_size,
__in uint32_t tag,
__deref_out_bcount_opt(*sizep) caddr_t *datap,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_buf_write_tlv(
__inout_bcount(partn_size) caddr_t partn_data,
__in size_t partn_size,
@@ -310,7 +315,7 @@ hunt_nvram_buf_write_tlv(
__in size_t tag_size,
__out size_t *total_lengthp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_partn_read_tlv(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -318,7 +323,7 @@ hunt_nvram_partn_read_tlv(
__deref_out_bcount_opt(*sizep) caddr_t *datap,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_partn_write_tlv(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -326,18 +331,27 @@ hunt_nvram_partn_write_tlv(
__in_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
+hunt_nvram_partn_write_segment_tlv(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __in boolean_t all_segments);
+
+extern __checkReturn efx_rc_t
hunt_nvram_partn_size(
__in efx_nic_t *enp,
__in unsigned int partn,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_partn_lock(
__in efx_nic_t *enp,
__in unsigned int partn);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_partn_read(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -345,14 +359,14 @@ hunt_nvram_partn_read(
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_partn_erase(
__in efx_nic_t *enp,
__in unsigned int partn,
__in unsigned int offset,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_partn_write(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -371,32 +385,32 @@ hunt_nvram_partn_unlock(
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_test(
__in efx_nic_t *enp);
#endif /* EFSYS_OPT_DIAG */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_size(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_get_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out uint32_t *subtypep,
__out_ecount(4) uint16_t version[4]);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_rw_start(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *pref_chunkp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_read_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -404,12 +418,12 @@ hunt_nvram_read_chunk(
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_erase(
__in efx_nic_t *enp,
__in efx_nvram_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_write_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -422,13 +436,13 @@ hunt_nvram_rw_finish(
__in efx_nic_t *enp,
__in efx_nvram_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_partn_set_version(
__in efx_nic_t *enp,
__in unsigned int partn,
__in_ecount(4) uint16_t version[4]);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -456,36 +470,36 @@ hunt_phy_link_ev(
__in efx_qword_t *eqp,
__out efx_link_mode_t *link_modep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_get_link(
__in efx_nic_t *enp,
__out hunt_link_state_t *hlsp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_power(
__in efx_nic_t *enp,
__in boolean_t on);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_reconfigure(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_verify(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip);
#if EFSYS_OPT_PHY_STATS
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_PHY_NSTATS) uint32_t *stat);
+ __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat);
#endif /* EFSYS_OPT_PHY_STATS */
@@ -500,14 +514,14 @@ hunt_phy_prop_name(
#endif /* EFSYS_OPT_NAMES */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
__in uint32_t flags,
__out uint32_t *valp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -517,16 +531,16 @@ hunt_phy_prop_set(
#if EFSYS_OPT_BIST
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_bist_enable_offline(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_bist_poll(
__in efx_nic_t *enp,
__in efx_bist_type_t type,
@@ -549,7 +563,7 @@ hunt_bist_stop(
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_sram_test(
__in efx_nic_t *enp,
__in efx_sram_pattern_fn_t func);
@@ -559,7 +573,7 @@ hunt_sram_test(
/* TX */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_init(
__in efx_nic_t *enp);
@@ -567,7 +581,7 @@ extern void
hunt_tx_fini(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -584,7 +598,7 @@ extern void
hunt_tx_qdestroy(
__in efx_txq_t *etp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qpost(
__in efx_txq_t *etp,
__in_ecount(n) efx_buffer_t *eb,
@@ -598,12 +612,12 @@ hunt_tx_qpush(
__in unsigned int added,
__in unsigned int pushed);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qflush(
__in efx_txq_t *etp);
@@ -611,7 +625,7 @@ extern void
hunt_tx_qenable(
__in efx_txq_t *etp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qpio_enable(
__in efx_txq_t *etp);
@@ -619,21 +633,21 @@ extern void
hunt_tx_qpio_disable(
__in efx_txq_t *etp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qpio_write(
__in efx_txq_t *etp,
__in_ecount(buf_length) uint8_t *buffer,
__in size_t buf_length,
__in size_t pio_buf_offset);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qpio_post(
__in efx_txq_t *etp,
__in size_t pkt_length,
__in unsigned int completed,
__inout unsigned int *addedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_tx_qdesc_post(
__in efx_txq_t *etp,
__in_ecount(n) efx_desc_t *ed,
@@ -714,7 +728,7 @@ typedef uint32_t efx_piobuf_handle_t;
#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1)
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_pio_alloc(
__inout efx_nic_t *enp,
__out uint32_t *bufnump,
@@ -723,19 +737,19 @@ hunt_nic_pio_alloc(
__out uint32_t *offsetp,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_pio_free(
__inout efx_nic_t *enp,
__in uint32_t bufnum,
__in uint32_t blknum);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_pio_link(
__inout efx_nic_t *enp,
__in uint32_t vi_index,
__in efx_piobuf_handle_t handle);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_nic_pio_unlink(
__inout efx_nic_t *enp,
__in uint32_t vi_index);
@@ -745,48 +759,48 @@ hunt_nic_pio_unlink(
#if EFSYS_OPT_VPD
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_init(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__inout efx_vpd_value_t *evvp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_set(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__in efx_vpd_value_t *evvp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_next(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -794,7 +808,7 @@ hunt_vpd_next(
__out efx_vpd_value_t *evvp,
__inout unsigned int *contp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -809,12 +823,12 @@ hunt_vpd_fini(
/* RX */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_init(
__in efx_nic_t *enp);
#if EFSYS_OPT_RX_HDR_SPLIT
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_hdr_split_enable(
__in efx_nic_t *enp,
__in unsigned int hdr_buf_size,
@@ -822,7 +836,7 @@ hunt_rx_hdr_split_enable(
#endif /* EFSYS_OPT_RX_HDR_SPLIT */
#if EFSYS_OPT_RX_SCATTER
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_scatter_enable(
__in efx_nic_t *enp,
__in unsigned int buf_size);
@@ -831,20 +845,20 @@ hunt_rx_scatter_enable(
#if EFSYS_OPT_RX_SCALE
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_scale_mode_set(
__in efx_nic_t *enp,
__in efx_rx_hash_alg_t alg,
__in efx_rx_hash_type_t type,
__in boolean_t insert);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
__in size_t n);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_scale_tbl_set(
__in efx_nic_t *enp,
__in_ecount(n) unsigned int *table,
@@ -867,7 +881,7 @@ hunt_rx_qpush(
__in unsigned int added,
__inout unsigned int *pushedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_qflush(
__in efx_rxq_t *erp);
@@ -875,7 +889,7 @@ extern void
hunt_rx_qenable(
__in efx_rxq_t *erp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_rx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -931,7 +945,7 @@ typedef struct hunt_filter_table_s {
uint32_t hft_mulcst_filter_count;
} hunt_filter_table_t;
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_init(
__in efx_nic_t *enp);
@@ -939,28 +953,28 @@ hunt_filter_init(
hunt_filter_fini(
__in efx_nic_t *enp);
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_restore(
__in efx_nic_t *enp);
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_add(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec,
__in boolean_t may_replace);
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_filter_delete(
__in efx_nic_t *enp,
__inout efx_filter_spec_t *spec);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_filter_supported_filters(
__in efx_nic_t *enp,
__out uint32_t *list,
__out size_t *length);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_filter_reconfigure(
__in efx_nic_t *enp,
__in_ecount(6) uint8_t const *mac_addr,
@@ -990,7 +1004,7 @@ hunt_filter_default_rxq_clear(
#endif /* EFSYS_OPT_FILTER */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_pktfilter_set(
__in efx_nic_t *enp,
__in boolean_t unicst,
@@ -998,7 +1012,7 @@ hunt_pktfilter_set(
#if EFSYS_OPT_MCAST_FILTER_LIST
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_pktfilter_mcast_set(
__in efx_nic_t *enp,
__in uint8_t const *addrs,
@@ -1006,17 +1020,17 @@ hunt_pktfilter_mcast_set(
#endif /* EFSYS_OPT_MCAST_FILTER_LIST */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_pktfilter_mcast_all(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_get_function_info(
__in efx_nic_t *enp,
__out uint32_t *pfp,
__out_opt uint32_t *vfp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
efx_mcdi_privilege_mask(
__in efx_nic_t *enp,
__in uint32_t pf,
diff --git a/sys/dev/sfxge/common/hunt_intr.c b/sys/dev/sfxge/common/hunt_intr.c
index b68135c..d5e977a 100644
--- a/sys/dev/sfxge/common/hunt_intr.c
+++ b/sys/dev/sfxge/common/hunt_intr.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_HUNTINGTON
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -73,7 +73,7 @@ hunt_intr_disable_unlocked(
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_trigger_interrupt(
__in efx_nic_t *enp,
__in unsigned int level)
@@ -81,7 +81,7 @@ efx_mcdi_trigger_interrupt(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_TRIGGER_INTERRUPT_IN_LEN,
MC_CMD_TRIGGER_INTERRUPT_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -112,18 +112,18 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- int rc;
+ efx_rc_t rc;
if (encp->enc_bug41750_workaround) {
/* bug 41750: Test interrupts don't work on Greenport */
@@ -139,7 +139,7 @@ hunt_intr_trigger(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_mac.c b/sys/dev/sfxge/common/hunt_mac.c
index be9eb37..5d5d26f 100644
--- a/sys/dev/sfxge/common/hunt_mac.c
+++ b/sys/dev/sfxge/common/hunt_mac.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_HUNTINGTON
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mac_poll(
__in efx_nic_t *enp,
__out efx_link_mode_t *link_modep)
@@ -50,7 +50,7 @@ hunt_mac_poll(
efx_port_t *epp = &(enp->en_port);
hunt_link_state_t hls;
- int rc;
+ efx_rc_t rc;
if ((rc = hunt_phy_get_link(enp, &hls)) != 0)
goto fail1;
@@ -63,14 +63,14 @@ hunt_mac_poll(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
*link_modep = EFX_LINK_UNKNOWN;
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp)
@@ -81,7 +81,7 @@ hunt_mac_up(
*/
hunt_link_state_t hls;
- int rc;
+ efx_rc_t rc;
/*
* Because Huntington doesn't *require* polling, we can't rely on
@@ -95,7 +95,7 @@ hunt_mac_up(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -107,7 +107,7 @@ fail1:
* MC_CMD_VADAPTOR_SET_MAC requires mac-spoofing privilege and
* the port to have no filters or queues active.
*/
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_vadapter_set_mac(
__in efx_nic_t *enp)
{
@@ -115,7 +115,7 @@ efx_mcdi_vadapter_set_mac(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_VADAPTOR_SET_MAC_IN_LEN,
MC_CMD_VADAPTOR_SET_MAC_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_VADAPTOR_SET_MAC;
@@ -139,16 +139,16 @@ efx_mcdi_vadapter_set_mac(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mac_addr_set(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_vadapter_set_mac(enp)) != 0) {
if (rc != ENOTSUP)
@@ -165,12 +165,12 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-__checkReturn int
+__checkReturn efx_rc_t
hunt_mac_reconfigure(
__in efx_nic_t *enp)
{
@@ -178,7 +178,7 @@ hunt_mac_reconfigure(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_SET_MAC_IN_LEN,
MC_CMD_SET_MAC_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_MAC;
@@ -242,18 +242,18 @@ hunt_mac_reconfigure(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mac_multicast_list_set(
__in efx_nic_t *enp)
{
efx_port_t *epp = &(enp->en_port);
efx_mac_ops_t *emop = epp->ep_emop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -265,12 +265,12 @@ hunt_mac_multicast_list_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mac_filter_default_rxq_set(
__in efx_nic_t *enp,
__in efx_rxq_t *erp,
@@ -279,7 +279,7 @@ hunt_mac_filter_default_rxq_set(
efx_port_t *epp = &(enp->en_port);
efx_rxq_t *old_rxq;
boolean_t old_using_rss;
- int rc;
+ efx_rc_t rc;
hunt_filter_get_default_rxq(enp, &old_rxq, &old_using_rss);
@@ -297,7 +297,7 @@ hunt_mac_filter_default_rxq_set(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
hunt_filter_default_rxq_set(enp, old_rxq, old_using_rss);
@@ -322,7 +322,7 @@ hunt_mac_filter_default_rxq_clear(
#if EFSYS_OPT_LOOPBACK
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mac_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
@@ -337,7 +337,7 @@ hunt_mac_loopback_set(
efx_phy_ops_t *epop = epp->ep_epop;
efx_loopback_type_t old_loopback_type;
efx_link_mode_t old_loopback_link_mode;
- int rc;
+ efx_rc_t rc;
/* The PHY object handles this on Huntington */
old_loopback_type = epp->ep_loopback_type;
@@ -351,7 +351,7 @@ hunt_mac_loopback_set(
return (0);
fail1:
- EFSYS_PROBE(fail2);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
epp->ep_loopback_type = old_loopback_type;
epp->ep_loopback_link_mode = old_loopback_link_mode;
@@ -367,12 +367,12 @@ fail1:
EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp)
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
- __out_opt uint32_t *generationp)
+ __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
+ __inout_opt uint32_t *generationp)
{
efx_qword_t value;
efx_qword_t generation_start;
diff --git a/sys/dev/sfxge/common/hunt_mcdi.c b/sys/dev/sfxge/common/hunt_mcdi.c
index 8782bcc..1a694a1 100644
--- a/sys/dev/sfxge/common/hunt_mcdi.c
+++ b/sys/dev/sfxge/common/hunt_mcdi.c
@@ -76,14 +76,14 @@ typedef enum efx_mcdi_header_type_e {
*/
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mcdi_init(
__in efx_nic_t *enp,
__in const efx_mcdi_transport_t *emtp)
{
efsys_mem_t *esmp = emtp->emt_dma_mem;
efx_dword_t dword;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_features & EFX_FEATURE_MCDI_DMA);
@@ -117,7 +117,7 @@ hunt_mcdi_init(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -143,6 +143,7 @@ hunt_mcdi_request_copyin(
efsys_mem_t *esmp = emtp->emt_dma_mem;
efx_mcdi_header_type_t hdr_type;
efx_dword_t dword;
+ efx_dword_t hdr[2];
unsigned int xflags;
unsigned int pos;
size_t offset;
@@ -160,7 +161,7 @@ hunt_mcdi_request_copyin(
if (hdr_type == EFX_MCDI_HEADER_TYPE_V2) {
/* Construct MCDI v2 header */
- EFX_POPULATE_DWORD_8(dword,
+ EFX_POPULATE_DWORD_8(hdr[0],
MCDI_HEADER_CODE, MC_CMD_V2_EXTN,
MCDI_HEADER_RESYNC, 1,
MCDI_HEADER_DATALEN, 0,
@@ -169,17 +170,17 @@ hunt_mcdi_request_copyin(
MCDI_HEADER_ERROR, 0,
MCDI_HEADER_RESPONSE, 0,
MCDI_HEADER_XFLAGS, xflags);
- EFSYS_MEM_WRITED(esmp, offset, &dword);
- offset += sizeof (dword);
+ EFSYS_MEM_WRITED(esmp, offset, &hdr[0]);
+ offset += sizeof (efx_dword_t);
- EFX_POPULATE_DWORD_2(dword,
+ EFX_POPULATE_DWORD_2(hdr[1],
MC_CMD_V2_EXTN_IN_EXTENDED_CMD, emrp->emr_cmd,
MC_CMD_V2_EXTN_IN_ACTUAL_LEN, emrp->emr_in_length);
- EFSYS_MEM_WRITED(esmp, offset, &dword);
- offset += sizeof (dword);
+ EFSYS_MEM_WRITED(esmp, offset, &hdr[1]);
+ offset += sizeof (efx_dword_t);
} else {
/* Construct MCDI v1 header */
- EFX_POPULATE_DWORD_8(dword,
+ EFX_POPULATE_DWORD_8(hdr[0],
MCDI_HEADER_CODE, emrp->emr_cmd,
MCDI_HEADER_RESYNC, 1,
MCDI_HEADER_DATALEN, emrp->emr_in_length,
@@ -188,9 +189,17 @@ hunt_mcdi_request_copyin(
MCDI_HEADER_ERROR, 0,
MCDI_HEADER_RESPONSE, 0,
MCDI_HEADER_XFLAGS, xflags);
- EFSYS_MEM_WRITED(esmp, offset, &dword);
- offset += sizeof (dword);
+ EFSYS_MEM_WRITED(esmp, 0, &hdr[0]);
+ offset += sizeof (efx_dword_t);
+ }
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST,
+ &hdr, offset,
+ emrp->emr_in_buf, emrp->emr_in_length);
}
+#endif /* EFSYS_OPT_MCDI_LOGGING */
/* Construct the payload */
for (pos = 0; pos < emrp->emr_in_length; pos += sizeof (efx_dword_t)) {
@@ -224,8 +233,7 @@ hunt_mcdi_request_copyout(
efsys_mem_t *esmp = emtp->emt_dma_mem;
unsigned int pos;
unsigned int offset;
- efx_dword_t hdr;
- efx_dword_t hdr2;
+ efx_dword_t hdr[2];
efx_dword_t data;
size_t bytes;
@@ -233,16 +241,16 @@ hunt_mcdi_request_copyout(
return;
/* Read the command header to detect MCDI response format */
- EFSYS_MEM_READD(esmp, 0, &hdr);
- if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
+ EFSYS_MEM_READD(esmp, 0, &hdr[0]);
+ if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
offset = 2 * sizeof (efx_dword_t);
/*
* Read the actual payload length. The length given in the event
* is only correct for responses with the V1 format.
*/
- EFSYS_MEM_READD(esmp, sizeof (efx_dword_t), &hdr2);
- emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr2,
+ EFSYS_MEM_READD(esmp, sizeof (efx_dword_t), &hdr[1]);
+ emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1],
MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
} else {
offset = sizeof (efx_dword_t);
@@ -255,6 +263,15 @@ hunt_mcdi_request_copyout(
memcpy(MCDI_OUT(*emrp, efx_dword_t, pos), &data,
MIN(sizeof (data), bytes - pos));
}
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ emtp->emt_logger(emtp->emt_context,
+ EFX_LOG_MCDI_RESPONSE,
+ &hdr, offset,
+ emrp->emr_out_buf, emrp->emr_out_length_used);
+ }
+#endif /* EFSYS_OPT_MCDI_LOGGING */
}
__checkReturn boolean_t
@@ -265,13 +282,13 @@ hunt_mcdi_request_poll(
const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
efsys_mem_t *esmp = emtp->emt_dma_mem;
efx_mcdi_req_t *emrp;
- efx_dword_t dword;
+ efx_dword_t hdr[2];
unsigned int seq;
unsigned int cmd;
unsigned int length;
size_t offset;
int state;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
@@ -285,23 +302,21 @@ hunt_mcdi_request_poll(
offset = 0;
/* Read the command header */
- EFSYS_MEM_READD(esmp, offset, &dword);
+ EFSYS_MEM_READD(esmp, offset, &hdr[0]);
offset += sizeof (efx_dword_t);
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_RESPONSE) == 0) {
+ if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_RESPONSE) == 0) {
EFSYS_UNLOCK(enp->en_eslp, state);
return (B_FALSE);
}
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
- efx_dword_t dword2;
-
- EFSYS_MEM_READD(esmp, offset, &dword2);
+ if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) {
+ EFSYS_MEM_READD(esmp, offset, &hdr[1]);
offset += sizeof (efx_dword_t);
- cmd = EFX_DWORD_FIELD(dword2, MC_CMD_V2_EXTN_IN_EXTENDED_CMD);
- length = EFX_DWORD_FIELD(dword2, MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
+ cmd = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD);
+ length = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
} else {
- cmd = EFX_DWORD_FIELD(dword, MCDI_HEADER_CODE);
- length = EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN);
+ cmd = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE);
+ length = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN);
}
/* Request complete */
@@ -309,7 +324,7 @@ hunt_mcdi_request_poll(
seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ);
/* Check for synchronous reboot */
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR) != 0 && length == 0) {
+ if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR) != 0 && length == 0) {
/* The MC has rebooted since the request was sent. */
EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US);
hunt_mcdi_poll_reboot(enp);
@@ -326,22 +341,31 @@ hunt_mcdi_request_poll(
/* Check that the returned data is consistent */
if (cmd != emrp->emr_cmd ||
- EFX_DWORD_FIELD(dword, MCDI_HEADER_SEQ) != seq) {
+ EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_SEQ) != seq) {
/* Response is for a different request */
rc = EIO;
goto fail2;
}
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR)) {
- efx_dword_t errdword;
+ if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR)) {
+ efx_dword_t err[2];
int errcode;
int argnum;
/* Read error code (and arg num for MCDI v2 commands) */
- EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_CODE_OFST, &errdword);
- errcode = EFX_DWORD_FIELD(errdword, EFX_DWORD_0);
-
- EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_ARG_OFST, &errdword);
- argnum = EFX_DWORD_FIELD(errdword, EFX_DWORD_0);
+ EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_CODE_OFST, &err[0]);
+ errcode = EFX_DWORD_FIELD(err[0], EFX_DWORD_0);
+
+ EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_ARG_OFST, &err[1]);
+ argnum = EFX_DWORD_FIELD(err[1], EFX_DWORD_0);
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ emtp->emt_logger(emtp->emt_context,
+ EFX_LOG_MCDI_RESPONSE,
+ &hdr, offset,
+ &err, sizeof (err));
+ }
+#endif /* EFSYS_OPT_MCDI_LOGGING */
rc = efx_mcdi_request_errcode(errcode);
if (!emrp->emr_quiet) {
@@ -366,7 +390,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
if (!emrp->emr_quiet)
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
/* Fill out error state */
emrp->emr_rc = rc;
@@ -380,7 +404,7 @@ out:
return (B_TRUE);
}
- int
+ efx_rc_t
hunt_mcdi_poll_reboot(
__in efx_nic_t *enp)
{
@@ -388,7 +412,7 @@ hunt_mcdi_poll_reboot(
efx_dword_t dword;
uint32_t old_status;
uint32_t new_status;
- int rc;
+ efx_rc_t rc;
old_status = emip->emi_mc_reboot_status;
@@ -421,12 +445,12 @@ hunt_mcdi_poll_reboot(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mcdi_fw_update_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp)
@@ -435,7 +459,11 @@ hunt_mcdi_fw_update_supported(
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
- /* use privilege mask state at MCDI attach */
+ /*
+ * Use privilege mask state at MCDI attach.
+ * Admin privilege must be used prior to introduction of
+ * specific flag.
+ */
*supportedp = (encp->enc_privilege_mask &
MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN)
== MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN;
@@ -443,19 +471,50 @@ hunt_mcdi_fw_update_supported(
return (0);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_mcdi_macaddr_change_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint32_t privilege_mask = encp->enc_privilege_mask;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
- /* use privilege mask state at MCDI attach */
- *supportedp = (encp->enc_privilege_mask &
- MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING)
- == MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING;
+ /*
+ * Use privilege mask state at MCDI attach.
+ * Admin privilege must be used prior to introduction of
+ * specific flag (at v4.6).
+ */
+ *supportedp =
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) ||
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN);
+
+ return (0);
+}
+
+ __checkReturn efx_rc_t
+hunt_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint32_t privilege_mask = encp->enc_privilege_mask;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /*
+ * Use privilege mask state at MCDI attach.
+ * Admin privilege used prior to introduction of
+ * specific flag.
+ */
+ *supportedp =
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) ||
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN);
return (0);
}
diff --git a/sys/dev/sfxge/common/hunt_nic.c b/sys/dev/sfxge/common/hunt_nic.c
index 3a7204e..b41eb40 100644
--- a/sys/dev/sfxge/common/hunt_nic.c
+++ b/sys/dev/sfxge/common/hunt_nic.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#include "ef10_tlv_layout.h"
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_port_assignment(
__in efx_nic_t *enp,
__out uint32_t *portp)
@@ -48,7 +48,7 @@ efx_mcdi_get_port_assignment(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN,
MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -78,12 +78,12 @@ efx_mcdi_get_port_assignment(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_port_modes(
__in efx_nic_t *enp,
__out uint32_t *modesp)
@@ -91,7 +91,7 @@ efx_mcdi_get_port_modes(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_PORT_MODES_IN_LEN,
MC_CMD_GET_PORT_MODES_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -123,13 +123,13 @@ efx_mcdi_get_port_modes(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_vadaptor_alloc(
__in efx_nic_t *enp,
__in uint32_t port_id)
@@ -137,7 +137,7 @@ efx_mcdi_vadaptor_alloc(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_VADAPTOR_ALLOC_IN_LEN,
MC_CMD_VADAPTOR_ALLOC_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_vport_id, ==, EVB_PORT_ID_NULL);
@@ -160,12 +160,12 @@ efx_mcdi_vadaptor_alloc(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_vadaptor_free(
__in efx_nic_t *enp,
__in uint32_t port_id)
@@ -173,7 +173,7 @@ efx_mcdi_vadaptor_free(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_VADAPTOR_FREE_IN_LEN,
MC_CMD_VADAPTOR_FREE_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_VADAPTOR_FREE;
@@ -194,12 +194,12 @@ efx_mcdi_vadaptor_free(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_mac_address_pf(
__in efx_nic_t *enp,
__out_ecount_opt(6) uint8_t mac_addrp[6])
@@ -207,7 +207,7 @@ efx_mcdi_get_mac_address_pf(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_MAC_ADDRESSES_IN_LEN,
MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -251,12 +251,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_mac_address_vf(
__in efx_nic_t *enp,
__out_ecount_opt(6) uint8_t mac_addrp[6])
@@ -264,7 +264,7 @@ efx_mcdi_get_mac_address_vf(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN,
MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -313,12 +313,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_clock(
__in efx_nic_t *enp,
__out uint32_t *sys_freqp)
@@ -326,7 +326,7 @@ efx_mcdi_get_clock(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_CLOCK_IN_LEN,
MC_CMD_GET_CLOCK_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -362,12 +362,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_vector_cfg(
__in efx_nic_t *enp,
__out_opt uint32_t *vec_basep,
@@ -377,7 +377,7 @@ efx_mcdi_get_vector_cfg(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_VECTOR_CFG_IN_LEN,
MC_CMD_GET_VECTOR_CFG_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_VECTOR_CFG;
@@ -410,12 +410,12 @@ efx_mcdi_get_vector_cfg(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_get_capabilities(
__in efx_nic_t *enp,
__out efx_dword_t *flagsp)
@@ -423,7 +423,7 @@ efx_mcdi_get_capabilities(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN,
MC_CMD_GET_CAPABILITIES_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_CAPABILITIES;
@@ -451,13 +451,13 @@ efx_mcdi_get_capabilities(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_alloc_vis(
__in efx_nic_t *enp,
__in uint32_t min_vi_count,
@@ -469,7 +469,7 @@ efx_mcdi_alloc_vis(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN,
MC_CMD_ALLOC_VIS_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
if (vi_countp == NULL) {
rc = EINVAL;
@@ -511,18 +511,18 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_free_vis(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(MC_CMD_FREE_VIS_IN_LEN == 0);
EFX_STATIC_ASSERT(MC_CMD_FREE_VIS_OUT_LEN == 0);
@@ -544,13 +544,13 @@ efx_mcdi_free_vis(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_alloc_piobuf(
__in efx_nic_t *enp,
__out efx_piobuf_handle_t *handlep)
@@ -558,7 +558,7 @@ efx_mcdi_alloc_piobuf(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_ALLOC_PIOBUF_IN_LEN,
MC_CMD_ALLOC_PIOBUF_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
if (handlep == NULL) {
rc = EINVAL;
@@ -593,20 +593,20 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_free_piobuf(
__in efx_nic_t *enp,
- __out efx_piobuf_handle_t handle)
+ __in efx_piobuf_handle_t handle)
{
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_FREE_PIOBUF_IN_LEN,
MC_CMD_FREE_PIOBUF_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FREE_PIOBUF;
@@ -627,12 +627,12 @@ efx_mcdi_free_piobuf(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_link_piobuf(
__in efx_nic_t *enp,
__in uint32_t vi_index,
@@ -641,7 +641,7 @@ efx_mcdi_link_piobuf(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_LINK_PIOBUF_IN_LEN,
MC_CMD_LINK_PIOBUF_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_LINK_PIOBUF;
@@ -663,12 +663,12 @@ efx_mcdi_link_piobuf(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_unlink_piobuf(
__in efx_nic_t *enp,
__in uint32_t vi_index)
@@ -676,7 +676,7 @@ efx_mcdi_unlink_piobuf(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_UNLINK_PIOBUF_IN_LEN,
MC_CMD_UNLINK_PIOBUF_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_UNLINK_PIOBUF;
@@ -697,7 +697,7 @@ efx_mcdi_unlink_piobuf(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -709,7 +709,7 @@ hunt_nic_alloc_piobufs(
{
efx_piobuf_handle_t *handlep;
unsigned int i;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(max_piobuf_count, <=,
EFX_ARRAY_SIZE(enp->en_u.hunt.enu_piobuf_handle));
@@ -756,7 +756,7 @@ hunt_nic_free_piobufs(
}
/* Sub-allocate a block from a piobuf */
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_pio_alloc(
__inout efx_nic_t *enp,
__out uint32_t *bufnump,
@@ -768,7 +768,7 @@ hunt_nic_pio_alloc(
efx_drv_cfg_t *edcp = &enp->en_drv_cfg;
uint32_t blk_per_buf;
uint32_t buf, blk;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(bufnump);
@@ -813,20 +813,20 @@ done:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
/* Free a piobuf sub-allocated block */
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_pio_free(
__inout efx_nic_t *enp,
__in uint32_t bufnum,
__in uint32_t blknum)
{
uint32_t *map;
- int rc;
+ efx_rc_t rc;
if ((bufnum >= enp->en_u.hunt.enu_piobuf_count) ||
(blknum >= (8 * sizeof (*map)))) {
@@ -846,12 +846,12 @@ hunt_nic_pio_free(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_pio_link(
__inout efx_nic_t *enp,
__in uint32_t vi_index,
@@ -860,7 +860,7 @@ hunt_nic_pio_link(
return (efx_mcdi_link_piobuf(enp, vi_index, handle));
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_pio_unlink(
__inout efx_nic_t *enp,
__in uint32_t vi_index)
@@ -868,13 +868,13 @@ hunt_nic_pio_unlink(
return (efx_mcdi_unlink_piobuf(enp, vi_index));
}
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_get_datapath_caps(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_dword_t datapath_capabilities;
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_get_capabilities(enp, &datapath_capabilities)) != 0)
goto fail1;
@@ -920,12 +920,20 @@ hunt_get_datapath_caps(
encp->enc_rx_batching_enabled = B_FALSE;
}
+ /* Check if the firmware supports disabling scatter on RXQs */
+ if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities,
+ GET_CAPABILITIES_OUT_RX_DISABLE_SCATTER) == 1) {
+ encp->enc_rx_disable_scatter_supported = B_TRUE;
+ } else {
+ encp->enc_rx_disable_scatter_supported = B_FALSE;
+ }
+
return (0);
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -948,28 +956,36 @@ static struct {
{
EFX_FAMILY_HUNTINGTON,
(1 << TLV_PORT_MODE_10G) |
- (1 << TLV_PORT_MODE_40G) |
(1 << TLV_PORT_MODE_10G_10G) |
- (1 << TLV_PORT_MODE_40G_40G),
+ (1 << TLV_PORT_MODE_10G_10G_10G_10G),
1
},
/* Supported modes requiring 2 outputs per port */
{
EFX_FAMILY_HUNTINGTON,
- (1 << TLV_PORT_MODE_10G_10G_10G_10G) |
+ (1 << TLV_PORT_MODE_40G) |
+ (1 << TLV_PORT_MODE_40G_40G) |
(1 << TLV_PORT_MODE_40G_10G_10G) |
(1 << TLV_PORT_MODE_10G_10G_40G),
2
}
+ /*
+ * NOTE: Medford modes will require 4 outputs per port:
+ * TLV_PORT_MODE_10G_10G_10G_10G_Q
+ * TLV_PORT_MODE_10G_10G_10G_10G_Q2
+ * The Q2 mode routes outputs to external port 2. Support for this
+ * will require a new field specifying the number to add after
+ * scaling by stride. This is fixed at 1 currently.
+ */
};
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_external_port_mapping(
__in efx_nic_t *enp,
__in uint32_t port,
__out uint8_t *external_portp)
{
- int rc;
+ efx_rc_t rc;
int i;
uint32_t port_modes;
uint32_t matches;
@@ -1011,12 +1027,12 @@ out:
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
hunt_board_cfg(
__in efx_nic_t *enp)
{
@@ -1033,7 +1049,7 @@ hunt_board_cfg(
uint32_t flags;
uint32_t sysclk;
uint32_t base, nvec;
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_get_port_assignment(enp, &port)) != 0)
goto fail1;
@@ -1063,18 +1079,18 @@ hunt_board_cfg(
/* MAC address for this function */
if (EFX_PCI_FUNCTION_IS_PF(encp)) {
rc = efx_mcdi_get_mac_address_pf(enp, mac_addr);
+ if ((rc == 0) && (mac_addr[0] & 0x02)) {
+ /*
+ * If the static config does not include a global MAC
+ * address pool then the board may return a locally
+ * administered MAC address (this should only happen on
+ * incorrectly programmed boards).
+ */
+ rc = EINVAL;
+ }
} else {
rc = efx_mcdi_get_mac_address_vf(enp, mac_addr);
}
- if ((rc == 0) && (mac_addr[0] & 0x02)) {
- /*
- * If the static config does not include a global MAC address
- * pool then the board may return a locally administered MAC
- * address (this should only happen on incorrectly programmed
- * boards).
- */
- rc = EINVAL;
- }
if (rc != 0)
goto fail4;
@@ -1302,19 +1318,19 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_probe(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_drv_cfg_t *edcp = &(enp->en_drv_cfg);
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
@@ -1390,12 +1406,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_set_drv_limits(
__inout efx_nic_t *enp,
__in efx_drv_limits_t *edlp)
@@ -1405,7 +1421,7 @@ hunt_nic_set_drv_limits(
uint32_t min_evq_count, max_evq_count;
uint32_t min_rxq_count, max_rxq_count;
uint32_t min_txq_count, max_txq_count;
- int rc;
+ efx_rc_t rc;
if (edlp == NULL) {
rc = EINVAL;
@@ -1463,20 +1479,20 @@ hunt_nic_set_drv_limits(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_reset(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_ENTITY_RESET_IN_LEN,
MC_CMD_ENTITY_RESET_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
/* hunt_nic_reset() is called to recover from BADASSERT failures. */
if ((rc = efx_mcdi_read_assertion(enp)) != 0)
@@ -1511,12 +1527,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_init(
__in efx_nic_t *enp)
{
@@ -1524,7 +1540,9 @@ hunt_nic_init(
uint32_t min_vi_count, max_vi_count;
uint32_t vi_count, vi_base;
uint32_t i;
- int rc;
+ uint32_t retry;
+ uint32_t delay_us;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
@@ -1614,14 +1632,48 @@ hunt_nic_init(
}
}
- /* Allocate a vAdapter attached to our upstream vPort/pPort */
- if ((rc = efx_mcdi_vadaptor_alloc(enp, EVB_PORT_ID_ASSIGNED)) != 0)
- goto fail5;
+ /*
+ * Allocate a vAdaptor attached to our upstream vPort/pPort.
+ *
+ * On a VF, this may fail with MC_CMD_ERR_NO_EVB_PORT (ENOENT) if the PF
+ * driver has yet to bring up the EVB port. See bug 56147. In this case,
+ * retry the request several times after waiting a while. The wait time
+ * between retries starts small (10ms) and exponentially increases.
+ * Total wait time is a little over two seconds. Retry logic in the
+ * client driver may mean this whole loop is repeated if it continues to
+ * fail.
+ */
+ retry = 0;
+ delay_us = 10000;
+ while ((rc = efx_mcdi_vadaptor_alloc(enp, EVB_PORT_ID_ASSIGNED)) != 0) {
+ if (EFX_PCI_FUNCTION_IS_PF(&enp->en_nic_cfg) ||
+ (rc != ENOENT)) {
+ /*
+ * Do not retry alloc for PF, or for other errors on
+ * a VF.
+ */
+ goto fail5;
+ }
+
+ /* VF startup before PF is ready. Retry allocation. */
+ if (retry > 5) {
+ /* Too many attempts */
+ rc = EINVAL;
+ goto fail6;
+ }
+ EFSYS_PROBE1(mcdi_no_evb_port_retry, int, retry);
+ EFSYS_SLEEP(delay_us);
+ retry++;
+ if (delay_us < 500000)
+ delay_us <<= 2;
+ }
enp->en_vport_id = EVB_PORT_ID_ASSIGNED;
return (0);
+fail6:
+ EFSYS_PROBE(fail6);
fail5:
EFSYS_PROBE(fail5);
fail4:
@@ -1634,12 +1686,12 @@ fail2:
hunt_nic_free_piobufs(enp);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_get_vi_pool(
__in efx_nic_t *enp,
__out uint32_t *vi_countp)
@@ -1655,14 +1707,14 @@ hunt_nic_get_vi_pool(
return (0);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_get_bar_region(
__in efx_nic_t *enp,
__in efx_nic_region_t region,
__out uint32_t *offsetp,
__out size_t *sizep)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
@@ -1692,7 +1744,7 @@ hunt_nic_get_bar_region(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1701,10 +1753,22 @@ fail1:
hunt_nic_fini(
__in efx_nic_t *enp)
{
+ uint32_t i;
+ efx_rc_t rc;
+
(void) efx_mcdi_vadaptor_free(enp, enp->en_vport_id);
enp->en_vport_id = 0;
- /* FIXME: do we need to unlink piobufs ? */
+ /* Unlink piobufs from extra VIs in WC mapping */
+ if (enp->en_u.hunt.enu_piobuf_count > 0) {
+ for (i = 0; i < enp->en_u.hunt.enu_piobuf_count; i++) {
+ rc = efx_mcdi_unlink_piobuf(enp,
+ enp->en_u.hunt.enu_pio_write_vi_base + i);
+ if (rc != 0)
+ break;
+ }
+ }
+
hunt_nic_free_piobufs(enp);
(void) efx_mcdi_free_vis(enp);
@@ -1723,11 +1787,11 @@ hunt_nic_unprobe(
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nic_register_test(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
/* FIXME */
_NOTE(ARGUNUSED(enp))
@@ -1740,7 +1804,7 @@ hunt_nic_register_test(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_nvram.c b/sys/dev/sfxge/common/hunt_nvram.c
index 3e130f4..341a31b 100644
--- a/sys/dev/sfxge/common/hunt_nvram.c
+++ b/sys/dev/sfxge/common/hunt_nvram.c
@@ -51,7 +51,7 @@ typedef struct tlv_cursor_s {
uint32_t *limit; /* Last dword of data block */
} tlv_cursor_t;
-static __checkReturn int
+static __checkReturn efx_rc_t
tlv_validate_state(
__in tlv_cursor_t *cursor);
@@ -125,11 +125,11 @@ tlv_next_item_ptr(
return (cursor->current + TLV_DWORD_COUNT(length));
}
-static int
+static efx_rc_t
tlv_advance(
__in tlv_cursor_t *cursor)
{
- int rc;
+ efx_rc_t rc;
if ((rc = tlv_validate_state(cursor)) != 0)
goto fail1;
@@ -154,16 +154,16 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static int
+static efx_rc_t
tlv_rewind(
__in tlv_cursor_t *cursor)
{
- int rc;
+ efx_rc_t rc;
cursor->current = cursor->block;
@@ -173,17 +173,17 @@ tlv_rewind(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static int
+static efx_rc_t
tlv_find(
__in tlv_cursor_t *cursor,
__in uint32_t tag)
{
- int rc;
+ efx_rc_t rc;
rc = tlv_rewind(cursor);
while (rc == 0) {
@@ -195,11 +195,11 @@ tlv_find(
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
tlv_validate_state(
__in tlv_cursor_t *cursor)
{
- int rc;
+ efx_rc_t rc;
/* Check cursor position */
if (cursor->current < cursor->block) {
@@ -236,12 +236,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static int
+static efx_rc_t
tlv_init_cursor(
__in tlv_cursor_t *cursor,
__in uint32_t *block,
@@ -256,7 +256,7 @@ tlv_init_cursor(
return (tlv_validate_state(cursor));
}
-static int
+static efx_rc_t
tlv_init_cursor_from_size(
__in tlv_cursor_t *cursor,
__in uint8_t *block,
@@ -267,12 +267,12 @@ tlv_init_cursor_from_size(
return (tlv_init_cursor(cursor, (uint32_t *)block, limit));
}
-static int
+static efx_rc_t
tlv_require_end(
__in tlv_cursor_t *cursor)
{
uint32_t *pos;
- int rc;
+ efx_rc_t rc;
if (cursor->end == NULL) {
pos = cursor->current;
@@ -286,7 +286,7 @@ tlv_require_end(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -295,7 +295,7 @@ static size_t
tlv_block_length_used(
__in tlv_cursor_t *cursor)
{
- int rc;
+ efx_rc_t rc;
if ((rc = tlv_validate_state(cursor)) != 0)
goto fail1;
@@ -309,7 +309,7 @@ tlv_block_length_used(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (0);
}
@@ -339,7 +339,7 @@ tlv_write(
return (ptr);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
tlv_insert(
__in tlv_cursor_t *cursor,
__in uint32_t tag,
@@ -347,7 +347,7 @@ tlv_insert(
__in size_t size)
{
unsigned int delta;
- int rc;
+ efx_rc_t rc;
if ((rc = tlv_validate_state(cursor)) != 0)
goto fail1;
@@ -385,12 +385,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
tlv_modify(
__in tlv_cursor_t *cursor,
__in uint32_t tag,
@@ -401,7 +401,7 @@ tlv_modify(
unsigned int old_ndwords;
unsigned int new_ndwords;
unsigned int delta;
- int rc;
+ efx_rc_t rc;
if ((rc = tlv_validate_state(cursor)) != 0)
goto fail1;
@@ -468,13 +468,13 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
/* Validate TLV formatted partition contents (before writing to flash) */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_nvram_tlv_validate(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -487,7 +487,7 @@ efx_nvram_tlv_validate(
size_t total_length;
uint32_t cksum;
int pos;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(sizeof (*header) <= HUNTINGTON_NVRAM_CHUNK);
@@ -566,18 +566,24 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-/* Read and validate an entire TLV formatted partition */
-static __checkReturn int
-hunt_nvram_read_tlv_partition(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in_bcount(partn_size) caddr_t partn_data,
- __in size_t partn_size)
+/*
+ * Read and validate a segment from a partition. A segment is a complete
+ * tlv chain between PARTITION_HEADER and PARTITION_END tags. There may
+ * be multiple segments in a partition, so seg_offset allows segments
+ * beyond the first to be read.
+ */
+static __checkReturn efx_rc_t
+hunt_nvram_read_tlv_segment(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in size_t seg_offset,
+ __in_bcount(max_seg_size) caddr_t seg_data,
+ __in size_t max_seg_size)
{
tlv_cursor_t cursor;
struct tlv_partition_header *header;
@@ -585,24 +591,24 @@ hunt_nvram_read_tlv_partition(
size_t total_length;
uint32_t cksum;
int pos;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(sizeof (*header) <= HUNTINGTON_NVRAM_CHUNK);
- if ((partn_data == NULL) || (partn_size == 0)) {
+ if ((seg_data == NULL) || (max_seg_size == 0)) {
rc = EINVAL;
goto fail1;
}
- /* Read initial chunk of partition */
- if ((rc = hunt_nvram_partn_read(enp, partn, 0, partn_data,
+ /* Read initial chunk of the segment, starting at offset */
+ if ((rc = hunt_nvram_partn_read(enp, partn, seg_offset, seg_data,
HUNTINGTON_NVRAM_CHUNK)) != 0) {
goto fail2;
}
- /* The partition header must be the first item (at offset zero) */
- if ((rc = tlv_init_cursor_from_size(&cursor, partn_data,
- partn_size)) != 0) {
+ /* A PARTITION_HEADER tag must be the first item at the given offset */
+ if ((rc = tlv_init_cursor_from_size(&cursor, seg_data,
+ max_seg_size)) != 0) {
rc = EFAULT;
goto fail3;
}
@@ -612,23 +618,23 @@ hunt_nvram_read_tlv_partition(
}
header = (struct tlv_partition_header *)tlv_item(&cursor);
- /* Check TLV partition length (includes the END tag) */
+ /* Check TLV segment length (includes the END tag) */
total_length = __LE_TO_CPU_32(header->total_length);
- if (total_length > partn_size) {
+ if (total_length > max_seg_size) {
rc = EFBIG;
goto fail5;
}
- /* Read the remaining partition content */
+ /* Read the remaining segment content */
if (total_length > HUNTINGTON_NVRAM_CHUNK) {
if ((rc = hunt_nvram_partn_read(enp, partn,
- HUNTINGTON_NVRAM_CHUNK,
- partn_data + HUNTINGTON_NVRAM_CHUNK,
+ seg_offset + HUNTINGTON_NVRAM_CHUNK,
+ seg_data + HUNTINGTON_NVRAM_CHUNK,
total_length - HUNTINGTON_NVRAM_CHUNK)) != 0)
goto fail6;
}
- /* Check partition ends with PARTITION_TRAILER and END tags */
+ /* Check segment ends with PARTITION_TRAILER and END tags */
if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
rc = EINVAL;
goto fail7;
@@ -644,7 +650,7 @@ hunt_nvram_read_tlv_partition(
goto fail9;
}
- /* Check data read from partition is consistent */
+ /* Check data read from segment is consistent */
if (trailer->generation != header->generation) {
/*
* The partition data may have been modified between successive
@@ -656,10 +662,10 @@ hunt_nvram_read_tlv_partition(
goto fail10;
}
- /* Verify partition checksum */
+ /* Verify segment checksum */
cksum = 0;
for (pos = 0; (size_t)pos < total_length; pos += sizeof (uint32_t)) {
- cksum += *((uint32_t *)(partn_data + pos));
+ cksum += *((uint32_t *)(seg_data + pos));
}
if (cksum != 0) {
rc = EINVAL;
@@ -689,20 +695,20 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
/*
* Read a single TLV item from a host memory
- * buffer containing a TLV formatted partition.
+ * buffer containing a TLV formatted segment.
*/
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_buf_read_tlv(
__in efx_nic_t *enp,
- __in_bcount(partn_size) caddr_t partn_data,
- __in size_t partn_size,
+ __in_bcount(max_seg_size) caddr_t seg_data,
+ __in size_t max_seg_size,
__in uint32_t tag,
__deref_out_bcount_opt(*sizep) caddr_t *datap,
__out size_t *sizep)
@@ -711,16 +717,16 @@ hunt_nvram_buf_read_tlv(
caddr_t data;
size_t length;
caddr_t value;
- int rc;
+ efx_rc_t rc;
- if ((partn_data == NULL) || (partn_size == 0)) {
+ if ((seg_data == NULL) || (max_seg_size == 0)) {
rc = EINVAL;
goto fail1;
}
- /* Find requested TLV tag in partition data */
- if ((rc = tlv_init_cursor_from_size(&cursor, partn_data,
- partn_size)) != 0) {
+ /* Find requested TLV tag in segment data */
+ if ((rc = tlv_init_cursor_from_size(&cursor, seg_data,
+ max_seg_size)) != 0) {
rc = EFAULT;
goto fail2;
}
@@ -755,28 +761,26 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-
-
-/* Read a single TLV item from a TLV formatted partition */
- __checkReturn int
+/* Read a single TLV item from the first segment in a TLV formatted partition */
+ __checkReturn efx_rc_t
hunt_nvram_partn_read_tlv(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __in uint32_t tag,
- __deref_out_bcount_opt(*sizep) caddr_t *datap,
- __out size_t *sizep)
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __deref_out_bcount_opt(*seg_sizep) caddr_t *seg_datap,
+ __out size_t *seg_sizep)
{
- caddr_t partn_data = NULL;
+ caddr_t seg_data = NULL;
size_t partn_size = 0;
size_t length;
caddr_t data;
int retry;
- int rc;
+ efx_rc_t rc;
/* Allocate sufficient memory for the entire partition */
if ((rc = hunt_nvram_partn_size(enp, partn, &partn_size)) != 0)
@@ -787,39 +791,39 @@ hunt_nvram_partn_read_tlv(
goto fail2;
}
- EFSYS_KMEM_ALLOC(enp->en_esip, partn_size, partn_data);
- if (partn_data == NULL) {
+ EFSYS_KMEM_ALLOC(enp->en_esip, partn_size, seg_data);
+ if (seg_data == NULL) {
rc = ENOMEM;
goto fail3;
}
/*
- * Read the entire TLV partition. Retry until consistent partition
- * contents are returned. Inconsistent data may be read if:
- * a) the partition contents are invalid
+ * Read the first segment in a TLV partition. Retry until consistent
+ * segment contents are returned. Inconsistent data may be read if:
+ * a) the segment contents are invalid
* b) the MC has rebooted while we were reading the partition
* c) the partition has been modified while we were reading it
* Limit retry attempts to ensure forward progress.
*/
retry = 10;
do {
- rc = hunt_nvram_read_tlv_partition(enp, partn,
- partn_data, partn_size);
+ rc = hunt_nvram_read_tlv_segment(enp, partn, 0,
+ seg_data, partn_size);
} while ((rc == EAGAIN) && (--retry > 0));
if (rc != 0) {
- /* Failed to obtain consistent partition data */
+ /* Failed to obtain consistent segment data */
goto fail4;
}
- if ((rc = hunt_nvram_buf_read_tlv(enp, partn_data, partn_size,
+ if ((rc = hunt_nvram_buf_read_tlv(enp, seg_data, partn_size,
tag, &data, &length)) != 0)
goto fail5;
- EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data);
+ EFSYS_KMEM_FREE(enp->en_esip, partn_size, seg_data);
- *datap = data;
- *sizep = length;
+ *seg_datap = data;
+ *seg_sizep = length;
return (0);
@@ -828,25 +832,153 @@ fail5:
fail4:
EFSYS_PROBE(fail4);
- EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data);
+ EFSYS_KMEM_FREE(enp->en_esip, partn_size, seg_data);
fail3:
EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+/* Compute the size of a segment. */
+ static __checkReturn efx_rc_t
+hunt_nvram_buf_segment_size(
+ __in caddr_t seg_data,
+ __in size_t max_seg_size,
+ __out size_t *seg_sizep)
+{
+ efx_rc_t rc;
+ tlv_cursor_t cursor;
+ struct tlv_partition_header *header;
+ uint32_t cksum;
+ int pos;
+ uint32_t *end_tag_position;
+ uint32_t segment_length;
+
+ /* A PARTITION_HEADER tag must be the first item at the given offset */
+ if ((rc = tlv_init_cursor_from_size(&cursor, seg_data,
+ max_seg_size)) != 0) {
+ rc = EFAULT;
+ goto fail1;
+ }
+ if (tlv_tag(&cursor) != TLV_TAG_PARTITION_HEADER) {
+ rc = EINVAL;
+ goto fail2;
+ }
+ header = (struct tlv_partition_header *)tlv_item(&cursor);
+
+ /* Check TLV segment length (includes the END tag) */
+ *seg_sizep = __LE_TO_CPU_32(header->total_length);
+ if (*seg_sizep > max_seg_size) {
+ rc = EFBIG;
+ goto fail3;
+ }
+
+ /* Check segment ends with PARTITION_TRAILER and END tags */
+ if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
+ rc = EINVAL;
+ goto fail4;
+ }
+
+ if ((rc = tlv_advance(&cursor)) != 0) {
+ rc = EINVAL;
+ goto fail5;
+ }
+ if (tlv_tag(&cursor) != TLV_TAG_END) {
+ rc = EINVAL;
+ goto fail6;
+ }
+ end_tag_position = cursor.current;
+
+ /* Verify segment checksum */
+ cksum = 0;
+ for (pos = 0; (size_t)pos < *seg_sizep; pos += sizeof (uint32_t)) {
+ cksum += *((uint32_t *)(seg_data + pos));
+ }
+ if (cksum != 0) {
+ rc = EINVAL;
+ goto fail7;
+ }
+
+ /*
+ * Calculate total length from HEADER to END tags and compare to
+ * max_seg_size and the total_length field in the HEADER tag.
+ */
+ segment_length = tlv_block_length_used(&cursor);
+
+ if (segment_length > max_seg_size) {
+ rc = EINVAL;
+ goto fail8;
+ }
+
+ if (segment_length != *seg_sizep) {
+ rc = EINVAL;
+ goto fail9;
+ }
+
+ /* Skip over the first HEADER tag. */
+ rc = tlv_rewind(&cursor);
+ rc = tlv_advance(&cursor);
+
+ while (rc == 0) {
+ if (tlv_tag(&cursor) == TLV_TAG_END) {
+ /* Check that the END tag is the one found earlier. */
+ if (cursor.current != end_tag_position)
+ goto fail10;
+ break;
+ }
+ /* Check for duplicate HEADER tags before the END tag. */
+ if (tlv_tag(&cursor) == TLV_TAG_PARTITION_HEADER) {
+ rc = EINVAL;
+ goto fail11;
+ }
+
+ rc = tlv_advance(&cursor);
+ }
+ if (rc != 0)
+ goto fail12;
+
+ return (0);
+
+fail12:
+ EFSYS_PROBE(fail12);
+fail11:
+ EFSYS_PROBE(fail11);
+fail10:
+ EFSYS_PROBE(fail10);
+fail9:
+ EFSYS_PROBE(fail9);
+fail8:
+ EFSYS_PROBE(fail8);
+fail7:
+ EFSYS_PROBE(fail7);
+fail6:
+ EFSYS_PROBE(fail6);
+fail5:
+ EFSYS_PROBE(fail5);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
/*
* Add or update a single TLV item in a host memory buffer containing a TLV
- * formatted partition.
+ * formatted segment. Historically partitions consisted of only one segment.
*/
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_buf_write_tlv(
- __inout_bcount(partn_size) caddr_t partn_data,
- __in size_t partn_size,
+ __inout_bcount(max_seg_size) caddr_t seg_data,
+ __in size_t max_seg_size,
__in uint32_t tag,
__in_bcount(tag_size) caddr_t tag_data,
__in size_t tag_size,
@@ -858,11 +990,11 @@ hunt_nvram_buf_write_tlv(
uint32_t generation;
uint32_t cksum;
int pos;
- int rc;
+ efx_rc_t rc;
- /* The partition header must be the first item (at offset zero) */
- if ((rc = tlv_init_cursor_from_size(&cursor, partn_data,
- partn_size)) != 0) {
+ /* A PARTITION_HEADER tag must be the first item (at offset zero) */
+ if ((rc = tlv_init_cursor_from_size(&cursor, seg_data,
+ max_seg_size)) != 0) {
rc = EFAULT;
goto fail1;
}
@@ -901,7 +1033,10 @@ hunt_nvram_buf_write_tlv(
/* Update PARTITION_HEADER and PARTITION_TRAILER fields */
*total_lengthp = tlv_block_length_used(&cursor);
- EFSYS_ASSERT3U(*total_lengthp, <=, partn_size);
+ if (*total_lengthp > max_seg_size) {
+ rc = ENOSPC;
+ goto fail7;
+ }
generation = __LE_TO_CPU_32(header->generation) + 1;
header->total_length = __CPU_TO_LE_32(*total_lengthp);
@@ -912,12 +1047,14 @@ hunt_nvram_buf_write_tlv(
trailer->checksum = 0;
cksum = 0;
for (pos = 0; (size_t)pos < *total_lengthp; pos += sizeof (uint32_t)) {
- cksum += *((uint32_t *)(partn_data + pos));
+ cksum += *((uint32_t *)(seg_data + pos));
}
trailer->checksum = ~cksum + 1;
return (0);
+fail7:
+ EFSYS_PROBE(fail7);
fail6:
EFSYS_PROBE(fail6);
fail5:
@@ -929,13 +1066,17 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-/* Add or update a single TLV item in a TLV formatted partition */
- __checkReturn int
+/*
+ * Add or update a single TLV item in the first segment of a TLV formatted
+ * dynamic config partition. The first segment is the current active
+ * configuration.
+ */
+ __checkReturn efx_rc_t
hunt_nvram_partn_write_tlv(
__in efx_nic_t *enp,
__in uint32_t partn,
@@ -943,10 +1084,114 @@ hunt_nvram_partn_write_tlv(
__in_bcount(size) caddr_t data,
__in size_t size)
{
- size_t partn_size;
+ return hunt_nvram_partn_write_segment_tlv(enp, partn, tag, data,
+ size, B_FALSE);
+}
+
+/*
+ * Read a segment from nvram at the given offset into a buffer (segment_data)
+ * and optionally write a new tag to it.
+ */
+ static __checkReturn efx_rc_t
+hunt_nvram_segment_write_tlv(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __inout caddr_t *seg_datap,
+ __inout size_t *partn_offsetp,
+ __inout size_t *src_remain_lenp,
+ __inout size_t *dest_remain_lenp,
+ __in boolean_t write)
+{
+ efx_rc_t rc;
+ int status;
+ size_t original_segment_size;
+ size_t modified_segment_size;
+
+ /*
+ * Read the segment from NVRAM into the segment_data buffer and validate
+ * it, returning if it does not validate. This is not a failure unless
+ * this is the first segment in a partition. In this case the caller
+ * must propogate the error.
+ */
+ status = hunt_nvram_read_tlv_segment(enp, partn, *partn_offsetp,
+ *seg_datap, *src_remain_lenp);
+ if (status != 0)
+ return (EINVAL);
+
+ status = hunt_nvram_buf_segment_size(*seg_datap,
+ *src_remain_lenp, &original_segment_size);
+ if (status != 0)
+ return (EINVAL);
+
+ if (write) {
+ /* Update the contents of the segment in the buffer */
+ if ((rc = hunt_nvram_buf_write_tlv(*seg_datap,
+ *dest_remain_lenp, tag, data, size,
+ &modified_segment_size)) != 0)
+ goto fail1;
+ *dest_remain_lenp -= modified_segment_size;
+ *seg_datap += modified_segment_size;
+ } else {
+ /*
+ * We won't modify this segment, but still need to update the
+ * remaining lengths and pointers.
+ */
+ *dest_remain_lenp -= original_segment_size;
+ *seg_datap += original_segment_size;
+ }
+
+ *partn_offsetp += original_segment_size;
+ *src_remain_lenp -= original_segment_size;
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
+/*
+ * Add or update a single TLV item in either the first segment or in all
+ * segments in a TLV formatted dynamic config partition. Dynamic config
+ * partitions on boards that support RFID are divided into a number of segments,
+ * each formatted like a partition, with header, trailer and end tags. The first
+ * segment is the current active configuration.
+ *
+ * The segments are initialised by manftest and each contain a different
+ * configuration e.g. firmware variant. The firmware can be instructed
+ * via RFID to copy a segment to replace the first segment, hence changing the
+ * active configuration. This allows ops to change the configuration of a board
+ * prior to shipment using RFID.
+ *
+ * Changes to the dynamic config may need to be written to all segments (e.g.
+ * firmware versions) or just the first segment (changes to the active
+ * configuration). See SF-111324-SW "The use of RFID in Solarflare Products".
+ * If only the first segment is written the code still needs to be aware of the
+ * possible presence of subsequent segments as writing to a segment may cause
+ * its size to increase, which would overwrite the subsequent segments and
+ * invalidate them.
+ */
+ __checkReturn efx_rc_t
+hunt_nvram_partn_write_segment_tlv(
+ __in efx_nic_t *enp,
+ __in uint32_t partn,
+ __in uint32_t tag,
+ __in_bcount(size) caddr_t data,
+ __in size_t size,
+ __in boolean_t all_segments)
+{
+ size_t partn_size = 0;
caddr_t partn_data;
- size_t total_length;
- int rc;
+ size_t total_length = 0;
+ efx_rc_t rc;
+ size_t current_offset = 0;
+ size_t remaining_original_length;
+ size_t remaining_modified_length;
+ caddr_t segment_data;
EFSYS_ASSERT3U(partn, ==, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG);
@@ -960,27 +1205,49 @@ hunt_nvram_partn_write_tlv(
goto fail2;
}
+ remaining_original_length = partn_size;
+ remaining_modified_length = partn_size;
+ segment_data = partn_data;
+
/* Lock the partition */
if ((rc = hunt_nvram_partn_lock(enp, partn)) != 0)
goto fail3;
- /* Read the partition contents (no need to retry when locked). */
- if ((rc = hunt_nvram_read_tlv_partition(enp, partn,
- partn_data, partn_size)) != 0) {
- /* Failed to obtain consistent partition data */
- goto fail4;
- }
+ /* Iterate over each (potential) segment to update it. */
+ do {
+ boolean_t write = all_segments || current_offset == 0;
- /* Update the contents in memory */
- if ((rc = hunt_nvram_buf_write_tlv(partn_data, partn_size,
- tag, data, size, &total_length)) != 0)
+ rc = hunt_nvram_segment_write_tlv(enp, partn, tag, data, size,
+ &segment_data, &current_offset, &remaining_original_length,
+ &remaining_modified_length, write);
+ if (rc != 0) {
+ if (current_offset == 0) {
+ /*
+ * If no data has been read then the first
+ * segment is invalid, which is an error.
+ */
+ goto fail4;
+ }
+ break;
+ }
+ } while (current_offset < partn_size);
+
+ total_length = segment_data - partn_data;
+
+ /*
+ * We've run out of space. This should actually be dealt with by
+ * hunt_nvram_buf_write_tlv returning ENOSPC.
+ */
+ if (total_length > partn_size) {
+ rc = ENOSPC;
goto fail5;
+ }
- /* Erase the whole partition */
+ /* Erase the whole partition in NVRAM */
if ((rc = hunt_nvram_partn_erase(enp, partn, 0, partn_size)) != 0)
goto fail6;
- /* Write new partition contents to NVRAM */
+ /* Write new partition contents from the buffer to NVRAM */
if ((rc = hunt_nvram_partn_write(enp, partn, 0, partn_data,
total_length)) != 0)
goto fail7;
@@ -1009,36 +1276,41 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+/*
+ * Get the size of a NVRAM partition. This is the total size allocated in nvram,
+ * not the data used by the segments in the partition.
+ */
+ __checkReturn efx_rc_t
hunt_nvram_partn_size(
__in efx_nic_t *enp,
__in unsigned int partn,
__out size_t *sizep)
{
- int rc;
+ efx_rc_t rc;
- if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, NULL, NULL)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp, partn, sizep,
+ NULL, NULL, NULL)) != 0)
goto fail1;
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_partn_lock(
__in efx_nic_t *enp,
__in unsigned int partn)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_nvram_update_start(enp, partn)) != 0)
goto fail1;
@@ -1046,12 +1318,12 @@ hunt_nvram_partn_lock(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_partn_read(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -1060,7 +1332,7 @@ hunt_nvram_partn_read(
__in size_t size)
{
size_t chunk;
- int rc;
+ efx_rc_t rc;
while (size > 0) {
chunk = MIN(size, HUNTINGTON_NVRAM_CHUNK);
@@ -1078,32 +1350,57 @@ hunt_nvram_partn_read(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_partn_erase(
__in efx_nic_t *enp,
__in unsigned int partn,
__in unsigned int offset,
__in size_t size)
{
- int rc;
+ efx_rc_t rc;
+ uint32_t erase_size;
- if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL,
+ &erase_size, NULL)) != 0)
goto fail1;
+ if (erase_size == 0) {
+ if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0)
+ goto fail2;
+ } else {
+ if (size % erase_size != 0) {
+ rc = EINVAL;
+ goto fail3;
+ }
+ while (size > 0) {
+ if ((rc = efx_mcdi_nvram_erase(enp, partn, offset,
+ erase_size)) != 0)
+ goto fail4;
+ offset += erase_size;
+ size -= erase_size;
+ }
+ }
+
return (0);
+fail4:
+ EFSYS_PROBE(fail4);
+fail3:
+ EFSYS_PROBE(fail3);
+fail2:
+ EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_partn_write(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -1112,7 +1409,7 @@ hunt_nvram_partn_write(
__in size_t size)
{
size_t chunk;
- int rc;
+ efx_rc_t rc;
while (size > 0) {
chunk = MIN(size, HUNTINGTON_NVRAM_CHUNK);
@@ -1130,7 +1427,7 @@ hunt_nvram_partn_write(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1141,7 +1438,7 @@ hunt_nvram_partn_unlock(
__in unsigned int partn)
{
boolean_t reboot;
- int rc;
+ efx_rc_t rc;
reboot = B_FALSE;
if ((rc = efx_mcdi_nvram_update_finish(enp, partn, reboot)) != 0)
@@ -1150,10 +1447,10 @@ hunt_nvram_partn_unlock(
return;
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_partn_set_version(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -1161,7 +1458,7 @@ hunt_nvram_partn_set_version(
{
struct tlv_partition_version partn_version;
size_t size;
- int rc;
+ efx_rc_t rc;
/* Add or modify partition version TLV item */
partn_version.version_w = __CPU_TO_LE_16(version[0]);
@@ -1171,16 +1468,17 @@ hunt_nvram_partn_set_version(
size = sizeof (partn_version) - (2 * sizeof (uint32_t));
- if ((rc = hunt_nvram_partn_write_tlv(enp,
+ /* Write the version number to all segments in the partition */
+ if ((rc = hunt_nvram_partn_write_segment_tlv(enp,
NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
TLV_TAG_PARTITION_VERSION(partn),
- (caddr_t)&partn_version.version_w, size)) != 0)
+ (caddr_t)&partn_version.version_w, size, B_TRUE)) != 0)
goto fail1;
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1216,7 +1514,15 @@ static hunt_parttbl_entry_t hunt_parttbl[] = {
{NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 1, EFX_NVRAM_DYNAMIC_CFG},
{NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 2, EFX_NVRAM_DYNAMIC_CFG},
{NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 3, EFX_NVRAM_DYNAMIC_CFG},
- {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG}
+ {NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, 4, EFX_NVRAM_DYNAMIC_CFG},
+ {NVRAM_PARTITION_TYPE_FPGA, 1, EFX_NVRAM_FPGA},
+ {NVRAM_PARTITION_TYPE_FPGA, 2, EFX_NVRAM_FPGA},
+ {NVRAM_PARTITION_TYPE_FPGA, 3, EFX_NVRAM_FPGA},
+ {NVRAM_PARTITION_TYPE_FPGA, 4, EFX_NVRAM_FPGA},
+ {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 1, EFX_NVRAM_FPGA_BACKUP},
+ {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 2, EFX_NVRAM_FPGA_BACKUP},
+ {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 3, EFX_NVRAM_FPGA_BACKUP},
+ {NVRAM_PARTITION_TYPE_FPGA_BACKUP, 4, EFX_NVRAM_FPGA_BACKUP}
};
static __checkReturn hunt_parttbl_entry_t *
@@ -1243,7 +1549,7 @@ hunt_parttbl_entry(
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_test(
__in efx_nic_t *enp)
{
@@ -1254,7 +1560,7 @@ hunt_nvram_test(
size_t size;
int i;
unsigned int j;
- int rc;
+ efx_rc_t rc;
/* Find supported partitions */
size = MC_CMD_NVRAM_PARTITIONS_OUT_TYPE_ID_MAXNUM * sizeof (uint32_t);
@@ -1297,13 +1603,13 @@ fail2:
EFSYS_PROBE(fail2);
EFSYS_KMEM_FREE(enp->en_esip, size, partns);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_DIAG */
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_size(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1311,7 +1617,7 @@ hunt_nvram_size(
{
hunt_parttbl_entry_t *entry;
uint32_t partn;
- int rc;
+ efx_rc_t rc;
if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -1327,14 +1633,14 @@ hunt_nvram_size(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
*sizep = 0;
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_get_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1343,7 +1649,7 @@ hunt_nvram_get_version(
{
hunt_parttbl_entry_t *entry;
uint32_t partn;
- int rc;
+ efx_rc_t rc;
if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -1363,12 +1669,12 @@ hunt_nvram_get_version(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_rw_start(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1376,7 +1682,7 @@ hunt_nvram_rw_start(
{
hunt_parttbl_entry_t *entry;
uint32_t partn;
- int rc;
+ efx_rc_t rc;
if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -1395,12 +1701,12 @@ hunt_nvram_rw_start(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_read_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1409,7 +1715,7 @@ hunt_nvram_read_chunk(
__in size_t size)
{
hunt_parttbl_entry_t *entry;
- int rc;
+ efx_rc_t rc;
if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -1425,19 +1731,19 @@ hunt_nvram_read_chunk(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_erase(
__in efx_nic_t *enp,
__in efx_nvram_type_t type)
{
hunt_parttbl_entry_t *entry;
size_t size;
- int rc;
+ efx_rc_t rc;
if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -1457,12 +1763,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_write_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1471,7 +1777,7 @@ hunt_nvram_write_chunk(
__in size_t size)
{
hunt_parttbl_entry_t *entry;
- int rc;
+ efx_rc_t rc;
if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -1487,7 +1793,7 @@ hunt_nvram_write_chunk(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -1503,7 +1809,7 @@ hunt_nvram_rw_finish(
hunt_nvram_partn_unlock(enp, entry->partn);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -1511,7 +1817,7 @@ hunt_nvram_set_version(
{
hunt_parttbl_entry_t *entry;
unsigned int partn;
- int rc;
+ efx_rc_t rc;
if ((entry = hunt_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -1528,7 +1834,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_phy.c b/sys/dev/sfxge/common/hunt_phy.c
index 1cffea2..e8d234a 100644
--- a/sys/dev/sfxge/common/hunt_phy.c
+++ b/sys/dev/sfxge/common/hunt_phy.c
@@ -191,14 +191,14 @@ hunt_phy_link_ev(
*link_modep = link_mode;
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_phy_power(
__in efx_nic_t *enp,
__in boolean_t power)
{
/* TBD: consider common Siena/Hunt function: essentially identical */
- int rc;
+ efx_rc_t rc;
if (!power)
return (0);
@@ -212,12 +212,12 @@ hunt_phy_power(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_phy_get_link(
__in efx_nic_t *enp,
__out hunt_link_state_t *hlsp)
@@ -231,7 +231,7 @@ hunt_phy_get_link(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN,
MC_CMD_GET_LINK_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_LINK;
@@ -293,12 +293,12 @@ hunt_phy_get_link(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_phy_reconfigure(
__in efx_nic_t *enp)
{
@@ -316,7 +316,7 @@ hunt_phy_reconfigure(
uint32_t cap_mask;
unsigned int led_mode;
unsigned int speed;
- int rc;
+ efx_rc_t rc;
if (~encp->enc_func_flags & EFX_NIC_FUNC_LINKCTRL)
goto out;
@@ -423,12 +423,12 @@ out:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_phy_verify(
__in efx_nic_t *enp)
{
@@ -438,7 +438,7 @@ hunt_phy_verify(
uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN,
MC_CMD_GET_PHY_STATE_OUT_LEN)];
uint32_t state;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_PHY_STATE;
@@ -474,12 +474,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip)
@@ -491,11 +491,11 @@ hunt_phy_oui_get(
#if EFSYS_OPT_PHY_STATS
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_PHY_NSTATS) uint32_t *stat)
+ __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat)
{
/* TBD: no stats support in firmware yet */
_NOTE(ARGUNUSED(enp, esmp))
@@ -522,7 +522,7 @@ hunt_phy_prop_name(
#endif /* EFSYS_OPT_NAMES */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -534,7 +534,7 @@ hunt_phy_prop_get(
return (ENOTSUP);
}
-extern __checkReturn int
+extern __checkReturn efx_rc_t
hunt_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -549,11 +549,11 @@ hunt_phy_prop_set(
#if EFSYS_OPT_BIST
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_bist_enable_offline(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0)
goto fail1;
@@ -561,17 +561,17 @@ hunt_bist_enable_offline(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_bist_start(enp, type)) != 0)
goto fail1;
@@ -579,12 +579,12 @@ hunt_bist_start(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_bist_poll(
__in efx_nic_t *enp,
__in efx_bist_type_t type,
@@ -601,7 +601,7 @@ hunt_bist_poll(
MCDI_CTL_SDU_LEN_MAX)];
uint32_t value_mask = 0;
uint32_t result;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_POLL_BIST;
@@ -682,7 +682,7 @@ hunt_bist_poll(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_rx.c b/sys/dev/sfxge/common/hunt_rx.c
index 991f293..6fdc747 100644
--- a/sys/dev/sfxge/common/hunt_rx.c
+++ b/sys/dev/sfxge/common/hunt_rx.c
@@ -39,14 +39,15 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_HUNTINGTON
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_init_rxq(
__in efx_nic_t *enp,
__in uint32_t size,
__in uint32_t target_evq,
__in uint32_t label,
__in uint32_t instance,
- __in efsys_mem_t *esmp)
+ __in efsys_mem_t *esmp,
+ __in boolean_t disable_scatter)
{
efx_mcdi_req_t req;
uint8_t payload[
@@ -56,7 +57,7 @@ efx_mcdi_init_rxq(
int i;
efx_qword_t *dma_addr;
uint64_t addr;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS);
@@ -71,12 +72,13 @@ efx_mcdi_init_rxq(
MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_TARGET_EVQ, target_evq);
MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_LABEL, label);
MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_INSTANCE, instance);
- MCDI_IN_POPULATE_DWORD_5(req, INIT_RXQ_IN_FLAGS,
- INIT_RXQ_IN_FLAG_BUFF_MODE, 0,
- INIT_RXQ_IN_FLAG_HDR_SPLIT, 0,
- INIT_RXQ_IN_FLAG_TIMESTAMP, 0,
- INIT_RXQ_IN_CRC_MODE, 0,
- INIT_RXQ_IN_FLAG_PREFIX, 1);
+ MCDI_IN_POPULATE_DWORD_6(req, INIT_RXQ_IN_FLAGS,
+ INIT_RXQ_IN_FLAG_BUFF_MODE, 0,
+ INIT_RXQ_IN_FLAG_HDR_SPLIT, 0,
+ INIT_RXQ_IN_FLAG_TIMESTAMP, 0,
+ INIT_RXQ_IN_CRC_MODE, 0,
+ INIT_RXQ_IN_FLAG_PREFIX, 1,
+ INIT_RXQ_IN_FLAG_DISABLE_SCATTER, disable_scatter);
MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_OWNER_ID, 0);
MCDI_IN_SET_DWORD(req, INIT_RXQ_IN_PORT_ID, EVB_PORT_ID_ASSIGNED);
@@ -102,12 +104,12 @@ efx_mcdi_init_rxq(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_fini_rxq(
__in efx_nic_t *enp,
__in uint32_t instance)
@@ -115,7 +117,7 @@ efx_mcdi_fini_rxq(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_FINI_RXQ_IN_LEN,
MC_CMD_FINI_RXQ_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FINI_RXQ;
@@ -136,13 +138,13 @@ efx_mcdi_fini_rxq(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#if EFSYS_OPT_RX_SCALE
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_rss_context_alloc(
__in efx_nic_t *enp,
__out uint32_t *rss_contextp)
@@ -151,7 +153,7 @@ efx_mcdi_rss_context_alloc(
uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN,
MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN)];
uint32_t rss_context;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_RSS_CONTEXT_ALLOC;
@@ -194,14 +196,14 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
-static int
+static efx_rc_t
efx_mcdi_rss_context_free(
__in efx_nic_t *enp,
__in uint32_t rss_context)
@@ -209,7 +211,7 @@ efx_mcdi_rss_context_free(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_FREE_IN_LEN,
MC_CMD_RSS_CONTEXT_FREE_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
rc = EINVAL;
@@ -237,14 +239,14 @@ efx_mcdi_rss_context_free(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
-static int
+static efx_rc_t
efx_mcdi_rss_context_set_flags(
__in efx_nic_t *enp,
__in uint32_t rss_context,
@@ -253,7 +255,7 @@ efx_mcdi_rss_context_set_flags(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN,
MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
rc = EINVAL;
@@ -292,14 +294,14 @@ efx_mcdi_rss_context_set_flags(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
-static int
+static efx_rc_t
efx_mcdi_rss_context_set_key(
__in efx_nic_t *enp,
__in uint32_t rss_context,
@@ -309,7 +311,7 @@ efx_mcdi_rss_context_set_key(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN,
MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
if (rss_context == HUNTINGTON_RSS_CONTEXT_INVALID) {
rc = EINVAL;
@@ -349,14 +351,14 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
-static int
+static efx_rc_t
efx_mcdi_rss_context_set_table(
__in efx_nic_t *enp,
__in uint32_t rss_context,
@@ -405,14 +407,14 @@ efx_mcdi_rss_context_set_table(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_init(
__in efx_nic_t *enp)
{
@@ -441,13 +443,13 @@ hunt_rx_init(
}
#if EFSYS_OPT_RX_HDR_SPLIT
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_hdr_split_enable(
__in efx_nic_t *enp,
__in unsigned int hdr_buf_size,
__in unsigned int pld_buf_size)
{
- int rc;
+ efx_rc_t rc;
/* FIXME */
_NOTE(ARGUNUSED(enp, hdr_buf_size, pld_buf_size))
@@ -460,14 +462,14 @@ hunt_rx_hdr_split_enable(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_HDR_SPLIT */
#if EFSYS_OPT_RX_SCATTER
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_scatter_enable(
__in efx_nic_t *enp,
__in unsigned int buf_size)
@@ -478,14 +480,14 @@ hunt_rx_scatter_enable(
#endif /* EFSYS_OPT_RX_SCATTER */
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_scale_mode_set(
__in efx_nic_t *enp,
__in efx_rx_hash_alg_t alg,
__in efx_rx_hash_type_t type,
__in boolean_t insert)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(alg, ==, EFX_RX_HASHALG_TOEPLITZ);
EFSYS_ASSERT3U(insert, ==, B_TRUE);
@@ -511,20 +513,20 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_scale_key_set(
__in efx_nic_t *enp,
__in_ecount(n) uint8_t *key,
__in size_t n)
{
- int rc;
+ efx_rc_t rc;
if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
rc = ENOTSUP;
@@ -540,20 +542,20 @@ hunt_rx_scale_key_set(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_RX_SCALE */
#if EFSYS_OPT_RX_SCALE
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_scale_tbl_set(
__in efx_nic_t *enp,
__in_ecount(n) unsigned int *table,
__in size_t n)
{
- int rc;
+ efx_rc_t rc;
if (enp->en_rss_support == EFX_RX_SCALE_UNAVAILABLE) {
rc = ENOTSUP;
@@ -569,7 +571,7 @@ hunt_rx_scale_tbl_set(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -644,12 +646,12 @@ hunt_rx_qpush(
erp->er_index, &dword, B_FALSE);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_qflush(
__in efx_rxq_t *erp)
{
efx_nic_t *enp = erp->er_enp;
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_fini_rxq(enp, erp->er_index)) != 0)
goto fail1;
@@ -657,7 +659,7 @@ hunt_rx_qflush(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -671,7 +673,7 @@ hunt_rx_qenable(
/* FIXME */
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_rx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -684,7 +686,8 @@ hunt_rx_qcreate(
__in efx_rxq_t *erp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- int rc;
+ efx_rc_t rc;
+ boolean_t disable_scatter;
_NOTE(ARGUNUSED(erp))
@@ -704,14 +707,21 @@ hunt_rx_qcreate(
goto fail2;
}
+ /* Scatter can only be disabled if the firmware supports doing so */
+ if ((type != EFX_RXQ_TYPE_SCATTER) &&
+ enp->en_nic_cfg.enc_rx_disable_scatter_supported) {
+ disable_scatter = B_TRUE;
+ } else {
+ disable_scatter = B_FALSE;
+ }
+
/*
- * FIXME: Siena code handles different queue types (default, header
- * split, scatter); we'll need to do something more here later, but
- * all that stuff is TBD for now.
+ * Note: EFX_RXQ_TYPE_SPLIT_HEADER and EFX_RXQ_TYPE_SPLIT_PAYLOAD are
+ * not supported here.
*/
if ((rc = efx_mcdi_init_rxq(enp, n, eep->ee_index, label, index,
- esmp)) != 0)
+ esmp, disable_scatter)) != 0)
goto fail3;
erp->er_eep = eep;
@@ -726,7 +736,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_sram.c b/sys/dev/sfxge/common/hunt_sram.c
index 947e033..9eb1480 100644
--- a/sys/dev/sfxge/common/hunt_sram.c
+++ b/sys/dev/sfxge/common/hunt_sram.c
@@ -40,12 +40,12 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_sram_test(
__in efx_nic_t *enp,
__in efx_sram_pattern_fn_t func)
{
- int rc;
+ efx_rc_t rc;
/* FIXME */
_NOTE(ARGUNUSED(enp))
@@ -59,7 +59,7 @@ hunt_sram_test(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_tx.c b/sys/dev/sfxge/common/hunt_tx.c
index ee5691a..910ee2e 100755
--- a/sys/dev/sfxge/common/hunt_tx.c
+++ b/sys/dev/sfxge/common/hunt_tx.c
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
#define EFX_TX_QSTAT_INCR(_etp, _stat)
#endif
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_init_txq(
__in efx_nic_t *enp,
__in uint32_t size,
@@ -65,7 +65,7 @@ efx_mcdi_init_txq(
uint64_t addr;
int npages;
int i;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >=
EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg)));
@@ -123,12 +123,12 @@ efx_mcdi_init_txq(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_fini_txq(
__in efx_nic_t *enp,
__in uint32_t instance)
@@ -136,7 +136,7 @@ efx_mcdi_fini_txq(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_FINI_TXQ_IN_LEN,
MC_CMD_FINI_TXQ_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_FINI_TXQ;
@@ -157,12 +157,12 @@ efx_mcdi_fini_txq(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_init(
__in efx_nic_t *enp)
{
@@ -177,7 +177,7 @@ hunt_tx_fini(
_NOTE(ARGUNUSED(enp))
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -191,7 +191,7 @@ hunt_tx_qcreate(
__out unsigned int *addedp)
{
efx_qword_t desc;
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags,
@@ -219,7 +219,7 @@ hunt_tx_qcreate(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -233,13 +233,13 @@ hunt_tx_qdestroy(
/* FIXME */
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qpio_enable(
__in efx_txq_t *etp)
{
efx_nic_t *enp = etp->et_enp;
efx_piobuf_handle_t handle;
- int rc;
+ efx_rc_t rc;
if (etp->et_pio_size != 0) {
rc = EALREADY;
@@ -284,7 +284,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -306,7 +306,7 @@ hunt_tx_qpio_disable(
}
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qpio_write(
__in efx_txq_t *etp,
__in_ecount(length) uint8_t *buffer,
@@ -318,7 +318,7 @@ hunt_tx_qpio_write(
uint32_t write_offset;
uint32_t write_offset_limit;
efx_qword_t *eqp;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(length % sizeof (efx_qword_t) == 0);
@@ -349,12 +349,12 @@ hunt_tx_qpio_write(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qpio_post(
__in efx_txq_t *etp,
__in size_t pkt_length,
@@ -365,7 +365,7 @@ hunt_tx_qpio_post(
unsigned int id;
size_t offset;
unsigned int added = *addedp;
- int rc;
+ efx_rc_t rc;
if (added - completed + 1 > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
@@ -402,12 +402,12 @@ hunt_tx_qpio_post(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qpost(
__in efx_txq_t *etp,
__in_ecount(n) efx_buffer_t *eb,
@@ -417,7 +417,7 @@ hunt_tx_qpost(
{
unsigned int added = *addedp;
unsigned int i;
- int rc;
+ efx_rc_t rc;
if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
rc = ENOSPC;
@@ -459,7 +459,7 @@ hunt_tx_qpost(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -499,7 +499,7 @@ hunt_tx_qpush(
&oword);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qdesc_post(
__in efx_txq_t *etp,
__in_ecount(n) efx_desc_t *ed,
@@ -509,7 +509,7 @@ hunt_tx_qdesc_post(
{
unsigned int added = *addedp;
unsigned int i;
- int rc;
+ efx_rc_t rc;
if (added - completed + n > EFX_TXQ_LIMIT(etp->et_mask + 1)) {
rc = ENOSPC;
@@ -536,7 +536,7 @@ hunt_tx_qdesc_post(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -603,12 +603,12 @@ hunt_tx_qdesc_vlantci_create(
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qpace(
__in efx_txq_t *etp,
__in unsigned int ns)
{
- int rc;
+ efx_rc_t rc;
/* FIXME */
_NOTE(ARGUNUSED(etp, ns))
@@ -621,17 +621,17 @@ hunt_tx_qpace(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_tx_qflush(
__in efx_txq_t *etp)
{
efx_nic_t *enp = etp->et_enp;
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_fini_txq(enp, etp->et_index)) != 0)
goto fail1;
@@ -639,7 +639,7 @@ hunt_tx_qflush(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/hunt_vpd.c b/sys/dev/sfxge/common/hunt_vpd.c
index 536ebbc..129167c 100644
--- a/sys/dev/sfxge/common/hunt_vpd.c
+++ b/sys/dev/sfxge/common/hunt_vpd.c
@@ -44,14 +44,14 @@ __FBSDID("$FreeBSD$");
#include "ef10_tlv_layout.h"
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_init(
__in efx_nic_t *enp)
{
caddr_t svpd;
size_t svpd_size;
uint32_t pci_pf;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -92,17 +92,17 @@ fail2:
EFSYS_KMEM_FREE(enp->en_esip, svpd_size, svpd);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -113,18 +113,18 @@ hunt_vpd_size(
* which is the size of the DYNAMIC_CONFIG partition.
*/
if ((rc = efx_mcdi_nvram_info(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
- sizep, NULL, NULL)) != 0)
+ sizep, NULL, NULL, NULL)) != 0)
goto fail1;
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
@@ -133,7 +133,7 @@ hunt_vpd_read(
caddr_t dvpd;
size_t dvpd_size;
uint32_t pci_pf;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -163,12 +163,12 @@ fail2:
EFSYS_KMEM_FREE(enp->en_esip, dvpd_size, dvpd);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -180,7 +180,7 @@ hunt_vpd_verify(
efx_vpd_keyword_t dkey;
unsigned int scont;
unsigned int dcont;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -237,19 +237,19 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
{
boolean_t wantpid;
- int rc;
+ efx_rc_t rc;
/*
* Only create an ID string if the dynamic cfg doesn't have one
@@ -279,12 +279,12 @@ hunt_vpd_reinit(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -293,7 +293,7 @@ hunt_vpd_get(
{
unsigned int offset;
uint8_t length;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -323,19 +323,19 @@ hunt_vpd_get(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_set(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__in efx_vpd_value_t *evvp)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -360,12 +360,12 @@ hunt_vpd_set(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_next(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -378,7 +378,7 @@ hunt_vpd_next(
return (ENOTSUP);
}
- __checkReturn int
+ __checkReturn efx_rc_t
hunt_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -386,7 +386,7 @@ hunt_vpd_write(
{
size_t vpd_length;
uint32_t pci_pf;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
@@ -396,11 +396,11 @@ hunt_vpd_write(
if ((rc = efx_vpd_hunk_length(data, size, &vpd_length)) != 0)
goto fail1;
- /* Store new dynamic VPD in DYNAMIC_CONFIG partition */
- if ((rc = hunt_nvram_partn_write_tlv(enp,
+ /* Store new dynamic VPD in all segments in DYNAMIC_CONFIG partition */
+ if ((rc = hunt_nvram_partn_write_segment_tlv(enp,
NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
TLV_TAG_PF_DYNAMIC_VPD(pci_pf),
- data, vpd_length)) != 0) {
+ data, vpd_length, B_TRUE)) != 0) {
goto fail2;
}
@@ -410,7 +410,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/mcdi_mon.c b/sys/dev/sfxge/common/mcdi_mon.c
index ec692be..f8b1681 100644
--- a/sys/dev/sfxge/common/mcdi_mon.c
+++ b/sys/dev/sfxge/common/mcdi_mon.c
@@ -162,7 +162,7 @@ mcdi_mon_decode_stats(
__in size_t sensor_mask_size,
__in_opt efsys_mem_t *esmp,
__out_ecount_opt(sensor_mask_size) uint32_t *stat_maskp,
- __out_ecount_opt(EFX_MON_NSTATS) efx_mon_stat_value_t *stat)
+ __inout_ecount_opt(EFX_MON_NSTATS) efx_mon_stat_value_t *stat)
{
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
uint16_t port_mask;
@@ -245,7 +245,7 @@ mcdi_mon_decode_stats(
}
}
- __checkReturn int
+ __checkReturn efx_rc_t
mcdi_mon_ev(
__in efx_nic_t *enp,
__in efx_qword_t *eqp,
@@ -259,7 +259,7 @@ mcdi_mon_ev(
uint16_t state;
uint16_t value;
efx_mon_stat_t id;
- int rc;
+ efx_rc_t rc;
port_mask = (emip->emi_port == 1)
? MCDI_MON_PORT_P1
@@ -293,13 +293,13 @@ mcdi_mon_ev(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_read_sensors(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
@@ -328,7 +328,7 @@ efx_mcdi_read_sensors(
return (req.emr_rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_sensor_info_npages(
__in efx_nic_t *enp,
__out uint32_t *npagesp)
@@ -337,7 +337,7 @@ efx_mcdi_sensor_info_npages(
uint8_t payload[MAX(MC_CMD_SENSOR_INFO_EXT_IN_LEN,
MC_CMD_SENSOR_INFO_OUT_LENMAX)];
int page;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(npagesp != NULL);
@@ -366,12 +366,12 @@ efx_mcdi_sensor_info_npages(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
efx_mcdi_sensor_info(
__in efx_nic_t *enp,
__out_ecount(npages) uint32_t *sensor_maskp,
@@ -381,7 +381,7 @@ efx_mcdi_sensor_info(
uint8_t payload[MAX(MC_CMD_SENSOR_INFO_EXT_IN_LEN,
MC_CMD_SENSOR_INFO_OUT_LENMAX)];
uint32_t page;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(sensor_maskp != NULL);
@@ -426,20 +426,20 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
mcdi_mon_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values)
+ __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t size = encp->enc_mon_stat_dma_buf_size;
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_read_sensors(enp, esmp, size)) != 0)
goto fail1;
@@ -454,18 +454,18 @@ mcdi_mon_stats_update(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
mcdi_mon_cfg_build(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t npages;
- int rc;
+ efx_rc_t rc;
switch (enp->en_family) {
#if EFSYS_OPT_SIENA
@@ -528,7 +528,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/mcdi_mon.h b/sys/dev/sfxge/common/mcdi_mon.h
index 30bb150..440a887 100644
--- a/sys/dev/sfxge/common/mcdi_mon.h
+++ b/sys/dev/sfxge/common/mcdi_mon.h
@@ -43,7 +43,7 @@ extern "C" {
#if EFSYS_OPT_MON_STATS
- __checkReturn int
+ __checkReturn efx_rc_t
mcdi_mon_cfg_build(
__in efx_nic_t *enp);
@@ -52,18 +52,18 @@ mcdi_mon_cfg_free(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
mcdi_mon_ev(
__in efx_nic_t *enp,
__in efx_qword_t *eqp,
__out efx_mon_stat_t *idp,
__out efx_mon_stat_value_t *valuep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
mcdi_mon_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values);
+ __inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values);
#endif /* EFSYS_OPT_MON_STATS */
diff --git a/sys/dev/sfxge/common/siena_flash.h b/sys/dev/sfxge/common/siena_flash.h
index c1ee1c5..51e29e7 100644
--- a/sys/dev/sfxge/common/siena_flash.h
+++ b/sys/dev/sfxge/common/siena_flash.h
@@ -193,7 +193,7 @@ typedef struct siena_mc_combo_rom_hdr_s { /* GENERATED BY scripts/genfwdef */
efx_byte_t infoblk_len;/* length of space reserved for one infoblk structure */
efx_byte_t reserved[7];/* (set to 0) */
} v2;
- };
+ } data;
} siena_mc_combo_rom_hdr_t;
#pragma pack()
diff --git a/sys/dev/sfxge/common/siena_impl.h b/sys/dev/sfxge/common/siena_impl.h
index b65e399..58c9400 100644
--- a/sys/dev/sfxge/common/siena_impl.h
+++ b/sys/dev/sfxge/common/siena_impl.h
@@ -55,29 +55,29 @@ typedef enum siena_phy_prop_e {
#define SIENA_NVRAM_CHUNK 0x80
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nic_probe(
__in efx_nic_t *enp);
#if EFSYS_OPT_PCIE_TUNE
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nic_pcie_extended_sync(
__in efx_nic_t *enp);
#endif
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nic_reset(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nic_init(
__in efx_nic_t *enp);
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nic_register_test(
__in efx_nic_t *enp);
@@ -99,7 +99,7 @@ siena_sram_init(
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_sram_test(
__in efx_nic_t *enp,
__in efx_sram_pattern_fn_t func);
@@ -108,7 +108,7 @@ siena_sram_test(
#if EFSYS_OPT_MCDI
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mcdi_init(
__in efx_nic_t *enp,
__in const efx_mcdi_transport_t *mtp);
@@ -130,7 +130,7 @@ siena_mcdi_request_copyout(
__in efx_nic_t *enp,
__in efx_mcdi_req_t *emrp);
-extern int
+extern efx_rc_t
siena_mcdi_poll_reboot(
__in efx_nic_t *enp);
@@ -138,32 +138,37 @@ extern void
siena_mcdi_fini(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mcdi_fw_update_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mcdi_macaddr_change_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+siena_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
#endif /* EFSYS_OPT_MCDI */
#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_partn_size(
__in efx_nic_t *enp,
__in unsigned int partn,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_partn_lock(
__in efx_nic_t *enp,
__in unsigned int partn);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_partn_read(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -171,14 +176,14 @@ siena_nvram_partn_read(
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_partn_erase(
__in efx_nic_t *enp,
__in unsigned int partn,
__in unsigned int offset,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_partn_write(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -191,7 +196,7 @@ siena_nvram_partn_unlock(
__in efx_nic_t *enp,
__in unsigned int partn);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_get_dynamic_cfg(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -205,38 +210,38 @@ siena_nvram_get_dynamic_cfg(
#if EFSYS_OPT_DIAG
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_test(
__in efx_nic_t *enp);
#endif /* EFSYS_OPT_DIAG */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_size(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_get_subtype(
__in efx_nic_t *enp,
__in unsigned int partn,
__out uint32_t *subtypep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_get_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out uint32_t *subtypep,
__out_ecount(4) uint16_t version[4]);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_rw_start(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *pref_chunkp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_read_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -244,12 +249,12 @@ siena_nvram_read_chunk(
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_erase(
__in efx_nic_t *enp,
__in efx_nvram_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_write_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -262,7 +267,7 @@ siena_nvram_rw_finish(
__in efx_nic_t *enp,
__in efx_nvram_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -272,48 +277,48 @@ siena_nvram_set_version(
#if EFSYS_OPT_VPD
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_init(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__inout efx_vpd_value_t *evvp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_set(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__in efx_vpd_value_t *evvp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_next(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -321,7 +326,7 @@ siena_vpd_next(
__out efx_vpd_value_t *evvp,
__inout unsigned int *contp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -350,44 +355,44 @@ siena_phy_link_ev(
__in efx_qword_t *eqp,
__out efx_link_mode_t *link_modep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_get_link(
__in efx_nic_t *enp,
__out siena_link_state_t *slsp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_power(
__in efx_nic_t *enp,
__in boolean_t on);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_reconfigure(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_verify(
__in efx_nic_t *enp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip);
#if EFSYS_OPT_PHY_STATS
-extern void
+extern void
siena_phy_decode_stats(
- __in efx_nic_t *enp,
- __in uint32_t vmask,
- __in_opt efsys_mem_t *esmp,
- __out_opt uint64_t *smaskp,
- __out_ecount_opt(EFX_PHY_NSTATS) uint32_t *stat);
+ __in efx_nic_t *enp,
+ __in uint32_t vmask,
+ __in_opt efsys_mem_t *esmp,
+ __out_opt uint64_t *smaskp,
+ __inout_ecount_opt(EFX_PHY_NSTATS) uint32_t *stat);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_PHY_NSTATS) uint32_t *stat);
+ __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat);
#endif /* EFSYS_OPT_PHY_STATS */
@@ -402,14 +407,14 @@ siena_phy_prop_name(
#endif /* EFSYS_OPT_NAMES */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
__in uint32_t flags,
__out uint32_t *valp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -419,12 +424,12 @@ siena_phy_prop_set(
#if EFSYS_OPT_BIST
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_bist_poll(
__in efx_nic_t *enp,
__in efx_bist_type_t type,
@@ -442,23 +447,23 @@ siena_phy_bist_stop(
#endif /* EFSYS_OPT_BIST */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mac_poll(
__in efx_nic_t *enp,
__out efx_link_mode_t *link_modep);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp);
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mac_reconfigure(
__in efx_nic_t *enp);
#if EFSYS_OPT_LOOPBACK
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mac_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
@@ -468,12 +473,12 @@ siena_mac_loopback_set(
#if EFSYS_OPT_MAC_STATS
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
- __out_opt uint32_t *generationp);
+ __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
+ __inout_opt uint32_t *generationp);
#endif /* EFSYS_OPT_MAC_STATS */
diff --git a/sys/dev/sfxge/common/siena_mac.c b/sys/dev/sfxge/common/siena_mac.c
index beeaea1..ff8e11a 100644
--- a/sys/dev/sfxge/common/siena_mac.c
+++ b/sys/dev/sfxge/common/siena_mac.c
@@ -37,14 +37,14 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_SIENA
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mac_poll(
__in efx_nic_t *enp,
__out efx_link_mode_t *link_modep)
{
efx_port_t *epp = &(enp->en_port);
siena_link_state_t sls;
- int rc;
+ efx_rc_t rc;
if ((rc = siena_phy_get_link(enp, &sls)) != 0)
goto fail1;
@@ -57,20 +57,20 @@ siena_mac_poll(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
*link_modep = EFX_LINK_UNKNOWN;
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mac_up(
__in efx_nic_t *enp,
__out boolean_t *mac_upp)
{
siena_link_state_t sls;
- int rc;
+ efx_rc_t rc;
/*
* Because Siena doesn't *require* polling, we can't rely on
@@ -84,12 +84,12 @@ siena_mac_up(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mac_reconfigure(
__in efx_nic_t *enp)
{
@@ -101,7 +101,7 @@ siena_mac_reconfigure(
MAX(MC_CMD_SET_MCAST_HASH_IN_LEN,
MC_CMD_SET_MCAST_HASH_OUT_LEN))];
unsigned int fcntl;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_MAC;
@@ -184,14 +184,14 @@ siena_mac_reconfigure(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#if EFSYS_OPT_LOOPBACK
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mac_loopback_set(
__in efx_nic_t *enp,
__in efx_link_mode_t link_mode,
@@ -201,7 +201,7 @@ siena_mac_loopback_set(
efx_phy_ops_t *epop = epp->ep_epop;
efx_loopback_type_t old_loopback_type;
efx_link_mode_t old_loopback_link_mode;
- int rc;
+ efx_rc_t rc;
/* The PHY object handles this on Siena */
old_loopback_type = epp->ep_loopback_type;
@@ -230,12 +230,12 @@ fail1:
#define SIENA_MAC_STAT_READ(_esmp, _field, _eqp) \
EFSYS_MEM_READQ((_esmp), (_field) * sizeof (efx_qword_t), _eqp)
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mac_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
- __out_opt uint32_t *generationp)
+ __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat,
+ __inout_opt uint32_t *generationp)
{
efx_qword_t value;
efx_qword_t generation_start;
diff --git a/sys/dev/sfxge/common/siena_mcdi.c b/sys/dev/sfxge/common/siena_mcdi.c
index b2224ac..a05791b 100644
--- a/sys/dev/sfxge/common/siena_mcdi.c
+++ b/sys/dev/sfxge/common/siena_mcdi.c
@@ -61,7 +61,11 @@ siena_mcdi_request_copyin(
__in boolean_t ev_cpl,
__in boolean_t new_epoch)
{
+#if EFSYS_OPT_MCDI_LOGGING
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+#endif
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
+ efx_dword_t hdr;
efx_dword_t dword;
unsigned int xflags;
unsigned int pdur;
@@ -80,15 +84,24 @@ siena_mcdi_request_copyin(
xflags |= MCDI_HEADER_XFLAGS_EVREQ;
/* Construct the header in shared memory */
- EFX_POPULATE_DWORD_6(dword,
+ EFX_POPULATE_DWORD_6(hdr,
MCDI_HEADER_CODE, emrp->emr_cmd,
MCDI_HEADER_RESYNC, 1,
MCDI_HEADER_DATALEN, emrp->emr_in_length,
MCDI_HEADER_SEQ, seq,
MCDI_HEADER_RESPONSE, 0,
MCDI_HEADER_XFLAGS, xflags);
- EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_TRUE);
+ EFX_BAR_TBL_WRITED(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_TRUE);
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_REQUEST,
+ &hdr, sizeof (hdr),
+ emrp->emr_in_buf, emrp->emr_in_length);
+ }
+#endif /* EFSYS_OPT_MCDI_LOGGING */
+ /* Construct the payload */
for (pos = 0; pos < emrp->emr_in_length; pos += sizeof (efx_dword_t)) {
memcpy(&dword, MCDI_IN(*emrp, efx_dword_t, pos),
MIN(sizeof (dword), emrp->emr_in_length - pos));
@@ -106,6 +119,10 @@ siena_mcdi_request_copyout(
__in efx_nic_t *enp,
__in efx_mcdi_req_t *emrp)
{
+#if EFSYS_OPT_MCDI_LOGGING
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+ efx_dword_t hdr;
+#endif
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
unsigned int pos;
unsigned int pdur;
@@ -124,9 +141,20 @@ siena_mcdi_request_copyout(
MIN(sizeof (data), bytes - pos));
}
}
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE);
+
+ emtp->emt_logger(emtp->emt_context,
+ EFX_LOG_MCDI_RESPONSE,
+ &hdr, sizeof (hdr),
+ emrp->emr_out_buf, emrp->emr_out_length_used);
+ }
+#endif /* EFSYS_OPT_MCDI_LOGGING */
}
- int
+ efx_rc_t
siena_mcdi_poll_reboot(
__in efx_nic_t *enp)
{
@@ -167,14 +195,17 @@ siena_mcdi_poll_reboot(
siena_mcdi_request_poll(
__in efx_nic_t *enp)
{
+#if EFSYS_OPT_MCDI_LOGGING
+ const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
+#endif
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
efx_mcdi_req_t *emrp;
- efx_dword_t dword;
+ efx_dword_t hdr;
unsigned int pdur;
unsigned int seq;
unsigned int length;
int state;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
@@ -199,8 +230,8 @@ siena_mcdi_request_poll(
pdur = SIENA_MCDI_PDU(emip);
/* Read the command header */
- EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &dword, B_FALSE);
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_RESPONSE) == 0) {
+ EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE);
+ if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) == 0) {
EFSYS_UNLOCK(enp->en_eslp, state);
return (B_FALSE);
}
@@ -210,8 +241,8 @@ siena_mcdi_request_poll(
seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ);
/* Check for synchronous reboot */
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR) != 0 &&
- EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN) == 0) {
+ if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_ERROR) != 0 &&
+ EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN) == 0) {
/* Consume status word */
EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US);
siena_mcdi_poll_reboot(enp);
@@ -223,15 +254,15 @@ siena_mcdi_request_poll(
EFSYS_UNLOCK(enp->en_eslp, state);
/* Check that the returned data is consistent */
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_CODE) != emrp->emr_cmd ||
- EFX_DWORD_FIELD(dword, MCDI_HEADER_SEQ) != seq) {
+ if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_CODE) != emrp->emr_cmd ||
+ EFX_DWORD_FIELD(hdr, MCDI_HEADER_SEQ) != seq) {
/* Response is for a different request */
rc = EIO;
goto fail3;
}
- length = EFX_DWORD_FIELD(dword, MCDI_HEADER_DATALEN);
- if (EFX_DWORD_FIELD(dword, MCDI_HEADER_ERROR)) {
+ length = EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN);
+ if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_ERROR)) {
efx_dword_t errdword;
int errcode;
@@ -240,6 +271,16 @@ siena_mcdi_request_poll(
pdur + 1 + (MC_CMD_ERR_CODE_OFST >> 2),
&errdword, B_FALSE);
errcode = EFX_DWORD_FIELD(errdword, EFX_DWORD_0);
+
+#if EFSYS_OPT_MCDI_LOGGING
+ if (emtp->emt_logger != NULL) {
+ emtp->emt_logger(emtp->emt_context,
+ EFX_LOG_MCDI_RESPONSE,
+ &hdr, sizeof (hdr),
+ &errdword, sizeof (errdword));
+ }
+#endif /* EFSYS_OPT_MCDI_LOGGING */
+
rc = efx_mcdi_request_errcode(errcode);
if (!emrp->emr_quiet) {
EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd,
@@ -266,7 +307,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
if (!emrp->emr_quiet)
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
/* Fill out error state */
emrp->emr_rc = rc;
@@ -280,7 +321,7 @@ out:
return (B_TRUE);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mcdi_init(
__in efx_nic_t *enp,
__in const efx_mcdi_transport_t *mtp)
@@ -288,7 +329,7 @@ siena_mcdi_init(
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
efx_oword_t oword;
unsigned int portnum;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -316,7 +357,7 @@ siena_mcdi_init(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -327,7 +368,7 @@ siena_mcdi_fini(
{
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mcdi_fw_update_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp)
@@ -339,7 +380,7 @@ siena_mcdi_fw_update_supported(
return (0);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_mcdi_macaddr_change_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp)
@@ -351,4 +392,16 @@ siena_mcdi_macaddr_change_supported(
return (0);
}
+ __checkReturn efx_rc_t
+siena_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
+
+ *supportedp = B_TRUE;
+
+ return (0);
+}
+
#endif /* EFSYS_OPT_SIENA && EFSYS_OPT_MCDI */
diff --git a/sys/dev/sfxge/common/siena_nic.c b/sys/dev/sfxge/common/siena_nic.c
index 3dcf48e..6652f1e 100644
--- a/sys/dev/sfxge/common/siena_nic.c
+++ b/sys/dev/sfxge/common/siena_nic.c
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
siena_nic_get_partn_mask(
__in efx_nic_t *enp,
__out unsigned int *maskp)
@@ -46,7 +46,7 @@ siena_nic_get_partn_mask(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_NVRAM_TYPES_IN_LEN,
MC_CMD_NVRAM_TYPES_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_NVRAM_TYPES;
@@ -74,18 +74,18 @@ siena_nic_get_partn_mask(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#if EFSYS_OPT_PCIE_TUNE
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nic_pcie_extended_sync(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_set_workaround(enp, MC_CMD_WORKAROUND_BUG17230,
B_TRUE, NULL) != 0))
@@ -94,14 +94,14 @@ siena_nic_pcie_extended_sync(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_PCIE_TUNE */
-static __checkReturn int
+static __checkReturn efx_rc_t
siena_board_cfg(
__in efx_nic_t *enp)
{
@@ -110,7 +110,7 @@ siena_board_cfg(
efx_dword_t capabilities;
uint32_t board_type;
uint32_t nevq, nrxq, ntxq;
- int rc;
+ efx_rc_t rc;
/* External port identifier using one-based port numbering */
encp->enc_external_port = (uint8_t)enp->en_mcdi.em_emip.emi_port;
@@ -176,17 +176,17 @@ siena_board_cfg(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
siena_phy_cfg(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
- int rc;
+ efx_rc_t rc;
/* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */
if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0)
@@ -201,12 +201,12 @@ siena_phy_cfg(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nic_probe(
__in efx_nic_t *enp)
{
@@ -215,7 +215,7 @@ siena_nic_probe(
siena_link_state_t sls;
unsigned int mask;
efx_oword_t oword;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
@@ -314,17 +314,17 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nic_reset(
__in efx_nic_t *enp)
{
efx_mcdi_req_t req;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
@@ -360,7 +360,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (0);
}
@@ -395,11 +395,11 @@ siena_nic_usrev_dis(
EFX_BAR_WRITEO(enp, FR_CZ_USR_EV_CFG, &oword);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nic_init(
__in efx_nic_t *enp)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
@@ -424,7 +424,7 @@ siena_nic_init(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -506,7 +506,7 @@ static const uint32_t __siena_table_masks[] = {
0xFFFF07FF, 0xFFFFFFFF, 0x0000007F, 0x00000000,
};
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nic_register_test(
__in efx_nic_t *enp)
{
@@ -514,7 +514,7 @@ siena_nic_register_test(
const uint32_t *dwordp;
unsigned int nitems;
unsigned int count;
- int rc;
+ efx_rc_t rc;
/* Fill out the register mask entries */
EFX_STATIC_ASSERT(EFX_ARRAY_SIZE(__siena_register_masks)
@@ -571,7 +571,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/siena_nvram.c b/sys/dev/sfxge/common/siena_nvram.c
index 7d20ec0..ecc5195 100644
--- a/sys/dev/sfxge/common/siena_nvram.c
+++ b/sys/dev/sfxge/common/siena_nvram.c
@@ -41,20 +41,21 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_partn_size(
__in efx_nic_t *enp,
__in unsigned int partn,
__out size_t *sizep)
{
- int rc;
+ efx_rc_t rc;
if ((1 << partn) & ~enp->en_u.siena.enu_partn_mask) {
rc = ENOTSUP;
goto fail1;
}
- if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, NULL, NULL)) != 0) {
+ if ((rc = efx_mcdi_nvram_info(enp, partn, sizep,
+ NULL, NULL, NULL)) != 0) {
goto fail2;
}
@@ -63,17 +64,17 @@ siena_nvram_partn_size(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_partn_lock(
__in efx_nic_t *enp,
__in unsigned int partn)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_nvram_update_start(enp, partn)) != 0) {
goto fail1;
@@ -82,12 +83,12 @@ siena_nvram_partn_lock(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_partn_read(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -96,7 +97,7 @@ siena_nvram_partn_read(
__in size_t size)
{
size_t chunk;
- int rc;
+ efx_rc_t rc;
while (size > 0) {
chunk = MIN(size, SIENA_NVRAM_CHUNK);
@@ -114,19 +115,19 @@ siena_nvram_partn_read(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_partn_erase(
__in efx_nic_t *enp,
__in unsigned int partn,
__in unsigned int offset,
__in size_t size)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0) {
goto fail1;
@@ -135,12 +136,12 @@ siena_nvram_partn_erase(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_partn_write(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -149,7 +150,7 @@ siena_nvram_partn_write(
__in size_t size)
{
size_t chunk;
- int rc;
+ efx_rc_t rc;
while (size > 0) {
chunk = MIN(size, SIENA_NVRAM_CHUNK);
@@ -167,7 +168,7 @@ siena_nvram_partn_write(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -178,7 +179,7 @@ siena_nvram_partn_unlock(
__in unsigned int partn)
{
boolean_t reboot;
- int rc;
+ efx_rc_t rc;
/*
* Reboot into the new image only for PHYs. The driver has to
@@ -195,7 +196,7 @@ siena_nvram_partn_unlock(
return;
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
}
#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */
@@ -254,14 +255,14 @@ siena_parttbl_entry(
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_test(
__in efx_nic_t *enp)
{
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
siena_parttbl_entry_t *entry;
unsigned int i;
- int rc;
+ efx_rc_t rc;
/*
* Iterate over the list of supported partition types
@@ -282,21 +283,21 @@ siena_nvram_test(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
#endif /* EFSYS_OPT_DIAG */
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_size(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *sizep)
{
siena_parttbl_entry_t *entry;
- int rc;
+ efx_rc_t rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -311,7 +312,7 @@ siena_nvram_size(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
*sizep = 0;
@@ -322,7 +323,7 @@ fail1:
(sizeof (siena_mc_dynamic_config_hdr_t) + ((_nitems) * \
sizeof (((siena_mc_dynamic_config_hdr_t *)NULL)->fw_version[0])))
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_get_dynamic_cfg(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -339,7 +340,7 @@ siena_nvram_get_dynamic_cfg(
unsigned int nversions;
unsigned int pos;
unsigned int region;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(partn == MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0 ||
partn == MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1);
@@ -446,12 +447,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_get_subtype(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -461,7 +462,7 @@ siena_nvram_get_subtype(
uint8_t payload[MAX(MC_CMD_GET_BOARD_CFG_IN_LEN,
MC_CMD_GET_BOARD_CFG_OUT_LENMAX)];
efx_word_t *fw_list;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_BOARD_CFG;
@@ -500,12 +501,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_get_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -517,7 +518,7 @@ siena_nvram_get_version(
unsigned int dcfg_partn;
unsigned int partn;
unsigned int i;
- int rc;
+ efx_rc_t rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -593,19 +594,19 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_rw_start(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
__out size_t *chunk_sizep)
{
siena_parttbl_entry_t *entry;
- int rc;
+ efx_rc_t rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -623,12 +624,12 @@ siena_nvram_rw_start(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_read_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -637,7 +638,7 @@ siena_nvram_read_chunk(
__in size_t size)
{
siena_parttbl_entry_t *entry;
- int rc;
+ efx_rc_t rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -653,19 +654,19 @@ siena_nvram_read_chunk(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_erase(
__in efx_nic_t *enp,
__in efx_nvram_type_t type)
{
siena_parttbl_entry_t *entry;
size_t size;
- int rc;
+ efx_rc_t rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -685,12 +686,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_write_chunk(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -699,7 +700,7 @@ siena_nvram_write_chunk(
__in size_t size)
{
siena_parttbl_entry_t *entry;
- int rc;
+ efx_rc_t rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -715,7 +716,7 @@ siena_nvram_write_chunk(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -731,7 +732,7 @@ siena_nvram_rw_finish(
siena_nvram_partn_unlock(enp, entry->partn);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_nvram_set_version(
__in efx_nic_t *enp,
__in efx_nvram_type_t type,
@@ -750,7 +751,7 @@ siena_nvram_set_version(
uint8_t cksum;
uint32_t subtype;
size_t length;
- int rc;
+ efx_rc_t rc;
if ((entry = siena_parttbl_entry(enp, type)) == NULL) {
rc = ENOTSUP;
@@ -861,7 +862,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/siena_phy.c b/sys/dev/sfxge/common/siena_phy.c
index fd0871d..d39ae97 100644
--- a/sys/dev/sfxge/common/siena_phy.c
+++ b/sys/dev/sfxge/common/siena_phy.c
@@ -167,12 +167,12 @@ siena_phy_link_ev(
*link_modep = link_mode;
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_power(
__in efx_nic_t *enp,
__in boolean_t power)
{
- int rc;
+ efx_rc_t rc;
if (!power)
return (0);
@@ -186,12 +186,12 @@ siena_phy_power(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_get_link(
__in efx_nic_t *enp,
__out siena_link_state_t *slsp)
@@ -199,7 +199,7 @@ siena_phy_get_link(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN,
MC_CMD_GET_LINK_OUT_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_LINK;
@@ -261,12 +261,12 @@ siena_phy_get_link(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_reconfigure(
__in efx_nic_t *enp)
{
@@ -279,7 +279,7 @@ siena_phy_reconfigure(
uint32_t cap_mask;
unsigned int led_mode;
unsigned int speed;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SET_LINK;
@@ -377,12 +377,12 @@ siena_phy_reconfigure(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_verify(
__in efx_nic_t *enp)
{
@@ -390,7 +390,7 @@ siena_phy_verify(
uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN,
MC_CMD_GET_PHY_STATE_OUT_LEN)];
uint32_t state;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_GET_PHY_STATE;
@@ -426,12 +426,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_oui_get(
__in efx_nic_t *enp,
__out uint32_t *ouip)
@@ -466,7 +466,7 @@ siena_phy_decode_stats(
__in uint32_t vmask,
__in_opt efsys_mem_t *esmp,
__out_opt uint64_t *smaskp,
- __out_ecount_opt(EFX_PHY_NSTATS) uint32_t *stat)
+ __inout_ecount_opt(EFX_PHY_NSTATS) uint32_t *stat)
{
uint64_t smask = 0;
@@ -546,11 +546,11 @@ siena_phy_decode_stats(
*smaskp = smask;
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
- __out_ecount(EFX_PHY_NSTATS) uint32_t *stat)
+ __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t vmask = encp->enc_mcdi_phy_stat_mask;
@@ -558,7 +558,7 @@ siena_phy_stats_update(
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_PHY_STATS_IN_LEN,
MC_CMD_PHY_STATS_OUT_DMA_LEN)];
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_PHY_STATS;
@@ -586,7 +586,7 @@ siena_phy_stats_update(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (0);
}
@@ -609,7 +609,7 @@ siena_phy_prop_name(
#endif /* EFSYS_OPT_NAMES */
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_prop_get(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -621,7 +621,7 @@ siena_phy_prop_get(
return (ENOTSUP);
}
-extern __checkReturn int
+extern __checkReturn efx_rc_t
siena_phy_prop_set(
__in efx_nic_t *enp,
__in unsigned int id,
@@ -636,12 +636,12 @@ siena_phy_prop_set(
#if EFSYS_OPT_BIST
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_bist_start(
__in efx_nic_t *enp,
__in efx_bist_type_t type)
{
- int rc;
+ efx_rc_t rc;
if ((rc = efx_mcdi_bist_start(enp, type)) != 0)
goto fail1;
@@ -649,7 +649,7 @@ siena_phy_bist_start(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -674,7 +674,7 @@ siena_phy_sft9001_bist_status(
}
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_phy_bist_poll(
__in efx_nic_t *enp,
__in efx_bist_type_t type,
@@ -691,7 +691,7 @@ siena_phy_bist_poll(
uint32_t value_mask = 0;
efx_mcdi_req_t req;
uint32_t result;
- int rc;
+ efx_rc_t rc;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_POLL_BIST;
@@ -823,7 +823,7 @@ siena_phy_bist_poll(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/common/siena_sram.c b/sys/dev/sfxge/common/siena_sram.c
index cf36067..9a9c5ca 100644
--- a/sys/dev/sfxge/common/siena_sram.c
+++ b/sys/dev/sfxge/common/siena_sram.c
@@ -77,7 +77,7 @@ siena_sram_init(
#if EFSYS_OPT_DIAG
- __checkReturn int
+ __checkReturn efx_rc_t
siena_sram_test(
__in efx_nic_t *enp,
__in efx_sram_pattern_fn_t func)
@@ -88,7 +88,7 @@ siena_sram_test(
size_t rows;
unsigned int wptr;
unsigned int rptr;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -168,7 +168,7 @@ siena_sram_test(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
/* Restore back to FULL buffer table mode */
EFX_POPULATE_OWORD_1(oword, FRF_AZ_BUF_TBL_MODE, 1);
diff --git a/sys/dev/sfxge/common/siena_vpd.c b/sys/dev/sfxge/common/siena_vpd.c
index 4d4b825..df6797d 100644
--- a/sys/dev/sfxge/common/siena_vpd.c
+++ b/sys/dev/sfxge/common/siena_vpd.c
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
siena_vpd_get_static(
__in efx_nic_t *enp,
__in unsigned int partn,
@@ -57,7 +57,7 @@ siena_vpd_get_static(
unsigned int hdr_length;
unsigned int pos;
unsigned int region;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(partn == MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT0 ||
partn == MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT1);
@@ -152,12 +152,12 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_init(
__in efx_nic_t *enp)
{
@@ -165,7 +165,7 @@ siena_vpd_init(
caddr_t svpd = NULL;
unsigned partn;
size_t size = 0;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -196,19 +196,19 @@ fail2:
EFSYS_KMEM_FREE(enp->en_esip, size, svpd);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_size(
__in efx_nic_t *enp,
__out size_t *sizep)
{
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
unsigned int partn;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -230,12 +230,12 @@ siena_vpd_size(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_read(
__in efx_nic_t *enp,
__out_bcount(size) caddr_t data,
@@ -247,7 +247,7 @@ siena_vpd_read(
unsigned int vpd_offset;
unsigned int dcfg_partn;
size_t dcfg_size;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -282,12 +282,12 @@ fail2:
EFSYS_KMEM_FREE(enp->en_esip, dcfg_size, dcfg);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_verify(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -300,7 +300,7 @@ siena_vpd_verify(
unsigned int scont;
unsigned int dcont;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -357,19 +357,19 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_reinit(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size)
{
boolean_t wantpid;
- int rc;
+ efx_rc_t rc;
/*
* Only create a PID if the dynamic cfg doesn't have one
@@ -399,12 +399,12 @@ siena_vpd_reinit(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_get(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -413,7 +413,7 @@ siena_vpd_get(
{
unsigned int offset;
uint8_t length;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -443,19 +443,19 @@ siena_vpd_get(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_set(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
__in size_t size,
__in efx_vpd_value_t *evvp)
{
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -480,12 +480,12 @@ siena_vpd_set(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_next(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -498,7 +498,7 @@ siena_vpd_next(
return (ENOTSUP);
}
- __checkReturn int
+ __checkReturn efx_rc_t
siena_vpd_write(
__in efx_nic_t *enp,
__in_bcount(size) caddr_t data,
@@ -513,7 +513,7 @@ siena_vpd_write(
uint8_t cksum;
size_t partn_size, dcfg_size;
size_t vpd_length;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA);
@@ -588,7 +588,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c
index 3ee908b..97588c7 100644
--- a/sys/dev/sfxge/sfxge.c
+++ b/sys/dev/sfxge/sfxge.c
@@ -95,6 +95,12 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, CTLFLAG_RDTUN,
&sfxge_tx_ring_entries, 0,
"Maximum number of descriptors in a transmit ring");
+#if EFSYS_OPT_MCDI_LOGGING
+#define SFXGE_PARAM_MCDI_LOGGING SFXGE_PARAM(mcdi_logging)
+static int sfxge_mcdi_logging = 0;
+TUNABLE_INT(SFXGE_PARAM_MCDI_LOGGING, &sfxge_mcdi_logging);
+#endif
+
static void
sfxge_reset(void *arg, int npending);
@@ -538,6 +544,9 @@ sfxge_ifnet_init(struct ifnet *ifp, struct sfxge_softc *sc)
ifp->if_capabilities = SFXGE_CAP;
ifp->if_capenable = SFXGE_CAP_ENABLE;
+ ifp->if_hw_tsomax = SFXGE_TSO_MAX_SIZE;
+ ifp->if_hw_tsomaxsegcount = SFXGE_TX_MAPPING_MAX_SEG;
+ ifp->if_hw_tsomaxsegsize = PAGE_SIZE;
#ifdef SFXGE_LRO
ifp->if_capabilities |= IFCAP_LRO;
@@ -617,6 +626,9 @@ sfxge_create(struct sfxge_softc *sc)
efx_nic_t *enp;
int error;
char rss_param_name[sizeof(SFXGE_PARAM(%d.max_rss_channels))];
+#if EFSYS_OPT_MCDI_LOGGING
+ char mcdi_log_param_name[sizeof(SFXGE_PARAM(%d.mcdi_logging))];
+#endif
dev = sc->dev;
@@ -627,6 +639,13 @@ sfxge_create(struct sfxge_softc *sc)
SFXGE_PARAM(%d.max_rss_channels),
(int)device_get_unit(dev));
TUNABLE_INT_FETCH(rss_param_name, &sc->max_rss_channels);
+#if EFSYS_OPT_MCDI_LOGGING
+ sc->mcdi_logging = sfxge_mcdi_logging;
+ snprintf(mcdi_log_param_name, sizeof(mcdi_log_param_name),
+ SFXGE_PARAM(%d.mcdi_logging),
+ (int)device_get_unit(dev));
+ TUNABLE_INT_FETCH(mcdi_log_param_name, &sc->mcdi_logging);
+#endif
sc->stats_node = SYSCTL_ADD_NODE(
device_get_sysctl_ctx(dev),
diff --git a/sys/dev/sfxge/sfxge.h b/sys/dev/sfxge/sfxge.h
index 6e6c0af..fbe0bd4 100644
--- a/sys/dev/sfxge/sfxge.h
+++ b/sys/dev/sfxge/sfxge.h
@@ -281,6 +281,9 @@ struct sfxge_softc {
unsigned int txq_count;
int tso_fw_assisted;
+#if EFSYS_OPT_MCDI_LOGGING
+ int mcdi_logging;
+#endif
};
#define SFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
diff --git a/sys/dev/sfxge/sfxge_mcdi.c b/sys/dev/sfxge/sfxge_mcdi.c
index fb9f650..3a85c28 100644
--- a/sys/dev/sfxge/sfxge_mcdi.c
+++ b/sys/dev/sfxge/sfxge_mcdi.c
@@ -49,6 +49,10 @@ __FBSDID("$FreeBSD$");
#include "sfxge.h"
+#if EFSYS_OPT_MCDI_LOGGING
+#include <dev/pci/pcivar.h>
+#endif
+
#define SFXGE_MCDI_POLL_INTERVAL_MIN 10 /* 10us in 1us units */
#define SFXGE_MCDI_POLL_INTERVAL_MAX 100000 /* 100ms in 1us units */
#define SFXGE_MCDI_WATCHDOG_INTERVAL 10000000 /* 10s in 1us units */
@@ -163,6 +167,64 @@ sfxge_mcdi_exception(void *arg, efx_mcdi_exception_t eme)
sfxge_schedule_reset(sc);
}
+#if EFSYS_OPT_MCDI_LOGGING
+
+#define SFXGE_MCDI_LOG_BUF_SIZE 128
+
+static size_t
+sfxge_mcdi_do_log(char *buffer, void *data, size_t data_size,
+ size_t pfxsize, size_t position)
+{
+ uint32_t *words = data;
+ size_t i;
+
+ for (i = 0; i < data_size; i += sizeof(*words)) {
+ if (position + 2 * sizeof(*words) + 1 >= SFXGE_MCDI_LOG_BUF_SIZE) {
+ buffer[position] = '\0';
+ printf("%s \\\n", buffer);
+ position = pfxsize;
+ }
+ snprintf(buffer + position, SFXGE_MCDI_LOG_BUF_SIZE - position,
+ " %08x", *words);
+ words++;
+ position += 2 * sizeof(uint32_t) + 1;
+ }
+ return (position);
+}
+
+static void
+sfxge_mcdi_logger(void *arg, efx_log_msg_t type,
+ void *header, size_t header_size,
+ void *data, size_t data_size)
+{
+ struct sfxge_softc *sc = (struct sfxge_softc *)arg;
+ char buffer[SFXGE_MCDI_LOG_BUF_SIZE];
+ size_t pfxsize;
+ size_t start;
+
+ if (!sc->mcdi_logging)
+ return;
+
+ pfxsize = snprintf(buffer, sizeof(buffer),
+ "sfc %04x:%02x:%02x.%02x %s MCDI RPC %s:",
+ pci_get_domain(sc->dev),
+ pci_get_bus(sc->dev),
+ pci_get_slot(sc->dev),
+ pci_get_function(sc->dev),
+ device_get_nameunit(sc->dev),
+ type == EFX_LOG_MCDI_REQUEST ? "REQ" :
+ type == EFX_LOG_MCDI_RESPONSE ? "RESP" : "???");
+ start = sfxge_mcdi_do_log(buffer, header, header_size,
+ pfxsize, pfxsize);
+ start = sfxge_mcdi_do_log(buffer, data, data_size, pfxsize, start);
+ if (start != pfxsize) {
+ buffer[start] = '\0';
+ printf("%s\n", buffer);
+ }
+}
+
+#endif
+
int
sfxge_mcdi_ioctl(struct sfxge_softc *sc, sfxge_ioc_t *ip)
{
@@ -269,6 +331,14 @@ sfxge_mcdi_init(struct sfxge_softc *sc)
emtp->emt_execute = sfxge_mcdi_execute;
emtp->emt_ev_cpl = sfxge_mcdi_ev_cpl;
emtp->emt_exception = sfxge_mcdi_exception;
+#if EFSYS_OPT_MCDI_LOGGING
+ emtp->emt_logger = sfxge_mcdi_logger;
+ SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)),
+ OID_AUTO, "mcdi_logging", CTLFLAG_RW,
+ &sc->mcdi_logging, 0,
+ "MCDI logging");
+#endif
if ((rc = efx_mcdi_init(enp, emtp)) != 0)
goto fail;
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index af8efc2..5554852 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -710,6 +710,84 @@ sfxge_if_qflush(struct ifnet *ifp)
sfxge_tx_qdpl_flush(sc->txq[i]);
}
+#if SFXGE_TX_PARSE_EARLY
+
+/* There is little space for user data in mbuf pkthdr, so we
+ * use l*hlen fields which are not used by the driver otherwise
+ * to store header offsets.
+ * The fields are 8-bit, but it's ok, no header may be longer than 255 bytes.
+ */
+
+
+#define TSO_MBUF_PROTO(_mbuf) ((_mbuf)->m_pkthdr.PH_loc.sixteen[0])
+/* We abuse l5hlen here because PH_loc can hold only 64 bits of data */
+#define TSO_MBUF_FLAGS(_mbuf) ((_mbuf)->m_pkthdr.l5hlen)
+#define TSO_MBUF_PACKETID(_mbuf) ((_mbuf)->m_pkthdr.PH_loc.sixteen[1])
+#define TSO_MBUF_SEQNUM(_mbuf) ((_mbuf)->m_pkthdr.PH_loc.thirtytwo[1])
+
+static void sfxge_parse_tx_packet(struct mbuf *mbuf)
+{
+ struct ether_header *eh = mtod(mbuf, struct ether_header *);
+ const struct tcphdr *th;
+ struct tcphdr th_copy;
+
+ /* Find network protocol and header */
+ TSO_MBUF_PROTO(mbuf) = eh->ether_type;
+ if (TSO_MBUF_PROTO(mbuf) == htons(ETHERTYPE_VLAN)) {
+ struct ether_vlan_header *veh =
+ mtod(mbuf, struct ether_vlan_header *);
+ TSO_MBUF_PROTO(mbuf) = veh->evl_proto;
+ mbuf->m_pkthdr.l2hlen = sizeof(*veh);
+ } else {
+ mbuf->m_pkthdr.l2hlen = sizeof(*eh);
+ }
+
+ /* Find TCP header */
+ if (TSO_MBUF_PROTO(mbuf) == htons(ETHERTYPE_IP)) {
+ const struct ip *iph = (const struct ip *)mtodo(mbuf, mbuf->m_pkthdr.l2hlen);
+
+ KASSERT(iph->ip_p == IPPROTO_TCP,
+ ("TSO required on non-TCP packet"));
+ mbuf->m_pkthdr.l3hlen = mbuf->m_pkthdr.l2hlen + 4 * iph->ip_hl;
+ TSO_MBUF_PACKETID(mbuf) = iph->ip_id;
+ } else {
+ KASSERT(TSO_MBUF_PROTO(mbuf) == htons(ETHERTYPE_IPV6),
+ ("TSO required on non-IP packet"));
+ KASSERT(((const struct ip6_hdr *)mtodo(mbuf, mbuf->m_pkthdr.l2hlen))->ip6_nxt ==
+ IPPROTO_TCP,
+ ("TSO required on non-TCP packet"));
+ mbuf->m_pkthdr.l3hlen = mbuf->m_pkthdr.l2hlen + sizeof(struct ip6_hdr);
+ TSO_MBUF_PACKETID(mbuf) = 0;
+ }
+
+ KASSERT(mbuf->m_len >= mbuf->m_pkthdr.l3hlen,
+ ("network header is fragmented in mbuf"));
+
+ /* We need TCP header including flags (window is the next) */
+ if (mbuf->m_len < mbuf->m_pkthdr.l3hlen + offsetof(struct tcphdr, th_win)) {
+ m_copydata(mbuf, mbuf->m_pkthdr.l3hlen, sizeof(th_copy),
+ (caddr_t)&th_copy);
+ th = &th_copy;
+ } else {
+ th = (const struct tcphdr *)mtodo(mbuf, mbuf->m_pkthdr.l3hlen);
+ }
+
+ mbuf->m_pkthdr.l4hlen = mbuf->m_pkthdr.l3hlen + 4 * th->th_off;
+ TSO_MBUF_SEQNUM(mbuf) = ntohl(th->th_seq);
+
+ /* These flags must not be duplicated */
+ /*
+ * RST should not be duplicated as well, but FreeBSD kernel
+ * generates TSO packets with RST flag. So, do not assert
+ * its absence.
+ */
+ KASSERT(!(th->th_flags & (TH_URG | TH_SYN)),
+ ("incompatible TCP flag 0x%x on TSO packet",
+ th->th_flags & (TH_URG | TH_SYN)));
+ TSO_MBUF_FLAGS(mbuf) = th->th_flags;
+}
+#endif
+
/*
* TX start -- called by the stack.
*/
@@ -744,6 +822,10 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m)
index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX];
}
+#if SFXGE_TX_PARSE_EARLY
+ if (m->m_pkthdr.csum_flags & CSUM_TSO)
+ sfxge_parse_tx_packet(m);
+#endif
txq = sc->txq[SFXGE_TXQ_IP_TCP_UDP_CKSUM + index];
} else if (m->m_pkthdr.csum_flags & CSUM_DELAY_IP) {
txq = sc->txq[SFXGE_TXQ_IP_CKSUM];
@@ -781,26 +863,32 @@ struct sfxge_tso_state {
unsigned seg_size; /* TCP segment size */
int fw_assisted; /* Use FW-assisted TSO */
u_short packet_id; /* IPv4 packet ID from the original packet */
+ uint8_t tcp_flags; /* TCP flags */
efx_desc_t header_desc; /* Precomputed header descriptor for
* FW-assisted TSO */
};
+#if !SFXGE_TX_PARSE_EARLY
static const struct ip *tso_iph(const struct sfxge_tso_state *tso)
{
KASSERT(tso->protocol == htons(ETHERTYPE_IP),
("tso_iph() in non-IPv4 state"));
return (const struct ip *)(tso->mbuf->m_data + tso->nh_off);
}
+
static __unused const struct ip6_hdr *tso_ip6h(const struct sfxge_tso_state *tso)
{
KASSERT(tso->protocol == htons(ETHERTYPE_IPV6),
("tso_ip6h() in non-IPv6 state"));
return (const struct ip6_hdr *)(tso->mbuf->m_data + tso->nh_off);
}
+
static const struct tcphdr *tso_tcph(const struct sfxge_tso_state *tso)
{
return (const struct tcphdr *)(tso->mbuf->m_data + tso->tcph_off);
}
+#endif
+
/* Size of preallocated TSO header buffers. Larger blocks must be
* allocated from the heap.
@@ -857,15 +945,18 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
const bus_dma_segment_t *hdr_dma_seg,
struct mbuf *mbuf)
{
- struct ether_header *eh = mtod(mbuf, struct ether_header *);
const efx_nic_cfg_t *encp = efx_nic_cfg_get(txq->sc->enp);
+#if !SFXGE_TX_PARSE_EARLY
+ struct ether_header *eh = mtod(mbuf, struct ether_header *);
const struct tcphdr *th;
struct tcphdr th_copy;
+#endif
tso->fw_assisted = txq->sc->tso_fw_assisted;
tso->mbuf = mbuf;
/* Find network protocol and header */
+#if !SFXGE_TX_PARSE_EARLY
tso->protocol = eh->ether_type;
if (tso->protocol == htons(ETHERTYPE_VLAN)) {
struct ether_vlan_header *veh =
@@ -875,7 +966,14 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
} else {
tso->nh_off = sizeof(*eh);
}
-
+#else
+ tso->protocol = TSO_MBUF_PROTO(mbuf);
+ tso->nh_off = mbuf->m_pkthdr.l2hlen;
+ tso->tcph_off = mbuf->m_pkthdr.l3hlen;
+ tso->packet_id = TSO_MBUF_PACKETID(mbuf);
+#endif
+
+#if !SFXGE_TX_PARSE_EARLY
/* Find TCP header */
if (tso->protocol == htons(ETHERTYPE_IP)) {
KASSERT(tso_iph(tso)->ip_p == IPPROTO_TCP,
@@ -890,12 +988,17 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
tso->tcph_off = tso->nh_off + sizeof(struct ip6_hdr);
tso->packet_id = 0;
}
+#endif
+
+
if (tso->fw_assisted &&
__predict_false(tso->tcph_off >
encp->enc_tx_tso_tcp_header_offset_limit)) {
tso->fw_assisted = 0;
}
+
+#if !SFXGE_TX_PARSE_EARLY
KASSERT(mbuf->m_len >= tso->tcph_off,
("network header is fragmented in mbuf"));
/* We need TCP header including flags (window is the next) */
@@ -906,10 +1009,13 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
} else {
th = tso_tcph(tso);
}
-
tso->header_len = tso->tcph_off + 4 * th->th_off;
+#else
+ tso->header_len = mbuf->m_pkthdr.l4hlen;
+#endif
tso->seg_size = mbuf->m_pkthdr.tso_segsz;
+#if !SFXGE_TX_PARSE_EARLY
tso->seqnum = ntohl(th->th_seq);
/* These flags must not be duplicated */
@@ -921,6 +1027,11 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso,
KASSERT(!(th->th_flags & (TH_URG | TH_SYN)),
("incompatible TCP flag 0x%x on TSO packet",
th->th_flags & (TH_URG | TH_SYN)));
+ tso->tcp_flags = th->th_flags;
+#else
+ tso->seqnum = TSO_MBUF_SEQNUM(mbuf);
+ tso->tcp_flags = TSO_MBUF_FLAGS(mbuf);
+#endif
tso->out_len = mbuf->m_pkthdr.len - tso->header_len;
@@ -1001,7 +1112,7 @@ static int tso_start_new_packet(struct sfxge_txq *txq,
int rc;
if (tso->fw_assisted) {
- uint8_t tcp_flags = tso_tcph(tso)->th_flags;
+ uint8_t tcp_flags = tso->tcp_flags;
if (tso->out_len > tso->seg_size)
tcp_flags &= ~(TH_FIN | TH_PUSH);
diff --git a/sys/dev/sfxge/sfxge_tx.h b/sys/dev/sfxge/sfxge_tx.h
index 3a1dd5b..a18fdb7 100644
--- a/sys/dev/sfxge/sfxge_tx.h
+++ b/sys/dev/sfxge/sfxge_tx.h
@@ -40,6 +40,11 @@
#include <netinet/ip.h>
#include <netinet/tcp.h>
+/* If defined, parse TX packets directly in if_transmit
+ * for better cache locality and reduced time under TX lock
+ */
+#define SFXGE_TX_PARSE_EARLY 1
+
/* Maximum size of TSO packet */
#define SFXGE_TSO_MAX_SIZE (65535)
@@ -51,11 +56,15 @@
/* Maximum number of DMA segments needed to map an mbuf chain. With
* TSO, the mbuf length may be just over 64K, divided into 2K mbuf
- * clusters. (The chain could be longer than this initially, but can
- * be shortened with m_collapse().)
+ * clusters taking into account that the first may be not 2K cluster
+ * boundary aligned.
+ * Packet header may be split into two segments because of, for example,
+ * VLAN header insertion.
+ * The chain could be longer than this initially, but can be shortened
+ * with m_collapse().
*/
#define SFXGE_TX_MAPPING_MAX_SEG \
- (1 + howmany(SFXGE_TSO_MAX_SIZE, MCLBYTES))
+ (2 + howmany(SFXGE_TSO_MAX_SIZE, MCLBYTES) + 1)
/*
* Buffer mapping flags.
diff --git a/sys/dev/uart/uart_dev_imx.h b/sys/dev/uart/uart_dev_imx.h
index ac24a3f..7276c7a 100644
--- a/sys/dev/uart/uart_dev_imx.h
+++ b/sys/dev/uart/uart_dev_imx.h
@@ -124,7 +124,6 @@
#define IMXUART_UFCR_TXTL_SHIFT 10
#define IMXUART_UFCR_RFDIV_MASK (0x07 << 7)
#define IMXUART_UFCR_RFDIV_SHIFT 7
-#define IMXUART_UFCR_RFDIV_SHIFT 7
#define IMXUART_UFCR_RFDIV_DIV6 (0 << 7)
#define IMXUART_UFCR_RFDIV_DIV5 (1 << 7)
#define IMXUART_UFCR_RFDIV_DIV4 (2 << 7)
diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c
new file mode 100644
index 0000000..4d215f8
--- /dev/null
+++ b/sys/dev/usb/net/if_ure.c
@@ -0,0 +1,1070 @@
+/*-
+ * Copyright (c) 2015 Kevin Lo <kevlo@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/condvar.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/unistd.h>
+
+#include <net/if.h>
+#include <net/if_var.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include "usbdevs.h"
+
+#define USB_DEBUG_VAR ure_debug
+#include <dev/usb/usb_debug.h>
+#include <dev/usb/usb_process.h>
+
+#include <dev/usb/net/usb_ethernet.h>
+#include <dev/usb/net/if_urereg.h>
+
+#ifdef USB_DEBUG
+static int ure_debug = 0;
+
+static SYSCTL_NODE(_hw_usb, OID_AUTO, ure, CTLFLAG_RW, 0, "USB ure");
+SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN, &ure_debug, 0,
+ "Debug level");
+#endif
+
+/*
+ * Various supported device vendors/products.
+ */
+static const STRUCT_USB_HOST_ID ure_devs[] = {
+#define URE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) }
+ URE_DEV(REALTEK, RTL8152),
+#undef URE_DEV
+};
+
+static device_probe_t ure_probe;
+static device_attach_t ure_attach;
+static device_detach_t ure_detach;
+
+static usb_callback_t ure_bulk_read_callback;
+static usb_callback_t ure_bulk_write_callback;
+
+static miibus_readreg_t ure_miibus_readreg;
+static miibus_writereg_t ure_miibus_writereg;
+static miibus_statchg_t ure_miibus_statchg;
+
+static uether_fn_t ure_attach_post;
+static uether_fn_t ure_init;
+static uether_fn_t ure_stop;
+static uether_fn_t ure_start;
+static uether_fn_t ure_tick;
+static uether_fn_t ure_setmulti;
+static uether_fn_t ure_setpromisc;
+
+static int ure_ctl(struct ure_softc *, uint8_t, uint16_t, uint16_t,
+ void *, int);
+static int ure_read_mem(struct ure_softc *, uint16_t, uint16_t, void *,
+ int);
+static int ure_write_mem(struct ure_softc *, uint16_t, uint16_t, void *,
+ int);
+static uint8_t ure_read_1(struct ure_softc *, uint16_t, uint16_t);
+static uint16_t ure_read_2(struct ure_softc *, uint16_t, uint16_t);
+static uint32_t ure_read_4(struct ure_softc *, uint16_t, uint16_t);
+static int ure_write_1(struct ure_softc *, uint16_t, uint16_t, uint32_t);
+static int ure_write_2(struct ure_softc *, uint16_t, uint16_t, uint32_t);
+static int ure_write_4(struct ure_softc *, uint16_t, uint16_t, uint32_t);
+static uint16_t ure_ocp_reg_read(struct ure_softc *, uint16_t);
+static void ure_ocp_reg_write(struct ure_softc *, uint16_t, uint16_t);
+
+static void ure_read_chipver(struct ure_softc *);
+static int ure_attach_post_sub(struct usb_ether *);
+static void ure_reset(struct ure_softc *);
+static int ure_ifmedia_upd(struct ifnet *);
+static void ure_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static int ure_ioctl(struct ifnet *, u_long, caddr_t);
+static void ure_rtl8152_init(struct ure_softc *);
+static void ure_disable_teredo(struct ure_softc *);
+static void ure_init_fifo(struct ure_softc *);
+
+static const struct usb_config ure_config[URE_N_TRANSFER] = {
+ [URE_BULK_DT_WR] = {
+ .type = UE_BULK,
+ .endpoint = UE_ADDR_ANY,
+ .direction = UE_DIR_OUT,
+ .bufsize = MCLBYTES,
+ .flags = {.pipe_bof = 1,.force_short_xfer = 1,},
+ .callback = ure_bulk_write_callback,
+ .timeout = 10000, /* 10 seconds */
+ },
+ [URE_BULK_DT_RD] = {
+ .type = UE_BULK,
+ .endpoint = UE_ADDR_ANY,
+ .direction = UE_DIR_IN,
+ .bufsize = MCLBYTES,
+ .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
+ .callback = ure_bulk_read_callback,
+ .timeout = 0, /* no timeout */
+ },
+};
+
+static device_method_t ure_methods[] = {
+ /* Device interface. */
+ DEVMETHOD(device_probe, ure_probe),
+ DEVMETHOD(device_attach, ure_attach),
+ DEVMETHOD(device_detach, ure_detach),
+
+ /* MII interface. */
+ DEVMETHOD(miibus_readreg, ure_miibus_readreg),
+ DEVMETHOD(miibus_writereg, ure_miibus_writereg),
+ DEVMETHOD(miibus_statchg, ure_miibus_statchg),
+
+ DEVMETHOD_END
+};
+
+static driver_t ure_driver = {
+ .name = "ure",
+ .methods = ure_methods,
+ .size = sizeof(struct ure_softc),
+};
+
+static devclass_t ure_devclass;
+
+DRIVER_MODULE(ure, uhub, ure_driver, ure_devclass, NULL, NULL);
+DRIVER_MODULE(miibus, ure, miibus_driver, miibus_devclass, NULL, NULL);
+MODULE_DEPEND(ure, uether, 1, 1, 1);
+MODULE_DEPEND(ure, usb, 1, 1, 1);
+MODULE_DEPEND(ure, ether, 1, 1, 1);
+MODULE_DEPEND(ure, miibus, 1, 1, 1);
+MODULE_VERSION(ure, 1);
+
+static const struct usb_ether_methods ure_ue_methods = {
+ .ue_attach_post = ure_attach_post,
+ .ue_attach_post_sub = ure_attach_post_sub,
+ .ue_start = ure_start,
+ .ue_init = ure_init,
+ .ue_stop = ure_stop,
+ .ue_tick = ure_tick,
+ .ue_setmulti = ure_setmulti,
+ .ue_setpromisc = ure_setpromisc,
+ .ue_mii_upd = ure_ifmedia_upd,
+ .ue_mii_sts = ure_ifmedia_sts,
+};
+
+static int
+ure_ctl(struct ure_softc *sc, uint8_t rw, uint16_t val, uint16_t index,
+ void *buf, int len)
+{
+ struct usb_device_request req;
+
+ URE_LOCK_ASSERT(sc, MA_OWNED);
+
+ if (rw == URE_CTL_WRITE)
+ req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
+ else
+ req.bmRequestType = UT_READ_VENDOR_DEVICE;
+ req.bRequest = UR_SET_ADDRESS;
+ USETW(req.wValue, val);
+ USETW(req.wIndex, index);
+ USETW(req.wLength, len);
+
+ return (uether_do_request(&sc->sc_ue, &req, buf, 1000));
+}
+
+static int
+ure_read_mem(struct ure_softc *sc, uint16_t addr, uint16_t index,
+ void *buf, int len)
+{
+
+ return (ure_ctl(sc, URE_CTL_READ, addr, index, buf, len));
+}
+
+static int
+ure_write_mem(struct ure_softc *sc, uint16_t addr, uint16_t index,
+ void *buf, int len)
+{
+
+ return (ure_ctl(sc, URE_CTL_WRITE, addr, index, buf, len));
+}
+
+static uint8_t
+ure_read_1(struct ure_softc *sc, uint16_t reg, uint16_t index)
+{
+ uint32_t val;
+ uint8_t temp[4];
+ uint8_t shift;
+
+ shift = (reg & 3) << 3;
+ reg &= ~3;
+
+ ure_read_mem(sc, reg, index, &temp, 4);
+ val = UGETDW(temp);
+ val >>= shift;
+
+ return (val & 0xff);
+}
+
+static uint16_t
+ure_read_2(struct ure_softc *sc, uint16_t reg, uint16_t index)
+{
+ uint32_t val;
+ uint8_t temp[4];
+ uint8_t shift;
+
+ shift = (reg & 2) << 3;
+ reg &= ~3;
+
+ ure_read_mem(sc, reg, index, &temp, 4);
+ val = UGETDW(temp);
+ val >>= shift;
+
+ return (val & 0xffff);
+}
+
+static uint32_t
+ure_read_4(struct ure_softc *sc, uint16_t reg, uint16_t index)
+{
+ uint8_t temp[4];
+
+ ure_read_mem(sc, reg, index, &temp, 4);
+ return (UGETDW(temp));
+}
+
+static int
+ure_write_1(struct ure_softc *sc, uint16_t reg, uint16_t index, uint32_t val)
+{
+ uint16_t byen;
+ uint8_t temp[4];
+ uint8_t shift;
+
+ byen = URE_BYTE_EN_BYTE;
+ shift = reg & 3;
+ val &= 0xff;
+
+ if (reg & 3) {
+ byen <<= shift;
+ val <<= (shift << 3);
+ reg &= ~3;
+ }
+
+ USETDW(temp, val);
+ return (ure_write_mem(sc, reg, index | byen, &temp, 4));
+}
+
+static int
+ure_write_2(struct ure_softc *sc, uint16_t reg, uint16_t index, uint32_t val)
+{
+ uint16_t byen;
+ uint8_t temp[4];
+ uint8_t shift;
+
+ byen = URE_BYTE_EN_WORD;
+ shift = reg & 2;
+ val &= 0xffff;
+
+ if (reg & 2) {
+ byen <<= shift;
+ val <<= (shift << 3);
+ reg &= ~3;
+ }
+
+ USETDW(temp, val);
+ return (ure_write_mem(sc, reg, index | byen, &temp, 4));
+}
+
+static int
+ure_write_4(struct ure_softc *sc, uint16_t reg, uint16_t index, uint32_t val)
+{
+ uint8_t temp[4];
+
+ USETDW(temp, val);
+ return (ure_write_mem(sc, reg, index | URE_BYTE_EN_DWORD, &temp, 4));
+}
+
+static uint16_t
+ure_ocp_reg_read(struct ure_softc *sc, uint16_t addr)
+{
+ uint16_t reg;
+
+ ure_write_2(sc, URE_PLA_OCP_GPHY_BASE, URE_MCU_TYPE_PLA, addr & 0xf000);
+ reg = (addr & 0x0fff) | 0xb000;
+
+ return (ure_read_2(sc, reg, URE_MCU_TYPE_PLA));
+}
+
+static void
+ure_ocp_reg_write(struct ure_softc *sc, uint16_t addr, uint16_t data)
+{
+ uint16_t reg;
+
+ ure_write_2(sc, URE_PLA_OCP_GPHY_BASE, URE_MCU_TYPE_PLA, addr & 0xf000);
+ reg = (addr & 0x0fff) | 0xb000;
+
+ ure_write_2(sc, reg, URE_MCU_TYPE_PLA, data);
+}
+
+static int
+ure_miibus_readreg(device_t dev, int phy, int reg)
+{
+ struct ure_softc *sc;
+ uint16_t val;
+ int locked;
+
+ sc = device_get_softc(dev);
+ locked = mtx_owned(&sc->sc_mtx);
+ if (!locked)
+ URE_LOCK(sc);
+
+ val = ure_ocp_reg_read(sc, URE_OCP_BASE_MII + reg * 2);
+
+ if (!locked)
+ URE_UNLOCK(sc);
+ return (val);
+}
+
+static int
+ure_miibus_writereg(device_t dev, int phy, int reg, int val)
+{
+ struct ure_softc *sc;
+ int locked;
+
+ sc = device_get_softc(dev);
+ if (sc->sc_phyno != phy)
+ return (0);
+
+ locked = mtx_owned(&sc->sc_mtx);
+ if (!locked)
+ URE_LOCK(sc);
+
+ ure_ocp_reg_write(sc, URE_OCP_BASE_MII + reg * 2, val);
+
+ if (!locked)
+ URE_UNLOCK(sc);
+ return (0);
+}
+
+static void
+ure_miibus_statchg(device_t dev)
+{
+ struct ure_softc *sc;
+ struct mii_data *mii;
+ struct ifnet *ifp;
+ int locked;
+
+ sc = device_get_softc(dev);
+ mii = GET_MII(sc);
+ locked = mtx_owned(&sc->sc_mtx);
+ if (!locked)
+ URE_LOCK(sc);
+
+ ifp = uether_getifp(&sc->sc_ue);
+ if (mii == NULL || ifp == NULL ||
+ (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ goto done;
+
+ sc->sc_flags &= ~URE_FLAG_LINK;
+ if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) ==
+ (IFM_ACTIVE | IFM_AVALID)) {
+ switch (IFM_SUBTYPE(mii->mii_media_active)) {
+ case IFM_10_T:
+ case IFM_100_TX:
+ sc->sc_flags |= URE_FLAG_LINK;
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* Lost link, do nothing. */
+ if ((sc->sc_flags & URE_FLAG_LINK) == 0)
+ goto done;
+done:
+ if (!locked)
+ URE_UNLOCK(sc);
+}
+
+/*
+ * Probe for a RTL8152 chip.
+ */
+static int
+ure_probe(device_t dev)
+{
+ struct usb_attach_arg *uaa;
+
+ uaa = device_get_ivars(dev);;
+ if (uaa->usb_mode != USB_MODE_HOST)
+ return (ENXIO);
+ if (uaa->info.bConfigIndex != URE_CONFIG_IDX)
+ return (ENXIO);
+ if (uaa->info.bIfaceIndex != URE_IFACE_IDX)
+ return (ENXIO);
+
+ return (usbd_lookup_id_by_uaa(ure_devs, sizeof(ure_devs), uaa));
+}
+
+/*
+ * Attach the interface. Allocate softc structures, do ifmedia
+ * setup and ethernet/BPF attach.
+ */
+static int
+ure_attach(device_t dev)
+{
+ struct usb_attach_arg *uaa = device_get_ivars(dev);
+ struct ure_softc *sc = device_get_softc(dev);
+ struct usb_ether *ue = &sc->sc_ue;
+ uint8_t iface_index;
+ int error;
+
+ device_set_usb_desc(dev);
+ mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF);
+
+ iface_index = URE_IFACE_IDX;
+ error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer,
+ ure_config, URE_N_TRANSFER, sc, &sc->sc_mtx);
+ if (error != 0) {
+ device_printf(dev, "allocating USB transfers failed\n");
+ goto detach;
+ }
+
+ ue->ue_sc = sc;
+ ue->ue_dev = dev;
+ ue->ue_udev = uaa->device;
+ ue->ue_mtx = &sc->sc_mtx;
+ ue->ue_methods = &ure_ue_methods;
+
+ error = uether_ifattach(ue);
+ if (error != 0) {
+ device_printf(dev, "could not attach interface\n");
+ goto detach;
+ }
+ return (0); /* success */
+
+detach:
+ ure_detach(dev);
+ return (ENXIO); /* failure */
+}
+
+static int
+ure_detach(device_t dev)
+{
+ struct ure_softc *sc = device_get_softc(dev);
+ struct usb_ether *ue = &sc->sc_ue;
+
+ usbd_transfer_unsetup(sc->sc_xfer, URE_N_TRANSFER);
+ uether_ifdetach(ue);
+ mtx_destroy(&sc->sc_mtx);
+
+ return (0);
+}
+
+static void
+ure_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
+{
+ struct ure_softc *sc = usbd_xfer_softc(xfer);
+ struct usb_ether *ue = &sc->sc_ue;
+ struct ifnet *ifp = uether_getifp(ue);
+ struct usb_page_cache *pc;
+ struct ure_rxpkt pkt;
+ int actlen, len;
+
+ usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
+
+ switch (USB_GET_STATE(xfer)) {
+ case USB_ST_TRANSFERRED:
+ if (actlen < (int)(sizeof(pkt))) {
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
+ goto tr_setup;
+ }
+ pc = usbd_xfer_get_frame(xfer, 0);
+ usbd_copy_out(pc, 0, &pkt, sizeof(pkt));
+ len = le32toh(pkt.ure_pktlen) & URE_RXPKT_LEN_MASK;
+ len -= ETHER_CRC_LEN;
+ if (actlen < (int)(len + sizeof(pkt))) {
+ if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
+ goto tr_setup;
+ }
+
+ uether_rxbuf(ue, pc, sizeof(pkt), len);
+ /* FALLTHROUGH */
+ case USB_ST_SETUP:
+tr_setup:
+ usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
+ usbd_transfer_submit(xfer);
+ uether_rxflush(ue);
+ return;
+
+ default: /* Error */
+ DPRINTF("bulk read error, %s\n",
+ usbd_errstr(error));
+
+ if (error != USB_ERR_CANCELLED) {
+ /* try to clear stall first */
+ usbd_xfer_set_stall(xfer);
+ goto tr_setup;
+ }
+ return;
+ }
+}
+
+static void
+ure_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error)
+{
+ struct ure_softc *sc = usbd_xfer_softc(xfer);
+ struct ifnet *ifp = uether_getifp(&sc->sc_ue);
+ struct usb_page_cache *pc;
+ struct mbuf *m;
+ struct ure_txpkt txpkt;
+ int len, pos;
+
+ switch (USB_GET_STATE(xfer)) {
+ case USB_ST_TRANSFERRED:
+ DPRINTFN(11, "transfer complete\n");
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+ /* FALLTHROUGH */
+ case USB_ST_SETUP:
+tr_setup:
+ if ((sc->sc_flags & URE_FLAG_LINK) == 0 ||
+ (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) {
+ /*
+ * don't send anything if there is no link !
+ */
+ return;
+ }
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
+ if (m == NULL)
+ break;
+ pos = 0;
+ len = m->m_pkthdr.len;
+ pc = usbd_xfer_get_frame(xfer, 0);
+ memset(&txpkt, 0, sizeof(txpkt));
+ txpkt.ure_pktlen = htole32((len & URE_TXPKT_LEN_MASK) |
+ URE_TKPKT_TX_FS | URE_TKPKT_TX_LS);
+ usbd_copy_in(pc, pos, &txpkt, sizeof(txpkt));
+ pos += sizeof(txpkt);
+ usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len);
+ pos += m->m_pkthdr.len;
+
+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
+
+ /*
+ * If there's a BPF listener, bounce a copy
+ * of this frame to him.
+ */
+ BPF_MTAP(ifp, m);
+
+ m_freem(m);
+
+ /* Set frame length. */
+ usbd_xfer_set_frame_len(xfer, 0, pos);
+
+ usbd_transfer_submit(xfer);
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+ return;
+ default: /* Error */
+ DPRINTFN(11, "transfer error, %s\n",
+ usbd_errstr(error));
+
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+
+ if (error != USB_ERR_CANCELLED) {
+ /* try to clear stall first */
+ usbd_xfer_set_stall(xfer);
+ goto tr_setup;
+ }
+ return;
+ }
+}
+
+static void
+ure_read_chipver(struct ure_softc *sc)
+{
+ uint16_t ver;
+
+ ver = ure_read_2(sc, URE_PLA_TCR1, URE_MCU_TYPE_PLA) & URE_VERSION_MASK;
+ switch (ver) {
+ case 0x4c00:
+ sc->sc_chip |= URE_CHIP_VER_4C00;
+ break;
+ case 0x4c10:
+ sc->sc_chip |= URE_CHIP_VER_4C10;
+ break;
+ default:
+ device_printf(sc->sc_ue.ue_dev,
+ "unknown version 0x%04x\n", ver);
+ break;
+ }
+}
+
+static void
+ure_attach_post(struct usb_ether *ue)
+{
+ struct ure_softc *sc = uether_getsc(ue);
+
+ sc->sc_phyno = 0;
+
+ /* Determine the chip version. */
+ ure_read_chipver(sc);
+
+ /* Initialize controller and get station address. */
+ ure_rtl8152_init(sc);
+
+ if (sc->sc_chip & URE_CHIP_VER_4C00)
+ ure_read_mem(sc, URE_PLA_IDR, URE_MCU_TYPE_PLA,
+ ue->ue_eaddr, 8);
+ else
+ ure_read_mem(sc, URE_PLA_BACKUP, URE_MCU_TYPE_PLA,
+ ue->ue_eaddr, 8);
+}
+
+static int
+ure_attach_post_sub(struct usb_ether *ue)
+{
+ struct ure_softc *sc;
+ struct ifnet *ifp;
+ int error;
+
+ sc = uether_getsc(ue);
+ ifp = ue->ue_ifp;
+ ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+ ifp->if_start = uether_start;
+ ifp->if_ioctl = ure_ioctl;
+ ifp->if_init = uether_init;
+ IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
+ IFQ_SET_READY(&ifp->if_snd);
+
+ mtx_lock(&Giant);
+ error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp,
+ uether_ifmedia_upd, ue->ue_methods->ue_mii_sts,
+ BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0);
+ mtx_unlock(&Giant);
+
+ return (error);
+}
+
+static void
+ure_init(struct usb_ether *ue)
+{
+ struct ure_softc *sc = uether_getsc(ue);
+ struct ifnet *ifp = uether_getifp(ue);
+ uint32_t rxmode;
+
+ URE_LOCK_ASSERT(sc, MA_OWNED);
+
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ return;
+
+ /* Cancel pending I/O. */
+ ure_stop(ue);
+
+ ure_reset(sc);
+
+ /* Set MAC address. */
+ ure_write_mem(sc, URE_PLA_IDR, URE_MCU_TYPE_PLA | URE_BYTE_EN_SIX_BYTES,
+ IF_LLADDR(ifp), 8);
+
+ /* Reset the packet filter. */
+ ure_write_2(sc, URE_PLA_FMC, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_FMC, URE_MCU_TYPE_PLA) &
+ ~URE_FMC_FCR_MCU_EN);
+ ure_write_2(sc, URE_PLA_FMC, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_FMC, URE_MCU_TYPE_PLA) |
+ URE_FMC_FCR_MCU_EN);
+
+ /* Enable transmit and receive. */
+ ure_write_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA,
+ ure_read_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA) | URE_CR_RE |
+ URE_CR_TE);
+
+ ure_write_2(sc, URE_PLA_MISC_1, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_MISC_1, URE_MCU_TYPE_PLA) &
+ ~URE_RXDY_GATED_EN);
+
+ /* Set Rx mode. */
+ rxmode = URE_RCR_APM;
+
+ /* If we want promiscuous mode, set the allframes bit. */
+ if (ifp->if_flags & IFF_PROMISC)
+ rxmode |= URE_RCR_AAP;
+
+ if (ifp->if_flags & IFF_BROADCAST)
+ rxmode |= URE_RCR_AB;
+
+ ure_write_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA, rxmode);
+
+ /* Load the multicast filter. */
+ ure_setmulti(ue);
+
+ usbd_xfer_set_stall(sc->sc_xfer[URE_BULK_DT_WR]);
+
+ /* Indicate we are up and running. */
+ ifp->if_drv_flags |= IFF_DRV_RUNNING;
+
+ /* Switch to selected media. */
+ ure_ifmedia_upd(ifp);
+}
+
+static void
+ure_tick(struct usb_ether *ue)
+{
+ struct ure_softc *sc = uether_getsc(ue);
+ struct mii_data *mii = GET_MII(sc);
+
+ URE_LOCK_ASSERT(sc, MA_OWNED);
+
+ mii_tick(mii);
+ if ((sc->sc_flags & URE_FLAG_LINK) == 0
+ && mii->mii_media_status & IFM_ACTIVE &&
+ IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
+ sc->sc_flags |= URE_FLAG_LINK;
+ ure_start(ue);
+ }
+}
+
+static void
+ure_setpromisc(struct usb_ether *ue)
+{
+ struct ure_softc *sc = uether_getsc(ue);
+ struct ifnet *ifp = uether_getifp(ue);
+ uint32_t rxmode;
+
+ rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA);
+
+ if (ifp->if_flags & IFF_PROMISC)
+ rxmode |= URE_RCR_AAP;
+ else
+ rxmode &= ~URE_RCR_AAP;
+
+ ure_write_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA, rxmode);
+
+ ure_setmulti(ue);
+}
+
+/*
+ * Program the 64-bit multicast hash filter.
+ */
+static void
+ure_setmulti(struct usb_ether *ue)
+{
+ struct ure_softc *sc = uether_getsc(ue);
+ struct ifnet *ifp = uether_getifp(ue);
+ struct ifmultiaddr *ifma;
+ uint32_t h, rxmode;
+ uint32_t hashes[2] = { 0, 0 };
+
+ URE_LOCK_ASSERT(sc, MA_OWNED);
+
+ rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA);
+ if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
+ if (ifp->if_flags & IFF_PROMISC)
+ rxmode |= URE_RCR_AAP;
+ rxmode |= URE_RCR_AM;
+ hashes[0] = hashes[1] = 0xffffffff;
+ goto done;
+ }
+
+ if_maddr_rlock(ifp);
+ TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
+ if (ifma->ifma_addr->sa_family != AF_LINK)
+ continue;
+ h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
+ ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
+ if (h < 32)
+ hashes[0] |= (1 << h);
+ else
+ hashes[1] |= (1 << (h - 32));
+ }
+ if_maddr_runlock(ifp);
+
+ h = bswap32(hashes[0]);
+ hashes[0] = bswap32(hashes[1]);
+ hashes[1] = h;
+ rxmode |= URE_RCR_AM;
+
+done:
+ ure_write_4(sc, URE_PLA_MAR0, URE_MCU_TYPE_PLA, hashes[0]);
+ ure_write_4(sc, URE_PLA_MAR4, URE_MCU_TYPE_PLA, hashes[1]);
+ ure_write_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA, rxmode);
+}
+
+static void
+ure_start(struct usb_ether *ue)
+{
+ struct ure_softc *sc = uether_getsc(ue);
+
+ /*
+ * start the USB transfers, if not already started:
+ */
+ usbd_transfer_start(sc->sc_xfer[URE_BULK_DT_RD]);
+ usbd_transfer_start(sc->sc_xfer[URE_BULK_DT_WR]);
+}
+
+static void
+ure_reset(struct ure_softc *sc)
+{
+ int i;
+
+ ure_write_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA, URE_CR_RST);
+
+ for (i = 0; i < URE_TIMEOUT; i++) {
+ if (!(ure_read_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA) &
+ URE_CR_RST))
+ break;
+ uether_pause(&sc->sc_ue, hz / 100);
+ }
+ if (i == URE_TIMEOUT)
+ device_printf(sc->sc_ue.ue_dev, "reset never completed\n");
+}
+
+/*
+ * Set media options.
+ */
+static int
+ure_ifmedia_upd(struct ifnet *ifp)
+{
+ struct ure_softc *sc = ifp->if_softc;
+ struct mii_data *mii = GET_MII(sc);
+ struct mii_softc *miisc;
+ int error;
+
+ URE_LOCK_ASSERT(sc, MA_OWNED);
+
+ LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
+ PHY_RESET(miisc);
+ error = mii_mediachg(mii);
+ return (error);
+}
+
+/*
+ * Report current media status.
+ */
+static void
+ure_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
+{
+ struct ure_softc *sc;
+ struct mii_data *mii;
+
+ sc = ifp->if_softc;
+ mii = GET_MII(sc);
+
+ URE_LOCK(sc);
+ mii_pollstat(mii);
+ ifmr->ifm_active = mii->mii_media_active;
+ ifmr->ifm_status = mii->mii_media_status;
+ URE_UNLOCK(sc);
+}
+
+static int
+ure_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
+{
+ struct usb_ether *ue = ifp->if_softc;
+ struct ure_softc *sc;
+ struct ifreq *ifr;
+ int error, mask, reinit;
+
+ sc = uether_getsc(ue);
+ ifr = (struct ifreq *)data;
+ error = 0;
+ reinit = 0;
+ if (cmd == SIOCSIFCAP) {
+ URE_LOCK(sc);
+ mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+ if (reinit > 0 && ifp->if_drv_flags & IFF_DRV_RUNNING)
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ else
+ reinit = 0;
+ URE_UNLOCK(sc);
+ if (reinit > 0)
+ uether_init(ue);
+ } else
+ error = uether_ioctl(ifp, cmd, data);
+
+ return (error);
+}
+
+static void
+ure_rtl8152_init(struct ure_softc *sc)
+{
+ uint32_t pwrctrl;
+
+ /* Disable ALDPS. */
+ ure_ocp_reg_write(sc, URE_OCP_ALDPS_CONFIG, URE_ENPDNPS | URE_LINKENA |
+ URE_DIS_SDSAVE);
+ uether_pause(&sc->sc_ue, hz / 50);
+
+ if (sc->sc_chip & URE_CHIP_VER_4C00) {
+ ure_write_2(sc, URE_PLA_LED_FEATURE, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_LED_FEATURE, URE_MCU_TYPE_PLA) &
+ ~URE_LED_MODE_MASK);
+ }
+
+ ure_write_2(sc, URE_USB_UPS_CTRL, URE_MCU_TYPE_USB,
+ ure_read_2(sc, URE_USB_UPS_CTRL, URE_MCU_TYPE_USB) &
+ ~URE_POWER_CUT);
+ ure_write_2(sc, URE_USB_PM_CTRL_STATUS, URE_MCU_TYPE_USB,
+ ure_read_2(sc, URE_USB_PM_CTRL_STATUS, URE_MCU_TYPE_USB) &
+ ~URE_RESUME_INDICATE);
+
+ ure_write_2(sc, URE_PLA_PHY_PWR, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_PHY_PWR, URE_MCU_TYPE_PLA) |
+ URE_TX_10M_IDLE_EN | URE_PFM_PWM_SWITCH);
+ pwrctrl = ure_read_4(sc, URE_PLA_MAC_PWR_CTRL, URE_MCU_TYPE_PLA);
+ pwrctrl &= ~URE_MCU_CLK_RATIO_MASK;
+ pwrctrl |= URE_MCU_CLK_RATIO | URE_D3_CLK_GATED_EN;
+ ure_write_4(sc, URE_PLA_MAC_PWR_CTRL, URE_MCU_TYPE_PLA, pwrctrl);
+ ure_write_2(sc, URE_PLA_GPHY_INTR_IMR, URE_MCU_TYPE_PLA,
+ URE_GPHY_STS_MSK | URE_SPEED_DOWN_MSK | URE_SPDWN_RXDV_MSK |
+ URE_SPDWN_LINKCHG_MSK);
+
+ /* Disable Rx aggregation. */
+ ure_write_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB,
+ ure_read_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB) |
+ URE_RX_AGG_DISABLE);
+
+ /* Disable ALDPS. */
+ ure_ocp_reg_write(sc, URE_OCP_ALDPS_CONFIG, URE_ENPDNPS | URE_LINKENA |
+ URE_DIS_SDSAVE);
+ uether_pause(&sc->sc_ue, hz / 50);
+
+ ure_init_fifo(sc);
+
+ ure_write_1(sc, URE_USB_TX_AGG, URE_MCU_TYPE_USB,
+ URE_TX_AGG_MAX_THRESHOLD);
+ ure_write_4(sc, URE_USB_RX_BUF_TH, URE_MCU_TYPE_USB, URE_RX_THR_HIGH);
+ ure_write_4(sc, URE_USB_TX_DMA, URE_MCU_TYPE_USB,
+ URE_TEST_MODE_DISABLE | URE_TX_SIZE_ADJUST1);
+}
+
+static void
+ure_stop(struct usb_ether *ue)
+{
+ struct ure_softc *sc = uether_getsc(ue);
+ struct ifnet *ifp = uether_getifp(ue);
+
+ URE_LOCK_ASSERT(sc, MA_OWNED);
+
+ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
+ sc->sc_flags &= ~URE_FLAG_LINK;
+
+ /*
+ * stop all the transfers, if not already stopped:
+ */
+ usbd_transfer_stop(sc->sc_xfer[URE_BULK_DT_WR]);
+ usbd_transfer_stop(sc->sc_xfer[URE_BULK_DT_RD]);
+}
+
+static void
+ure_disable_teredo(struct ure_softc *sc)
+{
+
+ ure_write_4(sc, URE_PLA_TEREDO_CFG, URE_MCU_TYPE_PLA,
+ ure_read_4(sc, URE_PLA_TEREDO_CFG, URE_MCU_TYPE_PLA) &
+ ~(URE_TEREDO_SEL | URE_TEREDO_RS_EVENT_MASK | URE_OOB_TEREDO_EN));
+ ure_write_2(sc, URE_PLA_WDT6_CTRL, URE_MCU_TYPE_PLA,
+ URE_WDT6_SET_MODE);
+ ure_write_2(sc, URE_PLA_REALWOW_TIMER, URE_MCU_TYPE_PLA, 0);
+ ure_write_4(sc, URE_PLA_TEREDO_TIMER, URE_MCU_TYPE_PLA, 0);
+}
+
+static void
+ure_init_fifo(struct ure_softc *sc)
+{
+ uint32_t rx_fifo1, rx_fifo2;
+ int i;
+
+ ure_write_2(sc, URE_PLA_MISC_1, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_MISC_1, URE_MCU_TYPE_PLA) |
+ URE_RXDY_GATED_EN);
+
+ ure_disable_teredo(sc);
+
+ ure_write_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA,
+ ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA) &
+ ~URE_RCR_ACPT_ALL);
+
+ ure_reset(sc);
+
+ ure_write_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA, 0);
+
+ ure_write_1(sc, URE_PLA_OOB_CTRL, URE_MCU_TYPE_PLA,
+ ure_read_1(sc, URE_PLA_OOB_CTRL, URE_MCU_TYPE_PLA) &
+ ~URE_NOW_IS_OOB);
+
+ ure_write_2(sc, URE_PLA_SFF_STS_7, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_SFF_STS_7, URE_MCU_TYPE_PLA) &
+ ~URE_MCU_BORW_EN);
+ for (i = 0; i < URE_TIMEOUT; i++) {
+ if (ure_read_1(sc, URE_PLA_OOB_CTRL, URE_MCU_TYPE_PLA) &
+ URE_LINK_LIST_READY)
+ break;
+ uether_pause(&sc->sc_ue, hz / 100);
+ }
+ if (i == URE_TIMEOUT)
+ device_printf(sc->sc_ue.ue_dev,
+ "timeout waiting for OOB control\n");
+ ure_write_2(sc, URE_PLA_SFF_STS_7, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_SFF_STS_7, URE_MCU_TYPE_PLA) |
+ URE_RE_INIT_LL);
+ for (i = 0; i < URE_TIMEOUT; i++) {
+ if (ure_read_1(sc, URE_PLA_OOB_CTRL, URE_MCU_TYPE_PLA) &
+ URE_LINK_LIST_READY)
+ break;
+ uether_pause(&sc->sc_ue, hz / 100);
+ }
+ if (i == URE_TIMEOUT)
+ device_printf(sc->sc_ue.ue_dev,
+ "timeout waiting for OOB control\n");
+
+ ure_write_2(sc, URE_PLA_CPCR, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_CPCR, URE_MCU_TYPE_PLA) &
+ ~URE_CPCR_RX_VLAN);
+ ure_write_2(sc, URE_PLA_TCR0, URE_MCU_TYPE_PLA,
+ ure_read_2(sc, URE_PLA_TCR0, URE_MCU_TYPE_PLA) |
+ URE_TCR0_AUTO_FIFO);
+
+ /* Configure Rx FIFO threshold. */
+ ure_write_4(sc, URE_PLA_RXFIFO_CTRL0, URE_MCU_TYPE_PLA,
+ URE_RXFIFO_THR1_NORMAL);
+ if (usbd_get_speed(sc->sc_ue.ue_udev) == USB_SPEED_FULL) {
+ rx_fifo1 = URE_RXFIFO_THR2_FULL;
+ rx_fifo2 = URE_RXFIFO_THR3_FULL;
+ } else {
+ rx_fifo1 = URE_RXFIFO_THR2_HIGH;
+ rx_fifo2 = URE_RXFIFO_THR3_HIGH;
+ }
+ ure_write_4(sc, URE_PLA_RXFIFO_CTRL1, URE_MCU_TYPE_PLA, rx_fifo1);
+ ure_write_4(sc, URE_PLA_RXFIFO_CTRL2, URE_MCU_TYPE_PLA, rx_fifo2);
+
+ /* Configure Tx FIFO threshold. */
+ ure_write_4(sc, URE_PLA_TXFIFO_CTRL, URE_MCU_TYPE_PLA,
+ URE_TXFIFO_THR_NORMAL);
+}
diff --git a/sys/dev/usb/net/if_urereg.h b/sys/dev/usb/net/if_urereg.h
new file mode 100644
index 0000000..89c34f5
--- /dev/null
+++ b/sys/dev/usb/net/if_urereg.h
@@ -0,0 +1,435 @@
+/*-
+ * Copyright (c) 2015 Kevin Lo <kevlo@FreeBSD.org>
+ * 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$
+ */
+
+#define URE_CONFIG_IDX 0 /* config number 1 */
+#define URE_IFACE_IDX 0
+
+#define URE_CTL_READ 0x01
+#define URE_CTL_WRITE 0x02
+
+#define URE_TIMEOUT 1000
+#define URE_PHY_TIMEOUT 2000
+
+#define URE_BYTE_EN_DWORD 0xff
+#define URE_BYTE_EN_WORD 0x33
+#define URE_BYTE_EN_BYTE 0x11
+#define URE_BYTE_EN_SIX_BYTES 0x3f
+
+#define URE_MAX_FRAMELEN (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN)
+
+#define URE_PLA_IDR 0xc000
+#define URE_PLA_RCR 0xc010
+#define URE_PLA_RMS 0xc016
+#define URE_PLA_RXFIFO_CTRL0 0xc0a0
+#define URE_PLA_RXFIFO_CTRL1 0xc0a4
+#define URE_PLA_RXFIFO_CTRL2 0xc0a8
+#define URE_PLA_DMY_REG0 0xc0b0
+#define URE_PLA_FMC 0xc0b4
+#define URE_PLA_CFG_WOL 0xc0b6
+#define URE_PLA_TEREDO_CFG 0xc0bc
+#define URE_PLA_MAR0 0xcd00
+#define URE_PLA_MAR4 0xcd04
+#define URE_PLA_BACKUP 0xd000
+#define URE_PAL_BDC_CR 0xd1a0
+#define URE_PLA_TEREDO_TIMER 0xd2cc
+#define URE_PLA_REALWOW_TIMER 0xd2e8
+#define URE_PLA_LEDSEL 0xdd90
+#define URE_PLA_LED_FEATURE 0xdd92
+#define URE_PLA_PHYAR 0xde00
+#define URE_PLA_BOOT_CTRL 0xe004
+#define URE_PLA_GPHY_INTR_IMR 0xe022
+#define URE_PLA_EEE_CR 0xe040
+#define URE_PLA_EEEP_CR 0xe080
+#define URE_PLA_MAC_PWR_CTRL 0xe0c0
+#define URE_PLA_MAC_PWR_CTRL2 0xe0ca
+#define URE_PLA_MAC_PWR_CTRL3 0xe0cc
+#define URE_PLA_MAC_PWR_CTRL4 0xe0ce
+#define URE_PLA_WDT6_CTRL 0xe428
+#define URE_PLA_TCR0 0xe610
+#define URE_PLA_TCR1 0xe612
+#define URE_PLA_MTPS 0xe615
+#define URE_PLA_TXFIFO_CTRL 0xe618
+#define URE_PLA_RSTTELLY 0xe800
+#define URE_PLA_CR 0xe813
+#define URE_PLA_CRWECR 0xe81c
+#define URE_PLA_CONFIG5 0xe822
+#define URE_PLA_PHY_PWR 0xe84c
+#define URE_PLA_OOB_CTRL 0xe84f
+#define URE_PLA_CPCR 0xe854
+#define URE_PLA_MISC_0 0xe858
+#define URE_PLA_MISC_1 0xe85a
+#define URE_PLA_OCP_GPHY_BASE 0xe86c
+#define URE_PLA_TELLYCNT 0xe890
+#define URE_PLA_SFF_STS_7 0xe8de
+#define URE_PLA_PHYSTATUS 0xe908
+
+#define URE_USB_USB2PHY 0xb41e
+#define URE_USB_SSPHYLINK2 0xb428
+#define URE_USB_U2P3_CTRL 0xb460
+#define URE_USB_CSR_DUMMY1 0xb464
+#define URE_USB_CSR_DUMMY2 0xb466
+#define URE_USB_DEV_STAT 0xb808
+#define URE_USB_CONNECT_TIMER 0xcbf8
+#define URE_USB_BURST_SIZE 0xcfc0
+#define URE_USB_USB_CTRL 0xd406
+#define URE_USB_PHY_CTRL 0xd408
+#define URE_USB_TX_AGG 0xd40a
+#define URE_USB_RX_BUF_TH 0xd40c
+#define URE_USB_USB_TIMER 0xd428
+#define URE_USB_RX_EARLY_AGG 0xd42c
+#define URE_USB_PM_CTRL_STATUS 0xd432
+#define URE_USB_TX_DMA 0xd434
+#define URE_USB_TOLERANCE 0xd490
+#define URE_USB_LPM_CTRL 0xd41a
+#define URE_USB_UPS_CTRL 0xd800
+#define URE_USB_MISC_0 0xd81a
+#define URE_USB_POWER_CUT 0xd80a
+#define URE_USB_AFE_CTRL2 0xd824
+#define URE_USB_WDT11_CTRL 0xe43c
+
+/* OCP Registers. */
+#define URE_OCP_ALDPS_CONFIG 0x2010
+#define URE_OCP_EEE_CONFIG1 0x2080
+#define URE_OCP_EEE_CONFIG2 0x2092
+#define URE_OCP_EEE_CONFIG3 0x2094
+#define URE_OCP_BASE_MII 0xa400
+#define URE_OCP_EEE_AR 0xa41a
+#define URE_OCP_EEE_DATA 0xa41c
+#define URE_OCP_PHY_STATUS 0xa420
+#define URE_OCP_POWER_CFG 0xa430
+#define URE_OCP_EEE_CFG 0xa432
+#define URE_OCP_SRAM_ADDR 0xa436
+#define URE_OCP_SRAM_DATA 0xa438
+#define URE_OCP_DOWN_SPEED 0xa442
+#define URE_OCP_EEE_ABLE 0xa5c4
+#define URE_OCP_EEE_ADV 0xa5d0
+#define URE_OCP_EEE_LPABLE 0xa5d2
+#define URE_OCP_PHY_STATE 0xa708
+#define URE_OCP_ADC_CFG 0xbc06
+
+/* SRAM Register. */
+#define URE_SRAM_LPF_CFG 0x8012
+#define URE_SRAM_10M_AMP1 0x8080
+#define URE_SRAM_10M_AMP2 0x8082
+#define URE_SRAM_IMPEDANCE 0x8084
+
+/* PLA_RCR */
+#define URE_RCR_AAP 0x00000001
+#define URE_RCR_APM 0x00000002
+#define URE_RCR_AM 0x00000004
+#define URE_RCR_AB 0x00000008
+#define URE_RCR_ACPT_ALL \
+ (URE_RCR_AAP | URE_RCR_APM | URE_RCR_AM | URE_RCR_AB)
+
+/* PLA_RXFIFO_CTRL0 */
+#define URE_RXFIFO_THR1_NORMAL 0x00080002
+#define URE_RXFIFO_THR1_OOB 0x01800003
+
+/* PLA_RXFIFO_CTRL1 */
+#define URE_RXFIFO_THR2_FULL 0x00000060
+#define URE_RXFIFO_THR2_HIGH 0x00000038
+#define URE_RXFIFO_THR2_OOB 0x0000004a
+#define URE_RXFIFO_THR2_NORMAL 0x00a0
+
+/* PLA_RXFIFO_CTRL2 */
+#define URE_RXFIFO_THR3_FULL 0x00000078
+#define URE_RXFIFO_THR3_HIGH 0x00000048
+#define URE_RXFIFO_THR3_OOB 0x0000005a
+#define URE_RXFIFO_THR3_NORMAL 0x0110
+
+/* PLA_TXFIFO_CTRL */
+#define URE_TXFIFO_THR_NORMAL 0x00400008
+#define URE_TXFIFO_THR_NORMAL2 0x01000008
+
+/* PLA_DMY_REG0 */
+#define URE_ECM_ALDPS 0x0002
+
+/* PLA_FMC */
+#define URE_FMC_FCR_MCU_EN 0x0001
+
+/* PLA_EEEP_CR */
+#define URE_EEEP_CR_EEEP_TX 0x0002
+
+/* PLA_WDT6_CTRL */
+#define URE_WDT6_SET_MODE 0x001
+
+/* PLA_TCR0 */
+#define URE_TCR0_TX_EMPTY 0x0800
+#define URE_TCR0_AUTO_FIFO 0x0080
+
+/* PLA_TCR1 */
+#define URE_VERSION_MASK 0x7cf0
+
+/* PLA_CR */
+#define URE_CR_RST 0x10
+#define URE_CR_RE 0x08
+#define URE_CR_TE 0x04
+
+/* PLA_CRWECR */
+#define URE_CRWECR_NORAML 0x00
+#define URE_CRWECR_CONFIG 0xc0
+
+/* PLA_OOB_CTRL */
+#define URE_NOW_IS_OOB 0x80
+#define URE_TXFIFO_EMPTY 0x20
+#define URE_RXFIFO_EMPTY 0x10
+#define URE_LINK_LIST_READY 0x02
+#define URE_DIS_MCU_CLROOB 0x01
+#define URE_FIFO_EMPTY (URE_TXFIFO_EMPTY | URE_RXFIFO_EMPTY)
+
+/* PLA_MISC_1 */
+#define URE_RXDY_GATED_EN 0x0008
+
+/* PLA_SFF_STS_7 */
+#define URE_RE_INIT_LL 0x8000
+#define URE_MCU_BORW_EN 0x4000
+
+/* PLA_CPCR */
+#define URE_CPCR_RX_VLAN 0x0040
+
+/* PLA_TEREDO_CFG */
+#define URE_TEREDO_SEL 0x8000
+#define URE_TEREDO_WAKE_MASK 0x7f00
+#define URE_TEREDO_RS_EVENT_MASK 0x00fe
+#define URE_OOB_TEREDO_EN 0x0001
+
+/* PAL_BDC_CR */
+#define URE_ALDPS_PROXY_MODE 0x0001
+
+/* PLA_CONFIG5 */
+#define URE_LAN_WAKE_EN 0x0002
+
+/* PLA_LED_FEATURE */
+#define URE_LED_MODE_MASK 0x0700
+
+/* PLA_PHY_PWR */
+#define URE_TX_10M_IDLE_EN 0x0080
+#define URE_PFM_PWM_SWITCH 0x0040
+
+/* PLA_MAC_PWR_CTRL */
+#define URE_D3_CLK_GATED_EN 0x00004000
+#define URE_MCU_CLK_RATIO 0x07010f07
+#define URE_MCU_CLK_RATIO_MASK 0x0f0f0f0f
+#define URE_ALDPS_SPDWN_RATIO 0x0f87
+
+/* PLA_MAC_PWR_CTRL2 */
+#define URE_EEE_SPDWN_RATIO 0x8007
+
+/* PLA_MAC_PWR_CTRL3 */
+#define URE_PKT_AVAIL_SPDWN_EN 0x0100
+#define URE_SUSPEND_SPDWN_EN 0x0004
+#define URE_U1U2_SPDWN_EN 0x0002
+#define URE_L1_SPDWN_EN 0x0001
+
+/* PLA_MAC_PWR_CTRL4 */
+#define URE_PWRSAVE_SPDWN_EN 0x1000
+#define URE_RXDV_SPDWN_EN 0x0800
+#define URE_TX10MIDLE_EN 0x0100
+#define URE_TP100_SPDWN_EN 0x0020
+#define URE_TP500_SPDWN_EN 0x0010
+#define URE_TP1000_SPDWN_EN 0x0008
+#define URE_EEE_SPDWN_EN 0x0001
+
+/* PLA_GPHY_INTR_IMR */
+#define URE_GPHY_STS_MSK 0x0001
+#define URE_SPEED_DOWN_MSK 0x0002
+#define URE_SPDWN_RXDV_MSK 0x0004
+#define URE_SPDWN_LINKCHG_MSK 0x0008
+
+/* PLA_PHYAR */
+#define URE_PHYAR_PHYDATA 0x0000ffff
+#define URE_PHYAR_BUSY 0x80000000
+
+/* PLA_EEE_CR */
+#define URE_EEE_RX_EN 0x0001
+#define URE_EEE_TX_EN 0x0002
+
+/* PLA_BOOT_CTRL */
+#define URE_AUTOLOAD_DONE 0x0002
+
+/* USB_USB2PHY */
+#define URE_USB2PHY_SUSPEND 0x0001
+#define URE_USB2PHY_L1 0x0002
+
+/* USB_SSPHYLINK2 */
+#define URE_PWD_DN_SCALE_MASK 0x3ffe
+#define URE_PWD_DN_SCALE(x) ((x) << 1)
+
+/* USB_CSR_DUMMY1 */
+#define URE_DYNAMIC_BURST 0x0001
+
+/* USB_CSR_DUMMY2 */
+#define URE_EP4_FULL_FC 0x0001
+
+/* USB_DEV_STAT */
+#define URE_STAT_SPEED_MASK 0x0006
+#define URE_STAT_SPEED_HIGH 0x0000
+#define URE_STAT_SPEED_FULL 0x0001
+
+/* USB_TX_AGG */
+#define URE_TX_AGG_MAX_THRESHOLD 0x03
+
+/* USB_RX_BUF_TH */
+#define URE_RX_THR_SUPER 0x0c350180
+#define URE_RX_THR_HIGH 0x7a120180
+#define URE_RX_THR_SLOW 0xffff0180
+
+/* USB_TX_DMA */
+#define URE_TEST_MODE_DISABLE 0x00000001
+#define URE_TX_SIZE_ADJUST1 0x00000100
+
+/* USB_UPS_CTRL */
+#define URE_POWER_CUT 0x0100
+
+/* USB_PM_CTRL_STATUS */
+#define URE_RESUME_INDICATE 0x0001
+
+/* USB_USB_CTRL */
+#define URE_RX_AGG_DISABLE 0x0010
+#define URE_RX_ZERO_EN 0x0080
+
+/* USB_U2P3_CTRL */
+#define URE_U2P3_ENABLE 0x0001
+
+/* USB_POWER_CUT */
+#define URE_PWR_EN 0x0001
+#define URE_PHASE2_EN 0x0008
+
+/* USB_MISC_0 */
+#define URE_PCUT_STATUS 0x0001
+
+/* USB_RX_EARLY_TIMEOUT */
+#define URE_COALESCE_SUPER 85000U
+#define URE_COALESCE_HIGH 250000U
+#define URE_COALESCE_SLOW 524280U
+
+/* USB_WDT11_CTRL */
+#define URE_TIMER11_EN 0x0001
+
+/* USB_LPM_CTRL */
+#define URE_FIFO_EMPTY_1FB 0x30
+#define URE_LPM_TIMER_MASK 0x0c
+#define URE_LPM_TIMER_500MS 0x04
+#define URE_LPM_TIMER_500US 0x0c
+#define URE_ROK_EXIT_LPM 0x02
+
+/* USB_AFE_CTRL2 */
+#define URE_SEN_VAL_MASK 0xf800
+#define URE_SEN_VAL_NORMAL 0xa000
+#define URE_SEL_RXIDLE 0x0100
+
+/* OCP_ALDPS_CONFIG */
+#define URE_ENPWRSAVE 0x8000
+#define URE_ENPDNPS 0x0200
+#define URE_LINKENA 0x0100
+#define URE_DIS_SDSAVE 0x0010
+
+/* OCP_PHY_STATUS */
+#define URE_PHY_STAT_MASK 0x0007
+#define URE_PHY_STAT_LAN_ON 3
+#define URE_PHY_STAT_PWRDN 5
+
+/* OCP_POWER_CFG */
+#define URE_EEE_CLKDIV_EN 0x8000
+#define URE_EN_ALDPS 0x0004
+#define URE_EN_10M_PLLOFF 0x0001
+
+/* OCP_EEE_CFG */
+#define URE_CTAP_SHORT_EN 0x0040
+#define URE_EEE10_EN 0x0010
+
+/* OCP_DOWN_SPEED */
+#define URE_EN_10M_BGOFF 0x0080
+
+/* OCP_PHY_STATE */
+#define URE_TXDIS_STATE 0x01
+#define URE_ABD_STATE 0x02
+
+/* OCP_ADC_CFG */
+#define URE_CKADSEL_L 0x0100
+#define URE_ADC_EN 0x0080
+#define URE_EN_EMI_L 0x0040
+
+#define URE_MCU_TYPE_PLA 0x0100
+#define URE_MCU_TYPE_USB 0x0000
+
+#define GET_MII(sc) uether_getmii(&(sc)->sc_ue)
+
+struct ure_intrpkt {
+ uint8_t ure_tsr;
+ uint8_t ure_rsr;
+ uint8_t ure_gep_msr;
+ uint8_t ure_waksr;
+ uint8_t ure_txok_cnt;
+ uint8_t ure_rxlost_cnt;
+ uint8_t ure_crcerr_cnt;
+ uint8_t ure_col_cnt;
+} __packed;
+
+struct ure_rxpkt {
+ uint32_t ure_pktlen;
+#define URE_RXPKT_LEN_MASK 0x7fff
+ uint32_t ure_rsvd0;
+ uint32_t ure_rsvd1;
+ uint32_t ure_rsvd2;
+ uint32_t ure_rsvd3;
+ uint32_t ure_rsvd4;
+} __packed;
+
+struct ure_txpkt {
+ uint32_t ure_pktlen;
+#define URE_TKPKT_TX_FS (1 << 31)
+#define URE_TKPKT_TX_LS (1 << 30)
+#define URE_TXPKT_LEN_MASK 0xffff
+ uint32_t ure_rsvd0;
+} __packed;
+
+enum {
+ URE_BULK_DT_WR,
+ URE_BULK_DT_RD,
+ URE_N_TRANSFER,
+};
+
+struct ure_softc {
+ struct usb_ether sc_ue;
+ struct mtx sc_mtx;
+ struct usb_xfer *sc_xfer[URE_N_TRANSFER];
+
+ int sc_phyno;
+
+ u_int sc_flags;
+#define URE_FLAG_LINK 0x0001
+
+ u_int sc_chip;
+#define URE_CHIP_VER_4C00 0x01
+#define URE_CHIP_VER_4C10 0x02
+};
+
+#define URE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
+#define URE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
+#define URE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t)
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 83d41e6..42ba9c1 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -3784,6 +3784,7 @@ product REALTEK USB20CRW 0x0158 USB20CRW Card Reader
product REALTEK RTL8188ETV 0x0179 RTL8188ETV
product REALTEK RTL8188CTV 0x018a RTL8188CTV
product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet
+product REALTEK RTL8152 0x8152 RTL8152 USB Ethernet
product REALTEK RTL8153 0x8153 RTL8153 USB Ethernet
product REALTEK RTL8188CE_0 0x8170 RTL8188CE
product REALTEK RTL8171 0x8171 RTL8171
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c
index 2fe2fcb..8db58d6 100644
--- a/sys/dev/usb/wlan/if_urtwn.c
+++ b/sys/dev/usb/wlan/if_urtwn.c
@@ -195,12 +195,12 @@ static void urtwn_free_rx_list(struct urtwn_softc *);
static void urtwn_free_tx_list(struct urtwn_softc *);
static struct urtwn_data * _urtwn_getbuf(struct urtwn_softc *);
static struct urtwn_data * urtwn_getbuf(struct urtwn_softc *);
-static int urtwn_write_region_1(struct urtwn_softc *, uint16_t,
+static usb_error_t urtwn_write_region_1(struct urtwn_softc *, uint16_t,
uint8_t *, int);
-static void urtwn_write_1(struct urtwn_softc *, uint16_t, uint8_t);
-static void urtwn_write_2(struct urtwn_softc *, uint16_t, uint16_t);
-static void urtwn_write_4(struct urtwn_softc *, uint16_t, uint32_t);
-static int urtwn_read_region_1(struct urtwn_softc *, uint16_t,
+static usb_error_t urtwn_write_1(struct urtwn_softc *, uint16_t, uint8_t);
+static usb_error_t urtwn_write_2(struct urtwn_softc *, uint16_t, uint16_t);
+static usb_error_t urtwn_write_4(struct urtwn_softc *, uint16_t, uint32_t);
+static usb_error_t urtwn_read_region_1(struct urtwn_softc *, uint16_t,
uint8_t *, int);
static uint8_t urtwn_read_1(struct urtwn_softc *, uint16_t);
static uint16_t urtwn_read_2(struct urtwn_softc *, uint16_t);
@@ -223,7 +223,7 @@ static void urtwn_dump_rom_contents(struct urtwn_softc *,
#endif
static int urtwn_efuse_read(struct urtwn_softc *, uint8_t *,
uint16_t);
-static void urtwn_efuse_switch_power(struct urtwn_softc *);
+static int urtwn_efuse_switch_power(struct urtwn_softc *);
static int urtwn_read_chipid(struct urtwn_softc *);
static int urtwn_read_rom(struct urtwn_softc *);
static int urtwn_r88e_read_rom(struct urtwn_softc *);
@@ -267,7 +267,7 @@ static int urtwn_fw_loadpage(struct urtwn_softc *, int,
static int urtwn_load_firmware(struct urtwn_softc *);
static int urtwn_r92c_dma_init(struct urtwn_softc *);
static int urtwn_r88e_dma_init(struct urtwn_softc *);
-static void urtwn_mac_init(struct urtwn_softc *);
+static int urtwn_mac_init(struct urtwn_softc *);
static void urtwn_bb_init(struct urtwn_softc *);
static void urtwn_rf_init(struct urtwn_softc *);
static void urtwn_cam_init(struct urtwn_softc *);
@@ -298,7 +298,7 @@ static void urtwn_set_chan(struct urtwn_softc *,
struct ieee80211_channel *);
static void urtwn_iq_calib(struct urtwn_softc *);
static void urtwn_lc_calib(struct urtwn_softc *);
-static void urtwn_init(struct urtwn_softc *);
+static int urtwn_init(struct urtwn_softc *);
static void urtwn_stop(struct urtwn_softc *);
static void urtwn_abort_xfers(struct urtwn_softc *);
static int urtwn_raw_xmit(struct ieee80211_node *, struct mbuf *,
@@ -516,9 +516,10 @@ urtwn_detach(device_t self)
/* Prevent further ioctls. */
URTWN_LOCK(sc);
sc->sc_flags |= URTWN_DETACHED;
- urtwn_stop(sc);
URTWN_UNLOCK(sc);
+ urtwn_stop(sc);
+
callout_drain(&sc->sc_watchdog_ch);
/* stop all USB transfers */
@@ -1051,7 +1052,7 @@ urtwn_getbuf(struct urtwn_softc *sc)
return (bf);
}
-static int
+static usb_error_t
urtwn_write_region_1(struct urtwn_softc *sc, uint16_t addr, uint8_t *buf,
int len)
{
@@ -1065,28 +1066,27 @@ urtwn_write_region_1(struct urtwn_softc *sc, uint16_t addr, uint8_t *buf,
return (urtwn_do_request(sc, &req, buf));
}
-static void
+static usb_error_t
urtwn_write_1(struct urtwn_softc *sc, uint16_t addr, uint8_t val)
{
- urtwn_write_region_1(sc, addr, &val, 1);
+ return (urtwn_write_region_1(sc, addr, &val, sizeof(val)));
}
-
-static void
+static usb_error_t
urtwn_write_2(struct urtwn_softc *sc, uint16_t addr, uint16_t val)
{
val = htole16(val);
- urtwn_write_region_1(sc, addr, (uint8_t *)&val, 2);
+ return (urtwn_write_region_1(sc, addr, (uint8_t *)&val, sizeof(val)));
}
-static void
+static usb_error_t
urtwn_write_4(struct urtwn_softc *sc, uint16_t addr, uint32_t val)
{
val = htole32(val);
- urtwn_write_region_1(sc, addr, (uint8_t *)&val, 4);
+ return (urtwn_write_region_1(sc, addr, (uint8_t *)&val, sizeof(val)));
}
-static int
+static usb_error_t
urtwn_read_region_1(struct urtwn_softc *sc, uint16_t addr, uint8_t *buf,
int len)
{
@@ -1134,6 +1134,7 @@ static int
urtwn_fw_cmd(struct urtwn_softc *sc, uint8_t id, const void *buf, int len)
{
struct r92c_fw_cmd cmd;
+ usb_error_t error;
int ntries;
/* Wait for current FW box to be empty. */
@@ -1155,10 +1156,14 @@ urtwn_fw_cmd(struct urtwn_softc *sc, uint8_t id, const void *buf, int len)
memcpy(cmd.msg, buf, len);
/* Write the first word last since that will trigger the FW. */
- urtwn_write_region_1(sc, R92C_HMEBOX_EXT(sc->fwcur),
+ error = urtwn_write_region_1(sc, R92C_HMEBOX_EXT(sc->fwcur),
(uint8_t *)&cmd + 4, 2);
- urtwn_write_region_1(sc, R92C_HMEBOX(sc->fwcur),
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_region_1(sc, R92C_HMEBOX(sc->fwcur),
(uint8_t *)&cmd + 0, 4);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
sc->fwcur = (sc->fwcur + 1) % R92C_H2C_NBOX;
return (0);
@@ -1221,12 +1226,15 @@ urtwn_rf_read(struct urtwn_softc *sc, int chain, uint8_t addr)
static int
urtwn_llt_write(struct urtwn_softc *sc, uint32_t addr, uint32_t data)
{
+ usb_error_t error;
int ntries;
- urtwn_write_4(sc, R92C_LLT_INIT,
+ error = urtwn_write_4(sc, R92C_LLT_INIT,
SM(R92C_LLT_INIT_OP, R92C_LLT_INIT_OP_WRITE) |
SM(R92C_LLT_INIT_ADDR, addr) |
SM(R92C_LLT_INIT_DATA, data));
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Wait for write operation to complete. */
for (ntries = 0; ntries < 20; ntries++) {
if (MS(urtwn_read_4(sc, R92C_LLT_INIT), R92C_LLT_INIT_OP) ==
@@ -1241,6 +1249,7 @@ static int
urtwn_efuse_read_next(struct urtwn_softc *sc, uint8_t *val)
{
uint32_t reg;
+ usb_error_t error;
int ntries;
if (sc->last_rom_addr >= URTWN_EFUSE_MAX_LEN)
@@ -1250,7 +1259,9 @@ urtwn_efuse_read_next(struct urtwn_softc *sc, uint8_t *val)
reg = RW(reg, R92C_EFUSE_CTRL_ADDR, sc->last_rom_addr);
reg &= ~R92C_EFUSE_CTRL_VALID;
- urtwn_write_4(sc, R92C_EFUSE_CTRL, reg);
+ error = urtwn_write_4(sc, R92C_EFUSE_CTRL, reg);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Wait for read operation to complete. */
for (ntries = 0; ntries < 100; ntries++) {
reg = urtwn_read_4(sc, R92C_EFUSE_CTRL);
@@ -1327,7 +1338,7 @@ urtwn_efuse_read(struct urtwn_softc *sc, uint8_t *rom, uint16_t size)
uint8_t msk, off, reg;
int error;
- urtwn_efuse_switch_power(sc);
+ URTWN_CHK(urtwn_efuse_switch_power(sc));
/* Read full ROM image. */
sc->last_rom_addr = 0;
@@ -1370,29 +1381,40 @@ end:
#undef URTWN_CHK
}
-static void
+static int
urtwn_efuse_switch_power(struct urtwn_softc *sc)
{
+ usb_error_t error;
uint32_t reg;
- urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_ON);
+ error = urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_ON);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
reg = urtwn_read_2(sc, R92C_SYS_ISO_CTRL);
if (!(reg & R92C_SYS_ISO_CTRL_PWC_EV12V)) {
- urtwn_write_2(sc, R92C_SYS_ISO_CTRL,
+ error = urtwn_write_2(sc, R92C_SYS_ISO_CTRL,
reg | R92C_SYS_ISO_CTRL_PWC_EV12V);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
}
reg = urtwn_read_2(sc, R92C_SYS_FUNC_EN);
if (!(reg & R92C_SYS_FUNC_EN_ELDR)) {
- urtwn_write_2(sc, R92C_SYS_FUNC_EN,
+ error = urtwn_write_2(sc, R92C_SYS_FUNC_EN,
reg | R92C_SYS_FUNC_EN_ELDR);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
}
reg = urtwn_read_2(sc, R92C_SYS_CLKR);
if ((reg & (R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) !=
(R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M)) {
- urtwn_write_2(sc, R92C_SYS_CLKR,
+ error = urtwn_write_2(sc, R92C_SYS_CLKR,
reg | R92C_SYS_CLKR_LOADER_EN | R92C_SYS_CLKR_ANA8M);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
}
+
+ return (0);
}
static int
@@ -1579,14 +1601,16 @@ urtwn_init_beacon(struct urtwn_softc *sc, struct urtwn_vap *uvp)
SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_BEACON) |
SM(R92C_TXDW1_RAID, R92C_RAID_11B));
- if (sc->chip & URTWN_CHIP_88E)
+ if (sc->chip & URTWN_CHIP_88E) {
txd->txdw1 |= htole32(SM(R88E_TXDW1_MACID, URTWN_MACID_BC));
- else
+ txd->txdseq |= htole16(R88E_TXDSEQ_HWSEQ_EN);
+ } else {
txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, URTWN_MACID_BC));
+ txd->txdw4 |= htole32(R92C_TXDW4_HWSEQ_EN);
+ }
txd->txdw4 = htole32(R92C_TXDW4_DRVRATE);
txd->txdw5 = htole32(SM(R92C_TXDW5_DATARATE, URTWN_RIDX_CCK1));
- txd->txdseq = htole16(R92C_TXDSEQ_HWSEQ_EN);
}
static int
@@ -2227,13 +2251,17 @@ urtwn_tx_data(struct urtwn_softc *sc, struct ieee80211_node *ni,
txd->txdw1 |= htole32(SM(R92C_TXDW1_MACID, macid));
txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx));
- /* not sure here */
- if (ridx <= URTWN_RIDX_CCK11)
+ /* Force this rate if needed. */
+ if (ismcast || type != IEEE80211_FC0_TYPE_DATA ||
+ (m->m_flags & M_EAPOL))
txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE);
if (!IEEE80211_QOS_HAS_SEQ(wh)) {
/* Use HW sequence numbering for non-QoS frames. */
- txd->txdseq = htole16(R92C_TXDSEQ_HWSEQ_EN);
+ if (sc->chip & URTWN_CHIP_88E)
+ txd->txdseq = htole16(R88E_TXDSEQ_HWSEQ_EN);
+ else
+ txd->txdw4 |= htole32(R92C_TXDW4_HWSEQ_EN);
} else {
/* Set sequence number. */
txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE);
@@ -2360,24 +2388,23 @@ static void
urtwn_parent(struct ieee80211com *ic)
{
struct urtwn_softc *sc = ic->ic_softc;
- int startall = 0;
URTWN_LOCK(sc);
if (sc->sc_flags & URTWN_DETACHED) {
URTWN_UNLOCK(sc);
return;
}
- if (ic->ic_nrunning > 0) {
- if ((sc->sc_flags & URTWN_RUNNING) == 0) {
- urtwn_init(sc);
- startall = 1;
- }
- } else if (sc->sc_flags & URTWN_RUNNING)
- urtwn_stop(sc);
URTWN_UNLOCK(sc);
- if (startall)
- ieee80211_start_all(ic);
+ if (ic->ic_nrunning > 0) {
+ if (urtwn_init(sc) != 0) {
+ struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
+ if (vap != NULL)
+ ieee80211_stop(vap);
+ } else
+ ieee80211_start_all(ic);
+ } else
+ urtwn_stop(sc);
}
static __inline int
@@ -2391,6 +2418,7 @@ static int
urtwn_r92c_power_on(struct urtwn_softc *sc)
{
uint32_t reg;
+ usb_error_t error;
int ntries;
/* Wait for autoload done bit. */
@@ -2406,24 +2434,34 @@ urtwn_r92c_power_on(struct urtwn_softc *sc)
}
/* Unlock ISO/CLK/Power control register. */
- urtwn_write_1(sc, R92C_RSV_CTRL, 0);
+ error = urtwn_write_1(sc, R92C_RSV_CTRL, 0);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Move SPS into PWM mode. */
- urtwn_write_1(sc, R92C_SPS0_CTRL, 0x2b);
+ error = urtwn_write_1(sc, R92C_SPS0_CTRL, 0x2b);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
urtwn_ms_delay(sc);
reg = urtwn_read_1(sc, R92C_LDOV12D_CTRL);
if (!(reg & R92C_LDOV12D_CTRL_LDV12_EN)) {
- urtwn_write_1(sc, R92C_LDOV12D_CTRL,
+ error = urtwn_write_1(sc, R92C_LDOV12D_CTRL,
reg | R92C_LDOV12D_CTRL_LDV12_EN);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
urtwn_ms_delay(sc);
- urtwn_write_1(sc, R92C_SYS_ISO_CTRL,
+ error = urtwn_write_1(sc, R92C_SYS_ISO_CTRL,
urtwn_read_1(sc, R92C_SYS_ISO_CTRL) &
~R92C_SYS_ISO_CTRL_MD2PP);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
}
/* Auto enable WLAN. */
- urtwn_write_2(sc, R92C_APS_FSMCO,
+ error = urtwn_write_2(sc, R92C_APS_FSMCO,
urtwn_read_2(sc, R92C_APS_FSMCO) | R92C_APS_FSMCO_APFM_ONMAC);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
for (ntries = 0; ntries < 1000; ntries++) {
if (!(urtwn_read_2(sc, R92C_APS_FSMCO) &
R92C_APS_FSMCO_APFM_ONMAC))
@@ -2437,17 +2475,23 @@ urtwn_r92c_power_on(struct urtwn_softc *sc)
}
/* Enable radio, GPIO and LED functions. */
- urtwn_write_2(sc, R92C_APS_FSMCO,
+ error = urtwn_write_2(sc, R92C_APS_FSMCO,
R92C_APS_FSMCO_AFSM_HSUS |
R92C_APS_FSMCO_PDN_EN |
R92C_APS_FSMCO_PFM_ALDN);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Release RF digital isolation. */
- urtwn_write_2(sc, R92C_SYS_ISO_CTRL,
+ error = urtwn_write_2(sc, R92C_SYS_ISO_CTRL,
urtwn_read_2(sc, R92C_SYS_ISO_CTRL) & ~R92C_SYS_ISO_CTRL_DIOR);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Initialize MAC. */
- urtwn_write_1(sc, R92C_APSD_CTRL,
+ error = urtwn_write_1(sc, R92C_APSD_CTRL,
urtwn_read_1(sc, R92C_APSD_CTRL) & ~R92C_APSD_CTRL_OFF);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
for (ntries = 0; ntries < 200; ntries++) {
if (!(urtwn_read_1(sc, R92C_APSD_CTRL) &
R92C_APSD_CTRL_OFF_STATUS))
@@ -2466,9 +2510,13 @@ urtwn_r92c_power_on(struct urtwn_softc *sc)
R92C_CR_TXDMA_EN | R92C_CR_RXDMA_EN | R92C_CR_PROTOCOL_EN |
R92C_CR_SCHEDULE_EN | R92C_CR_MACTXEN | R92C_CR_MACRXEN |
R92C_CR_ENSEC;
- urtwn_write_2(sc, R92C_CR, reg);
+ error = urtwn_write_2(sc, R92C_CR, reg);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
- urtwn_write_1(sc, 0xfe10, 0x19);
+ error = urtwn_write_1(sc, 0xfe10, 0x19);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
return (0);
}
@@ -2476,6 +2524,7 @@ static int
urtwn_r88e_power_on(struct urtwn_softc *sc)
{
uint32_t reg;
+ usb_error_t error;
int ntries;
/* Wait for power ready bit. */
@@ -2491,24 +2540,34 @@ urtwn_r88e_power_on(struct urtwn_softc *sc)
}
/* Reset BB. */
- urtwn_write_1(sc, R92C_SYS_FUNC_EN,
+ error = urtwn_write_1(sc, R92C_SYS_FUNC_EN,
urtwn_read_1(sc, R92C_SYS_FUNC_EN) & ~(R92C_SYS_FUNC_EN_BBRSTB |
R92C_SYS_FUNC_EN_BB_GLB_RST));
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
- urtwn_write_1(sc, R92C_AFE_XTAL_CTRL + 2,
+ error = urtwn_write_1(sc, R92C_AFE_XTAL_CTRL + 2,
urtwn_read_1(sc, R92C_AFE_XTAL_CTRL + 2) | 0x80);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Disable HWPDN. */
- urtwn_write_2(sc, R92C_APS_FSMCO,
+ error = urtwn_write_2(sc, R92C_APS_FSMCO,
urtwn_read_2(sc, R92C_APS_FSMCO) & ~R92C_APS_FSMCO_APDM_HPDN);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Disable WL suspend. */
- urtwn_write_2(sc, R92C_APS_FSMCO,
+ error = urtwn_write_2(sc, R92C_APS_FSMCO,
urtwn_read_2(sc, R92C_APS_FSMCO) &
~(R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE));
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
- urtwn_write_2(sc, R92C_APS_FSMCO,
+ error = urtwn_write_2(sc, R92C_APS_FSMCO,
urtwn_read_2(sc, R92C_APS_FSMCO) | R92C_APS_FSMCO_APFM_ONMAC);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
for (ntries = 0; ntries < 5000; ntries++) {
if (!(urtwn_read_2(sc, R92C_APS_FSMCO) &
R92C_APS_FSMCO_APFM_ONMAC))
@@ -2519,16 +2578,22 @@ urtwn_r88e_power_on(struct urtwn_softc *sc)
return (ETIMEDOUT);
/* Enable LDO normal mode. */
- urtwn_write_1(sc, R92C_LPLDO_CTRL,
+ error = urtwn_write_1(sc, R92C_LPLDO_CTRL,
urtwn_read_1(sc, R92C_LPLDO_CTRL) & ~0x10);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */
- urtwn_write_2(sc, R92C_CR, 0);
+ error = urtwn_write_2(sc, R92C_CR, 0);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
reg = urtwn_read_2(sc, R92C_CR);
reg |= R92C_CR_HCI_TXDMA_EN | R92C_CR_HCI_RXDMA_EN |
R92C_CR_TXDMA_EN | R92C_CR_RXDMA_EN | R92C_CR_PROTOCOL_EN |
R92C_CR_SCHEDULE_EN | R92C_CR_ENSEC | R92C_CR_CALTMR_EN;
- urtwn_write_2(sc, R92C_CR, reg);
+ error = urtwn_write_2(sc, R92C_CR, reg);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
return (0);
}
@@ -2598,7 +2663,8 @@ static int
urtwn_fw_loadpage(struct urtwn_softc *sc, int page, const uint8_t *buf, int len)
{
uint32_t reg;
- int off, mlen, error = 0;
+ usb_error_t error = USB_ERR_NORMAL_COMPLETION;
+ int off, mlen;
reg = urtwn_read_4(sc, R92C_MCUFWDL);
reg = RW(reg, R92C_MCUFWDL_PAGE, page);
@@ -2615,7 +2681,7 @@ urtwn_fw_loadpage(struct urtwn_softc *sc, int page, const uint8_t *buf, int len)
/* XXX fix this deconst */
error = urtwn_write_region_1(sc, off,
__DECONST(uint8_t *, buf), mlen);
- if (error != 0)
+ if (error != USB_ERR_NORMAL_COMPLETION)
break;
off += mlen;
buf += mlen;
@@ -2748,21 +2814,34 @@ fail:
static __inline int
urtwn_dma_init(struct urtwn_softc *sc)
{
+ usb_error_t usb_err;
+ int error;
+
+ /* Initialize LLT table. */
+ error = urtwn_llt_init(sc);
+ if (error != 0)
+ return (error);
- return sc->sc_dma_init(sc);
+ error = sc->sc_dma_init(sc);
+ if (error != 0)
+ return (error);
+
+ /* Set Tx/Rx transfer page size. */
+ usb_err = urtwn_write_1(sc, R92C_PBP,
+ SM(R92C_PBP_PSRX, R92C_PBP_128) |
+ SM(R92C_PBP_PSTX, R92C_PBP_128));
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+
+ return (0);
}
static int
urtwn_r92c_dma_init(struct urtwn_softc *sc)
{
int hashq, hasnq, haslq, nqueues, nqpages, nrempages;
+ usb_error_t error;
uint32_t reg;
- int error;
-
- /* Initialize LLT table. */
- error = urtwn_llt_init(sc);
- if (error != 0)
- return (error);
/* Get Tx queues to USB endpoints mapping. */
hashq = hasnq = haslq = 0;
@@ -2783,8 +2862,10 @@ urtwn_r92c_dma_init(struct urtwn_softc *sc)
nrempages = (R92C_TX_PAGE_COUNT - R92C_PUBQ_NPAGES) % nqueues;
/* Set number of pages for normal priority queue. */
- urtwn_write_1(sc, R92C_RQPN_NPQ, hasnq ? nqpages : 0);
- urtwn_write_4(sc, R92C_RQPN,
+ error = urtwn_write_1(sc, R92C_RQPN_NPQ, hasnq ? nqpages : 0);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_4(sc, R92C_RQPN,
/* Set number of pages for public queue. */
SM(R92C_RQPN_PUBQ, R92C_PUBQ_NPAGES) |
/* Set number of pages for high priority queue. */
@@ -2793,12 +2874,24 @@ urtwn_r92c_dma_init(struct urtwn_softc *sc)
SM(R92C_RQPN_LPQ, haslq ? nqpages : 0) |
/* Load values. */
R92C_RQPN_LD);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
- urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R92C_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R92C_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R92C_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TRXFF_BNDY, R92C_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TDECTRL + 1, R92C_TX_PAGE_BOUNDARY);
+ error = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R92C_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R92C_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R92C_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TRXFF_BNDY, R92C_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TDECTRL + 1, R92C_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Set queue to USB pipe mapping. */
reg = urtwn_read_2(sc, R92C_TRXDMA_CTRL);
@@ -2820,15 +2913,15 @@ urtwn_r92c_dma_init(struct urtwn_softc *sc)
reg |= R92C_TRXDMA_CTRL_QMAP_HQ_LQ;
} else
reg |= R92C_TRXDMA_CTRL_QMAP_3EP;
- urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg);
+ error = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Set Tx/Rx transfer page boundary. */
- urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x27ff);
+ error = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x27ff);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
- /* Set Tx/Rx transfer page size. */
- urtwn_write_1(sc, R92C_PBP,
- SM(R92C_PBP_PSRX, R92C_PBP_128) |
- SM(R92C_PBP_PSTX, R92C_PBP_128));
return (0);
}
@@ -2837,13 +2930,8 @@ urtwn_r88e_dma_init(struct urtwn_softc *sc)
{
struct usb_interface *iface;
uint32_t reg;
+ usb_error_t error;
int nqueues;
- int error;
-
- /* Initialize LLT table. */
- error = urtwn_llt_init(sc);
- if (error != 0)
- return (error);
/* Get Tx queues to USB endpoints mapping. */
iface = usbd_get_iface(sc->sc_udev, 0);
@@ -2852,14 +2940,28 @@ urtwn_r88e_dma_init(struct urtwn_softc *sc)
return (EIO);
/* Set number of pages for normal priority queue. */
- urtwn_write_2(sc, R92C_RQPN_NPQ, 0x000d);
- urtwn_write_4(sc, R92C_RQPN, 0x808e000d);
+ error = urtwn_write_2(sc, R92C_RQPN_NPQ, 0x000d);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_4(sc, R92C_RQPN, 0x808e000d);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
- urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R88E_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R88E_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R88E_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TRXFF_BNDY, R88E_TX_PAGE_BOUNDARY);
- urtwn_write_1(sc, R92C_TDECTRL + 1, R88E_TX_PAGE_BOUNDARY);
+ error = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R88E_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R88E_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R88E_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TRXFF_BNDY, R88E_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
+ error = urtwn_write_1(sc, R92C_TDECTRL + 1, R88E_TX_PAGE_BOUNDARY);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Set queue to USB pipe mapping. */
reg = urtwn_read_2(sc, R92C_TRXDMA_CTRL);
@@ -2870,36 +2972,42 @@ urtwn_r88e_dma_init(struct urtwn_softc *sc)
reg |= R92C_TRXDMA_CTRL_QMAP_HQ_NQ;
else
reg |= R92C_TRXDMA_CTRL_QMAP_3EP;
- urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg);
+ error = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
/* Set Tx/Rx transfer page boundary. */
- urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x23ff);
-
- /* Set Tx/Rx transfer page size. */
- urtwn_write_1(sc, R92C_PBP,
- SM(R92C_PBP_PSRX, R92C_PBP_128) |
- SM(R92C_PBP_PSTX, R92C_PBP_128));
+ error = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x23ff);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
return (0);
}
-static void
+static int
urtwn_mac_init(struct urtwn_softc *sc)
{
+ usb_error_t error;
int i;
/* Write MAC initialization values. */
if (sc->chip & URTWN_CHIP_88E) {
for (i = 0; i < nitems(rtl8188eu_mac); i++) {
- urtwn_write_1(sc, rtl8188eu_mac[i].reg,
+ error = urtwn_write_1(sc, rtl8188eu_mac[i].reg,
rtl8188eu_mac[i].val);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
}
urtwn_write_1(sc, R92C_MAX_AGGR_NUM, 0x07);
} else {
for (i = 0; i < nitems(rtl8192cu_mac); i++)
- urtwn_write_1(sc, rtl8192cu_mac[i].reg,
+ error = urtwn_write_1(sc, rtl8192cu_mac[i].reg,
rtl8192cu_mac[i].val);
+ if (error != USB_ERR_NORMAL_COMPLETION)
+ return (EIO);
}
+
+ return (0);
}
static void
@@ -3717,19 +3825,21 @@ urtwn_lc_calib(struct urtwn_softc *sc)
}
}
-static void
+static int
urtwn_init(struct urtwn_softc *sc)
{
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
uint8_t macaddr[IEEE80211_ADDR_LEN];
uint32_t reg;
+ usb_error_t usb_err = USB_ERR_NORMAL_COMPLETION;
int error;
- URTWN_ASSERT_LOCKED(sc);
-
- if (sc->sc_flags & URTWN_RUNNING)
- urtwn_stop(sc);
+ URTWN_LOCK(sc);
+ if (sc->sc_flags & URTWN_RUNNING) {
+ URTWN_UNLOCK(sc);
+ return (0);
+ }
/* Init firmware commands ring. */
sc->fwcur = 0;
@@ -3758,22 +3868,36 @@ urtwn_init(struct urtwn_softc *sc)
/* Init interrupts. */
if (sc->chip & URTWN_CHIP_88E) {
- urtwn_write_4(sc, R88E_HISR, 0xffffffff);
- urtwn_write_4(sc, R88E_HIMR, R88E_HIMR_CPWM | R88E_HIMR_CPWM2 |
+ usb_err = urtwn_write_4(sc, R88E_HISR, 0xffffffff);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
+ usb_err = urtwn_write_4(sc, R88E_HIMR, R88E_HIMR_CPWM | R88E_HIMR_CPWM2 |
R88E_HIMR_TBDER | R88E_HIMR_PSTIMEOUT);
- urtwn_write_4(sc, R88E_HIMRE, R88E_HIMRE_RXFOVW |
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
+ usb_err = urtwn_write_4(sc, R88E_HIMRE, R88E_HIMRE_RXFOVW |
R88E_HIMRE_TXFOVW | R88E_HIMRE_RXERR | R88E_HIMRE_TXERR);
- urtwn_write_1(sc, R92C_USB_SPECIAL_OPTION,
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
+ usb_err = urtwn_write_1(sc, R92C_USB_SPECIAL_OPTION,
urtwn_read_1(sc, R92C_USB_SPECIAL_OPTION) |
R92C_USB_SPECIAL_OPTION_INT_BULK_SEL);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
} else {
- urtwn_write_4(sc, R92C_HISR, 0xffffffff);
- urtwn_write_4(sc, R92C_HIMR, 0xffffffff);
+ usb_err = urtwn_write_4(sc, R92C_HISR, 0xffffffff);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
+ usb_err = urtwn_write_4(sc, R92C_HIMR, 0xffffffff);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
}
/* Set MAC address. */
IEEE80211_ADDR_COPY(macaddr, vap ? vap->iv_myaddr : ic->ic_macaddr);
- urtwn_write_region_1(sc, R92C_MACID, macaddr, IEEE80211_ADDR_LEN);
+ usb_err = urtwn_write_region_1(sc, R92C_MACID, macaddr, IEEE80211_ADDR_LEN);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
/* Set initial network type. */
urtwn_set_mode(sc, R92C_MSR_INFRA);
@@ -3848,7 +3972,12 @@ urtwn_init(struct urtwn_softc *sc)
goto fail;
/* Initialize MAC/BB/RF blocks. */
- urtwn_mac_init(sc);
+ error = urtwn_mac_init(sc);
+ if (error != 0) {
+ device_printf(sc->sc_dev,
+ "%s: error while initializing MAC block\n", __func__);
+ goto fail;
+ }
urtwn_bb_init(sc);
urtwn_rf_init(sc);
@@ -3864,10 +3993,14 @@ urtwn_init(struct urtwn_softc *sc)
/* Turn CCK and OFDM blocks on. */
reg = urtwn_bb_read(sc, R92C_FPGA0_RFMOD);
reg |= R92C_RFMOD_CCK_EN;
- urtwn_bb_write(sc, R92C_FPGA0_RFMOD, reg);
+ usb_err = urtwn_bb_write(sc, R92C_FPGA0_RFMOD, reg);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
reg = urtwn_bb_read(sc, R92C_FPGA0_RFMOD);
reg |= R92C_RFMOD_OFDM_EN;
- urtwn_bb_write(sc, R92C_FPGA0_RFMOD, reg);
+ usb_err = urtwn_bb_write(sc, R92C_FPGA0_RFMOD, reg);
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ goto fail;
/* Clear per-station keys table. */
urtwn_cam_init(sc);
@@ -3903,19 +4036,30 @@ urtwn_init(struct urtwn_softc *sc)
callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc);
fail:
- return;
+ if (usb_err != USB_ERR_NORMAL_COMPLETION)
+ error = EIO;
+
+ URTWN_UNLOCK(sc);
+
+ return (error);
}
static void
urtwn_stop(struct urtwn_softc *sc)
{
- URTWN_ASSERT_LOCKED(sc);
+ URTWN_LOCK(sc);
+ if (!(sc->sc_flags & URTWN_RUNNING)) {
+ URTWN_UNLOCK(sc);
+ return;
+ }
+
sc->sc_flags &= ~URTWN_RUNNING;
callout_stop(&sc->sc_watchdog_ch);
urtwn_abort_xfers(sc);
urtwn_drain_mbufq(sc);
+ URTWN_UNLOCK(sc);
}
static void
diff --git a/sys/dev/usb/wlan/if_urtwnreg.h b/sys/dev/usb/wlan/if_urtwnreg.h
index b3aaa9c..75a65f7 100644
--- a/sys/dev/usb/wlan/if_urtwnreg.h
+++ b/sys/dev/usb/wlan/if_urtwnreg.h
@@ -1055,12 +1055,13 @@ struct r92c_tx_desc {
uint16_t txdw3;
uint16_t txdseq;
-#define R92C_TXDSEQ_HWSEQ_EN 0x8000
+#define R88E_TXDSEQ_HWSEQ_EN 0x8000
uint32_t txdw4;
#define R92C_TXDW4_RTSRATE_M 0x0000003f
#define R92C_TXDW4_RTSRATE_S 0
#define R92C_TXDW4_HWSEQ_QOS 0x00000040
+#define R92C_TXDW4_HWSEQ_EN 0x00000080
#define R92C_TXDW4_DRVRATE 0x00000100
#define R92C_TXDW4_CTS2SELF 0x00000800
#define R92C_TXDW4_RTSEN 0x00001000
diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c
index 04e75f8..3bbc73a 100644
--- a/sys/dev/wpi/if_wpi.c
+++ b/sys/dev/wpi/if_wpi.c
@@ -3556,6 +3556,13 @@ wpi_update_promisc(struct ieee80211com *ic)
{
struct wpi_softc *sc = ic->ic_softc;
+ WPI_LOCK(sc);
+ if (sc->sc_running == 0) {
+ WPI_UNLOCK(sc);
+ return;
+ }
+ WPI_UNLOCK(sc);
+
WPI_RXON_LOCK(sc);
wpi_set_promisc(sc);
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index d27af46..5c45bd8 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -151,7 +151,7 @@ devfs_get_cdevpriv(void **datap)
}
int
-devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t priv_dtr)
+devfs_set_cdevpriv(void *priv, d_priv_dtor_t *priv_dtr)
{
struct file *fp;
struct cdev_priv *cdp;
diff --git a/sys/fs/nfs/nfs.h b/sys/fs/nfs/nfs.h
index be60c1c..5781459 100644
--- a/sys/fs/nfs/nfs.h
+++ b/sys/fs/nfs/nfs.h
@@ -96,12 +96,6 @@
#define NFSSESSIONHASHSIZE 20 /* Size of server session hash table */
#endif
#define NFSSTATEHASHSIZE 10 /* Size of server stateid hash table */
-#ifndef NFSUSERHASHSIZE
-#define NFSUSERHASHSIZE 30 /* Size of user id hash table */
-#endif
-#ifndef NFSGROUPHASHSIZE
-#define NFSGROUPHASHSIZE 5 /* Size of group id hash table */
-#endif
#ifndef NFSCLDELEGHIGHWATER
#define NFSCLDELEGHIGHWATER 10000 /* limit for client delegations */
#endif
@@ -204,6 +198,18 @@ struct nfsd_idargs {
int nid_usertimeout;/* User name timeout (minutes) */
u_char *nid_name; /* Name */
int nid_namelen; /* and its length */
+ gid_t *nid_grps; /* and the list */
+ int nid_ngroup; /* Size of groups list */
+};
+
+struct nfsd_oidargs {
+ int nid_flag; /* Flags (see below) */
+ uid_t nid_uid; /* user/group id */
+ gid_t nid_gid;
+ int nid_usermax; /* Upper bound on user name cache */
+ int nid_usertimeout;/* User name timeout (minutes) */
+ u_char *nid_name; /* Name */
+ int nid_namelen; /* and its length */
};
struct nfsd_clid {
diff --git a/sys/fs/nfs/nfs_commonport.c b/sys/fs/nfs/nfs_commonport.c
index bc5d9de..a22b38c 100644
--- a/sys/fs/nfs/nfs_commonport.c
+++ b/sys/fs/nfs/nfs_commonport.c
@@ -63,6 +63,7 @@ int nfs_numnfscbd = 0;
int nfscl_debuglevel = 0;
char nfsv4_callbackaddr[INET6_ADDRSTRLEN];
struct callout newnfsd_callout;
+int nfsrv_lughashsize = 100;
void (*nfsd_call_servertimer)(void) = NULL;
void (*ncl_call_invalcaches)(struct vnode *) = NULL;
@@ -79,6 +80,8 @@ SYSCTL_STRING(_vfs_nfs, OID_AUTO, callback_addr, CTLFLAG_RW,
"NFSv4 callback addr for server to use");
SYSCTL_INT(_vfs_nfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nfscl_debuglevel,
0, "Debug level for NFS client");
+SYSCTL_INT(_vfs_nfs, OID_AUTO, userhashsize, CTLFLAG_RDTUN, &nfsrv_lughashsize,
+ 0, "Size of hash tables for uid/name mapping");
/*
* Defines for malloc
@@ -445,9 +448,25 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, struct ucred *cred)
{
int error = EINVAL;
struct nfsd_idargs nid;
+ struct nfsd_oidargs onid;
if (uap->flag & NFSSVC_IDNAME) {
- error = copyin(uap->argp, (caddr_t)&nid, sizeof (nid));
+ if ((uap->flag & NFSSVC_NEWSTRUCT) != 0)
+ error = copyin(uap->argp, &nid, sizeof(nid));
+ else {
+ error = copyin(uap->argp, &onid, sizeof(onid));
+ if (error == 0) {
+ nid.nid_flag = onid.nid_flag;
+ nid.nid_uid = onid.nid_uid;
+ nid.nid_gid = onid.nid_gid;
+ nid.nid_usermax = onid.nid_usermax;
+ nid.nid_usertimeout = onid.nid_usertimeout;
+ nid.nid_name = onid.nid_name;
+ nid.nid_namelen = onid.nid_namelen;
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
+ }
+ }
if (error)
goto out;
error = nfssvc_idname(&nid);
@@ -604,6 +623,8 @@ nfscommon_modevent(module_t mod, int type, void *data)
nfsd_call_nfscommon = NULL;
callout_drain(&newnfsd_callout);
+ /* Clean out the name<-->id cache. */
+ nfsrv_cleanusergroup();
/* and get rid of the mutexes */
mtx_destroy(&nfs_nameid_mutex);
mtx_destroy(&newnfsd_mtx);
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 0f6db32..16d91af 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$");
#include <fs/nfs/nfsport.h>
+#include <security/mac/mac_framework.h>
+
/*
* Data items converted to xdr at startup, since they are constant
* This is kinda hokey, but may save a little time doing byte swaps
@@ -68,6 +70,7 @@ int ncl_mbuf_mlen = MLEN;
int nfsd_enable_stringtouid = 0;
NFSNAMEIDMUTEX;
NFSSOCKMUTEX;
+extern int nfsrv_lughashsize;
/*
* This array of structures indicates, for V4:
@@ -154,11 +157,14 @@ static int nfsrv_usercnt = 0;
static int nfsrv_dnsnamelen;
static u_char *nfsrv_dnsname = NULL;
static int nfsrv_usermax = 999999999;
-static struct nfsuserhashhead nfsuserhash[NFSUSERHASHSIZE];
-static struct nfsuserhashhead nfsusernamehash[NFSUSERHASHSIZE];
-static struct nfsuserhashhead nfsgrouphash[NFSGROUPHASHSIZE];
-static struct nfsuserhashhead nfsgroupnamehash[NFSGROUPHASHSIZE];
-static struct nfsuserlruhead nfsuserlruhead;
+struct nfsrv_lughash {
+ struct mtx mtx;
+ struct nfsuserhashhead lughead;
+};
+static struct nfsrv_lughash *nfsuserhash;
+static struct nfsrv_lughash *nfsusernamehash;
+static struct nfsrv_lughash *nfsgrouphash;
+static struct nfsrv_lughash *nfsgroupnamehash;
/*
* This static array indicates whether or not the RPC generates a large
@@ -177,7 +183,7 @@ static void nfsv4_wanted(struct nfsv4lock *lp);
static int nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len);
static int nfsrv_getuser(int procnum, uid_t uid, gid_t gid, char *name,
NFSPROC_T *p);
-static void nfsrv_removeuser(struct nfsusrgrp *usrp);
+static void nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser);
static int nfsrv_getrefstr(struct nfsrv_descript *, u_char **, u_char **,
int *, int *);
static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *);
@@ -2548,18 +2554,17 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, NFSPROC_T *p)
u_char *cp = *cpp;
uid_t tmp;
int cnt, hasampersand, len = NFSV4_SMALLSTR, ret;
+ struct nfsrv_lughash *hp;
cnt = 0;
tryagain:
- NFSLOCKNAMEID();
- if (nfsrv_dnsname) {
+ if (nfsrv_dnsnamelen > 0) {
/*
* Always map nfsrv_defaultuid to "nobody".
*/
if (uid == nfsrv_defaultuid) {
i = nfsrv_dnsnamelen + 7;
if (i > len) {
- NFSUNLOCKNAMEID();
if (len > NFSV4_SMALLSTR)
free(cp, M_NFSSTRING);
cp = malloc(i, M_NFSSTRING, M_WAITOK);
@@ -2571,11 +2576,12 @@ tryagain:
NFSBCOPY("nobody@", cp, 7);
cp += 7;
NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen);
- NFSUNLOCKNAMEID();
return;
}
hasampersand = 0;
- LIST_FOREACH(usrp, NFSUSERHASH(uid), lug_numhash) {
+ hp = NFSUSERHASH(uid);
+ mtx_lock(&hp->mtx);
+ TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) {
if (usrp->lug_uid == uid) {
if (usrp->lug_expiry < NFSD_MONOSEC)
break;
@@ -2595,7 +2601,7 @@ tryagain:
i = usrp->lug_namelen +
nfsrv_dnsnamelen + 1;
if (i > len) {
- NFSUNLOCKNAMEID();
+ mtx_unlock(&hp->mtx);
if (len > NFSV4_SMALLSTR)
free(cp, M_NFSSTRING);
cp = malloc(i, M_NFSSTRING, M_WAITOK);
@@ -2610,20 +2616,19 @@ tryagain:
*cp++ = '@';
NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen);
}
- TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru);
- TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru);
- NFSUNLOCKNAMEID();
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash);
+ TAILQ_INSERT_TAIL(&hp->lughead, usrp,
+ lug_numhash);
+ mtx_unlock(&hp->mtx);
return;
}
}
- NFSUNLOCKNAMEID();
+ mtx_unlock(&hp->mtx);
cnt++;
ret = nfsrv_getuser(RPCNFSUSERD_GETUID, uid, (gid_t)0,
NULL, p);
if (ret == 0 && cnt < 2)
goto tryagain;
- } else {
- NFSUNLOCKNAMEID();
}
/*
@@ -2647,6 +2652,52 @@ tryagain:
}
/*
+ * Get a credential for the uid with the server's group list.
+ * If none is found, just return the credential passed in after
+ * logging a warning message.
+ */
+struct ucred *
+nfsrv_getgrpscred(struct ucred *oldcred)
+{
+ struct nfsusrgrp *usrp;
+ struct ucred *newcred;
+ int cnt, ret;
+ uid_t uid;
+ struct nfsrv_lughash *hp;
+
+ cnt = 0;
+ uid = oldcred->cr_uid;
+tryagain:
+ if (nfsrv_dnsnamelen > 0) {
+ hp = NFSUSERHASH(uid);
+ mtx_lock(&hp->mtx);
+ TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) {
+ if (usrp->lug_uid == uid) {
+ if (usrp->lug_expiry < NFSD_MONOSEC)
+ break;
+ if (usrp->lug_cred != NULL) {
+ newcred = crhold(usrp->lug_cred);
+ crfree(oldcred);
+ } else
+ newcred = oldcred;
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash);
+ TAILQ_INSERT_TAIL(&hp->lughead, usrp,
+ lug_numhash);
+ mtx_unlock(&hp->mtx);
+ return (newcred);
+ }
+ }
+ mtx_unlock(&hp->mtx);
+ cnt++;
+ ret = nfsrv_getuser(RPCNFSUSERD_GETUID, uid, (gid_t)0,
+ NULL, curthread);
+ if (ret == 0 && cnt < 2)
+ goto tryagain;
+ }
+ return (oldcred);
+}
+
+/*
* Convert a string to a uid.
* If no conversion is possible return NFSERR_BADOWNER, otherwise
* return 0.
@@ -2664,6 +2715,7 @@ nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp,
int cnt, ret;
int error = 0;
uid_t tuid;
+ struct nfsrv_lughash *hp, *hp2;
if (len == 0) {
error = NFSERR_BADOWNER;
@@ -2693,49 +2745,55 @@ nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp,
cnt = 0;
tryagain:
- NFSLOCKNAMEID();
- /*
- * If an '@' is found and the domain name matches, search for the name
- * with dns stripped off.
- * Mixed case alpahbetics will match for the domain name, but all
- * upper case will not.
- */
- if (cnt == 0 && i < len && i > 0 && nfsrv_dnsname &&
- (len - 1 - i) == nfsrv_dnsnamelen &&
- !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) {
- len -= (nfsrv_dnsnamelen + 1);
- *(cp - 1) = '\0';
- }
-
- /*
- * Check for the special case of "nobody".
- */
- if (len == 6 && !NFSBCMP(str, "nobody", 6)) {
- *uidp = nfsrv_defaultuid;
- NFSUNLOCKNAMEID();
- error = 0;
- goto out;
- }
-
- LIST_FOREACH(usrp, NFSUSERNAMEHASH(str, len), lug_namehash) {
- if (usrp->lug_namelen == len &&
- !NFSBCMP(usrp->lug_name, str, len)) {
- if (usrp->lug_expiry < NFSD_MONOSEC)
- break;
- *uidp = usrp->lug_uid;
- TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru);
- TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru);
- NFSUNLOCKNAMEID();
+ if (nfsrv_dnsnamelen > 0) {
+ /*
+ * If an '@' is found and the domain name matches, search for
+ * the name with dns stripped off.
+ * Mixed case alpahbetics will match for the domain name, but
+ * all upper case will not.
+ */
+ if (cnt == 0 && i < len && i > 0 &&
+ (len - 1 - i) == nfsrv_dnsnamelen &&
+ !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) {
+ len -= (nfsrv_dnsnamelen + 1);
+ *(cp - 1) = '\0';
+ }
+
+ /*
+ * Check for the special case of "nobody".
+ */
+ if (len == 6 && !NFSBCMP(str, "nobody", 6)) {
+ *uidp = nfsrv_defaultuid;
error = 0;
goto out;
}
+
+ hp = NFSUSERNAMEHASH(str, len);
+ mtx_lock(&hp->mtx);
+ TAILQ_FOREACH(usrp, &hp->lughead, lug_namehash) {
+ if (usrp->lug_namelen == len &&
+ !NFSBCMP(usrp->lug_name, str, len)) {
+ if (usrp->lug_expiry < NFSD_MONOSEC)
+ break;
+ hp2 = NFSUSERHASH(usrp->lug_uid);
+ mtx_lock(&hp2->mtx);
+ TAILQ_REMOVE(&hp2->lughead, usrp, lug_numhash);
+ TAILQ_INSERT_TAIL(&hp2->lughead, usrp,
+ lug_numhash);
+ *uidp = usrp->lug_uid;
+ mtx_unlock(&hp2->mtx);
+ mtx_unlock(&hp->mtx);
+ error = 0;
+ goto out;
+ }
+ }
+ mtx_unlock(&hp->mtx);
+ cnt++;
+ ret = nfsrv_getuser(RPCNFSUSERD_GETUSER, (uid_t)0, (gid_t)0,
+ str, p);
+ if (ret == 0 && cnt < 2)
+ goto tryagain;
}
- NFSUNLOCKNAMEID();
- cnt++;
- ret = nfsrv_getuser(RPCNFSUSERD_GETUSER, (uid_t)0, (gid_t)0,
- str, p);
- if (ret == 0 && cnt < 2)
- goto tryagain;
error = NFSERR_BADOWNER;
out:
@@ -2758,18 +2816,17 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, NFSPROC_T *p)
u_char *cp = *cpp;
gid_t tmp;
int cnt, hasampersand, len = NFSV4_SMALLSTR, ret;
+ struct nfsrv_lughash *hp;
cnt = 0;
tryagain:
- NFSLOCKNAMEID();
- if (nfsrv_dnsname) {
+ if (nfsrv_dnsnamelen > 0) {
/*
* Always map nfsrv_defaultgid to "nogroup".
*/
if (gid == nfsrv_defaultgid) {
i = nfsrv_dnsnamelen + 8;
if (i > len) {
- NFSUNLOCKNAMEID();
if (len > NFSV4_SMALLSTR)
free(cp, M_NFSSTRING);
cp = malloc(i, M_NFSSTRING, M_WAITOK);
@@ -2781,11 +2838,12 @@ tryagain:
NFSBCOPY("nogroup@", cp, 8);
cp += 8;
NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen);
- NFSUNLOCKNAMEID();
return;
}
hasampersand = 0;
- LIST_FOREACH(usrp, NFSGROUPHASH(gid), lug_numhash) {
+ hp = NFSGROUPHASH(gid);
+ mtx_lock(&hp->mtx);
+ TAILQ_FOREACH(usrp, &hp->lughead, lug_numhash) {
if (usrp->lug_gid == gid) {
if (usrp->lug_expiry < NFSD_MONOSEC)
break;
@@ -2805,7 +2863,7 @@ tryagain:
i = usrp->lug_namelen +
nfsrv_dnsnamelen + 1;
if (i > len) {
- NFSUNLOCKNAMEID();
+ mtx_unlock(&hp->mtx);
if (len > NFSV4_SMALLSTR)
free(cp, M_NFSSTRING);
cp = malloc(i, M_NFSSTRING, M_WAITOK);
@@ -2820,20 +2878,19 @@ tryagain:
*cp++ = '@';
NFSBCOPY(nfsrv_dnsname, cp, nfsrv_dnsnamelen);
}
- TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru);
- TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru);
- NFSUNLOCKNAMEID();
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash);
+ TAILQ_INSERT_TAIL(&hp->lughead, usrp,
+ lug_numhash);
+ mtx_unlock(&hp->mtx);
return;
}
}
- NFSUNLOCKNAMEID();
+ mtx_unlock(&hp->mtx);
cnt++;
ret = nfsrv_getuser(RPCNFSUSERD_GETGID, (uid_t)0, gid,
NULL, p);
if (ret == 0 && cnt < 2)
goto tryagain;
- } else {
- NFSUNLOCKNAMEID();
}
/*
@@ -2874,6 +2931,7 @@ nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp,
int cnt, ret;
int error = 0;
gid_t tgid;
+ struct nfsrv_lughash *hp, *hp2;
if (len == 0) {
error = NFSERR_BADOWNER;
@@ -2903,47 +2961,53 @@ nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp,
cnt = 0;
tryagain:
- NFSLOCKNAMEID();
- /*
- * If an '@' is found and the dns name matches, search for the name
- * with the dns stripped off.
- */
- if (cnt == 0 && i < len && i > 0 && nfsrv_dnsname &&
- (len - 1 - i) == nfsrv_dnsnamelen &&
- !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) {
- len -= (nfsrv_dnsnamelen + 1);
- *(cp - 1) = '\0';
- }
-
- /*
- * Check for the special case of "nogroup".
- */
- if (len == 7 && !NFSBCMP(str, "nogroup", 7)) {
- *gidp = nfsrv_defaultgid;
- NFSUNLOCKNAMEID();
- error = 0;
- goto out;
- }
-
- LIST_FOREACH(usrp, NFSGROUPNAMEHASH(str, len), lug_namehash) {
- if (usrp->lug_namelen == len &&
- !NFSBCMP(usrp->lug_name, str, len)) {
- if (usrp->lug_expiry < NFSD_MONOSEC)
- break;
- *gidp = usrp->lug_gid;
- TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru);
- TAILQ_INSERT_TAIL(&nfsuserlruhead, usrp, lug_lru);
- NFSUNLOCKNAMEID();
+ if (nfsrv_dnsnamelen > 0) {
+ /*
+ * If an '@' is found and the dns name matches, search for the
+ * name with the dns stripped off.
+ */
+ if (cnt == 0 && i < len && i > 0 &&
+ (len - 1 - i) == nfsrv_dnsnamelen &&
+ !nfsrv_cmpmixedcase(cp, nfsrv_dnsname, nfsrv_dnsnamelen)) {
+ len -= (nfsrv_dnsnamelen + 1);
+ *(cp - 1) = '\0';
+ }
+
+ /*
+ * Check for the special case of "nogroup".
+ */
+ if (len == 7 && !NFSBCMP(str, "nogroup", 7)) {
+ *gidp = nfsrv_defaultgid;
error = 0;
goto out;
}
+
+ hp = NFSGROUPNAMEHASH(str, len);
+ mtx_lock(&hp->mtx);
+ TAILQ_FOREACH(usrp, &hp->lughead, lug_namehash) {
+ if (usrp->lug_namelen == len &&
+ !NFSBCMP(usrp->lug_name, str, len)) {
+ if (usrp->lug_expiry < NFSD_MONOSEC)
+ break;
+ hp2 = NFSGROUPHASH(usrp->lug_gid);
+ mtx_lock(&hp2->mtx);
+ TAILQ_REMOVE(&hp2->lughead, usrp, lug_numhash);
+ TAILQ_INSERT_TAIL(&hp2->lughead, usrp,
+ lug_numhash);
+ *gidp = usrp->lug_gid;
+ mtx_unlock(&hp2->mtx);
+ mtx_unlock(&hp->mtx);
+ error = 0;
+ goto out;
+ }
+ }
+ mtx_unlock(&hp->mtx);
+ cnt++;
+ ret = nfsrv_getuser(RPCNFSUSERD_GETGROUP, (uid_t)0, (gid_t)0,
+ str, p);
+ if (ret == 0 && cnt < 2)
+ goto tryagain;
}
- NFSUNLOCKNAMEID();
- cnt++;
- ret = nfsrv_getuser(RPCNFSUSERD_GETGROUP, (uid_t)0, (gid_t)0,
- str, p);
- if (ret == 0 && cnt < 2)
- goto tryagain;
error = NFSERR_BADOWNER;
out:
@@ -3101,111 +3165,218 @@ APPLESTATIC int
nfssvc_idname(struct nfsd_idargs *nidp)
{
struct nfsusrgrp *nusrp, *usrp, *newusrp;
- struct nfsuserhashhead *hp;
- int i;
+ struct nfsrv_lughash *hp_name, *hp_idnum, *thp;
+ int i, group_locked, groupname_locked, user_locked, username_locked;
int error = 0;
u_char *cp;
+ gid_t *grps;
+ struct ucred *cr;
+ static int onethread = 0;
+ static time_t lasttime = 0;
if (nidp->nid_flag & NFSID_INITIALIZE) {
- cp = (u_char *)malloc(nidp->nid_namelen + 1,
- M_NFSSTRING, M_WAITOK);
- error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp,
- nidp->nid_namelen);
- NFSLOCKNAMEID();
- if (nfsrv_dnsname) {
+ cp = malloc(nidp->nid_namelen + 1, M_NFSSTRING, M_WAITOK);
+ error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp,
+ nidp->nid_namelen);
+ if (error != 0) {
+ free(cp, M_NFSSTRING);
+ goto out;
+ }
+ if (atomic_cmpset_acq_int(&nfsrv_dnsnamelen, 0, 0) == 0) {
+ /*
+ * Free up all the old stuff and reinitialize hash
+ * lists. All mutexes for both lists must be locked,
+ * with the user/group name ones before the uid/gid
+ * ones, to avoid a LOR.
+ */
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsusernamehash[i].mtx);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsuserhash[i].mtx);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ TAILQ_FOREACH_SAFE(usrp,
+ &nfsuserhash[i].lughead, lug_numhash, nusrp)
+ nfsrv_removeuser(usrp, 1);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsuserhash[i].mtx);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsusernamehash[i].mtx);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsgroupnamehash[i].mtx);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsgrouphash[i].mtx);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ TAILQ_FOREACH_SAFE(usrp,
+ &nfsgrouphash[i].lughead, lug_numhash,
+ nusrp)
+ nfsrv_removeuser(usrp, 0);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsgrouphash[i].mtx);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsgroupnamehash[i].mtx);
+ free(nfsrv_dnsname, M_NFSSTRING);
+ nfsrv_dnsname = NULL;
+ }
+ if (nfsuserhash == NULL) {
+ /* Allocate the hash tables. */
+ nfsuserhash = malloc(sizeof(struct nfsrv_lughash) *
+ nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK |
+ M_ZERO);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_init(&nfsuserhash[i].mtx, "nfsuidhash",
+ NULL, MTX_DEF | MTX_DUPOK);
+ nfsusernamehash = malloc(sizeof(struct nfsrv_lughash) *
+ nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK |
+ M_ZERO);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_init(&nfsusernamehash[i].mtx,
+ "nfsusrhash", NULL, MTX_DEF |
+ MTX_DUPOK);
+ nfsgrouphash = malloc(sizeof(struct nfsrv_lughash) *
+ nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK |
+ M_ZERO);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_init(&nfsgrouphash[i].mtx, "nfsgidhash",
+ NULL, MTX_DEF | MTX_DUPOK);
+ nfsgroupnamehash = malloc(sizeof(struct nfsrv_lughash) *
+ nfsrv_lughashsize, M_NFSUSERGROUP, M_WAITOK |
+ M_ZERO);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_init(&nfsgroupnamehash[i].mtx,
+ "nfsgrphash", NULL, MTX_DEF | MTX_DUPOK);
+ }
+ /* (Re)initialize the list heads. */
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ TAILQ_INIT(&nfsuserhash[i].lughead);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ TAILQ_INIT(&nfsusernamehash[i].lughead);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ TAILQ_INIT(&nfsgrouphash[i].lughead);
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ TAILQ_INIT(&nfsgroupnamehash[i].lughead);
+
/*
- * Free up all the old stuff and reinitialize hash lists.
+ * Put name in "DNS" string.
*/
- TAILQ_FOREACH_SAFE(usrp, &nfsuserlruhead, lug_lru, nusrp) {
- nfsrv_removeuser(usrp);
- }
- free(nfsrv_dnsname, M_NFSSTRING);
- nfsrv_dnsname = NULL;
- }
- TAILQ_INIT(&nfsuserlruhead);
- for (i = 0; i < NFSUSERHASHSIZE; i++)
- LIST_INIT(&nfsuserhash[i]);
- for (i = 0; i < NFSGROUPHASHSIZE; i++)
- LIST_INIT(&nfsgrouphash[i]);
- for (i = 0; i < NFSUSERHASHSIZE; i++)
- LIST_INIT(&nfsusernamehash[i]);
- for (i = 0; i < NFSGROUPHASHSIZE; i++)
- LIST_INIT(&nfsgroupnamehash[i]);
-
- /*
- * Put name in "DNS" string.
- */
- if (!error) {
nfsrv_dnsname = cp;
- nfsrv_dnsnamelen = nidp->nid_namelen;
nfsrv_defaultuid = nidp->nid_uid;
nfsrv_defaultgid = nidp->nid_gid;
nfsrv_usercnt = 0;
nfsrv_usermax = nidp->nid_usermax;
- }
- NFSUNLOCKNAMEID();
- if (error)
- free(cp, M_NFSSTRING);
- goto out;
+ atomic_store_rel_int(&nfsrv_dnsnamelen, nidp->nid_namelen);
+ goto out;
}
/*
* malloc the new one now, so any potential sleep occurs before
* manipulation of the lists.
*/
- MALLOC(newusrp, struct nfsusrgrp *, sizeof (struct nfsusrgrp) +
- nidp->nid_namelen, M_NFSUSERGROUP, M_WAITOK);
+ newusrp = malloc(sizeof(struct nfsusrgrp) + nidp->nid_namelen,
+ M_NFSUSERGROUP, M_WAITOK | M_ZERO);
error = copyin(CAST_USER_ADDR_T(nidp->nid_name), newusrp->lug_name,
nidp->nid_namelen);
+ if (error == 0 && nidp->nid_ngroup > 0 &&
+ (nidp->nid_flag & NFSID_ADDUID) != 0) {
+ grps = malloc(sizeof(gid_t) * nidp->nid_ngroup, M_TEMP,
+ M_WAITOK);
+ error = copyin(CAST_USER_ADDR_T(nidp->nid_grps), grps,
+ sizeof(gid_t) * nidp->nid_ngroup);
+ if (error == 0) {
+ /*
+ * Create a credential just like svc_getcred(),
+ * but using the group list provided.
+ */
+ cr = crget();
+ cr->cr_uid = cr->cr_ruid = cr->cr_svuid = nidp->nid_uid;
+ crsetgroups(cr, nidp->nid_ngroup, grps);
+ cr->cr_rgid = cr->cr_svgid = cr->cr_groups[0];
+ cr->cr_prison = &prison0;
+ prison_hold(cr->cr_prison);
+#ifdef MAC
+ mac_cred_associate_nfsd(cr);
+#endif
+ newusrp->lug_cred = cr;
+ }
+ free(grps, M_TEMP);
+ }
if (error) {
- free((caddr_t)newusrp, M_NFSUSERGROUP);
+ free(newusrp, M_NFSUSERGROUP);
goto out;
}
newusrp->lug_namelen = nidp->nid_namelen;
- NFSLOCKNAMEID();
+ /*
+ * The lock order is username[0]->[nfsrv_lughashsize - 1] followed
+ * by uid[0]->[nfsrv_lughashsize - 1], with the same for group.
+ * The flags user_locked, username_locked, group_locked and
+ * groupname_locked are set to indicate all of those hash lists are
+ * locked. hp_name != NULL and hp_idnum != NULL indicates that
+ * the respective one mutex is locked.
+ */
+ user_locked = username_locked = group_locked = groupname_locked = 0;
+ hp_name = hp_idnum = NULL;
+
/*
* Delete old entries, as required.
*/
if (nidp->nid_flag & (NFSID_DELUID | NFSID_ADDUID)) {
- hp = NFSUSERHASH(nidp->nid_uid);
- LIST_FOREACH_SAFE(usrp, hp, lug_numhash, nusrp) {
+ /* Must lock all username hash lists first, to avoid a LOR. */
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsusernamehash[i].mtx);
+ username_locked = 1;
+ hp_idnum = NFSUSERHASH(nidp->nid_uid);
+ mtx_lock(&hp_idnum->mtx);
+ TAILQ_FOREACH_SAFE(usrp, &hp_idnum->lughead, lug_numhash,
+ nusrp) {
if (usrp->lug_uid == nidp->nid_uid)
- nfsrv_removeuser(usrp);
+ nfsrv_removeuser(usrp, 1);
}
- }
- if (nidp->nid_flag & (NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) {
- hp = NFSUSERNAMEHASH(newusrp->lug_name, newusrp->lug_namelen);
- LIST_FOREACH_SAFE(usrp, hp, lug_namehash, nusrp) {
+ } else if (nidp->nid_flag & (NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) {
+ hp_name = NFSUSERNAMEHASH(newusrp->lug_name,
+ newusrp->lug_namelen);
+ mtx_lock(&hp_name->mtx);
+ TAILQ_FOREACH_SAFE(usrp, &hp_name->lughead, lug_namehash,
+ nusrp) {
if (usrp->lug_namelen == newusrp->lug_namelen &&
!NFSBCMP(usrp->lug_name, newusrp->lug_name,
- usrp->lug_namelen))
- nfsrv_removeuser(usrp);
+ usrp->lug_namelen)) {
+ thp = NFSUSERHASH(usrp->lug_uid);
+ mtx_lock(&thp->mtx);
+ nfsrv_removeuser(usrp, 1);
+ mtx_unlock(&thp->mtx);
+ }
}
- }
- if (nidp->nid_flag & (NFSID_DELGID | NFSID_ADDGID)) {
- hp = NFSGROUPHASH(nidp->nid_gid);
- LIST_FOREACH_SAFE(usrp, hp, lug_numhash, nusrp) {
+ hp_idnum = NFSUSERHASH(nidp->nid_uid);
+ mtx_lock(&hp_idnum->mtx);
+ } else if (nidp->nid_flag & (NFSID_DELGID | NFSID_ADDGID)) {
+ /* Must lock all groupname hash lists first, to avoid a LOR. */
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsgroupnamehash[i].mtx);
+ groupname_locked = 1;
+ hp_idnum = NFSGROUPHASH(nidp->nid_gid);
+ mtx_lock(&hp_idnum->mtx);
+ TAILQ_FOREACH_SAFE(usrp, &hp_idnum->lughead, lug_numhash,
+ nusrp) {
if (usrp->lug_gid == nidp->nid_gid)
- nfsrv_removeuser(usrp);
+ nfsrv_removeuser(usrp, 0);
}
- }
- if (nidp->nid_flag & (NFSID_DELGROUPNAME | NFSID_ADDGROUPNAME)) {
- hp = NFSGROUPNAMEHASH(newusrp->lug_name, newusrp->lug_namelen);
- LIST_FOREACH_SAFE(usrp, hp, lug_namehash, nusrp) {
+ } else if (nidp->nid_flag & (NFSID_DELGROUPNAME | NFSID_ADDGROUPNAME)) {
+ hp_name = NFSGROUPNAMEHASH(newusrp->lug_name,
+ newusrp->lug_namelen);
+ mtx_lock(&hp_name->mtx);
+ TAILQ_FOREACH_SAFE(usrp, &hp_name->lughead, lug_namehash,
+ nusrp) {
if (usrp->lug_namelen == newusrp->lug_namelen &&
!NFSBCMP(usrp->lug_name, newusrp->lug_name,
- usrp->lug_namelen))
- nfsrv_removeuser(usrp);
+ usrp->lug_namelen)) {
+ thp = NFSGROUPHASH(usrp->lug_gid);
+ mtx_lock(&thp->mtx);
+ nfsrv_removeuser(usrp, 0);
+ mtx_unlock(&thp->mtx);
+ }
}
- }
- TAILQ_FOREACH_SAFE(usrp, &nfsuserlruhead, lug_lru, nusrp) {
- if (usrp->lug_expiry < NFSD_MONOSEC)
- nfsrv_removeuser(usrp);
- }
- while (nfsrv_usercnt >= nfsrv_usermax) {
- usrp = TAILQ_FIRST(&nfsuserlruhead);
- nfsrv_removeuser(usrp);
+ hp_idnum = NFSGROUPHASH(nidp->nid_gid);
+ mtx_lock(&hp_idnum->mtx);
}
/*
@@ -3217,23 +3388,129 @@ nfssvc_idname(struct nfsd_idargs *nidp)
newusrp->lug_expiry = NFSD_MONOSEC + 5;
if (nidp->nid_flag & (NFSID_ADDUID | NFSID_ADDUSERNAME)) {
newusrp->lug_uid = nidp->nid_uid;
- LIST_INSERT_HEAD(NFSUSERHASH(newusrp->lug_uid), newusrp,
- lug_numhash);
- LIST_INSERT_HEAD(NFSUSERNAMEHASH(newusrp->lug_name,
- newusrp->lug_namelen), newusrp, lug_namehash);
- TAILQ_INSERT_TAIL(&nfsuserlruhead, newusrp, lug_lru);
- nfsrv_usercnt++;
+ thp = NFSUSERHASH(newusrp->lug_uid);
+ mtx_assert(&thp->mtx, MA_OWNED);
+ TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_numhash);
+ thp = NFSUSERNAMEHASH(newusrp->lug_name, newusrp->lug_namelen);
+ mtx_assert(&thp->mtx, MA_OWNED);
+ TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash);
+ atomic_add_int(&nfsrv_usercnt, 1);
} else if (nidp->nid_flag & (NFSID_ADDGID | NFSID_ADDGROUPNAME)) {
newusrp->lug_gid = nidp->nid_gid;
- LIST_INSERT_HEAD(NFSGROUPHASH(newusrp->lug_gid), newusrp,
- lug_numhash);
- LIST_INSERT_HEAD(NFSGROUPNAMEHASH(newusrp->lug_name,
- newusrp->lug_namelen), newusrp, lug_namehash);
- TAILQ_INSERT_TAIL(&nfsuserlruhead, newusrp, lug_lru);
- nfsrv_usercnt++;
- } else
- FREE((caddr_t)newusrp, M_NFSUSERGROUP);
- NFSUNLOCKNAMEID();
+ thp = NFSGROUPHASH(newusrp->lug_gid);
+ mtx_assert(&thp->mtx, MA_OWNED);
+ TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_numhash);
+ thp = NFSGROUPNAMEHASH(newusrp->lug_name, newusrp->lug_namelen);
+ mtx_assert(&thp->mtx, MA_OWNED);
+ TAILQ_INSERT_TAIL(&thp->lughead, newusrp, lug_namehash);
+ atomic_add_int(&nfsrv_usercnt, 1);
+ } else {
+ if (newusrp->lug_cred != NULL)
+ crfree(newusrp->lug_cred);
+ free(newusrp, M_NFSUSERGROUP);
+ }
+
+ /*
+ * Once per second, allow one thread to trim the cache.
+ */
+ if (lasttime < NFSD_MONOSEC &&
+ atomic_cmpset_acq_int(&onethread, 0, 1) != 0) {
+ /*
+ * First, unlock the single mutexes, so that all entries
+ * can be locked and any LOR is avoided.
+ */
+ if (hp_name != NULL) {
+ mtx_unlock(&hp_name->mtx);
+ hp_name = NULL;
+ }
+ if (hp_idnum != NULL) {
+ mtx_unlock(&hp_idnum->mtx);
+ hp_idnum = NULL;
+ }
+
+ if ((nidp->nid_flag & (NFSID_DELUID | NFSID_ADDUID |
+ NFSID_DELUSERNAME | NFSID_ADDUSERNAME)) != 0) {
+ if (username_locked == 0) {
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsusernamehash[i].mtx);
+ username_locked = 1;
+ }
+ KASSERT(user_locked == 0,
+ ("nfssvc_idname: user_locked"));
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsuserhash[i].mtx);
+ user_locked = 1;
+ for (i = 0; i < nfsrv_lughashsize; i++) {
+ TAILQ_FOREACH_SAFE(usrp,
+ &nfsuserhash[i].lughead, lug_numhash,
+ nusrp)
+ if (usrp->lug_expiry < NFSD_MONOSEC)
+ nfsrv_removeuser(usrp, 1);
+ }
+ for (i = 0; i < nfsrv_lughashsize; i++) {
+ /*
+ * Trim the cache using an approximate LRU
+ * algorithm. This code deletes the least
+ * recently used entry on each hash list.
+ */
+ if (nfsrv_usercnt <= nfsrv_usermax)
+ break;
+ usrp = TAILQ_FIRST(&nfsuserhash[i].lughead);
+ if (usrp != NULL)
+ nfsrv_removeuser(usrp, 1);
+ }
+ } else {
+ if (groupname_locked == 0) {
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsgroupnamehash[i].mtx);
+ groupname_locked = 1;
+ }
+ KASSERT(group_locked == 0,
+ ("nfssvc_idname: group_locked"));
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_lock(&nfsgrouphash[i].mtx);
+ group_locked = 1;
+ for (i = 0; i < nfsrv_lughashsize; i++) {
+ TAILQ_FOREACH_SAFE(usrp,
+ &nfsgrouphash[i].lughead, lug_numhash,
+ nusrp)
+ if (usrp->lug_expiry < NFSD_MONOSEC)
+ nfsrv_removeuser(usrp, 0);
+ }
+ for (i = 0; i < nfsrv_lughashsize; i++) {
+ /*
+ * Trim the cache using an approximate LRU
+ * algorithm. This code deletes the least
+ * recently user entry on each hash list.
+ */
+ if (nfsrv_usercnt <= nfsrv_usermax)
+ break;
+ usrp = TAILQ_FIRST(&nfsgrouphash[i].lughead);
+ if (usrp != NULL)
+ nfsrv_removeuser(usrp, 0);
+ }
+ }
+ lasttime = NFSD_MONOSEC;
+ atomic_store_rel_int(&onethread, 0);
+ }
+
+ /* Now, unlock all locked mutexes. */
+ if (hp_idnum != NULL)
+ mtx_unlock(&hp_idnum->mtx);
+ if (hp_name != NULL)
+ mtx_unlock(&hp_name->mtx);
+ if (user_locked != 0)
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsuserhash[i].mtx);
+ if (username_locked != 0)
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsusernamehash[i].mtx);
+ if (group_locked != 0)
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsgrouphash[i].mtx);
+ if (groupname_locked != 0)
+ for (i = 0; i < nfsrv_lughashsize; i++)
+ mtx_unlock(&nfsgroupnamehash[i].mtx);
out:
NFSEXITCODE(error);
return (error);
@@ -3243,15 +3520,78 @@ out:
* Remove a user/group name element.
*/
static void
-nfsrv_removeuser(struct nfsusrgrp *usrp)
+nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser)
{
+ struct nfsrv_lughash *hp;
+
+ if (isuser != 0) {
+ hp = NFSUSERHASH(usrp->lug_uid);
+ mtx_assert(&hp->mtx, MA_OWNED);
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash);
+ hp = NFSUSERNAMEHASH(usrp->lug_name, usrp->lug_namelen);
+ mtx_assert(&hp->mtx, MA_OWNED);
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_namehash);
+ } else {
+ hp = NFSGROUPHASH(usrp->lug_gid);
+ mtx_assert(&hp->mtx, MA_OWNED);
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash);
+ hp = NFSGROUPNAMEHASH(usrp->lug_name, usrp->lug_namelen);
+ mtx_assert(&hp->mtx, MA_OWNED);
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_namehash);
+ }
+ atomic_add_int(&nfsrv_usercnt, -1);
+ if (usrp->lug_cred != NULL)
+ crfree(usrp->lug_cred);
+ free(usrp, M_NFSUSERGROUP);
+}
- NFSNAMEIDREQUIRED();
- LIST_REMOVE(usrp, lug_numhash);
- LIST_REMOVE(usrp, lug_namehash);
- TAILQ_REMOVE(&nfsuserlruhead, usrp, lug_lru);
- nfsrv_usercnt--;
- FREE((caddr_t)usrp, M_NFSUSERGROUP);
+/*
+ * Free up all the allocations related to the name<-->id cache.
+ * This function should only be called when the nfsuserd daemon isn't
+ * running, since it doesn't do any locking.
+ * This function is meant to be used when the nfscommon module is unloaded.
+ */
+APPLESTATIC void
+nfsrv_cleanusergroup(void)
+{
+ struct nfsrv_lughash *hp, *hp2;
+ struct nfsusrgrp *nusrp, *usrp;
+ int i;
+
+ if (nfsuserhash == NULL)
+ return;
+
+ for (i = 0; i < nfsrv_lughashsize; i++) {
+ hp = &nfsuserhash[i];
+ TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) {
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash);
+ hp2 = NFSUSERNAMEHASH(usrp->lug_name,
+ usrp->lug_namelen);
+ TAILQ_REMOVE(&hp2->lughead, usrp, lug_namehash);
+ if (usrp->lug_cred != NULL)
+ crfree(usrp->lug_cred);
+ free(usrp, M_NFSUSERGROUP);
+ }
+ hp = &nfsgrouphash[i];
+ TAILQ_FOREACH_SAFE(usrp, &hp->lughead, lug_numhash, nusrp) {
+ TAILQ_REMOVE(&hp->lughead, usrp, lug_numhash);
+ hp2 = NFSGROUPNAMEHASH(usrp->lug_name,
+ usrp->lug_namelen);
+ TAILQ_REMOVE(&hp2->lughead, usrp, lug_namehash);
+ if (usrp->lug_cred != NULL)
+ crfree(usrp->lug_cred);
+ free(usrp, M_NFSUSERGROUP);
+ }
+ mtx_destroy(&nfsuserhash[i].mtx);
+ mtx_destroy(&nfsusernamehash[i].mtx);
+ mtx_destroy(&nfsgroupnamehash[i].mtx);
+ mtx_destroy(&nfsgrouphash[i].mtx);
+ }
+ free(nfsuserhash, M_NFSUSERGROUP);
+ free(nfsusernamehash, M_NFSUSERGROUP);
+ free(nfsgrouphash, M_NFSUSERGROUP);
+ free(nfsgroupnamehash, M_NFSUSERGROUP);
+ free(nfsrv_dnsname, M_NFSSTRING);
}
/*
diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index ce77157..23475b2 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -283,6 +283,7 @@ void nfsv4_getref(struct nfsv4lock *, int *, void *, struct mount *);
int nfsv4_getref_nonblock(struct nfsv4lock *);
int nfsv4_testlock(struct nfsv4lock *);
int nfsrv_mtostr(struct nfsrv_descript *, char *, int);
+void nfsrv_cleanusergroup(void);
int nfsrv_checkutf8(u_int8_t *, int);
int newnfs_sndlock(int *);
void newnfs_sndunlock(int *);
@@ -296,6 +297,7 @@ void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *,
int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *,
int *, uint32_t *, uint8_t *);
void nfsv4_freeslot(struct nfsclsession *, int);
+struct ucred *nfsrv_getgrpscred(struct ucred *);
/* nfs_clcomsubs.c */
void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int);
diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h
index 42a7f94..59e353d 100644
--- a/sys/fs/nfs/nfsport.h
+++ b/sys/fs/nfs/nfsport.h
@@ -964,6 +964,13 @@ struct nfsreq {
#define NFSVNO_DELEGOK(v) (1)
#endif
+/*
+ * Name used by getnewvnode() to describe filesystem, "nfs".
+ * For perfomance reasons it is useful to have the same string
+ * used in both places that call getnewvnode().
+ */
+extern const char nfs_vnode_tag[];
+
#endif /* _KERNEL */
#endif /* _NFS_NFSPORT_H */
diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h
index 972fffe..6d32244 100644
--- a/sys/fs/nfs/nfsrvstate.h
+++ b/sys/fs/nfs/nfsrvstate.h
@@ -48,23 +48,22 @@ LIST_HEAD(nfssessionhashhead, nfsdsession);
/*
* List head for nfsusrgrp.
*/
-LIST_HEAD(nfsuserhashhead, nfsusrgrp);
-TAILQ_HEAD(nfsuserlruhead, nfsusrgrp);
+TAILQ_HEAD(nfsuserhashhead, nfsusrgrp);
#define NFSCLIENTHASH(id) \
(&nfsclienthash[(id).lval[1] % nfsrv_clienthashsize])
#define NFSSTATEHASH(clp, id) \
(&((clp)->lc_stateid[(id).other[2] % nfsrv_statehashsize]))
#define NFSUSERHASH(id) \
- (&nfsuserhash[(id) % NFSUSERHASHSIZE])
+ (&nfsuserhash[(id) % nfsrv_lughashsize])
#define NFSUSERNAMEHASH(p, l) \
(&nfsusernamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \
- % NFSUSERHASHSIZE])
+ % nfsrv_lughashsize])
#define NFSGROUPHASH(id) \
- (&nfsgrouphash[(id) % NFSGROUPHASHSIZE])
+ (&nfsgrouphash[(id) % nfsrv_lughashsize])
#define NFSGROUPNAMEHASH(p, l) \
(&nfsgroupnamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \
- % NFSGROUPHASHSIZE])
+ % nfsrv_lughashsize])
struct nfssessionhash {
struct mtx mtx;
@@ -264,14 +263,14 @@ struct nfslockfile {
* names.
*/
struct nfsusrgrp {
- TAILQ_ENTRY(nfsusrgrp) lug_lru; /* LRU list */
- LIST_ENTRY(nfsusrgrp) lug_numhash; /* Hash by id# */
- LIST_ENTRY(nfsusrgrp) lug_namehash; /* and by name */
+ TAILQ_ENTRY(nfsusrgrp) lug_numhash; /* Hash by id# */
+ TAILQ_ENTRY(nfsusrgrp) lug_namehash; /* and by name */
time_t lug_expiry; /* Expiry time in sec */
union {
uid_t un_uid; /* id# */
gid_t un_gid;
} lug_un;
+ struct ucred *lug_cred; /* Cred. with groups list */
int lug_namelen; /* Name length */
u_char lug_name[1]; /* malloc'd correct length */
};
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c
index b1a3451..124989a 100644
--- a/sys/fs/nfsclient/nfs_clnode.c
+++ b/sys/fs/nfsclient/nfs_clnode.c
@@ -64,6 +64,8 @@ MALLOC_DECLARE(M_NEWNFSREQ);
uma_zone_t newnfsnode_zone;
+const char nfs_vnode_tag[] = "nfs";
+
static void nfs_freesillyrename(void *arg, __unused int pending);
void
@@ -122,7 +124,7 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp,
}
np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO);
- error = getnewvnode("nfs", mntp, &newnfs_vnodeops, &nvp);
+ error = getnewvnode(nfs_vnode_tag, mntp, &newnfs_vnodeops, &nvp);
if (error) {
uma_zfree(newnfsnode_zone, np);
return (error);
@@ -330,4 +332,3 @@ ncl_invalcaches(struct vnode *vp)
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
mtx_unlock(&np->n_mtx);
}
-
diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c
index a6a2167..cdccbc8 100644
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -210,7 +210,7 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp,
}
np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO);
- error = getnewvnode("nfs", mntp, &newnfs_vnodeops, &nvp);
+ error = getnewvnode(nfs_vnode_tag, mntp, &newnfs_vnodeops, &nvp);
if (error) {
uma_zfree(newnfsnode_zone, np);
FREE((caddr_t)nfhp, M_NFSFH);
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 85b4466..edbcb35 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -2649,14 +2649,24 @@ nfsd_excred(struct nfsrv_descript *nd, struct nfsexstuff *exp,
* Fsinfo RPC. If set for anything else, this code might need
* to change.)
*/
- if (NFSVNO_EXPORTED(exp) &&
- ((!(nd->nd_flag & ND_GSS) && nd->nd_cred->cr_uid == 0) ||
- NFSVNO_EXPORTANON(exp) ||
- (nd->nd_flag & ND_AUTHNONE))) {
- nd->nd_cred->cr_uid = credanon->cr_uid;
- nd->nd_cred->cr_gid = credanon->cr_gid;
- crsetgroups(nd->nd_cred, credanon->cr_ngroups,
- credanon->cr_groups);
+ if (NFSVNO_EXPORTED(exp)) {
+ if (((nd->nd_flag & ND_GSS) == 0 && nd->nd_cred->cr_uid == 0) ||
+ NFSVNO_EXPORTANON(exp) ||
+ (nd->nd_flag & ND_AUTHNONE) != 0) {
+ nd->nd_cred->cr_uid = credanon->cr_uid;
+ nd->nd_cred->cr_gid = credanon->cr_gid;
+ crsetgroups(nd->nd_cred, credanon->cr_ngroups,
+ credanon->cr_groups);
+ } else if ((nd->nd_flag & ND_GSS) == 0) {
+ /*
+ * If using AUTH_SYS, call nfsrv_getgrpscred() to see
+ * if there is a replacement credential with a group
+ * list set up by "nfsuserd -manage-gids".
+ * If there is no replacement, nfsrv_getgrpscred()
+ * simply returns its argument.
+ */
+ nd->nd_cred = nfsrv_getgrpscred(nd->nd_cred);
+ }
}
out:
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index a948ea3..1943430 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$");
#include <dev/led/led.h>
+#include <machine/bus.h>
+
struct g_disk_softc {
struct mtx done_mtx;
struct disk *dp;
@@ -251,6 +253,145 @@ g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, int fflag, struct t
return (error);
}
+static off_t
+g_disk_maxsize(struct disk *dp, struct bio *bp)
+{
+ if (bp->bio_cmd == BIO_DELETE)
+ return (dp->d_delmaxsize);
+ return (dp->d_maxsize);
+}
+
+static int
+g_disk_maxsegs(struct disk *dp, struct bio *bp)
+{
+ return ((g_disk_maxsize(dp, bp) / PAGE_SIZE) + 1);
+}
+
+static void
+g_disk_advance(struct disk *dp, struct bio *bp, off_t off)
+{
+
+ bp->bio_offset += off;
+ bp->bio_length -= off;
+
+ if ((bp->bio_flags & BIO_VLIST) != 0) {
+ bus_dma_segment_t *seg, *end;
+
+ seg = (bus_dma_segment_t *)bp->bio_data;
+ end = (bus_dma_segment_t *)bp->bio_data + bp->bio_ma_n;
+ off += bp->bio_ma_offset;
+ while (off >= seg->ds_len) {
+ KASSERT((seg != end),
+ ("vlist request runs off the end"));
+ off -= seg->ds_len;
+ seg++;
+ }
+ bp->bio_ma_offset = off;
+ bp->bio_ma_n = end - seg;
+ bp->bio_data = (void *)seg;
+ } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
+ bp->bio_ma += off / PAGE_SIZE;
+ bp->bio_ma_offset += off;
+ bp->bio_ma_offset %= PAGE_SIZE;
+ bp->bio_ma_n -= off / PAGE_SIZE;
+ } else {
+ bp->bio_data += off;
+ }
+}
+
+static void
+g_disk_seg_limit(bus_dma_segment_t *seg, off_t *poffset,
+ off_t *plength, int *ppages)
+{
+ uintptr_t seg_page_base;
+ uintptr_t seg_page_end;
+ off_t offset;
+ off_t length;
+ int seg_pages;
+
+ offset = *poffset;
+ length = *plength;
+
+ if (length > seg->ds_len - offset)
+ length = seg->ds_len - offset;
+
+ seg_page_base = trunc_page(seg->ds_addr + offset);
+ seg_page_end = round_page(seg->ds_addr + offset + length);
+ seg_pages = (seg_page_end - seg_page_base) >> PAGE_SHIFT;
+
+ if (seg_pages > *ppages) {
+ seg_pages = *ppages;
+ length = (seg_page_base + (seg_pages << PAGE_SHIFT)) -
+ (seg->ds_addr + offset);
+ }
+
+ *poffset = 0;
+ *plength -= length;
+ *ppages -= seg_pages;
+}
+
+static off_t
+g_disk_vlist_limit(struct disk *dp, struct bio *bp, bus_dma_segment_t **pendseg)
+{
+ bus_dma_segment_t *seg, *end;
+ off_t residual;
+ off_t offset;
+ int pages;
+
+ seg = (bus_dma_segment_t *)bp->bio_data;
+ end = (bus_dma_segment_t *)bp->bio_data + bp->bio_ma_n;
+ residual = bp->bio_length;
+ offset = bp->bio_ma_offset;
+ pages = g_disk_maxsegs(dp, bp);
+ while (residual != 0 && pages != 0) {
+ KASSERT((seg != end),
+ ("vlist limit runs off the end"));
+ g_disk_seg_limit(seg, &offset, &residual, &pages);
+ seg++;
+ }
+ if (pendseg != NULL)
+ *pendseg = seg;
+ return (residual);
+}
+
+static bool
+g_disk_limit(struct disk *dp, struct bio *bp)
+{
+ bool limited = false;
+ off_t maxsz;
+
+ maxsz = g_disk_maxsize(dp, bp);
+
+ /*
+ * XXX: If we have a stripesize we should really use it here.
+ * Care should be taken in the delete case if this is done
+ * as deletes can be very sensitive to size given how they
+ * are processed.
+ */
+ if (bp->bio_length > maxsz) {
+ bp->bio_length = maxsz;
+ limited = true;
+ }
+
+ if ((bp->bio_flags & BIO_VLIST) != 0) {
+ bus_dma_segment_t *firstseg, *endseg;
+ off_t residual;
+
+ firstseg = (bus_dma_segment_t*)bp->bio_data;
+ residual = g_disk_vlist_limit(dp, bp, &endseg);
+ if (residual != 0) {
+ bp->bio_ma_n = endseg - firstseg;
+ bp->bio_length -= residual;
+ limited = true;
+ }
+ } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
+ bp->bio_ma_n =
+ howmany(bp->bio_ma_offset + bp->bio_length, PAGE_SIZE);
+ }
+
+ return (limited);
+}
+
static void
g_disk_start(struct bio *bp)
{
@@ -275,6 +416,9 @@ g_disk_start(struct bio *bp)
/* fall-through */
case BIO_READ:
case BIO_WRITE:
+ KASSERT((dp->d_flags & DISKFLAG_UNMAPPED_BIO) != 0 ||
+ (bp->bio_flags & BIO_UNMAPPED) == 0,
+ ("unmapped bio not supported by disk %s", dp->d_name));
off = 0;
bp3 = NULL;
bp2 = g_clone_bio(bp);
@@ -282,39 +426,10 @@ g_disk_start(struct bio *bp)
error = ENOMEM;
break;
}
- do {
- off_t d_maxsize;
-
- d_maxsize = (bp->bio_cmd == BIO_DELETE) ?
- dp->d_delmaxsize : dp->d_maxsize;
- bp2->bio_offset += off;
- bp2->bio_length -= off;
- if ((bp->bio_flags & BIO_UNMAPPED) == 0) {
- bp2->bio_data += off;
- } else {
- KASSERT((dp->d_flags & DISKFLAG_UNMAPPED_BIO)
- != 0,
- ("unmapped bio not supported by disk %s",
- dp->d_name));
- bp2->bio_ma += off / PAGE_SIZE;
- bp2->bio_ma_offset += off;
- bp2->bio_ma_offset %= PAGE_SIZE;
- bp2->bio_ma_n -= off / PAGE_SIZE;
- }
- if (bp2->bio_length > d_maxsize) {
- /*
- * XXX: If we have a stripesize we should really
- * use it here. Care should be taken in the delete
- * case if this is done as deletes can be very
- * sensitive to size given how they are processed.
- */
- bp2->bio_length = d_maxsize;
- if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
- bp2->bio_ma_n = howmany(
- bp2->bio_ma_offset +
- bp2->bio_length, PAGE_SIZE);
- }
- off += d_maxsize;
+ for (;;) {
+ if (g_disk_limit(dp, bp2)) {
+ off += bp2->bio_length;
+
/*
* To avoid a race, we need to grab the next bio
* before we schedule this one. See "notes".
@@ -331,9 +446,14 @@ g_disk_start(struct bio *bp)
devstat_start_transaction_bio(dp->d_devstat, bp2);
mtx_unlock(&sc->start_mtx);
dp->d_strategy(bp2);
+
+ if (bp3 == NULL)
+ break;
+
bp2 = bp3;
bp3 = NULL;
- } while (bp2 != NULL);
+ g_disk_advance(dp, bp2, off);
+ }
break;
case BIO_GETATTR:
/* Give the driver a chance to override */
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index f1edc70..9dff151 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -205,11 +205,12 @@ g_clone_bio(struct bio *bp)
/*
* BIO_ORDERED flag may be used by disk drivers to enforce
* ordering restrictions, so this flag needs to be cloned.
- * BIO_UNMAPPED should be inherited, to properly indicate
- * which way the buffer is passed.
+ * BIO_UNMAPPED and BIO_VLIST should be inherited, to properly
+ * indicate which way the buffer is passed.
* Other bio flags are not suitable for cloning.
*/
- bp2->bio_flags = bp->bio_flags & (BIO_ORDERED | BIO_UNMAPPED);
+ bp2->bio_flags = bp->bio_flags &
+ (BIO_ORDERED | BIO_UNMAPPED | BIO_VLIST);
bp2->bio_length = bp->bio_length;
bp2->bio_offset = bp->bio_offset;
bp2->bio_data = bp->bio_data;
@@ -240,7 +241,7 @@ g_duplicate_bio(struct bio *bp)
struct bio *bp2;
bp2 = uma_zalloc(biozone, M_WAITOK | M_ZERO);
- bp2->bio_flags = bp->bio_flags & BIO_UNMAPPED;
+ bp2->bio_flags = bp->bio_flags & (BIO_UNMAPPED | BIO_VLIST);
bp2->bio_parent = bp;
bp2->bio_cmd = bp->bio_cmd;
bp2->bio_length = bp->bio_length;
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
index ca57521..e23906d 100644
--- a/sys/i386/conf/GENERIC
+++ b/sys/i386/conf/GENERIC
@@ -30,7 +30,7 @@ options SCHED_ULE # ULE scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
-options IPSEC # IP (v4/v6) security
+options IPSEC # IP (v4/v6) security
options TCP_OFFLOAD # TCP offload
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index 8ee5219..5d8eaa3 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -989,7 +989,7 @@ options NKPT=31
# ABI Emulation
# Enable iBCS2 runtime support for SCO and ISC binaries
-options IBCS2
+#options IBCS2
# Emulate spx device for client side of SVR3 local X interface
options SPX_HACK
diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c
index 376dd0b..b11cb03 100644
--- a/sys/i386/i386/elf_machdep.c
+++ b/sys/i386/i386/elf_machdep.c
@@ -57,8 +57,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -66,7 +64,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode,
.sv_szsigcode = &szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF32",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index b219d9d..894244c 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -691,10 +691,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
/* Align to 16 bytes. */
sfp = (struct sigframe *)((unsigned int)sp & ~0xF);
- /* Translate the signal if appropriate. */
- if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize)
- sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)];
-
/* Build the argument list for the signal handler. */
sf.sf_signum = sig;
sf.sf_ucontext = (register_t)&sfp->sf_uc;
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 9b8b9c9..379eb6d 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -132,11 +132,6 @@ __FBSDID("$FreeBSD$");
extern struct pcpu __pcpu[];
-/* Variables needed for SMP tlb shootdown. */
-vm_offset_t smp_tlb_addr1;
-vm_offset_t smp_tlb_addr2;
-volatile int smp_tlb_wait;
-
/*
* Local data and functions.
*/
@@ -487,201 +482,3 @@ start_ap(int apic_id)
}
return 0; /* return FAILURE */
}
-
-/*
- * Flush the TLB on all other CPU's
- */
-static void
-smp_tlb_shootdown(u_int vector, vm_offset_t addr1, vm_offset_t addr2)
-{
- u_int ncpu;
-
- ncpu = mp_ncpus - 1; /* does not shootdown self */
- if (ncpu < 1)
- return; /* no other cpus */
- if (!(read_eflags() & PSL_I))
- panic("%s: interrupts disabled", __func__);
- mtx_lock_spin(&smp_ipi_mtx);
- smp_tlb_addr1 = addr1;
- smp_tlb_addr2 = addr2;
- smp_tlb_wait = 0;
- ipi_all_but_self(vector);
- while (smp_tlb_wait < ncpu)
- ia32_pause();
- mtx_unlock_spin(&smp_ipi_mtx);
-}
-
-static void
-smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2)
-{
- int cpu, ncpu, othercpus;
-
- othercpus = mp_ncpus - 1;
- if (CPU_ISFULLSET(&mask)) {
- if (othercpus < 1)
- return;
- } else {
- CPU_CLR(PCPU_GET(cpuid), &mask);
- if (CPU_EMPTY(&mask))
- return;
- }
- if (!(read_eflags() & PSL_I))
- panic("%s: interrupts disabled", __func__);
- mtx_lock_spin(&smp_ipi_mtx);
- smp_tlb_addr1 = addr1;
- smp_tlb_addr2 = addr2;
- atomic_store_rel_int(&smp_tlb_wait, 0);
- if (CPU_ISFULLSET(&mask)) {
- ncpu = othercpus;
- ipi_all_but_self(vector);
- } else {
- ncpu = 0;
- while ((cpu = CPU_FFS(&mask)) != 0) {
- cpu--;
- CPU_CLR(cpu, &mask);
- CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu,
- vector);
- ipi_send_cpu(cpu, vector);
- ncpu++;
- }
- }
- while (smp_tlb_wait < ncpu)
- ia32_pause();
- mtx_unlock_spin(&smp_ipi_mtx);
-}
-
-void
-smp_invltlb(void)
-{
-
- if (smp_started) {
- smp_tlb_shootdown(IPI_INVLTLB, 0, 0);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_global++;
-#endif
- }
-}
-
-void
-smp_invlpg(vm_offset_t addr)
-{
-
- if (smp_started) {
- smp_tlb_shootdown(IPI_INVLPG, addr, 0);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_page++;
-#endif
- }
-}
-
-void
-smp_invlpg_range(vm_offset_t addr1, vm_offset_t addr2)
-{
-
- if (smp_started) {
- smp_tlb_shootdown(IPI_INVLRNG, addr1, addr2);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_range++;
- ipi_range_size += (addr2 - addr1) / PAGE_SIZE;
-#endif
- }
-}
-
-void
-smp_masked_invltlb(cpuset_t mask)
-{
-
- if (smp_started) {
- smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, 0, 0);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_masked_global++;
-#endif
- }
-}
-
-void
-smp_masked_invlpg(cpuset_t mask, vm_offset_t addr)
-{
-
- if (smp_started) {
- smp_targeted_tlb_shootdown(mask, IPI_INVLPG, addr, 0);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_masked_page++;
-#endif
- }
-}
-
-void
-smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2)
-{
-
- if (smp_started) {
- smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, addr1, addr2);
-#ifdef COUNT_XINVLTLB_HITS
- ipi_masked_range++;
- ipi_masked_range_size += (addr2 - addr1) / PAGE_SIZE;
-#endif
- }
-}
-
-void
-smp_cache_flush(void)
-{
-
- if (smp_started)
- smp_tlb_shootdown(IPI_INVLCACHE, 0, 0);
-}
-
-/*
- * Handlers for TLB related IPIs
- */
-void
-invltlb_handler(void)
-{
- uint64_t cr3;
-#ifdef COUNT_XINVLTLB_HITS
- xhits_gbl[PCPU_GET(cpuid)]++;
-#endif /* COUNT_XINVLTLB_HITS */
-#ifdef COUNT_IPIS
- (*ipi_invltlb_counts[PCPU_GET(cpuid)])++;
-#endif /* COUNT_IPIS */
-
- cr3 = rcr3();
- load_cr3(cr3);
- atomic_add_int(&smp_tlb_wait, 1);
-}
-
-void
-invlpg_handler(void)
-{
-#ifdef COUNT_XINVLTLB_HITS
- xhits_pg[PCPU_GET(cpuid)]++;
-#endif /* COUNT_XINVLTLB_HITS */
-#ifdef COUNT_IPIS
- (*ipi_invlpg_counts[PCPU_GET(cpuid)])++;
-#endif /* COUNT_IPIS */
-
- invlpg(smp_tlb_addr1);
-
- atomic_add_int(&smp_tlb_wait, 1);
-}
-
-void
-invlrng_handler(void)
-{
- vm_offset_t addr;
-#ifdef COUNT_XINVLTLB_HITS
- xhits_rng[PCPU_GET(cpuid)]++;
-#endif /* COUNT_XINVLTLB_HITS */
-#ifdef COUNT_IPIS
- (*ipi_invlrng_counts[PCPU_GET(cpuid)])++;
-#endif /* COUNT_IPIS */
-
- addr = smp_tlb_addr1;
- do {
- invlpg(addr);
- addr += PAGE_SIZE;
- } while (addr < smp_tlb_addr2);
-
- atomic_add_int(&smp_tlb_wait, 1);
-}
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 5b69d58..5ae41a3 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -655,7 +655,7 @@ pmap_set_pg(void)
va = KERNBASE + KERNLOAD;
while (va < endva) {
pdir_pde(PTD, va) |= pgeflag;
- invltlb(); /* Play it safe, invltlb() every time */
+ invltlb(); /* Flush non-PG_G entries. */
va += NBPDR;
}
} else {
@@ -664,7 +664,7 @@ pmap_set_pg(void)
pte = vtopte(va);
if (*pte)
*pte |= pgeflag;
- invltlb(); /* Play it safe, invltlb() every time */
+ invltlb(); /* Flush non-PG_G entries. */
va += PAGE_SIZE;
}
}
@@ -973,6 +973,22 @@ pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde)
load_cr4(cr4 | CR4_PGE);
}
}
+
+void
+invltlb_glob(void)
+{
+ uint64_t cr4;
+
+ if (pgeflag == 0) {
+ invltlb();
+ } else {
+ cr4 = rcr4();
+ load_cr4(cr4 & ~CR4_PGE);
+ load_cr4(cr4 | CR4_PGE);
+ }
+}
+
+
#ifdef SMP
/*
* For SMP, these functions have to use the IPI mechanism for coherence.
@@ -996,13 +1012,13 @@ pmap_update_pde_invalidate(vm_offset_t va, pd_entry_t newpde)
void
pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
{
- cpuset_t other_cpus;
+ cpuset_t *mask, other_cpus;
u_int cpuid;
sched_pin();
if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
invlpg(va);
- smp_invlpg(va);
+ mask = &all_cpus;
} else {
cpuid = PCPU_GET(cpuid);
other_cpus = all_cpus;
@@ -1010,16 +1026,16 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
if (CPU_ISSET(cpuid, &pmap->pm_active))
invlpg(va);
CPU_AND(&other_cpus, &pmap->pm_active);
- if (!CPU_EMPTY(&other_cpus))
- smp_masked_invlpg(other_cpus, va);
+ mask = &other_cpus;
}
+ smp_masked_invlpg(*mask, va);
sched_unpin();
}
void
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
{
- cpuset_t other_cpus;
+ cpuset_t *mask, other_cpus;
vm_offset_t addr;
u_int cpuid;
@@ -1027,7 +1043,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
- smp_invlpg_range(sva, eva);
+ mask = &all_cpus;
} else {
cpuid = PCPU_GET(cpuid);
other_cpus = all_cpus;
@@ -1036,22 +1052,25 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
for (addr = sva; addr < eva; addr += PAGE_SIZE)
invlpg(addr);
CPU_AND(&other_cpus, &pmap->pm_active);
- if (!CPU_EMPTY(&other_cpus))
- smp_masked_invlpg_range(other_cpus, sva, eva);
+ mask = &other_cpus;
}
+ smp_masked_invlpg_range(*mask, sva, eva);
sched_unpin();
}
void
pmap_invalidate_all(pmap_t pmap)
{
- cpuset_t other_cpus;
+ cpuset_t *mask, other_cpus;
u_int cpuid;
sched_pin();
- if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) {
+ if (pmap == kernel_pmap) {
+ invltlb_glob();
+ mask = &all_cpus;
+ } else if (!CPU_CMP(&pmap->pm_active, &all_cpus)) {
invltlb();
- smp_invltlb();
+ mask = &all_cpus;
} else {
cpuid = PCPU_GET(cpuid);
other_cpus = all_cpus;
@@ -1059,9 +1078,9 @@ pmap_invalidate_all(pmap_t pmap)
if (CPU_ISSET(cpuid, &pmap->pm_active))
invltlb();
CPU_AND(&other_cpus, &pmap->pm_active);
- if (!CPU_EMPTY(&other_cpus))
- smp_masked_invltlb(other_cpus);
+ mask = &other_cpus;
}
+ smp_masked_invltlb(*mask, pmap);
sched_unpin();
}
@@ -1193,7 +1212,9 @@ PMAP_INLINE void
pmap_invalidate_all(pmap_t pmap)
{
- if (pmap == kernel_pmap || !CPU_EMPTY(&pmap->pm_active))
+ if (pmap == kernel_pmap)
+ invltlb_glob();
+ else if (!CPU_EMPTY(&pmap->pm_active))
invltlb();
}
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index 76822b1..f2d8c58 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -394,6 +394,8 @@ void pmap_invalidate_cache_pages(vm_page_t *pages, int count);
void pmap_invalidate_cache_range(vm_offset_t sva, vm_offset_t eva,
boolean_t force);
+void invltlb_glob(void);
+
#endif /* _KERNEL */
#endif /* !LOCORE */
diff --git a/sys/i386/include/smp.h b/sys/i386/include/smp.h
index 4618419..5948c25 100644
--- a/sys/i386/include/smp.h
+++ b/sys/i386/include/smp.h
@@ -53,10 +53,6 @@ extern u_int ipi_global;
extern u_int ipi_page;
extern u_int ipi_range;
extern u_int ipi_range_size;
-extern u_int ipi_masked_global;
-extern u_int ipi_masked_page;
-extern u_int ipi_masked_range;
-extern u_int ipi_masked_range_size;
struct cpu_info {
int cpu_present:1;
@@ -105,13 +101,10 @@ void ipi_selected(cpuset_t cpus, u_int ipi);
u_int mp_bootaddress(u_int);
void set_interrupt_apic_ids(void);
void smp_cache_flush(void);
-void smp_invlpg(vm_offset_t addr);
void smp_masked_invlpg(cpuset_t mask, vm_offset_t addr);
-void smp_invlpg_range(vm_offset_t startva, vm_offset_t endva);
void smp_masked_invlpg_range(cpuset_t mask, vm_offset_t startva,
vm_offset_t endva);
-void smp_invltlb(void);
-void smp_masked_invltlb(cpuset_t mask);
+void smp_masked_invltlb(cpuset_t mask, struct pmap *pmap);
void mem_range_AP_init(void);
void topo_probe(void);
void ipi_send_cpu(int cpu, u_int ipi);
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 7c980ce..2a8b7d2 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -956,8 +956,6 @@ struct sysentvec linux_sysvec = {
.sv_size = LINUX_SYS_MAXSYSCALL,
.sv_table = linux_sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = ELAST + 1,
.sv_errtbl = bsd_to_linux_errno,
.sv_transtrap = translate_traps,
@@ -965,7 +963,6 @@ struct sysentvec linux_sysvec = {
.sv_sendsig = linux_sendsig,
.sv_sigcode = &_binary_linux_locore_o_start,
.sv_szsigcode = &linux_szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "Linux a.out",
.sv_coredump = NULL,
.sv_imgact_try = exec_linux_imgact_try,
@@ -995,8 +992,6 @@ struct sysentvec elf_linux_sysvec = {
.sv_size = LINUX_SYS_MAXSYSCALL,
.sv_table = linux_sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = ELAST + 1,
.sv_errtbl = bsd_to_linux_errno,
.sv_transtrap = translate_traps,
@@ -1004,7 +999,6 @@ struct sysentvec elf_linux_sysvec = {
.sv_sendsig = linux_sendsig,
.sv_sigcode = &_binary_linux_locore_o_start,
.sv_szsigcode = &linux_szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "Linux ELF",
.sv_coredump = elf32_coredump,
.sv_imgact_try = exec_linux_imgact_try,
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 3165ac0..a7db17e 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -70,8 +70,6 @@ struct sysentvec aout_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -79,7 +77,6 @@ struct sysentvec aout_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode,
.sv_szsigcode = &szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD a.out",
.sv_coredump = NULL,
.sv_imgact_try = NULL,
@@ -116,8 +113,6 @@ struct sysentvec aout_sysvec = {
.sv_size = FREEBSD32_SYS_MAXSYSCALL,
.sv_table = freebsd32_sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -125,7 +120,6 @@ struct sysentvec aout_sysvec = {
.sv_sendsig = ia32_sendsig,
.sv_sigcode = ia32_sigcode,
.sv_szsigcode = &sz_ia32_sigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD a.out",
.sv_coredump = NULL,
.sv_imgact_try = NULL,
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 90b7895..7fe36cf 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -273,6 +273,9 @@ __elfN(get_brandinfo)(struct image_params *imgp, const char *interp,
if (hdr->e_machine == bi->machine && (bi->flags &
(BI_BRAND_NOTE|BI_BRAND_NOTE_MANDATORY)) != 0) {
ret = __elfN(check_note)(imgp, bi->brand_note, osrel);
+ /* Give brand a chance to veto check_note's guess */
+ if (ret && bi->header_supported)
+ ret = bi->header_supported(imgp);
if (ret)
return (bi);
}
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index d24827d..f0cd3c8 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -387,8 +387,6 @@ struct sysentvec null_sysvec = {
.sv_size = 0,
.sv_table = NULL,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -396,7 +394,6 @@ struct sysentvec null_sysvec = {
.sv_sendsig = NULL,
.sv_sigcode = NULL,
.sv_szsigcode = NULL,
- .sv_prepsyscall = NULL,
.sv_name = "null",
.sv_coredump = NULL,
.sv_imgact_try = NULL,
diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
index a16d8c8..ae30276 100644
--- a/sys/kern/subr_bus_dma.c
+++ b/sys/kern/subr_bus_dma.c
@@ -54,19 +54,32 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
/*
- * Load a list of virtual addresses.
+ * Load up data starting at offset within a region specified by a
+ * list of virtual address ranges until either length or the region
+ * are exhausted.
*/
static int
_bus_dmamap_load_vlist(bus_dma_tag_t dmat, bus_dmamap_t map,
bus_dma_segment_t *list, int sglist_cnt, struct pmap *pmap, int *nsegs,
- int flags)
+ int flags, size_t offset, size_t length)
{
int error;
error = 0;
- for (; sglist_cnt > 0; sglist_cnt--, list++) {
- error = _bus_dmamap_load_buffer(dmat, map,
- (void *)(uintptr_t)list->ds_addr, list->ds_len, pmap,
+ for (; sglist_cnt > 0 && length != 0; sglist_cnt--, list++) {
+ char *addr;
+ size_t ds_len;
+
+ KASSERT((offset < list->ds_len),
+ ("Invalid mid-segment offset"));
+ addr = (char *)(uintptr_t)list->ds_addr + offset;
+ ds_len = list->ds_len - offset;
+ offset = 0;
+ if (ds_len > length)
+ ds_len = length;
+ length -= ds_len;
+ KASSERT((ds_len != 0), ("Segment length is zero"));
+ error = _bus_dmamap_load_buffer(dmat, map, addr, ds_len, pmap,
flags, NULL, nsegs);
if (error)
break;
@@ -118,22 +131,48 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
}
/*
+ * Load tlen data starting at offset within a region specified by a list of
+ * physical pages.
+ */
+static int
+_bus_dmamap_load_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
+ vm_page_t *pages, bus_size_t tlen, int offset, int *nsegs, int flags)
+{
+ vm_paddr_t paddr;
+ bus_size_t len;
+ int error, i;
+
+ for (i = 0, error = 0; error == 0 && tlen > 0; i++, tlen -= len) {
+ len = min(PAGE_SIZE - offset, tlen);
+ paddr = VM_PAGE_TO_PHYS(pages[i]) + offset;
+ error = _bus_dmamap_load_phys(dmat, map, paddr, len,
+ flags, NULL, nsegs);
+ offset = 0;
+ }
+ return (error);
+}
+
+/*
* Load from block io.
*/
static int
_bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio,
int *nsegs, int flags)
{
- int error;
- if ((bio->bio_flags & BIO_UNMAPPED) == 0) {
- error = _bus_dmamap_load_buffer(dmat, map, bio->bio_data,
- bio->bio_bcount, kernel_pmap, flags, NULL, nsegs);
- } else {
- error = _bus_dmamap_load_ma(dmat, map, bio->bio_ma,
- bio->bio_bcount, bio->bio_ma_offset, flags, NULL, nsegs);
+ if ((bio->bio_flags & BIO_VLIST) != 0) {
+ bus_dma_segment_t *segs = (bus_dma_segment_t *)bio->bio_data;
+ return (_bus_dmamap_load_vlist(dmat, map, segs, bio->bio_ma_n,
+ kernel_pmap, nsegs, flags, bio->bio_ma_offset,
+ bio->bio_bcount));
}
- return (error);
+
+ if ((bio->bio_flags & BIO_UNMAPPED) != 0)
+ return (_bus_dmamap_load_pages(dmat, map, bio->bio_ma,
+ bio->bio_bcount, bio->bio_ma_offset, nsegs, flags));
+
+ return (_bus_dmamap_load_buffer(dmat, map, bio->bio_data,
+ bio->bio_bcount, kernel_pmap, flags, NULL, nsegs));
}
int
@@ -219,7 +258,7 @@ _bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,
case CAM_DATA_SG:
error = _bus_dmamap_load_vlist(dmat, map,
(bus_dma_segment_t *)data_ptr, sglist_cnt, kernel_pmap,
- nsegs, flags);
+ nsegs, flags, 0, dxfer_len);
break;
case CAM_DATA_SG_PADDR:
error = _bus_dmamap_load_plist(dmat, map,
@@ -494,7 +533,7 @@ bus_dmamap_load_mem(bus_dma_tag_t dmat, bus_dmamap_t map,
break;
case MEMDESC_VLIST:
error = _bus_dmamap_load_vlist(dmat, map, mem->u.md_list,
- mem->md_opaque, kernel_pmap, &nsegs, flags);
+ mem->md_opaque, kernel_pmap, &nsegs, flags, 0, SIZE_T_MAX);
break;
case MEMDESC_PLIST:
error = _bus_dmamap_load_plist(dmat, map, mem->u.md_list,
diff --git a/sys/kern/subr_capability.c b/sys/kern/subr_capability.c
index f3daa5e..683ca0d 100644
--- a/sys/kern/subr_capability.c
+++ b/sys/kern/subr_capability.c
@@ -157,7 +157,6 @@ __cap_rights_init(int version, cap_rights_t *rights, ...)
n = version + 2;
assert(n >= CAPARSIZE_MIN && n <= CAPARSIZE_MAX);
- memset(rights->cr_rights, 0, sizeof(rights->cr_rights[0]) * n);
CAP_NONE(rights);
va_start(ap, rights);
cap_rights_vset(rights, ap);
diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c
index aac6eb6..ec64b91 100644
--- a/sys/kern/subr_uio.c
+++ b/sys/kern/subr_uio.c
@@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_pageout.h>
#include <vm/vm_map.h>
+#include <machine/bus.h>
+
SYSCTL_INT(_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, UIO_MAXIOV,
"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)");
@@ -136,6 +138,58 @@ physcopyout(vm_paddr_t src, void *dst, size_t len)
#undef PHYS_PAGE_COUNT
int
+physcopyin_vlist(bus_dma_segment_t *src, off_t offset, vm_paddr_t dst,
+ size_t len)
+{
+ size_t seg_len;
+ int error;
+
+ error = 0;
+ while (offset >= src->ds_len) {
+ offset -= src->ds_len;
+ src++;
+ }
+
+ while (len > 0 && error == 0) {
+ seg_len = MIN(src->ds_len - offset, len);
+ error = physcopyin((void *)(uintptr_t)(src->ds_addr + offset),
+ dst, seg_len);
+ offset = 0;
+ src++;
+ len -= seg_len;
+ dst += seg_len;
+ }
+
+ return (error);
+}
+
+int
+physcopyout_vlist(vm_paddr_t src, bus_dma_segment_t *dst, off_t offset,
+ size_t len)
+{
+ size_t seg_len;
+ int error;
+
+ error = 0;
+ while (offset >= dst->ds_len) {
+ offset -= dst->ds_len;
+ dst++;
+ }
+
+ while (len > 0 && error == 0) {
+ seg_len = MIN(dst->ds_len - offset, len);
+ error = physcopyout(src, (void *)(uintptr_t)(dst->ds_addr +
+ offset), seg_len);
+ offset = 0;
+ dst++;
+ len -= seg_len;
+ src += seg_len;
+ }
+
+ return (error);
+}
+
+int
uiomove(void *cp, int n, struct uio *uio)
{
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 9d0a227..2ec5bc1 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -346,6 +346,66 @@ PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free);
#ifndef MAXVNODES_MAX
#define MAXVNODES_MAX (512 * 1024 * 1024 / 64) /* 8M */
#endif
+
+/*
+ * Initialize a vnode as it first enters the zone.
+ */
+static int
+vnode_init(void *mem, int size, int flags)
+{
+ struct vnode *vp;
+ struct bufobj *bo;
+
+ vp = mem;
+ bzero(vp, size);
+ /*
+ * Setup locks.
+ */
+ vp->v_vnlock = &vp->v_lock;
+ mtx_init(&vp->v_interlock, "vnode interlock", NULL, MTX_DEF);
+ /*
+ * By default, don't allow shared locks unless filesystems opt-in.
+ */
+ lockinit(vp->v_vnlock, PVFS, "vnode", VLKTIMEOUT,
+ LK_NOSHARE | LK_IS_VNODE);
+ /*
+ * Initialize bufobj.
+ */
+ bo = &vp->v_bufobj;
+ bo->__bo_vnode = vp;
+ rw_init(BO_LOCKPTR(bo), "bufobj interlock");
+ bo->bo_private = vp;
+ TAILQ_INIT(&bo->bo_clean.bv_hd);
+ TAILQ_INIT(&bo->bo_dirty.bv_hd);
+ /*
+ * Initialize namecache.
+ */
+ LIST_INIT(&vp->v_cache_src);
+ TAILQ_INIT(&vp->v_cache_dst);
+ /*
+ * Initialize rangelocks.
+ */
+ rangelock_init(&vp->v_rl);
+ return (0);
+}
+
+/*
+ * Free a vnode when it is cleared from the zone.
+ */
+static void
+vnode_fini(void *mem, int size)
+{
+ struct vnode *vp;
+ struct bufobj *bo;
+
+ vp = mem;
+ rangelock_destroy(&vp->v_rl);
+ lockdestroy(vp->v_vnlock);
+ mtx_destroy(&vp->v_interlock);
+ bo = &vp->v_bufobj;
+ rw_destroy(BO_LOCKPTR(bo));
+}
+
static void
vntblinit(void *dummy __unused)
{
@@ -379,7 +439,7 @@ vntblinit(void *dummy __unused)
TAILQ_INIT(&vnode_free_list);
mtx_init(&vnode_free_list_mtx, "vnode_free_list", NULL, MTX_DEF);
vnode_zone = uma_zcreate("VNODE", sizeof (struct vnode), NULL, NULL,
- NULL, NULL, UMA_ALIGN_PTR, 0);
+ vnode_init, vnode_fini, UMA_ALIGN_PTR, 0);
vnodepoll_zone = uma_zcreate("VNODEPOLL", sizeof (struct vpollinfo),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
/*
@@ -1223,8 +1283,8 @@ getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops,
struct vnode **vpp)
{
struct vnode *vp;
- struct bufobj *bo;
struct thread *td;
+ struct lock_object *lo;
static int cyclecount;
int error;
@@ -1271,40 +1331,42 @@ getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops,
mtx_unlock(&vnode_free_list_mtx);
alloc:
atomic_add_long(&vnodes_created, 1);
- vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO);
+ vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK);
/*
- * Setup locks.
- */
- vp->v_vnlock = &vp->v_lock;
- mtx_init(&vp->v_interlock, "vnode interlock", NULL, MTX_DEF);
- /*
- * By default, don't allow shared locks unless filesystems
- * opt-in.
- */
- lockinit(vp->v_vnlock, PVFS, tag, VLKTIMEOUT, LK_NOSHARE | LK_IS_VNODE);
- /*
- * Initialize bufobj.
+ * Locks are given the generic name "vnode" when created.
+ * Follow the historic practice of using the filesystem
+ * name when they allocated, e.g., "zfs", "ufs", "nfs, etc.
+ *
+ * Locks live in a witness group keyed on their name. Thus,
+ * when a lock is renamed, it must also move from the witness
+ * group of its old name to the witness group of its new name.
+ *
+ * The change only needs to be made when the vnode moves
+ * from one filesystem type to another. We ensure that each
+ * filesystem use a single static name pointer for its tag so
+ * that we can compare pointers rather than doing a strcmp().
*/
- bo = &vp->v_bufobj;
- bo->__bo_vnode = vp;
- rw_init(BO_LOCKPTR(bo), "bufobj interlock");
- bo->bo_ops = &buf_ops_bio;
- bo->bo_private = vp;
- TAILQ_INIT(&bo->bo_clean.bv_hd);
- TAILQ_INIT(&bo->bo_dirty.bv_hd);
+ lo = &vp->v_vnlock->lock_object;
+ if (lo->lo_name != tag) {
+ lo->lo_name = tag;
+ WITNESS_DESTROY(lo);
+ WITNESS_INIT(lo, tag);
+ }
/*
- * Initialize namecache.
+ * By default, don't allow shared locks unless filesystems opt-in.
*/
- LIST_INIT(&vp->v_cache_src);
- TAILQ_INIT(&vp->v_cache_dst);
+ vp->v_vnlock->lock_object.lo_flags |= LK_NOSHARE;
/*
* Finalize various vnode identity bits.
*/
+ KASSERT(vp->v_object == NULL, ("stale v_object %p", vp));
+ KASSERT(vp->v_lockf == NULL, ("stale v_lockf %p", vp));
+ KASSERT(vp->v_pollinfo == NULL, ("stale v_pollinfo %p", vp));
vp->v_type = VNON;
vp->v_tag = tag;
vp->v_op = vops;
v_init_counters(vp);
- vp->v_data = NULL;
+ vp->v_bufobj.bo_ops = &buf_ops_bio;
#ifdef MAC
mac_vnode_init(vp);
if (mp != NULL && (mp->mnt_flag & MNT_MULTILABEL) == 0)
@@ -1313,11 +1375,10 @@ alloc:
printf("NULL mp in getnewvnode()\n");
#endif
if (mp != NULL) {
- bo->bo_bsize = mp->mnt_stat.f_iosize;
+ vp->v_bufobj.bo_bsize = mp->mnt_stat.f_iosize;
if ((mp->mnt_kern_flag & MNTK_NOKNOTE) != 0)
vp->v_vflag |= VV_NOKNOTE;
}
- rangelock_init(&vp->v_rl);
/*
* For the filesystems which do not use vfs_hash_insert(),
@@ -2601,7 +2662,7 @@ _vhold(struct vnode *vp, bool locked)
mtx_lock(&vnode_free_list_mtx);
TAILQ_REMOVE(&vnode_free_list, vp, v_actfreelist);
freevnodes--;
- vp->v_iflag &= ~(VI_FREE|VI_AGE);
+ vp->v_iflag &= ~VI_FREE;
KASSERT((vp->v_iflag & VI_ACTIVE) == 0,
("Activating already active vnode"));
vp->v_iflag |= VI_ACTIVE;
@@ -2618,6 +2679,10 @@ _vhold(struct vnode *vp, bool locked)
* Drop the hold count of the vnode. If this is the last reference to
* the vnode we place it on the free list unless it has been vgone'd
* (marked VI_DOOMED) in which case we will free it.
+ *
+ * Because the vnode vm object keeps a hold reference on the vnode if
+ * there is at least one resident non-cached page, the vnode cannot
+ * leave the active list without the page cleanup done.
*/
void
_vdrop(struct vnode *vp, bool locked)
@@ -2666,16 +2731,9 @@ _vdrop(struct vnode *vp, bool locked)
v_actfreelist);
mp->mnt_activevnodelistsize--;
}
- /* XXX V*AGE hasn't been set since 1997. */
- if (vp->v_iflag & VI_AGE) {
- TAILQ_INSERT_HEAD(&vnode_free_list, vp,
- v_actfreelist);
- } else {
- TAILQ_INSERT_TAIL(&vnode_free_list, vp,
- v_actfreelist);
- }
+ TAILQ_INSERT_TAIL(&vnode_free_list, vp,
+ v_actfreelist);
freevnodes++;
- vp->v_iflag &= ~VI_AGE;
vp->v_iflag |= VI_FREE;
mtx_unlock(&vnode_free_list_mtx);
} else {
@@ -2686,6 +2744,12 @@ _vdrop(struct vnode *vp, bool locked)
}
/*
* The vnode has been marked for destruction, so free it.
+ *
+ * The vnode will be returned to the zone where it will
+ * normally remain until it is needed for another vnode. We
+ * need to cleanup (or verify that the cleanup has already
+ * been done) any residual data left from its current use
+ * so as not to contaminate the freshly allocated vnode.
*/
CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp);
atomic_subtract_long(&numvnodes, 1);
@@ -2706,20 +2770,25 @@ _vdrop(struct vnode *vp, bool locked)
VNASSERT(TAILQ_EMPTY(&vp->v_cache_dst), vp, ("vp has namecache dst"));
VNASSERT(LIST_EMPTY(&vp->v_cache_src), vp, ("vp has namecache src"));
VNASSERT(vp->v_cache_dd == NULL, vp, ("vp has namecache for .."));
+ VNASSERT(TAILQ_EMPTY(&vp->v_rl.rl_waiters), vp,
+ ("Dangling rangelock waiters"));
VI_UNLOCK(vp);
#ifdef MAC
mac_vnode_destroy(vp);
#endif
- if (vp->v_pollinfo != NULL)
+ if (vp->v_pollinfo != NULL) {
destroy_vpollinfo(vp->v_pollinfo);
+ vp->v_pollinfo = NULL;
+ }
#ifdef INVARIANTS
/* XXX Elsewhere we detect an already freed vnode via NULL v_op. */
vp->v_op = NULL;
#endif
- rangelock_destroy(&vp->v_rl);
- lockdestroy(vp->v_vnlock);
- mtx_destroy(&vp->v_interlock);
- rw_destroy(BO_LOCKPTR(bo));
+ bzero(&vp->v_un, sizeof(vp->v_un));
+ vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0;
+ vp->v_iflag = 0;
+ vp->v_vflag = 0;
+ bo->bo_flag = 0;
uma_zfree(vnode_zone, vp);
}
@@ -2744,11 +2813,13 @@ vinactive(struct vnode *vp, struct thread *td)
VI_UNLOCK(vp);
/*
* Before moving off the active list, we must be sure that any
- * modified pages are on the vnode's dirty list since these will
- * no longer be checked once the vnode is on the inactive list.
- * Because the vnode vm object keeps a hold reference on the vnode
- * if there is at least one resident non-cached page, the vnode
- * cannot leave the active list without the page cleanup done.
+ * modified pages are converted into the vnode's dirty
+ * buffers, since these will no longer be checked once the
+ * vnode is on the inactive list.
+ *
+ * The write-out of the dirty pages is asynchronous. At the
+ * point that VOP_INACTIVE() is called, there could still be
+ * pending I/O and dirty pages in the object.
*/
obj = vp->v_object;
if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {
@@ -3082,6 +3153,7 @@ vgonel(struct vnode *vp)
* Clear the advisory locks and wake up waiting threads.
*/
(void)VOP_ADVLOCKPURGE(vp);
+ vp->v_lockf = NULL;
/*
* Delete from old mount point vnode list.
*/
@@ -3184,8 +3256,6 @@ vn_printf(struct vnode *vp, const char *fmt, ...)
}
if (vp->v_iflag & VI_MOUNT)
strlcat(buf, "|VI_MOUNT", sizeof(buf));
- if (vp->v_iflag & VI_AGE)
- strlcat(buf, "|VI_AGE", sizeof(buf));
if (vp->v_iflag & VI_DOOMED)
strlcat(buf, "|VI_DOOMED", sizeof(buf));
if (vp->v_iflag & VI_FREE)
@@ -3196,7 +3266,7 @@ vn_printf(struct vnode *vp, const char *fmt, ...)
strlcat(buf, "|VI_DOINGINACT", sizeof(buf));
if (vp->v_iflag & VI_OWEINACT)
strlcat(buf, "|VI_OWEINACT", sizeof(buf));
- flags = vp->v_iflag & ~(VI_MOUNT | VI_AGE | VI_DOOMED | VI_FREE |
+ flags = vp->v_iflag & ~(VI_MOUNT | VI_DOOMED | VI_FREE |
VI_ACTIVE | VI_DOINGINACT | VI_OWEINACT);
if (flags != 0) {
snprintf(buf2, sizeof(buf2), "|VI(0x%lx)", flags);
diff --git a/sys/mips/conf/AP143.hints b/sys/mips/conf/AP143.hints
index eb95d00..ee609e5 100644
--- a/sys/mips/conf/AP143.hints
+++ b/sys/mips/conf/AP143.hints
@@ -24,6 +24,10 @@ hint.arge.1.phymask=0x0 # No directly mapped PHYs
hint.arge.1.media=1000
hint.arge.1.fduplex=1
+# ath0: Where the ART is - last 64k in the flash
+hint.ath.0.eepromaddr=0x1fff0000
+hint.ath.0.eepromsize=16384
+
# The AP121 4MB flash layout:
#
# bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs
diff --git a/sys/mips/conf/QCA953X_BASE b/sys/mips/conf/QCA953X_BASE
index ec2a464..3126f71 100644
--- a/sys/mips/conf/QCA953X_BASE
+++ b/sys/mips/conf/QCA953X_BASE
@@ -100,7 +100,7 @@ option AH_DEBUG_ALQ
device ath_ar9300 # AR9330 HAL; no need for the others
option AH_DEBUG
option AH_SUPPORT_AR5416 # 11n HAL support
-option AH_SUPPORT_AR9330 # Chipset support
+option AH_SUPPORT_QCA9530 # Chipset support
option AH_AR5416_INTERRUPT_MITIGATION
device mii
diff --git a/sys/mips/conf/QCA953X_BASE.hints b/sys/mips/conf/QCA953X_BASE.hints
index 4bbb083..164420e 100644
--- a/sys/mips/conf/QCA953X_BASE.hints
+++ b/sys/mips/conf/QCA953X_BASE.hints
@@ -50,9 +50,7 @@ hint.ath.0.maddr=0x18100000
hint.ath.0.msize=0x20000
hint.ath.0.irq=0
hint.ath.0.vendor_id=0x168c
-# XXX for now this is 0x00ff because there's no HAL support
-# yet for honeybee.
-hint.ath.0.device_id=0x00ff
+hint.ath.0.device_id=0x003d
# Set this to define where the ath calibration data
# should be fetched from in physical memory.
# hint.ath.0.eepromaddr=0x1fff1000
diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c
index 626b5f8..2b50015 100644
--- a/sys/mips/mips/elf_machdep.c
+++ b/sys/mips/mips/elf_machdep.c
@@ -54,8 +54,6 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -63,7 +61,6 @@ struct sysentvec elf64_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode,
.sv_szsigcode = &szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF64",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
@@ -111,8 +108,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -120,7 +115,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode,
.sv_szsigcode = &szsigcode,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF32",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/mips/mips/freebsd32_machdep.c b/sys/mips/mips/freebsd32_machdep.c
index 5303420..7726ecd 100644
--- a/sys/mips/mips/freebsd32_machdep.c
+++ b/sys/mips/mips/freebsd32_machdep.c
@@ -77,8 +77,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = freebsd32_sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -86,7 +84,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_sendsig = freebsd32_sendsig,
.sv_sigcode = sigcode32,
.sv_szsigcode = &szsigcode32,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF32",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 6ae1e3d..85c3553 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -682,7 +682,7 @@ _cp= cp
_elink= elink
_glxiic= glxiic
_glxsb= glxsb
-_ibcs2= ibcs2
+#_ibcs2= ibcs2
_ie= ie
_mse= mse
_ncr= ncr
@@ -771,6 +771,12 @@ afterinstall:
.include "${SYSDIR}/conf/config.mk"
+# Use sys/conf/kmod.mk's MPATH to avoid redundantly running in every subdir.
+.if !defined(__MPATH)
+__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
+.export __MPATH
+.endif
+
SUBDIR:= ${SUBDIR:u:O}
.include <bsd.subdir.mk>
diff --git a/sys/modules/ahci/Makefile b/sys/modules/ahci/Makefile
index 86d12c8..451859e 100644
--- a/sys/modules/ahci/Makefile
+++ b/sys/modules/ahci/Makefile
@@ -5,4 +5,8 @@
KMOD= ahci
SRCS= ahci.c ahci_pci.c ahciem.c ahci.h device_if.h bus_if.h pci_if.h opt_cam.h
+.if ${MACHINE_CPUARCH} == "aarch64"
+SRCS+= ahci_generic.c
+.endif
+
.include <bsd.kmod.mk>
diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile
index 03f00d6..d100532 100644
--- a/sys/modules/ath/Makefile
+++ b/sys/modules/ath/Makefile
@@ -131,7 +131,7 @@ SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c
SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c
SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c
SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c
-SRCS+= ar9300_power.c ar9300_timer.c
+SRCS+= ar9300_power.c ar9300_timer.c ar9300_spectral.c
# NB: rate control is bound to the driver by symbol names so only pick one
.if ${ATH_RATE} == "sample"
diff --git a/sys/modules/mlxen/Makefile b/sys/modules/mlxen/Makefile
index 11925d4..4c43998 100644
--- a/sys/modules/mlxen/Makefile
+++ b/sys/modules/mlxen/Makefile
@@ -11,5 +11,3 @@ CFLAGS+= -I${.CURDIR}/../../ofed/include
CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include
.include <bsd.kmod.mk>
-
-CFLAGS+= -Wno-cast-qual -Wno-pointer-arith
diff --git a/sys/modules/uart/Makefile b/sys/modules/uart/Makefile
index 6e4843b..9a21ddc 100644
--- a/sys/modules/uart/Makefile
+++ b/sys/modules/uart/Makefile
@@ -34,6 +34,6 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \
SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \
power_if.h pccarddevs.h serdev_if.h
-SRCS+= opt_platform.h
+SRCS+= opt_platform.h opt_uart.h
.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile
index ed8edcf..8bb355b 100644
--- a/sys/modules/usb/Makefile
+++ b/sys/modules/usb/Makefile
@@ -53,7 +53,7 @@ SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
umct umcs umodem umoscom uplcom uslcom uvisor uvscom
SUBDIR += udl
SUBDIR += uether aue axe axge cdce cue ${_kue} mos rue smsc udav uhso ipheth
-SUBDIR += urndis
+SUBDIR += ure urndis
SUBDIR += usfs umass urio
SUBDIR += quirk template
SUBDIR += ${_g_audio} ${_g_keyboard} ${_g_modem} ${_g_mouse}
diff --git a/sys/modules/usb/ure/Makefile b/sys/modules/usb/ure/Makefile
new file mode 100644
index 0000000..61dfc37
--- /dev/null
+++ b/sys/modules/usb/ure/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../dev/usb/net
+
+KMOD= if_ure
+SRCS+= if_ure.c usbdevs.h
+SRCS+= bus_if.h device_if.h miibus_if.h usb_if.h \
+ opt_bus.h opt_inet.h opt_usb.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c
index 0a89225..c7b1042 100644
--- a/sys/net/if_llatbl.c
+++ b/sys/net/if_llatbl.c
@@ -284,6 +284,7 @@ lltable_set_entry_addr(struct ifnet *ifp, struct llentry *lle,
bcopy(lladdr, &lle->ll_addr, ifp->if_addrlen);
lle->la_flags |= LLE_VALID;
+ lle->r_flags |= RLLE_VALID;
}
/*
@@ -640,6 +641,7 @@ lla_rt_output(struct rt_msghdr *rtm, struct rt_addrinfo *info)
if ((rtm->rtm_flags & RTF_ANNOUNCE))
lle->la_flags |= LLE_PUB;
lle->la_flags |= LLE_VALID;
+ lle->r_flags |= RLLE_VALID;
lle->la_expire = rtm->rtm_rmx.rmx_expire;
laflags = lle->la_flags;
diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h
index 2009a7a..044959e 100644
--- a/sys/net/if_llatbl.h
+++ b/sys/net/if_llatbl.h
@@ -63,7 +63,8 @@ struct llentry {
uint16_t mac16[3];
uint8_t mac8[20]; /* IB needs 20 bytes. */
} ll_addr;
- uint32_t spare0;
+ uint16_t r_flags; /* LLE runtime flags */
+ uint16_t r_skip_req; /* feedback from fast path */
uint64_t spare1;
struct lltable *lle_tbl;
@@ -83,6 +84,7 @@ struct llentry {
LIST_ENTRY(llentry) lle_chain; /* chain of deleted items */
struct callout lle_timer;
struct rwlock lle_lock;
+ struct mtx req_mtx;
};
#define LLE_WLOCK(lle) rw_wlock(&(lle)->lle_lock)
@@ -95,6 +97,12 @@ struct llentry {
#define LLE_LOCK_DESTROY(lle) rw_destroy(&(lle)->lle_lock)
#define LLE_WLOCK_ASSERT(lle) rw_assert(&(lle)->lle_lock, RA_WLOCKED)
+#define LLE_REQ_INIT(lle) mtx_init(&(lle)->req_mtx, "lle req", \
+ NULL, MTX_DEF)
+#define LLE_REQ_DESTROY(lle) mtx_destroy(&(lle)->req_mtx)
+#define LLE_REQ_LOCK(lle) mtx_lock(&(lle)->req_mtx)
+#define LLE_REQ_UNLOCK(lle) mtx_unlock(&(lle)->req_mtx)
+
#define LLE_IS_VALID(lle) (((lle) != NULL) && ((lle) != (void *)-1))
#define LLE_ADDREF(lle) do { \
@@ -187,6 +195,11 @@ MALLOC_DECLARE(M_LLTABLE);
#define LLE_LINKED 0x0040 /* linked to lookup structure */
/* LLE request flags */
#define LLE_EXCLUSIVE 0x2000 /* return lle xlocked */
+#define LLE_UNLOCKED 0x4000 /* return lle unlocked */
+
+/* LLE flags used by fastpath code */
+#define RLLE_VALID 0x0001 /* entry is valid */
+#define RLLE_IFADDR LLE_IFADDR /* entry is ifaddr */
#define LLATBL_HASH(key, mask) \
(((((((key >> 8) ^ key) >> 8) ^ key) >> 8) ^ key) & mask)
diff --git a/sys/net/route.c b/sys/net/route.c
index 94f64c9..6b19edd 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -139,7 +139,14 @@ static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */
static int rtrequest1_fib_change(struct radix_node_head *, struct rt_addrinfo *,
struct rtentry **, u_int);
static void rt_setmetrics(const struct rt_addrinfo *, struct rtentry *);
-static int rt_ifdelroute(struct rtentry *rt, void *arg);
+static int rt_ifdelroute(const struct rtentry *rt, void *arg);
+static struct rtentry *rt_unlinkrte(struct radix_node_head *rnh,
+ struct rt_addrinfo *info, int *perror);
+static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info);
+#ifdef RADIX_MPATH
+static struct radix_node *rt_mpath_unlink(struct radix_node_head *rnh,
+ struct rt_addrinfo *info, struct rtentry *rto, int *perror);
+#endif
struct if_mtuinfo
{
@@ -237,6 +244,7 @@ rtentry_ctor(void *mem, int size, void *arg, int how)
bzero(rt, offsetof(struct rtentry, rt_endzero));
counter_u64_zero(rt->rt_pksent);
+ rt->rt_chain = NULL;
return (0);
}
@@ -867,6 +875,108 @@ rt_foreach_fib_walk(int af, rt_setwarg_t *setwa_f, rt_walktree_f_t *wa_f,
}
}
+struct rt_delinfo
+{
+ struct rt_addrinfo info;
+ struct radix_node_head *rnh;
+ struct rtentry *head;
+};
+
+/*
+ * Conditionally unlinks @rn from radix tree based
+ * on info data passed in @arg.
+ */
+static int
+rt_checkdelroute(struct radix_node *rn, void *arg)
+{
+ struct rt_delinfo *di;
+ struct rt_addrinfo *info;
+ struct rtentry *rt;
+ int error;
+
+ di = (struct rt_delinfo *)arg;
+ rt = (struct rtentry *)rn;
+ info = &di->info;
+ error = 0;
+
+ info->rti_info[RTAX_DST] = rt_key(rt);
+ info->rti_info[RTAX_NETMASK] = rt_mask(rt);
+ info->rti_info[RTAX_GATEWAY] = rt->rt_gateway;
+
+ rt = rt_unlinkrte(di->rnh, info, &error);
+ if (rt == NULL) {
+ /* Either not allowed or not matched. Skip entry */
+ return (0);
+ }
+
+ /* Entry was unlinked. Add to the list and return */
+ rt->rt_chain = di->head;
+ di->head = rt;
+
+ return (0);
+}
+
+/*
+ * Iterates over all existing fibs in system.
+ * Deletes each element for which @filter_f function returned
+ * non-zero value.
+ * If @af is not AF_UNSPEC, iterates over fibs in particular
+ * address family.
+ */
+void
+rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg)
+{
+ struct radix_node_head *rnh;
+ struct rt_delinfo di;
+ struct rtentry *rt;
+ uint32_t fibnum;
+ int i, start, end;
+
+ bzero(&di, sizeof(di));
+ di.info.rti_filter = filter_f;
+ di.info.rti_filterdata = arg;
+
+ for (fibnum = 0; fibnum < rt_numfibs; fibnum++) {
+ /* Do we want some specific family? */
+ if (af != AF_UNSPEC) {
+ start = af;
+ end = af;
+ } else {
+ start = 1;
+ end = AF_MAX;
+ }
+
+ for (i = start; i <= end; i++) {
+ rnh = rt_tables_get_rnh(fibnum, i);
+ if (rnh == NULL)
+ continue;
+ di.rnh = rnh;
+
+ RADIX_NODE_HEAD_LOCK(rnh);
+ rnh->rnh_walktree(rnh, rt_checkdelroute, &di);
+ RADIX_NODE_HEAD_UNLOCK(rnh);
+
+ if (di.head == NULL)
+ continue;
+
+ /* We might have something to reclaim */
+ while (di.head != NULL) {
+ rt = di.head;
+ di.head = rt->rt_chain;
+ rt->rt_chain = NULL;
+
+ /* TODO std rt -> rt_addrinfo export */
+ di.info.rti_info[RTAX_DST] = rt_key(rt);
+ di.info.rti_info[RTAX_NETMASK] = rt_mask(rt);
+
+ rt_notifydelete(rt, &di.info);
+ RTFREE_LOCKED(rt);
+ }
+
+ }
+ }
+}
+
/*
* Delete Routes for a Network Interface
*
@@ -882,10 +992,9 @@ rt_foreach_fib_walk(int af, rt_setwarg_t *setwa_f, rt_walktree_f_t *wa_f,
* errno failed - reason indicated
*/
static int
-rt_ifdelroute(struct rtentry *rt, void *arg)
+rt_ifdelroute(const struct rtentry *rt, void *arg)
{
struct ifnet *ifp = arg;
- int err;
if (rt->rt_ifp != ifp)
return (0);
@@ -897,14 +1006,7 @@ rt_ifdelroute(struct rtentry *rt, void *arg)
if ((rt->rt_flags & RTF_UP) == 0)
return (0);
- err = rtrequest_fib(RTM_DELETE, rt_key(rt), rt->rt_gateway,
- rt_mask(rt),
- rt->rt_flags | RTF_RNH_LOCKED | RTF_PINNED,
- (struct rtentry **) NULL, rt->rt_fibnum);
- if (err != 0)
- log(LOG_WARNING, "rt_ifdelroute: error %d\n", err);
-
- return (0);
+ return (1);
}
/*
@@ -917,10 +1019,105 @@ void
rt_flushifroutes(struct ifnet *ifp)
{
- rt_foreach_fib_walk(AF_UNSPEC, NULL, rt_ifdelroute, ifp);
+ rt_foreach_fib_walk_del(AF_UNSPEC, rt_ifdelroute, ifp);
}
/*
+ * Conditionally unlinks rtentry matching data inside @info from @rnh.
+ * Returns unlinked, locked and referenced @rtentry on success,
+ * Returns NULL and sets @perror to:
+ * ESRCH - if prefix was not found,
+ * EADDRINUSE - if trying to delete PINNED route without appropriate flag.
+ * ENOENT - if supplied filter function returned 0 (not matched).
+ */
+static struct rtentry *
+rt_unlinkrte(struct radix_node_head *rnh, struct rt_addrinfo *info, int *perror)
+{
+ struct sockaddr *dst, *netmask;
+ struct rtentry *rt;
+ struct radix_node *rn;
+
+ dst = info->rti_info[RTAX_DST];
+ netmask = info->rti_info[RTAX_NETMASK];
+
+ rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, rnh);
+ if (rt == NULL) {
+ *perror = ESRCH;
+ return (NULL);
+ }
+
+ if ((info->rti_flags & RTF_PINNED) == 0) {
+ /* Check if target route can be deleted */
+ if (rt->rt_flags & RTF_PINNED) {
+ *perror = EADDRINUSE;
+ return (NULL);
+ }
+ }
+
+ if (info->rti_filter != NULL) {
+ if (info->rti_filter(rt, info->rti_filterdata) == 0) {
+ /* Not matched */
+ *perror = ENOENT;
+ return (NULL);
+ }
+
+ /*
+ * Filter function requested rte deletion.
+ * Ease the caller work by filling in remaining info
+ * from that particular entry.
+ */
+ info->rti_info[RTAX_GATEWAY] = rt->rt_gateway;
+ }
+
+ /*
+ * Remove the item from the tree and return it.
+ * Complain if it is not there and do no more processing.
+ */
+ *perror = ESRCH;
+#ifdef RADIX_MPATH
+ if (rn_mpath_capable(rnh))
+ rn = rt_mpath_unlink(rnh, info, rt, perror);
+ else
+#endif
+ rn = rnh->rnh_deladdr(dst, netmask, rnh);
+ if (rn == NULL)
+ return (NULL);
+
+ if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT))
+ panic ("rtrequest delete");
+
+ rt = RNTORT(rn);
+ RT_LOCK(rt);
+ RT_ADDREF(rt);
+ rt->rt_flags &= ~RTF_UP;
+
+ *perror = 0;
+
+ return (rt);
+}
+
+static void
+rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info)
+{
+ struct ifaddr *ifa;
+
+ /*
+ * give the protocol a chance to keep things in sync.
+ */
+ ifa = rt->rt_ifa;
+ if (ifa != NULL && ifa->ifa_rtrequest != NULL)
+ ifa->ifa_rtrequest(RTM_DELETE, rt, info);
+
+ /*
+ * One more rtentry floating around that is not
+ * linked to the routing table. rttrash will be decremented
+ * when RTFREE(rt) is eventually called.
+ */
+ V_rttrash++;
+}
+
+
+/*
* These (questionable) definitions of apparent local variables apply
* to the next two functions. XXXXXX!!!
*/
@@ -975,87 +1172,6 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum)
return (error);
}
-/*
- * Expunges references to a route that's about to be reclaimed.
- * The route must be locked.
- */
-int
-rt_expunge(struct radix_node_head *rnh, struct rtentry *rt)
-{
-#if !defined(RADIX_MPATH)
- struct radix_node *rn;
-#else
- struct rt_addrinfo info;
- int fib;
- struct rtentry *rt0;
-#endif
- struct ifaddr *ifa;
- int error = 0;
-
- RT_LOCK_ASSERT(rt);
- RADIX_NODE_HEAD_LOCK_ASSERT(rnh);
-
-#ifdef RADIX_MPATH
- fib = rt->rt_fibnum;
- bzero(&info, sizeof(info));
- info.rti_ifp = rt->rt_ifp;
- info.rti_flags = RTF_RNH_LOCKED;
- info.rti_info[RTAX_DST] = rt_key(rt);
- info.rti_info[RTAX_GATEWAY] = rt->rt_ifa->ifa_addr;
-
- RT_UNLOCK(rt);
- error = rtrequest1_fib(RTM_DELETE, &info, &rt0, fib);
-
- if (error == 0 && rt0 != NULL) {
- rt = rt0;
- RT_LOCK(rt);
- } else if (error != 0) {
- RT_LOCK(rt);
- return (error);
- }
-#else
- /*
- * Remove the item from the tree; it should be there,
- * but when callers invoke us blindly it may not (sigh).
- */
- rn = rnh->rnh_deladdr(rt_key(rt), rt_mask(rt), rnh);
- if (rn == NULL) {
- error = ESRCH;
- goto bad;
- }
- KASSERT((rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) == 0,
- ("unexpected flags 0x%x", rn->rn_flags));
- KASSERT(rt == RNTORT(rn),
- ("lookup mismatch, rt %p rn %p", rt, rn));
-#endif /* RADIX_MPATH */
-
- rt->rt_flags &= ~RTF_UP;
-
- /*
- * Give the protocol a chance to keep things in sync.
- */
- if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest) {
- struct rt_addrinfo info;
-
- bzero((caddr_t)&info, sizeof(info));
- info.rti_flags = rt->rt_flags;
- info.rti_info[RTAX_DST] = rt_key(rt);
- info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
- info.rti_info[RTAX_NETMASK] = rt_mask(rt);
- ifa->ifa_rtrequest(RTM_DELETE, rt, &info);
- }
-
- /*
- * one more rtentry floating around that is not
- * linked to the routing table.
- */
- V_rttrash++;
-#if !defined(RADIX_MPATH)
-bad:
-#endif
- return (error);
-}
-
static int
if_updatemtu_cb(struct radix_node *rn, void *arg)
{
@@ -1172,26 +1288,32 @@ rt_print(char *buf, int buflen, struct rtentry *rt)
#endif
#ifdef RADIX_MPATH
-static int
-rn_mpath_update(int req, struct rt_addrinfo *info,
- struct radix_node_head *rnh, struct rtentry **ret_nrt)
+/*
+ * Deletes key for single-path routes, unlinks rtentry with
+ * gateway specified in @info from multi-path routes.
+ *
+ * Returnes unlinked entry. In case of failure, returns NULL
+ * and sets @perror to ESRCH.
+ */
+static struct radix_node *
+rt_mpath_unlink(struct radix_node_head *rnh, struct rt_addrinfo *info,
+ struct rtentry *rto, int *perror)
{
/*
* if we got multipath routes, we require users to specify
* a matching RTAX_GATEWAY.
*/
- struct rtentry *rt, *rto = NULL;
+ struct rtentry *rt; // *rto = NULL;
struct radix_node *rn;
- int error = 0;
+ struct sockaddr *gw;
- rn = rnh->rnh_lookup(dst, netmask, rnh);
- if (rn == NULL)
- return (ESRCH);
- rto = rt = RNTORT(rn);
+ gw = info->rti_info[RTAX_GATEWAY];
+ rt = rt_mpath_matchgate(rto, gw);
+ if (rt == NULL) {
+ *perror = ESRCH;
+ return (NULL);
+ }
- rt = rt_mpath_matchgate(rt, gateway);
- if (rt == NULL)
- return (ESRCH);
/*
* this is the first entry in the chain
*/
@@ -1214,67 +1336,95 @@ rn_mpath_update(int req, struct rt_addrinfo *info,
* check the case when there is only
* one route in the chain.
*/
- if (gateway &&
- (rt->rt_gateway->sa_len != gateway->sa_len ||
- memcmp(rt->rt_gateway, gateway, gateway->sa_len)))
- error = ESRCH;
- else {
- /*
- * remove from tree before returning it
- * to the caller
- */
- rn = rnh->rnh_deladdr(dst, netmask, rnh);
- KASSERT(rt == RNTORT(rn), ("radix node disappeared"));
- goto gwdelete;
+ if (gw &&
+ (rt->rt_gateway->sa_len != gw->sa_len ||
+ memcmp(rt->rt_gateway, gw, gw->sa_len))) {
+ *perror = ESRCH;
+ return (NULL);
}
-
}
+
/*
* use the normal delete code to remove
* the first entry
*/
- if (req != RTM_DELETE)
- goto nondelete;
-
- error = ENOENT;
- goto done;
+ rn = rnh->rnh_deladdr(dst, netmask, rnh);
+ *perror = 0;
+ return (rn);
}
/*
* if the entry is 2nd and on up
*/
- if ((req == RTM_DELETE) && !rt_mpath_deldup(rto, rt))
+ if (rt_mpath_deldup(rto, rt) == 0)
panic ("rtrequest1: rt_mpath_deldup");
-gwdelete:
- RT_LOCK(rt);
- RT_ADDREF(rt);
- if (req == RTM_DELETE) {
- rt->rt_flags &= ~RTF_UP;
- /*
- * One more rtentry floating around that is not
- * linked to the routing table. rttrash will be decremented
- * when RTFREE(rt) is eventually called.
- */
- V_rttrash++;
+ *perror = 0;
+ rn = (struct radix_node *)rt;
+ return (rn);
+}
+#endif
+
+#ifdef FLOWTABLE
+static struct rtentry *
+rt_flowtable_check_route(struct radix_node_head *rnh, struct rt_addrinfo *info)
+{
+#if defined(INET6) || defined(INET)
+ struct radix_node *rn;
+#endif
+ struct rtentry *rt0;
+
+ rt0 = NULL;
+ /* "flow-table" only supports IPv6 and IPv4 at the moment. */
+ switch (dst->sa_family) {
+#ifdef INET6
+ case AF_INET6:
+#endif
+#ifdef INET
+ case AF_INET:
+#endif
+#if defined(INET6) || defined(INET)
+ rn = rnh->rnh_matchaddr(dst, rnh);
+ if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
+ struct sockaddr *mask;
+ u_char *m, *n;
+ int len;
+
+ /*
+ * compare mask to see if the new route is
+ * more specific than the existing one
+ */
+ rt0 = RNTORT(rn);
+ RT_LOCK(rt0);
+ RT_ADDREF(rt0);
+ RT_UNLOCK(rt0);
+ /*
+ * A host route is already present, so
+ * leave the flow-table entries as is.
+ */
+ if (rt0->rt_flags & RTF_HOST) {
+ RTFREE(rt0);
+ rt0 = NULL;
+ } else if (!(flags & RTF_HOST) && netmask) {
+ mask = rt_mask(rt0);
+ len = mask->sa_len;
+ m = (u_char *)mask;
+ n = (u_char *)netmask;
+ while (len-- > 0) {
+ if (*n != *m)
+ break;
+ n++;
+ m++;
+ }
+ if (len == 0 || (*n < *m)) {
+ RTFREE(rt0);
+ rt0 = NULL;
+ }
+ }
+ }
+#endif/* INET6 || INET */
}
-
-nondelete:
- if (req != RTM_DELETE)
- panic("unrecognized request %d", req);
-
- /*
- * If the caller wants it, then it can have it,
- * but it's up to it to free the rtentry as we won't be
- * doing it.
- */
- if (ret_nrt) {
- *ret_nrt = rt;
- RT_UNLOCK(rt);
- } else
- RTFREE_LOCKED(rt);
-done:
- return (error);
+ return (rt0);
}
#endif
@@ -1283,7 +1433,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
u_int fibnum)
{
int error = 0, needlock = 0;
- struct rtentry *rt;
+ struct rtentry *rt, *rt_old;
#ifdef FLOWTABLE
struct rtentry *rt0;
#endif
@@ -1330,52 +1480,12 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask);
dst = (struct sockaddr *)&mdst;
}
-#ifdef RADIX_MPATH
- if (rn_mpath_capable(rnh)) {
- error = rn_mpath_update(req, info, rnh, ret_nrt);
- /*
- * "bad" holds true for the success case
- * as well
- */
- if (error != ENOENT)
- goto bad;
- error = 0;
- }
-#endif
- if ((flags & RTF_PINNED) == 0) {
- /* Check if target route can be deleted */
- rt = (struct rtentry *)rnh->rnh_lookup(dst,
- netmask, rnh);
- if ((rt != NULL) && (rt->rt_flags & RTF_PINNED))
- senderr(EADDRINUSE);
- }
- /*
- * Remove the item from the tree and return it.
- * Complain if it is not there and do no more processing.
- */
- rn = rnh->rnh_deladdr(dst, netmask, rnh);
- if (rn == NULL)
- senderr(ESRCH);
- if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT))
- panic ("rtrequest delete");
- rt = RNTORT(rn);
- RT_LOCK(rt);
- RT_ADDREF(rt);
- rt->rt_flags &= ~RTF_UP;
-
- /*
- * give the protocol a chance to keep things in sync.
- */
- if ((ifa = rt->rt_ifa) && ifa->ifa_rtrequest)
- ifa->ifa_rtrequest(RTM_DELETE, rt, info);
+ rt = rt_unlinkrte(rnh, info, &error);
+ if (error != 0)
+ goto bad;
- /*
- * One more rtentry floating around that is not
- * linked to the routing table. rttrash will be decremented
- * when RTFREE(rt) is eventually called.
- */
- V_rttrash++;
+ rt_notifydelete(rt, info);
/*
* If the caller wants it, then it can have it,
@@ -1461,60 +1571,31 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
#endif
#ifdef FLOWTABLE
- rt0 = NULL;
- /* "flow-table" only supports IPv6 and IPv4 at the moment. */
- switch (dst->sa_family) {
-#ifdef INET6
- case AF_INET6:
-#endif
-#ifdef INET
- case AF_INET:
-#endif
-#if defined(INET6) || defined(INET)
- rn = rnh->rnh_matchaddr(dst, rnh);
- if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
- struct sockaddr *mask;
- u_char *m, *n;
- int len;
-
- /*
- * compare mask to see if the new route is
- * more specific than the existing one
- */
- rt0 = RNTORT(rn);
- RT_LOCK(rt0);
- RT_ADDREF(rt0);
- RT_UNLOCK(rt0);
- /*
- * A host route is already present, so
- * leave the flow-table entries as is.
- */
- if (rt0->rt_flags & RTF_HOST) {
- RTFREE(rt0);
- rt0 = NULL;
- } else if (!(flags & RTF_HOST) && netmask) {
- mask = rt_mask(rt0);
- len = mask->sa_len;
- m = (u_char *)mask;
- n = (u_char *)netmask;
- while (len-- > 0) {
- if (*n != *m)
- break;
- n++;
- m++;
- }
- if (len == 0 || (*n < *m)) {
- RTFREE(rt0);
- rt0 = NULL;
- }
- }
- }
-#endif/* INET6 || INET */
- }
+ rt0 = rt_flowtable_check_route(rnh, info);
#endif /* FLOWTABLE */
/* XXX mtu manipulation will be done in rnh_addaddr -- itojun */
rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes);
+
+ rt_old = NULL;
+ if (rn == NULL && (info->rti_flags & RTF_PINNED) != 0) {
+
+ /*
+ * Force removal and re-try addition
+ * TODO: better multipath&pinned support
+ */
+ struct sockaddr *info_dst = info->rti_info[RTAX_DST];
+ info->rti_info[RTAX_DST] = ndst;
+ rt_old = rt_unlinkrte(rnh, info, &error);
+ info->rti_info[RTAX_DST] = info_dst;
+ if (rt_old != NULL)
+ rn = rnh->rnh_addaddr(ndst, netmask, rnh,
+ rt->rt_nodes);
+ }
+
+ if (rt_old != NULL)
+ RT_UNLOCK(rt_old);
+
/*
* If it still failed to go into the tree,
* then un-make it (this should be a function)
@@ -1536,6 +1617,11 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
}
#endif
+ if (rt_old != NULL) {
+ rt_notifydelete(rt_old, info);
+ RTFREE(rt_old);
+ }
+
/*
* If this protocol has something to add to this then
* allow it to do that as well.
@@ -1912,32 +1998,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum)
info.rti_info[RTAX_NETMASK] = netmask;
error = rtrequest1_fib(cmd, &info, &rt, fibnum);
- if ((error == EEXIST) && (cmd == RTM_ADD)) {
- /*
- * Interface route addition failed.
- * Atomically delete current prefix generating
- * RTM_DELETE message, and retry adding
- * interface prefix.
- */
- rnh = rt_tables_get_rnh(fibnum, dst->sa_family);
- RADIX_NODE_HEAD_LOCK(rnh);
-
- /* Delete old prefix */
- info.rti_ifa = NULL;
- info.rti_flags = RTF_RNH_LOCKED;
-
- error = rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum);
- if (error == 0) {
- info.rti_ifa = ifa;
- info.rti_flags = flags | RTF_RNH_LOCKED |
- (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED;
- error = rtrequest1_fib(cmd, &info, &rt, fibnum);
- }
-
- RADIX_NODE_HEAD_UNLOCK(rnh);
- }
-
-
if (error == 0 && rt != NULL) {
/*
* notify any listening routing agents of the change
diff --git a/sys/net/route.h b/sys/net/route.h
index e62aaa6..ffbcb3c 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -128,6 +128,7 @@ struct rtentry {
#define rt_endzero rt_pksent
counter_u64_t rt_pksent; /* packets sent using this route */
struct mtx rt_mtx; /* mutex for routing entry */
+ struct rtentry *rt_chain; /* pointer to next rtentry to delete */
};
#endif /* _KERNEL || _WANT_RTENTRY */
@@ -259,14 +260,19 @@ struct rt_msghdr {
#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
#define RTAX_MAX 8 /* size of array to allocate */
+typedef int rt_filter_f_t(const struct rtentry *, void *);
+
struct rt_addrinfo {
- int rti_addrs;
- struct sockaddr *rti_info[RTAX_MAX];
- int rti_flags;
- struct ifaddr *rti_ifa;
- struct ifnet *rti_ifp;
- u_long rti_mflags;
- struct rt_metrics *rti_rmx;
+ int rti_addrs; /* Route RTF_ flags */
+ int rti_flags; /* Route RTF_ flags */
+ struct sockaddr *rti_info[RTAX_MAX]; /* Sockaddr data */
+ struct ifaddr *rti_ifa; /* value of rt_ifa addr */
+ struct ifnet *rti_ifp; /* route interface */
+ rt_filter_f_t *rti_filter; /* filter function */
+ void *rti_filterdata; /* filter paramenters */
+ u_long rti_mflags; /* metrics RTV_ flags */
+ u_long rti_spare; /* Will be used for fib */
+ struct rt_metrics *rti_rmx; /* Pointer to route metrics */
};
/*
@@ -383,6 +389,7 @@ void rt_updatemtu(struct ifnet *);
typedef int rt_walktree_f_t(struct rtentry *, void *);
typedef void rt_setwarg_t(struct radix_node_head *, uint32_t, int, void *);
void rt_foreach_fib_walk(int af, rt_setwarg_t *, rt_walktree_f_t *, void *);
+void rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg);
void rt_flushifroutes(struct ifnet *ifp);
/* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index dfba0b2..1dfa244 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -78,6 +78,14 @@ static struct timeval arp_lastlog;
static int arp_curpps;
static int arp_maxpps = 1;
+/* Simple ARP state machine */
+enum arp_llinfo_state {
+ ARP_LLINFO_INCOMPLETE = 0, /* No LLE data */
+ ARP_LLINFO_REACHABLE, /* LLE is valid */
+ ARP_LLINFO_VERIFY, /* LLE is valid, need refresh */
+ ARP_LLINFO_DELETED, /* LLE is deleted */
+};
+
SYSCTL_DECL(_net_link_ether);
static SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, "");
static SYSCTL_NODE(_net_link_ether, PF_ARP, arp, CTLFLAG_RW, 0, "");
@@ -89,6 +97,7 @@ static VNET_DEFINE(int, arp_maxtries) = 5;
static VNET_DEFINE(int, arp_proxyall) = 0;
static VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for
* 20 seconds */
+static VNET_DEFINE(int, arpt_rexmit) = 1; /* retransmit arp entries, sec*/
VNET_PCPUSTAT_DEFINE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */
VNET_PCPUSTAT_SYSINIT(arpstat);
@@ -100,6 +109,7 @@ static VNET_DEFINE(int, arp_maxhold) = 1;
#define V_arpt_keep VNET(arpt_keep)
#define V_arpt_down VNET(arpt_down)
+#define V_arpt_rexmit VNET(arpt_rexmit)
#define V_arp_maxtries VNET(arp_maxtries)
#define V_arp_proxyall VNET(arp_proxyall)
#define V_arp_maxhold VNET(arp_maxhold)
@@ -161,6 +171,7 @@ arptimer(void *arg)
{
struct llentry *lle = (struct llentry *)arg;
struct ifnet *ifp;
+ int r_skip_req;
if (lle->la_flags & LLE_STATIC) {
return;
@@ -188,6 +199,55 @@ arptimer(void *arg)
ifp = lle->lle_tbl->llt_ifp;
CURVNET_SET(ifp->if_vnet);
+ switch (lle->ln_state) {
+ case ARP_LLINFO_REACHABLE:
+
+ /*
+ * Expiration time is approaching.
+ * Let's try to refresh entry if it is still
+ * in use.
+ *
+ * Set r_skip_req to get feedback from
+ * fast path. Change state and re-schedule
+ * ourselves.
+ */
+ LLE_REQ_LOCK(lle);
+ lle->r_skip_req = 1;
+ LLE_REQ_UNLOCK(lle);
+ lle->ln_state = ARP_LLINFO_VERIFY;
+ callout_schedule(&lle->lle_timer, hz * V_arpt_rexmit);
+ LLE_WUNLOCK(lle);
+ CURVNET_RESTORE();
+ return;
+ case ARP_LLINFO_VERIFY:
+ LLE_REQ_LOCK(lle);
+ r_skip_req = lle->r_skip_req;
+ LLE_REQ_UNLOCK(lle);
+
+ if (r_skip_req == 0 && lle->la_preempt > 0) {
+ /* Entry was used, issue refresh request */
+ struct in_addr dst;
+ dst = lle->r_l3addr.addr4;
+ lle->la_preempt--;
+ callout_schedule(&lle->lle_timer, hz * V_arpt_rexmit);
+ LLE_WUNLOCK(lle);
+ arprequest(ifp, NULL, &dst, NULL);
+ CURVNET_RESTORE();
+ return;
+ }
+ /* Nothing happened. Reschedule if not too late */
+ if (lle->la_expire > time_uptime) {
+ callout_schedule(&lle->lle_timer, hz * V_arpt_rexmit);
+ LLE_WUNLOCK(lle);
+ CURVNET_RESTORE();
+ return;
+ }
+ break;
+ case ARP_LLINFO_INCOMPLETE:
+ case ARP_LLINFO_DELETED:
+ break;
+ }
+
if ((lle->la_flags & LLE_DELETED) == 0) {
int evt;
@@ -353,26 +413,16 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int create, struct mbuf *m,
if ((la->la_flags & LLE_VALID) &&
((la->la_flags & LLE_STATIC) || la->la_expire > time_uptime)) {
bcopy(&la->ll_addr, desten, ifp->if_addrlen);
- renew = 0;
- /*
- * If entry has an expiry time and it is approaching,
- * see if we need to send an ARP request within this
- * arpt_down interval.
- */
- if (!(la->la_flags & LLE_STATIC) &&
- time_uptime + la->la_preempt > la->la_expire) {
- renew = 1;
- la->la_preempt--;
- }
+ /* Check if we have feedback request from arptimer() */
+ if (la->r_skip_req != 0) {
+ LLE_REQ_LOCK(la);
+ la->r_skip_req = 0; /* Notify that entry was used */
+ LLE_REQ_UNLOCK(la);
+ }
if (pflags != NULL)
- *pflags = la->la_flags;
-
+ *pflags = la->la_flags & (LLE_VALID|LLE_IFADDR);
LLE_WUNLOCK(la);
-
- if (renew == 1)
- arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL);
-
return (0);
}
@@ -440,7 +490,7 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int create, struct mbuf *m,
* m is the mbuf. May be NULL if we don't have a packet.
* dst is the next hop,
* desten is the storage to put LL address.
- * flags returns lle entry flags.
+ * flags returns subset of lle flags: LLE_VALID | LLE_IFADDR
*
* On success, desten and flags are filled in and the function returns 0;
* If the packet must be held pending resolution, we return EWOULDBLOCK
@@ -452,7 +502,6 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m,
const struct sockaddr *dst, u_char *desten, uint32_t *pflags)
{
struct llentry *la = 0;
- int renew;
if (pflags != NULL)
*pflags = 0;
@@ -472,40 +521,24 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m,
}
IF_AFDATA_RLOCK(ifp);
- la = lla_lookup(LLTABLE(ifp), 0, dst);
- IF_AFDATA_RUNLOCK(ifp);
-
- if (la == NULL)
- return (arpresolve_full(ifp, is_gw, 1, m, dst, desten, pflags));
-
- if ((la->la_flags & LLE_VALID) &&
- ((la->la_flags & LLE_STATIC) || la->la_expire > time_uptime)) {
+ la = lla_lookup(LLTABLE(ifp), LLE_UNLOCKED, dst);
+ if (la != NULL && (la->r_flags & RLLE_VALID) != 0) {
+ /* Entry found, let's copy lle info */
bcopy(&la->ll_addr, desten, ifp->if_addrlen);
- renew = 0;
- /*
- * If entry has an expiry time and it is approaching,
- * see if we need to send an ARP request within this
- * arpt_down interval.
- */
- if (!(la->la_flags & LLE_STATIC) &&
- time_uptime + la->la_preempt > la->la_expire) {
- renew = 1;
- la->la_preempt--;
- }
-
if (pflags != NULL)
- *pflags = la->la_flags;
-
- LLE_RUNLOCK(la);
-
- if (renew == 1)
- arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL);
-
+ *pflags = LLE_VALID | (la->r_flags & RLLE_IFADDR);
+ /* Check if we have feedback request from arptimer() */
+ if (la->r_skip_req != 0) {
+ LLE_REQ_LOCK(la);
+ la->r_skip_req = 0; /* Notify that entry was used */
+ LLE_REQ_UNLOCK(la);
+ }
+ IF_AFDATA_RUNLOCK(ifp);
return (0);
}
- LLE_RUNLOCK(la);
+ IF_AFDATA_RUNLOCK(ifp);
- return (arpresolve_full(ifp, is_gw, 0, m, dst, desten, pflags));
+ return (arpresolve_full(ifp, is_gw, 1, m, dst, desten, pflags));
}
/*
@@ -1042,6 +1075,9 @@ arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, struct ifnet *ifp
IF_AFDATA_WUNLOCK(ifp);
LLE_REMREF(la);
+
+ /* Clear fast path feedback request if set */
+ la->r_skip_req = 0;
}
arp_mark_lle_reachable(la);
@@ -1073,17 +1109,21 @@ arp_check_update_lle(struct arphdr *ah, struct in_addr isaddr, struct ifnet *ifp
static void
arp_mark_lle_reachable(struct llentry *la)
{
- int canceled;
+ int canceled, wtime;
LLE_WLOCK_ASSERT(la);
+ la->ln_state = ARP_LLINFO_REACHABLE;
EVENTHANDLER_INVOKE(lle_event, la, LLENTRY_RESOLVED);
if (!(la->la_flags & LLE_STATIC)) {
LLE_ADDREF(la);
la->la_expire = time_uptime + V_arpt_keep;
+ wtime = V_arpt_keep - V_arp_maxtries * V_arpt_rexmit;
+ if (wtime < 0)
+ wtime = V_arpt_keep;
canceled = callout_reset(&la->lle_timer,
- hz * V_arpt_keep, arptimer, la);
+ hz * wtime, arptimer, la);
if (canceled)
LLE_REMREF(la);
}
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 185f5c2..d83348c 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -3334,6 +3334,15 @@ igmp_v3_dispatch_general_query(struct igmp_ifsoftc *igi)
KASSERT(igi->igi_version == IGMP_VERSION_3,
("%s: called when version %d", __func__, igi->igi_version));
+ /*
+ * Check that there are some packets queued. If so, send them first.
+ * For large number of groups the reply to general query can take
+ * many packets, we should finish sending them before starting of
+ * queuing the new reply.
+ */
+ if (mbufq_len(&igi->igi_gq) != 0)
+ goto send;
+
ifp = igi->igi_ifp;
IF_ADDR_RLOCK(ifp);
@@ -3369,6 +3378,7 @@ igmp_v3_dispatch_general_query(struct igmp_ifsoftc *igi)
}
IF_ADDR_RUNLOCK(ifp);
+send:
loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0;
igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop);
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index dcf10f1..7504c8f 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1013,6 +1013,7 @@ in_lltable_destroy_lle(struct llentry *lle)
LLE_WUNLOCK(lle);
LLE_LOCK_DESTROY(lle);
+ LLE_REQ_DESTROY(lle);
free(lle, M_LLTABLE);
}
@@ -1034,6 +1035,7 @@ in_lltable_new(struct in_addr addr4, u_int flags)
lle->base.lle_refcnt = 1;
lle->base.lle_free = in_lltable_destroy_lle;
LLE_LOCK_INIT(&lle->base);
+ LLE_REQ_INIT(&lle->base);
callout_init(&lle->base.lle_timer, 1);
return (&lle->base);
@@ -1257,9 +1259,12 @@ in_lltable_alloc(struct lltable *llt, u_int flags, const struct sockaddr *l3addr
return (NULL);
}
lle->la_flags = flags;
+ if (flags & LLE_STATIC)
+ lle->r_flags |= RLLE_VALID;
if ((flags & LLE_IFADDR) == LLE_IFADDR) {
lltable_set_entry_addr(ifp, lle, IF_LLADDR(ifp));
lle->la_flags |= LLE_STATIC;
+ lle->r_flags |= (RLLE_VALID | RLLE_IFADDR);
}
return (lle);
@@ -1283,6 +1288,13 @@ in_lltable_lookup(struct lltable *llt, u_int flags, const struct sockaddr *l3add
if (lle == NULL)
return (NULL);
+ KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) !=
+ (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X",
+ flags));
+
+ if (flags & LLE_UNLOCKED)
+ return (lle);
+
if (flags & LLE_EXCLUSIVE)
LLE_WLOCK(lle);
else
diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c
index e17d36f..bb98de2 100644
--- a/sys/netinet/in_rmx.c
+++ b/sys/netinet/in_rmx.c
@@ -53,9 +53,6 @@ extern int in_inithead(void **head, int off);
extern int in_detachhead(void **head, int off);
#endif
-static void in_setifarnh(struct radix_node_head *rnh, uint32_t fibnum,
- int af, void *_arg);
-
/*
* Do what we need to do when inserting a route.
*/
@@ -150,56 +147,22 @@ in_detachhead(void **head, int off)
* plug back in.
*/
struct in_ifadown_arg {
- struct radix_node_head *rnh;
struct ifaddr *ifa;
int del;
};
static int
-in_ifadownkill(struct rtentry *rt, void *xap)
+in_ifadownkill(const struct rtentry *rt, void *xap)
{
struct in_ifadown_arg *ap = xap;
- RT_LOCK(rt);
- if (rt->rt_ifa == ap->ifa &&
- (ap->del || !(rt->rt_flags & RTF_STATIC))) {
- /*
- * Aquire a reference so that it can later be freed
- * as the refcount would be 0 here in case of at least
- * ap->del.
- */
- RT_ADDREF(rt);
- /*
- * Disconnect it from the tree and permit protocols
- * to cleanup.
- */
- rt_expunge(ap->rnh, rt);
- /*
- * At this point it is an rttrash node, and in case
- * the above is the only reference we must free it.
- * If we do not noone will have a pointer and the
- * rtentry will be leaked forever.
- * In case someone else holds a reference, we are
- * fine as we only decrement the refcount. In that
- * case if the other entity calls RT_REMREF, we
- * will still be leaking but at least we tried.
- */
- RTFREE_LOCKED(rt);
+ if (rt->rt_ifa != ap->ifa)
return (0);
- }
- RT_UNLOCK(rt);
- return 0;
-}
-static void
-in_setifarnh(struct radix_node_head *rnh, uint32_t fibnum, int af,
- void *_arg)
-{
- struct in_ifadown_arg *arg;
-
- arg = (struct in_ifadown_arg *)_arg;
+ if ((rt->rt_flags & RTF_STATIC) != 0 && ap->del == 0)
+ return (0);
- arg->rnh = rnh;
+ return (1);
}
void
@@ -213,7 +176,7 @@ in_ifadown(struct ifaddr *ifa, int delete)
arg.ifa = ifa;
arg.del = delete;
- rt_foreach_fib_walk(AF_INET, in_setifarnh, in_ifadownkill, &arg);
+ rt_foreach_fib_walk_del(AF_INET, in_ifadownkill, &arg);
ifa->ifa_flags &= ~IFA_ROUTE; /* XXXlocking? */
}
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c
index 9c72d8b..b0d34f2 100644
--- a/sys/netinet/sctp_indata.c
+++ b/sys/netinet/sctp_indata.c
@@ -2763,6 +2763,11 @@ sctp_process_segment_range(struct sctp_tcb *stcb, struct sctp_tmit_chunk **p_tp1
panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number);
#endif
}
+ if ((stcb->asoc.strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) &&
+ (stcb->asoc.strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&stcb->asoc.strmout[tp1->rec.data.stream_number].outqueue)) {
+ stcb->asoc.trigger_reset = 1;
+ }
tp1->sent = SCTP_DATAGRAM_NR_ACKED;
if (tp1->data) {
/*
@@ -3736,6 +3741,11 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
#endif
}
}
+ if ((asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) &&
+ (asoc->strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.stream_number].outqueue)) {
+ asoc->trigger_reset = 1;
+ }
TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
if (tp1->data) {
/* sa_ignore NO_NULL_CHK */
@@ -4461,6 +4471,11 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
#endif
}
}
+ if ((asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues == 0) &&
+ (asoc->strmout[tp1->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&asoc->strmout[tp1->rec.data.stream_number].outqueue)) {
+ asoc->trigger_reset = 1;
+ }
TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next);
if (PR_SCTP_ENABLED(tp1->flags)) {
if (asoc->pr_sctp_cnt != 0)
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 441f219..32788d3 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -521,7 +521,6 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset,
/* calculate the RTO */
net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy,
SCTP_RTT_FROM_NON_DATA);
-
retval = sctp_send_cookie_echo(m, offset, stcb, net);
if (retval < 0) {
/*
@@ -2347,12 +2346,17 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL);
}
(void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
- if ((netp) && (*netp)) {
+ if ((netp != NULL) && (*netp != NULL)) {
/* calculate the RTT and set the encaps port */
(*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp,
&cookie->time_entered, sctp_align_unsafe_makecopy,
SCTP_RTT_FROM_NON_DATA);
+#if defined(INET) || defined(INET6)
+ if (((*netp)->port == 0) && (port != 0)) {
+ sctp_pathmtu_adjustment(stcb, (*netp)->mtu - sizeof(struct udphdr));
+ }
(*netp)->port = port;
+#endif
}
/* respond with a COOKIE-ACK */
sctp_send_cookie_ack(stcb);
@@ -3647,6 +3651,7 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb,
* Set it up so we don't stop
* retransmitting
*/
+ asoc->stream_reset_outstanding++;
stcb->asoc.str_reset_seq_out--;
asoc->stream_reset_out_is_outstanding = 1;
no_clear = 1;
@@ -5845,7 +5850,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
*/
inp = stcb->sctp_ep;
#if defined(INET) || defined(INET6)
- if ((net) && (port)) {
+ if ((net != NULL) && (port != 0)) {
if (net->port == 0) {
sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr));
}
@@ -6020,7 +6025,7 @@ trigger_send:
if (!TAILQ_EMPTY(&stcb->asoc.control_send_queue)) {
cnt_ctrl_ready = stcb->asoc.ctrl_queue_cnt - stcb->asoc.ecn_echo_cnt_onq;
}
- if (cnt_ctrl_ready ||
+ if (cnt_ctrl_ready || stcb->asoc.trigger_reset ||
((un_sent) &&
(stcb->asoc.peers_rwnd > 0 ||
(stcb->asoc.peers_rwnd <= 0 && stcb->asoc.total_flight == 0)))) {
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 7d13aa2..55e049f 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -7169,7 +7169,8 @@ one_more_time:
}
atomic_subtract_int(&asoc->stream_queue_cnt, 1);
TAILQ_REMOVE(&strq->outqueue, sp, next);
- if (strq->state == SCTP_STREAM_RESET_PENDING &&
+ if ((strq->state == SCTP_STREAM_RESET_PENDING) &&
+ (strq->chunks_on_queues == 0) &&
TAILQ_EMPTY(&strq->outqueue)) {
stcb->asoc.trigger_reset = 1;
}
@@ -7571,7 +7572,8 @@ dont_do_it:
send_lock_up = 1;
}
TAILQ_REMOVE(&strq->outqueue, sp, next);
- if (strq->state == SCTP_STREAM_RESET_PENDING &&
+ if ((strq->state == SCTP_STREAM_RESET_PENDING) &&
+ (strq->chunks_on_queues == 0) &&
TAILQ_EMPTY(&strq->outqueue)) {
stcb->asoc.trigger_reset = 1;
}
@@ -9895,7 +9897,6 @@ sctp_chunk_output(struct sctp_inpcb *inp,
asoc = &stcb->asoc;
do_it_again:
/* The Nagle algorithm is only applied when handling a send call. */
- stcb->asoc.trigger_reset = 0;
if (from_where == SCTP_OUTPUT_FROM_USR_SEND) {
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NODELAY)) {
nagle_on = 0;
@@ -9912,7 +9913,8 @@ do_it_again:
if ((un_sent <= 0) &&
(TAILQ_EMPTY(&asoc->control_send_queue)) &&
(TAILQ_EMPTY(&asoc->asconf_send_queue)) &&
- (asoc->sent_queue_retran_cnt == 0)) {
+ (asoc->sent_queue_retran_cnt == 0) &&
+ (asoc->trigger_reset == 0)) {
/* Nothing to do unless there is something to be sent left */
return;
}
@@ -11561,7 +11563,8 @@ sctp_add_stream_reset_out(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk,
/* now how long will this param be? */
for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) &&
- (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) {
+ (stcb->asoc.strmout[i].chunks_on_queues == 0) &&
+ TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
number_entries++;
}
}
@@ -11584,7 +11587,8 @@ sctp_add_stream_reset_out(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk,
if (number_entries) {
for (i = 0; i < stcb->asoc.streamoutcnt; i++) {
if ((stcb->asoc.strmout[i].state == SCTP_STREAM_RESET_PENDING) &&
- (TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue))) {
+ (stcb->asoc.strmout[i].chunks_on_queues == 0) &&
+ TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) {
req_out->list_of_streams[at] = htons(i);
at++;
stcb->asoc.strmout[i].state = SCTP_STREAM_RESET_IN_FLIGHT;
@@ -11881,6 +11885,7 @@ sctp_send_stream_reset_out_if_possible(struct sctp_tcb *stcb, int so_locked)
uint32_t seq;
asoc = &stcb->asoc;
+ asoc->trigger_reset = 0;
if (asoc->stream_reset_outstanding) {
return (EALREADY);
}
@@ -12049,7 +12054,7 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb,
oldstream = stcb->asoc.strmout;
/* get some more */
SCTP_MALLOC(stcb->asoc.strmout, struct sctp_stream_out *,
- ((stcb->asoc.streamoutcnt + adding_o) * sizeof(struct sctp_stream_out)),
+ (stcb->asoc.streamoutcnt + adding_o) * sizeof(struct sctp_stream_out),
SCTP_M_STRMO);
if (stcb->asoc.strmout == NULL) {
uint8_t x;
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index bbb7306..0d684b3 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -442,6 +442,11 @@ sctp_recover_sent_list(struct sctp_tcb *stcb)
asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--;
}
}
+ if ((asoc->strmout[chk->rec.data.stream_number].chunks_on_queues == 0) &&
+ (asoc->strmout[chk->rec.data.stream_number].state == SCTP_STREAM_RESET_PENDING) &&
+ TAILQ_EMPTY(&asoc->strmout[chk->rec.data.stream_number].outqueue)) {
+ asoc->trigger_reset = 1;
+ }
TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next);
if (PR_SCTP_ENABLED(chk->flags)) {
if (asoc->pr_sctp_cnt != 0)
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 6a474e3..eafa2c9 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -4651,11 +4651,20 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
error = sctp_send_str_reset_req(stcb, strrst->srs_number_streams,
strrst->srs_stream_list,
send_in, 0, 0, 0, 0, 0);
- } else
+ } else {
error = sctp_send_stream_reset_out_if_possible(stcb, SCTP_SO_LOCKED);
- if (!error)
+ }
+ if (error == 0) {
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_STRRST_REQ, SCTP_SO_LOCKED);
-
+ } else {
+ /*
+ * For outgoing streams don't report any
+ * problems in sending the request to the
+ * application. XXX: Double check resetting
+ * incoming streams.
+ */
+ error = 0;
+ }
SCTP_TCB_UNLOCK(stcb);
break;
}
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index cae0e26..8d8f375 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -6957,6 +6957,18 @@ sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *inp,
for (last = m; last->m_next; last = last->m_next);
last->m_next = sp;
m->m_pkthdr.len += sp->m_pkthdr.len;
+ /*
+ * The CSUM_DATA_VALID flags indicates that the HW checked the UDP
+ * checksum and it was valid. Since CSUM_DATA_VALID ==
+ * CSUM_SCTP_VALID this would imply that the HW also verified the
+ * SCTP checksum. Therefore, clear the bit.
+ */
+ SCTPDBG(SCTP_DEBUG_CRCOFFLOAD,
+ "sctp_recv_udp_tunneled_packet(): Packet of length %d received on %s with csum_flags 0x%b.\n",
+ m->m_pkthdr.len,
+ if_name(m->m_pkthdr.rcvif),
+ (int)m->m_pkthdr.csum_flags, CSUM_BITS);
+ m->m_pkthdr.csum_flags &= ~CSUM_DATA_VALID;
iph = mtod(m, struct ip *);
switch (iph->ip_v) {
#ifdef INET
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 615fb19..3c4cc99 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -2985,6 +2985,15 @@ mld_v2_dispatch_general_query(struct mld_ifsoftc *mli)
KASSERT(mli->mli_version == MLD_VERSION_2,
("%s: called when version %d", __func__, mli->mli_version));
+ /*
+ * Check that there are some packets queued. If so, send them first.
+ * For large number of groups the reply to general query can take
+ * many packets, we should finish sending them before starting of
+ * queuing the new reply.
+ */
+ if (mbufq_len(&mli->mli_gq) != 0)
+ goto send;
+
ifp = mli->mli_ifp;
IF_ADDR_RLOCK(ifp);
@@ -3020,6 +3029,7 @@ mld_v2_dispatch_general_query(struct mld_ifsoftc *mli)
}
IF_ADDR_RUNLOCK(ifp);
+send:
mld_dispatch_queue(&mli->mli_gq, MLD_MAX_RESPONSE_BURST);
/*
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 8ead873..a925470 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1307,6 +1307,15 @@ nd6_free(struct llentry *ln, int gc)
llentry_free(ln);
}
+static int
+nd6_isdynrte(const struct rtentry *rt, void *xap)
+{
+
+ if (rt->rt_flags == (RTF_UP | RTF_HOST | RTF_DYNAMIC))
+ return (1);
+
+ return (0);
+}
/*
* Remove the rtentry for the given llentry,
* both of which were installed by a redirect.
@@ -1315,26 +1324,16 @@ static void
nd6_free_redirect(const struct llentry *ln)
{
int fibnum;
- struct rtentry *rt;
- struct radix_node_head *rnh;
struct sockaddr_in6 sin6;
+ struct rt_addrinfo info;
lltable_fill_sa_entry(ln, (struct sockaddr *)&sin6);
- for (fibnum = 0; fibnum < rt_numfibs; fibnum++) {
- rnh = rt_tables_get_rnh(fibnum, AF_INET6);
- if (rnh == NULL)
- continue;
+ memset(&info, 0, sizeof(info));
+ info.rti_info[RTAX_DST] = (struct sockaddr *)&sin6;
+ info.rti_filter = nd6_isdynrte;
- RADIX_NODE_HEAD_LOCK(rnh);
- rt = in6_rtalloc1((struct sockaddr *)&sin6, 0,
- RTF_RNH_LOCKED, fibnum);
- if (rt) {
- if (rt->rt_flags == (RTF_UP | RTF_HOST | RTF_DYNAMIC))
- rt_expunge(rnh, rt);
- RTFREE_LOCKED(rt);
- }
- RADIX_NODE_HEAD_UNLOCK(rnh);
- }
+ for (fibnum = 0; fibnum < rt_numfibs; fibnum++)
+ rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum);
}
/*
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index cbcca46..b57cf15 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -88,7 +88,7 @@ static void in6_init_address_ltimes(struct nd_prefix *,
static int nd6_prefix_onlink(struct nd_prefix *);
static int nd6_prefix_offlink(struct nd_prefix *);
-static int rt6_deleteroute(struct rtentry *, void *);
+static int rt6_deleteroute(const struct rtentry *, void *);
VNET_DECLARE(int, nd6_recalc_reachtm_interval);
#define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval)
@@ -2073,11 +2073,11 @@ rt6_flush(struct in6_addr *gateway, struct ifnet *ifp)
return;
/* XXX Do we really need to walk any but the default FIB? */
- rt_foreach_fib_walk(AF_INET6, NULL, rt6_deleteroute, (void *)gateway);
+ rt_foreach_fib_walk_del(AF_INET6, rt6_deleteroute, (void *)gateway);
}
static int
-rt6_deleteroute(struct rtentry *rt, void *arg)
+rt6_deleteroute(const struct rtentry *rt, void *arg)
{
#define SIN6(s) ((struct sockaddr_in6 *)s)
struct in6_addr *gate = (struct in6_addr *)arg;
@@ -2104,8 +2104,7 @@ rt6_deleteroute(struct rtentry *rt, void *arg)
if ((rt->rt_flags & RTF_HOST) == 0)
return (0);
- return (in6_rtrequest(RTM_DELETE, rt_key(rt), rt->rt_gateway,
- rt_mask(rt), rt->rt_flags | RTF_RNH_LOCKED, NULL, rt->rt_fibnum));
+ return (1);
#undef SIN6
}
diff --git a/sys/nfs/nfssvc.h b/sys/nfs/nfssvc.h
index 65b1681..a194ed5 100644
--- a/sys/nfs/nfssvc.h
+++ b/sys/nfs/nfssvc.h
@@ -69,6 +69,7 @@
#define NFSSVC_SUSPENDNFSD 0x04000000
#define NFSSVC_RESUMENFSD 0x08000000
#define NFSSVC_DUMPMNTOPTS 0x10000000
+#define NFSSVC_NEWSTRUCT 0x20000000
/* Argument structure for NFSSVC_DUMPMNTOPTS. */
struct nfscl_dumpmntopts {
diff --git a/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c b/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c
index ab059a6..f571bd6 100644
--- a/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c
+++ b/sys/ofed/drivers/infiniband/hw/mthca/mthca_reset.c
@@ -43,9 +43,13 @@ int mthca_reset(struct mthca_dev *mdev)
int i;
int err = 0;
u32 *hca_header = NULL;
+#ifdef __linux__
u32 *bridge_header = NULL;
+#endif
struct pci_dev *bridge = NULL;
+#ifdef __linux__
int bridge_pcix_cap = 0;
+#endif
int hca_pcie_cap = 0;
int hca_pcix_cap = 0;
@@ -195,6 +199,7 @@ int mthca_reset(struct mthca_dev *mdev)
}
good:
+#ifdef __linux__
/* Now restore the PCI headers */
if (bridge) {
if (pci_write_config_dword(bridge, bridge_pcix_cap + 0x8,
@@ -235,6 +240,7 @@ good:
goto out;
}
}
+#endif
if (hca_pcix_cap) {
if (pci_write_config_dword(mdev->pdev, hca_pcix_cap,
@@ -289,8 +295,8 @@ out:
#ifdef __linux__
if (bridge)
pci_dev_put(bridge);
-#endif
kfree(bridge_header);
+#endif
kfree(hca_header);
return err;
diff --git a/sys/ofed/drivers/net/mlx4/en_ethtool.c b/sys/ofed/drivers/net/mlx4/en_ethtool.c
deleted file mode 100644
index 3ebeaf4..0000000
--- a/sys/ofed/drivers/net/mlx4/en_ethtool.c
+++ /dev/null
@@ -1,1616 +0,0 @@
-/*
- * Copyright (c) 2007, 2014 Mellanox Technologies. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses. You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * - 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.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
-#include <linux/mlx4/driver.h>
-#include <linux/in.h>
-#include <net/ip.h>
-#include <linux/bitmap.h>
-
-#include "mlx4_en.h"
-#include "en_port.h"
-
-#define EN_ETHTOOL_QP_ATTACH (1ull << 63)
-
-union mlx4_ethtool_flow_union {
- struct ethtool_tcpip4_spec tcp_ip4_spec;
- struct ethtool_tcpip4_spec udp_ip4_spec;
- struct ethtool_tcpip4_spec sctp_ip4_spec;
- struct ethtool_ah_espip4_spec ah_ip4_spec;
- struct ethtool_ah_espip4_spec esp_ip4_spec;
- struct ethtool_usrip4_spec usr_ip4_spec;
- struct ethhdr ether_spec;
- __u8 hdata[52];
-};
-
-struct mlx4_ethtool_flow_ext {
- __u8 padding[2];
- unsigned char h_dest[ETH_ALEN];
- __be16 vlan_etype;
- __be16 vlan_tci;
- __be32 data[2];
-};
-
-struct mlx4_ethtool_rx_flow_spec {
- __u32 flow_type;
- union mlx4_ethtool_flow_union h_u;
- struct mlx4_ethtool_flow_ext h_ext;
- union mlx4_ethtool_flow_union m_u;
- struct mlx4_ethtool_flow_ext m_ext;
- __u64 ring_cookie;
- __u32 location;
-};
-
-struct mlx4_ethtool_rxnfc {
- __u32 cmd;
- __u32 flow_type;
- __u64 data;
- struct mlx4_ethtool_rx_flow_spec fs;
- __u32 rule_cnt;
- __u32 rule_locs[0];
-};
-
-#ifndef FLOW_MAC_EXT
-#define FLOW_MAC_EXT 0x40000000
-#endif
-
-static void
-mlx4_en_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
-
- strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
- strlcpy(drvinfo->version, DRV_VERSION " (" DRV_RELDATE ")",
- sizeof(drvinfo->version));
- snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
- "%d.%d.%d",
- (u16) (mdev->dev->caps.fw_ver >> 32),
- (u16) ((mdev->dev->caps.fw_ver >> 16) & 0xffff),
- (u16) (mdev->dev->caps.fw_ver & 0xffff));
- strlcpy(drvinfo->bus_info, pci_name(mdev->dev->pdev),
- sizeof(drvinfo->bus_info));
- drvinfo->n_stats = 0;
- drvinfo->regdump_len = 0;
- drvinfo->eedump_len = 0;
-}
-
-static const char main_strings[][ETH_GSTRING_LEN] = {
- /* packet statistics */
- "rx_packets",
- "rx_bytes",
- "rx_multicast_packets",
- "rx_broadcast_packets",
- "rx_errors",
- "rx_dropped",
- "rx_length_errors",
- "rx_over_errors",
- "rx_crc_errors",
- "rx_jabbers",
- "rx_in_range_length_error",
- "rx_out_range_length_error",
- "rx_lt_64_bytes_packets",
- "rx_127_bytes_packets",
- "rx_255_bytes_packets",
- "rx_511_bytes_packets",
- "rx_1023_bytes_packets",
- "rx_1518_bytes_packets",
- "rx_1522_bytes_packets",
- "rx_1548_bytes_packets",
- "rx_gt_1548_bytes_packets",
- "tx_packets",
- "tx_bytes",
- "tx_multicast_packets",
- "tx_broadcast_packets",
- "tx_errors",
- "tx_dropped",
- "tx_lt_64_bytes_packets",
- "tx_127_bytes_packets",
- "tx_255_bytes_packets",
- "tx_511_bytes_packets",
- "tx_1023_bytes_packets",
- "tx_1518_bytes_packets",
- "tx_1522_bytes_packets",
- "tx_1548_bytes_packets",
- "tx_gt_1548_bytes_packets",
- "rx_prio_0_packets", "rx_prio_0_bytes",
- "rx_prio_1_packets", "rx_prio_1_bytes",
- "rx_prio_2_packets", "rx_prio_2_bytes",
- "rx_prio_3_packets", "rx_prio_3_bytes",
- "rx_prio_4_packets", "rx_prio_4_bytes",
- "rx_prio_5_packets", "rx_prio_5_bytes",
- "rx_prio_6_packets", "rx_prio_6_bytes",
- "rx_prio_7_packets", "rx_prio_7_bytes",
- "rx_novlan_packets", "rx_novlan_bytes",
- "tx_prio_0_packets", "tx_prio_0_bytes",
- "tx_prio_1_packets", "tx_prio_1_bytes",
- "tx_prio_2_packets", "tx_prio_2_bytes",
- "tx_prio_3_packets", "tx_prio_3_bytes",
- "tx_prio_4_packets", "tx_prio_4_bytes",
- "tx_prio_5_packets", "tx_prio_5_bytes",
- "tx_prio_6_packets", "tx_prio_6_bytes",
- "tx_prio_7_packets", "tx_prio_7_bytes",
- "tx_novlan_packets", "tx_novlan_bytes",
-
- /* flow control statistics */
- "rx_pause_prio_0", "rx_pause_duration_prio_0",
- "rx_pause_transition_prio_0", "tx_pause_prio_0",
- "tx_pause_duration_prio_0", "tx_pause_transition_prio_0",
- "rx_pause_prio_1", "rx_pause_duration_prio_1",
- "rx_pause_transition_prio_1", "tx_pause_prio_1",
- "tx_pause_duration_prio_1", "tx_pause_transition_prio_1",
- "rx_pause_prio_2", "rx_pause_duration_prio_2",
- "rx_pause_transition_prio_2", "tx_pause_prio_2",
- "tx_pause_duration_prio_2", "tx_pause_transition_prio_2",
- "rx_pause_prio_3", "rx_pause_duration_prio_3",
- "rx_pause_transition_prio_3", "tx_pause_prio_3",
- "tx_pause_duration_prio_3", "tx_pause_transition_prio_3",
- "rx_pause_prio_4", "rx_pause_duration_prio_4",
- "rx_pause_transition_prio_4", "tx_pause_prio_4",
- "tx_pause_duration_prio_4", "tx_pause_transition_prio_4",
- "rx_pause_prio_5", "rx_pause_duration_prio_5",
- "rx_pause_transition_prio_5", "tx_pause_prio_5",
- "tx_pause_duration_prio_5", "tx_pause_transition_prio_5",
- "rx_pause_prio_6", "rx_pause_duration_prio_6",
- "rx_pause_transition_prio_6", "tx_pause_prio_6",
- "tx_pause_duration_prio_6", "tx_pause_transition_prio_6",
- "rx_pause_prio_7", "rx_pause_duration_prio_7",
- "rx_pause_transition_prio_7", "tx_pause_prio_7",
- "tx_pause_duration_prio_7", "tx_pause_transition_prio_7",
-
- /* VF statistics */
- "rx_packets",
- "rx_bytes",
- "rx_multicast_packets",
- "rx_broadcast_packets",
- "rx_errors",
- "rx_dropped",
- "tx_packets",
- "tx_bytes",
- "tx_multicast_packets",
- "tx_broadcast_packets",
- "tx_errors",
-
- /* VPort statistics */
- "vport_rx_unicast_packets",
- "vport_rx_unicast_bytes",
- "vport_rx_multicast_packets",
- "vport_rx_multicast_bytes",
- "vport_rx_broadcast_packets",
- "vport_rx_broadcast_bytes",
- "vport_rx_dropped",
- "vport_rx_errors",
- "vport_tx_unicast_packets",
- "vport_tx_unicast_bytes",
- "vport_tx_multicast_packets",
- "vport_tx_multicast_bytes",
- "vport_tx_broadcast_packets",
- "vport_tx_broadcast_bytes",
- "vport_tx_errors",
-
- /* port statistics */
- "tx_tso_packets",
- "tx_queue_stopped", "tx_wake_queue", "tx_timeout", "rx_alloc_failed",
- "rx_csum_good", "rx_csum_none", "tx_chksum_offload",
-};
-
-static const char mlx4_en_test_names[][ETH_GSTRING_LEN]= {
- "Interrupt Test",
- "Link Test",
- "Speed Test",
- "Register Test",
- "Loopback Test",
-};
-
-static u32 mlx4_en_get_msglevel(struct net_device *dev)
-{
- return ((struct mlx4_en_priv *) netdev_priv(dev))->msg_enable;
-}
-
-static void mlx4_en_set_msglevel(struct net_device *dev, u32 val)
-{
- ((struct mlx4_en_priv *) netdev_priv(dev))->msg_enable = val;
-}
-
-static void mlx4_en_get_wol(struct net_device *netdev,
- struct ethtool_wolinfo *wol)
-{
- struct mlx4_en_priv *priv = netdev_priv(netdev);
- int err = 0;
- u64 config = 0;
- u64 mask;
-
- if ((priv->port < 1) || (priv->port > 2)) {
- en_err(priv, "Failed to get WoL information\n");
- return;
- }
-
- mask = (priv->port == 1) ? MLX4_DEV_CAP_FLAG_WOL_PORT1 :
- MLX4_DEV_CAP_FLAG_WOL_PORT2;
-
- if (!(priv->mdev->dev->caps.flags & mask)) {
- wol->supported = 0;
- wol->wolopts = 0;
- return;
- }
-
- err = mlx4_wol_read(priv->mdev->dev, &config, priv->port);
- if (err) {
- en_err(priv, "Failed to get WoL information\n");
- return;
- }
-
- if (config & MLX4_EN_WOL_MAGIC)
- wol->supported = WAKE_MAGIC;
- else
- wol->supported = 0;
-
- if (config & MLX4_EN_WOL_ENABLED)
- wol->wolopts = WAKE_MAGIC;
- else
- wol->wolopts = 0;
-}
-
-static int mlx4_en_set_wol(struct net_device *netdev,
- struct ethtool_wolinfo *wol)
-{
- struct mlx4_en_priv *priv = netdev_priv(netdev);
- u64 config = 0;
- int err = 0;
- u64 mask;
-
- if ((priv->port < 1) || (priv->port > 2))
- return -EOPNOTSUPP;
-
- mask = (priv->port == 1) ? MLX4_DEV_CAP_FLAG_WOL_PORT1 :
- MLX4_DEV_CAP_FLAG_WOL_PORT2;
-
- if (!(priv->mdev->dev->caps.flags & mask))
- return -EOPNOTSUPP;
-
- if (wol->supported & ~WAKE_MAGIC)
- return -EINVAL;
-
- err = mlx4_wol_read(priv->mdev->dev, &config, priv->port);
- if (err) {
- en_err(priv, "Failed to get WoL info, unable to modify\n");
- return err;
- }
-
- if (wol->wolopts & WAKE_MAGIC) {
- config |= MLX4_EN_WOL_DO_MODIFY | MLX4_EN_WOL_ENABLED |
- MLX4_EN_WOL_MAGIC;
- } else {
- config &= ~(MLX4_EN_WOL_ENABLED | MLX4_EN_WOL_MAGIC);
- config |= MLX4_EN_WOL_DO_MODIFY;
- }
-
- err = mlx4_wol_write(priv->mdev->dev, config, priv->port);
- if (err)
- en_err(priv, "Failed to set WoL information\n");
-
- return err;
-}
-
-struct bitmap_sim_iterator {
- bool advance_array;
- unsigned long *stats_bitmap;
- unsigned int count;
- unsigned int j;
-};
-
-static inline void bitmap_sim_iterator_init(struct bitmap_sim_iterator *h,
- unsigned long *stats_bitmap,
- int count)
-{
- h->j = 0;
- h->advance_array = !bitmap_empty(stats_bitmap, count);
- h->count = h->advance_array ? bitmap_weight(stats_bitmap, count)
- : count;
- h->stats_bitmap = stats_bitmap;
-}
-
-static inline int bitmap_sim_iterator_test(struct bitmap_sim_iterator *h)
-{
- return !h->advance_array ? 1 : test_bit(h->j, h->stats_bitmap);
-}
-
-static inline int bitmap_sim_iterator_inc(struct bitmap_sim_iterator *h)
-{
- return h->j++;
-}
-
-static inline unsigned int bitmap_sim_iterator_count(
- struct bitmap_sim_iterator *h)
-{
- return h->count;
-}
-
-int mlx4_en_get_sset_count(struct net_device *dev, int sset)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct bitmap_sim_iterator it;
-
- int num_of_stats = NUM_ALL_STATS -
- ((priv->mdev->dev->caps.flags2 &
- MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) ? 0 : NUM_FLOW_STATS);
-
- bitmap_sim_iterator_init(&it, priv->stats_bitmap, num_of_stats);
-
- switch (sset) {
- case ETH_SS_STATS:
- return bitmap_sim_iterator_count(&it) +
- (priv->tx_ring_num * 2) +
-#ifdef LL_EXTENDED_STATS
- (priv->rx_ring_num * 5);
-#else
- (priv->rx_ring_num * 2);
-#endif
- case ETH_SS_TEST:
- return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags
- & MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2;
- default:
- return -EOPNOTSUPP;
- }
-}
-
-void mlx4_en_get_ethtool_stats(struct net_device *dev,
- struct ethtool_stats *stats, u64 *data)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- int index = 0;
- int i;
- struct bitmap_sim_iterator it;
-
- int num_of_stats = NUM_ALL_STATS -
- ((priv->mdev->dev->caps.flags2 &
- MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) ? 0 : NUM_FLOW_STATS);
-
- bitmap_sim_iterator_init(&it, priv->stats_bitmap, num_of_stats);
-
- if (!data || !priv->port_up)
- return;
-
- spin_lock_bh(&priv->stats_lock);
-
- for (i = 0; i < NUM_PKT_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- data[index++] =
- ((unsigned long *)&priv->pkstats)[i];
- for (i = 0; i < NUM_FLOW_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (priv->mdev->dev->caps.flags2 &
- MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN)
- if (bitmap_sim_iterator_test(&it))
- data[index++] =
- ((u64 *)&priv->flowstats)[i];
- for (i = 0; i < NUM_VF_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- data[index++] =
- ((unsigned long *)&priv->vf_stats)[i];
- for (i = 0; i < NUM_VPORT_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- data[index++] =
- ((unsigned long *)&priv->vport_stats)[i];
- for (i = 0; i < NUM_PORT_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- data[index++] =
- ((unsigned long *)&priv->port_stats)[i];
-
- for (i = 0; i < priv->tx_ring_num; i++) {
- data[index++] = priv->tx_ring[i]->packets;
- data[index++] = priv->tx_ring[i]->bytes;
- }
- for (i = 0; i < priv->rx_ring_num; i++) {
- data[index++] = priv->rx_ring[i]->packets;
- data[index++] = priv->rx_ring[i]->bytes;
-#ifdef LL_EXTENDED_STATS
- data[index++] = priv->rx_ring[i]->yields;
- data[index++] = priv->rx_ring[i]->misses;
- data[index++] = priv->rx_ring[i]->cleaned;
-#endif
- }
- spin_unlock_bh(&priv->stats_lock);
-
-}
-
-void mlx4_en_restore_ethtool_stats(struct mlx4_en_priv *priv, u64 *data)
-{
- int index = 0;
- int i;
- struct bitmap_sim_iterator it;
-
- int num_of_stats = NUM_ALL_STATS -
- ((priv->mdev->dev->caps.flags2 &
- MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) ? 0 : NUM_FLOW_STATS);
-
- bitmap_sim_iterator_init(&it, priv->stats_bitmap, num_of_stats);
-
- if (!data || !priv->port_up)
- return;
-
- spin_lock_bh(&priv->stats_lock);
-
- for (i = 0; i < NUM_PKT_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- ((unsigned long *)&priv->pkstats)[i] =
- data[index++];
- for (i = 0; i < NUM_FLOW_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (priv->mdev->dev->caps.flags2 &
- MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN)
- if (bitmap_sim_iterator_test(&it))
- ((u64 *)&priv->flowstats)[i] =
- data[index++];
- for (i = 0; i < NUM_VF_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- ((unsigned long *)&priv->vf_stats)[i] =
- data[index++];
- for (i = 0; i < NUM_VPORT_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- ((unsigned long *)&priv->vport_stats)[i] =
- data[index++];
- for (i = 0; i < NUM_PORT_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- ((unsigned long *)&priv->port_stats)[i] =
- data[index++];
-
- for (i = 0; i < priv->tx_ring_num; i++) {
- priv->tx_ring[i]->packets = data[index++];
- priv->tx_ring[i]->bytes = data[index++];
- }
- for (i = 0; i < priv->rx_ring_num; i++) {
- priv->rx_ring[i]->packets = data[index++];
- priv->rx_ring[i]->bytes = data[index++];
- }
- spin_unlock_bh(&priv->stats_lock);
-}
-
-static void mlx4_en_self_test(struct net_device *dev,
- struct ethtool_test *etest, u64 *buf)
-{
- mlx4_en_ex_selftest(dev, &etest->flags, buf);
-}
-
-static void mlx4_en_get_strings(struct net_device *dev,
- uint32_t stringset, uint8_t *data)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- int index = 0;
- int i, k;
- struct bitmap_sim_iterator it;
-
- int num_of_stats = NUM_ALL_STATS -
- ((priv->mdev->dev->caps.flags2 &
- MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) ? 0 : NUM_FLOW_STATS);
-
- bitmap_sim_iterator_init(&it, priv->stats_bitmap, num_of_stats);
-
- switch (stringset) {
- case ETH_SS_TEST:
- for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++)
- strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
- if (priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UC_LOOPBACK)
- for (; i < MLX4_EN_NUM_SELF_TEST; i++)
- strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
- break;
-
- case ETH_SS_STATS:
- /* Add main counters */
- for (i = 0; i < NUM_PKT_STATS; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[i]);
-
- for (k = 0; k < NUM_FLOW_STATS; k++,
- bitmap_sim_iterator_inc(&it))
- if (priv->mdev->dev->caps.flags2 &
- MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN)
- if (bitmap_sim_iterator_test(&it))
- strcpy(data + (index++) *
- ETH_GSTRING_LEN,
- main_strings[i + k]);
-
- for (; (i + k) < num_of_stats; i++,
- bitmap_sim_iterator_inc(&it))
- if (bitmap_sim_iterator_test(&it))
- strcpy(data + (index++) * ETH_GSTRING_LEN,
- main_strings[i + k]);
-
- for (i = 0; i < priv->tx_ring_num; i++) {
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "tx%d_packets", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "tx%d_bytes", i);
- }
- for (i = 0; i < priv->rx_ring_num; i++) {
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_packets", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_bytes", i);
-#ifdef LL_EXTENDED_STATS
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_napi_yield", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_misses", i);
- sprintf(data + (index++) * ETH_GSTRING_LEN,
- "rx%d_cleaned", i);
-#endif
- }
- break;
- }
-}
-
-static u32 mlx4_en_autoneg_get(struct net_device *dev)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- u32 autoneg = AUTONEG_DISABLE;
-
- if ((mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP) &&
- priv->port_state.autoneg) {
- autoneg = AUTONEG_ENABLE;
- }
-
- return autoneg;
-}
-
-static int mlx4_en_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- int trans_type;
-
- /* SUPPORTED_1000baseT_Half isn't supported */
- cmd->supported = SUPPORTED_1000baseT_Full
- |SUPPORTED_10000baseT_Full;
-
- cmd->advertising = ADVERTISED_1000baseT_Full
- |ADVERTISED_10000baseT_Full;
-
- cmd->supported |= SUPPORTED_1000baseKX_Full
- |SUPPORTED_10000baseKX4_Full
- |SUPPORTED_10000baseKR_Full
- |SUPPORTED_10000baseR_FEC
- |SUPPORTED_40000baseKR4_Full
- |SUPPORTED_40000baseCR4_Full
- |SUPPORTED_40000baseSR4_Full
- |SUPPORTED_40000baseLR4_Full;
-
- /* ADVERTISED_1000baseT_Half isn't advertised */
- cmd->advertising |= ADVERTISED_1000baseKX_Full
- |ADVERTISED_10000baseKX4_Full
- |ADVERTISED_10000baseKR_Full
- |ADVERTISED_10000baseR_FEC
- |ADVERTISED_40000baseKR4_Full
- |ADVERTISED_40000baseCR4_Full
- |ADVERTISED_40000baseSR4_Full
- |ADVERTISED_40000baseLR4_Full;
-
- if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
- return -ENOMEM;
-
- cmd->autoneg = mlx4_en_autoneg_get(dev);
- if (cmd->autoneg == AUTONEG_ENABLE) {
- cmd->supported |= SUPPORTED_Autoneg;
- cmd->advertising |= ADVERTISED_Autoneg;
- }
-
- trans_type = priv->port_state.transciver;
- if (netif_carrier_ok(dev)) {
- ethtool_cmd_speed_set(cmd, priv->port_state.link_speed);
- cmd->duplex = DUPLEX_FULL;
- } else {
- ethtool_cmd_speed_set(cmd, -1);
- cmd->duplex = -1;
- }
-
- if (trans_type > 0 && trans_type <= 0xC) {
- cmd->port = PORT_FIBRE;
- cmd->transceiver = XCVR_EXTERNAL;
- cmd->supported |= SUPPORTED_FIBRE;
- cmd->advertising |= ADVERTISED_FIBRE;
- } else if (trans_type == 0x80 || trans_type == 0) {
- cmd->port = PORT_TP;
- cmd->transceiver = XCVR_INTERNAL;
- cmd->supported |= SUPPORTED_TP;
- cmd->advertising |= ADVERTISED_TP;
- } else {
- cmd->port = -1;
- cmd->transceiver = -1;
- }
- return 0;
-}
-
-static const char *mlx4_en_duplex_to_string(int duplex)
-{
- switch (duplex) {
- case DUPLEX_FULL:
- return "FULL";
- case DUPLEX_HALF:
- return "HALF";
- default:
- break;
- }
- return "UNKNOWN";
-}
-
-static int mlx4_en_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_port_state *port_state = &priv->port_state;
-
- if ((cmd->autoneg != port_state->autoneg) ||
- (ethtool_cmd_speed(cmd) != port_state->link_speed) ||
- (cmd->duplex != DUPLEX_FULL)) {
- en_info(priv, "Changing port state properties (auto-negotiation"
- " , speed/duplex) is not supported. Current:"
- " auto-negotiation=%d speed/duplex=%d/%s\n",
- port_state->autoneg, port_state->link_speed,
- mlx4_en_duplex_to_string(DUPLEX_FULL));
- return -EOPNOTSUPP;
- }
-
- /* User provided same port state properties that are currently set.
- * Nothing to change
- */
- return 0;
-}
-
-static int mlx4_en_get_coalesce(struct net_device *dev,
- struct ethtool_coalesce *coal)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
-
- coal->tx_coalesce_usecs = priv->tx_usecs;
- coal->tx_max_coalesced_frames = priv->tx_frames;
- coal->rx_coalesce_usecs = priv->rx_usecs;
- coal->rx_max_coalesced_frames = priv->rx_frames;
-
- coal->pkt_rate_low = priv->pkt_rate_low;
- coal->rx_coalesce_usecs_low = priv->rx_usecs_low;
- coal->pkt_rate_high = priv->pkt_rate_high;
- coal->rx_coalesce_usecs_high = priv->rx_usecs_high;
- coal->rate_sample_interval = priv->sample_interval;
- coal->use_adaptive_rx_coalesce = priv->adaptive_rx_coal;
- return 0;
-}
-
-static int mlx4_en_set_coalesce(struct net_device *dev,
- struct ethtool_coalesce *coal)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- int err, i;
-
- priv->rx_frames = (coal->rx_max_coalesced_frames ==
- MLX4_EN_AUTO_CONF) ?
- MLX4_EN_RX_COAL_TARGET /
- priv->dev->mtu + 1 :
- coal->rx_max_coalesced_frames;
- priv->rx_usecs = (coal->rx_coalesce_usecs ==
- MLX4_EN_AUTO_CONF) ?
- MLX4_EN_RX_COAL_TIME :
- coal->rx_coalesce_usecs;
-
- /* Setting TX coalescing parameters */
- if (coal->tx_coalesce_usecs != priv->tx_usecs ||
- coal->tx_max_coalesced_frames != priv->tx_frames) {
- priv->tx_usecs = coal->tx_coalesce_usecs;
- priv->tx_frames = coal->tx_max_coalesced_frames;
- if (priv->port_up) {
- for (i = 0; i < priv->tx_ring_num; i++) {
- priv->tx_cq[i]->moder_cnt = priv->tx_frames;
- priv->tx_cq[i]->moder_time = priv->tx_usecs;
- if (mlx4_en_set_cq_moder(priv, priv->tx_cq[i]))
- en_warn(priv, "Failed changing moderation for TX cq %d\n", i);
- }
- }
- }
-
- /* Set adaptive coalescing params */
- priv->pkt_rate_low = coal->pkt_rate_low;
- priv->rx_usecs_low = coal->rx_coalesce_usecs_low;
- priv->pkt_rate_high = coal->pkt_rate_high;
- priv->rx_usecs_high = coal->rx_coalesce_usecs_high;
- priv->sample_interval = coal->rate_sample_interval;
- priv->adaptive_rx_coal = coal->use_adaptive_rx_coalesce;
- if (priv->adaptive_rx_coal)
- return 0;
-
- if (priv->port_up) {
- for (i = 0; i < priv->rx_ring_num; i++) {
- priv->rx_cq[i]->moder_cnt = priv->rx_frames;
- priv->rx_cq[i]->moder_time = priv->rx_usecs;
- priv->last_moder_time[i] = MLX4_EN_AUTO_CONF;
- err = mlx4_en_set_cq_moder(priv, priv->rx_cq[i]);
- if (err)
- return err;
- }
- }
-
- return 0;
-}
-
-static int mlx4_en_set_pauseparam(struct net_device *dev,
- struct ethtool_pauseparam *pause)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- int err;
-
- if (pause->autoneg)
- return -EOPNOTSUPP;
-
- priv->prof->tx_pause = pause->tx_pause != 0;
- priv->prof->rx_pause = pause->rx_pause != 0;
- err = mlx4_SET_PORT_general(mdev->dev, priv->port,
- priv->rx_skb_size + ETH_FCS_LEN,
- priv->prof->tx_pause,
- priv->prof->tx_ppp,
- priv->prof->rx_pause,
- priv->prof->rx_ppp);
- if (err)
- en_err(priv, "Failed setting pause params\n");
-
- return err;
-}
-
-static void mlx4_en_get_pauseparam(struct net_device *dev,
- struct ethtool_pauseparam *pause)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
-
- pause->tx_pause = priv->prof->tx_pause;
- pause->rx_pause = priv->prof->rx_pause;
- pause->autoneg = mlx4_en_autoneg_get(dev);
-}
-
-/* rtnl lock must be taken before calling */
-int mlx4_en_pre_config(struct mlx4_en_priv *priv)
-{
-#ifdef CONFIG_RFS_ACCEL
- struct cpu_rmap *rmap;
-
- if (!priv->dev->rx_cpu_rmap)
- return 0;
-
- /* Disable RFS events
- * Must have all RFS jobs flushed before freeing resources
- */
- rmap = priv->dev->rx_cpu_rmap;
- priv->dev->rx_cpu_rmap = NULL;
-
- rtnl_unlock();
- free_irq_cpu_rmap(rmap);
- rtnl_lock();
-
- if (priv->dev->rx_cpu_rmap)
- return -EBUSY; /* another configuration completed while lock
- * was free
- */
-
- /* Make sure all currently running filter_work are being processed
- * Other work will return immediatly because of disable_rfs
- */
- flush_workqueue(priv->mdev->workqueue);
-
-#endif
-
- return 0;
-}
-
-static int mlx4_en_set_ringparam(struct net_device *dev,
- struct ethtool_ringparam *param)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- u32 rx_size, tx_size;
- int port_up = 0;
- int err = 0;
- int i, n_stats;
- u64 *data = NULL;
-
- if (!priv->port_up)
- return -ENOMEM;
-
- if (param->rx_jumbo_pending || param->rx_mini_pending)
- return -EINVAL;
-
- rx_size = roundup_pow_of_two(param->rx_pending);
- rx_size = max_t(u32, rx_size, MLX4_EN_MIN_RX_SIZE);
- rx_size = min_t(u32, rx_size, MLX4_EN_MAX_RX_SIZE);
- tx_size = roundup_pow_of_two(param->tx_pending);
- tx_size = max_t(u32, tx_size, MLX4_EN_MIN_TX_SIZE);
- tx_size = min_t(u32, tx_size, MLX4_EN_MAX_TX_SIZE);
-
- if (rx_size == (priv->port_up ? priv->rx_ring[0]->actual_size :
- priv->rx_ring[0]->size) &&
- tx_size == priv->tx_ring[0]->size)
- return 0;
- err = mlx4_en_pre_config(priv);
- if (err)
- return err;
-
- mutex_lock(&mdev->state_lock);
- if (priv->port_up) {
- port_up = 1;
- mlx4_en_stop_port(dev);
- }
-
- /* Cache port statistics */
- n_stats = mlx4_en_get_sset_count(dev, ETH_SS_STATS);
- if (n_stats > 0) {
- data = kmalloc(n_stats * sizeof(u64), GFP_KERNEL);
- if (data)
- mlx4_en_get_ethtool_stats(dev, NULL, data);
- }
-
- mlx4_en_free_resources(priv);
-
- priv->prof->tx_ring_size = tx_size;
- priv->prof->rx_ring_size = rx_size;
-
- err = mlx4_en_alloc_resources(priv);
- if (err) {
- en_err(priv, "Failed reallocating port resources\n");
- goto out;
- }
-
- /* Restore port statistics */
- if (n_stats > 0 && data)
- mlx4_en_restore_ethtool_stats(priv, data);
-
- if (port_up) {
- err = mlx4_en_start_port(dev);
- if (err) {
- en_err(priv, "Failed starting port\n");
- goto out;
- }
-
- for (i = 0; i < priv->rx_ring_num; i++) {
- priv->rx_cq[i]->moder_cnt = priv->rx_frames;
- priv->rx_cq[i]->moder_time = priv->rx_usecs;
- priv->last_moder_time[i] = MLX4_EN_AUTO_CONF;
- err = mlx4_en_set_cq_moder(priv, priv->rx_cq[i]);
- if (err)
- goto out;
- }
- }
-
-out:
- kfree(data);
- mutex_unlock(&mdev->state_lock);
- return err;
-}
-
-static void mlx4_en_get_ringparam(struct net_device *dev,
- struct ethtool_ringparam *param)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
-
- if (!priv->port_up)
- return;
-
- memset(param, 0, sizeof(*param));
- param->rx_max_pending = MLX4_EN_MAX_RX_SIZE;
- param->tx_max_pending = MLX4_EN_MAX_TX_SIZE;
- param->rx_pending = priv->port_up ?
- priv->rx_ring[0]->actual_size : priv->rx_ring[0]->size;
- param->tx_pending = priv->tx_ring[0]->size;
-}
-
-static u32 mlx4_en_get_rxfh_indir_size(struct net_device *dev)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
-
- return priv->rx_ring_num;
-}
-
-static int mlx4_en_get_rxfh_indir(struct net_device *dev, u32 *ring_index)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_rss_map *rss_map = &priv->rss_map;
- int rss_rings;
- size_t n = priv->rx_ring_num;
- int err = 0;
-
- rss_rings = priv->prof->rss_rings ?: priv->rx_ring_num;
- rss_rings = 1 << ilog2(rss_rings);
-
- while (n--) {
- ring_index[n] = rss_map->qps[n % rss_rings].qpn -
- rss_map->base_qpn;
- }
-
- return err;
-}
-
-static int mlx4_en_set_rxfh_indir(struct net_device *dev,
- const u32 *ring_index)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- int port_up = 0;
- int err = 0;
- int i;
- int rss_rings = 0;
-
- /* Calculate RSS table size and make sure flows are spread evenly
- * between rings
- */
- for (i = 0; i < priv->rx_ring_num; i++) {
- if (i > 0 && !ring_index[i] && !rss_rings)
- rss_rings = i;
-
- if (ring_index[i] != (i % (rss_rings ?: priv->rx_ring_num)))
- return -EINVAL;
- }
-
- if (!rss_rings)
- rss_rings = priv->rx_ring_num;
-
- /* RSS table size must be an order of 2 */
- if (!is_power_of_2(rss_rings))
- return -EINVAL;
-
- mutex_lock(&mdev->state_lock);
- if (priv->port_up) {
- port_up = 1;
- mlx4_en_stop_port(dev);
- }
-
- priv->prof->rss_rings = rss_rings;
-
- if (port_up) {
- err = mlx4_en_start_port(dev);
- if (err)
- en_err(priv, "Failed starting port\n");
- }
-
- mutex_unlock(&mdev->state_lock);
- return err;
-}
-
-#define all_zeros_or_all_ones(field) \
- ((field) == 0 || (field) == (__force typeof(field))-1)
-
-static int mlx4_en_validate_flow(struct net_device *dev,
- struct mlx4_ethtool_rxnfc *cmd)
-{
- struct ethtool_usrip4_spec *l3_mask;
- struct ethtool_tcpip4_spec *l4_mask;
- struct ethhdr *eth_mask;
-
- if (cmd->fs.location >= MAX_NUM_OF_FS_RULES)
- return -EINVAL;
-
- if (cmd->fs.flow_type & FLOW_MAC_EXT) {
- /* dest mac mask must be ff:ff:ff:ff:ff:ff */
- if (!is_broadcast_ether_addr(cmd->fs.m_ext.h_dest))
- return -EINVAL;
- }
-
- switch (cmd->fs.flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) {
- case TCP_V4_FLOW:
- case UDP_V4_FLOW:
- if (cmd->fs.m_u.tcp_ip4_spec.tos)
- return -EINVAL;
- l4_mask = &cmd->fs.m_u.tcp_ip4_spec;
- /* don't allow mask which isn't all 0 or 1 */
- if (!all_zeros_or_all_ones(l4_mask->ip4src) ||
- !all_zeros_or_all_ones(l4_mask->ip4dst) ||
- !all_zeros_or_all_ones(l4_mask->psrc) ||
- !all_zeros_or_all_ones(l4_mask->pdst))
- return -EINVAL;
- break;
- case IP_USER_FLOW:
- l3_mask = &cmd->fs.m_u.usr_ip4_spec;
- if (l3_mask->l4_4_bytes || l3_mask->tos || l3_mask->proto ||
- cmd->fs.h_u.usr_ip4_spec.ip_ver != ETH_RX_NFC_IP4 ||
- (!l3_mask->ip4src && !l3_mask->ip4dst) ||
- !all_zeros_or_all_ones(l3_mask->ip4src) ||
- !all_zeros_or_all_ones(l3_mask->ip4dst))
- return -EINVAL;
- break;
- case ETHER_FLOW:
- eth_mask = &cmd->fs.m_u.ether_spec;
- /* source mac mask must not be set */
- if (!is_zero_ether_addr(eth_mask->h_source))
- return -EINVAL;
-
- /* dest mac mask must be ff:ff:ff:ff:ff:ff */
- if (!is_broadcast_ether_addr(eth_mask->h_dest))
- return -EINVAL;
-
- if (!all_zeros_or_all_ones(eth_mask->h_proto))
- return -EINVAL;
- break;
- default:
- return -EINVAL;
- }
-
- if ((cmd->fs.flow_type & FLOW_EXT)) {
- if (cmd->fs.m_ext.vlan_etype ||
- !(cmd->fs.m_ext.vlan_tci == 0 ||
- cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff)))
- return -EINVAL;
- if (cmd->fs.m_ext.vlan_tci) {
- if (be16_to_cpu(cmd->fs.h_ext.vlan_tci) <
- VLAN_MIN_VALUE ||
- be16_to_cpu(cmd->fs.h_ext.vlan_tci) >
- VLAN_MAX_VALUE)
- return -EINVAL;
- }
- }
-
- return 0;
-}
-
-static int mlx4_en_ethtool_add_mac_rule(struct mlx4_ethtool_rxnfc *cmd,
- struct list_head *rule_list_h,
- struct mlx4_spec_list *spec_l2,
- unsigned char *mac)
-{
- int err = 0;
- __be64 mac_msk = cpu_to_be64(MLX4_MAC_MASK << 16);
-
- spec_l2->id = MLX4_NET_TRANS_RULE_ID_ETH;
- memcpy(spec_l2->eth.dst_mac_msk, &mac_msk, ETH_ALEN);
- memcpy(spec_l2->eth.dst_mac, mac, ETH_ALEN);
-
- if ((cmd->fs.flow_type & FLOW_EXT) && cmd->fs.m_ext.vlan_tci) {
- spec_l2->eth.vlan_id = cmd->fs.h_ext.vlan_tci;
- spec_l2->eth.vlan_id_msk = cpu_to_be16(0xfff);
- }
-
- list_add_tail(&spec_l2->list, rule_list_h);
-
- return err;
-}
-
-static int mlx4_en_ethtool_add_mac_rule_by_ipv4(struct mlx4_en_priv *priv,
- struct mlx4_ethtool_rxnfc *cmd,
- struct list_head *rule_list_h,
- struct mlx4_spec_list *spec_l2,
- __be32 ipv4_dst)
-{
- unsigned char mac[ETH_ALEN];
-
- if (!ipv4_is_multicast(ipv4_dst)) {
- if (cmd->fs.flow_type & FLOW_MAC_EXT)
- memcpy(&mac, cmd->fs.h_ext.h_dest, ETH_ALEN);
- else
- memcpy(&mac, priv->dev->dev_addr, ETH_ALEN);
- } else {
- ip_eth_mc_map(ipv4_dst, mac);
- }
-
- return mlx4_en_ethtool_add_mac_rule(cmd, rule_list_h, spec_l2, &mac[0]);
-}
-
-static int add_ip_rule(struct mlx4_en_priv *priv,
- struct mlx4_ethtool_rxnfc *cmd,
- struct list_head *list_h)
-{
- struct mlx4_spec_list *spec_l2 = NULL;
- struct mlx4_spec_list *spec_l3 = NULL;
- struct ethtool_usrip4_spec *l3_mask = &cmd->fs.m_u.usr_ip4_spec;
-
- spec_l3 = kzalloc(sizeof(*spec_l3), GFP_KERNEL);
- spec_l2 = kzalloc(sizeof(*spec_l2), GFP_KERNEL);
- if (!spec_l2 || !spec_l3) {
- en_err(priv, "Fail to alloc ethtool rule.\n");
- kfree(spec_l2);
- kfree(spec_l3);
- return -ENOMEM;
- }
-
- mlx4_en_ethtool_add_mac_rule_by_ipv4(priv, cmd, list_h, spec_l2,
- cmd->fs.h_u.
- usr_ip4_spec.ip4dst);
- spec_l3->id = MLX4_NET_TRANS_RULE_ID_IPV4;
- spec_l3->ipv4.src_ip = cmd->fs.h_u.usr_ip4_spec.ip4src;
- if (l3_mask->ip4src)
- spec_l3->ipv4.src_ip_msk = MLX4_BE_WORD_MASK;
- spec_l3->ipv4.dst_ip = cmd->fs.h_u.usr_ip4_spec.ip4dst;
- if (l3_mask->ip4dst)
- spec_l3->ipv4.dst_ip_msk = MLX4_BE_WORD_MASK;
- list_add_tail(&spec_l3->list, list_h);
-
- return 0;
-}
-
-static int add_tcp_udp_rule(struct mlx4_en_priv *priv,
- struct mlx4_ethtool_rxnfc *cmd,
- struct list_head *list_h, int proto)
-{
- struct mlx4_spec_list *spec_l2 = NULL;
- struct mlx4_spec_list *spec_l3 = NULL;
- struct mlx4_spec_list *spec_l4 = NULL;
- struct ethtool_tcpip4_spec *l4_mask = &cmd->fs.m_u.tcp_ip4_spec;
-
- spec_l2 = kzalloc(sizeof(*spec_l2), GFP_KERNEL);
- spec_l3 = kzalloc(sizeof(*spec_l3), GFP_KERNEL);
- spec_l4 = kzalloc(sizeof(*spec_l4), GFP_KERNEL);
- if (!spec_l2 || !spec_l3 || !spec_l4) {
- en_err(priv, "Fail to alloc ethtool rule.\n");
- kfree(spec_l2);
- kfree(spec_l3);
- kfree(spec_l4);
- return -ENOMEM;
- }
-
- spec_l3->id = MLX4_NET_TRANS_RULE_ID_IPV4;
-
- if (proto == TCP_V4_FLOW) {
- mlx4_en_ethtool_add_mac_rule_by_ipv4(priv, cmd, list_h,
- spec_l2,
- cmd->fs.h_u.
- tcp_ip4_spec.ip4dst);
- spec_l4->id = MLX4_NET_TRANS_RULE_ID_TCP;
- spec_l3->ipv4.src_ip = cmd->fs.h_u.tcp_ip4_spec.ip4src;
- spec_l3->ipv4.dst_ip = cmd->fs.h_u.tcp_ip4_spec.ip4dst;
- spec_l4->tcp_udp.src_port = cmd->fs.h_u.tcp_ip4_spec.psrc;
- spec_l4->tcp_udp.dst_port = cmd->fs.h_u.tcp_ip4_spec.pdst;
- } else {
- mlx4_en_ethtool_add_mac_rule_by_ipv4(priv, cmd, list_h,
- spec_l2,
- cmd->fs.h_u.
- udp_ip4_spec.ip4dst);
- spec_l4->id = MLX4_NET_TRANS_RULE_ID_UDP;
- spec_l3->ipv4.src_ip = cmd->fs.h_u.udp_ip4_spec.ip4src;
- spec_l3->ipv4.dst_ip = cmd->fs.h_u.udp_ip4_spec.ip4dst;
- spec_l4->tcp_udp.src_port = cmd->fs.h_u.udp_ip4_spec.psrc;
- spec_l4->tcp_udp.dst_port = cmd->fs.h_u.udp_ip4_spec.pdst;
- }
-
- if (l4_mask->ip4src)
- spec_l3->ipv4.src_ip_msk = MLX4_BE_WORD_MASK;
- if (l4_mask->ip4dst)
- spec_l3->ipv4.dst_ip_msk = MLX4_BE_WORD_MASK;
-
- if (l4_mask->psrc)
- spec_l4->tcp_udp.src_port_msk = MLX4_BE_SHORT_MASK;
- if (l4_mask->pdst)
- spec_l4->tcp_udp.dst_port_msk = MLX4_BE_SHORT_MASK;
-
- list_add_tail(&spec_l3->list, list_h);
- list_add_tail(&spec_l4->list, list_h);
-
- return 0;
-}
-
-static int mlx4_en_ethtool_to_net_trans_rule(struct net_device *dev,
- struct mlx4_ethtool_rxnfc *cmd,
- struct list_head *rule_list_h)
-{
- int err;
- struct ethhdr *eth_spec;
- struct mlx4_spec_list *spec_l2;
- struct mlx4_en_priv *priv = netdev_priv(dev);
-
- err = mlx4_en_validate_flow(dev, cmd);
- if (err)
- return err;
-
- switch (cmd->fs.flow_type & ~(FLOW_EXT | FLOW_MAC_EXT)) {
- case ETHER_FLOW:
- spec_l2 = kzalloc(sizeof(*spec_l2), GFP_KERNEL);
- if (!spec_l2)
- return -ENOMEM;
-
- eth_spec = &cmd->fs.h_u.ether_spec;
- mlx4_en_ethtool_add_mac_rule(cmd, rule_list_h, spec_l2, &eth_spec->h_dest[0]);
- spec_l2->eth.ether_type = eth_spec->h_proto;
- if (eth_spec->h_proto)
- spec_l2->eth.ether_type_enable = 1;
- break;
- case IP_USER_FLOW:
- err = add_ip_rule(priv, cmd, rule_list_h);
- break;
- case TCP_V4_FLOW:
- err = add_tcp_udp_rule(priv, cmd, rule_list_h, TCP_V4_FLOW);
- break;
- case UDP_V4_FLOW:
- err = add_tcp_udp_rule(priv, cmd, rule_list_h, UDP_V4_FLOW);
- break;
- }
-
- return err;
-}
-
-static int mlx4_en_flow_replace(struct net_device *dev,
- struct mlx4_ethtool_rxnfc *cmd)
-{
- int err;
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- struct ethtool_flow_id *loc_rule;
- struct mlx4_spec_list *spec, *tmp_spec;
- u32 qpn;
- u64 reg_id;
-
- struct mlx4_net_trans_rule rule = {
- .queue_mode = MLX4_NET_TRANS_Q_FIFO,
- .exclusive = 0,
- .allow_loopback = 1,
- .promisc_mode = MLX4_FS_REGULAR,
- };
-
- rule.port = priv->port;
- rule.priority = MLX4_DOMAIN_ETHTOOL | cmd->fs.location;
- INIT_LIST_HEAD(&rule.list);
-
- /* Allow direct QP attaches if the EN_ETHTOOL_QP_ATTACH flag is set */
- if (cmd->fs.ring_cookie == RX_CLS_FLOW_DISC)
- qpn = priv->drop_qp.qpn;
- else if (cmd->fs.ring_cookie & EN_ETHTOOL_QP_ATTACH) {
- qpn = cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1);
- } else {
- if (cmd->fs.ring_cookie >= priv->rx_ring_num) {
- en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist.\n",
- cmd->fs.ring_cookie);
- return -EINVAL;
- }
- qpn = priv->rss_map.qps[cmd->fs.ring_cookie].qpn;
- if (!qpn) {
- en_warn(priv, "rxnfc: RX ring (%llu) is inactive.\n",
- cmd->fs.ring_cookie);
- return -EINVAL;
- }
- }
- rule.qpn = qpn;
- err = mlx4_en_ethtool_to_net_trans_rule(dev, cmd, &rule.list);
- if (err)
- goto out_free_list;
-
- mutex_lock(&mdev->state_lock);
- loc_rule = &priv->ethtool_rules[cmd->fs.location];
- if (loc_rule->id) {
- err = mlx4_flow_detach(priv->mdev->dev, loc_rule->id);
- if (err) {
- en_err(priv, "Fail to detach network rule at location %d. registration id = %llx\n",
- cmd->fs.location, loc_rule->id);
- goto unlock;
- }
- loc_rule->id = 0;
- memset(&loc_rule->flow_spec, 0,
- sizeof(struct ethtool_rx_flow_spec));
- list_del(&loc_rule->list);
- }
- err = mlx4_flow_attach(priv->mdev->dev, &rule, &reg_id);
- if (err) {
- en_err(priv, "Fail to attach network rule at location %d.\n",
- cmd->fs.location);
- goto unlock;
- }
- loc_rule->id = reg_id;
- memcpy(&loc_rule->flow_spec, &cmd->fs,
- sizeof(struct ethtool_rx_flow_spec));
- list_add_tail(&loc_rule->list, &priv->ethtool_list);
-
-unlock:
- mutex_unlock(&mdev->state_lock);
-out_free_list:
- list_for_each_entry_safe(spec, tmp_spec, &rule.list, list) {
- list_del(&spec->list);
- kfree(spec);
- }
- return err;
-}
-
-static int mlx4_en_flow_detach(struct net_device *dev,
- struct mlx4_ethtool_rxnfc *cmd)
-{
- int err = 0;
- struct ethtool_flow_id *rule;
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
-
- if (cmd->fs.location >= MAX_NUM_OF_FS_RULES)
- return -EINVAL;
-
- mutex_lock(&mdev->state_lock);
- rule = &priv->ethtool_rules[cmd->fs.location];
- if (!rule->id) {
- err = -ENOENT;
- goto out;
- }
-
- err = mlx4_flow_detach(priv->mdev->dev, rule->id);
- if (err) {
- en_err(priv, "Fail to detach network rule at location %d. registration id = 0x%llx\n",
- cmd->fs.location, rule->id);
- goto out;
- }
- rule->id = 0;
- memset(&rule->flow_spec, 0, sizeof(struct ethtool_rx_flow_spec));
-
- list_del(&rule->list);
-out:
- mutex_unlock(&mdev->state_lock);
- return err;
-
-}
-
-static int mlx4_en_get_flow(struct net_device *dev, struct mlx4_ethtool_rxnfc *cmd,
- int loc)
-{
- int err = 0;
- struct ethtool_flow_id *rule;
- struct mlx4_en_priv *priv = netdev_priv(dev);
-
- if (loc < 0 || loc >= MAX_NUM_OF_FS_RULES)
- return -EINVAL;
-
- rule = &priv->ethtool_rules[loc];
- if (rule->id)
- memcpy(&cmd->fs, &rule->flow_spec,
- sizeof(struct ethtool_rx_flow_spec));
- else
- err = -ENOENT;
-
- return err;
-}
-
-static int mlx4_en_get_num_flows(struct mlx4_en_priv *priv)
-{
-
- int i, res = 0;
- for (i = 0; i < MAX_NUM_OF_FS_RULES; i++) {
- if (priv->ethtool_rules[i].id)
- res++;
- }
- return res;
-
-}
-
-static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *c,
- u32 *rule_locs)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- int err = 0;
- int i = 0, priority = 0;
- struct mlx4_ethtool_rxnfc *cmd = (struct mlx4_ethtool_rxnfc *)c;
-
- if ((cmd->cmd == ETHTOOL_GRXCLSRLCNT ||
- cmd->cmd == ETHTOOL_GRXCLSRULE ||
- cmd->cmd == ETHTOOL_GRXCLSRLALL) &&
- (mdev->dev->caps.steering_mode !=
- MLX4_STEERING_MODE_DEVICE_MANAGED || !priv->port_up))
- return -EINVAL;
-
- switch (cmd->cmd) {
- case ETHTOOL_GRXRINGS:
- cmd->data = priv->rx_ring_num;
- break;
- case ETHTOOL_GRXCLSRLCNT:
- cmd->rule_cnt = mlx4_en_get_num_flows(priv);
- break;
- case ETHTOOL_GRXCLSRULE:
- err = mlx4_en_get_flow(dev, cmd, cmd->fs.location);
- break;
- case ETHTOOL_GRXCLSRLALL:
- while ((!err || err == -ENOENT) && priority < cmd->rule_cnt) {
- err = mlx4_en_get_flow(dev, cmd, i);
- if (!err)
- rule_locs[priority++] = i;
- i++;
- }
- err = 0;
- break;
- default:
- err = -EOPNOTSUPP;
- break;
- }
-
- return err;
-}
-
-static int mlx4_en_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *c)
-{
- int err = 0;
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- struct mlx4_ethtool_rxnfc *cmd = (struct mlx4_ethtool_rxnfc *)c;
-
- if (mdev->dev->caps.steering_mode !=
- MLX4_STEERING_MODE_DEVICE_MANAGED || !priv->port_up)
- return -EINVAL;
-
- switch (cmd->cmd) {
- case ETHTOOL_SRXCLSRLINS:
- err = mlx4_en_flow_replace(dev, cmd);
- break;
- case ETHTOOL_SRXCLSRLDEL:
- err = mlx4_en_flow_detach(dev, cmd);
- break;
- default:
- en_warn(priv, "Unsupported ethtool command. (%d)\n", cmd->cmd);
- return -EINVAL;
- }
-
- return err;
-}
-
-static void mlx4_en_get_channels(struct net_device *dev,
- struct ethtool_channels *channel)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
-
- memset(channel, 0, sizeof(*channel));
-
- channel->max_rx = MAX_RX_RINGS;
- channel->max_tx = MLX4_EN_MAX_TX_RING_P_UP;
-
- channel->rx_count = priv->rx_ring_num;
- channel->tx_count = priv->tx_ring_num / MLX4_EN_NUM_UP;
-}
-
-static int mlx4_en_set_channels(struct net_device *dev,
- struct ethtool_channels *channel)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- int port_up = 0;
- int i;
- int err = 0;
-
- if (channel->other_count || channel->combined_count ||
- channel->tx_count > MLX4_EN_MAX_TX_RING_P_UP ||
- channel->rx_count > MAX_RX_RINGS ||
- !channel->tx_count || !channel->rx_count)
- return -EINVAL;
-
- err = mlx4_en_pre_config(priv);
- if (err)
- return err;
-
- mutex_lock(&mdev->state_lock);
- if (priv->port_up) {
- port_up = 1;
- mlx4_en_stop_port(dev);
- }
-
- mlx4_en_free_resources(priv);
-
- priv->num_tx_rings_p_up = channel->tx_count;
- priv->tx_ring_num = channel->tx_count * MLX4_EN_NUM_UP;
- priv->rx_ring_num = channel->rx_count;
-
- err = mlx4_en_alloc_resources(priv);
- if (err) {
- en_err(priv, "Failed reallocating port resources\n");
- goto out;
- }
-
- netif_set_real_num_tx_queues(dev, priv->tx_ring_num);
- netif_set_real_num_rx_queues(dev, priv->rx_ring_num);
-
- mlx4_en_setup_tc(dev, MLX4_EN_NUM_UP);
-
- en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num);
- en_warn(priv, "Using %d RX rings\n", priv->rx_ring_num);
-
- if (port_up) {
- err = mlx4_en_start_port(dev);
- if (err)
- en_err(priv, "Failed starting port\n");
-
- for (i = 0; i < priv->rx_ring_num; i++) {
- priv->rx_cq[i]->moder_cnt = priv->rx_frames;
- priv->rx_cq[i]->moder_time = priv->rx_usecs;
- priv->last_moder_time[i] = MLX4_EN_AUTO_CONF;
- err = mlx4_en_set_cq_moder(priv, priv->rx_cq[i]);
- if (err)
- goto out;
- }
- }
-
-out:
- mutex_unlock(&mdev->state_lock);
- return err;
-}
-
-static int mlx4_en_get_ts_info(struct net_device *dev,
- struct ethtool_ts_info *info)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- int ret;
-
- ret = ethtool_op_get_ts_info(dev, info);
- if (ret)
- return ret;
-
- if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) {
- info->so_timestamping |=
- SOF_TIMESTAMPING_TX_HARDWARE |
- SOF_TIMESTAMPING_RX_HARDWARE |
- SOF_TIMESTAMPING_RAW_HARDWARE;
-
- info->tx_types =
- (1 << HWTSTAMP_TX_OFF) |
- (1 << HWTSTAMP_TX_ON);
-
- info->rx_filters =
- (1 << HWTSTAMP_FILTER_NONE) |
- (1 << HWTSTAMP_FILTER_ALL);
- }
-
- return ret;
-}
-
-const struct ethtool_ops mlx4_en_ethtool_ops = {
- .get_drvinfo = mlx4_en_get_drvinfo,
- .get_settings = mlx4_en_get_settings,
- .set_settings = mlx4_en_set_settings,
- .get_link = ethtool_op_get_link,
- .get_strings = mlx4_en_get_strings,
- .get_sset_count = mlx4_en_get_sset_count,
- .get_ethtool_stats = mlx4_en_get_ethtool_stats,
- .self_test = mlx4_en_self_test,
- .get_wol = mlx4_en_get_wol,
- .set_wol = mlx4_en_set_wol,
- .get_msglevel = mlx4_en_get_msglevel,
- .set_msglevel = mlx4_en_set_msglevel,
- .get_coalesce = mlx4_en_get_coalesce,
- .set_coalesce = mlx4_en_set_coalesce,
- .get_pauseparam = mlx4_en_get_pauseparam,
- .set_pauseparam = mlx4_en_set_pauseparam,
- .get_ringparam = mlx4_en_get_ringparam,
- .set_ringparam = mlx4_en_set_ringparam,
- .get_rxnfc = mlx4_en_get_rxnfc,
- .set_rxnfc = mlx4_en_set_rxnfc,
- .get_rxfh_indir_size = mlx4_en_get_rxfh_indir_size,
- .get_rxfh_indir = mlx4_en_get_rxfh_indir,
- .set_rxfh_indir = mlx4_en_set_rxfh_indir,
- .get_channels = mlx4_en_get_channels,
- .set_channels = mlx4_en_set_channels,
- .get_ts_info = mlx4_en_get_ts_info,
-};
-
-
-
-
-
diff --git a/sys/ofed/drivers/net/mlx4/en_main.c b/sys/ofed/drivers/net/mlx4/en_main.c
index 3aa4745..9573096 100644
--- a/sys/ofed/drivers/net/mlx4/en_main.c
+++ b/sys/ofed/drivers/net/mlx4/en_main.c
@@ -42,16 +42,7 @@
#include "mlx4_en.h"
-MODULE_AUTHOR("Liran Liss, Yevgeny Petrilin");
-MODULE_DESCRIPTION("Mellanox ConnectX HCA Ethernet driver");
-MODULE_LICENSE("Dual BSD/GPL");
-#ifdef __linux__
-MODULE_VERSION(DRV_VERSION " ("DRV_RELDATE")");
-#endif
-
-static const char mlx4_en_version[] =
- DRV_NAME ": Mellanox ConnectX HCA Ethernet driver v"
- DRV_VERSION " (" DRV_RELDATE ")\n";
+/* Mellanox ConnectX HCA Ethernet driver */
#define MLX4_EN_PARM_INT(X, def_val, desc) \
static unsigned int X = def_val;\
@@ -176,8 +167,6 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
int i;
int err;
- printk_once(KERN_INFO "%s", mlx4_en_version);
-
mdev = kzalloc(sizeof *mdev, GFP_KERNEL);
if (!mdev) {
dev_err(&dev->pdev->dev, "Device struct alloc failed, "
diff --git a/sys/ofed/drivers/net/mlx4/en_netdev.c b/sys/ofed/drivers/net/mlx4/en_netdev.c
index 6f49ed0..6fe2bde 100644
--- a/sys/ofed/drivers/net/mlx4/en_netdev.c
+++ b/sys/ofed/drivers/net/mlx4/en_netdev.c
@@ -658,8 +658,10 @@ static void mlx4_en_cache_mclist(struct net_device *dev)
continue;
/* Make sure the list didn't grow. */
tmp = kzalloc(sizeof(struct mlx4_en_mc_list), GFP_ATOMIC);
- if (tmp == NULL)
+ if (tmp == NULL) {
+ en_err(priv, "Failed to allocate multicast list\n");
break;
+ }
memcpy(tmp->addr,
LLADDR((struct sockaddr_dl *)ifma->ifma_addr), ETH_ALEN);
list_add_tail(&tmp->list, &priv->mc_list);
@@ -970,12 +972,12 @@ static void mlx4_en_do_set_rx_mode(struct work_struct *work)
if (!mlx4_en_QUERY_PORT(mdev, priv->port)) {
if (priv->port_state.link_state) {
priv->last_link_state = MLX4_DEV_EVENT_PORT_UP;
- /* Important note: the following call for if_link_state_change
- * is needed for interface up scenario (start port, link state
- * change) */
/* update netif baudrate */
priv->dev->if_baudrate =
IF_Mbps(priv->port_state.link_speed);
+ /* Important note: the following call for if_link_state_change
+ * is needed for interface up scenario (start port, link state
+ * change) */
if_link_state_change(priv->dev, LINK_STATE_UP);
en_dbg(HW, priv, "Link Up\n");
}
@@ -1195,8 +1197,8 @@ static void mlx4_en_linkstate(struct work_struct *work)
/* update netif baudrate */
priv->dev->if_baudrate = 0;
- /* make sure the port is up before notifying the OS.
- * This is tricky since we get here on INIT_PORT and
+ /* make sure the port is up before notifying the OS.
+ * This is tricky since we get here on INIT_PORT and
* in such case we can't tell the OS the port is up.
* To solve this there is a call to if_link_state_change
* in set_rx_mode.
@@ -1245,7 +1247,6 @@ int mlx4_en_start_port(struct net_device *dev)
PAGE_SIZE);
priv->rx_alloc_order = get_order(priv->rx_alloc_size);
priv->rx_buf_size = roundup_pow_of_two(priv->rx_mb_size);
- priv->log_rx_info = ROUNDUP_LOG2(sizeof(struct mlx4_en_rx_buf));
en_dbg(DRV, priv, "Rx buf size:%d\n", priv->rx_mb_size);
/* Configure rx cq's and rings */
@@ -1574,6 +1575,7 @@ static void mlx4_en_clear_stats(struct net_device *dev)
priv->tx_ring[i]->bytes = 0;
priv->tx_ring[i]->packets = 0;
priv->tx_ring[i]->tx_csum = 0;
+ priv->tx_ring[i]->oversized_packets = 0;
}
for (i = 0; i < priv->rx_ring_num; i++) {
priv->rx_ring[i]->bytes = 0;
@@ -1643,8 +1645,6 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv)
if (priv->sysctl)
sysctl_ctx_free(&priv->stat_ctx);
-
-
}
int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
@@ -1729,8 +1729,11 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
EVENTHANDLER_DEREGISTER(vlan_unconfig, priv->vlan_detach);
/* Unregister device - this will close the port if it was up */
- if (priv->registered)
+ if (priv->registered) {
+ mutex_lock(&mdev->state_lock);
ether_ifdetach(dev);
+ mutex_unlock(&mdev->state_lock);
+ }
if (priv->allocated)
mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE);
@@ -1808,13 +1811,6 @@ static int mlx4_en_calc_media(struct mlx4_en_priv *priv)
active = IFM_ETHER;
if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN)
return (active);
- /*
- * [ShaharK] mlx4_en_QUERY_PORT sleeps and cannot be called under a
- * non-sleepable lock.
- * I moved it to the periodic mlx4_en_do_get_stats.
- if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
- return (active);
- */
active |= IFM_FDX;
trans_type = priv->port_state.transciver;
/* XXX I don't know all of the transceiver values. */
@@ -1947,12 +1943,55 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data)
case SIOCSIFCAP:
mutex_lock(&mdev->state_lock);
mask = ifr->ifr_reqcap ^ dev->if_capenable;
- if (mask & IFCAP_HWCSUM)
- dev->if_capenable ^= IFCAP_HWCSUM;
- if (mask & IFCAP_TSO4)
+ if (mask & IFCAP_TXCSUM) {
+ dev->if_capenable ^= IFCAP_TXCSUM;
+ dev->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP);
+
+ if (IFCAP_TSO4 & dev->if_capenable &&
+ !(IFCAP_TXCSUM & dev->if_capenable)) {
+ dev->if_capenable &= ~IFCAP_TSO4;
+ dev->if_hwassist &= ~CSUM_IP_TSO;
+ if_printf(dev,
+ "tso4 disabled due to -txcsum.\n");
+ }
+ }
+ if (mask & IFCAP_TXCSUM_IPV6) {
+ dev->if_capenable ^= IFCAP_TXCSUM_IPV6;
+ dev->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6);
+
+ if (IFCAP_TSO6 & dev->if_capenable &&
+ !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) {
+ dev->if_capenable &= ~IFCAP_TSO6;
+ dev->if_hwassist &= ~CSUM_IP6_TSO;
+ if_printf(dev,
+ "tso6 disabled due to -txcsum6.\n");
+ }
+ }
+ if (mask & IFCAP_RXCSUM)
+ dev->if_capenable ^= IFCAP_RXCSUM;
+ if (mask & IFCAP_RXCSUM_IPV6)
+ dev->if_capenable ^= IFCAP_RXCSUM_IPV6;
+
+ if (mask & IFCAP_TSO4) {
+ if (!(IFCAP_TSO4 & dev->if_capenable) &&
+ !(IFCAP_TXCSUM & dev->if_capenable)) {
+ if_printf(dev, "enable txcsum first.\n");
+ error = EAGAIN;
+ goto out;
+ }
dev->if_capenable ^= IFCAP_TSO4;
- if (mask & IFCAP_TSO6)
+ dev->if_hwassist ^= CSUM_IP_TSO;
+ }
+ if (mask & IFCAP_TSO6) {
+ if (!(IFCAP_TSO6 & dev->if_capenable) &&
+ !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) {
+ if_printf(dev, "enable txcsum6 first.\n");
+ error = EAGAIN;
+ goto out;
+ }
dev->if_capenable ^= IFCAP_TSO6;
+ dev->if_hwassist ^= CSUM_IP6_TSO;
+ }
if (mask & IFCAP_LRO)
dev->if_capenable ^= IFCAP_LRO;
if (mask & IFCAP_VLAN_HWTAGGING)
@@ -1963,9 +2002,11 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data)
dev->if_capenable ^= IFCAP_WOL_MAGIC;
if (dev->if_drv_flags & IFF_DRV_RUNNING)
mlx4_en_start_port(dev);
+out:
mutex_unlock(&mdev->state_lock);
VLAN_CAPABILITIES(dev);
break;
+#if __FreeBSD_version >= 1100036
case SIOCGI2C: {
struct ifi2creq i2c;
@@ -1989,6 +2030,7 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data)
error = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
break;
}
+#endif
default:
error = ether_ioctl(dev, command, data);
break;
@@ -2048,8 +2090,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
priv->port = port;
priv->port_up = false;
priv->flags = prof->flags;
- priv->ctrl_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE |
- MLX4_WQE_CTRL_SOLICITED);
priv->num_tx_rings_p_up = mdev->profile.num_tx_rings_p_up;
priv->tx_ring_num = prof->tx_ring_num;
@@ -2065,7 +2105,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
err = -ENOMEM;
goto out;
}
-
+
priv->rx_ring_num = prof->rx_ring_num;
priv->cqe_factor = (mdev->dev->caps.cqe_size == 64) ? 1 : 0;
priv->mac_index = -1;
@@ -2088,7 +2128,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i)
INIT_HLIST_HEAD(&priv->mac_hash[i]);
-
/* Query for default mac and max mtu */
priv->max_mtu = mdev->dev->caps.eth_mtu_cap[priv->port];
priv->mac = mdev->dev->caps.def_mac[priv->port];
@@ -2104,8 +2143,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
goto out;
}
-
-
priv->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) +
DS_SIZE);
@@ -2127,7 +2164,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
/*
* Set driver features
*/
- dev->if_capabilities |= IFCAP_RXCSUM | IFCAP_TXCSUM;
+ dev->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6;
dev->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
dev->if_capabilities |= IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWFILTER;
dev->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU;
@@ -2136,10 +2173,12 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
if (mdev->LSO_support)
dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO;
+#if __FreeBSD_version >= 1100000
/* set TSO limits so that we don't have to drop TX packets */
- dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN);
- dev->if_hw_tsomaxsegcount = 16;
- dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */
+ dev->if_hw_tsomax = MLX4_EN_TX_MAX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* hdr */;
+ dev->if_hw_tsomaxsegcount = MLX4_EN_TX_MAX_MBUF_FRAGS - 1 /* hdr */;
+ dev->if_hw_tsomaxsegsize = MLX4_EN_TX_MAX_MBUF_SIZE;
+#endif
dev->if_capenable = dev->if_capabilities;
@@ -2148,6 +2187,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
dev->if_hwassist |= CSUM_TSO;
if (dev->if_capenable & IFCAP_TXCSUM)
dev->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP);
+ if (dev->if_capenable & IFCAP_TXCSUM_IPV6)
+ dev->if_hwassist |= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6);
/* Register for VLAN events */
@@ -2210,8 +2251,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)
queue_delayed_work(mdev->workqueue, &priv->service_task, SERVICE_TASK_DELAY);
-
-
return 0;
out:
@@ -2293,6 +2332,162 @@ static int mlx4_en_set_tx_ring_size(SYSCTL_HANDLER_ARGS)
return (error);
}
+static int mlx4_en_get_module_info(struct net_device *dev,
+ struct ethtool_modinfo *modinfo)
+{
+ struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_dev *mdev = priv->mdev;
+ int ret;
+ u8 data[4];
+
+ /* Read first 2 bytes to get Module & REV ID */
+ ret = mlx4_get_module_info(mdev->dev, priv->port,
+ 0/*offset*/, 2/*size*/, data);
+
+ if (ret < 2) {
+ en_err(priv, "Failed to read eeprom module first two bytes, error: 0x%x\n", -ret);
+ return -EIO;
+ }
+
+ switch (data[0] /* identifier */) {
+ case MLX4_MODULE_ID_QSFP:
+ modinfo->type = ETH_MODULE_SFF_8436;
+ modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN;
+ break;
+ case MLX4_MODULE_ID_QSFP_PLUS:
+ if (data[1] >= 0x3) { /* revision id */
+ modinfo->type = ETH_MODULE_SFF_8636;
+ modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN;
+ } else {
+ modinfo->type = ETH_MODULE_SFF_8436;
+ modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN;
+ }
+ break;
+ case MLX4_MODULE_ID_QSFP28:
+ modinfo->type = ETH_MODULE_SFF_8636;
+ modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN;
+ break;
+ case MLX4_MODULE_ID_SFP:
+ modinfo->type = ETH_MODULE_SFF_8472;
+ modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
+ break;
+ default:
+ en_err(priv, "mlx4_en_get_module_info : Not recognized cable type\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int mlx4_en_get_module_eeprom(struct net_device *dev,
+ struct ethtool_eeprom *ee,
+ u8 *data)
+{
+ struct mlx4_en_priv *priv = netdev_priv(dev);
+ struct mlx4_en_dev *mdev = priv->mdev;
+ int offset = ee->offset;
+ int i = 0, ret;
+
+ if (ee->len == 0)
+ return -EINVAL;
+
+ memset(data, 0, ee->len);
+
+ while (i < ee->len) {
+ en_dbg(DRV, priv,
+ "mlx4_get_module_info i(%d) offset(%d) len(%d)\n",
+ i, offset, ee->len - i);
+
+ ret = mlx4_get_module_info(mdev->dev, priv->port,
+ offset, ee->len - i, data + i);
+
+ if (!ret) /* Done reading */
+ return 0;
+
+ if (ret < 0) {
+ en_err(priv,
+ "mlx4_get_module_info i(%d) offset(%d) bytes_to_read(%d) - FAILED (0x%x)\n",
+ i, offset, ee->len - i, ret);
+ return -1;
+ }
+
+ i += ret;
+ offset += ret;
+ }
+ return 0;
+}
+
+static void mlx4_en_print_eeprom(u8 *data, __u32 len)
+{
+ int i;
+ int j = 0;
+ int row = 0;
+ const int NUM_OF_BYTES = 16;
+
+ printf("\nOffset\t\tValues\n");
+ printf("------\t\t------\n");
+ while(row < len){
+ printf("0x%04x\t\t",row);
+ for(i=0; i < NUM_OF_BYTES; i++){
+ printf("%02x ", data[j]);
+ row++;
+ j++;
+ }
+ printf("\n");
+ }
+}
+
+/* Read cable EEPROM module information by first inspecting the first
+ * two bytes to get the length and then read the rest of the information.
+ * The information is printed to dmesg. */
+static int mlx4_en_read_eeprom(SYSCTL_HANDLER_ARGS)
+{
+
+ u8* data;
+ int error;
+ int result = 0;
+ struct mlx4_en_priv *priv;
+ struct net_device *dev;
+ struct ethtool_modinfo modinfo;
+ struct ethtool_eeprom ee;
+
+ error = sysctl_handle_int(oidp, &result, 0, req);
+ if (error || !req->newptr)
+ return (error);
+
+ if (result == 1) {
+ priv = arg1;
+ dev = priv->dev;
+ data = kmalloc(PAGE_SIZE, GFP_KERNEL);
+
+ error = mlx4_en_get_module_info(dev, &modinfo);
+ if (error) {
+ en_err(priv,
+ "mlx4_en_get_module_info returned with error - FAILED (0x%x)\n",
+ -error);
+ goto out;
+ }
+
+ ee.len = modinfo.eeprom_len;
+ ee.offset = 0;
+
+ error = mlx4_en_get_module_eeprom(dev, &ee, data);
+ if (error) {
+ en_err(priv,
+ "mlx4_en_get_module_eeprom returned with error - FAILED (0x%x)\n",
+ -error);
+ /* Continue printing partial information in case of an error */
+ }
+
+ /* EEPROM information will be printed in dmesg */
+ mlx4_en_print_eeprom(data, ee.len);
+out:
+ kfree(data);
+ }
+ /* Return zero to prevent sysctl failure. */
+ return (0);
+}
+
static int mlx4_en_set_tx_ppp(SYSCTL_HANDLER_ARGS)
{
struct mlx4_en_priv *priv;
@@ -2418,7 +2613,7 @@ static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv)
/* Add coalescer configuration. */
coal = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO,
"coalesce", CTLFLAG_RD, NULL, "Interrupt coalesce configuration");
- coal_list = SYSCTL_CHILDREN(node);
+ coal_list = SYSCTL_CHILDREN(coal);
SYSCTL_ADD_UINT(ctx, coal_list, OID_AUTO, "pkt_rate_low",
CTLFLAG_RW, &priv->pkt_rate_low, 0,
"Packets per-second for minimum delay");
@@ -2437,11 +2632,14 @@ static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv)
SYSCTL_ADD_UINT(ctx, coal_list, OID_AUTO, "adaptive_rx_coal",
CTLFLAG_RW, &priv->adaptive_rx_coal, 0,
"Enable adaptive rx coalescing");
+ /* EEPROM support */
+ SYSCTL_ADD_PROC(ctx, node_list, OID_AUTO, "eeprom_info",
+ CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0,
+ mlx4_en_read_eeprom, "I", "EEPROM information");
}
static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv)
{
- struct net_device *dev;
struct sysctl_ctx_list *ctx;
struct sysctl_oid *node;
struct sysctl_oid_list *node_list;
@@ -2452,8 +2650,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv)
char namebuf[128];
int i;
- dev = priv->dev;
-
ctx = &priv->stat_ctx;
sysctl_ctx_init(ctx);
node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(priv->sysctl), OID_AUTO,
@@ -2481,6 +2677,8 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv)
&priv->port_stats.wake_queue, "Queue resumed after full");
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_timeout", CTLFLAG_RD,
&priv->port_stats.tx_timeout, "Transmit timeouts");
+ SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_oversized_packets", CTLFLAG_RD,
+ &priv->port_stats.oversized_packets, "TX oversized packets, m_defrag failed");
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_alloc_failed", CTLFLAG_RD,
&priv->port_stats.rx_alloc_failed, "RX failed to allocate mbuf");
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_chksum_good", CTLFLAG_RD,
@@ -2564,7 +2762,7 @@ struct mlx4_en_pkt_stats {
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD,
&priv->pkstats.tx_packets, "TX packets");
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_bytes", CTLFLAG_RD,
- &priv->pkstats.tx_packets, "TX Bytes");
+ &priv->pkstats.tx_bytes, "TX Bytes");
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_multicast_packets", CTLFLAG_RD,
&priv->pkstats.tx_multicast_packets, "TX Multicast Packets");
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_broadcast_packets", CTLFLAG_RD,
@@ -2605,8 +2803,8 @@ struct mlx4_en_pkt_stats {
CTLFLAG_RD, &tx_ring->packets, "TX packets");
SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "bytes",
CTLFLAG_RD, &tx_ring->bytes, "TX bytes");
-
}
+
for (i = 0; i < priv->rx_ring_num; i++) {
rx_ring = priv->rx_ring[i];
snprintf(namebuf, sizeof(namebuf), "rx_ring%d", i);
diff --git a/sys/ofed/drivers/net/mlx4/en_port.c b/sys/ofed/drivers/net/mlx4/en_port.c
index 33eb0b9..e4dab0a 100644
--- a/sys/ofed/drivers/net/mlx4/en_port.c
+++ b/sys/ofed/drivers/net/mlx4/en_port.c
@@ -194,6 +194,7 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
priv->port_stats.tx_chksum_offload += priv->tx_ring[i]->tx_csum;
priv->port_stats.queue_stopped += priv->tx_ring[i]->queue_stopped;
priv->port_stats.wake_queue += priv->tx_ring[i]->wake_queue;
+ priv->port_stats.oversized_packets += priv->tx_ring[i]->oversized_packets;
}
/* RX Statistics */
priv->pkstats.rx_packets = be64_to_cpu(mlx4_en_stats->RTOT_prio_0) +
@@ -546,8 +547,9 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
}
if (!mlx4_is_mfunc(mdev->dev)) {
+/* netdevice stats format */
+#if __FreeBSD_version >= 1100000
if (reset == 0) {
- /* netdevice stats format */
dev = mdev->pndev[port];
if_inc_counter(dev, IFCOUNTER_IPACKETS,
priv->pkstats.rx_packets - priv->pkstats_last.rx_packets);
@@ -567,6 +569,18 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
priv->pkstats.tx_multicast_packets - priv->pkstats_last.tx_multicast_packets);
}
priv->pkstats_last = priv->pkstats;
+#else
+ dev = mdev->pndev[port];
+ dev->if_ipackets = priv->pkstats.rx_packets;
+ dev->if_opackets = priv->pkstats.tx_packets;
+ dev->if_ibytes = priv->pkstats.rx_bytes;
+ dev->if_obytes = priv->pkstats.tx_bytes;
+ dev->if_ierrors = priv->pkstats.rx_errors;
+ dev->if_iqdrops = priv->pkstats.rx_dropped;
+ dev->if_imcasts = priv->pkstats.rx_multicast_packets;
+ dev->if_omcasts = priv->pkstats.tx_multicast_packets;
+ dev->if_collisions = 0;
+#endif
}
spin_unlock(&priv->stats_lock);
diff --git a/sys/ofed/drivers/net/mlx4/en_rx.c b/sys/ofed/drivers/net/mlx4/en_rx.c
index e011b87..7c5b759 100644
--- a/sys/ofed/drivers/net/mlx4/en_rx.c
+++ b/sys/ofed/drivers/net/mlx4/en_rx.c
@@ -49,106 +49,135 @@ static void mlx4_en_init_rx_desc(struct mlx4_en_priv *priv,
struct mlx4_en_rx_ring *ring,
int index)
{
- struct mlx4_en_rx_desc *rx_desc = ring->buf + ring->stride * index;
+ struct mlx4_en_rx_desc *rx_desc = (struct mlx4_en_rx_desc *)
+ (ring->buf + (ring->stride * index));
int possible_frags;
int i;
-
/* Set size and memtype fields */
- for (i = 0; i < priv->num_frags; i++) {
- rx_desc->data[i].byte_count =
- cpu_to_be32(priv->frag_info[i].frag_size);
- rx_desc->data[i].lkey = cpu_to_be32(priv->mdev->mr.key);
- }
-
- /* If the number of used fragments does not fill up the ring stride,
- * * remaining (unused) fragments must be padded with null address/size
- * * and a special memory key */
+ rx_desc->data[0].byte_count = cpu_to_be32(priv->rx_mb_size);
+ rx_desc->data[0].lkey = cpu_to_be32(priv->mdev->mr.key);
+
+ /*
+ * If the number of used fragments does not fill up the ring
+ * stride, remaining (unused) fragments must be padded with
+ * null address/size and a special memory key:
+ */
possible_frags = (ring->stride - sizeof(struct mlx4_en_rx_desc)) / DS_SIZE;
- for (i = priv->num_frags; i < possible_frags; i++) {
+ for (i = 1; i < possible_frags; i++) {
rx_desc->data[i].byte_count = 0;
rx_desc->data[i].lkey = cpu_to_be32(MLX4_EN_MEMTYPE_PAD);
rx_desc->data[i].addr = 0;
}
-
}
-static int mlx4_en_alloc_buf(struct mlx4_en_priv *priv,
- struct mlx4_en_rx_desc *rx_desc,
- struct mbuf **mb_list,
- int i)
+static int
+mlx4_en_alloc_buf(struct mlx4_en_rx_ring *ring,
+ __be64 *pdma, struct mlx4_en_rx_mbuf *mb_list)
{
- struct mlx4_en_dev *mdev = priv->mdev;
- struct mlx4_en_frag_info *frag_info = &priv->frag_info[i];
+ bus_dma_segment_t segs[1];
+ bus_dmamap_t map;
struct mbuf *mb;
- dma_addr_t dma;
+ int nsegs;
+ int err;
- if (i == 0)
- mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, frag_info->frag_size);
- else
- mb = m_getjcl(M_NOWAIT, MT_DATA, 0, frag_info->frag_size);
- if (mb == NULL) {
- priv->port_stats.rx_alloc_failed++;
- return -ENOMEM;
+ /* try to allocate a new spare mbuf */
+ if (unlikely(ring->spare.mbuf == NULL)) {
+ mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, ring->rx_mb_size);
+ if (unlikely(mb == NULL))
+ return (-ENOMEM);
+ /* setup correct length */
+ mb->m_len = ring->rx_mb_size;
+
+ /* load spare mbuf into BUSDMA */
+ err = -bus_dmamap_load_mbuf_sg(ring->dma_tag, ring->spare.dma_map,
+ mb, segs, &nsegs, BUS_DMA_NOWAIT);
+ if (unlikely(err != 0)) {
+ m_freem(mb);
+ return (err);
+ }
+
+ /* store spare info */
+ ring->spare.mbuf = mb;
+ ring->spare.paddr_be = cpu_to_be64(segs[0].ds_addr);
+
+ bus_dmamap_sync(ring->dma_tag, ring->spare.dma_map,
+ BUS_DMASYNC_PREREAD);
+ }
+
+ /* synchronize and unload the current mbuf, if any */
+ if (likely(mb_list->mbuf != NULL)) {
+ bus_dmamap_sync(ring->dma_tag, mb_list->dma_map,
+ BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(ring->dma_tag, mb_list->dma_map);
}
- dma = pci_map_single(mdev->pdev, mb->m_data, frag_info->frag_size,
- PCI_DMA_FROMDEVICE);
- rx_desc->data[i].addr = cpu_to_be64(dma);
- mb_list[i] = mb;
- return 0;
-}
+ mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, ring->rx_mb_size);
+ if (unlikely(mb == NULL))
+ goto use_spare;
-static int mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv,
- struct mlx4_en_rx_ring *ring, int index)
-{
- struct mlx4_en_rx_desc *rx_desc = ring->buf + (index * ring->stride);
- struct mbuf **mb_list = ring->rx_info + (index << priv->log_rx_info);
- int i;
+ /* setup correct length */
+ mb->m_len = ring->rx_mb_size;
- for (i = 0; i < priv->num_frags; i++)
- if (mlx4_en_alloc_buf(priv, rx_desc, mb_list, i))
- goto err;
+ err = -bus_dmamap_load_mbuf_sg(ring->dma_tag, mb_list->dma_map,
+ mb, segs, &nsegs, BUS_DMA_NOWAIT);
+ if (unlikely(err != 0)) {
+ m_freem(mb);
+ goto use_spare;
+ }
+
+ *pdma = cpu_to_be64(segs[0].ds_addr);
+ mb_list->mbuf = mb;
+
+ bus_dmamap_sync(ring->dma_tag, mb_list->dma_map, BUS_DMASYNC_PREREAD);
+ return (0);
- return 0;
+use_spare:
+ /* swap DMA maps */
+ map = mb_list->dma_map;
+ mb_list->dma_map = ring->spare.dma_map;
+ ring->spare.dma_map = map;
-err:
- while (i--)
- m_free(mb_list[i]);
- return -ENOMEM;
+ /* swap MBUFs */
+ mb_list->mbuf = ring->spare.mbuf;
+ ring->spare.mbuf = NULL;
+
+ /* store physical address */
+ *pdma = ring->spare.paddr_be;
+ return (0);
}
-static inline void mlx4_en_update_rx_prod_db(struct mlx4_en_rx_ring *ring)
+static void
+mlx4_en_free_buf(struct mlx4_en_rx_ring *ring, struct mlx4_en_rx_mbuf *mb_list)
{
- *ring->wqres.db.db = cpu_to_be32(ring->prod & 0xffff);
+ bus_dmamap_t map = mb_list->dma_map;
+ bus_dmamap_sync(ring->dma_tag, map, BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(ring->dma_tag, map);
+ m_freem(mb_list->mbuf);
+ mb_list->mbuf = NULL; /* safety clearing */
}
-static void mlx4_en_free_rx_desc(struct mlx4_en_priv *priv,
- struct mlx4_en_rx_ring *ring,
- int index)
+static int
+mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv,
+ struct mlx4_en_rx_ring *ring, int index)
{
- struct mlx4_en_frag_info *frag_info;
- struct mlx4_en_dev *mdev = priv->mdev;
- struct mbuf **mb_list;
- struct mlx4_en_rx_desc *rx_desc = ring->buf + (index << ring->log_stride);
- dma_addr_t dma;
- int nr;
-
- mb_list = ring->rx_info + (index << priv->log_rx_info);
- for (nr = 0; nr < priv->num_frags; nr++) {
- en_dbg(DRV, priv, "Freeing fragment:%d\n", nr);
- frag_info = &priv->frag_info[nr];
- dma = be64_to_cpu(rx_desc->data[nr].addr);
-
-#if BITS_PER_LONG == 64
- en_dbg(DRV, priv, "Unmaping buffer at dma:0x%lx\n", (u64) dma);
-#elif BITS_PER_LONG == 32
- en_dbg(DRV, priv, "Unmaping buffer at dma:0x%llx\n", (u64) dma);
-#endif
- pci_unmap_single(mdev->pdev, dma, frag_info->frag_size,
- PCI_DMA_FROMDEVICE);
- m_free(mb_list[nr]);
+ struct mlx4_en_rx_desc *rx_desc = (struct mlx4_en_rx_desc *)
+ (ring->buf + (index * ring->stride));
+ struct mlx4_en_rx_mbuf *mb_list = ring->mbuf + index;
+
+ mb_list->mbuf = NULL;
+
+ if (mlx4_en_alloc_buf(ring, &rx_desc->data[0].addr, mb_list)) {
+ priv->port_stats.rx_alloc_failed++;
+ return (-ENOMEM);
}
+ return (0);
+}
+
+static inline void
+mlx4_en_update_rx_prod_db(struct mlx4_en_rx_ring *ring)
+{
+ *ring->wqres.db.db = cpu_to_be32(ring->prod & 0xffff);
}
static int mlx4_en_fill_rx_buffers(struct mlx4_en_priv *priv)
@@ -191,7 +220,8 @@ reduce_rings:
while (ring->actual_size > new_size) {
ring->actual_size--;
ring->prod--;
- mlx4_en_free_rx_desc(priv, ring, ring->actual_size);
+ mlx4_en_free_buf(ring,
+ ring->mbuf + ring->actual_size);
}
}
@@ -211,100 +241,106 @@ static void mlx4_en_free_rx_buf(struct mlx4_en_priv *priv,
while (ring->cons != ring->prod) {
index = ring->cons & ring->size_mask;
en_dbg(DRV, priv, "Processing descriptor:%d\n", index);
- mlx4_en_free_rx_desc(priv, ring, index);
+ mlx4_en_free_buf(ring, ring->mbuf + index);
++ring->cons;
}
}
-#if MLX4_EN_MAX_RX_FRAGS == 3
-static int frag_sizes[] = {
- FRAG_SZ0,
- FRAG_SZ1,
- FRAG_SZ2,
-};
-#elif MLX4_EN_MAX_RX_FRAGS == 2
-static int frag_sizes[] = {
- FRAG_SZ0,
- FRAG_SZ1,
-};
-#else
-#error "Unknown MAX_RX_FRAGS"
-#endif
-
void mlx4_en_calc_rx_buf(struct net_device *dev)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
int eff_mtu = dev->if_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN;
- int buf_size = 0;
- int i, frag;
- for (i = 0, frag = 0; buf_size < eff_mtu; frag++, i++) {
- /*
- * Allocate small to large but only as much as is needed for
- * the tail.
- */
- while (i > 0 && eff_mtu - buf_size <= frag_sizes[i - 1])
- i--;
- priv->frag_info[frag].frag_size = frag_sizes[i];
- priv->frag_info[frag].frag_prefix_size = buf_size;
- buf_size += priv->frag_info[frag].frag_size;
- }
+ if (eff_mtu > MJUM16BYTES) {
+ en_err(priv, "MTU(%d) is too big\n", dev->if_mtu);
+ eff_mtu = MJUM16BYTES;
+ } else if (eff_mtu > MJUM9BYTES) {
+ eff_mtu = MJUM16BYTES;
+ } else if (eff_mtu > MJUMPAGESIZE) {
+ eff_mtu = MJUM9BYTES;
+ } else if (eff_mtu > MCLBYTES) {
+ eff_mtu = MJUMPAGESIZE;
+ } else {
+ eff_mtu = MCLBYTES;
+ }
- priv->num_frags = frag;
priv->rx_mb_size = eff_mtu;
- priv->log_rx_info =
- ROUNDUP_LOG2(priv->num_frags * sizeof(struct mbuf *));
- en_dbg(DRV, priv, "Rx buffer scatter-list (effective-mtu:%d "
- "num_frags:%d):\n", eff_mtu, priv->num_frags);
- for (i = 0; i < priv->num_frags; i++) {
- en_dbg(DRV, priv, " frag:%d - size:%d prefix:%d\n", i,
- priv->frag_info[i].frag_size,
- priv->frag_info[i].frag_prefix_size);
- }
+ en_dbg(DRV, priv, "Effective RX MTU: %d bytes\n", eff_mtu);
}
-
int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
struct mlx4_en_rx_ring **pring,
u32 size, int node)
{
struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_rx_ring *ring;
- int err = -ENOMEM;
+ int err;
int tmp;
+ uint32_t x;
ring = kzalloc(sizeof(struct mlx4_en_rx_ring), GFP_KERNEL);
if (!ring) {
en_err(priv, "Failed to allocate RX ring structure\n");
return -ENOMEM;
}
-
+
+ /* Create DMA descriptor TAG */
+ if ((err = -bus_dma_tag_create(
+ bus_get_dma_tag(mdev->pdev->dev.bsddev),
+ 1, /* any alignment */
+ 0, /* no boundary */
+ BUS_SPACE_MAXADDR, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ MJUM16BYTES, /* maxsize */
+ 1, /* nsegments */
+ MJUM16BYTES, /* maxsegsize */
+ 0, /* flags */
+ NULL, NULL, /* lockfunc, lockfuncarg */
+ &ring->dma_tag))) {
+ en_err(priv, "Failed to create DMA tag\n");
+ goto err_ring;
+ }
+
ring->prod = 0;
ring->cons = 0;
ring->size = size;
ring->size_mask = size - 1;
- ring->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) +
- DS_SIZE * MLX4_EN_MAX_RX_FRAGS);
+ ring->stride = roundup_pow_of_two(
+ sizeof(struct mlx4_en_rx_desc) + DS_SIZE);
ring->log_stride = ffs(ring->stride) - 1;
ring->buf_size = ring->size * ring->stride + TXBB_SIZE;
- tmp = size * roundup_pow_of_two(MLX4_EN_MAX_RX_FRAGS *
- sizeof(struct mbuf *));
+ tmp = size * sizeof(struct mlx4_en_rx_mbuf);
- ring->rx_info = kmalloc(tmp, GFP_KERNEL);
- if (!ring->rx_info) {
+ ring->mbuf = kzalloc(tmp, GFP_KERNEL);
+ if (ring->mbuf == NULL) {
err = -ENOMEM;
- goto err_ring;
+ goto err_dma_tag;
}
- en_dbg(DRV, priv, "Allocated rx_info ring at addr:%p size:%d\n",
- ring->rx_info, tmp);
+ err = -bus_dmamap_create(ring->dma_tag, 0, &ring->spare.dma_map);
+ if (err != 0)
+ goto err_info;
+
+ for (x = 0; x != size; x++) {
+ err = -bus_dmamap_create(ring->dma_tag, 0,
+ &ring->mbuf[x].dma_map);
+ if (err != 0) {
+ while (x--)
+ bus_dmamap_destroy(ring->dma_tag,
+ ring->mbuf[x].dma_map);
+ goto err_info;
+ }
+ }
+ en_dbg(DRV, priv, "Allocated MBUF ring at addr:%p size:%d\n",
+ ring->mbuf, tmp);
err = mlx4_alloc_hwq_res(mdev->dev, &ring->wqres,
ring->buf_size, 2 * PAGE_SIZE);
if (err)
- goto err_info;
+ goto err_dma_map;
err = mlx4_en_map_buffer(&ring->wqres.buf);
if (err) {
@@ -317,23 +353,29 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
err_hwq:
mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
+err_dma_map:
+ for (x = 0; x != size; x++) {
+ bus_dmamap_destroy(ring->dma_tag,
+ ring->mbuf[x].dma_map);
+ }
+ bus_dmamap_destroy(ring->dma_tag, ring->spare.dma_map);
err_info:
- vfree(ring->rx_info);
+ vfree(ring->mbuf);
+err_dma_tag:
+ bus_dma_tag_destroy(ring->dma_tag);
err_ring:
kfree(ring);
-
- return err;
+ return (err);
}
-
int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
{
struct mlx4_en_rx_ring *ring;
int i;
int ring_ind;
int err;
- int stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) +
- DS_SIZE * priv->num_frags);
+ int stride = roundup_pow_of_two(
+ sizeof(struct mlx4_en_rx_desc) + DS_SIZE);
for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) {
ring = priv->rx_ring[ring_ind];
@@ -409,10 +451,22 @@ void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
{
struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_rx_ring *ring = *pring;
+ uint32_t x;
mlx4_en_unmap_buffer(&ring->wqres.buf);
mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE);
- vfree(ring->rx_info);
+ for (x = 0; x != size; x++)
+ bus_dmamap_destroy(ring->dma_tag, ring->mbuf[x].dma_map);
+ /* free spare mbuf, if any */
+ if (ring->spare.mbuf != NULL) {
+ bus_dmamap_sync(ring->dma_tag, ring->spare.dma_map,
+ BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(ring->dma_tag, ring->spare.dma_map);
+ m_freem(ring->spare.mbuf);
+ }
+ bus_dmamap_destroy(ring->dma_tag, ring->spare.dma_map);
+ vfree(ring->mbuf);
+ bus_dma_tag_destroy(ring->dma_tag);
kfree(ring);
*pring = NULL;
#ifdef CONFIG_RFS_ACCEL
@@ -420,7 +474,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
#endif
}
-
void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv,
struct mlx4_en_rx_ring *ring)
{
@@ -469,69 +522,27 @@ static inline int invalid_cqe(struct mlx4_en_priv *priv,
return 0;
}
-
-/* Unmap a completed descriptor and free unused pages */
-static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
- struct mlx4_en_rx_desc *rx_desc,
- struct mbuf **mb_list,
- int length)
+static struct mbuf *
+mlx4_en_rx_mb(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring,
+ struct mlx4_en_rx_desc *rx_desc, struct mlx4_en_rx_mbuf *mb_list,
+ int length)
{
- struct mlx4_en_dev *mdev = priv->mdev;
- struct mlx4_en_frag_info *frag_info;
- dma_addr_t dma;
struct mbuf *mb;
- int nr;
-
- mb = mb_list[0];
- mb->m_pkthdr.len = length;
- /* Collect used fragments while replacing them in the HW descirptors */
- for (nr = 0; nr < priv->num_frags; nr++) {
- frag_info = &priv->frag_info[nr];
- if (length <= frag_info->frag_prefix_size)
- break;
- if (nr)
- mb->m_next = mb_list[nr];
- mb = mb_list[nr];
- mb->m_len = frag_info->frag_size;
- dma = be64_to_cpu(rx_desc->data[nr].addr);
-
- /* Allocate a replacement page */
- if (mlx4_en_alloc_buf(priv, rx_desc, mb_list, nr))
- goto fail;
-
- /* Unmap buffer */
- pci_unmap_single(mdev->pdev, dma, frag_info->frag_size,
- PCI_DMA_FROMDEVICE);
- }
- /* Adjust size of last fragment to match actual length */
- mb->m_len = length - priv->frag_info[nr - 1].frag_prefix_size;
- mb->m_next = NULL;
- return 0;
-fail:
- /* Drop all accumulated fragments (which have already been replaced in
- * the descriptor) of this packet; remaining fragments are reused... */
- while (nr > 0) {
- nr--;
- m_free(mb_list[nr]);
- }
- return -ENOMEM;
-
-}
+ /* get mbuf */
+ mb = mb_list->mbuf;
-static struct mbuf *mlx4_en_rx_mb(struct mlx4_en_priv *priv,
- struct mlx4_en_rx_desc *rx_desc,
- struct mbuf **mb_list,
- unsigned int length)
-{
- struct mbuf *mb;
+ /* collect used fragment while atomically replacing it */
+ if (mlx4_en_alloc_buf(ring, &rx_desc->data[0].addr, mb_list))
+ return (NULL);
- mb = mb_list[0];
- /* Move relevant fragments to mb */
- if (unlikely(mlx4_en_complete_rx_desc(priv, rx_desc, mb_list, length)))
- return NULL;
+ /* range check hardware computed value */
+ if (unlikely(length > mb->m_len))
+ length = mb->m_len;
- return mb;
+ /* update total packet length in packet header */
+ mb->m_len = mb->m_pkthdr.len = length;
+ return (mb);
}
/* For cpu arch with cache line of 64B the performance is better when cqe size==64B
@@ -545,7 +556,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_cqe *cqe;
struct mlx4_en_rx_ring *ring = priv->rx_ring[cq->ring];
- struct mbuf **mb_list;
+ struct mlx4_en_rx_mbuf *mb_list;
struct mlx4_en_rx_desc *rx_desc;
struct mbuf *mb;
struct mlx4_cq *mcq = &cq->mcq;
@@ -573,8 +584,9 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
/* Process all completed CQEs */
while (XNOR(cqe->owner_sr_opcode & MLX4_CQE_OWNER_MASK,
cons_index & size)) {
- mb_list = ring->rx_info + (index << priv->log_rx_info);
- rx_desc = ring->buf + (index << ring->log_stride);
+ mb_list = ring->mbuf + index;
+ rx_desc = (struct mlx4_en_rx_desc *)
+ (ring->buf + (index << ring->log_stride));
/*
* make sure we read the CQE after we read the ownership bit
@@ -589,8 +601,9 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
*/
length = be32_to_cpu(cqe->byte_cnt);
length -= ring->fcs_del;
- mb = mlx4_en_rx_mb(priv, rx_desc, mb_list, length);
- if (!mb) {
+
+ mb = mlx4_en_rx_mb(priv, ring, rx_desc, mb_list, length);
+ if (unlikely(!mb)) {
ring->errors++;
goto next;
}
@@ -611,7 +624,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
mb->m_pkthdr.ether_vtag = be16_to_cpu(cqe->sl_vid);
mb->m_flags |= M_VLANTAG;
}
- if (likely(dev->if_capabilities & IFCAP_RXCSUM) &&
+ if (likely(dev->if_capenable &
+ (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) &&
(cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
(cqe->checksum == cpu_to_be16(0xffff))) {
priv->port_stats.rx_chksum_good++;
@@ -692,6 +706,7 @@ void mlx4_en_rx_irq(struct mlx4_cq *mcq)
// Because there is no NAPI in freeBSD
done = mlx4_en_poll_rx_cq(cq, MLX4_EN_RX_BUDGET);
if (priv->port_up && (done == MLX4_EN_RX_BUDGET) ) {
+ cq->curr_poll_rx_cpu_id = curcpu;
taskqueue_enqueue(cq->tq, &cq->cq_task);
}
else {
@@ -702,8 +717,15 @@ void mlx4_en_rx_irq(struct mlx4_cq *mcq)
void mlx4_en_rx_que(void *context, int pending)
{
struct mlx4_en_cq *cq;
+ struct thread *td;
cq = context;
+ td = curthread;
+
+ thread_lock(td);
+ sched_bind(td, cq->curr_poll_rx_cpu_id);
+ thread_unlock(td);
+
while (mlx4_en_poll_rx_cq(cq, MLX4_EN_RX_BUDGET)
== MLX4_EN_RX_BUDGET);
mlx4_en_arm_cq(cq->dev->if_softc, cq);
@@ -841,8 +863,8 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
else
rss_rings = priv->prof->rss_rings;
- ptr = ((void *) &context) + offsetof(struct mlx4_qp_context, pri_path)
- + MLX4_RSS_OFFSET_IN_QPC_PRI_PATH;
+ ptr = ((u8 *)&context) + offsetof(struct mlx4_qp_context, pri_path) +
+ MLX4_RSS_OFFSET_IN_QPC_PRI_PATH;
rss_context = ptr;
rss_context->base_qpn = cpu_to_be32(ilog2(rss_rings) << 24 |
(rss_map->base_qpn));
diff --git a/sys/ofed/drivers/net/mlx4/en_selftest.c b/sys/ofed/drivers/net/mlx4/en_selftest.c
deleted file mode 100644
index fb13bd6..0000000
--- a/sys/ofed/drivers/net/mlx4/en_selftest.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2007, 2014 Mellanox Technologies. All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses. You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- * - Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * - 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.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
-#include <linux/delay.h>
-#include <linux/mlx4/driver.h>
-
-#include "mlx4_en.h"
-
-
-static int mlx4_en_test_registers(struct mlx4_en_priv *priv)
-{
- return mlx4_cmd(priv->mdev->dev, 0, 0, 0, MLX4_CMD_HW_HEALTH_CHECK,
- MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
-}
-
-static int mlx4_en_test_loopback_xmit(struct mlx4_en_priv *priv)
-{
- struct sk_buff *skb;
- struct ethhdr *ethh;
- unsigned char *packet;
- unsigned int packet_size = MLX4_LOOPBACK_TEST_PAYLOAD;
- unsigned int i;
- int err;
-
-
- /* build the pkt before xmit */
- skb = netdev_alloc_skb(priv->dev, MLX4_LOOPBACK_TEST_PAYLOAD + ETH_HLEN + NET_IP_ALIGN);
- if (!skb) {
- en_err(priv, "-LOOPBACK_TEST_XMIT- failed to create skb for xmit\n");
- return -ENOMEM;
- }
- skb_reserve(skb, NET_IP_ALIGN);
-
- ethh = (struct ethhdr *)skb_put(skb, sizeof(struct ethhdr));
- packet = (unsigned char *)skb_put(skb, packet_size);
- memcpy(ethh->h_dest, priv->dev->dev_addr, ETH_ALEN);
- memset(ethh->h_source, 0, ETH_ALEN);
- ethh->h_proto = htons(ETH_P_ARP);
- skb_set_mac_header(skb, 0);
- for (i = 0; i < packet_size; ++i) /* fill our packet */
- packet[i] = (unsigned char)(i & 0xff);
-
- /* xmit the pkt */
- err = mlx4_en_xmit(skb, priv->dev);
- return err;
-}
-
-static int mlx4_en_test_loopback(struct mlx4_en_priv *priv)
-{
- u32 loopback_ok = 0;
- int i;
-
-
- priv->loopback_ok = 0;
- priv->validate_loopback = 1;
-
- mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
-
- /* xmit */
- if (mlx4_en_test_loopback_xmit(priv)) {
- en_err(priv, "Transmitting loopback packet failed\n");
- goto mlx4_en_test_loopback_exit;
- }
-
- /* polling for result */
- for (i = 0; i < MLX4_EN_LOOPBACK_RETRIES; ++i) {
- msleep(MLX4_EN_LOOPBACK_TIMEOUT);
- if (priv->loopback_ok) {
- loopback_ok = 1;
- break;
- }
- }
- if (!loopback_ok)
- en_err(priv, "Loopback packet didn't arrive\n");
-
-mlx4_en_test_loopback_exit:
-
- priv->validate_loopback = 0;
- mlx4_en_update_loopback_state(priv->dev, priv->dev->features);
- return !loopback_ok;
-}
-
-
-static int mlx4_en_test_link(struct mlx4_en_priv *priv)
-{
- if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
- return -ENOMEM;
- if (priv->port_state.link_state == 1)
- return 0;
- else
- return 1;
-}
-
-static int mlx4_en_test_speed(struct mlx4_en_priv *priv)
-{
-
- if (mlx4_en_QUERY_PORT(priv->mdev, priv->port))
- return -ENOMEM;
-
- /* The device supports 1G, 10G and 40G speed */
- if (priv->port_state.link_speed != MLX4_EN_LINK_SPEED_1G &&
- priv->port_state.link_speed != MLX4_EN_LINK_SPEED_10G &&
- priv->port_state.link_speed != MLX4_EN_LINK_SPEED_40G)
- return priv->port_state.link_speed;
- return 0;
-}
-
-
-void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf)
-{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- int i, carrier_ok;
-
- memset(buf, 0, sizeof(u64) * MLX4_EN_NUM_SELF_TEST);
-
- if (*flags & ETH_TEST_FL_OFFLINE) {
- /* disable the interface */
- carrier_ok = netif_carrier_ok(dev);
-
- netif_carrier_off(dev);
- /* Wait until all tx queues are empty.
- * there should not be any additional incoming traffic
- * since we turned the carrier off */
- msleep(200);
-
- if (priv->mdev->dev->caps.flags &
- MLX4_DEV_CAP_FLAG_UC_LOOPBACK) {
- buf[3] = mlx4_en_test_registers(priv);
- if (priv->port_up)
- buf[4] = mlx4_en_test_loopback(priv);
- }
-
- if (carrier_ok)
- netif_carrier_on(dev);
-
- }
- buf[0] = mlx4_test_interrupts(mdev->dev);
- buf[1] = mlx4_en_test_link(priv);
- buf[2] = mlx4_en_test_speed(priv);
-
- for (i = 0; i < MLX4_EN_NUM_SELF_TEST; i++) {
- if (buf[i])
- *flags |= ETH_TEST_FL_FAILED;
- }
-}
diff --git a/sys/ofed/drivers/net/mlx4/en_tx.c b/sys/ofed/drivers/net/mlx4/en_tx.c
index 2565f51..56bb5b2 100644
--- a/sys/ofed/drivers/net/mlx4/en_tx.c
+++ b/sys/ofed/drivers/net/mlx4/en_tx.c
@@ -67,6 +67,7 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
{
struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_tx_ring *ring;
+ uint32_t x;
int tmp;
int err;
@@ -79,11 +80,26 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
}
}
+ /* Create DMA descriptor TAG */
+ if ((err = -bus_dma_tag_create(
+ bus_get_dma_tag(mdev->pdev->dev.bsddev),
+ 1, /* any alignment */
+ 0, /* no boundary */
+ BUS_SPACE_MAXADDR, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ MLX4_EN_TX_MAX_PAYLOAD_SIZE, /* maxsize */
+ MLX4_EN_TX_MAX_MBUF_FRAGS, /* nsegments */
+ MLX4_EN_TX_MAX_MBUF_SIZE, /* maxsegsize */
+ 0, /* flags */
+ NULL, NULL, /* lockfunc, lockfuncarg */
+ &ring->dma_tag)))
+ goto done;
+
ring->size = size;
ring->size_mask = size - 1;
ring->stride = stride;
- ring->full_size = ring->size - HEADROOM - MAX_DESC_TXBBS;
- ring->inline_thold = min(inline_thold, MAX_INLINE);
+ ring->inline_thold = MAX(MIN_PKT_LEN, MIN(inline_thold, MAX_INLINE));
mtx_init(&ring->tx_lock.m, "mlx4 tx", NULL, MTX_DEF);
mtx_init(&ring->comp_lock.m, "mlx4 comp", NULL, MTX_DEF);
@@ -92,30 +108,36 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
M_WAITOK, &ring->tx_lock.m);
if (ring->br == NULL) {
en_err(priv, "Failed allocating tx_info ring\n");
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_free_dma_tag;
}
tmp = size * sizeof(struct mlx4_en_tx_info);
- ring->tx_info = vmalloc_node(tmp, node);
+ ring->tx_info = kzalloc_node(tmp, GFP_KERNEL, node);
if (!ring->tx_info) {
- ring->tx_info = vmalloc(tmp);
+ ring->tx_info = kzalloc(tmp, GFP_KERNEL);
if (!ring->tx_info) {
err = -ENOMEM;
goto err_ring;
}
}
- en_dbg(DRV, priv, "Allocated tx_info ring at addr:%p size:%d\n",
- ring->tx_info, tmp);
-
- ring->bounce_buf = kmalloc_node(MAX_DESC_SIZE, GFP_KERNEL, node);
- if (!ring->bounce_buf) {
- ring->bounce_buf = kmalloc(MAX_DESC_SIZE, GFP_KERNEL);
- if (!ring->bounce_buf) {
- err = -ENOMEM;
+ /* Create DMA descriptor MAPs */
+ for (x = 0; x != size; x++) {
+ err = -bus_dmamap_create(ring->dma_tag, 0,
+ &ring->tx_info[x].dma_map);
+ if (err != 0) {
+ while (x--) {
+ bus_dmamap_destroy(ring->dma_tag,
+ ring->tx_info[x].dma_map);
+ }
goto err_info;
}
}
+
+ en_dbg(DRV, priv, "Allocated tx_info ring at addr:%p size:%d\n",
+ ring->tx_info, tmp);
+
ring->buf_size = ALIGN(size * ring->stride, MLX4_EN_PAGE_SIZE);
/* Allocate HW buffers on provided NUMA node */
@@ -123,7 +145,7 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
2 * PAGE_SIZE);
if (err) {
en_err(priv, "Failed allocating hwq resources\n");
- goto err_bounce;
+ goto err_dma_map;
}
err = mlx4_en_map_buffer(&ring->wqres.buf);
@@ -173,12 +195,16 @@ err_map:
mlx4_en_unmap_buffer(&ring->wqres.buf);
err_hwq_res:
mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
-err_bounce:
- kfree(ring->bounce_buf);
+err_dma_map:
+ for (x = 0; x != size; x++)
+ bus_dmamap_destroy(ring->dma_tag, ring->tx_info[x].dma_map);
err_info:
vfree(ring->tx_info);
err_ring:
buf_ring_free(ring->br, M_DEVBUF);
+err_free_dma_tag:
+ bus_dma_tag_destroy(ring->dma_tag);
+done:
kfree(ring);
return err;
}
@@ -188,6 +214,7 @@ void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv,
{
struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_tx_ring *ring = *pring;
+ uint32_t x;
en_dbg(DRV, priv, "Destroying tx ring, qpn: %d\n", ring->qpn);
buf_ring_free(ring->br, M_DEVBUF);
@@ -198,10 +225,12 @@ void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv,
mlx4_qp_release_range(priv->mdev->dev, ring->qpn, 1);
mlx4_en_unmap_buffer(&ring->wqres.buf);
mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
- kfree(ring->bounce_buf);
+ for (x = 0; x != ring->size; x++)
+ bus_dmamap_destroy(ring->dma_tag, ring->tx_info[x].dma_map);
vfree(ring->tx_info);
mtx_destroy(&ring->tx_lock.m);
mtx_destroy(&ring->comp_lock.m);
+ bus_dma_tag_destroy(ring->dma_tag);
kfree(ring);
*pring = NULL;
}
@@ -219,7 +248,6 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
ring->last_nr_txbb = 1;
ring->poll_cnt = 0;
ring->blocked = 0;
- memset(ring->tx_info, 0, ring->size * sizeof(struct mlx4_en_tx_info));
memset(ring->buf, 0, ring->buf_size);
ring->qp_state = MLX4_QP_STATE_RST;
@@ -244,96 +272,63 @@ void mlx4_en_deactivate_tx_ring(struct mlx4_en_priv *priv,
MLX4_QP_STATE_RST, NULL, 0, 0, &ring->qp);
}
-static void mlx4_en_stamp_wqe(struct mlx4_en_priv *priv,
- struct mlx4_en_tx_ring *ring,
- int index, u8 owner)
+static volatile struct mlx4_wqe_data_seg *
+mlx4_en_store_inline_lso_data(volatile struct mlx4_wqe_data_seg *dseg,
+ struct mbuf *mb, int len, __be32 owner_bit)
{
- struct mlx4_en_tx_info *tx_info = &ring->tx_info[index];
- struct mlx4_en_tx_desc *tx_desc = ring->buf + index * TXBB_SIZE;
- void *end = ring->buf + ring->buf_size;
- __be32 *ptr = (__be32 *)tx_desc;
- __be32 stamp = cpu_to_be32(STAMP_VAL | (!!owner << STAMP_SHIFT));
- int i;
-
- /* Optimize the common case when there are no wraparounds */
- if (likely((void *)tx_desc + tx_info->nr_txbb * TXBB_SIZE <= end))
- /* Stamp the freed descriptor */
- for (i = 0; i < tx_info->nr_txbb * TXBB_SIZE; i += STAMP_STRIDE) {
- *ptr = stamp;
- ptr += STAMP_DWORDS;
- }
- else
- /* Stamp the freed descriptor */
- for (i = 0; i < tx_info->nr_txbb * TXBB_SIZE; i += STAMP_STRIDE) {
- *ptr = stamp;
- ptr += STAMP_DWORDS;
- if ((void *)ptr >= end) {
- ptr = ring->buf;
- stamp ^= cpu_to_be32(0x80000000);
- }
- }
+ uint8_t *inl = __DEVOLATILE(uint8_t *, dseg);
+
+ /* copy data into place */
+ m_copydata(mb, 0, len, inl + 4);
+ dseg += DIV_ROUND_UP(4 + len, DS_SIZE_ALIGNMENT);
+ return (dseg);
}
-static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
- struct mlx4_en_tx_ring *ring,
- int index, u8 owner, u64 timestamp)
+static void
+mlx4_en_store_inline_lso_header(volatile struct mlx4_wqe_data_seg *dseg,
+ int len, __be32 owner_bit)
+{
+}
+
+static void
+mlx4_en_stamp_wqe(struct mlx4_en_priv *priv,
+ struct mlx4_en_tx_ring *ring, u32 index, u8 owner)
{
- struct mlx4_en_dev *mdev = priv->mdev;
struct mlx4_en_tx_info *tx_info = &ring->tx_info[index];
- struct mlx4_en_tx_desc *tx_desc = ring->buf + index * TXBB_SIZE;
- struct mlx4_wqe_data_seg *data = (void *) tx_desc + tx_info->data_offset;
- struct mbuf *mb = tx_info->mb;
- void *end = ring->buf + ring->buf_size;
- int frags = tx_info->nr_segs;;
- int i;
-
- /* Optimize the common case when there are no wraparounds */
- if (likely((void *) tx_desc + tx_info->nr_txbb * TXBB_SIZE <= end)) {
- if (!tx_info->inl) {
- if (tx_info->linear) {
- dma_unmap_single(priv->ddev,
- (dma_addr_t) be64_to_cpu(data->addr),
- be32_to_cpu(data->byte_count),
- PCI_DMA_TODEVICE);
- ++data;
- }
+ struct mlx4_en_tx_desc *tx_desc = (struct mlx4_en_tx_desc *)
+ (ring->buf + (index * TXBB_SIZE));
+ volatile __be32 *ptr = (__be32 *)tx_desc;
+ const __be32 stamp = cpu_to_be32(STAMP_VAL |
+ ((u32)owner << STAMP_SHIFT));
+ u32 i;
+
+ /* Stamp the freed descriptor */
+ for (i = 0; i < tx_info->nr_txbb * TXBB_SIZE; i += STAMP_STRIDE) {
+ *ptr = stamp;
+ ptr += STAMP_DWORDS;
+ }
+}
- for (i = 0; i < frags; i++) {
- pci_unmap_single(mdev->pdev,
- (dma_addr_t) be64_to_cpu(data[i].addr),
- data[i].byte_count, PCI_DMA_TODEVICE);
- }
- }
- } else {
- if (!tx_info->inl) {
- if ((void *) data >= end) {
- data = ring->buf + ((void *)data - end);
- }
+static u32
+mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
+ struct mlx4_en_tx_ring *ring, u32 index)
+{
+ struct mlx4_en_tx_info *tx_info;
+ struct mbuf *mb;
- if (tx_info->linear) {
- dma_unmap_single(priv->ddev,
- (dma_addr_t) be64_to_cpu(data->addr),
- be32_to_cpu(data->byte_count),
- PCI_DMA_TODEVICE);
- ++data;
- }
+ tx_info = &ring->tx_info[index];
+ mb = tx_info->mb;
+
+ if (mb == NULL)
+ goto done;
+
+ bus_dmamap_sync(ring->dma_tag, tx_info->dma_map,
+ BUS_DMASYNC_POSTWRITE);
+ bus_dmamap_unload(ring->dma_tag, tx_info->dma_map);
- for (i = 0; i < frags; i++) {
- /* Check for wraparound before unmapping */
- if ((void *) data >= end)
- data = ring->buf;
- pci_unmap_single(mdev->pdev,
- (dma_addr_t) be64_to_cpu(data->addr),
- data->byte_count, PCI_DMA_TODEVICE);
- ++data;
- }
- }
- }
- /* Send a copy of the frame to the BPF listener */
- if (priv->dev && priv->dev->if_bpf)
- ETHER_BPF_MTAP(priv->dev, mb);
m_freem(mb);
- return tx_info->nr_txbb;
+done:
+ return (tx_info->nr_txbb);
}
int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
@@ -353,8 +348,7 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
while (ring->cons != ring->prod) {
ring->last_nr_txbb = mlx4_en_free_tx_desc(priv, ring,
- ring->cons & ring->size_mask,
- !!(ring->cons & ring->size), 0);
+ ring->cons & ring->size_mask);
ring->cons += ring->last_nr_txbb;
cnt++;
}
@@ -365,6 +359,14 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
return cnt;
}
+static bool
+mlx4_en_tx_ring_is_full(struct mlx4_en_tx_ring *ring)
+{
+ int wqs;
+ wqs = ring->size - (ring->prod - ring->cons);
+ return (wqs < (HEADROOM + (2 * MLX4_EN_TX_WQE_MAX_WQEBBS)));
+}
+
static int mlx4_en_process_tx_cq(struct net_device *dev,
struct mlx4_en_cq *cq)
{
@@ -380,12 +382,7 @@ static int mlx4_en_process_tx_cq(struct net_device *dev,
int size = cq->size;
u32 size_mask = ring->size_mask;
struct mlx4_cqe *buf = cq->buf;
- u32 packets = 0;
- u32 bytes = 0;
int factor = priv->cqe_factor;
- u64 timestamp = 0;
- int done = 0;
-
if (!priv->port_up)
return 0;
@@ -420,16 +417,12 @@ static int mlx4_en_process_tx_cq(struct net_device *dev,
ring_index = (ring_index + ring->last_nr_txbb) & size_mask;
/* free next descriptor */
ring->last_nr_txbb = mlx4_en_free_tx_desc(
- priv, ring, ring_index,
- !!((ring->cons + txbbs_skipped) &
- ring->size), timestamp);
+ priv, ring, ring_index);
mlx4_en_stamp_wqe(priv, ring, stamp_index,
!!((ring->cons + txbbs_stamp) &
ring->size));
stamp_index = ring_index;
txbbs_stamp = txbbs_skipped;
- packets++;
- bytes += ring->tx_info[ring_index].nr_bytes;
} while (ring_index != new_index);
++cons_index;
@@ -448,15 +441,14 @@ static int mlx4_en_process_tx_cq(struct net_device *dev,
ring->cons += txbbs_skipped;
/* Wakeup Tx queue if it was stopped and ring is not full */
- if (unlikely(ring->blocked) &&
- (ring->prod - ring->cons) <= ring->full_size) {
+ if (unlikely(ring->blocked) && !mlx4_en_tx_ring_is_full(ring)) {
ring->blocked = 0;
if (atomic_fetchadd_int(&priv->blocked, -1) == 1)
atomic_clear_int(&dev->if_drv_flags ,IFF_DRV_OACTIVE);
ring->wake_queue++;
priv->port_stats.wake_queue++;
}
- return done;
+ return (0);
}
void mlx4_en_tx_irq(struct mlx4_cq *mcq)
@@ -497,34 +489,6 @@ void mlx4_en_poll_tx_cq(unsigned long data)
spin_unlock(&ring->comp_lock);
}
-static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv,
- struct mlx4_en_tx_ring *ring,
- u32 index,
- unsigned int desc_size)
-{
- u32 copy = (ring->size - index) * TXBB_SIZE;
- int i;
-
- for (i = desc_size - copy - 4; i >= 0; i -= 4) {
- if ((i & (TXBB_SIZE - 1)) == 0)
- wmb();
-
- *((u32 *) (ring->buf + i)) =
- *((u32 *) (ring->bounce_buf + copy + i));
- }
-
- for (i = copy - 4; i >= 4 ; i -= 4) {
- if ((i & (TXBB_SIZE - 1)) == 0)
- wmb();
-
- *((u32 *) (ring->buf + index * TXBB_SIZE + i)) =
- *((u32 *) (ring->bounce_buf + i));
- }
-
- /* Return real descriptor location */
- return ring->buf + index * TXBB_SIZE;
-}
-
static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)
{
struct mlx4_en_cq *cq = priv->tx_cq[tx_ind];
@@ -543,30 +507,22 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)
}
}
-static int is_inline(struct mbuf *mb, int thold)
+static u16
+mlx4_en_get_inline_hdr_size(struct mlx4_en_tx_ring *ring, struct mbuf *mb)
{
- if (thold && mb->m_pkthdr.len <= thold &&
- (mb->m_pkthdr.csum_flags & CSUM_TSO) == 0)
- return 1;
+ u16 retval;
- return 0;
-}
-
-static int inline_size(struct mbuf *mb)
-{
- int len;
+ /* only copy from first fragment, if possible */
+ retval = MIN(ring->inline_thold, mb->m_len);
- len = mb->m_pkthdr.len;
- if (len + CTRL_SIZE + sizeof(struct mlx4_wqe_inline_seg)
- <= MLX4_INLINE_ALIGN)
- return ALIGN(len + CTRL_SIZE +
- sizeof(struct mlx4_wqe_inline_seg), 16);
- else
- return ALIGN(len + CTRL_SIZE + 2 *
- sizeof(struct mlx4_wqe_inline_seg), 16);
+ /* check for too little data */
+ if (unlikely(retval < MIN_PKT_LEN))
+ retval = MIN(ring->inline_thold, mb->m_pkthdr.len);
+ return (retval);
}
-static int get_head_size(struct mbuf *mb)
+static int
+mlx4_en_get_header_size(struct mbuf *mb)
{
struct ether_vlan_header *eh;
struct tcphdr *th;
@@ -619,83 +575,48 @@ static int get_head_size(struct mbuf *mb)
return (eth_hdr_len);
}
-static int get_real_size(struct mbuf *mb, struct net_device *dev, int *p_n_segs,
- int *lso_header_size, int inl)
+static volatile struct mlx4_wqe_data_seg *
+mlx4_en_store_inline_data(volatile struct mlx4_wqe_data_seg *dseg,
+ struct mbuf *mb, int len, __be32 owner_bit)
{
- struct mbuf *m;
- int nr_segs = 0;
-
- for (m = mb; m != NULL; m = m->m_next)
- if (m->m_len)
- nr_segs++;
-
- if (mb->m_pkthdr.csum_flags & CSUM_TSO) {
- *lso_header_size = get_head_size(mb);
- if (*lso_header_size) {
- if (mb->m_len == *lso_header_size)
- nr_segs--;
- *p_n_segs = nr_segs;
- return CTRL_SIZE + nr_segs * DS_SIZE +
- ALIGN(*lso_header_size + 4, DS_SIZE);
- }
- } else
- *lso_header_size = 0;
- *p_n_segs = nr_segs;
- if (inl)
- return inline_size(mb);
- return (CTRL_SIZE + nr_segs * DS_SIZE);
-}
-
-static struct mbuf *mb_copy(struct mbuf *mb, int *offp, char *data, int len)
-{
- int bytes;
- int off;
-
- off = *offp;
- while (len) {
- bytes = min(mb->m_len - off, len);
- if (bytes)
- memcpy(data, mb->m_data + off, bytes);
- len -= bytes;
- data += bytes;
- off += bytes;
- if (off == mb->m_len) {
- off = 0;
- mb = mb->m_next;
- }
- }
- *offp = off;
- return (mb);
+ uint8_t *inl = __DEVOLATILE(uint8_t *, dseg);
+ const int spc = MLX4_INLINE_ALIGN - CTRL_SIZE - 4;
+
+ if (unlikely(len < MIN_PKT_LEN)) {
+ m_copydata(mb, 0, len, inl + 4);
+ memset(inl + 4 + len, 0, MIN_PKT_LEN - len);
+ dseg += DIV_ROUND_UP(4 + MIN_PKT_LEN, DS_SIZE_ALIGNMENT);
+ } else if (len <= spc) {
+ m_copydata(mb, 0, len, inl + 4);
+ dseg += DIV_ROUND_UP(4 + len, DS_SIZE_ALIGNMENT);
+ } else {
+ m_copydata(mb, 0, spc, inl + 4);
+ m_copydata(mb, spc, len - spc, inl + 8 + spc);
+ dseg += DIV_ROUND_UP(8 + len, DS_SIZE_ALIGNMENT);
+ }
+ return (dseg);
}
-static void build_inline_wqe(struct mlx4_en_tx_desc *tx_desc, struct mbuf *mb,
- int real_size, u16 *vlan_tag, int tx_ind)
+static void
+mlx4_en_store_inline_header(volatile struct mlx4_wqe_data_seg *dseg,
+ int len, __be32 owner_bit)
{
- struct mlx4_wqe_inline_seg *inl = &tx_desc->inl;
- int spc = MLX4_INLINE_ALIGN - CTRL_SIZE - sizeof *inl;
- int len;
- int off;
-
- off = 0;
- len = mb->m_pkthdr.len;
- if (len <= spc) {
- inl->byte_count = cpu_to_be32(1 << 31 |
- (max_t(typeof(len), len, MIN_PKT_LEN)));
- mb_copy(mb, &off, (void *)(inl + 1), len);
- if (len < MIN_PKT_LEN)
- memset(((void *)(inl + 1)) + len, 0,
- MIN_PKT_LEN - len);
+ uint8_t *inl = __DEVOLATILE(uint8_t *, dseg);
+ const int spc = MLX4_INLINE_ALIGN - CTRL_SIZE - 4;
+
+ if (unlikely(len < MIN_PKT_LEN)) {
+ *(volatile uint32_t *)inl =
+ SET_BYTE_COUNT((1 << 31) | MIN_PKT_LEN);
+ } else if (len <= spc) {
+ *(volatile uint32_t *)inl =
+ SET_BYTE_COUNT((1 << 31) | len);
} else {
- inl->byte_count = cpu_to_be32(1 << 31 | spc);
- mb = mb_copy(mb, &off, (void *)(inl + 1), spc);
- inl = (void *) (inl + 1) + spc;
- mb_copy(mb, &off, (void *)(inl + 1), len - spc);
+ *(volatile uint32_t *)(inl + 4 + spc) =
+ SET_BYTE_COUNT((1 << 31) | (len - spc));
wmb();
- inl->byte_count = cpu_to_be32(1 << 31 | (len - spc));
+ *(volatile uint32_t *)inl =
+ SET_BYTE_COUNT((1 << 31) | spc);
}
- tx_desc->ctrl.vlan_tag = cpu_to_be16(*vlan_tag);
- tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN * !!(*vlan_tag);
- tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
}
static uint32_t hashrandom;
@@ -723,18 +644,14 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct mbuf *mb)
up = (vlan_tag >> 13) % MLX4_EN_NUM_UP;
}
#endif
- /* check if flowid is set */
- if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE)
- queue_index = mb->m_pkthdr.flowid;
- else
- queue_index = m_ether_tcpip_hash(MBUF_HASHFLAG_L3 | MBUF_HASHFLAG_L4, mb, hashrandom);
+ queue_index = m_ether_tcpip_hash(MBUF_HASHFLAG_L3 | MBUF_HASHFLAG_L4, mb, hashrandom);
return ((queue_index % rings_p_up) + (up * rings_p_up));
}
-static void mlx4_bf_copy(void __iomem *dst, unsigned long *src, unsigned bytecnt)
+static void mlx4_bf_copy(void __iomem *dst, volatile unsigned long *src, unsigned bytecnt)
{
- __iowrite64_copy(dst, src, bytecnt / 8);
+ __iowrite64_copy(dst, __DEVOLATILE(void *, src), bytecnt / 8);
}
static u64 mlx4_en_mac_to_u64(u8 *addr)
@@ -749,168 +666,263 @@ static u64 mlx4_en_mac_to_u64(u8 *addr)
return mac;
}
-static int mlx4_en_xmit(struct net_device *dev, int tx_ind, struct mbuf **mbp)
+static int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp)
{
- struct mlx4_en_priv *priv = netdev_priv(dev);
- struct mlx4_en_dev *mdev = priv->mdev;
- struct mlx4_en_tx_ring *ring;
- struct mlx4_en_cq *cq;
- struct mlx4_en_tx_desc *tx_desc;
- struct mlx4_wqe_data_seg *data;
+ enum {
+ DS_FACT = TXBB_SIZE / DS_SIZE_ALIGNMENT,
+ CTRL_FLAGS = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE |
+ MLX4_WQE_CTRL_SOLICITED),
+ };
+ bus_dma_segment_t segs[MLX4_EN_TX_MAX_MBUF_FRAGS];
+ volatile struct mlx4_wqe_data_seg *dseg;
+ volatile struct mlx4_wqe_data_seg *dseg_inline;
+ volatile struct mlx4_en_tx_desc *tx_desc;
+ struct mlx4_en_tx_ring *ring = priv->tx_ring[tx_ind];
+ struct ifnet *ifp = priv->dev;
struct mlx4_en_tx_info *tx_info;
+ struct mbuf *mb = *mbp;
struct mbuf *m;
- int nr_txbb;
+ __be32 owner_bit;
int nr_segs;
- int desc_size;
- int real_size;
- dma_addr_t dma;
- u32 index, bf_index, ring_size;
- __be32 op_own;
- u16 vlan_tag = 0;
- int i;
- int lso_header_size;
- bool bounce = false;
- bool inl = false;
- struct mbuf *mb;
- mb = *mbp;
- int defrag = 1;
-
- if (!priv->port_up)
- goto tx_drop;
-
- ring = priv->tx_ring[tx_ind];
- ring_size = ring->size;
- inl = is_inline(mb, ring->inline_thold);
-
-retry:
- real_size = get_real_size(mb, dev, &nr_segs, &lso_header_size, inl);
- if (unlikely(!real_size))
- goto tx_drop;
+ int pad;
+ int err;
+ u32 bf_size;
+ u32 bf_prod;
+ u32 opcode;
+ u16 index;
+ u16 ds_cnt;
+ u16 ihs;
- /* Align descriptor to TXBB size */
- desc_size = ALIGN(real_size, TXBB_SIZE);
- nr_txbb = desc_size / TXBB_SIZE;
- if (unlikely(nr_txbb > MAX_DESC_TXBBS)) {
- if (defrag) {
- mb = m_defrag(*mbp, M_NOWAIT);
- if (mb == NULL) {
- mb = *mbp;
- goto tx_drop;
- }
- *mbp = mb;
- defrag = 0;
- goto retry;
- }
- en_warn(priv, "Oversized header or SG list\n");
+ if (unlikely(!priv->port_up)) {
+ err = EINVAL;
goto tx_drop;
}
- /* Obtain VLAN information if present */
- if (mb->m_flags & M_VLANTAG) {
- vlan_tag = mb->m_pkthdr.ether_vtag;
- }
-
- /* Check available TXBBs and 2K spare for prefetch
- * Even if netif_tx_stop_queue() will be called
- * driver will send current packet to ensure
- * that at least one completion will be issued after
- * stopping the queue
- */
- if (unlikely((int)(ring->prod - ring->cons) > ring->full_size)) {
- /* every full Tx ring stops queue */
- if (ring->blocked == 0)
- atomic_add_int(&priv->blocked, 1);
- /* Set HW-queue-is-full flag */
- atomic_set_int(&dev->if_drv_flags, IFF_DRV_OACTIVE);
+ /* check if TX ring is full */
+ if (unlikely(mlx4_en_tx_ring_is_full(ring))) {
+ /* every full native Tx ring stops queue */
+ if (ring->blocked == 0)
+ atomic_add_int(&priv->blocked, 1);
+ /* Set HW-queue-is-full flag */
+ atomic_set_int(&ifp->if_drv_flags, IFF_DRV_OACTIVE);
+ priv->port_stats.queue_stopped++;
ring->blocked = 1;
priv->port_stats.queue_stopped++;
ring->queue_stopped++;
/* Use interrupts to find out when queue opened */
- cq = priv->tx_cq[tx_ind];
- mlx4_en_arm_cq(priv, cq);
- return EBUSY;
+ mlx4_en_arm_cq(priv, priv->tx_cq[tx_ind]);
+ return (ENOBUFS);
}
+ /* sanity check we are not wrapping around */
+ KASSERT(((~ring->prod) & ring->size_mask) >=
+ (MLX4_EN_TX_WQE_MAX_WQEBBS - 1), ("Wrapping around TX ring"));
+
/* Track current inflight packets for performance analysis */
AVG_PERF_COUNTER(priv->pstats.inflight_avg,
(u32) (ring->prod - ring->cons - 1));
- /* Packet is good - grab an index and transmit it */
+ /* Track current mbuf packet header length */
+ AVG_PERF_COUNTER(priv->pstats.tx_pktsz_avg, mb->m_pkthdr.len);
+
+ /* Grab an index and try to transmit packet */
+ owner_bit = (ring->prod & ring->size) ?
+ cpu_to_be32(MLX4_EN_BIT_DESC_OWN) : 0;
index = ring->prod & ring->size_mask;
- bf_index = ring->prod;
+ tx_desc = (volatile struct mlx4_en_tx_desc *)
+ (ring->buf + index * TXBB_SIZE);
+ tx_info = &ring->tx_info[index];
+ dseg = &tx_desc->data;
- /* See if we have enough space for whole descriptor TXBB for setting
- * SW ownership on next descriptor; if not, use a bounce buffer. */
- if (likely(index + nr_txbb <= ring_size))
- tx_desc = ring->buf + index * TXBB_SIZE;
- else {
- tx_desc = (struct mlx4_en_tx_desc *) ring->bounce_buf;
- bounce = true;
+ /* send a copy of the frame to the BPF listener, if any */
+ if (ifp != NULL && ifp->if_bpf != NULL)
+ ETHER_BPF_MTAP(ifp, mb);
+
+ /* get default flags */
+ tx_desc->ctrl.srcrb_flags = CTRL_FLAGS;
+
+ if (mb->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO))
+ tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM);
+
+ if (mb->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP |
+ CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO))
+ tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_TCP_UDP_CSUM);
+
+ /* do statistics */
+ if (likely(tx_desc->ctrl.srcrb_flags != CTRL_FLAGS)) {
+ priv->port_stats.tx_chksum_offload++;
+ ring->tx_csum++;
}
- /* Save mb in tx_info ring */
- tx_info = &ring->tx_info[index];
- tx_info->mb = mb;
- tx_info->nr_txbb = nr_txbb;
- tx_info->nr_segs = nr_segs;
-
- if (lso_header_size) {
- memcpy(tx_desc->lso.header, mb->m_data, lso_header_size);
- data = ((void *)&tx_desc->lso + ALIGN(lso_header_size + 4,
- DS_SIZE));
- /* lso header is part of m_data.
- * need to omit when mapping DMA */
- mb->m_data += lso_header_size;
- mb->m_len -= lso_header_size;
+ /* check for VLAN tag */
+ if (mb->m_flags & M_VLANTAG) {
+ tx_desc->ctrl.vlan_tag = cpu_to_be16(mb->m_pkthdr.ether_vtag);
+ tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN;
+ } else {
+ tx_desc->ctrl.vlan_tag = 0;
+ tx_desc->ctrl.ins_vlan = 0;
}
- else
- data = &tx_desc->data;
- /* valid only for none inline segments */
- tx_info->data_offset = (void *)data - (void *)tx_desc;
+ /* clear immediate field */
+ tx_desc->ctrl.imm = 0;
- if (inl) {
- tx_info->inl = 1;
+ /* Handle LSO (TSO) packets */
+ if (mb->m_pkthdr.csum_flags & CSUM_TSO) {
+ u32 payload_len;
+ u32 mss = mb->m_pkthdr.tso_segsz;
+ u32 num_pkts;
+
+ opcode = cpu_to_be32(MLX4_OPCODE_LSO | MLX4_WQE_CTRL_RR) |
+ owner_bit;
+ ihs = mlx4_en_get_header_size(mb);
+ if (unlikely(ihs > MAX_INLINE)) {
+ ring->oversized_packets++;
+ err = EINVAL;
+ goto tx_drop;
+ }
+ tx_desc->lso.mss_hdr_size = cpu_to_be32((mss << 16) | ihs);
+ payload_len = mb->m_pkthdr.len - ihs;
+ if (unlikely(payload_len == 0))
+ num_pkts = 1;
+ else
+ num_pkts = DIV_ROUND_UP(payload_len, mss);
+ ring->bytes += payload_len + (num_pkts * ihs);
+ ring->packets += num_pkts;
+ priv->port_stats.tso_packets++;
+ /* store pointer to inline header */
+ dseg_inline = dseg;
+ /* copy data inline */
+ dseg = mlx4_en_store_inline_lso_data(dseg,
+ mb, ihs, owner_bit);
} else {
- for (i = 0, m = mb; i < nr_segs; i++, m = m->m_next) {
- if (m->m_len == 0) {
- i--;
- continue;
- }
- dma = pci_map_single(mdev->dev->pdev, m->m_data,
- m->m_len, PCI_DMA_TODEVICE);
- data->addr = cpu_to_be64(dma);
- data->lkey = cpu_to_be32(mdev->mr.key);
- wmb();
- data->byte_count = cpu_to_be32(m->m_len);
- data++;
- }
- if (lso_header_size) {
- mb->m_data -= lso_header_size;
- mb->m_len += lso_header_size;
- }
- tx_info->inl = 0;
+ opcode = cpu_to_be32(MLX4_OPCODE_SEND) |
+ owner_bit;
+ ihs = mlx4_en_get_inline_hdr_size(ring, mb);
+ ring->bytes += max_t (unsigned int,
+ mb->m_pkthdr.len, ETHER_MIN_LEN - ETHER_CRC_LEN);
+ ring->packets++;
+ /* store pointer to inline header */
+ dseg_inline = dseg;
+ /* copy data inline */
+ dseg = mlx4_en_store_inline_data(dseg,
+ mb, ihs, owner_bit);
+ }
+ m_adj(mb, ihs);
+
+ /* trim off empty mbufs */
+ while (mb->m_len == 0) {
+ mb = m_free(mb);
+ /* check if all data has been inlined */
+ if (mb == NULL) {
+ nr_segs = 0;
+ goto skip_dma;
+ }
}
+ err = bus_dmamap_load_mbuf_sg(ring->dma_tag, tx_info->dma_map,
+ mb, segs, &nr_segs, BUS_DMA_NOWAIT);
+ if (unlikely(err == EFBIG)) {
+ /* Too many mbuf fragments */
+ m = m_defrag(mb, M_NOWAIT);
+ if (m == NULL) {
+ ring->oversized_packets++;
+ goto tx_drop;
+ }
+ mb = m;
+ /* Try again */
+ err = bus_dmamap_load_mbuf_sg(ring->dma_tag, tx_info->dma_map,
+ mb, segs, &nr_segs, BUS_DMA_NOWAIT);
+ }
+ /* catch errors */
+ if (unlikely(err != 0)) {
+ ring->oversized_packets++;
+ goto tx_drop;
+ }
+ /* make sure all mbuf data is written to RAM */
+ bus_dmamap_sync(ring->dma_tag, tx_info->dma_map,
+ BUS_DMASYNC_PREWRITE);
- /* Prepare ctrl segement apart opcode+ownership, which depends on
- * whether LSO is used */
- tx_desc->ctrl.vlan_tag = cpu_to_be16(vlan_tag);
- tx_desc->ctrl.ins_vlan = MLX4_WQE_CTRL_INS_VLAN *
- !!vlan_tag;
- tx_desc->ctrl.fence_size = (real_size / 16) & 0x3f;
- tx_desc->ctrl.srcrb_flags = priv->ctrl_flags;
- if (mb->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO |
- CSUM_TCP | CSUM_UDP | CSUM_TCP_IPV6 | CSUM_UDP_IPV6)) {
- if (mb->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO))
- tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM);
- if (mb->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP |
- CSUM_UDP_IPV6 | CSUM_TCP_IPV6 | CSUM_TSO))
- tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_TCP_UDP_CSUM);
- priv->port_stats.tx_chksum_offload++;
- ring->tx_csum++;
- }
+skip_dma:
+ /* compute number of DS needed */
+ ds_cnt = (dseg - ((volatile struct mlx4_wqe_data_seg *)tx_desc)) + nr_segs;
+
+ /*
+ * Check if the next request can wrap around and fill the end
+ * of the current request with zero immediate data:
+ */
+ pad = DIV_ROUND_UP(ds_cnt, DS_FACT);
+ pad = (~(ring->prod + pad)) & ring->size_mask;
+
+ if (unlikely(pad < (MLX4_EN_TX_WQE_MAX_WQEBBS - 1))) {
+ /*
+ * Compute the least number of DS blocks we need to
+ * pad in order to achieve a TX ring wraparound:
+ */
+ pad = (DS_FACT * (pad + 1));
+ } else {
+ /*
+ * The hardware will automatically jump to the next
+ * TXBB. No need for padding.
+ */
+ pad = 0;
+ }
+
+ /* compute total number of DS blocks */
+ ds_cnt += pad;
+ /*
+ * When modifying this code, please ensure that the following
+ * computation is always less than or equal to 0x3F:
+ *
+ * ((MLX4_EN_TX_WQE_MAX_WQEBBS - 1) * DS_FACT) +
+ * (MLX4_EN_TX_WQE_MAX_WQEBBS * DS_FACT)
+ *
+ * Else the "ds_cnt" variable can become too big.
+ */
+ tx_desc->ctrl.fence_size = (ds_cnt & 0x3f);
+
+ /* store pointer to mbuf */
+ tx_info->mb = mb;
+ tx_info->nr_txbb = DIV_ROUND_UP(ds_cnt, DS_FACT);
+ bf_size = ds_cnt * DS_SIZE_ALIGNMENT;
+ bf_prod = ring->prod;
+
+ /* compute end of "dseg" array */
+ dseg += nr_segs + pad;
+
+ /* pad using zero immediate dseg */
+ while (pad--) {
+ dseg--;
+ dseg->addr = 0;
+ dseg->lkey = 0;
+ wmb();
+ dseg->byte_count = SET_BYTE_COUNT((1 << 31)|0);
+ }
+
+ /* fill segment list */
+ while (nr_segs--) {
+ if (unlikely(segs[nr_segs].ds_len == 0)) {
+ dseg--;
+ dseg->addr = 0;
+ dseg->lkey = 0;
+ wmb();
+ dseg->byte_count = SET_BYTE_COUNT((1 << 31)|0);
+ } else {
+ dseg--;
+ dseg->addr = cpu_to_be64((uint64_t)segs[nr_segs].ds_addr);
+ dseg->lkey = cpu_to_be32(priv->mdev->mr.key);
+ wmb();
+ dseg->byte_count = SET_BYTE_COUNT((uint32_t)segs[nr_segs].ds_len);
+ }
+ }
+
+ wmb();
+
+ /* write owner bits in reverse order */
+ if ((opcode & cpu_to_be32(0x1F)) == cpu_to_be32(MLX4_OPCODE_LSO))
+ mlx4_en_store_inline_lso_header(dseg_inline, ihs, owner_bit);
+ else
+ mlx4_en_store_inline_header(dseg_inline, ihs, owner_bit);
if (unlikely(priv->validate_loopback)) {
/* Copy dst mac address to wqe */
@@ -928,77 +940,46 @@ retry:
}
}
- /* Handle LSO (TSO) packets */
- if (lso_header_size) {
- int segsz;
- /* Mark opcode as LSO */
- op_own = cpu_to_be32(MLX4_OPCODE_LSO | (1 << 6)) |
- ((ring->prod & ring_size) ?
- cpu_to_be32(MLX4_EN_BIT_DESC_OWN) : 0);
-
- /* Fill in the LSO prefix */
- tx_desc->lso.mss_hdr_size = cpu_to_be32(
- mb->m_pkthdr.tso_segsz << 16 | lso_header_size);
-
- priv->port_stats.tso_packets++;
- segsz = mb->m_pkthdr.tso_segsz;
- i = ((mb->m_pkthdr.len - lso_header_size + segsz - 1) / segsz);
- tx_info->nr_bytes= mb->m_pkthdr.len + (i - 1) * lso_header_size;
- ring->packets += i;
- } else {
- /* Normal (Non LSO) packet */
- op_own = cpu_to_be32(MLX4_OPCODE_SEND) |
- ((ring->prod & ring_size) ?
- cpu_to_be32(MLX4_EN_BIT_DESC_OWN) : 0);
- tx_info->nr_bytes = max(mb->m_pkthdr.len,
- (unsigned int)ETHER_MIN_LEN - ETHER_CRC_LEN);
- ring->packets++;
-
- }
- ring->bytes += tx_info->nr_bytes;
- AVG_PERF_COUNTER(priv->pstats.tx_pktsz_avg, mb->m_pkthdr.len);
+ /* update producer counter */
+ ring->prod += tx_info->nr_txbb;
- if (tx_info->inl) {
- build_inline_wqe(tx_desc, mb, real_size, &vlan_tag, tx_ind);
- tx_info->inl = 1;
- }
+ if (ring->bf_enabled && bf_size <= MAX_BF &&
+ (tx_desc->ctrl.ins_vlan != MLX4_WQE_CTRL_INS_VLAN)) {
- ring->prod += nr_txbb;
+ /* store doorbell number */
+ *(volatile __be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn);
+ /* or in producer number for this WQE */
+ opcode |= cpu_to_be32((bf_prod & 0xffff) << 8);
- /* If we used a bounce buffer then copy descriptor back into place */
- if (unlikely(bounce))
- tx_desc = mlx4_en_bounce_to_desc(priv, ring, index, desc_size);
- if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) {
- *(__be32 *) (&tx_desc->ctrl.vlan_tag) |= cpu_to_be32(ring->doorbell_qpn);
- op_own |= htonl((bf_index & 0xffff) << 8);
- /* Ensure new descirptor hits memory
- * before setting ownership of this descriptor to HW */
+ /*
+ * Ensure the new descriptor hits memory before
+ * setting ownership of this descriptor to HW:
+ */
wmb();
- tx_desc->ctrl.owner_opcode = op_own;
-
+ tx_desc->ctrl.owner_opcode = opcode;
wmb();
-
- mlx4_bf_copy(ring->bf.reg + ring->bf.offset, (unsigned long *) &tx_desc->ctrl,
- desc_size);
-
+ mlx4_bf_copy(((u8 *)ring->bf.reg) + ring->bf.offset,
+ (volatile unsigned long *) &tx_desc->ctrl, bf_size);
wmb();
-
ring->bf.offset ^= ring->bf.buf_size;
} else {
- /* Ensure new descirptor hits memory
- * before setting ownership of this descriptor to HW */
+ /*
+ * Ensure the new descriptor hits memory before
+ * setting ownership of this descriptor to HW:
+ */
wmb();
- tx_desc->ctrl.owner_opcode = op_own;
+ tx_desc->ctrl.owner_opcode = opcode;
wmb();
- writel(cpu_to_be32(ring->doorbell_qpn), ring->bf.uar->map + MLX4_SEND_DOORBELL);
+ writel(cpu_to_be32(ring->doorbell_qpn),
+ ((u8 *)ring->bf.uar->map) + MLX4_SEND_DOORBELL);
}
- return 0;
+ return (0);
tx_drop:
*mbp = NULL;
m_freem(mb);
- return EINVAL;
+ return (err);
}
static int
@@ -1018,13 +999,16 @@ mlx4_en_transmit_locked(struct ifnet *dev, int tx_ind, struct mbuf *m)
}
enqueued = 0;
- if (m != NULL) {
- if ((err = drbr_enqueue(dev, ring->br, m)) != 0)
- return (err);
- }
+ if (m != NULL)
+ /*
+ * If we can't insert mbuf into drbr, try to xmit anyway.
+ * We keep the error we got so we could return that after xmit.
+ */
+ err = drbr_enqueue(dev, ring->br, m);
+
/* Process the queue */
while ((next = drbr_peek(dev, ring->br)) != NULL) {
- if ((err = mlx4_en_xmit(dev, tx_ind, &next)) != 0) {
+ if (mlx4_en_xmit(priv, tx_ind, &next) != 0) {
if (next == NULL) {
drbr_advance(dev, ring->br);
} else {
@@ -1075,10 +1059,14 @@ mlx4_en_transmit(struct ifnet *dev, struct mbuf *m)
int i, err = 0;
/* Compute which queue to use */
- i = mlx4_en_select_queue(dev, m);
+ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
+ i = m->m_pkthdr.flowid % priv->tx_ring_num;
+ }
+ else {
+ i = mlx4_en_select_queue(dev, m);
+ }
ring = priv->tx_ring[i];
-
if (spin_trylock(&ring->tx_lock)) {
err = mlx4_en_transmit_locked(dev, i, m);
spin_unlock(&ring->tx_lock);
diff --git a/sys/ofed/drivers/net/mlx4/main.c b/sys/ofed/drivers/net/mlx4/main.c
index 0f2ab6c..462e7c8 100644
--- a/sys/ofed/drivers/net/mlx4/main.c
+++ b/sys/ofed/drivers/net/mlx4/main.c
@@ -33,7 +33,7 @@
* SOFTWARE.
*/
-#include <linux/kmod.h>
+#include <linux/kmod.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/pci.h>
@@ -53,9 +53,7 @@
#include "icm.h"
#include "mlx4_stats.h"
-MODULE_AUTHOR("Roland Dreier");
-MODULE_DESCRIPTION("Mellanox ConnectX HCA low-level driver");
-MODULE_LICENSE("Dual BSD/GPL");
+/* Mellanox ConnectX HCA low-level driver */
struct workqueue_struct *mlx4_wq;
@@ -173,7 +171,7 @@ MODULE_PARM_DESC(enable_64b_cqe_eqe,
#define PF_CONTEXT_BEHAVIOUR_MASK MLX4_FUNC_CAP_64B_EQE_CQE
static char mlx4_version[] __devinitdata =
- DRV_NAME ": Mellanox ConnectX core driver v"
+ DRV_NAME ": Mellanox ConnectX VPI driver v"
DRV_VERSION " (" DRV_RELDATE ")\n";
static int log_num_mac = 7;
@@ -1295,6 +1293,43 @@ static inline int ibta_mtu_to_int(enum ibta_mtu mtu)
}
}
+static ssize_t
+show_board(struct device *device, struct device_attribute *attr,
+ char *buf)
+{
+ struct mlx4_hca_info *info = container_of(attr, struct mlx4_hca_info,
+ board_attr);
+ struct mlx4_dev *mdev = info->dev;
+
+ return sprintf(buf, "%.*s\n", MLX4_BOARD_ID_LEN,
+ mdev->board_id);
+}
+
+static ssize_t
+show_hca(struct device *device, struct device_attribute *attr,
+ char *buf)
+{
+ struct mlx4_hca_info *info = container_of(attr, struct mlx4_hca_info,
+ hca_attr);
+ struct mlx4_dev *mdev = info->dev;
+
+ return sprintf(buf, "MT%d\n", mdev->pdev->device);
+}
+
+static ssize_t
+show_firmware_version(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct mlx4_hca_info *info = container_of(attr, struct mlx4_hca_info,
+ firmware_attr);
+ struct mlx4_dev *mdev = info->dev;
+
+ return sprintf(buf, "%d.%d.%d\n", (int)(mdev->caps.fw_ver >> 32),
+ (int)(mdev->caps.fw_ver >> 16) & 0xffff,
+ (int)mdev->caps.fw_ver & 0xffff);
+}
+
static ssize_t show_port_ib_mtu(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -2937,6 +2972,30 @@ no_msi:
no_irq:
dev->caps.num_comp_vectors = 0;
dev->caps.comp_pool = 0;
+ return;
+}
+
+static void
+mlx4_init_hca_info(struct mlx4_dev *dev)
+{
+ struct mlx4_hca_info *info = &mlx4_priv(dev)->hca_info;
+
+ info->dev = dev;
+
+ info->firmware_attr = (struct device_attribute)__ATTR(fw_ver, S_IRUGO,
+ show_firmware_version, NULL);
+ if (device_create_file(&dev->pdev->dev, &info->firmware_attr))
+ mlx4_err(dev, "Failed to add file firmware version");
+
+ info->hca_attr = (struct device_attribute)__ATTR(hca, S_IRUGO, show_hca,
+ NULL);
+ if (device_create_file(&dev->pdev->dev, &info->hca_attr))
+ mlx4_err(dev, "Failed to add file hca type");
+
+ info->board_attr = (struct device_attribute)__ATTR(board_id, S_IRUGO,
+ show_board, NULL);
+ if (device_create_file(&dev->pdev->dev, &info->board_attr))
+ mlx4_err(dev, "Failed to add file board id type");
}
static int mlx4_init_port_info(struct mlx4_dev *dev, int port)
@@ -2990,6 +3049,14 @@ static int mlx4_init_port_info(struct mlx4_dev *dev, int port)
return err;
}
+static void
+mlx4_cleanup_hca_info(struct mlx4_hca_info *info)
+{
+ device_remove_file(&info->dev->pdev->dev, &info->firmware_attr);
+ device_remove_file(&info->dev->pdev->dev, &info->board_attr);
+ device_remove_file(&info->dev->pdev->dev, &info->hca_attr);
+}
+
static void mlx4_cleanup_port_info(struct mlx4_port_info *info)
{
if (info->port < 0)
@@ -3347,6 +3414,7 @@ slave_start:
goto err_steer;
mlx4_init_quotas(dev);
+ mlx4_init_hca_info(dev);
for (port = 1; port <= dev->caps.num_ports; port++) {
err = mlx4_init_port_info(dev, port);
@@ -3439,8 +3507,7 @@ err_disable_pdev:
static int __devinit mlx4_init_one(struct pci_dev *pdev,
const struct pci_device_id *id)
{
- printk_once(KERN_INFO "%s", mlx4_version);
-
+ device_set_desc(pdev->dev.bsddev, mlx4_version);
return __mlx4_init_one(pdev, id->driver_data);
}
@@ -3460,6 +3527,7 @@ static void mlx4_remove_one(struct pci_dev *pdev)
mlx4_stop_sense(dev);
mlx4_unregister_device(dev);
+ mlx4_cleanup_hca_info(&priv->hca_info);
for (p = 1; p <= dev->caps.num_ports; p++) {
mlx4_cleanup_port_info(&priv->port[p]);
mlx4_CLOSE_PORT(dev, p);
diff --git a/sys/ofed/drivers/net/mlx4/mlx4.h b/sys/ofed/drivers/net/mlx4/mlx4.h
index 47fde25..bef2e00 100644
--- a/sys/ofed/drivers/net/mlx4/mlx4.h
+++ b/sys/ofed/drivers/net/mlx4/mlx4.h
@@ -51,7 +51,7 @@
#define DRV_NAME "mlx4_core"
#define PFX DRV_NAME ": "
-#define DRV_VERSION "2.1"
+#define DRV_VERSION "2.1.6"
#define DRV_RELDATE __DATE__
#define DRV_STACK_NAME "Linux-MLNX_OFED"
@@ -755,6 +755,13 @@ struct mlx4_set_port_rqp_calc_context {
__be32 mcast;
};
+struct mlx4_hca_info {
+ struct mlx4_dev *dev;
+ struct device_attribute firmware_attr;
+ struct device_attribute hca_attr;
+ struct device_attribute board_attr;
+};
+
struct mlx4_port_info {
struct mlx4_dev *dev;
int port;
@@ -845,6 +852,7 @@ struct mlx4_priv {
struct mlx4_uar driver_uar;
void __iomem *kar;
struct mlx4_port_info port[MLX4_MAX_PORTS + 1];
+ struct mlx4_hca_info hca_info;
struct mlx4_sense sense;
struct mutex port_mutex;
struct mlx4_msix_ctl msix_ctl;
diff --git a/sys/ofed/drivers/net/mlx4/mlx4_en.h b/sys/ofed/drivers/net/mlx4/mlx4_en.h
index f74865c..a584bad 100644
--- a/sys/ofed/drivers/net/mlx4/mlx4_en.h
+++ b/sys/ofed/drivers/net/mlx4/mlx4_en.h
@@ -59,8 +59,6 @@
#include "mlx4_stats.h"
#define DRV_NAME "mlx4_en"
-#define DRV_VERSION "2.1"
-#define DRV_RELDATE __DATE__
#define MLX4_EN_MSG_LEVEL (NETIF_MSG_LINK | NETIF_MSG_IFDOWN)
@@ -95,10 +93,6 @@
#define VLAN_MIN_VALUE 1
#define VLAN_MAX_VALUE 4094
-/* Typical TSO descriptor with 16 gather entries is 352 bytes... */
-#define MAX_DESC_SIZE 512
-#define MAX_DESC_TXBBS (MAX_DESC_SIZE / TXBB_SIZE)
-
/*
* OS related constants and tunables
*/
@@ -113,26 +107,6 @@ enum mlx4_en_alloc_type {
MLX4_EN_ALLOC_REPLACEMENT = 1,
};
-/* Receive fragment sizes; we use at most 3 fragments (for 9600 byte MTU
- * and 4K allocations) */
-#if MJUMPAGESIZE == 4096
-enum {
- FRAG_SZ0 = MCLBYTES,
- FRAG_SZ1 = MJUMPAGESIZE,
- FRAG_SZ2 = MJUMPAGESIZE,
-};
-#define MLX4_EN_MAX_RX_FRAGS 3
-#elif MJUMPAGESIZE == 8192
-enum {
- FRAG_SZ0 = MCLBYTES,
- FRAG_SZ1 = MJUMPAGESIZE,
-};
-#define MLX4_EN_MAX_RX_FRAGS 2
-#elif MJUMPAGESIZE == 8192
-#else
-#error "Unknown PAGE_SIZE"
-#endif
-
/* Maximum ring sizes */
#define MLX4_EN_DEF_TX_QUEUE_SIZE 4096
@@ -154,7 +128,7 @@ enum {
#define MLX4_EN_NUM_UP 1
#define MAX_TX_RINGS (MLX4_EN_MAX_TX_RING_P_UP * \
- MLX4_EN_NUM_UP)
+ MLX4_EN_NUM_UP)
#define MLX4_EN_DEF_TX_RING_SIZE 1024
#define MLX4_EN_DEF_RX_RING_SIZE 1024
@@ -235,16 +209,10 @@ enum cq_type {
#define ILLEGAL_MAC(addr) (addr == 0xffffffffffffULL || addr == 0x0)
struct mlx4_en_tx_info {
+ bus_dmamap_t dma_map;
struct mbuf *mb;
u32 nr_txbb;
u32 nr_bytes;
- u8 linear;
- u8 nr_segs;
- u8 data_offset;
- u8 inl;
-#if 0
- u8 ts_requested;
-#endif
};
@@ -265,14 +233,22 @@ struct mlx4_en_tx_desc {
#define MLX4_EN_USE_SRQ 0x01000000
-#define MLX4_EN_TX_BUDGET 64*4 //Compensate for no NAPI in freeBSD - might need some fine tunning in the future.
#define MLX4_EN_RX_BUDGET 64
+#define MLX4_EN_TX_MAX_DESC_SIZE 512 /* bytes */
+#define MLX4_EN_TX_MAX_MBUF_SIZE 65536 /* bytes */
+#define MLX4_EN_TX_MAX_PAYLOAD_SIZE 65536 /* bytes */
+#define MLX4_EN_TX_MAX_MBUF_FRAGS \
+ ((MLX4_EN_TX_MAX_DESC_SIZE - 128) / DS_SIZE_ALIGNMENT) /* units */
+#define MLX4_EN_TX_WQE_MAX_WQEBBS \
+ (MLX4_EN_TX_MAX_DESC_SIZE / TXBB_SIZE) /* units */
+
#define MLX4_EN_CX3_LOW_ID 0x1000
#define MLX4_EN_CX3_HIGH_ID 0x1005
struct mlx4_en_tx_ring {
spinlock_t tx_lock;
+ bus_dma_tag_t dma_tag;
struct mlx4_hwq_resources wqres;
u32 size ; /* number of TXBBs */
u32 size_mask;
@@ -282,11 +258,10 @@ struct mlx4_en_tx_ring {
u32 cons;
u32 buf_size;
u32 doorbell_qpn;
- void *buf;
+ u8 *buf;
u16 poll_cnt;
int blocked;
struct mlx4_en_tx_info *tx_info;
- u8 *bounce_buf;
u8 queue_index;
cpuset_t affinity_mask;
struct buf_ring *br;
@@ -300,13 +275,12 @@ struct mlx4_en_tx_ring {
unsigned long packets;
unsigned long tx_csum;
unsigned long queue_stopped;
+ unsigned long oversized_packets;
unsigned long wake_queue;
struct mlx4_bf bf;
bool bf_enabled;
- struct netdev_queue *tx_queue;
int hwtstamp_tx_type;
spinlock_t comp_lock;
- int full_size;
int inline_thold;
u64 watchdog_time;
};
@@ -316,14 +290,21 @@ struct mlx4_en_rx_desc {
struct mlx4_wqe_data_seg data[0];
};
-struct mlx4_en_rx_buf {
- dma_addr_t dma;
- struct page *page;
- unsigned int page_offset;
+struct mlx4_en_rx_mbuf {
+ bus_dmamap_t dma_map;
+ struct mbuf *mbuf;
+};
+
+struct mlx4_en_rx_spare {
+ bus_dmamap_t dma_map;
+ struct mbuf *mbuf;
+ u64 paddr_be;
};
struct mlx4_en_rx_ring {
struct mlx4_hwq_resources wqres;
+ bus_dma_tag_t dma_tag;
+ struct mlx4_en_rx_spare spare;
u32 size ; /* number of Rx descs*/
u32 actual_size;
u32 size_mask;
@@ -339,8 +320,8 @@ struct mlx4_en_rx_ring {
u32 rx_buf_size;
u32 rx_mb_size;
int qpn;
- void *buf;
- void *rx_info;
+ u8 *buf;
+ struct mlx4_en_rx_mbuf *mbuf;
unsigned long errors;
unsigned long bytes;
unsigned long packets;
@@ -400,6 +381,7 @@ struct mlx4_en_cq {
#define MLX4_EN_OPCODE_ERROR 0x1e
u32 tot_rx;
u32 tot_tx;
+ u32 curr_poll_rx_cpu_id;
#ifdef CONFIG_NET_RX_BUSY_POLL
unsigned int state;
@@ -524,12 +506,6 @@ struct en_port {
u8 vport_num;
};
-struct mlx4_en_frag_info {
- u16 frag_size;
- u16 frag_prefix_size;
-};
-
-
struct mlx4_en_priv {
struct mlx4_en_dev *mdev;
struct mlx4_en_port_profile *prof;
@@ -575,18 +551,14 @@ struct mlx4_en_priv {
int cqe_factor;
struct mlx4_en_rss_map rss_map;
- __be32 ctrl_flags;
u32 flags;
u8 num_tx_rings_p_up;
u32 tx_ring_num;
u32 rx_ring_num;
u32 rx_mb_size;
- struct mlx4_en_frag_info frag_info[MLX4_EN_MAX_RX_FRAGS];
u16 rx_alloc_order;
u32 rx_alloc_size;
u32 rx_buf_size;
- u16 num_frags;
- u16 log_rx_info;
struct mlx4_en_tx_ring **tx_ring;
struct mlx4_en_rx_ring *rx_ring[MAX_RX_RINGS];
@@ -641,7 +613,6 @@ struct mlx4_en_priv {
unsigned long last_ifq_jiffies;
u64 if_counters_rx_errors;
u64 if_counters_rx_no_buffer;
-
};
enum mlx4_en_wol {
diff --git a/sys/ofed/drivers/net/mlx4/mlx4_stats.h b/sys/ofed/drivers/net/mlx4/mlx4_stats.h
index 0270cef..ef0b1c0 100644
--- a/sys/ofed/drivers/net/mlx4/mlx4_stats.h
+++ b/sys/ofed/drivers/net/mlx4/mlx4_stats.h
@@ -124,6 +124,7 @@ struct mlx4_en_port_stats {
unsigned long queue_stopped;
unsigned long wake_queue;
unsigned long tx_timeout;
+ unsigned long oversized_packets;
unsigned long rx_alloc_failed;
unsigned long rx_chksum_good;
unsigned long rx_chksum_none;
diff --git a/sys/ofed/drivers/net/mlx4/port.c b/sys/ofed/drivers/net/mlx4/port.c
index 4d7aa0b..9ef63f7 100644
--- a/sys/ofed/drivers/net/mlx4/port.c
+++ b/sys/ofed/drivers/net/mlx4/port.c
@@ -1145,12 +1145,17 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, u16 offset,
size = MODULE_INFO_MAX_READ;
inbox = mlx4_alloc_cmd_mailbox(dev);
- if (IS_ERR(inbox))
+ if (IS_ERR(inbox)) {
+ mlx4_err(dev,
+ "mlx4_alloc_cmd_mailbox returned with error(%lx)", PTR_ERR(inbox));
return PTR_ERR(inbox);
+ }
outbox = mlx4_alloc_cmd_mailbox(dev);
if (IS_ERR(outbox)) {
mlx4_free_cmd_mailbox(dev, inbox);
+ mlx4_err(dev,
+ "mlx4_alloc_cmd_mailbox returned with error(%lx)", PTR_ERR(outbox));
return PTR_ERR(outbox);
}
diff --git a/sys/ofed/include/linux/mlx4/cq.h b/sys/ofed/include/linux/mlx4/cq.h
index ed6bec1..b39910a 100644
--- a/sys/ofed/include/linux/mlx4/cq.h
+++ b/sys/ofed/include/linux/mlx4/cq.h
@@ -139,7 +139,7 @@ enum {
};
static inline void mlx4_cq_arm(struct mlx4_cq *cq, u32 cmd,
- void __iomem *uar_page,
+ u8 __iomem *uar_page,
spinlock_t *doorbell_lock)
{
__be32 doorbell[2];
diff --git a/sys/ofed/include/linux/mlx4/device.h b/sys/ofed/include/linux/mlx4/device.h
index 536c421..aca4aef 100644
--- a/sys/ofed/include/linux/mlx4/device.h
+++ b/sys/ofed/include/linux/mlx4/device.h
@@ -413,6 +413,13 @@ enum {
#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \
MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK)
+enum mlx4_module_id {
+ MLX4_MODULE_ID_SFP = 0x3,
+ MLX4_MODULE_ID_QSFP = 0xC,
+ MLX4_MODULE_ID_QSFP_PLUS = 0xD,
+ MLX4_MODULE_ID_QSFP28 = 0x11,
+};
+
static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
{
return (major << 32) | (minor << 16) | subminor;
diff --git a/sys/ofed/include/linux/mlx4/doorbell.h b/sys/ofed/include/linux/mlx4/doorbell.h
index f31bba2..6724e5e 100644
--- a/sys/ofed/include/linux/mlx4/doorbell.h
+++ b/sys/ofed/include/linux/mlx4/doorbell.h
@@ -77,7 +77,7 @@ static inline void mlx4_write64(__be32 val[2], void __iomem *dest,
spin_lock_irqsave(doorbell_lock, flags);
__raw_writel((__force u32) val[0], dest);
- __raw_writel((__force u32) val[1], dest + 4);
+ __raw_writel((__force u32) val[1], (u8 *)dest + 4);
spin_unlock_irqrestore(doorbell_lock, flags);
}
diff --git a/sys/ofed/include/linux/mlx4/qp.h b/sys/ofed/include/linux/mlx4/qp.h
index 9b78167..c8b6cb1 100644
--- a/sys/ofed/include/linux/mlx4/qp.h
+++ b/sys/ofed/include/linux/mlx4/qp.h
@@ -39,6 +39,12 @@
#define MLX4_INVALID_LKEY 0x100
+#define DS_SIZE_ALIGNMENT 16
+
+#define SET_BYTE_COUNT(byte_count) cpu_to_be32(byte_count)
+#define SET_LSO_MSS(mss_hdr_size) cpu_to_be32(mss_hdr_size)
+#define DS_BYTE_COUNT_MASK cpu_to_be32(0x7fffffff)
+
enum ib_m_qp_attr_mask {
IB_M_EXT_CLASS_1 = 1 << 28,
IB_M_EXT_CLASS_2 = 1 << 29,
@@ -266,7 +272,9 @@ enum { /* param3 */
#define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232)
enum {
+ MLX4_WQE_CTRL_OWN = 1 << 31,
MLX4_WQE_CTRL_NEC = 1 << 29,
+ MLX4_WQE_CTRL_RR = 1 << 6,
MLX4_WQE_CTRL_FENCE = 1 << 6,
MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2,
MLX4_WQE_CTRL_SOLICITED = 1 << 1,
diff --git a/sys/pc98/conf/GENERIC b/sys/pc98/conf/GENERIC
index 5adcf32..478df09 100644
--- a/sys/pc98/conf/GENERIC
+++ b/sys/pc98/conf/GENERIC
@@ -29,7 +29,7 @@ options SCHED_4BSD # 4BSD scheduler
#options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
-options IPSEC # IP (v4/v6) security
+options IPSEC # IP (v4/v6) security
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
diff --git a/sys/pc98/conf/NOTES b/sys/pc98/conf/NOTES
index 5442002..1dfc260 100644
--- a/sys/pc98/conf/NOTES
+++ b/sys/pc98/conf/NOTES
@@ -506,7 +506,7 @@ options KVA_PAGES=260
# ABI Emulation
# Enable iBCS2 runtime support for SCO and ISC binaries
-options IBCS2
+#options IBCS2
# Emulate spx device for client side of SVR3 local X interface
options SPX_HACK
diff --git a/sys/pc98/include/bus.h b/sys/pc98/include/bus.h
index 3292474..2060414 100644
--- a/sys/pc98/include/bus.h
+++ b/sys/pc98/include/bus.h
@@ -78,7 +78,9 @@
#ifndef _PC98_BUS_H_
#define _PC98_BUS_H_
+#ifdef _KERNEL
#include <sys/systm.h>
+#endif /* _KERNEL */
#include <machine/_bus.h>
#include <machine/cpufunc.h>
@@ -92,6 +94,8 @@
#define BUS_SPACE_UNRESTRICTED (~0)
+#ifdef _KERNEL
+
/*
* address relocation table
*/
@@ -639,4 +643,6 @@ bus_space_barrier(bus_space_tag_t tag, bus_space_handle_t bsh,
#define bus_space_copy_region_stream_4(t, h1, o1, h2, o2, c) \
bus_space_copy_region_4((t), (h1), (o1), (h2), (o2), (c))
+#endif /* _KERNEL */
+
#endif /* _PC98_BUS_H_ */
diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S
index e1fcd3a..fc2fa8d 100644
--- a/sys/powerpc/aim/locore64.S
+++ b/sys/powerpc/aim/locore64.S
@@ -65,6 +65,10 @@
#include <machine/spr.h>
#include <machine/asm.h>
+#ifdef _CALL_ELF
+.abiversion _CALL_ELF
+#endif
+
/* Locate the per-CPU data structure */
#define GET_CPUINFO(r) \
mfsprg0 r
diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC
index e2ed787..f67e5e5 100644
--- a/sys/powerpc/conf/GENERIC
+++ b/sys/powerpc/conf/GENERIC
@@ -37,7 +37,7 @@ options SCHED_ULE #ULE scheduler
options PREEMPTION #Enable kernel thread preemption
options INET #InterNETworking
options INET6 #IPv6 communications protocols
-options IPSEC # IP (v4/v6) security
+options IPSEC # IP (v4/v6) security
options SCTP #Stream Control Transmission Protocol
options FFS #Berkeley Fast Filesystem
options SOFTUPDATES #Enable FFS soft updates support
diff --git a/sys/powerpc/include/asm.h b/sys/powerpc/include/asm.h
index e5ec398..3aec5d3 100644
--- a/sys/powerpc/include/asm.h
+++ b/sys/powerpc/include/asm.h
@@ -61,17 +61,26 @@
#define HIDENAME(asmsym) __CONCAT(.,asmsym)
#endif
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
#ifdef _KERNEL
+/* ELFv1 kernel uses global dot symbols */
#define DOT_LABEL(name) __CONCAT(.,name)
#define TYPE_ENTRY(name) .size name,24; \
.type DOT_LABEL(name),@function; \
.globl DOT_LABEL(name);
#define END_SIZE(name) .size DOT_LABEL(name),.-DOT_LABEL(name);
#else /* !_KERNEL */
+/* ELFv1 user code uses local function entry points */
#define DOT_LABEL(name) __CONCAT(.L.,name)
#define TYPE_ENTRY(name) .type name,@function;
#define END_SIZE(name) .size name,.-DOT_LABEL(name);
#endif /* _KERNEL */
+#else
+/* ELFv2 doesn't have any of this complication */
+#define DOT_LABEL(name) name
+#define TYPE_ENTRY(name) .type name,@function;
+#define END_SIZE(name) .size name,.-DOT_LABEL(name);
+#endif
#define _GLOBAL(name) \
.data; \
@@ -87,7 +96,9 @@
.tc name[TC],name
#endif
-#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
+#ifdef __powerpc64__
+
+#if !defined(_CALL_ELF) || _CALL_ELF == 1
#define _ENTRY(name) \
.section ".text"; \
.p2align 2; \
@@ -100,6 +111,17 @@
.p2align 4; \
TYPE_ENTRY(name) \
DOT_LABEL(name):
+#else
+#define _ENTRY(name) \
+ .text; \
+ .p2align 4; \
+ .globl name; \
+ .type name,@function; \
+name: \
+ addis %r2, %r12, (.TOC.-name)@ha; \
+ addi %r2, %r2, (.TOC.-name)@l; \
+ .localentry name, .-name;
+#endif
#define _END(name) \
.long 0; \
diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h
index 4780a68..df5a7be 100644
--- a/sys/powerpc/include/param.h
+++ b/sys/powerpc/include/param.h
@@ -69,7 +69,7 @@
#if defined(SMP) || defined(KLD_MODULE)
#ifndef MAXCPU
-#define MAXCPU 32
+#define MAXCPU 256
#endif
#else
#define MAXCPU 1
diff --git a/sys/powerpc/include/spr.h b/sys/powerpc/include/spr.h
index ab48a91..86dac97 100644
--- a/sys/powerpc/include/spr.h
+++ b/sys/powerpc/include/spr.h
@@ -652,7 +652,9 @@
#elif defined(BOOKE)
+#define SPR_MCARU 0x239 /* ..8 Machine Check Address register upper bits */
#define SPR_MCSR 0x23c /* ..8 Machine Check Syndrome register */
+#define SPR_MCAR 0x23d /* ..8 Machine Check Address register */
#define SPR_ESR 0x003e /* ..8 Exception Syndrome Register */
#define ESR_PIL 0x08000000 /* Program interrupt - illegal */
diff --git a/sys/powerpc/mpc85xx/qoriq_gpio.c b/sys/powerpc/mpc85xx/qoriq_gpio.c
new file mode 100644
index 0000000..626b390
--- /dev/null
+++ b/sys/powerpc/mpc85xx/qoriq_gpio.c
@@ -0,0 +1,309 @@
+/*-
+ * Copyright (c) 2015 Justin Hibbits
+ * 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$
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/rman.h>
+#include <sys/gpio.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <machine/stdarg.h>
+
+#include <dev/gpio/gpiobusvar.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
+#include "gpio_if.h"
+
+#define MAXPIN (31)
+
+#define VALID_PIN(u) ((u) >= 0 && (u) <= MAXPIN)
+
+#define GPIO_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
+#define GPIO_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)
+#define GPIO_LOCK_INIT(sc) \
+ mtx_init(&(sc)->sc_mtx, device_get_nameunit((sc)->dev), \
+ "gpio", MTX_DEF)
+#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
+
+#define GPIO_GPDIR 0x0
+#define GPIO_GPODR 0x4
+#define GPIO_GPDAT 0x8
+#define GPIO_GPIER 0xc
+#define GPIO_GPIMR 0x10
+#define GPIO_GPICR 0x14
+
+
+struct qoriq_gpio_softc {
+ device_t dev;
+ device_t busdev;
+ struct mtx sc_mtx;
+ struct resource *sc_mem; /* Memory resource */
+};
+
+static device_t
+qoriq_gpio_get_bus(device_t dev)
+{
+ struct qoriq_gpio_softc *sc;
+
+ sc = device_get_softc(dev);
+
+ return (sc->busdev);
+}
+
+static int
+qoriq_gpio_pin_max(device_t dev, int *maxpin)
+{
+
+ *maxpin = MAXPIN;
+ return (0);
+}
+
+/* Get a specific pin's capabilities. */
+static int
+qoriq_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps)
+{
+
+ if (!VALID_PIN(pin))
+ return (EINVAL);
+
+ *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
+
+ return (0);
+}
+
+/* Get a specific pin's name. */
+static int
+qoriq_gpio_pin_getname(device_t dev, uint32_t pin, char *name)
+{
+
+ if (!VALID_PIN(pin))
+ return (EINVAL);
+
+ snprintf(name, GPIOMAXNAME, "qoriq_gpio%d.%d",
+ device_get_unit(dev), pin);
+ name[GPIOMAXNAME-1] = '\0';
+
+ return (0);
+}
+
+/* Set flags for the pin. */
+static int
+qoriq_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags)
+{
+ struct qoriq_gpio_softc *sc = device_get_softc(dev);
+ uint32_t reg;
+
+ if (!VALID_PIN(pin))
+ return (EINVAL);
+
+ if ((flags & (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)) ==
+ (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT))
+ return (EINVAL);
+
+ GPIO_LOCK(sc);
+ if (flags & GPIO_PIN_INPUT) {
+ reg = bus_read_4(sc->sc_mem, GPIO_GPDIR);
+ reg &= ~(1 << (31 - pin));
+ bus_write_4(sc->sc_mem, GPIO_GPDIR, reg);
+ }
+ else if (flags & GPIO_PIN_OUTPUT) {
+ reg = bus_read_4(sc->sc_mem, GPIO_GPDIR);
+ reg |= (1 << (31 - pin));
+ bus_write_4(sc->sc_mem, GPIO_GPDIR, reg);
+ reg = bus_read_4(sc->sc_mem, GPIO_GPODR);
+ if (flags & GPIO_PIN_OPENDRAIN)
+ reg |= (1 << (31 - pin));
+ else
+ reg &= ~(1 << (31 - pin));
+ bus_write_4(sc->sc_mem, GPIO_GPODR, reg);
+ }
+ GPIO_UNLOCK(sc);
+ return (0);
+}
+
+/* Set a specific output pin's value. */
+static int
+qoriq_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value)
+{
+ struct qoriq_gpio_softc *sc = device_get_softc(dev);
+ uint32_t outvals;
+ uint8_t pinbit;
+
+ if (!VALID_PIN(pin) || value > 1)
+ return (EINVAL);
+
+ GPIO_LOCK(sc);
+ pinbit = 31 - pin;
+
+ outvals = bus_read_4(sc->sc_mem, GPIO_GPDAT);
+ outvals &= ~(1 << pinbit);
+ outvals |= (value << pinbit);
+ bus_write_4(sc->sc_mem, 0, outvals);
+
+ GPIO_UNLOCK(sc);
+
+ return (0);
+}
+
+/* Get a specific pin's input value. */
+static int
+qoriq_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *value)
+{
+ struct qoriq_gpio_softc *sc = device_get_softc(dev);
+
+ if (!VALID_PIN(pin))
+ return (EINVAL);
+
+ *value = (bus_read_4(sc->sc_mem, GPIO_GPDAT) >> (31 - pin)) & 1;
+
+ return (0);
+}
+
+/* Toggle a pin's output value. */
+static int
+qoriq_gpio_pin_toggle(device_t dev, uint32_t pin)
+{
+ struct qoriq_gpio_softc *sc = device_get_softc(dev);
+ uint32_t val;
+
+ if (!VALID_PIN(pin))
+ return (EINVAL);
+
+ GPIO_LOCK(sc);
+
+ val = bus_read_4(sc->sc_mem, GPIO_GPDAT);
+ val ^= (1 << (31 - pin));
+ bus_write_4(sc->sc_mem, 0, val);
+
+ GPIO_UNLOCK(sc);
+
+ return (0);
+}
+
+static int
+qoriq_gpio_probe(device_t dev)
+{
+
+ if (!ofw_bus_is_compatible(dev, "fsl,qoriq-gpio"))
+ return (ENXIO);
+
+ device_set_desc(dev, "Freescale QorIQ GPIO driver");
+
+ return (0);
+}
+
+static int qoriq_gpio_detach(device_t dev);
+
+static int
+qoriq_gpio_attach(device_t dev)
+{
+ struct qoriq_gpio_softc *sc = device_get_softc(dev);
+ int rid;
+
+ sc->dev = dev;
+
+ GPIO_LOCK_INIT(sc);
+
+ /* Allocate memory. */
+ rid = 0;
+ sc->sc_mem = bus_alloc_resource_any(dev,
+ SYS_RES_MEMORY, &rid, RF_ACTIVE);
+ if (sc->sc_mem == NULL) {
+ device_printf(dev, "Can't allocate memory for device output port");
+ qoriq_gpio_detach(dev);
+ return (ENOMEM);
+ }
+
+ sc->busdev = gpiobus_attach_bus(dev);
+ if (sc->busdev == NULL) {
+ qoriq_gpio_detach(dev);
+ return (ENOMEM);
+ }
+
+ OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev);
+
+ return (0);
+}
+
+static int
+qoriq_gpio_detach(device_t dev)
+{
+ struct qoriq_gpio_softc *sc = device_get_softc(dev);
+
+ gpiobus_detach_bus(dev);
+
+ if (sc->sc_mem != NULL) {
+ /* Release output port resource. */
+ bus_release_resource(dev, SYS_RES_MEMORY,
+ rman_get_rid(sc->sc_mem), sc->sc_mem);
+ }
+
+ GPIO_LOCK_DESTROY(sc);
+
+ return (0);
+}
+
+static device_method_t qoriq_gpio_methods[] = {
+ /* device_if */
+ DEVMETHOD(device_probe, qoriq_gpio_probe),
+ DEVMETHOD(device_attach, qoriq_gpio_attach),
+ DEVMETHOD(device_detach, qoriq_gpio_detach),
+
+ /* GPIO protocol */
+ DEVMETHOD(gpio_get_bus, qoriq_gpio_get_bus),
+ DEVMETHOD(gpio_pin_max, qoriq_gpio_pin_max),
+ DEVMETHOD(gpio_pin_getname, qoriq_gpio_pin_getname),
+ DEVMETHOD(gpio_pin_getcaps, qoriq_gpio_pin_getcaps),
+ DEVMETHOD(gpio_pin_get, qoriq_gpio_pin_get),
+ DEVMETHOD(gpio_pin_set, qoriq_gpio_pin_set),
+ DEVMETHOD(gpio_pin_setflags, qoriq_gpio_pin_setflags),
+ DEVMETHOD(gpio_pin_toggle, qoriq_gpio_pin_toggle),
+
+ DEVMETHOD_END
+};
+
+static driver_t qoriq_gpio_driver = {
+ "gpio",
+ qoriq_gpio_methods,
+ sizeof(struct qoriq_gpio_softc),
+};
+static devclass_t qoriq_gpio_devclass;
+
+EARLY_DRIVER_MODULE(qoriq_gpio, simplebus, qoriq_gpio_driver,
+ qoriq_gpio_devclass, NULL, NULL,
+ BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE);
diff --git a/sys/powerpc/powerpc/elf32_machdep.c b/sys/powerpc/powerpc/elf32_machdep.c
index bfe23ac..027105d 100644
--- a/sys/powerpc/powerpc/elf32_machdep.c
+++ b/sys/powerpc/powerpc/elf32_machdep.c
@@ -68,8 +68,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_table = sysent,
#endif
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -77,7 +75,6 @@ struct sysentvec elf32_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode32,
.sv_szsigcode = &szsigcode32,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF32",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/powerpc/powerpc/elf64_machdep.c b/sys/powerpc/powerpc/elf64_machdep.c
index 71a9a70..261660a 100644
--- a/sys/powerpc/powerpc/elf64_machdep.c
+++ b/sys/powerpc/powerpc/elf64_machdep.c
@@ -56,8 +56,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -65,7 +63,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode64,
.sv_szsigcode = &szsigcode64,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF64",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
@@ -95,8 +92,6 @@ struct sysentvec elf64_freebsd_sysvec_v2 = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -104,7 +99,6 @@ struct sysentvec elf64_freebsd_sysvec_v2 = {
.sv_sendsig = sendsig,
.sv_sigcode = sigcode64_elfv2,
.sv_szsigcode = &szsigcode64_elfv2,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF64 V2",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c
index 88bbf7cb..e9eff54 100644
--- a/sys/powerpc/powerpc/exec_machdep.c
+++ b/sys/powerpc/powerpc/exec_machdep.c
@@ -972,11 +972,12 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
cf->cf_arg1 = (register_t)tf;
pcb2->pcb_sp = (register_t)cf;
- #ifdef __powerpc64__
+ #if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
pcb2->pcb_lr = ((register_t *)fork_trampoline)[0];
pcb2->pcb_toc = ((register_t *)fork_trampoline)[1];
#else
pcb2->pcb_lr = (register_t)fork_trampoline;
+ pcb2->pcb_context[0] = pcb2->pcb_lr;
#endif
pcb2->pcb_cpu.aim.usr_vsid = 0;
diff --git a/sys/powerpc/powerpc/sigcode64.S b/sys/powerpc/powerpc/sigcode64.S
index 47be3ab..43d9ecb 100644
--- a/sys/powerpc/powerpc/sigcode64.S
+++ b/sys/powerpc/powerpc/sigcode64.S
@@ -57,6 +57,7 @@ CNAME(sigcode64):
CNAME(sigcode64_elfv2):
addi 1,1,-112 /* reserved space for callee */
+ mflr 12 /* ELFv2 wants the address in r12 */
blrl
addi 3,1,112+SF_UC /* restore sp, and get &frame->sf_uc */
diff --git a/sys/powerpc/powerpc/swtch64.S b/sys/powerpc/powerpc/swtch64.S
index d2f6863..fbec9a5 100644
--- a/sys/powerpc/powerpc/swtch64.S
+++ b/sys/powerpc/powerpc/swtch64.S
@@ -65,6 +65,10 @@
#include <machine/param.h>
#include <machine/asm.h>
+#ifdef _CALL_ELF
+.abiversion _CALL_ELF
+#endif
+
TOC_ENTRY(blocked_lock)
/*
diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c
index 29130ea..a18c293 100644
--- a/sys/powerpc/powerpc/trap.c
+++ b/sys/powerpc/powerpc/trap.c
@@ -401,6 +401,9 @@ static void
printtrap(u_int vector, struct trapframe *frame, int isfatal, int user)
{
uint16_t ver;
+#ifdef BOOKE
+ vm_paddr_t pa;
+#endif
printf("\n");
printf("%s %s trap:\n", isfatal ? "fatal" : "handled",
@@ -429,7 +432,10 @@ printtrap(u_int vector, struct trapframe *frame, int isfatal, int user)
printf(" msssr0 = 0x%lx\n",
(u_long)mfspr(SPR_MSSSR0));
#elif defined(BOOKE)
- printf(" mcsr = 0x%lx\n", (u_long)mfspr(SPR_MCSR));
+ pa = mfspr(SPR_MCARU);
+ pa = (pa << 32) | mfspr(SPR_MCAR);
+ printf(" mcsr = 0x%lx\n", (u_long)mfspr(SPR_MCSR));
+ printf(" mcar = 0x%jx\n", (uintmax_t)pa);
#endif
break;
}
diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c
index c816e32..3d4e58b 100644
--- a/sys/powerpc/powerpc/vm_machdep.c
+++ b/sys/powerpc/powerpc/vm_machdep.c
@@ -143,7 +143,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
cf = (struct callframe *)tf - 1;
memset(cf, 0, sizeof(struct callframe));
- #ifdef __powerpc64__
+ #if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
cf->cf_toc = ((register_t *)fork_return)[1];
#endif
cf->cf_func = (register_t)fork_return;
@@ -152,11 +152,12 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
pcb->pcb_sp = (register_t)cf;
KASSERT(pcb->pcb_sp % 16 == 0, ("stack misaligned"));
- #ifdef __powerpc64__
+ #if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
pcb->pcb_lr = ((register_t *)fork_trampoline)[0];
pcb->pcb_toc = ((register_t *)fork_trampoline)[1];
#else
pcb->pcb_lr = (register_t)fork_trampoline;
+ pcb->pcb_context[0] = pcb->pcb_lr;
#endif
#ifdef AIM
pcb->pcb_cpu.aim.usr_vsid = 0;
diff --git a/sys/sparc64/conf/GENERIC b/sys/sparc64/conf/GENERIC
index 0038c66..27fea64 100644
--- a/sys/sparc64/conf/GENERIC
+++ b/sys/sparc64/conf/GENERIC
@@ -30,7 +30,7 @@ options SCHED_ULE # ULE scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
-options IPSEC # IP (v4/v6) security
+options IPSEC # IP (v4/v6) security
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
diff --git a/sys/sparc64/include/kerneldump.h b/sys/sparc64/include/kerneldump.h
index 7fad3fc..684c9e3 100644
--- a/sys/sparc64/include/kerneldump.h
+++ b/sys/sparc64/include/kerneldump.h
@@ -29,9 +29,9 @@
#define _MACHINE_KERNELDUMP_H_
struct sparc64_dump_reg {
- vm_paddr_t dr_pa;
- vm_offset_t dr_size;
- vm_offset_t dr_offs;
+ uint64_t dr_pa;
+ uint64_t dr_size;
+ uint64_t dr_offs;
};
/*
@@ -40,11 +40,12 @@ struct sparc64_dump_reg {
* would require some ugly hacks.
*/
struct sparc64_dump_hdr {
- vm_offset_t dh_hdr_size;
- vm_paddr_t dh_tsb_pa;
- vm_size_t dh_tsb_size;
- vm_size_t dh_tsb_mask;
- int dh_nregions;
+ uint64_t dh_hdr_size;
+ uint64_t dh_tsb_pa;
+ uint64_t dh_tsb_size;
+ uint64_t dh_tsb_mask;
+ int32_t dh_nregions;
+ int32_t dh_pad;
struct sparc64_dump_reg dh_regions[];
};
diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c
index 0dab76d..eea21a2 100644
--- a/sys/sparc64/sparc64/elf_machdep.c
+++ b/sys/sparc64/sparc64/elf_machdep.c
@@ -58,8 +58,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_size = SYS_MAXSYSCALL,
.sv_table = sysent,
.sv_mask = 0,
- .sv_sigsize = 0,
- .sv_sigtbl = NULL,
.sv_errsize = 0,
.sv_errtbl = NULL,
.sv_transtrap = NULL,
@@ -67,7 +65,6 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_sendsig = sendsig,
.sv_sigcode = NULL,
.sv_szsigcode = NULL,
- .sv_prepsyscall = NULL,
.sv_name = "FreeBSD ELF64",
.sv_coredump = __elfN(coredump),
.sv_imgact_try = NULL,
diff --git a/sys/sys/bio.h b/sys/sys/bio.h
index 535ce61..8b3a5fc 100644
--- a/sys/sys/bio.h
+++ b/sys/sys/bio.h
@@ -61,6 +61,7 @@
#define BIO_ORDERED 0x08
#define BIO_UNMAPPED 0x10
#define BIO_TRANSIENT_MAPPING 0x20
+#define BIO_VLIST 0x40
#ifdef _KERNEL
struct disk;
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index bdc457e..75b41f3 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -211,9 +211,9 @@ struct buf {
#define B_NOCACHE 0x00008000 /* Do not cache block after use. */
#define B_MALLOC 0x00010000 /* malloced b_data */
#define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */
-#define B_000400000 0x00040000 /* Available flag. */
-#define B_000800000 0x00080000 /* Available flag. */
-#define B_001000000 0x00100000 /* Available flag. */
+#define B_00040000 0x00040000 /* Available flag. */
+#define B_00080000 0x00080000 /* Available flag. */
+#define B_00100000 0x00100000 /* Available flag. */
#define B_DIRTY 0x00200000 /* Needs writing later (in EXT2FS). */
#define B_RELBUF 0x00400000 /* Release VMIO buffer. */
#define B_FS_FLAG1 0x00800000 /* Available flag for FS use. */
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 4001822..4681acd 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -277,9 +277,9 @@ void setconf(void);
#define dev2unit(d) ((d)->si_drv0)
-typedef void (*cdevpriv_dtr_t)(void *data);
+typedef void d_priv_dtor_t(void *data);
int devfs_get_cdevpriv(void **datap);
-int devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t dtr);
+int devfs_set_cdevpriv(void *priv, d_priv_dtor_t *dtr);
void devfs_clear_cdevpriv(void);
void devfs_fpdrop(struct file *fp); /* XXX This is not public KPI */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 657c557..f196dd6 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1100090 /* Master, propagated to newvers */
+#define __FreeBSD_version 1100091 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h
index 47662fa..4561ec6 100644
--- a/sys/sys/pmc.h
+++ b/sys/sys/pmc.h
@@ -96,6 +96,9 @@
__PMC_CPU(INTEL_WESTMERE_EX, 0x94, "Intel Westmere Xeon E7") \
__PMC_CPU(INTEL_HASWELL_XEON, 0x95, "Intel Haswell Xeon E5 v3") \
__PMC_CPU(INTEL_BROADWELL, 0x96, "Intel Broadwell") \
+ __PMC_CPU(INTEL_BROADWELL_XEON, 0x97, "Intel Broadwell Xeon") \
+ __PMC_CPU(INTEL_SKYLAKE, 0x98, "Intel Skylake") \
+ __PMC_CPU(INTEL_SKYLAKE_XEON, 0x99, "Intel Skylake Xeon") \
__PMC_CPU(INTEL_XSCALE, 0x100, "Intel XScale") \
__PMC_CPU(MIPS_24K, 0x200, "MIPS 24K") \
__PMC_CPU(MIPS_OCTEON, 0x201, "Cavium Octeon") \
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 7e25ee4..fe78fb4 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -92,8 +92,6 @@ struct sysentvec {
int sv_size; /* number of entries */
struct sysent *sv_table; /* pointer to sysent */
u_int sv_mask; /* optional mask to index */
- int sv_sigsize; /* size of signal translation table */
- int *sv_sigtbl; /* signal translation table */
int sv_errsize; /* size of errno translation table */
int *sv_errtbl; /* errno translation table */
int (*sv_transtrap)(int, int);
@@ -104,8 +102,6 @@ struct sysentvec {
/* send signal */
char *sv_sigcode; /* start of sigtramp code */
int *sv_szsigcode; /* size of sigtramp code */
- void (*sv_prepsyscall)(struct trapframe *, int *, u_int *,
- caddr_t *);
char *sv_name; /* name of binary type */
int (*sv_coredump)(struct thread *, struct vnode *, off_t, int);
/* function to dump core, or NULL */
diff --git a/sys/sys/uio.h b/sys/sys/uio.h
index 271a2f7..ff21b09 100644
--- a/sys/sys/uio.h
+++ b/sys/sys/uio.h
@@ -85,6 +85,7 @@ struct uio {
struct vm_object;
struct vm_page;
+struct bus_dma_segment;
struct uio *cloneuio(struct uio *uiop);
int copyinfrom(const void * __restrict src, void * __restrict dst,
@@ -98,6 +99,10 @@ int copyout_map(struct thread *td, vm_offset_t *addr, size_t sz);
int copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz);
int physcopyin(void *src, vm_paddr_t dst, size_t len);
int physcopyout(vm_paddr_t src, void *dst, size_t len);
+int physcopyin_vlist(struct bus_dma_segment *src, off_t offset,
+ vm_paddr_t dst, size_t len);
+int physcopyout_vlist(vm_paddr_t src, struct bus_dma_segment *dst,
+ off_t offset, size_t len);
int uiomove(void *cp, int n, struct uio *uio);
int uiomove_frombuf(void *buf, int buflen, struct uio *uio);
int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n,
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index cce39ef..2ee63f2 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -234,7 +234,6 @@ struct xvnode {
* are required for writing but the status may be checked with either.
*/
#define VI_MOUNT 0x0020 /* Mount in progress */
-#define VI_AGE 0x0040 /* Insert vnode at head of free list */
#define VI_DOOMED 0x0080 /* This vnode is being recycled */
#define VI_FREE 0x0100 /* This vnode is on the freelist */
#define VI_ACTIVE 0x0200 /* This vnode is on the active list */
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index ebd8520..82c22fd 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1670,10 +1670,8 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags)
ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO);
/* Allocate a new vnode/inode. */
- if (fs->fs_magic == FS_UFS1_MAGIC)
- error = getnewvnode("ufs", mp, &ffs_vnodeops1, &vp);
- else
- error = getnewvnode("ufs", mp, &ffs_vnodeops2, &vp);
+ error = getnewvnode("ufs", mp, fs->fs_magic == FS_UFS1_MAGIC ?
+ &ffs_vnodeops1 : &ffs_vnodeops2, &vp);
if (error) {
*vpp = NULL;
uma_zfree(uma_inode, ip);
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index 33fba4e..a0446be 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -60,10 +60,8 @@ static vm_object_t dev_pager_alloc(void *, vm_ooffset_t, vm_prot_t,
vm_ooffset_t, struct ucred *);
static void dev_pager_dealloc(vm_object_t);
static int dev_pager_getpages(vm_object_t, vm_page_t *, int, int);
-static void dev_pager_putpages(vm_object_t, vm_page_t *, int,
- boolean_t, int *);
-static boolean_t dev_pager_haspage(vm_object_t, vm_pindex_t, int *,
- int *);
+static void dev_pager_putpages(vm_object_t, vm_page_t *, int, int, int *);
+static boolean_t dev_pager_haspage(vm_object_t, vm_pindex_t, int *, int *);
static void dev_pager_free_page(vm_object_t object, vm_page_t m);
/* list of device pager objects */
@@ -101,8 +99,9 @@ static struct cdev_pager_ops old_dev_pager_ops = {
};
static void
-dev_pager_init()
+dev_pager_init(void)
{
+
TAILQ_INIT(&dev_pager_object_list);
mtx_init(&dev_pager_mtx, "dev_pager list", NULL, MTX_DEF);
}
@@ -233,8 +232,7 @@ dev_pager_free_page(vm_object_t object, vm_page_t m)
}
static void
-dev_pager_dealloc(object)
- vm_object_t object;
+dev_pager_dealloc(vm_object_t object)
{
vm_page_t m;
@@ -261,7 +259,7 @@ dev_pager_dealloc(object)
static int
dev_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int reqpage)
{
- int error, i;
+ int error;
VM_OBJECT_ASSERT_WLOCKED(object);
error = object->un_pager.devp.ops->cdev_pg_fault(object,
@@ -269,13 +267,7 @@ dev_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int reqpage)
VM_OBJECT_ASSERT_WLOCKED(object);
- for (i = 0; i < count; i++) {
- if (i != reqpage) {
- vm_page_lock(ma[i]);
- vm_page_free(ma[i]);
- vm_page_unlock(ma[i]);
- }
- }
+ vm_pager_free_nonreq(object, ma, reqpage, count, TRUE);
if (error == VM_PAGER_OK) {
KASSERT((object->type == OBJT_DEVICE &&
@@ -362,24 +354,18 @@ old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot,
}
static void
-dev_pager_putpages(object, m, count, sync, rtvals)
- vm_object_t object;
- vm_page_t *m;
- int count;
- boolean_t sync;
- int *rtvals;
+dev_pager_putpages(vm_object_t object, vm_page_t *m, int count, int flags,
+ int *rtvals)
{
panic("dev_pager_putpage called");
}
static boolean_t
-dev_pager_haspage(object, pindex, before, after)
- vm_object_t object;
- vm_pindex_t pindex;
- int *before;
- int *after;
+dev_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before,
+ int *after)
{
+
if (before != NULL)
*before = 0;
if (after != NULL)
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 0a3c2ef..9c5c83a 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1419,240 +1419,219 @@ retry:
VM_OBJECT_WLOCK(new_object);
}
-#define OBSC_TEST_ALL_SHADOWED 0x0001
#define OBSC_COLLAPSE_NOWAIT 0x0002
#define OBSC_COLLAPSE_WAIT 0x0004
-static int
-vm_object_backing_scan(vm_object_t object, int op)
+static vm_page_t
+vm_object_collapse_scan_wait(vm_object_t object, vm_page_t p, vm_page_t next,
+ int op)
{
- int r = 1;
- vm_page_t p;
vm_object_t backing_object;
- vm_pindex_t backing_offset_index;
+
+ VM_OBJECT_ASSERT_WLOCKED(object);
+ backing_object = object->backing_object;
+ VM_OBJECT_ASSERT_WLOCKED(backing_object);
+
+ KASSERT(p == NULL || vm_page_busied(p), ("unbusy page %p", p));
+ KASSERT(p == NULL || p->object == object || p->object == backing_object,
+ ("invalid ownership %p %p %p", p, object, backing_object));
+ if ((op & OBSC_COLLAPSE_NOWAIT) != 0)
+ return (next);
+ if (p != NULL)
+ vm_page_lock(p);
+ VM_OBJECT_WUNLOCK(object);
+ VM_OBJECT_WUNLOCK(backing_object);
+ if (p == NULL)
+ VM_WAIT;
+ else
+ vm_page_busy_sleep(p, "vmocol");
+ VM_OBJECT_WLOCK(object);
+ VM_OBJECT_WLOCK(backing_object);
+ return (TAILQ_FIRST(&backing_object->memq));
+}
+
+static bool
+vm_object_scan_all_shadowed(vm_object_t object)
+{
+ vm_object_t backing_object;
+ vm_page_t p, pp;
+ vm_pindex_t backing_offset_index, new_pindex;
VM_OBJECT_ASSERT_WLOCKED(object);
VM_OBJECT_ASSERT_WLOCKED(object->backing_object);
backing_object = object->backing_object;
- backing_offset_index = OFF_TO_IDX(object->backing_object_offset);
/*
- * Initial conditions
+ * Initial conditions:
+ *
+ * We do not want to have to test for the existence of cache or swap
+ * pages in the backing object. XXX but with the new swapper this
+ * would be pretty easy to do.
*/
- if (op & OBSC_TEST_ALL_SHADOWED) {
+ if (backing_object->type != OBJT_DEFAULT)
+ return (false);
+
+ backing_offset_index = OFF_TO_IDX(object->backing_object_offset);
+
+ for (p = TAILQ_FIRST(&backing_object->memq); p != NULL;
+ p = TAILQ_NEXT(p, listq)) {
+ new_pindex = p->pindex - backing_offset_index;
+
/*
- * We do not want to have to test for the existence of cache
- * or swap pages in the backing object. XXX but with the
- * new swapper this would be pretty easy to do.
+ * Ignore pages outside the parent object's range and outside
+ * the parent object's mapping of the backing object.
+ */
+ if (p->pindex < backing_offset_index ||
+ new_pindex >= object->size)
+ continue;
+
+ /*
+ * See if the parent has the page or if the parent's object
+ * pager has the page. If the parent has the page but the page
+ * is not valid, the parent's object pager must have the page.
*
- * XXX what about anonymous MAP_SHARED memory that hasn't
- * been ZFOD faulted yet? If we do not test for this, the
- * shadow test may succeed! XXX
+ * If this fails, the parent does not completely shadow the
+ * object and we might as well give up now.
*/
- if (backing_object->type != OBJT_DEFAULT) {
- return (0);
- }
+ pp = vm_page_lookup(object, new_pindex);
+ if ((pp == NULL || pp->valid == 0) &&
+ !vm_pager_has_page(object, new_pindex, NULL, NULL))
+ return (false);
}
- if (op & OBSC_COLLAPSE_WAIT) {
+ return (true);
+}
+
+static bool
+vm_object_collapse_scan(vm_object_t object, int op)
+{
+ vm_object_t backing_object;
+ vm_page_t next, p, pp;
+ vm_pindex_t backing_offset_index, new_pindex;
+
+ VM_OBJECT_ASSERT_WLOCKED(object);
+ VM_OBJECT_ASSERT_WLOCKED(object->backing_object);
+
+ backing_object = object->backing_object;
+ backing_offset_index = OFF_TO_IDX(object->backing_object_offset);
+
+ /*
+ * Initial conditions
+ */
+ if ((op & OBSC_COLLAPSE_WAIT) != 0)
vm_object_set_flag(backing_object, OBJ_DEAD);
- }
/*
* Our scan
*/
- p = TAILQ_FIRST(&backing_object->memq);
- while (p) {
- vm_page_t next = TAILQ_NEXT(p, listq);
- vm_pindex_t new_pindex = p->pindex - backing_offset_index;
+ for (p = TAILQ_FIRST(&backing_object->memq); p != NULL; p = next) {
+ next = TAILQ_NEXT(p, listq);
+ new_pindex = p->pindex - backing_offset_index;
+
+ /*
+ * Check for busy page
+ */
+ if (vm_page_busied(p)) {
+ next = vm_object_collapse_scan_wait(object, p, next, op);
+ continue;
+ }
- if (op & OBSC_TEST_ALL_SHADOWED) {
- vm_page_t pp;
+ KASSERT(p->object == backing_object,
+ ("vm_object_collapse_scan: object mismatch"));
+
+ if (p->pindex < backing_offset_index ||
+ new_pindex >= object->size) {
+ if (backing_object->type == OBJT_SWAP)
+ swap_pager_freespace(backing_object, p->pindex,
+ 1);
/*
- * Ignore pages outside the parent object's range
- * and outside the parent object's mapping of the
- * backing object.
- *
- * note that we do not busy the backing object's
- * page.
+ * Page is out of the parent object's range, we can
+ * simply destroy it.
*/
- if (
- p->pindex < backing_offset_index ||
- new_pindex >= object->size
- ) {
- p = next;
- continue;
- }
+ vm_page_lock(p);
+ KASSERT(!pmap_page_is_mapped(p),
+ ("freeing mapped page %p", p));
+ if (p->wire_count == 0)
+ vm_page_free(p);
+ else
+ vm_page_remove(p);
+ vm_page_unlock(p);
+ continue;
+ }
+ pp = vm_page_lookup(object, new_pindex);
+ if (pp != NULL && vm_page_busied(pp)) {
/*
- * See if the parent has the page or if the parent's
- * object pager has the page. If the parent has the
- * page but the page is not valid, the parent's
- * object pager must have the page.
+ * The page in the parent is busy and possibly not
+ * (yet) valid. Until its state is finalized by the
+ * busy bit owner, we can't tell whether it shadows the
+ * original page. Therefore, we must either skip it
+ * and the original (backing_object) page or wait for
+ * its state to be finalized.
*
- * If this fails, the parent does not completely shadow
- * the object and we might as well give up now.
+ * This is due to a race with vm_fault() where we must
+ * unbusy the original (backing_obj) page before we can
+ * (re)lock the parent. Hence we can get here.
*/
-
- pp = vm_page_lookup(object, new_pindex);
- if (
- (pp == NULL || pp->valid == 0) &&
- !vm_pager_has_page(object, new_pindex, NULL, NULL)
- ) {
- r = 0;
- break;
- }
+ next = vm_object_collapse_scan_wait(object, pp, next,
+ op);
+ continue;
}
- /*
- * Check for busy page
- */
- if (op & (OBSC_COLLAPSE_WAIT | OBSC_COLLAPSE_NOWAIT)) {
- vm_page_t pp;
-
- if (op & OBSC_COLLAPSE_NOWAIT) {
- if (!p->valid || vm_page_busied(p)) {
- p = next;
- continue;
- }
- } else if (op & OBSC_COLLAPSE_WAIT) {
- if (vm_page_busied(p)) {
- VM_OBJECT_WUNLOCK(object);
- vm_page_lock(p);
- VM_OBJECT_WUNLOCK(backing_object);
- vm_page_busy_sleep(p, "vmocol");
- VM_OBJECT_WLOCK(object);
- VM_OBJECT_WLOCK(backing_object);
- /*
- * If we slept, anything could have
- * happened. Since the object is
- * marked dead, the backing offset
- * should not have changed so we
- * just restart our scan.
- */
- p = TAILQ_FIRST(&backing_object->memq);
- continue;
- }
- }
-
- KASSERT(
- p->object == backing_object,
- ("vm_object_backing_scan: object mismatch")
- );
-
- if (
- p->pindex < backing_offset_index ||
- new_pindex >= object->size
- ) {
- if (backing_object->type == OBJT_SWAP)
- swap_pager_freespace(backing_object,
- p->pindex, 1);
-
- /*
- * Page is out of the parent object's range, we
- * can simply destroy it.
- */
- vm_page_lock(p);
- KASSERT(!pmap_page_is_mapped(p),
- ("freeing mapped page %p", p));
- if (p->wire_count == 0)
- vm_page_free(p);
- else
- vm_page_remove(p);
- vm_page_unlock(p);
- p = next;
- continue;
- }
-
- pp = vm_page_lookup(object, new_pindex);
- if (
- (op & OBSC_COLLAPSE_NOWAIT) != 0 &&
- (pp != NULL && pp->valid == 0)
- ) {
- if (backing_object->type == OBJT_SWAP)
- swap_pager_freespace(backing_object,
- p->pindex, 1);
-
- /*
- * The page in the parent is not (yet) valid.
- * We don't know anything about the state of
- * the original page. It might be mapped,
- * so we must avoid the next if here.
- *
- * This is due to a race in vm_fault() where
- * we must unbusy the original (backing_obj)
- * page before we can (re)lock the parent.
- * Hence we can get here.
- */
- p = next;
- continue;
- }
- if (
- pp != NULL ||
- vm_pager_has_page(object, new_pindex, NULL, NULL)
- ) {
- if (backing_object->type == OBJT_SWAP)
- swap_pager_freespace(backing_object,
- p->pindex, 1);
-
- /*
- * page already exists in parent OR swap exists
- * for this location in the parent. Destroy
- * the original page from the backing object.
- *
- * Leave the parent's page alone
- */
- vm_page_lock(p);
- KASSERT(!pmap_page_is_mapped(p),
- ("freeing mapped page %p", p));
- if (p->wire_count == 0)
- vm_page_free(p);
- else
- vm_page_remove(p);
- vm_page_unlock(p);
- p = next;
- continue;
- }
+ KASSERT(pp == NULL || pp->valid != 0,
+ ("unbusy invalid page %p", pp));
+ if (pp != NULL || vm_pager_has_page(object, new_pindex, NULL,
+ NULL)) {
/*
- * Page does not exist in parent, rename the
- * page from the backing object to the main object.
- *
- * If the page was mapped to a process, it can remain
- * mapped through the rename.
- * vm_page_rename() will handle dirty and cache.
+ * The page already exists in the parent OR swap exists
+ * for this location in the parent. Leave the parent's
+ * page alone. Destroy the original page from the
+ * backing object.
*/
- if (vm_page_rename(p, object, new_pindex)) {
- if (op & OBSC_COLLAPSE_NOWAIT) {
- p = next;
- continue;
- }
- VM_OBJECT_WUNLOCK(backing_object);
- VM_OBJECT_WUNLOCK(object);
- VM_WAIT;
- VM_OBJECT_WLOCK(object);
- VM_OBJECT_WLOCK(backing_object);
- p = TAILQ_FIRST(&backing_object->memq);
- continue;
- }
-
- /* Use the old pindex to free the right page. */
if (backing_object->type == OBJT_SWAP)
- swap_pager_freespace(backing_object,
- new_pindex + backing_offset_index, 1);
+ swap_pager_freespace(backing_object, p->pindex,
+ 1);
+ vm_page_lock(p);
+ KASSERT(!pmap_page_is_mapped(p),
+ ("freeing mapped page %p", p));
+ if (p->wire_count == 0)
+ vm_page_free(p);
+ else
+ vm_page_remove(p);
+ vm_page_unlock(p);
+ continue;
+ }
+
+ /*
+ * Page does not exist in parent, rename the page from the
+ * backing object to the main object.
+ *
+ * If the page was mapped to a process, it can remain mapped
+ * through the rename. vm_page_rename() will handle dirty and
+ * cache.
+ */
+ if (vm_page_rename(p, object, new_pindex)) {
+ next = vm_object_collapse_scan_wait(object, NULL, next,
+ op);
+ continue;
+ }
+
+ /* Use the old pindex to free the right page. */
+ if (backing_object->type == OBJT_SWAP)
+ swap_pager_freespace(backing_object,
+ new_pindex + backing_offset_index, 1);
#if VM_NRESERVLEVEL > 0
- /*
- * Rename the reservation.
- */
- vm_reserv_rename(p, object, backing_object,
- backing_offset_index);
+ /*
+ * Rename the reservation.
+ */
+ vm_reserv_rename(p, object, backing_object,
+ backing_offset_index);
#endif
- }
- p = next;
}
- return (r);
+ return (true);
}
@@ -1672,7 +1651,7 @@ vm_object_qcollapse(vm_object_t object)
if (backing_object->ref_count != 1)
return;
- vm_object_backing_scan(object, OBSC_COLLAPSE_NOWAIT);
+ vm_object_collapse_scan(object, OBSC_COLLAPSE_NOWAIT);
}
/*
@@ -1730,15 +1709,15 @@ vm_object_collapse(vm_object_t object)
* all the resident pages in the entire backing object.
*
* This is ignoring pager-backed pages such as swap pages.
- * vm_object_backing_scan fails the shadowing test in this
+ * vm_object_collapse_scan fails the shadowing test in this
* case.
*/
if (backing_object->ref_count == 1) {
/*
* If there is exactly one reference to the backing
- * object, we can collapse it into the parent.
+ * object, we can collapse it into the parent.
*/
- vm_object_backing_scan(object, OBSC_COLLAPSE_WAIT);
+ vm_object_collapse_scan(object, OBSC_COLLAPSE_WAIT);
#if VM_NRESERVLEVEL > 0
/*
@@ -1819,8 +1798,7 @@ vm_object_collapse(vm_object_t object)
* there is nothing we can do so we give up.
*/
if (object->resident_page_count != object->size &&
- vm_object_backing_scan(object,
- OBSC_TEST_ALL_SHADOWED) == 0) {
+ !vm_object_scan_all_shadowed(object)) {
VM_OBJECT_WUNLOCK(backing_object);
break;
}
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 2c7b10e..4997c82 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -729,32 +729,33 @@ vm_pageout_grow_cache(int tries, vm_paddr_t low, vm_paddr_t high)
* the specified address range, as indicated by segments
* constituting the domain.
*/
-again:
+again_inact:
if (inactl < inactmax) {
if (vm_phys_domain_intersects(vm_dom[dom].vmd_segs,
low, high) &&
vm_pageout_launder(&vm_dom[dom].vmd_pagequeues[PQ_INACTIVE],
tries, low, high)) {
inactl++;
- goto again;
+ goto again_inact;
}
if (++dom == vm_ndomains)
dom = 0;
if (dom != initial_dom)
- goto again;
+ goto again_inact;
}
+again_act:
if (actl < actmax) {
if (vm_phys_domain_intersects(vm_dom[dom].vmd_segs,
low, high) &&
vm_pageout_launder(&vm_dom[dom].vmd_pagequeues[PQ_ACTIVE],
tries, low, high)) {
actl++;
- goto again;
+ goto again_act;
}
if (++dom == vm_ndomains)
dom = 0;
if (dom != initial_dom)
- goto again;
+ goto again_act;
}
}
diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c
index 34e69e1..8f34b31 100644
--- a/sys/vm/vm_reserv.c
+++ b/sys/vm/vm_reserv.c
@@ -971,7 +971,7 @@ vm_reserv_reclaim_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
{
vm_paddr_t pa, size;
vm_reserv_t rv;
- int hi, i, lo, next_free;
+ int hi, i, lo, low_index, next_free;
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
if (npages > VM_LEVEL_0_NPAGES - 1)
@@ -990,8 +990,9 @@ vm_reserv_reclaim_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
}
if (pa < low) {
/* Start the search for free pages at "low". */
- i = (low - pa) / NBPOPMAP;
- hi = (low - pa) % NBPOPMAP;
+ low_index = (low + PAGE_MASK - pa) >> PAGE_SHIFT;
+ i = low_index / NBPOPMAP;
+ hi = low_index % NBPOPMAP;
} else
i = hi = 0;
do {
diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c
index 62554bd..241a769 100644
--- a/sys/x86/acpica/madt.c
+++ b/sys/x86/acpica/madt.c
@@ -166,37 +166,30 @@ madt_setup_local(void)
} else if (vm_guest == VM_GUEST_XEN) {
x2apic_mode = 0;
reason = "due to running under XEN";
- } else if (vm_guest == VM_GUEST_NO) {
+ } else if (vm_guest == VM_GUEST_NO &&
+ CPUID_TO_FAMILY(cpu_id) == 0x6 &&
+ CPUID_TO_MODEL(cpu_id) == 0x2a) {
hw_vendor = kern_getenv("smbios.planar.maker");
/*
- * It seems that some Lenovo SandyBridge-based
- * notebook BIOSes have a bug which prevents
- * booting AP in x2APIC mode. Since the only
- * way to detect mobile CPU is to check
- * northbridge pci id, which cannot be done
- * that early, disable x2APIC for all Lenovo
- * SandyBridge machines.
+ * It seems that some Lenovo and ASUS
+ * SandyBridge-based notebook BIOSes have a
+ * bug which prevents booting AP in x2APIC
+ * mode. Since the only way to detect mobile
+ * CPU is to check northbridge pci id, which
+ * cannot be done that early, disable x2APIC
+ * for all Lenovo and ASUS SandyBridge
+ * machines.
*/
- if (hw_vendor != NULL &&
- !strcmp(hw_vendor, "LENOVO") &&
- CPUID_TO_FAMILY(cpu_id) == 0x6 &&
- CPUID_TO_MODEL(cpu_id) == 0x2a) {
- x2apic_mode = 0;
- reason =
- "for a suspected Lenovo SandyBridge BIOS bug";
- }
- /*
- * Same reason, ASUS SandyBridge.
- */
- if (hw_vendor != NULL &&
- !strcmp(hw_vendor, "ASUSTeK Computer Inc.") &&
- CPUID_TO_FAMILY(cpu_id) == 0x6 &&
- CPUID_TO_MODEL(cpu_id) == 0x2a) {
- x2apic_mode = 0;
- reason =
- "for a suspected ASUS SandyBridge BIOS bug";
+ if (hw_vendor != NULL) {
+ if (!strcmp(hw_vendor, "LENOVO") ||
+ !strcmp(hw_vendor,
+ "ASUSTeK Computer Inc.")) {
+ x2apic_mode = 0;
+ reason =
+ "for a suspected SandyBridge BIOS bug";
+ }
+ freeenv(hw_vendor);
}
- freeenv(hw_vendor);
}
TUNABLE_INT_FETCH("hw.x2apic_enable", &x2apic_mode);
if (!x2apic_mode && reason != NULL && bootverbose)
diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c
index 106a842..7fc6278 100644
--- a/sys/x86/x86/local_apic.c
+++ b/sys/x86/x86/local_apic.c
@@ -467,10 +467,20 @@ native_lapic_init(vm_paddr_t addr)
* we by default enable suppression even when system only has
* one IO-APIC, since EOI is broadcasted to all APIC agents,
* including CPUs, otherwise.
+ *
+ * It seems that at least some KVM versions report
+ * EOI_SUPPRESSION bit, but auto-EOI does not work.
*/
ver = lapic_read32(LAPIC_VERSION);
if ((ver & APIC_VER_EOI_SUPPRESSION) != 0) {
lapic_eoi_suppression = 1;
+ if (vm_guest == VM_GUEST_VM &&
+ !strcmp(hv_vendor, "KVMKVMKVM")) {
+ if (bootverbose)
+ printf(
+ "KVM -- disabling lapic eoi suppression\n");
+ lapic_eoi_suppression = 0;
+ }
TUNABLE_INT_FETCH("hw.lapic_eoi_suppression",
&lapic_eoi_suppression);
}
diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c
index a9f3f1b..9594ff3 100644
--- a/sys/x86/x86/mp_x86.c
+++ b/sys/x86/x86/mp_x86.c
@@ -713,19 +713,6 @@ SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_page, CTLFLAG_RW, &ipi_page, 0, "");
SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_range, CTLFLAG_RW, &ipi_range, 0, "");
SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_range_size, CTLFLAG_RW, &ipi_range_size,
0, "");
-
-u_int ipi_masked_global;
-u_int ipi_masked_page;
-u_int ipi_masked_range;
-u_int ipi_masked_range_size;
-SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_global, CTLFLAG_RW,
- &ipi_masked_global, 0, "");
-SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_page, CTLFLAG_RW,
- &ipi_masked_page, 0, "");
-SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_range, CTLFLAG_RW,
- &ipi_masked_range, 0, "");
-SYSCTL_INT(_debug_xhits, OID_AUTO, ipi_masked_range_size, CTLFLAG_RW,
- &ipi_masked_range_size, 0, "");
#endif /* COUNT_XINVLTLB_HITS */
/*
@@ -1090,3 +1077,165 @@ mp_ipi_intrcnt(void *dummy)
}
SYSINIT(mp_ipi_intrcnt, SI_SUB_INTR, SI_ORDER_MIDDLE, mp_ipi_intrcnt, NULL);
#endif
+
+/*
+ * Flush the TLB on other CPU's
+ */
+
+/* Variables needed for SMP tlb shootdown. */
+static vm_offset_t smp_tlb_addr1, smp_tlb_addr2;
+pmap_t smp_tlb_pmap;
+volatile int smp_tlb_wait;
+
+#ifdef __amd64__
+#define read_eflags() read_rflags()
+#endif
+
+static void
+smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap,
+ vm_offset_t addr1, vm_offset_t addr2)
+{
+ int cpu, ncpu, othercpus;
+
+ othercpus = mp_ncpus - 1; /* does not shootdown self */
+
+ /*
+ * Check for other cpus. Return if none.
+ */
+ if (CPU_ISFULLSET(&mask)) {
+ if (othercpus < 1)
+ return;
+ } else {
+ CPU_CLR(PCPU_GET(cpuid), &mask);
+ if (CPU_EMPTY(&mask))
+ return;
+ }
+
+ if (!(read_eflags() & PSL_I))
+ panic("%s: interrupts disabled", __func__);
+ mtx_lock_spin(&smp_ipi_mtx);
+ smp_tlb_addr1 = addr1;
+ smp_tlb_addr2 = addr2;
+ smp_tlb_pmap = pmap;
+ smp_tlb_wait = 0;
+ if (CPU_ISFULLSET(&mask)) {
+ ncpu = othercpus;
+ ipi_all_but_self(vector);
+ } else {
+ ncpu = 0;
+ while ((cpu = CPU_FFS(&mask)) != 0) {
+ cpu--;
+ CPU_CLR(cpu, &mask);
+ CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__,
+ cpu, vector);
+ ipi_send_cpu(cpu, vector);
+ ncpu++;
+ }
+ }
+ while (smp_tlb_wait < ncpu)
+ ia32_pause();
+ mtx_unlock_spin(&smp_ipi_mtx);
+}
+
+void
+smp_masked_invltlb(cpuset_t mask, pmap_t pmap)
+{
+
+ if (smp_started) {
+ smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0);
+#ifdef COUNT_XINVLTLB_HITS
+ ipi_global++;
+#endif
+ }
+}
+
+void
+smp_masked_invlpg(cpuset_t mask, vm_offset_t addr)
+{
+
+ if (smp_started) {
+ smp_targeted_tlb_shootdown(mask, IPI_INVLPG, NULL, addr, 0);
+#ifdef COUNT_XINVLTLB_HITS
+ ipi_page++;
+#endif
+ }
+}
+
+void
+smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2)
+{
+
+ if (smp_started) {
+ smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, NULL,
+ addr1, addr2);
+#ifdef COUNT_XINVLTLB_HITS
+ ipi_range++;
+ ipi_range_size += (addr2 - addr1) / PAGE_SIZE;
+#endif
+ }
+}
+
+void
+smp_cache_flush(void)
+{
+
+ if (smp_started) {
+ smp_targeted_tlb_shootdown(all_cpus, IPI_INVLCACHE, NULL,
+ 0, 0);
+ }
+}
+
+/*
+ * Handlers for TLB related IPIs
+ */
+void
+invltlb_handler(void)
+{
+#ifdef COUNT_XINVLTLB_HITS
+ xhits_gbl[PCPU_GET(cpuid)]++;
+#endif /* COUNT_XINVLTLB_HITS */
+#ifdef COUNT_IPIS
+ (*ipi_invltlb_counts[PCPU_GET(cpuid)])++;
+#endif /* COUNT_IPIS */
+
+ if (smp_tlb_pmap == kernel_pmap)
+ invltlb_glob();
+ else
+ invltlb();
+ atomic_add_int(&smp_tlb_wait, 1);
+}
+
+void
+invlpg_handler(void)
+{
+#ifdef COUNT_XINVLTLB_HITS
+ xhits_pg[PCPU_GET(cpuid)]++;
+#endif /* COUNT_XINVLTLB_HITS */
+#ifdef COUNT_IPIS
+ (*ipi_invlpg_counts[PCPU_GET(cpuid)])++;
+#endif /* COUNT_IPIS */
+
+ invlpg(smp_tlb_addr1);
+ atomic_add_int(&smp_tlb_wait, 1);
+}
+
+void
+invlrng_handler(void)
+{
+ vm_offset_t addr;
+
+#ifdef COUNT_XINVLTLB_HITS
+ xhits_rng[PCPU_GET(cpuid)]++;
+#endif /* COUNT_XINVLTLB_HITS */
+#ifdef COUNT_IPIS
+ (*ipi_invlrng_counts[PCPU_GET(cpuid)])++;
+#endif /* COUNT_IPIS */
+
+ addr = smp_tlb_addr1;
+ do {
+ invlpg(addr);
+ addr += PAGE_SIZE;
+ } while (addr < smp_tlb_addr2);
+
+ atomic_add_int(&smp_tlb_wait, 1);
+}
diff --git a/targets/pseudo/bootstrap-tools/Makefile b/targets/pseudo/bootstrap-tools/Makefile
index f196c8a..2d38a70 100644
--- a/targets/pseudo/bootstrap-tools/Makefile
+++ b/targets/pseudo/bootstrap-tools/Makefile
@@ -20,7 +20,7 @@ BSENV= \
MAKESYSPATH=${SRCTOP}/tools/build/mk:${SRCTOP}/share/mk \
TARGET=${HOST_MACHINE} TARGET_ARCH=${HOST_MACHINE_ARCH} \
WITHOUT_STAGING=1 STAGE_ROOT= BOOTSTRAPPING_TOOLS=1 \
- WORLDTMP=${BTOOLSDIR} LEGACY_TOOLS=${LEGACY_TOOLS} \
+ WORLDTMP=${BTOOLSDIR} \
INSTALL="sh ${SRCTOP}/tools/install.sh" \
PATH=${LEGACY_TOOLS}/usr/sbin:${LEGACY_TOOLS}/usr/bin:${LEGACY_TOOLS}/bin:${PATH}
@@ -43,6 +43,11 @@ BSARGS= DESTDIR= \
MK_LLDB=no MK_TESTS=no \
MK_INCLUDES=yes
+# Need to override these so OBJTOP uses are proper in the non-meta build.
+BSARGS+= OBJTOP=${BTOOLSDIR}${SRCTOP} OBJROOT='$${OBJTOP}/'
+# We will handle building the toolchain and cross-compiler.
+BSARGS+= MK_CROSS_COMPILER=no MK_CLANG=no MK_GCC=no
+
DISTRIB_ENV= INSTALL="sh ${SRCTOP}/tools/install.sh" NO_FSCHG=1 MK_TESTS=no
legacy: .MAKE .META
mkdir -p ${LEGACY_TOOLS}
@@ -62,21 +67,22 @@ cross-tools build-tools bootstrap-tools: .MAKE .META
touch $@
# MAKELEVEL=0 so that dirdeps.mk does its thing
-# LEGACY_TOOLS lets us use the bootstrapped stuff above
+# BSENV:MPATH=* lets us use the bootstrapped stuff in LEGACY_TOOLS above.
# TARGET* is so that MK_CLANG gets set correctly.
BSTCENV= \
MAKELEVEL=0 \
MACHINE=host \
- LEGACY_TOOLS=${LEGACY_TOOLS} \
+ BOOTSTRAPPING_TOOLS=1 \
TARGET=${HOST_MACHINE} \
- TARGET_ARCH=${HOST_MACHINE_ARCH}
+ TARGET_ARCH=${HOST_MACHINE_ARCH} \
+ ${BSENV:MPATH=*}
BSTCARGS= \
- ${BSARGS} \
+ ${BSARGS:NDESTDIR=*:NOBJTOP=*:NOBJROOT=*:NMK_CROSS_COMPILER=*:NMK_CLANG=*:NMK_GCC=*} \
BUILD_DIRDEPS=yes \
-DWITH_STAGING \
-DWITH_TOOLSDIR
# finally we build toolchain leveraging the above.
bootstrap-toolchain: .MAKE cross-tools
- ${BSTCENV} ${MAKE} -C ${.CURDIR:H:H} ${BSTCARGS:NDESTDIR=} toolchain
+ ${BSTCENV} ${MAKE} -C ${.CURDIR:H:H} ${BSTCARGS} toolchain
diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend
index 546e146..a7130dd 100644
--- a/targets/pseudo/userland/Makefile.depend
+++ b/targets/pseudo/userland/Makefile.depend
@@ -146,6 +146,7 @@ DIRDEPS+= \
sbin/resolvconf \
sbin/restore \
sbin/route \
+ sbin/routed \
sbin/routed/rtquery \
sbin/rtsol \
sbin/savecore \
@@ -209,6 +210,8 @@ DIRDEPS+= \
usr.bin/dc \
usr.bin/dig \
usr.bin/dirname \
+ usr.bin/dpv \
+ usr.bin/drill \
usr.bin/du \
usr.bin/ee \
usr.bin/elf2aout \
@@ -239,10 +242,13 @@ DIRDEPS+= \
usr.bin/head \
usr.bin/hexdump \
usr.bin/host \
+ usr.bin/iconv \
usr.bin/id \
+ usr.bin/ident \
usr.bin/indent \
usr.bin/ipcrm \
usr.bin/ipcs \
+ usr.bin/iscsictl \
usr.bin/join \
usr.bin/jot \
usr.bin/kdump \
@@ -254,6 +260,7 @@ DIRDEPS+= \
usr.bin/lam \
usr.bin/last \
usr.bin/lastcomm \
+ usr.bin/lex \
usr.bin/ldd \
usr.bin/leave \
usr.bin/less \
@@ -282,8 +289,11 @@ DIRDEPS+= \
usr.bin/mesg \
usr.bin/minigzip \
usr.bin/ministat \
+ usr.bin/mkcsmapper \
usr.bin/mkdep \
+ usr.bin/mkesdb \
usr.bin/mkfifo \
+ usr.bin/mkimg \
usr.bin/mklocale \
usr.bin/mkstr \
usr.bin/mktemp \
@@ -309,12 +319,14 @@ DIRDEPS+= \
usr.bin/pagesize \
usr.bin/passwd \
usr.bin/paste \
+ usr.bin/patch \
usr.bin/pathchk \
usr.bin/perror \
usr.bin/pr \
usr.bin/printenv \
usr.bin/printf \
usr.bin/procstat \
+ usr.bin/protect \
usr.bin/quota \
usr.bin/rctl \
usr.bin/renice \
@@ -332,16 +344,30 @@ DIRDEPS+= \
usr.bin/rwho \
usr.bin/script \
usr.bin/sed \
+ usr.bin/send-pr \
usr.bin/seq \
usr.bin/shar \
usr.bin/showmount \
+ usr.bin/smbutil \
usr.bin/sockstat \
+ usr.bin/soelim \
usr.bin/sort \
usr.bin/split \
usr.bin/ssh-copy-id \
usr.bin/stat \
usr.bin/stdbuf \
usr.bin/su \
+ usr.bin/svn/svn \
+ usr.bin/svn/svnadmin \
+ usr.bin/svn/svnbench \
+ usr.bin/svn/svndumpfilter \
+ usr.bin/svn/svnfsfs \
+ usr.bin/svn/svnlook \
+ usr.bin/svn/svnmucc \
+ usr.bin/svn/svnrdump \
+ usr.bin/svn/svnserve \
+ usr.bin/svn/svnsync \
+ usr.bin/svn/svnversion \
usr.bin/systat \
usr.bin/tabs \
usr.bin/tail \
@@ -380,6 +406,7 @@ DIRDEPS+= \
usr.bin/vacation \
usr.bin/vgrind \
usr.bin/vi \
+ usr.bin/vi/catalog \
usr.bin/vis \
usr.bin/vmstat \
usr.bin/vtfontcvt \
@@ -396,8 +423,9 @@ DIRDEPS+= \
usr.bin/xinstall \
usr.bin/xlint/lint1 \
usr.bin/xlint/lint2 \
- usr.bin/xlint/xlint \
usr.bin/xlint/llib \
+ usr.bin/xlint/xlint \
+ usr.bin/xo \
usr.bin/xstr \
usr.bin/xz \
usr.bin/xzdec \
@@ -410,14 +438,14 @@ DIRDEPS+= \
usr.sbin/ac \
usr.sbin/accton \
usr.sbin/adduser \
- usr.sbin/amd/include \
- usr.sbin/amd/libamu \
usr.sbin/amd/amd \
usr.sbin/amd/amq \
usr.sbin/amd/doc \
usr.sbin/amd/fixmount \
usr.sbin/amd/fsinfo \
usr.sbin/amd/hlfsd \
+ usr.sbin/amd/include \
+ usr.sbin/amd/libamu \
usr.sbin/amd/mk-amd-map \
usr.sbin/amd/pawd \
usr.sbin/amd/scripts \
@@ -428,9 +456,11 @@ DIRDEPS+= \
usr.sbin/arpaname \
usr.sbin/audit \
usr.sbin/auditd \
+ usr.sbin/auditdistd \
usr.sbin/auditreduce \
usr.sbin/authpf \
- usr.sbin/bhyve \
+ usr.sbin/autofs \
+ usr.sbin/binmiscctl \
usr.sbin/bluetooth/ath3kfw \
usr.sbin/bluetooth/bcmfw \
usr.sbin/bluetooth/bt3cfw \
@@ -447,25 +477,65 @@ DIRDEPS+= \
usr.sbin/bluetooth/sdpd \
usr.sbin/bootparamd/bootparamd \
usr.sbin/bootparamd/callbootd \
+ usr.sbin/bsdconfig \
+ usr.sbin/bsdconfig/console \
+ usr.sbin/bsdconfig/console/include \
+ usr.sbin/bsdconfig/diskmgmt \
+ usr.sbin/bsdconfig/diskmgmt/include \
+ usr.sbin/bsdconfig/docsinstall \
+ usr.sbin/bsdconfig/docsinstall/include \
+ usr.sbin/bsdconfig/dot \
+ usr.sbin/bsdconfig/dot/include \
+ usr.sbin/bsdconfig/examples \
+ usr.sbin/bsdconfig/include \
+ usr.sbin/bsdconfig/includes \
+ usr.sbin/bsdconfig/includes/include \
+ usr.sbin/bsdconfig/mouse \
+ usr.sbin/bsdconfig/mouse/include \
+ usr.sbin/bsdconfig/networking \
+ usr.sbin/bsdconfig/networking/include \
+ usr.sbin/bsdconfig/networking/share \
+ usr.sbin/bsdconfig/packages \
+ usr.sbin/bsdconfig/packages/include \
+ usr.sbin/bsdconfig/password \
+ usr.sbin/bsdconfig/password/include \
+ usr.sbin/bsdconfig/password/share \
+ usr.sbin/bsdconfig/security \
+ usr.sbin/bsdconfig/security/include \
+ usr.sbin/bsdconfig/share \
+ usr.sbin/bsdconfig/share/media \
+ usr.sbin/bsdconfig/share/packages \
+ usr.sbin/bsdconfig/startup \
+ usr.sbin/bsdconfig/startup/include \
+ usr.sbin/bsdconfig/startup/share \
+ usr.sbin/bsdconfig/timezone \
+ usr.sbin/bsdconfig/timezone/include \
+ usr.sbin/bsdconfig/timezone/share \
+ usr.sbin/bsdconfig/ttys \
+ usr.sbin/bsdconfig/ttys/include \
+ usr.sbin/bsdconfig/usermgmt \
+ usr.sbin/bsdconfig/usermgmt/include \
+ usr.sbin/bsdconfig/usermgmt/share \
usr.sbin/bsdinstall/distextract \
usr.sbin/bsdinstall/distfetch \
usr.sbin/bsdinstall/partedit \
usr.sbin/bsdinstall/scripts \
- usr.sbin/bsnmpd/gensnmptree \
usr.sbin/bsnmpd/bsnmpd \
+ usr.sbin/bsnmpd/gensnmptree \
usr.sbin/bsnmpd/modules/snmp_atm \
usr.sbin/bsnmpd/modules/snmp_bridge \
+ usr.sbin/bsnmpd/modules/snmp_hast \
usr.sbin/bsnmpd/modules/snmp_hostres \
usr.sbin/bsnmpd/modules/snmp_lm75 \
usr.sbin/bsnmpd/modules/snmp_mibII \
+ usr.sbin/bsnmpd/modules/snmp_netgraph \
usr.sbin/bsnmpd/modules/snmp_pf \
usr.sbin/bsnmpd/modules/snmp_target \
usr.sbin/bsnmpd/modules/snmp_usm \
usr.sbin/bsnmpd/modules/snmp_vacm \
usr.sbin/bsnmpd/modules/snmp_wlan \
- usr.sbin/bsnmpd/modules/snmp_netgraph \
- usr.sbin/bsnmpd/tools/libbsnmptools \
usr.sbin/bsnmpd/tools/bsnmptools \
+ usr.sbin/bsnmpd/tools/libbsnmptools \
usr.sbin/burncd \
usr.sbin/cdcontrol \
usr.sbin/chkgrp \
@@ -475,19 +545,21 @@ DIRDEPS+= \
usr.sbin/clear_locks \
usr.sbin/config \
usr.sbin/crashinfo \
- usr.sbin/cron/lib \
usr.sbin/cron/cron \
usr.sbin/cron/crontab \
+ usr.sbin/cron/lib \
usr.sbin/crunch/crunchgen \
usr.sbin/crunch/crunchide \
usr.sbin/ctladm \
+ usr.sbin/ctld \
usr.sbin/ctm/ctm \
+ usr.sbin/ctm/ctm_dequeue \
usr.sbin/ctm/ctm_rmail \
usr.sbin/ctm/ctm_smail \
- usr.sbin/ctm/ctm_dequeue \
usr.sbin/daemon \
usr.sbin/dconschat \
usr.sbin/ddns-confgen \
+ usr.sbin/devctl \
usr.sbin/devinfo \
usr.sbin/digictl \
usr.sbin/diskinfo \
@@ -507,13 +579,15 @@ DIRDEPS+= \
usr.sbin/fdformat \
usr.sbin/fdread \
usr.sbin/fdwrite \
- usr.sbin/fifolog/lib \
usr.sbin/fifolog/fifolog_create \
- usr.sbin/fifolog/fifolog_writer \
usr.sbin/fifolog/fifolog_reader \
+ usr.sbin/fifolog/fifolog_writer \
+ usr.sbin/fifolog/lib \
usr.sbin/flowctl \
usr.sbin/fmtree \
usr.sbin/freebsd-update \
+ usr.sbin/fstyp \
+ usr.sbin/ftp-proxy \
usr.sbin/fwcontrol \
usr.sbin/genrandom \
usr.sbin/getfmac \
@@ -525,9 +599,11 @@ DIRDEPS+= \
usr.sbin/ifmcstat \
usr.sbin/inetd \
usr.sbin/iostat \
+ usr.sbin/iovctl \
usr.sbin/ip6addrctl \
usr.sbin/ipfwpcap \
usr.sbin/isc-hmac-fixup \
+ usr.sbin/iscsid \
usr.sbin/isfctl \
usr.sbin/jail \
usr.sbin/jexec \
@@ -538,8 +614,11 @@ DIRDEPS+= \
usr.sbin/kldxref \
usr.sbin/lastlogin \
usr.sbin/lmcconfig \
- usr.sbin/lpr/common_source \
usr.sbin/lpr/chkprintcap \
+ usr.sbin/lpr/common_source \
+ usr.sbin/lpr/filters \
+ usr.sbin/lpr/filters.ru/koi2855 \
+ usr.sbin/lpr/filters.ru/koi2alt \
usr.sbin/lpr/lp \
usr.sbin/lpr/lpc \
usr.sbin/lpr/lpd \
@@ -548,21 +627,18 @@ DIRDEPS+= \
usr.sbin/lpr/lprm \
usr.sbin/lpr/lptest \
usr.sbin/lpr/pac \
- usr.sbin/lpr/filters \
- usr.sbin/lpr/filters.ru/koi2alt \
- usr.sbin/lpr/filters.ru/koi2855 \
usr.sbin/mailstats \
usr.sbin/mailwrapper \
usr.sbin/makefs \
usr.sbin/makemap \
usr.sbin/manctl \
- usr.sbin/manctl \
usr.sbin/memcontrol \
usr.sbin/mergemaster \
usr.sbin/mfiutil \
usr.sbin/mixer \
usr.sbin/mld6query \
usr.sbin/mlxcontrol \
+ usr.sbin/mount_smbfs \
usr.sbin/mountd \
usr.sbin/moused \
usr.sbin/mpsutil \
@@ -585,17 +661,24 @@ DIRDEPS+= \
usr.sbin/nologin \
usr.sbin/nscd \
usr.sbin/nsec3hash \
- usr.sbin/ntp/libopts \
+ usr.sbin/ntp/doc \
+ usr.sbin/ntp/doc/drivers/icons \
+ usr.sbin/ntp/doc/drivers/scripts \
+ usr.sbin/ntp/doc/drivers \
+ usr.sbin/ntp/doc/hints \
+ usr.sbin/ntp/doc/icons \
+ usr.sbin/ntp/doc/pic \
+ usr.sbin/ntp/doc/scripts \
usr.sbin/ntp/libntp \
+ usr.sbin/ntp/libopts \
usr.sbin/ntp/libparse \
+ usr.sbin/ntp/ntp-keygen \
usr.sbin/ntp/ntpd \
+ usr.sbin/ntp/ntpdate \
usr.sbin/ntp/ntpdc \
usr.sbin/ntp/ntpq \
- usr.sbin/ntp/ntpdate \
usr.sbin/ntp/ntptime \
- usr.sbin/ntp/ntp-keygen \
usr.sbin/ntp/sntp \
- usr.sbin/ntp/doc \
usr.sbin/pc-sysinstall/backend \
usr.sbin/pc-sysinstall/backend-partmanager \
usr.sbin/pc-sysinstall/backend-query \
@@ -606,19 +689,19 @@ DIRDEPS+= \
usr.sbin/pciconf \
usr.sbin/periodic \
usr.sbin/pkg \
- usr.sbin/pkg_install/lib \
usr.sbin/pkg_install/add \
usr.sbin/pkg_install/create \
usr.sbin/pkg_install/delete \
usr.sbin/pkg_install/info \
+ usr.sbin/pkg_install/lib \
usr.sbin/pkg_install/updating \
usr.sbin/pkg_install/version \
usr.sbin/pmcannotate \
usr.sbin/pmccontrol \
usr.sbin/pmcstat \
- usr.sbin/portsnap/portsnap \
usr.sbin/portsnap/make_index \
usr.sbin/portsnap/phttpget \
+ usr.sbin/portsnap/portsnap \
usr.sbin/powerd \
usr.sbin/ppp \
usr.sbin/pppctl \
@@ -662,6 +745,7 @@ DIRDEPS+= \
usr.sbin/snapinfo \
usr.sbin/spray \
usr.sbin/syslogd \
+ usr.sbin/sysrc \
usr.sbin/tcpdchk \
usr.sbin/tcpdmatch \
usr.sbin/tcpdrop \
@@ -673,40 +757,58 @@ DIRDEPS+= \
usr.sbin/trpt \
usr.sbin/tzsetup \
usr.sbin/uathload \
+ usr.sbin/uefisign \
usr.sbin/ugidfw \
usr.sbin/uhsoctl \
+ usr.sbin/unbound/anchor \
+ usr.sbin/unbound/checkconf \
+ usr.sbin/unbound/control \
+ usr.sbin/unbound/daemon \
+ usr.sbin/unbound/local-setup \
usr.sbin/usbconfig \
usr.sbin/usbdump \
usr.sbin/utx \
usr.sbin/vidcontrol \
+ usr.sbin/vigr \
usr.sbin/vipw \
usr.sbin/wake \
usr.sbin/watch \
usr.sbin/watchdogd \
usr.sbin/wlandebug \
- usr.sbin/wpa/wpa_supplicant \
- usr.sbin/wpa/wpa_cli \
- usr.sbin/wpa/wpa_passphrase \
usr.sbin/wpa/hostapd \
usr.sbin/wpa/hostapd_cli \
usr.sbin/wpa/ndis_events \
+ usr.sbin/wpa/wpa_cli \
+ usr.sbin/wpa/wpa_passphrase \
+ usr.sbin/wpa/wpa_supplicant \
usr.sbin/yp_mkdb \
usr.sbin/ypbind \
usr.sbin/yppoll \
usr.sbin/yppush \
usr.sbin/ypserv \
usr.sbin/ypset \
- usr.sbin/zic/zic \
usr.sbin/zic/zdump \
+ usr.sbin/zic/zic \
${DEP_RELDIR}/cddl \
${DEP_RELDIR}/games \
${DEP_RELDIR}/gnu \
${DEP_RELDIR}/include \
${DEP_RELDIR}/kerberos5 \
+ ${DEP_RELDIR}/lib \
${DEP_RELDIR}/libexec \
+ ${DEP_RELDIR}/misc \
${DEP_RELDIR}/secure \
${DEP_RELDIR}/share \
+.if ${MK_NAND} != "no"
+DIRDEPS+= \
+ sbin/nandfs \
+ sbin/newfs_nandfs \
+ usr.sbin/nandsim \
+ usr.sbin/nandtool \
+
+.endif
+
DIRDEPS.amd64= \
sbin/bsdlabel \
sbin/fdisk \
@@ -717,9 +819,14 @@ DIRDEPS.amd64= \
usr.sbin/acpi/iasl \
usr.sbin/apm \
usr.sbin/asf \
+ usr.sbin/bhyve \
+ usr.sbin/bhyvectl \
+ usr.sbin/bhyveload \
usr.sbin/boot0cfg \
usr.sbin/btxld \
+ usr.sbin/camdd \
usr.sbin/cpucontrol \
+ usr.sbin/hyperv/tools \
usr.sbin/kgmon \
usr.sbin/lptcontrol \
usr.sbin/mptable \
@@ -745,6 +852,7 @@ DIRDEPS.i386= \
usr.sbin/asf \
usr.sbin/btxld \
usr.sbin/cpucontrol \
+ usr.sbin/hyperv/tools \
usr.sbin/kgmon \
usr.sbin/kgzip \
usr.sbin/lptcontrol \
@@ -759,6 +867,10 @@ DIRDEPS.i386= \
usr.sbin/boot0cfg \
usr.sbin/wlconfig
+DIRDEPS.arm64= \
+ usr.sbin/acpi \
+ usr.sbin/ofwdump
+
DIRDEPS.mips= \
sbin/bsdlabel \
sbin/fdisk
@@ -779,6 +891,14 @@ DIRDEPS.powerpc= \
usr.sbin/nvram \
usr.sbin/ofwdump
+.if ${MK_GPL_DTC} != "yes"
+DIRDEPS+= usr.bin/dtc
+.endif
+
+.if ${MK_CASPER} == "yes"
+DIRDEPS+= sbin/casperd
+.endif
+
DIRDEPS+= ${DIRDEPS.${MACHINE}:U}
diff --git a/targets/pseudo/userland/cddl/Makefile.depend b/targets/pseudo/userland/cddl/Makefile.depend
index 00524e9..4747c0b 100644
--- a/targets/pseudo/userland/cddl/Makefile.depend
+++ b/targets/pseudo/userland/cddl/Makefile.depend
@@ -9,19 +9,18 @@
DIRDEPS = \
cddl/lib/drti \
cddl/lib/libavl \
+ cddl/lib/libctf \
+ cddl/lib/libdtrace \
cddl/lib/libnvpair \
cddl/lib/libumem \
cddl/lib/libuutil \
-
-
-DIRDEPS.CTF = \
- cddl/lib/libctf \
cddl/usr.bin/ctfconvert \
cddl/usr.bin/ctfdump \
cddl/usr.bin/ctfmerge \
- cddl/lib/libdtrace \
cddl/usr.sbin/dtrace \
cddl/usr.sbin/dtruss \
+ cddl/usr.sbin/lockstat \
+ cddl/usr.sbin/plockstat \
DIRDEPS.ZFS = \
@@ -33,12 +32,11 @@ DIRDEPS.ZFS = \
cddl/usr.bin/zinject \
cddl/usr.bin/zstreamdump \
cddl/usr.bin/ztest \
- cddl/usr.sbin/lockstat \
cddl/usr.sbin/zdb \
cddl/usr.sbin/zhack \
-.for O in CTF ZFS
+.for O in ZFS
.if ${MK_$O} == "yes"
DIRDEPS+= ${DIRDEPS.$O}
.endif
diff --git a/targets/pseudo/userland/gnu/Makefile.depend b/targets/pseudo/userland/gnu/Makefile.depend
index 3a90fb0..2ef018f 100644
--- a/targets/pseudo/userland/gnu/Makefile.depend
+++ b/targets/pseudo/userland/gnu/Makefile.depend
@@ -1,5 +1,9 @@
# $FreeBSD$
+.if !defined(MK_GPL_DTC)
+.include "${SRCTOP}/share/mk/src.opts.mk"
+.endif
+
# This file is not autogenerated - take care!
DIRDEPS = \
@@ -11,6 +15,7 @@ DIRDEPS = \
gnu/lib/libreadline/history/doc \
gnu/lib/libreadline/readline/doc \
gnu/lib/libregex/doc \
+ gnu/lib/libssp \
gnu/lib/libssp/libssp_nonshared \
gnu/lib/libstdc++ \
gnu/lib/libsupc++ \
@@ -26,6 +31,7 @@ DIRDEPS = \
gnu/usr.bin/binutils/objdump \
gnu/usr.bin/binutils/ranlib \
gnu/usr.bin/dialog \
+ gnu/usr.bin/diff \
gnu/usr.bin/diff/doc \
gnu/usr.bin/diff3 \
gnu/usr.bin/gdb/doc \
@@ -34,7 +40,9 @@ DIRDEPS = \
gnu/usr.bin/gdb/gdbtui \
gnu/usr.bin/gdb/kgdb \
gnu/usr.bin/gdb/libgdb \
+ gnu/usr.bin/gperf \
gnu/usr.bin/gperf/doc \
+ gnu/usr.bin/grep \
gnu/usr.bin/grep/doc \
gnu/usr.bin/groff/contrib/mm \
gnu/usr.bin/groff/doc \
@@ -104,5 +112,8 @@ DIRDEPS = \
gnu/usr.bin/texinfo/makeinfo \
gnu/usr.bin/texinfo/texindex \
+.if ${MK_GPL_DTC} != "no"
+DIRDEPS+= gnu/usr.bin/dtc
+.endif
.include <dirdeps.mk>
diff --git a/targets/pseudo/userland/lib/Makefile.depend b/targets/pseudo/userland/lib/Makefile.depend
index 74e6a6e..c5e2407 100644
--- a/targets/pseudo/userland/lib/Makefile.depend
+++ b/targets/pseudo/userland/lib/Makefile.depend
@@ -2,10 +2,15 @@
# This file is not autogenerated - take care!
+.if !defined(MK_CLANG)
+.include <src.opts.mk>
+.endif
+
DIRDEPS = \
lib/${CSU_DIR} \
lib/atf/libatf-c \
lib/atf/libatf-c++ \
+ lib/lib80211 \
lib/libalias/libalias \
lib/libalias/modules/cuseeme \
lib/libalias/modules/dummy \
@@ -20,6 +25,7 @@ DIRDEPS = \
lib/libbegemot \
lib/libblocksruntime \
lib/libbluetooth \
+ lib/libbsdstat \
lib/libbsm \
lib/libbsnmp/libbsnmp \
lib/libbz2 \
@@ -27,17 +33,20 @@ DIRDEPS = \
lib/libc++ \
lib/libcalendar \
lib/libcam \
+ lib/libcasper \
lib/libcom_err/doc \
lib/libcompat \
lib/libcompiler_rt \
lib/libcrypt \
lib/libcuse \
lib/libcxxrt \
+ lib/libdevctl \
lib/libdevinfo \
lib/libdevstat \
lib/libdwarf \
lib/libedit/edit/readline \
lib/libelf \
+ lib/libevent \
lib/libexecinfo \
lib/libexpat \
lib/libfetch \
@@ -81,6 +90,7 @@ DIRDEPS = \
lib/libmp \
lib/libnetgraph \
lib/libngatm \
+ lib/libnv \
lib/libopie \
lib/libpam/libpam \
lib/libpam/modules/pam_chroot \
@@ -108,6 +118,7 @@ DIRDEPS = \
lib/libpam/modules/pam_tacplus \
lib/libpam/modules/pam_unix \
lib/libpcap \
+ lib/libpjdlog \
lib/libpmc \
lib/libproc \
lib/libprocstat \
@@ -153,5 +164,24 @@ DIRDEPS = \
lib/ncurses/panel \
lib/ncurses/panelw \
+.if ${MK_CLANG} != "no" && \
+ (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
+ (${MACHINE_CPUARCH} == "i386"))
+DIRDEPS+= \
+ lib/libclang_rt/asan-preinit \
+ lib/libclang_rt/asan \
+ lib/libclang_rt/asan_cxx \
+ lib/libclang_rt/include \
+ lib/libclang_rt/profile \
+ lib/libclang_rt/safestack \
+ lib/libclang_rt/ubsan_standalone \
+ lib/libclang_rt/ubsan_standalone_cxx \
+
+.endif
+
+.if ${MK_NAND} != "no"
+DIRDEPS+= lib/libnandfs
+.endif
.include <dirdeps.mk>
diff --git a/targets/pseudo/userland/libexec/Makefile.depend b/targets/pseudo/userland/libexec/Makefile.depend
index f870b6a..427268c 100644
--- a/targets/pseudo/userland/libexec/Makefile.depend
+++ b/targets/pseudo/userland/libexec/Makefile.depend
@@ -6,13 +6,20 @@ DIRDEPS = \
libexec/atf/atf-check \
libexec/atf/atf-sh \
libexec/atrun \
+ libexec/bootpd \
libexec/bootpd/bootpgw \
libexec/bootpd/tools/bootpef \
libexec/bootpd/tools/bootptest \
+ libexec/casper/dns \
+ libexec/casper/grp \
+ libexec/casper/pwd \
+ libexec/casper/random \
+ libexec/casper/sysctl \
libexec/comsat \
libexec/fingerd \
libexec/ftpd \
libexec/getty \
+ libexec/hyperv \
libexec/mail.local \
libexec/mknetid \
libexec/pppoed \
diff --git a/targets/pseudo/userland/misc/Makefile.depend b/targets/pseudo/userland/misc/Makefile.depend
index 15065fa..6d46af1 100644
--- a/targets/pseudo/userland/misc/Makefile.depend
+++ b/targets/pseudo/userland/misc/Makefile.depend
@@ -2,47 +2,83 @@
# This file is not autogenerated - take care!
+.if !defined(MK_FORTH)
+.include <src.opts.mk>
+.endif
+
+_sys_boot_efi= sys/boot/efi/loader sys/boot/efi/boot1
+.if ${MK_FDT} != "no"
+_sys_boot_fdt= sys/boot/fdt sys/boot/efi/fdt
+.endif
+.if ${MK_ZFS} != "no"
+_sys_boot_zfs= sys/boot/zfs
+.endif
+
DIRDEPS = \
- rescue/librescue \
- rescue/rescue \
- sys/boot/ficl \
+ etc \
+ etc/newsyslog.conf.d \
etc/sendmail \
+ rescue/librescue \
+.if ${MK_BOOT} != "no"
+DIRDEPS+= sys/boot/common
+.if ${MK_FORTH} != "no"
+DIRDEPS+= \
+ sys/boot/ficl \
+ sys/boot/forth \
+
+.endif
DIRDEPS.x86sys= \
- sys/boot/i386/mbr \
- sys/boot/i386/pmbr \
+ sys/boot/efi/libefi \
sys/boot/i386/boot0 \
sys/boot/i386/boot0sio \
+ sys/boot/i386/boot2 \
sys/boot/i386/btx/btx \
sys/boot/i386/btx/btxldr \
sys/boot/i386/btx/lib \
- sys/boot/i386/boot2 \
sys/boot/i386/cdboot \
sys/boot/i386/gptboot \
- sys/boot/i386/libi386 \
sys/boot/i386/libfirewire \
+ sys/boot/i386/libi386 \
sys/boot/i386/loader \
+ sys/boot/i386/mbr \
+ sys/boot/i386/pmbr \
sys/boot/i386/pxeldr \
- sys/boot/i386/zfsboot \
+ sys/boot/libstand32 \
+ ${_sys_boot_zfs} \
+
+.if ${MK_ZFS} != "no"
+DIRDEPS.x86sys+= \
sys/boot/i386/gptzfsboot \
+ sys/boot/i386/zfsboot \
sys/boot/i386/zfsloader \
+.endif
DIRDEPS.amd64= \
${DIRDEPS.x86sys} \
- sys/boot/efi/libefi \
- sys/boot/zfs \
+ ${_sys_boot_efi} \
+ sys/boot/ficl32 \
sys/boot/userboot/ficl \
sys/boot/userboot/libstand \
sys/boot/userboot/test \
sys/boot/userboot/userboot \
-DIRDEPS.arm= sys/boot/fdt sys/boot/uboot
-DIRDEPS.i386= ${DIRDEPS.x86sys} sys/boot/efi/libefi sys/boot/zfs
-DIRDEPS.powerpc= sys/boot/fdt sys/boot/ofw sys/boot/uboot
-DIRDEPS.sparc64= sys/boot/ofw sys/boot/zfs
+.if ${MK_ZFS} != "no"
+DIRDEPS.amd64+= \
+ sys/boot/userboot/zfs \
+
+.endif
+
+DIRDEPS.arm= ${_sys_boot_fdt} ${_sys_boot_efi}
+DIRDEPS.arm64= ${_sys_boot_fdt} ${_sys_boot_efi}
+DIRDEPS.i386= ${DIRDEPS.x86sys} sys/boot/efi/libefi
+DIRDEPS.powerpc= ${_sys_boot_fdt} sys/boot/libstand32 sys/boot/ofw sys/boot/uboot
+DIRDEPS.pc98= sys/boot/libstand32
+DIRDEPS.sparc64= sys/boot/ofw ${_sys_boot_zfs}
+.endif
DIRDEPS+= ${DIRDEPS.${MACHINE}:U}
diff --git a/targets/pseudo/userland/secure/Makefile.depend b/targets/pseudo/userland/secure/Makefile.depend
index 22532a9..b00e889 100644
--- a/targets/pseudo/userland/secure/Makefile.depend
+++ b/targets/pseudo/userland/secure/Makefile.depend
@@ -7,6 +7,7 @@ DIRDEPS = \
secure/lib/libcrypto/engines/lib4758cca \
secure/lib/libcrypto/engines/libaep \
secure/lib/libcrypto/engines/libatalla \
+ secure/lib/libcrypto/engines/libcapi \
secure/lib/libcrypto/engines/libchil \
secure/lib/libcrypto/engines/libcswift \
secure/lib/libcrypto/engines/libgost \
diff --git a/targets/pseudo/userland/share/Makefile.depend b/targets/pseudo/userland/share/Makefile.depend
index 9f13ae0..4e7c9e1 100644
--- a/targets/pseudo/userland/share/Makefile.depend
+++ b/targets/pseudo/userland/share/Makefile.depend
@@ -83,10 +83,13 @@ DIRDEPS = \
share/doc/usd/22.trofftut \
share/doc/usd/contents \
share/doc/usd/title \
+ share/dtrace \
share/dtrace/toolkit \
share/examples/atf \
share/examples/ipfilter \
share/examples/pf \
+ share/examples/smbfs \
+ share/examples/smbfs/print \
share/i18n/csmapper \
share/i18n/csmapper/APPLE \
share/i18n/csmapper/AST \
@@ -123,6 +126,8 @@ DIRDEPS = \
share/i18n/esdb/TCVN \
share/i18n/esdb/UTF \
share/info \
+ share/keys/pkg/trusted \
+ share/locale-links \
share/man/man1 \
share/man/man3 \
share/man/man4 \
@@ -133,6 +138,7 @@ DIRDEPS = \
share/man/man9 \
share/me \
share/misc \
+ share/mk \
share/mklocale \
share/monetdef \
share/msgdef \
@@ -146,6 +152,8 @@ DIRDEPS = \
share/tabset \
share/termcap \
share/timedef \
+ share/vt/fonts \
+ share/vt/keymaps \
share/xml/atf \
share/xsl/atf \
share/zoneinfo \
diff --git a/tests/sys/aio/Makefile b/tests/sys/aio/Makefile
index 851252d..766d9b0 100644
--- a/tests/sys/aio/Makefile
+++ b/tests/sys/aio/Makefile
@@ -6,8 +6,7 @@ PLAIN_TESTS_C+= aio_kqueue_test
PLAIN_TESTS_C+= lio_kqueue_test
ATF_TESTS_C+= aio_test
-DPADD.aio_test+= ${LIBUTIL}
-LDADD.aio_test+= -lutil
+LIBADD.aio_test+= util
CFLAGS+= -I${.CURDIR:H:H}
diff --git a/tests/sys/file/Makefile b/tests/sys/file/Makefile
index 6151c9f..ed2d2c4 100644
--- a/tests/sys/file/Makefile
+++ b/tests/sys/file/Makefile
@@ -13,13 +13,10 @@ PLAIN_TESTS_C+= newfileops_on_fork_test
PROGS+= flock_helper
-DPADD.closefrom_test= ${LIBUTIL}
-LDADD.closefrom_test= -lutil
+LIBADD.closefrom_test= util
-DPADD.flock_helper= ${LIBPTHREAD}
-LDADD.flock_helper= -lpthread
+LIBADD.flock_helper= pthread
-DPADD.newfileops_on_fork_test= ${LIBPTHREAD}
-LDADD.newfileops_on_fork_test= -lpthread
+LIBADD.newfileops_on_fork_test= pthread
.include <bsd.test.mk>
diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile
index b3d2453..a38b1f2 100644
--- a/tests/sys/kern/Makefile
+++ b/tests/sys/kern/Makefile
@@ -10,15 +10,14 @@ ATF_TESTS_C+= ptrace_test
ATF_TESTS_C+= unix_seqpacket_test
TEST_METADATA.unix_seqpacket_test+= timeout="15"
-LDADD.ptrace_test+= -lpthread
-LDADD.unix_seqpacket_test+= -lpthread
+LIBADD.ptrace_test+= pthread
+LIBADD.unix_seqpacket_test+= pthread
NETBSD_ATF_TESTS_C+= lockf_test
NETBSD_ATF_TESTS_C+= mqueue_test
CFLAGS.mqueue_test+= -I${SRCTOP}/tests
-DPADD.mqueue_test+= ${LIBRT}
-LDADD.mqueue_test+= -lrt
+LIBADD.mqueue_test+= rt
WARNS?= 5
diff --git a/tests/sys/mqueue/Makefile b/tests/sys/mqueue/Makefile
index 63741d2..ce5033c 100644
--- a/tests/sys/mqueue/Makefile
+++ b/tests/sys/mqueue/Makefile
@@ -10,12 +10,11 @@ CFLAGS+= -I${SRCTOP}/tests
PROGS+= mqtest1
PROGS+= mqtest2
-PROGS+= mqtest3
-PROGS+= mqtest4
+#PROGS+= mqtest3
+#PROGS+= mqtest4
PROGS+= mqtest5
-LDADD+= -lrt
-DPADD+= ${LIBRT}
+LIBADD+= rt
WARNS?= 6
diff --git a/tests/sys/mqueue/mqueue_test.sh b/tests/sys/mqueue/mqueue_test.sh
index 4841418..9a426ee 100755
--- a/tests/sys/mqueue/mqueue_test.sh
+++ b/tests/sys/mqueue/mqueue_test.sh
@@ -75,7 +75,7 @@ atf_init_test_cases()
{
atf_add_test_case mqtest1
atf_add_test_case mqtest2
- atf_add_test_case mqtest3
- atf_add_test_case mqtest4
+ #atf_add_test_case mqtest3
+ #atf_add_test_case mqtest4
atf_add_test_case mqtest5
}
diff --git a/tools/bsdbox/Makefile.net b/tools/bsdbox/Makefile.net
index 179fe70..ed39dec 100644
--- a/tools/bsdbox/Makefile.net
+++ b/tools/bsdbox/Makefile.net
@@ -21,6 +21,7 @@ CRUNCH_LIBS+= -lmemstat -lnetgraph
# ifconfig
CRUNCH_PROGS_sbin+= ifconfig
+CRUNCH_SHLIBS+= -l80211
# wlan stuff
CRUNCH_PROGS_usr.sbin+= wlandebug
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index 1ef88ff..0e9c955 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -978,7 +978,11 @@ OLD_FILES+=usr/lib32/libuutil_p.a
OLD_LIBS+=lib/libdtrace.so.2
OLD_FILES+=usr/sbin/dtrace
OLD_FILES+=usr/sbin/lockstat
+OLD_FILES+=usr/sbin/plockstat
OLD_FILES+=usr/share/man/man1/dtrace.1.gz
+OLD_FILES+=usr/share/man/man1/dtruss.1.gz
+OLD_FILES+=usr/share/man/man1/lockstat.1.gz
+OLD_FILES+=usr/share/man/man1/plockstat.1.gz
OLD_FILES+=usr/share/dtrace/disklatency
OLD_FILES+=usr/share/dtrace/disklatencycmd
OLD_FILES+=usr/share/dtrace/hotopen
@@ -1048,6 +1052,16 @@ OLD_FILES+=usr/bin/clang++
OLD_FILES+=usr/bin/clang-cpp
OLD_FILES+=usr/bin/clang-tblgen
OLD_FILES+=usr/bin/tblgen
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/allocator_interface.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/asan_interface.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/common_interface_defs.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/coverage_interface.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/dfsan_interface.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/linux_syscall_hooks.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/lsan_interface.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/msan_interface.h
+OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/tsan_interface_atomic.h
+OLD_DIRS+=usr/lib/clang/3.7.0/include/sanitizer
OLD_FILES+=usr/lib/clang/3.7.0/include/__stddef_max_align_t.h
OLD_FILES+=usr/lib/clang/3.7.0/include/__wmmintrin_aes.h
OLD_FILES+=usr/lib/clang/3.7.0/include/__wmmintrin_pclmul.h
diff --git a/tools/build/options/makeman b/tools/build/options/makeman
index 0e21499..acc0eb5 100755
--- a/tools/build/options/makeman
+++ b/tools/build/options/makeman
@@ -3,7 +3,7 @@
# This file is in the public domain.
set -o errexit
-LC_ALL=C
+export LC_ALL=C
ident='$FreeBSD$'
diff --git a/tools/diag/dumpvfscache/Makefile b/tools/diag/dumpvfscache/Makefile
index fe81d5c..3cd9c5d 100644
--- a/tools/diag/dumpvfscache/Makefile
+++ b/tools/diag/dumpvfscache/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= dumpvfscache
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD= kvm
MAN=
diff --git a/tools/regression/gaithrstress/Makefile b/tools/regression/gaithrstress/Makefile
index 187c973..9c5cdd5 100644
--- a/tools/regression/gaithrstress/Makefile
+++ b/tools/regression/gaithrstress/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= gaithrstress
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
MAN=
.include <bsd.prog.mk>
diff --git a/tools/regression/kgssapi/Makefile b/tools/regression/kgssapi/Makefile
index 751604f..203b688 100644
--- a/tools/regression/kgssapi/Makefile
+++ b/tools/regression/kgssapi/Makefile
@@ -3,8 +3,7 @@
PROG= gsstest
MAN=
WARNS?= 2
-DPADD= ${LIBGSSAPI} ${LIBGSSAPI_KRB5}
-LDADD= -lgssapi -lgssapi_krb5
+LIBADD= gssapi gssapi_krb5
DEBUG_FLAGS= -g -O0
.include <bsd.prog.mk>
diff --git a/tools/regression/lib/libc/nss/test-getaddr.c b/tools/regression/lib/libc/nss/test-getaddr.c
index aae1605..f0729ec 100644
--- a/tools/regression/lib/libc/nss/test-getaddr.c
+++ b/tools/regression/lib/libc/nss/test-getaddr.c
@@ -67,22 +67,22 @@ IMPLEMENT_TEST_DATA(addrinfo)
IMPLEMENT_TEST_FILE_SNAPSHOT(addrinfo)
IMPLEMENT_2PASS_TEST(addrinfo)
-static void
+static void
clone_addrinfo(struct addrinfo *dest, struct addrinfo const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
memcpy(dest, src, sizeof(struct addrinfo));
if (src->ai_canonname != NULL)
dest->ai_canonname = strdup(src->ai_canonname);
-
+
if (src->ai_addr != NULL) {
dest->ai_addr = (struct sockaddr *)malloc(src->ai_addrlen);
assert(dest->ai_addr != NULL);
memcpy(dest->ai_addr, src->ai_addr, src->ai_addrlen);
}
-
+
if (src->ai_next != NULL) {
dest->ai_next = (struct addrinfo *)malloc(
sizeof(struct addrinfo));
@@ -96,7 +96,7 @@ compare_addrinfo_(struct addrinfo *ai1, struct addrinfo *ai2)
{
if ((ai1 == NULL) || (ai2 == NULL))
return (-1);
-
+
if ((ai1->ai_flags != ai2->ai_flags) ||
(ai1->ai_family != ai2->ai_family) ||
(ai1->ai_socktype != ai2->ai_socktype) ||
@@ -107,11 +107,11 @@ compare_addrinfo_(struct addrinfo *ai1, struct addrinfo *ai2)
(((ai1->ai_canonname == NULL) || (ai2->ai_canonname == NULL)) &&
(ai1->ai_canonname != ai2->ai_canonname)))
return (-1);
-
- if ((ai1->ai_canonname != NULL) &&
+
+ if ((ai1->ai_canonname != NULL) &&
(strcmp(ai1->ai_canonname, ai2->ai_canonname) != 0))
return (-1);
-
+
if ((ai1->ai_addr != NULL) &&
(memcmp(ai1->ai_addr, ai2->ai_addr, ai1->ai_addrlen) != 0))
return (-1);
@@ -122,17 +122,17 @@ compare_addrinfo_(struct addrinfo *ai1, struct addrinfo *ai2)
return (compare_addrinfo_(ai1->ai_next, ai2->ai_next));
}
-static int
+static int
compare_addrinfo(struct addrinfo *ai1, struct addrinfo *ai2, void *mdata)
{
int rv;
-
+
if (debug) {
printf("testing equality of 2 addrinfo structures\n");
}
rv = compare_addrinfo_(ai1, ai2);
-
+
if (debug) {
if (rv == 0)
printf("equal\n");
@@ -142,16 +142,16 @@ compare_addrinfo(struct addrinfo *ai1, struct addrinfo *ai2, void *mdata)
printf("not equal\n");
}
}
-
+
return (rv);
}
-void
+void
free_addrinfo(struct addrinfo *ai)
{
if (ai == NULL)
return;
-
+
free(ai->ai_addr);
free(ai->ai_canonname);
free_addrinfo(ai->ai_next);
@@ -159,9 +159,9 @@ free_addrinfo(struct addrinfo *ai)
void
sdump_addrinfo(struct addrinfo *ai, char *buffer, size_t buflen)
-{
+{
int written, i;
-
+
written = snprintf(buffer, buflen, "%d %d %d %d %d ",
ai->ai_flags, ai->ai_family, ai->ai_socktype, ai->ai_protocol,
ai->ai_addrlen);
@@ -169,14 +169,14 @@ sdump_addrinfo(struct addrinfo *ai, char *buffer, size_t buflen)
if (written > buflen)
return;
buflen -= written;
-
+
written = snprintf(buffer, buflen, "%s ",
ai->ai_canonname == NULL ? "(null)" : ai->ai_canonname);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (ai->ai_addr == NULL) {
written = snprintf(buffer, buflen, "(null)");
buffer += written;
@@ -185,26 +185,26 @@ sdump_addrinfo(struct addrinfo *ai, char *buffer, size_t buflen)
buflen -= written;
} else {
for (i = 0; i < ai->ai_addrlen; ++i ) {
- written = snprintf(buffer, buflen,
+ written = snprintf(buffer, buflen,
i + 1 != ai->ai_addrlen ? "%d." : "%d",
((unsigned char *)ai->ai_addr)[i]);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (buflen == 0)
return;
- }
+ }
}
-
+
if (ai->ai_next != NULL) {
written = snprintf(buffer, buflen, ":");
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
sdump_addrinfo(ai->ai_next, buffer, buflen);
}
}
@@ -224,12 +224,12 @@ static int
addrinfo_read_snapshot_addr(char *addr, unsigned char *result, size_t len)
{
char *s, *ps, *ts;
-
+
ps = addr;
while ( (s = strsep(&ps, ".")) != NULL) {
if (len == 0)
return (-1);
-
+
*result = (unsigned char)strtol(s, &ts, 10);
++result;
if (*ts != '\0')
@@ -265,7 +265,7 @@ addrinfo_read_snapshot_ai(struct addrinfo *ai, char *line)
goto fin;
break;
case 4:
- ai->ai_addrlen = (socklen_t)strtol(s, &ts, 10);
+ ai->ai_addrlen = (socklen_t)strtol(s, &ts, 10);
if (*ts != '\0')
goto fin;
break;
@@ -274,7 +274,7 @@ addrinfo_read_snapshot_ai(struct addrinfo *ai, char *line)
ai->ai_canonname = strdup(s);
assert(ai->ai_canonname != NULL);
}
- break;
+ break;
case 6:
if (strcmp(s, "(null)") != 0) {
ai->ai_addr = (struct sockaddr *)malloc(
@@ -284,7 +284,7 @@ addrinfo_read_snapshot_ai(struct addrinfo *ai, char *line)
rv = addrinfo_read_snapshot_addr(s,
(unsigned char *)ai->ai_addr,
ai->ai_addrlen);
-
+
if (rv != 0)
goto fin;
}
@@ -294,18 +294,18 @@ addrinfo_read_snapshot_ai(struct addrinfo *ai, char *line)
rv = -1;
goto fin;
};
-
+
++i;
}
fin:
- if ((i != 7) || (rv != 0)) {
+ if ((i != 7) || (rv != 0)) {
free_addrinfo(ai);
memset(ai, 0, sizeof(struct addrinfo));
return (-1);
}
-
- return (0);
+
+ return (0);
}
static int
@@ -317,33 +317,33 @@ addrinfo_read_snapshot_func(struct addrinfo *ai, char *line)
if (debug)
printf("1 line read from snapshot:\n%s\n", line);
-
+
rv = 0;
i = 0;
ps = line;
-
+
s = strsep(&ps, ":");
if (s == NULL)
return (-1);
-
+
rv = addrinfo_read_snapshot_ai(ai, s);
if (rv != 0)
return (-1);
-
+
ai2 = ai;
while ( (s = strsep(&ps, ":")) != NULL) {
ai2->ai_next = (struct addrinfo *)malloc(
sizeof(struct addrinfo));
assert(ai2->ai_next != NULL);
memset(ai2->ai_next, 0, sizeof(struct addrinfo));
-
+
rv = addrinfo_read_snapshot_ai(ai2->ai_next, s);
if (rv != 0) {
- free_addrinfo(ai);
+ free_addrinfo(ai);
return (-1);
}
- ai2 = ai2->ai_next;
+ ai2 = ai2->ai_next;
}
return (0);
@@ -356,36 +356,36 @@ addrinfo_test_correctness(struct addrinfo *ai, void *mdata)
printf("testing correctness with the following data:\n");
dump_addrinfo(ai);
}
-
+
if (ai == NULL)
goto errfin;
-
+
if (!((ai->ai_family >= 0) && (ai->ai_family < AF_MAX)))
goto errfin;
-
+
if ((ai->ai_socktype != 0) && (ai->ai_socktype != SOCK_STREAM) &&
(ai->ai_socktype != SOCK_DGRAM) && (ai->ai_socktype != SOCK_RAW))
goto errfin;
-
+
if ((ai->ai_protocol != 0) && (ai->ai_protocol != IPPROTO_UDP) &&
(ai->ai_protocol != IPPROTO_TCP))
goto errfin;
-
+
if ((ai->ai_flags & ~(AI_CANONNAME | AI_NUMERICHOST | AI_PASSIVE)) != 0)
goto errfin;
- if ((ai->ai_addrlen != ai->ai_addr->sa_len) ||
+ if ((ai->ai_addrlen != ai->ai_addr->sa_len) ||
(ai->ai_family != ai->ai_addr->sa_family))
goto errfin;
-
+
if (debug)
printf("correct\n");
-
- return (0);
+
+ return (0);
errfin:
if (debug)
printf("incorrect\n");
-
+
return (-1);
}
@@ -393,27 +393,27 @@ static int
addrinfo_read_hostlist_func(struct addrinfo *ai, char *line)
{
struct addrinfo *result;
- int rv;
-
+ int rv;
+
if (debug)
printf("resolving %s: ", line);
rv = getaddrinfo(line, NULL, &hints, &result);
if (rv == 0) {
if (debug)
printf("found\n");
-
+
rv = addrinfo_test_correctness(result, NULL);
if (rv != 0) {
freeaddrinfo(result);
return (rv);
}
-
+
clone_addrinfo(ai, result);
freeaddrinfo(result);
} else {
if (debug)
printf("not found\n");
-
+
memset(ai, 0, sizeof(struct addrinfo));
}
return (0);
@@ -435,10 +435,10 @@ main(int argc, char **argv)
char *snapshot_file, *hostlist_file;
int rv;
int c;
-
+
if (argc < 2)
usage();
-
+
snapshot_file = NULL;
hostlist_file = NULL;
memset(&hints, 0, sizeof(struct addrinfo));
@@ -465,38 +465,38 @@ main(int argc, char **argv)
default:
usage();
}
-
+
TEST_DATA_INIT(addrinfo, &td, clone_addrinfo, free_addrinfo);
TEST_DATA_INIT(addrinfo, &td_snap, clone_addrinfo, free_addrinfo);
-
+
if (hostlist_file == NULL)
usage();
-
+
if (access(hostlist_file, R_OK) != 0) {
if (debug)
printf("can't access the hostlist file %s\n",
hostlist_file);
-
+
usage();
}
-
+
if (debug)
printf("building host lists from %s\n", hostlist_file);
-
+
rv = TEST_SNAPSHOT_FILE_READ(addrinfo, hostlist_file, &td,
addrinfo_read_hostlist_func);
if (rv != 0)
goto fin;
-
+
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT)
method = TEST_BUILD_SNAPSHOT;
else {
if (debug)
printf("can't access the snapshot file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -510,7 +510,7 @@ main(int argc, char **argv)
}
}
}
-
+
switch (method) {
case TEST_GETADDRINFO:
if (snapshot_file != NULL)
@@ -519,7 +519,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL) {
- rv = TEST_SNAPSHOT_FILE_WRITE(addrinfo, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(addrinfo, snapshot_file, &td,
sdump_addrinfo);
}
break;
diff --git a/tools/regression/lib/libc/nss/test-getgr.c b/tools/regression/lib/libc/nss/test-getgr.c
index 322c636..0ccebae 100644
--- a/tools/regression/lib/libc/nss/test-getgr.c
+++ b/tools/regression/lib/libc/nss/test-getgr.c
@@ -63,14 +63,14 @@ static void free_group(struct group *);
static void sdump_group(struct group *, char *, size_t);
static int group_read_snapshot_func(struct group *, char *);
-static int group_check_ambiguity(struct group_test_data *,
+static int group_check_ambiguity(struct group_test_data *,
struct group *);
static int group_fill_test_data(struct group_test_data *);
static int group_test_correctness(struct group *, void *);
static int group_test_getgrnam(struct group *, void *);
static int group_test_getgrgid(struct group *, void *);
static int group_test_getgrent(struct group *, void *);
-
+
static void usage(void) __attribute__((__noreturn__));
IMPLEMENT_TEST_DATA(group)
@@ -83,33 +83,33 @@ clone_group(struct group *dest, struct group const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
char **cp;
int members_num;
-
+
memset(dest, 0, sizeof(struct group));
-
+
if (src->gr_name != NULL) {
dest->gr_name = strdup(src->gr_name);
assert(dest->gr_name != NULL);
}
-
+
if (src->gr_passwd != NULL) {
dest->gr_passwd = strdup(src->gr_passwd);
assert(dest->gr_passwd != NULL);
}
dest->gr_gid = src->gr_gid;
-
+
if (src->gr_mem != NULL) {
members_num = 0;
for (cp = src->gr_mem; *cp; ++cp)
++members_num;
-
+
dest->gr_mem = (char **)malloc(
(members_num + 1) * (sizeof(char *)));
assert(dest->gr_mem != NULL);
memset(dest->gr_mem, 0, (members_num+1) * (sizeof(char *)));
-
+
for (cp = src->gr_mem; *cp; ++cp) {
dest->gr_mem[cp - src->gr_mem] = strdup(*cp);
assert(dest->gr_mem[cp - src->gr_mem] != NULL);
@@ -117,52 +117,52 @@ clone_group(struct group *dest, struct group const *src)
}
}
-static void
+static void
free_group(struct group *grp)
{
char **cp;
-
+
assert(grp != NULL);
-
+
free(grp->gr_name);
free(grp->gr_passwd);
-
+
for (cp = grp->gr_mem; *cp; ++cp)
free(*cp);
free(grp->gr_mem);
}
-static int
+static int
compare_group(struct group *grp1, struct group *grp2, void *mdata)
{
char **c1, **c2;
-
+
if (grp1 == grp2)
return (0);
-
+
if ((grp1 == NULL) || (grp2 == NULL))
goto errfin;
-
+
if ((strcmp(grp1->gr_name, grp2->gr_name) != 0) ||
(strcmp(grp1->gr_passwd, grp2->gr_passwd) != 0) ||
(grp1->gr_gid != grp2->gr_gid))
goto errfin;
-
+
c1 = grp1->gr_mem;
c2 = grp2->gr_mem;
-
+
if ((grp1->gr_mem == NULL) || (grp2->gr_mem == NULL))
goto errfin;
-
+
for (;*c1 && *c2; ++c1, ++c2)
if (strcmp(*c1, *c2) != 0)
goto errfin;
-
+
if ((*c1 != '\0') || (*c2 != '\0'))
goto errfin;
-
+
return 0;
-
+
errfin:
if ((debug) && (mdata == NULL)) {
printf("following structures are not equal:\n");
@@ -178,14 +178,14 @@ sdump_group(struct group *grp, char *buffer, size_t buflen)
{
char **cp;
int written;
-
+
written = snprintf(buffer, buflen, "%s %s %d",
- grp->gr_name, grp->gr_passwd, grp->gr_gid);
+ grp->gr_name, grp->gr_passwd, grp->gr_gid);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (grp->gr_mem != NULL) {
if (*(grp->gr_mem) != '\0') {
for (cp = grp->gr_mem; *cp; ++cp) {
@@ -194,9 +194,9 @@ sdump_group(struct group *grp, char *buffer, size_t buflen)
if (written > buflen)
return;
buflen -= written;
-
+
if (buflen == 0)
- return;
+ return;
}
} else
snprintf(buffer, buflen, " nomem");
@@ -213,7 +213,7 @@ group_read_snapshot_func(struct group *grp, char *line)
if (debug)
printf("1 line read from snapshot:\n%s\n", line);
-
+
i = 0;
sl = NULL;
ps = line;
@@ -243,10 +243,10 @@ group_read_snapshot_func(struct group *grp, char *line)
if (sl == NULL) {
if (strcmp(s, "(null)") == 0)
return (0);
-
+
sl = sl_init();
assert(sl != NULL);
-
+
if (strcmp(s, "nomem") != 0) {
ts = strdup(s);
assert(ts != NULL);
@@ -257,7 +257,7 @@ group_read_snapshot_func(struct group *grp, char *line)
assert(ts != NULL);
sl_add(sl, ts);
}
- break;
+ break;
};
++i;
}
@@ -268,16 +268,16 @@ group_read_snapshot_func(struct group *grp, char *line)
memset(grp, 0, sizeof(struct group));
return (-1);
}
-
+
sl_add(sl, NULL);
grp->gr_mem = sl->sl_str;
/* NOTE: is it a dirty hack or not? */
- free(sl);
+ free(sl);
return (0);
}
-static void
+static void
dump_group(struct group *result)
{
if (result != NULL) {
@@ -292,7 +292,7 @@ static int
group_fill_test_data(struct group_test_data *td)
{
struct group *grp;
-
+
setgroupent(1);
while ((grp = getgrent()) != NULL) {
if (group_test_correctness(grp, NULL) == 0)
@@ -301,7 +301,7 @@ group_fill_test_data(struct group_test_data *td)
return (-1);
}
endgrent();
-
+
return (0);
}
@@ -312,37 +312,37 @@ group_test_correctness(struct group *grp, void *mdata)
printf("testing correctness with the following data:\n");
dump_group(grp);
}
-
+
if (grp == NULL)
goto errfin;
-
+
if (grp->gr_name == NULL)
goto errfin;
-
+
if (grp->gr_passwd == NULL)
goto errfin;
-
+
if (grp->gr_mem == NULL)
goto errfin;
-
+
if (debug)
printf("correct\n");
-
- return (0);
+
+ return (0);
errfin:
if (debug)
printf("incorrect\n");
-
+
return (-1);
}
/* group_check_ambiguity() is needed here because when doing the getgrent()
- * calls sequence, records from different nsswitch sources can be different,
+ * calls sequence, records from different nsswitch sources can be different,
* though having the same pw_name/pw_uid */
static int
group_check_ambiguity(struct group_test_data *td, struct group *pwd)
{
-
+
return (TEST_DATA_FIND(group, td, pwd, compare_group,
NULL) != NULL ? 0 : -1);
}
@@ -351,7 +351,7 @@ static int
group_test_getgrnam(struct group *grp_model, void *mdata)
{
struct group *grp;
-
+
if (debug) {
printf("testing getgrnam() with the following data:\n");
dump_group(grp_model);
@@ -360,20 +360,20 @@ group_test_getgrnam(struct group *grp_model, void *mdata)
grp = getgrnam(grp_model->gr_name);
if (group_test_correctness(grp, NULL) != 0)
goto errfin;
-
+
if ((compare_group(grp, grp_model, NULL) != 0) &&
- (group_check_ambiguity((struct group_test_data *)mdata, grp)
+ (group_check_ambiguity((struct group_test_data *)mdata, grp)
!=0))
goto errfin;
-
+
if (debug)
printf("ok\n");
return (0);
-
+
errfin:
if (debug)
printf("not ok\n");
-
+
return (-1);
}
@@ -381,14 +381,14 @@ static int
group_test_getgrgid(struct group *grp_model, void *mdata)
{
struct group *grp;
-
+
if (debug) {
printf("testing getgrgid() with the following data...\n");
dump_group(grp_model);
- }
-
+ }
+
grp = getgrgid(grp_model->gr_gid);
- if ((group_test_correctness(grp, NULL) != 0) ||
+ if ((group_test_correctness(grp, NULL) != 0) ||
((compare_group(grp, grp_model, NULL) != 0) &&
(group_check_ambiguity((struct group_test_data *)mdata, grp)
!= 0))) {
@@ -402,7 +402,7 @@ group_test_getgrgid(struct group *grp_model, void *mdata)
}
}
-static int
+static int
group_test_getgrent(struct group *grp, void *mdata)
{
/* Only correctness can be checked when doing 1-pass test for
@@ -426,10 +426,10 @@ main(int argc, char **argv)
char *snapshot_file;
int rv;
int c;
-
+
if (argc < 2)
usage();
-
+
snapshot_file = NULL;
while ((c = getopt(argc, argv, "nge2ds:")) != -1)
switch (c) {
@@ -454,18 +454,18 @@ main(int argc, char **argv)
default:
usage();
}
-
+
TEST_DATA_INIT(group, &td, clone_group, free_group);
TEST_DATA_INIT(group, &td_snap, clone_group, free_group);
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT)
method = TEST_BUILD_SNAPSHOT;
else {
if (debug)
printf("can't access the file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -474,12 +474,12 @@ main(int argc, char **argv)
rv = 0;
goto fin;
}
-
+
TEST_SNAPSHOT_FILE_READ(group, snapshot_file,
&td_snap, group_read_snapshot_func);
}
}
-
+
rv = group_fill_test_data(&td);
if (rv == -1)
return (-1);
@@ -489,7 +489,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(group, &td,
group_test_getgrnam, (void *)&td);
else
- rv = DO_1PASS_TEST(group, &td_snap,
+ rv = DO_1PASS_TEST(group, &td_snap,
group_test_getgrnam, (void *)&td_snap);
break;
case TEST_GETGRGID:
@@ -497,7 +497,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(group, &td,
group_test_getgrgid, (void *)&td);
else
- rv = DO_1PASS_TEST(group, &td_snap,
+ rv = DO_1PASS_TEST(group, &td_snap,
group_test_getgrgid, (void *)&td_snap);
break;
case TEST_GETGRENT:
@@ -510,7 +510,7 @@ main(int argc, char **argv)
break;
case TEST_GETGRENT_2PASS:
TEST_DATA_INIT(group, &td_2pass, clone_group, free_group);
- rv = group_fill_test_data(&td_2pass);
+ rv = group_fill_test_data(&td_2pass);
if (rv != -1)
rv = DO_2PASS_TEST(group, &td, &td_2pass,
compare_group, NULL);
@@ -518,7 +518,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL)
- rv = TEST_SNAPSHOT_FILE_WRITE(group, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(group, snapshot_file, &td,
sdump_group);
break;
default:
@@ -529,6 +529,6 @@ main(int argc, char **argv)
fin:
TEST_DATA_DESTROY(group, &td_snap);
TEST_DATA_DESTROY(group, &td);
- free(snapshot_file);
+ free(snapshot_file);
return (rv);
}
diff --git a/tools/regression/lib/libc/nss/test-gethostby.c b/tools/regression/lib/libc/nss/test-gethostby.c
index 7346544..9e7bdf5 100644
--- a/tools/regression/lib/libc/nss/test-gethostby.c
+++ b/tools/regression/lib/libc/nss/test-gethostby.c
@@ -90,7 +90,7 @@ static int hostent_test_correctness(struct hostent *, void *);
static int hostent_test_gethostbyaddr(struct hostent *, void *);
static int hostent_test_getaddrinfo_eq(struct hostent *, void *);
static int hostent_test_getnameinfo_eq(struct hostent *, void *);
-
+
static void usage(void) __attribute__((__noreturn__));
IMPLEMENT_TEST_DATA(hostent)
@@ -103,7 +103,7 @@ __gethostbyname2(const char *name, int af)
{
struct hostent *he;
int error;
-
+
if (use_ipnode_functions == 0)
he = gethostbyname2(name, af);
else {
@@ -112,7 +112,7 @@ __gethostbyname2(const char *name, int af)
if (he == NULL)
errno = error;
}
-
+
return (he);
}
@@ -121,7 +121,7 @@ __gethostbyaddr(const void *addr, socklen_t len, int af)
{
struct hostent *he;
int error;
-
+
if (use_ipnode_functions == 0)
he = gethostbyaddr(addr, len, af);
else {
@@ -130,8 +130,8 @@ __gethostbyaddr(const void *addr, socklen_t len, int af)
if (he == NULL)
errno = error;
}
-
- return (he);
+
+ return (he);
}
static void
@@ -147,44 +147,44 @@ clone_hostent(struct hostent *dest, struct hostent const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
char **cp;
int aliases_num;
int addrs_num;
size_t offset;
-
+
memset(dest, 0, sizeof(struct hostent));
-
+
if (src->h_name != NULL) {
dest->h_name = strdup(src->h_name);
assert(dest->h_name != NULL);
}
-
+
dest->h_addrtype = src->h_addrtype;
dest->h_length = src->h_length;
-
+
if (src->h_aliases != NULL) {
aliases_num = 0;
for (cp = src->h_aliases; *cp; ++cp)
++aliases_num;
-
+
dest->h_aliases = (char **)malloc((aliases_num + 1) *
(sizeof(char *)));
assert(dest->h_aliases != NULL);
memset(dest->h_aliases, 0, (aliases_num + 1) *
(sizeof(char *)));
-
+
for (cp = src->h_aliases; *cp; ++cp) {
dest->h_aliases[cp - src->h_aliases] = strdup(*cp);
assert(dest->h_aliases[cp - src->h_aliases] != NULL);
}
}
-
+
if (src->h_addr_list != NULL) {
addrs_num = 0;
for (cp = src->h_addr_list; *cp; ++cp)
++addrs_num;
-
+
dest->h_addr_list = (char **)malloc((addrs_num + 1) *
(sizeof(char *)));
assert(dest->h_addr_list != NULL);
@@ -193,7 +193,7 @@ clone_hostent(struct hostent *dest, struct hostent const *src)
for (cp = src->h_addr_list; *cp; ++cp) {
offset = cp - src->h_addr_list;
- dest->h_addr_list[offset] =
+ dest->h_addr_list[offset] =
(char *)malloc(src->h_length);
assert(dest->h_addr_list[offset] != NULL);
memcpy(dest->h_addr_list[offset],
@@ -202,15 +202,15 @@ clone_hostent(struct hostent *dest, struct hostent const *src)
}
}
-static void
+static void
free_hostent(struct hostent *ht)
{
char **cp;
-
+
assert(ht != NULL);
-
+
free(ht->h_name);
-
+
if (ht->h_aliases != NULL) {
for (cp = ht->h_aliases; *cp; ++cp)
free(*cp);
@@ -224,33 +224,33 @@ free_hostent(struct hostent *ht)
}
}
-static int
+static int
compare_hostent(struct hostent *ht1, struct hostent *ht2, void *mdata)
{
char **c1, **c2, **ct, **cb;
int b;
-
+
if (ht1 == ht2)
return 0;
-
+
if ((ht1 == NULL) || (ht2 == NULL))
goto errfin;
-
+
if ((ht1->h_name == NULL) || (ht2->h_name == NULL))
goto errfin;
-
+
if ((ht1->h_addrtype != ht2->h_addrtype) ||
- (ht1->h_length != ht2->h_length) ||
+ (ht1->h_length != ht2->h_length) ||
(strcmp(ht1->h_name, ht2->h_name) != 0))
goto errfin;
-
+
c1 = ht1->h_aliases;
c2 = ht2->h_aliases;
-
+
if (((ht1->h_aliases == NULL) || (ht2->h_aliases == NULL)) &&
(ht1->h_aliases != ht2->h_aliases))
goto errfin;
-
+
if ((c1 != NULL) && (c2 != NULL)) {
cb = c1;
for (;*c1; ++c1) {
@@ -286,14 +286,14 @@ compare_hostent(struct hostent *ht1, struct hostent *ht2, void *mdata)
}
}
}
-
+
c1 = ht1->h_addr_list;
c2 = ht2->h_addr_list;
-
+
if (((ht1->h_addr_list == NULL) || (ht2->h_addr_list== NULL)) &&
(ht1->h_addr_list != ht2->h_addr_list))
goto errfin;
-
+
if ((c1 != NULL) && (c2 != NULL)) {
cb = c1;
for (;*c1; ++c1) {
@@ -311,7 +311,7 @@ compare_hostent(struct hostent *ht1, struct hostent *ht2, void *mdata)
goto errfin;
}
}
-
+
c1 = cb;
for (;*c2; ++c2) {
b = 0;
@@ -331,7 +331,7 @@ compare_hostent(struct hostent *ht1, struct hostent *ht2, void *mdata)
}
return 0;
-
+
errfin:
if ((debug) && (mdata == NULL)) {
printf("following structures are not equal:\n");
@@ -346,28 +346,28 @@ static int
check_addrinfo_for_name(struct addrinfo *ai, char const *name)
{
struct addrinfo *ai2;
-
+
for (ai2 = ai; ai2 != NULL; ai2 = ai2->ai_next) {
if (strcmp(ai2->ai_canonname, name) == 0)
return (0);
}
-
+
return (-1);
}
static int
-check_addrinfo_for_addr(struct addrinfo *ai, char const *addr,
+check_addrinfo_for_addr(struct addrinfo *ai, char const *addr,
socklen_t addrlen, int af)
{
struct addrinfo *ai2;
-
+
for (ai2 = ai; ai2 != NULL; ai2 = ai2->ai_next) {
if (af != ai2->ai_family)
continue;
-
+
switch (af) {
case AF_INET:
- if (memcmp(addr,
+ if (memcmp(addr,
(void *)&((struct sockaddr_in *)ai2->ai_addr)->sin_addr,
min(addrlen, ai2->ai_addrlen)) == 0)
return (0);
@@ -382,24 +382,24 @@ check_addrinfo_for_addr(struct addrinfo *ai, char const *addr,
break;
}
}
-
+
return (-1);
}
-static int
+static int
is_hostent_equal(struct hostent *he, struct addrinfo *ai)
{
char **cp;
int rv;
-
+
if (debug)
printf("checking equality of he and ai\n");
-
+
rv = check_addrinfo_for_name(ai, he->h_name);
if (rv != 0) {
if (debug)
printf("not equal - he->h_name couldn't be found\n");
-
+
return (rv);
}
@@ -409,14 +409,14 @@ is_hostent_equal(struct hostent *he, struct addrinfo *ai)
if (rv != 0) {
if (debug)
printf("not equal - one of he->h_addr_list couldn't be found\n");
-
+
return (rv);
}
}
-
+
if (debug)
printf("equal\n");
-
+
return (0);
}
@@ -426,14 +426,14 @@ sdump_hostent(struct hostent *ht, char *buffer, size_t buflen)
char **cp;
size_t i;
int written;
-
+
written = snprintf(buffer, buflen, "%s %d %d",
ht->h_name, ht->h_addrtype, ht->h_length);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (ht->h_aliases != NULL) {
if (*(ht->h_aliases) != NULL) {
for (cp = ht->h_aliases; *cp; ++cp) {
@@ -442,53 +442,53 @@ sdump_hostent(struct hostent *ht, char *buffer, size_t buflen)
if (written > buflen)
return;
buflen -= written;
-
+
if (buflen == 0)
- return;
+ return;
}
} else {
written = snprintf(buffer, buflen, " noaliases");
buffer += written;
if (written > buflen)
return;
- buflen -= written;
+ buflen -= written;
}
} else {
written = snprintf(buffer, buflen, " (null)");
buffer += written;
if (written > buflen)
return;
- buflen -= written;
+ buflen -= written;
}
-
+
written = snprintf(buffer, buflen, " : ");
buffer += written;
if (written > buflen)
return;
- buflen -= written;
+ buflen -= written;
if (ht->h_addr_list != NULL) {
if (*(ht->h_addr_list) != NULL) {
for (cp = ht->h_addr_list; *cp; ++cp) {
for (i = 0; i < ht->h_length; ++i ) {
- written = snprintf(buffer, buflen,
+ written = snprintf(buffer, buflen,
i + 1 != ht->h_length ? "%d." : "%d",
(unsigned char)(*cp)[i]);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (buflen == 0)
return;
}
-
+
if (*(cp + 1) ) {
written = snprintf(buffer, buflen, " ");
buffer += written;
if (written > buflen)
return;
- buflen -= written;
+ buflen -= written;
}
}
} else {
@@ -496,42 +496,42 @@ sdump_hostent(struct hostent *ht, char *buffer, size_t buflen)
buffer += written;
if (written > buflen)
return;
- buflen -= written;
+ buflen -= written;
}
} else {
written = snprintf(buffer, buflen, " (null)");
buffer += written;
if (written > buflen)
return;
- buflen -= written;
- }
+ buflen -= written;
+ }
}
static int
hostent_read_hostlist_func(struct hostent *he, char *line)
{
struct hostent *result;
- int rv;
-
+ int rv;
+
if (debug)
printf("resolving %s: ", line);
result = __gethostbyname2(line, af_type);
if (result != NULL) {
if (debug)
printf("found\n");
-
+
rv = hostent_test_correctness(result, NULL);
if (rv != 0) {
__freehostent(result);
return (rv);
}
-
+
clone_hostent(he, result);
__freehostent(result);
} else {
if (debug)
printf("not found\n");
-
+
memset(he, 0, sizeof(struct hostent));
he->h_name = strdup(line);
assert(he->h_name != NULL);
@@ -543,12 +543,12 @@ static int
hostent_read_snapshot_addr(char *addr, unsigned char *result, size_t len)
{
char *s, *ps, *ts;
-
+
ps = addr;
while ( (s = strsep(&ps, ".")) != NULL) {
if (len == 0)
return (-1);
-
+
*result = (unsigned char)strtol(s, &ts, 10);
++result;
if (*ts != '\0')
@@ -571,7 +571,7 @@ hostent_read_snapshot_func(struct hostent *ht, char *line)
if (debug)
printf("1 line read from snapshot:\n%s\n", line);
-
+
rv = 0;
i = 0;
sl1 = sl2 = NULL;
@@ -595,15 +595,15 @@ hostent_read_snapshot_func(struct hostent *ht, char *line)
if (*ts != '\0')
goto fin;
break;
-
+
case 3:
if (sl1 == NULL) {
if (strcmp(s, "(null)") == 0)
return (0);
-
+
sl1 = sl_init();
assert(sl1 != NULL);
-
+
if (strcmp(s, "noaliases") != 0) {
ts = strdup(s);
assert(ts != NULL);
@@ -618,16 +618,16 @@ hostent_read_snapshot_func(struct hostent *ht, char *line)
sl_add(sl1, ts);
}
}
- break;
+ break;
case 4:
if (sl2 == NULL) {
if (strcmp(s, "(null)") == 0)
return (0);
-
+
sl2 = sl_init();
assert(sl2 != NULL);
-
+
if (strcmp(s, "noaddrs") != 0) {
ts = (char *)malloc(ht->h_length);
assert(ts != NULL);
@@ -650,9 +650,9 @@ hostent_read_snapshot_func(struct hostent *ht, char *line)
}
break;
default:
- break;
+ break;
};
-
+
if ((i != 3) && (i != 4))
++i;
}
@@ -667,19 +667,19 @@ fin:
ht->h_addr_list = sl2->sl_str;
}
- if ((i != 4) || (rv != 0)) {
+ if ((i != 4) || (rv != 0)) {
free_hostent(ht);
memset(ht, 0, sizeof(struct hostent));
return (-1);
}
-
+
/* NOTE: is it a dirty hack or not? */
free(sl1);
- free(sl2);
+ free(sl2);
return (0);
}
-static void
+static void
dump_hostent(struct hostent *result)
{
if (result != NULL) {
@@ -697,34 +697,34 @@ hostent_test_correctness(struct hostent *ht, void *mdata)
printf("testing correctness with the following data:\n");
dump_hostent(ht);
}
-
+
if (ht == NULL)
goto errfin;
-
+
if (ht->h_name == NULL)
goto errfin;
if (!((ht->h_addrtype >= 0) && (ht->h_addrtype < AF_MAX)))
goto errfin;
-
- if ((ht->h_length != sizeof(struct in_addr)) &&
+
+ if ((ht->h_length != sizeof(struct in_addr)) &&
(ht->h_length != sizeof(struct in6_addr)))
goto errfin;
-
+
if (ht->h_aliases == NULL)
goto errfin;
-
+
if (ht->h_addr_list == NULL)
goto errfin;
-
+
if (debug)
printf("correct\n");
-
- return (0);
+
+ return (0);
errfin:
if (debug)
printf("incorrect\n");
-
+
return (-1);
}
@@ -733,23 +733,23 @@ hostent_test_gethostbyaddr(struct hostent *he, void *mdata)
{
struct hostent *result;
struct hostent_test_data *addr_test_data;
- int rv;
-
+ int rv;
+
addr_test_data = (struct hostent_test_data *)mdata;
-
+
/* We should omit unresolved hostents */
if (he->h_addr_list != NULL) {
char **cp;
for (cp = he->h_addr_list; *cp; ++cp) {
if (debug)
printf("doing reverse lookup for %s\n", he->h_name);
-
+
result = __gethostbyaddr(*cp, he->h_length,
he->h_addrtype);
if (result == NULL) {
if (debug)
printf("warning: reverse lookup failed\n");
-
+
continue;
}
rv = hostent_test_correctness(result, NULL);
@@ -757,14 +757,14 @@ hostent_test_gethostbyaddr(struct hostent *he, void *mdata)
__freehostent(result);
return (rv);
}
-
+
if (addr_test_data != NULL)
TEST_DATA_APPEND(hostent, addr_test_data, result);
-
+
__freehostent(result);
}
}
-
+
return (0);
}
@@ -772,16 +772,16 @@ static int
hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata)
{
struct addrinfo *ai, hints;
- int rv;
-
+ int rv;
+
ai = NULL;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = af_type;
hints.ai_flags = AI_CANONNAME;
-
+
if (debug)
printf("using getaddrinfo() to resolve %s\n", he->h_name);
-
+
/* struct hostent *he was not resolved */
if (he->h_addr_list == NULL) {
/* We can be sure that he->h_name is not NULL */
@@ -798,20 +798,20 @@ hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata)
printf("not ok - should have beed resolved\n");
return (-1);
}
-
+
rv = is_hostent_equal(he, ai);
if (rv != 0) {
if (debug)
printf("not ok - addrinfo and hostent are not equal\n");
return (-1);
}
-
+
}
-
+
return (0);
}
-static int
+static int
hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
{
char buffer[NI_MAXHOST];
@@ -820,13 +820,13 @@ hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
struct sockaddr *saddr;
struct hostent *result;
int rv;
-
+
if (he->h_addr_list != NULL) {
char **cp;
for (cp = he->h_addr_list; *cp; ++cp) {
if (debug)
printf("doing reverse lookup for %s\n", he->h_name);
-
+
result = __gethostbyaddr(*cp, he->h_length,
he->h_addrtype);
if (result != NULL) {
@@ -837,16 +837,16 @@ hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
}
} else {
if (debug)
- printf("reverse lookup failed\n");
+ printf("reverse lookup failed\n");
}
-
+
switch (he->h_addrtype) {
case AF_INET:
memset(&sin, 0, sizeof(struct sockaddr_in));
sin.sin_len = sizeof(struct sockaddr_in);
sin.sin_family = AF_INET;
memcpy(&sin.sin_addr, *cp, he->h_length);
-
+
saddr = (struct sockaddr *)&sin;
break;
case AF_INET6:
@@ -854,7 +854,7 @@ hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
sin6.sin6_len = sizeof(struct sockaddr_in6);
sin6.sin6_family = AF_INET6;
memcpy(&sin6.sin6_addr, *cp, he->h_length);
-
+
saddr = (struct sockaddr *)&sin6;
break;
default:
@@ -863,38 +863,38 @@ hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
he->h_addrtype);
continue;
}
-
+
assert(saddr != NULL);
- rv = getnameinfo(saddr, saddr->sa_len, buffer,
+ rv = getnameinfo(saddr, saddr->sa_len, buffer,
sizeof(buffer), NULL, 0, NI_NAMEREQD);
-
+
if ((rv != 0) && (result != NULL)) {
if (debug)
printf("not ok - getnameinfo() didn't make the reverse lookup, when it should have (%s)\n",
gai_strerror(rv));
return (rv);
}
-
+
if ((rv == 0) && (result == NULL)) {
if (debug)
- printf("not ok - getnameinfo() made the reverse lookup, when it shouldn't have\n");
+ printf("not ok - getnameinfo() made the reverse lookup, when it shouldn't have\n");
return (rv);
}
-
+
if ((rv != 0) && (result == NULL)) {
if (debug)
printf("ok - both getnameinfo() and ***byaddr() failed\n");
-
+
continue;
}
-
+
if (debug)
printf("comparing %s with %s\n", result->h_name,
- buffer);
-
+ buffer);
+
rv = strcmp(result->h_name, buffer);
__freehostent(result);
-
+
if (rv != 0) {
if (debug)
printf("not ok - getnameinfo() and ***byaddr() results are not equal\n");
@@ -903,10 +903,10 @@ hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
if (debug)
printf("ok - getnameinfo() and ***byaddr() results are equal\n");
}
- }
+ }
}
-
- return (0);
+
+ return (0);
}
static void
@@ -923,13 +923,13 @@ main(int argc, char **argv)
{
struct hostent_test_data td, td_addr, td_snap;
char *snapshot_file, *hostlist_file;
- res_state statp;
+ res_state statp;
int rv;
int c;
-
+
if (argc < 2)
usage();
-
+
snapshot_file = NULL;
hostlist_file = NULL;
while ((c = getopt(argc, argv, "nad2iod46mAcMs:f:")) != -1)
@@ -986,37 +986,37 @@ main(int argc, char **argv)
if (use_ipnode_functions == 0) {
statp = __res_state();
- if ((statp == NULL) || ((statp->options & RES_INIT) == 0 &&
+ if ((statp == NULL) || ((statp->options & RES_INIT) == 0 &&
res_ninit(statp) == -1)) {
if (debug)
printf("error: can't init res_state\n");
-
+
free(snapshot_file);
free(hostlist_file);
return (-1);
}
-
- if (use_ipv6_mapping == 0)
+
+ if (use_ipv6_mapping == 0)
statp->options &= ~RES_USE_INET6;
else
statp->options |= RES_USE_INET6;
}
-
+
TEST_DATA_INIT(hostent, &td, clone_hostent, free_hostent);
TEST_DATA_INIT(hostent, &td_addr, clone_hostent, free_hostent);
TEST_DATA_INIT(hostent, &td_snap, clone_hostent, free_hostent);
-
+
if (hostlist_file == NULL)
usage();
-
+
if (access(hostlist_file, R_OK) != 0) {
if (debug)
printf("can't access the hostlist file %s\n",
hostlist_file);
-
+
usage();
}
-
+
if (debug)
printf("building host lists from %s\n", hostlist_file);
@@ -1024,9 +1024,9 @@ main(int argc, char **argv)
hostent_read_hostlist_func);
if (rv != 0)
goto fin;
-
+
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT) {
if (method != TEST_GETHOSTBYADDR)
method = TEST_BUILD_SNAPSHOT;
@@ -1036,7 +1036,7 @@ main(int argc, char **argv)
if (debug)
printf("can't access the snapshot file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -1050,7 +1050,7 @@ main(int argc, char **argv)
}
}
}
-
+
switch (method) {
case TEST_GETHOSTBYNAME2:
if (snapshot_file != NULL)
@@ -1062,7 +1062,7 @@ main(int argc, char **argv)
hostent_test_gethostbyaddr, (void *)&td_addr);
if (snapshot_file != NULL)
- rv = DO_2PASS_TEST(hostent, &td_addr, &td_snap,
+ rv = DO_2PASS_TEST(hostent, &td_addr, &td_snap,
compare_hostent, NULL);
break;
case TEST_GETHOSTBYNAME2_GETADDRINFO:
@@ -1075,7 +1075,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL) {
- rv = TEST_SNAPSHOT_FILE_WRITE(hostent, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(hostent, snapshot_file, &td,
sdump_hostent);
}
break;
@@ -1083,8 +1083,8 @@ main(int argc, char **argv)
if (snapshot_file != NULL) {
rv = DO_1PASS_TEST(hostent, &td,
hostent_test_gethostbyaddr, (void *)&td_addr);
-
- rv = TEST_SNAPSHOT_FILE_WRITE(hostent, snapshot_file,
+
+ rv = TEST_SNAPSHOT_FILE_WRITE(hostent, snapshot_file,
&td_addr, sdump_hostent);
}
break;
diff --git a/tools/regression/lib/libc/nss/test-getproto.c b/tools/regression/lib/libc/nss/test-getproto.c
index 89ad087..a3ba271 100644
--- a/tools/regression/lib/libc/nss/test-getproto.c
+++ b/tools/regression/lib/libc/nss/test-getproto.c
@@ -63,14 +63,14 @@ static void free_protoent(struct protoent *);
static void sdump_protoent(struct protoent *, char *, size_t);
static int protoent_read_snapshot_func(struct protoent *, char *);
-static int protoent_check_ambiguity(struct protoent_test_data *,
+static int protoent_check_ambiguity(struct protoent_test_data *,
struct protoent *);
static int protoent_fill_test_data(struct protoent_test_data *);
static int protoent_test_correctness(struct protoent *, void *);
static int protoent_test_getprotobyname(struct protoent *, void *);
static int protoent_test_getprotobynumber(struct protoent *, void *);
static int protoent_test_getprotoent(struct protoent *, void *);
-
+
static void usage(void) __attribute__((__noreturn__));
IMPLEMENT_TEST_DATA(protoent)
@@ -83,28 +83,28 @@ clone_protoent(struct protoent *dest, struct protoent const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
char **cp;
int aliases_num;
-
+
memset(dest, 0, sizeof(struct protoent));
-
+
if (src->p_name != NULL) {
dest->p_name = strdup(src->p_name);
assert(dest->p_name != NULL);
}
-
+
dest->p_proto = src->p_proto;
-
+
if (src->p_aliases != NULL) {
aliases_num = 0;
for (cp = src->p_aliases; *cp; ++cp)
++aliases_num;
-
+
dest->p_aliases = (char **)malloc((aliases_num+1) * (sizeof(char *)));
assert(dest->p_aliases != NULL);
memset(dest->p_aliases, 0, (aliases_num+1) * (sizeof(char *)));
-
+
for (cp = src->p_aliases; *cp; ++cp) {
dest->p_aliases[cp - src->p_aliases] = strdup(*cp);
assert(dest->p_aliases[cp - src->p_aliases] != NULL);
@@ -112,50 +112,50 @@ clone_protoent(struct protoent *dest, struct protoent const *src)
}
}
-static void
+static void
free_protoent(struct protoent *pe)
{
char **cp;
-
+
assert(pe != NULL);
-
+
free(pe->p_name);
-
+
for (cp = pe->p_aliases; *cp; ++cp)
free(*cp);
free(pe->p_aliases);
}
-static int
+static int
compare_protoent(struct protoent *pe1, struct protoent *pe2, void *mdata)
{
char **c1, **c2;
-
+
if (pe1 == pe2)
return 0;
-
+
if ((pe1 == NULL) || (pe2 == NULL))
goto errfin;
-
+
if ((strcmp(pe1->p_name, pe2->p_name) != 0) ||
(pe1->p_proto != pe2->p_proto))
goto errfin;
-
+
c1 = pe1->p_aliases;
c2 = pe2->p_aliases;
-
+
if ((pe1->p_aliases == NULL) || (pe2->p_aliases == NULL))
goto errfin;
-
+
for (;*c1 && *c2; ++c1, ++c2)
if (strcmp(*c1, *c2) != 0)
goto errfin;
-
+
if ((*c1 != '\0') || (*c2 != '\0'))
goto errfin;
-
+
return 0;
-
+
errfin:
if ((debug) && (mdata == NULL)) {
printf("following structures are not equal:\n");
@@ -171,14 +171,14 @@ sdump_protoent(struct protoent *pe, char *buffer, size_t buflen)
{
char **cp;
int written;
-
+
written = snprintf(buffer, buflen, "%s %d",
- pe->p_name, pe->p_proto);
+ pe->p_name, pe->p_proto);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (pe->p_aliases != NULL) {
if (*(pe->p_aliases) != '\0') {
for (cp = pe->p_aliases; *cp; ++cp) {
@@ -187,9 +187,9 @@ sdump_protoent(struct protoent *pe, char *buffer, size_t buflen)
if (written > buflen)
return;
buflen -= written;
-
+
if (buflen == 0)
- return;
+ return;
}
} else
snprintf(buffer, buflen, " noaliases");
@@ -206,7 +206,7 @@ protoent_read_snapshot_func(struct protoent *pe, char *line)
if (debug)
printf("1 line read from snapshot:\n%s\n", line);
-
+
i = 0;
sl = NULL;
ps = line;
@@ -230,10 +230,10 @@ protoent_read_snapshot_func(struct protoent *pe, char *line)
if (sl == NULL) {
if (strcmp(s, "(null)") == 0)
return (0);
-
+
sl = sl_init();
assert(sl != NULL);
-
+
if (strcmp(s, "noaliases") != 0) {
ts = strdup(s);
assert(ts != NULL);
@@ -244,7 +244,7 @@ protoent_read_snapshot_func(struct protoent *pe, char *line)
assert(ts != NULL);
sl_add(sl, ts);
}
- break;
+ break;
};
++i;
}
@@ -254,16 +254,16 @@ protoent_read_snapshot_func(struct protoent *pe, char *line)
memset(pe, 0, sizeof(struct protoent));
return (-1);
}
-
+
sl_add(sl, NULL);
pe->p_aliases = sl->sl_str;
/* NOTE: is it a dirty hack or not? */
- free(sl);
+ free(sl);
return (0);
}
-static void
+static void
dump_protoent(struct protoent *result)
{
if (result != NULL) {
@@ -278,7 +278,7 @@ static int
protoent_fill_test_data(struct protoent_test_data *td)
{
struct protoent *pe;
-
+
setprotoent(1);
while ((pe = getprotoent()) != NULL) {
if (protoent_test_correctness(pe, NULL) == 0)
@@ -287,7 +287,7 @@ protoent_fill_test_data(struct protoent_test_data *td)
return (-1);
}
endprotoent();
-
+
return (0);
}
@@ -298,39 +298,39 @@ protoent_test_correctness(struct protoent *pe, void *mdata)
printf("testing correctness with the following data:\n");
dump_protoent(pe);
}
-
+
if (pe == NULL)
goto errfin;
-
+
if (pe->p_name == NULL)
goto errfin;
-
+
if (pe->p_proto < 0)
goto errfin;
-
+
if (pe->p_aliases == NULL)
goto errfin;
-
+
if (debug)
printf("correct\n");
-
- return (0);
+
+ return (0);
errfin:
if (debug)
printf("incorrect\n");
-
+
return (-1);
}
/* protoent_check_ambiguity() is needed when one port+proto is associated with
* more than one peice (these cases are usually marked as PROBLEM in
- * /etc/peices. This functions is needed also when one peice+proto is
+ * /etc/peices. This functions is needed also when one peice+proto is
* associated with several ports. We have to check all the protoent structures
* to make sure that pe really exists and correct */
static int
protoent_check_ambiguity(struct protoent_test_data *td, struct protoent *pe)
{
-
+
return (TEST_DATA_FIND(protoent, td, pe, compare_protoent,
NULL) != NULL ? 0 : -1);
}
@@ -340,7 +340,7 @@ protoent_test_getprotobyname(struct protoent *pe_model, void *mdata)
{
char **alias;
struct protoent *pe;
-
+
if (debug) {
printf("testing getprotobyname() with the following data:\n");
dump_protoent(pe_model);
@@ -349,32 +349,32 @@ protoent_test_getprotobyname(struct protoent *pe_model, void *mdata)
pe = getprotobyname(pe_model->p_name);
if (protoent_test_correctness(pe, NULL) != 0)
goto errfin;
-
+
if ((compare_protoent(pe, pe_model, NULL) != 0) &&
- (protoent_check_ambiguity((struct protoent_test_data *)mdata, pe)
+ (protoent_check_ambiguity((struct protoent_test_data *)mdata, pe)
!=0))
goto errfin;
-
+
for (alias = pe_model->p_aliases; *alias; ++alias) {
pe = getprotobyname(*alias);
-
+
if (protoent_test_correctness(pe, NULL) != 0)
goto errfin;
-
+
if ((compare_protoent(pe, pe_model, NULL) != 0) &&
(protoent_check_ambiguity(
(struct protoent_test_data *)mdata, pe) != 0))
goto errfin;
}
-
+
if (debug)
printf("ok\n");
return (0);
-
+
errfin:
if (debug)
printf("not ok\n");
-
+
return (-1);
}
@@ -382,14 +382,14 @@ static int
protoent_test_getprotobynumber(struct protoent *pe_model, void *mdata)
{
struct protoent *pe;
-
+
if (debug) {
printf("testing getprotobyport() with the following data...\n");
dump_protoent(pe_model);
- }
-
+ }
+
pe = getprotobynumber(pe_model->p_proto);
- if ((protoent_test_correctness(pe, NULL) != 0) ||
+ if ((protoent_test_correctness(pe, NULL) != 0) ||
((compare_protoent(pe, pe_model, NULL) != 0) &&
(protoent_check_ambiguity((struct protoent_test_data *)mdata, pe)
!= 0))) {
@@ -403,7 +403,7 @@ protoent_test_getprotobynumber(struct protoent *pe_model, void *mdata)
}
}
-static int
+static int
protoent_test_getprotoent(struct protoent *pe, void *mdata)
{
/* Only correctness can be checked when doing 1-pass test for
@@ -427,10 +427,10 @@ main(int argc, char **argv)
char *snapshot_file;
int rv;
int c;
-
+
if (argc < 2)
usage();
-
+
snapshot_file = NULL;
while ((c = getopt(argc, argv, "nve2ds:")) != -1)
switch (c) {
@@ -455,18 +455,18 @@ main(int argc, char **argv)
default:
usage();
}
-
+
TEST_DATA_INIT(protoent, &td, clone_protoent, free_protoent);
TEST_DATA_INIT(protoent, &td_snap, clone_protoent, free_protoent);
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT)
method = TEST_BUILD_SNAPSHOT;
else {
if (debug)
printf("can't access the file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -475,12 +475,12 @@ main(int argc, char **argv)
rv = 0;
goto fin;
}
-
+
TEST_SNAPSHOT_FILE_READ(protoent, snapshot_file,
&td_snap, protoent_read_snapshot_func);
}
}
-
+
rv = protoent_fill_test_data(&td);
if (rv == -1)
return (-1);
@@ -490,7 +490,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(protoent, &td,
protoent_test_getprotobyname, (void *)&td);
else
- rv = DO_1PASS_TEST(protoent, &td_snap,
+ rv = DO_1PASS_TEST(protoent, &td_snap,
protoent_test_getprotobyname, (void *)&td_snap);
break;
case TEST_GETPROTOBYNUMBER:
@@ -498,12 +498,12 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(protoent, &td,
protoent_test_getprotobynumber, (void *)&td);
else
- rv = DO_1PASS_TEST(protoent, &td_snap,
+ rv = DO_1PASS_TEST(protoent, &td_snap,
protoent_test_getprotobynumber, (void *)&td_snap);
break;
case TEST_GETPROTOENT:
if (snapshot_file == NULL)
- rv = DO_1PASS_TEST(protoent, &td,
+ rv = DO_1PASS_TEST(protoent, &td,
protoent_test_getprotoent, (void *)&td);
else
rv = DO_2PASS_TEST(protoent, &td, &td_snap,
@@ -520,7 +520,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL)
- rv = TEST_SNAPSHOT_FILE_WRITE(protoent, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(protoent, snapshot_file, &td,
sdump_protoent);
break;
default:
@@ -531,6 +531,6 @@ main(int argc, char **argv)
fin:
TEST_DATA_DESTROY(protoent, &td_snap);
TEST_DATA_DESTROY(protoent, &td);
- free(snapshot_file);
+ free(snapshot_file);
return (rv);
}
diff --git a/tools/regression/lib/libc/nss/test-getpw.c b/tools/regression/lib/libc/nss/test-getpw.c
index bb88f6a..a0b348d 100644
--- a/tools/regression/lib/libc/nss/test-getpw.c
+++ b/tools/regression/lib/libc/nss/test-getpw.c
@@ -68,7 +68,7 @@ static int passwd_test_correctness(struct passwd *, void *);
static int passwd_test_getpwnam(struct passwd *, void *);
static int passwd_test_getpwuid(struct passwd *, void *);
static int passwd_test_getpwent(struct passwd *, void *);
-
+
static void usage(void) __attribute__((__noreturn__));
IMPLEMENT_TEST_DATA(passwd)
@@ -76,12 +76,12 @@ IMPLEMENT_TEST_FILE_SNAPSHOT(passwd)
IMPLEMENT_1PASS_TEST(passwd)
IMPLEMENT_2PASS_TEST(passwd)
-static void
+static void
clone_passwd(struct passwd *dest, struct passwd const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
memcpy(dest, src, sizeof(struct passwd));
if (src->pw_name != NULL)
dest->pw_name = strdup(src->pw_name);
@@ -97,15 +97,15 @@ clone_passwd(struct passwd *dest, struct passwd const *src)
dest->pw_shell = strdup(dest->pw_shell);
}
-static int
+static int
compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata)
{
assert(pwd1 != NULL);
assert(pwd2 != NULL);
-
+
if (pwd1 == pwd2)
return (0);
-
+
if ((pwd1->pw_uid != pwd2->pw_uid) ||
(pwd1->pw_gid != pwd2->pw_gid) ||
(pwd1->pw_change != pwd2->pw_change) ||
@@ -116,14 +116,14 @@ compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata)
(strcmp(pwd1->pw_class, pwd2->pw_class) != 0) ||
(strcmp(pwd1->pw_gecos, pwd2->pw_gecos) != 0) ||
(strcmp(pwd1->pw_dir, pwd2->pw_dir) != 0) ||
- (strcmp(pwd1->pw_shell, pwd2->pw_shell) != 0)
+ (strcmp(pwd1->pw_shell, pwd2->pw_shell) != 0)
)
return (-1);
else
return (0);
}
-static void
+static void
free_passwd(struct passwd *pwd)
{
free(pwd->pw_name);
@@ -134,7 +134,7 @@ free_passwd(struct passwd *pwd)
free(pwd->pw_shell);
}
-static void
+static void
sdump_passwd(struct passwd *pwd, char *buffer, size_t buflen)
{
snprintf(buffer, buflen, "%s:%s:%d:%d:%d:%s:%s:%s:%s:%d:%d",
@@ -154,7 +154,7 @@ dump_passwd(struct passwd *pwd)
printf("(null)\n");
}
-static int
+static int
passwd_read_snapshot_func(struct passwd *pwd, char *line)
{
char *s, *ps, *ts;
@@ -162,7 +162,7 @@ passwd_read_snapshot_func(struct passwd *pwd, char *line)
if (debug)
printf("1 line read from snapshot:\n%s\n", line);
-
+
i = 0;
ps = line;
memset(pwd, 0, sizeof(struct passwd));
@@ -174,7 +174,7 @@ passwd_read_snapshot_func(struct passwd *pwd, char *line)
break;
case 1:
pwd->pw_passwd = strdup(s);
- assert(pwd->pw_passwd != NULL);
+ assert(pwd->pw_passwd != NULL);
break;
case 2:
pwd->pw_uid = (uid_t)strtol(s, &ts, 10);
@@ -218,7 +218,7 @@ passwd_read_snapshot_func(struct passwd *pwd, char *line)
goto fin;
break;
default:
- break;
+ break;
};
++i;
}
@@ -229,7 +229,7 @@ fin:
memset(pwd, 0, sizeof(struct passwd));
return (-1);
}
-
+
return (0);
}
@@ -237,7 +237,7 @@ static int
passwd_fill_test_data(struct passwd_test_data *td)
{
struct passwd *pwd;
-
+
setpassent(1);
while ((pwd = getpwent()) != NULL) {
if (passwd_test_correctness(pwd, NULL) == 0)
@@ -246,7 +246,7 @@ passwd_fill_test_data(struct passwd_test_data *td)
return (-1);
}
endpwent();
-
+
return (0);
}
@@ -257,9 +257,9 @@ passwd_test_correctness(struct passwd *pwd, void *mdata)
printf("testing correctness with the following data:\n");
dump_passwd(pwd);
}
-
+
if (pwd == NULL)
- return (-1);
+ return (-1);
if (pwd->pw_name == NULL)
goto errfin;
@@ -278,25 +278,25 @@ passwd_test_correctness(struct passwd *pwd, void *mdata)
if (pwd->pw_shell == NULL)
goto errfin;
-
+
if (debug)
printf("correct\n");
-
- return (0);
+
+ return (0);
errfin:
if (debug)
printf("incorrect\n");
-
+
return (-1);
}
/* passwd_check_ambiguity() is needed here because when doing the getpwent()
- * calls sequence, records from different nsswitch sources can be different,
+ * calls sequence, records from different nsswitch sources can be different,
* though having the same pw_name/pw_uid */
static int
passwd_check_ambiguity(struct passwd_test_data *td, struct passwd *pwd)
{
-
+
return (TEST_DATA_FIND(passwd, td, pwd, compare_passwd,
NULL) != NULL ? 0 : -1);
}
@@ -305,7 +305,7 @@ static int
passwd_test_getpwnam(struct passwd *pwd_model, void *mdata)
{
struct passwd *pwd;
-
+
if (debug) {
printf("testing getpwnam() with the following data:\n");
dump_passwd(pwd_model);
@@ -314,20 +314,20 @@ passwd_test_getpwnam(struct passwd *pwd_model, void *mdata)
pwd = getpwnam(pwd_model->pw_name);
if (passwd_test_correctness(pwd, NULL) != 0)
goto errfin;
-
+
if ((compare_passwd(pwd, pwd_model, NULL) != 0) &&
- (passwd_check_ambiguity((struct passwd_test_data *)mdata, pwd)
+ (passwd_check_ambiguity((struct passwd_test_data *)mdata, pwd)
!=0))
goto errfin;
-
+
if (debug)
printf("ok\n");
return (0);
-
+
errfin:
if (debug)
printf("not ok\n");
-
+
return (-1);
}
@@ -335,14 +335,14 @@ static int
passwd_test_getpwuid(struct passwd *pwd_model, void *mdata)
{
struct passwd *pwd;
-
+
if (debug) {
printf("testing getpwuid() with the following data...\n");
dump_passwd(pwd_model);
- }
-
+ }
+
pwd = getpwuid(pwd_model->pw_uid);
- if ((passwd_test_correctness(pwd, NULL) != 0) ||
+ if ((passwd_test_correctness(pwd, NULL) != 0) ||
((compare_passwd(pwd, pwd_model, NULL) != 0) &&
(passwd_check_ambiguity((struct passwd_test_data *)mdata, pwd)
!= 0))) {
@@ -356,7 +356,7 @@ passwd_test_getpwuid(struct passwd *pwd_model, void *mdata)
}
}
-static int
+static int
passwd_test_getpwent(struct passwd *pwd, void *mdata)
{
/* Only correctness can be checked when doing 1-pass test for
@@ -380,10 +380,10 @@ main(int argc, char **argv)
char *snapshot_file;
int rv;
int c;
-
+
if (argc < 2)
usage();
-
+
snapshot_file = NULL;
while ((c = getopt(argc, argv, "nue2ds:")) != -1)
switch (c) {
@@ -408,18 +408,18 @@ main(int argc, char **argv)
default:
usage();
}
-
+
TEST_DATA_INIT(passwd, &td, clone_passwd, free_passwd);
TEST_DATA_INIT(passwd, &td_snap, clone_passwd, free_passwd);
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT)
method = TEST_BUILD_SNAPSHOT;
else {
if (debug)
printf("can't access the file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -428,23 +428,23 @@ main(int argc, char **argv)
rv = 0;
goto fin;
}
-
+
TEST_SNAPSHOT_FILE_READ(passwd, snapshot_file,
&td_snap, passwd_read_snapshot_func);
}
}
-
+
rv = passwd_fill_test_data(&td);
if (rv == -1)
return (-1);
-
+
switch (method) {
case TEST_GETPWNAM:
if (snapshot_file == NULL)
rv = DO_1PASS_TEST(passwd, &td,
passwd_test_getpwnam, (void *)&td);
else
- rv = DO_1PASS_TEST(passwd, &td_snap,
+ rv = DO_1PASS_TEST(passwd, &td_snap,
passwd_test_getpwnam, (void *)&td_snap);
break;
case TEST_GETPWUID:
@@ -452,7 +452,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(passwd, &td,
passwd_test_getpwuid, (void *)&td);
else
- rv = DO_1PASS_TEST(passwd, &td_snap,
+ rv = DO_1PASS_TEST(passwd, &td_snap,
passwd_test_getpwuid, (void *)&td_snap);
break;
case TEST_GETPWENT:
@@ -465,7 +465,7 @@ main(int argc, char **argv)
break;
case TEST_GETPWENT_2PASS:
TEST_DATA_INIT(passwd, &td_2pass, clone_passwd, free_passwd);
- rv = passwd_fill_test_data(&td_2pass);
+ rv = passwd_fill_test_data(&td_2pass);
if (rv != -1)
rv = DO_2PASS_TEST(passwd, &td, &td_2pass,
compare_passwd, NULL);
@@ -473,7 +473,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL)
- rv = TEST_SNAPSHOT_FILE_WRITE(passwd, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(passwd, snapshot_file, &td,
sdump_passwd);
break;
default:
@@ -484,6 +484,6 @@ main(int argc, char **argv)
fin:
TEST_DATA_DESTROY(passwd, &td_snap);
TEST_DATA_DESTROY(passwd, &td);
- free(snapshot_file);
+ free(snapshot_file);
return (rv);
}
diff --git a/tools/regression/lib/libc/nss/test-getrpc.c b/tools/regression/lib/libc/nss/test-getrpc.c
index 4041e88..707186e 100644
--- a/tools/regression/lib/libc/nss/test-getrpc.c
+++ b/tools/regression/lib/libc/nss/test-getrpc.c
@@ -63,14 +63,14 @@ static void free_rpcent(struct rpcent *);
static void sdump_rpcent(struct rpcent *, char *, size_t);
static int rpcent_read_snapshot_func(struct rpcent *, char *);
-static int rpcent_check_ambiguity(struct rpcent_test_data *,
+static int rpcent_check_ambiguity(struct rpcent_test_data *,
struct rpcent *);
static int rpcent_fill_test_data(struct rpcent_test_data *);
static int rpcent_test_correctness(struct rpcent *, void *);
static int rpcent_test_getrpcbyname(struct rpcent *, void *);
static int rpcent_test_getrpcbynumber(struct rpcent *, void *);
static int rpcent_test_getrpcent(struct rpcent *, void *);
-
+
static void usage(void) __attribute__((__noreturn__));
IMPLEMENT_TEST_DATA(rpcent)
@@ -83,28 +83,28 @@ clone_rpcent(struct rpcent *dest, struct rpcent const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
char **cp;
int aliases_num;
-
+
memset(dest, 0, sizeof(struct rpcent));
-
+
if (src->r_name != NULL) {
dest->r_name = strdup(src->r_name);
assert(dest->r_name != NULL);
}
-
+
dest->r_number = src->r_number;
-
+
if (src->r_aliases != NULL) {
aliases_num = 0;
for (cp = src->r_aliases; *cp; ++cp)
++aliases_num;
-
+
dest->r_aliases = (char **)malloc((aliases_num+1) * (sizeof(char *)));
assert(dest->r_aliases != NULL);
memset(dest->r_aliases, 0, (aliases_num+1) * (sizeof(char *)));
-
+
for (cp = src->r_aliases; *cp; ++cp) {
dest->r_aliases[cp - src->r_aliases] = strdup(*cp);
assert(dest->r_aliases[cp - src->r_aliases] != NULL);
@@ -112,50 +112,50 @@ clone_rpcent(struct rpcent *dest, struct rpcent const *src)
}
}
-static void
+static void
free_rpcent(struct rpcent *rpc)
{
char **cp;
-
+
assert(rpc != NULL);
-
+
free(rpc->r_name);
-
+
for (cp = rpc->r_aliases; *cp; ++cp)
free(*cp);
free(rpc->r_aliases);
}
-static int
+static int
compare_rpcent(struct rpcent *rpc1, struct rpcent *rpc2, void *mdata)
{
char **c1, **c2;
-
+
if (rpc1 == rpc2)
return 0;
-
+
if ((rpc1 == NULL) || (rpc2 == NULL))
goto errfin;
-
+
if ((strcmp(rpc1->r_name, rpc2->r_name) != 0) ||
(rpc1->r_number != rpc2->r_number))
goto errfin;
-
+
c1 = rpc1->r_aliases;
c2 = rpc2->r_aliases;
-
+
if ((rpc1->r_aliases == NULL) || (rpc2->r_aliases == NULL))
goto errfin;
-
+
for (;*c1 && *c2; ++c1, ++c2)
if (strcmp(*c1, *c2) != 0)
goto errfin;
-
+
if ((*c1 != '\0') || (*c2 != '\0'))
goto errfin;
-
+
return 0;
-
+
errfin:
if ((debug) && (mdata == NULL)) {
printf("following structures are not equal:\n");
@@ -171,14 +171,14 @@ sdump_rpcent(struct rpcent *rpc, char *buffer, size_t buflen)
{
char **cp;
int written;
-
+
written = snprintf(buffer, buflen, "%s %d",
- rpc->r_name, rpc->r_number);
+ rpc->r_name, rpc->r_number);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (rpc->r_aliases != NULL) {
if (*(rpc->r_aliases) != '\0') {
for (cp = rpc->r_aliases; *cp; ++cp) {
@@ -187,9 +187,9 @@ sdump_rpcent(struct rpcent *rpc, char *buffer, size_t buflen)
if (written > buflen)
return;
buflen -= written;
-
+
if (buflen == 0)
- return;
+ return;
}
} else
snprintf(buffer, buflen, " noaliases");
@@ -206,7 +206,7 @@ rpcent_read_snapshot_func(struct rpcent *rpc, char *line)
if (debug)
printf("1 line read from snapshot:\n%s\n", line);
-
+
i = 0;
sl = NULL;
ps = line;
@@ -230,10 +230,10 @@ rpcent_read_snapshot_func(struct rpcent *rpc, char *line)
if (sl == NULL) {
if (strcmp(s, "(null)") == 0)
return (0);
-
+
sl = sl_init();
assert(sl != NULL);
-
+
if (strcmp(s, "noaliases") != 0) {
ts = strdup(s);
assert(ts != NULL);
@@ -244,7 +244,7 @@ rpcent_read_snapshot_func(struct rpcent *rpc, char *line)
assert(ts != NULL);
sl_add(sl, ts);
}
- break;
+ break;
};
++i;
}
@@ -254,16 +254,16 @@ rpcent_read_snapshot_func(struct rpcent *rpc, char *line)
memset(rpc, 0, sizeof(struct rpcent));
return (-1);
}
-
+
sl_add(sl, NULL);
rpc->r_aliases = sl->sl_str;
/* NOTE: is it a dirty hack or not? */
- free(sl);
+ free(sl);
return (0);
}
-static void
+static void
dump_rpcent(struct rpcent *result)
{
if (result != NULL) {
@@ -278,7 +278,7 @@ static int
rpcent_fill_test_data(struct rpcent_test_data *td)
{
struct rpcent *rpc;
-
+
setrpcent(1);
while ((rpc = getrpcent()) != NULL) {
if (rpcent_test_correctness(rpc, NULL) == 0)
@@ -287,7 +287,7 @@ rpcent_fill_test_data(struct rpcent_test_data *td)
return (-1);
}
endrpcent();
-
+
return (0);
}
@@ -298,39 +298,39 @@ rpcent_test_correctness(struct rpcent *rpc, void *mdata)
printf("testing correctness with the following data:\n");
dump_rpcent(rpc);
}
-
+
if (rpc == NULL)
goto errfin;
-
+
if (rpc->r_name == NULL)
goto errfin;
-
+
if (rpc->r_number < 0)
goto errfin;
-
+
if (rpc->r_aliases == NULL)
goto errfin;
-
+
if (debug)
printf("correct\n");
-
- return (0);
+
+ return (0);
errfin:
if (debug)
printf("incorrect\n");
-
+
return (-1);
}
/* rpcent_check_ambiguity() is needed when one port+rpc is associated with
* more than one peice (these cases are usually marked as PROBLEM in
- * /etc/peices. This functions is needed also when one peice+rpc is
+ * /etc/peices. This functions is needed also when one peice+rpc is
* associated with several ports. We have to check all the rpcent structures
* to make sure that rpc really exists and correct */
static int
rpcent_check_ambiguity(struct rpcent_test_data *td, struct rpcent *rpc)
{
-
+
return (TEST_DATA_FIND(rpcent, td, rpc, compare_rpcent,
NULL) != NULL ? 0 : -1);
}
@@ -340,7 +340,7 @@ rpcent_test_getrpcbyname(struct rpcent *rpc_model, void *mdata)
{
char **alias;
struct rpcent *rpc;
-
+
if (debug) {
printf("testing getrpcbyname() with the following data:\n");
dump_rpcent(rpc_model);
@@ -349,32 +349,32 @@ rpcent_test_getrpcbyname(struct rpcent *rpc_model, void *mdata)
rpc = getrpcbyname(rpc_model->r_name);
if (rpcent_test_correctness(rpc, NULL) != 0)
goto errfin;
-
+
if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
- (rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
+ (rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
!=0))
goto errfin;
-
+
for (alias = rpc_model->r_aliases; *alias; ++alias) {
rpc = getrpcbyname(*alias);
-
+
if (rpcent_test_correctness(rpc, NULL) != 0)
goto errfin;
-
+
if ((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
(rpcent_check_ambiguity(
(struct rpcent_test_data *)mdata, rpc) != 0))
goto errfin;
}
-
+
if (debug)
printf("ok\n");
return (0);
-
+
errfin:
if (debug)
printf("not ok\n");
-
+
return (-1);
}
@@ -382,14 +382,14 @@ static int
rpcent_test_getrpcbynumber(struct rpcent *rpc_model, void *mdata)
{
struct rpcent *rpc;
-
+
if (debug) {
printf("testing getrpcbyport() with the following data...\n");
dump_rpcent(rpc_model);
- }
-
+ }
+
rpc = getrpcbynumber(rpc_model->r_number);
- if ((rpcent_test_correctness(rpc, NULL) != 0) ||
+ if ((rpcent_test_correctness(rpc, NULL) != 0) ||
((compare_rpcent(rpc, rpc_model, NULL) != 0) &&
(rpcent_check_ambiguity((struct rpcent_test_data *)mdata, rpc)
!= 0))) {
@@ -403,7 +403,7 @@ rpcent_test_getrpcbynumber(struct rpcent *rpc_model, void *mdata)
}
}
-static int
+static int
rpcent_test_getrpcent(struct rpcent *rpc, void *mdata)
{
/* Only correctness can be checked when doing 1-pass test for
@@ -427,10 +427,10 @@ main(int argc, char **argv)
char *snapshot_file;
int rv;
int c;
-
+
if (argc < 2)
usage();
-
+
snapshot_file = NULL;
while ((c = getopt(argc, argv, "nve2ds:")) != -1)
switch (c) {
@@ -455,18 +455,18 @@ main(int argc, char **argv)
default:
usage();
}
-
+
TEST_DATA_INIT(rpcent, &td, clone_rpcent, free_rpcent);
TEST_DATA_INIT(rpcent, &td_snap, clone_rpcent, free_rpcent);
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT)
method = TEST_BUILD_SNAPSHOT;
else {
if (debug)
printf("can't access the file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -475,12 +475,12 @@ main(int argc, char **argv)
rv = 0;
goto fin;
}
-
+
TEST_SNAPSHOT_FILE_READ(rpcent, snapshot_file,
&td_snap, rpcent_read_snapshot_func);
}
}
-
+
rv = rpcent_fill_test_data(&td);
if (rv == -1)
return (-1);
@@ -490,7 +490,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(rpcent, &td,
rpcent_test_getrpcbyname, (void *)&td);
else
- rv = DO_1PASS_TEST(rpcent, &td_snap,
+ rv = DO_1PASS_TEST(rpcent, &td_snap,
rpcent_test_getrpcbyname, (void *)&td_snap);
break;
case TEST_GETRPCBYNUMBER:
@@ -498,7 +498,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(rpcent, &td,
rpcent_test_getrpcbynumber, (void *)&td);
else
- rv = DO_1PASS_TEST(rpcent, &td_snap,
+ rv = DO_1PASS_TEST(rpcent, &td_snap,
rpcent_test_getrpcbynumber, (void *)&td_snap);
break;
case TEST_GETRPCENT:
@@ -511,7 +511,7 @@ main(int argc, char **argv)
break;
case TEST_GETRPCENT_2PASS:
TEST_DATA_INIT(rpcent, &td_2pass, clone_rpcent, free_rpcent);
- rv = rpcent_fill_test_data(&td_2pass);
+ rv = rpcent_fill_test_data(&td_2pass);
if (rv != -1)
rv = DO_2PASS_TEST(rpcent, &td, &td_2pass,
compare_rpcent, NULL);
@@ -519,7 +519,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL)
- rv = TEST_SNAPSHOT_FILE_WRITE(rpcent, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(rpcent, snapshot_file, &td,
sdump_rpcent);
break;
default:
@@ -530,6 +530,6 @@ main(int argc, char **argv)
fin:
TEST_DATA_DESTROY(rpcent, &td_snap);
TEST_DATA_DESTROY(rpcent, &td);
- free(snapshot_file);
+ free(snapshot_file);
return (rv);
}
diff --git a/tools/regression/lib/libc/nss/test-getserv.c b/tools/regression/lib/libc/nss/test-getserv.c
index 79d42f0..31e4700 100644
--- a/tools/regression/lib/libc/nss/test-getserv.c
+++ b/tools/regression/lib/libc/nss/test-getserv.c
@@ -63,14 +63,14 @@ static void free_servent(struct servent *);
static void sdump_servent(struct servent *, char *, size_t);
static int servent_read_snapshot_func(struct servent *, char *);
-static int servent_check_ambiguity(struct servent_test_data *,
+static int servent_check_ambiguity(struct servent_test_data *,
struct servent *);
static int servent_fill_test_data(struct servent_test_data *);
static int servent_test_correctness(struct servent *, void *);
static int servent_test_getservbyname(struct servent *, void *);
static int servent_test_getservbyport(struct servent *, void *);
static int servent_test_getservent(struct servent *, void *);
-
+
static void usage(void) __attribute__((__noreturn__));
IMPLEMENT_TEST_DATA(servent)
@@ -83,32 +83,32 @@ clone_servent(struct servent *dest, struct servent const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
char **cp;
int aliases_num;
-
+
memset(dest, 0, sizeof(struct servent));
-
+
if (src->s_name != NULL) {
dest->s_name = strdup(src->s_name);
assert(dest->s_name != NULL);
}
-
+
if (src->s_proto != NULL) {
dest->s_proto = strdup(src->s_proto);
assert(dest->s_proto != NULL);
}
dest->s_port = src->s_port;
-
+
if (src->s_aliases != NULL) {
aliases_num = 0;
for (cp = src->s_aliases; *cp; ++cp)
++aliases_num;
-
+
dest->s_aliases = (char **)malloc((aliases_num+1) * (sizeof(char *)));
assert(dest->s_aliases != NULL);
memset(dest->s_aliases, 0, (aliases_num+1) * (sizeof(char *)));
-
+
for (cp = src->s_aliases; *cp; ++cp) {
dest->s_aliases[cp - src->s_aliases] = strdup(*cp);
assert(dest->s_aliases[cp - src->s_aliases] != NULL);
@@ -116,52 +116,52 @@ clone_servent(struct servent *dest, struct servent const *src)
}
}
-static void
+static void
free_servent(struct servent *serv)
{
char **cp;
-
+
assert(serv != NULL);
-
+
free(serv->s_name);
free(serv->s_proto);
-
+
for (cp = serv->s_aliases; *cp; ++cp)
free(*cp);
free(serv->s_aliases);
}
-static int
+static int
compare_servent(struct servent *serv1, struct servent *serv2, void *mdata)
{
char **c1, **c2;
-
+
if (serv1 == serv2)
return 0;
-
+
if ((serv1 == NULL) || (serv2 == NULL))
goto errfin;
-
+
if ((strcmp(serv1->s_name, serv2->s_name) != 0) ||
(strcmp(serv1->s_proto, serv2->s_proto) != 0) ||
(serv1->s_port != serv2->s_port))
goto errfin;
-
+
c1 = serv1->s_aliases;
c2 = serv2->s_aliases;
-
+
if ((serv1->s_aliases == NULL) || (serv2->s_aliases == NULL))
goto errfin;
-
+
for (;*c1 && *c2; ++c1, ++c2)
if (strcmp(*c1, *c2) != 0)
goto errfin;
-
+
if ((*c1 != '\0') || (*c2 != '\0'))
goto errfin;
-
+
return 0;
-
+
errfin:
if ((debug) && (mdata == NULL)) {
printf("following structures are not equal:\n");
@@ -177,14 +177,14 @@ sdump_servent(struct servent *serv, char *buffer, size_t buflen)
{
char **cp;
int written;
-
+
written = snprintf(buffer, buflen, "%s %d %s",
- serv->s_name, ntohs(serv->s_port), serv->s_proto);
+ serv->s_name, ntohs(serv->s_port), serv->s_proto);
buffer += written;
if (written > buflen)
return;
buflen -= written;
-
+
if (serv->s_aliases != NULL) {
if (*(serv->s_aliases) != '\0') {
for (cp = serv->s_aliases; *cp; ++cp) {
@@ -193,9 +193,9 @@ sdump_servent(struct servent *serv, char *buffer, size_t buflen)
if (written > buflen)
return;
buflen -= written;
-
+
if (buflen == 0)
- return;
+ return;
}
} else
snprintf(buffer, buflen, " noaliases");
@@ -212,7 +212,7 @@ servent_read_snapshot_func(struct servent *serv, char *line)
if (debug)
printf("1 line read from snapshot:\n%s\n", line);
-
+
i = 0;
sl = NULL;
ps = line;
@@ -242,10 +242,10 @@ servent_read_snapshot_func(struct servent *serv, char *line)
if (sl == NULL) {
if (strcmp(s, "(null)") == 0)
return (0);
-
+
sl = sl_init();
assert(sl != NULL);
-
+
if (strcmp(s, "noaliases") != 0) {
ts = strdup(s);
assert(ts != NULL);
@@ -256,7 +256,7 @@ servent_read_snapshot_func(struct servent *serv, char *line)
assert(ts != NULL);
sl_add(sl, ts);
}
- break;
+ break;
};
++i;
}
@@ -267,16 +267,16 @@ servent_read_snapshot_func(struct servent *serv, char *line)
memset(serv, 0, sizeof(struct servent));
return (-1);
}
-
+
sl_add(sl, NULL);
serv->s_aliases = sl->sl_str;
/* NOTE: is it a dirty hack or not? */
- free(sl);
+ free(sl);
return (0);
}
-static void
+static void
dump_servent(struct servent *result)
{
if (result != NULL) {
@@ -291,7 +291,7 @@ static int
servent_fill_test_data(struct servent_test_data *td)
{
struct servent *serv;
-
+
setservent(1);
while ((serv = getservent()) != NULL) {
if (servent_test_correctness(serv, NULL) == 0)
@@ -300,7 +300,7 @@ servent_fill_test_data(struct servent_test_data *td)
return (-1);
}
endservent();
-
+
return (0);
}
@@ -311,42 +311,42 @@ servent_test_correctness(struct servent *serv, void *mdata)
printf("testing correctness with the following data:\n");
dump_servent(serv);
}
-
+
if (serv == NULL)
goto errfin;
-
+
if (serv->s_name == NULL)
goto errfin;
-
+
if (serv->s_proto == NULL)
goto errfin;
-
+
if (ntohs(serv->s_port < 0))
goto errfin;
-
+
if (serv->s_aliases == NULL)
goto errfin;
-
+
if (debug)
printf("correct\n");
-
- return (0);
+
+ return (0);
errfin:
if (debug)
printf("incorrect\n");
-
+
return (-1);
}
/* servent_check_ambiguity() is needed when one port+proto is associated with
* more than one service (these cases are usually marked as PROBLEM in
- * /etc/services. This functions is needed also when one service+proto is
+ * /etc/services. This functions is needed also when one service+proto is
* associated with several ports. We have to check all the servent structures
* to make sure that serv really exists and correct */
static int
servent_check_ambiguity(struct servent_test_data *td, struct servent *serv)
{
-
+
return (TEST_DATA_FIND(servent, td, serv, compare_servent,
NULL) != NULL ? 0 : -1);
}
@@ -356,7 +356,7 @@ servent_test_getservbyname(struct servent *serv_model, void *mdata)
{
char **alias;
struct servent *serv;
-
+
if (debug) {
printf("testing getservbyname() with the following data:\n");
dump_servent(serv_model);
@@ -365,32 +365,32 @@ servent_test_getservbyname(struct servent *serv_model, void *mdata)
serv = getservbyname(serv_model->s_name, serv_model->s_proto);
if (servent_test_correctness(serv, NULL) != 0)
goto errfin;
-
+
if ((compare_servent(serv, serv_model, NULL) != 0) &&
- (servent_check_ambiguity((struct servent_test_data *)mdata, serv)
+ (servent_check_ambiguity((struct servent_test_data *)mdata, serv)
!=0))
goto errfin;
-
+
for (alias = serv_model->s_aliases; *alias; ++alias) {
serv = getservbyname(*alias, serv_model->s_proto);
-
+
if (servent_test_correctness(serv, NULL) != 0)
goto errfin;
-
+
if ((compare_servent(serv, serv_model, NULL) != 0) &&
(servent_check_ambiguity(
(struct servent_test_data *)mdata, serv) != 0))
goto errfin;
}
-
+
if (debug)
printf("ok\n");
return (0);
-
+
errfin:
if (debug)
printf("not ok\n");
-
+
return (-1);
}
@@ -398,14 +398,14 @@ static int
servent_test_getservbyport(struct servent *serv_model, void *mdata)
{
struct servent *serv;
-
+
if (debug) {
printf("testing getservbyport() with the following data...\n");
dump_servent(serv_model);
- }
-
+ }
+
serv = getservbyport(serv_model->s_port, serv_model->s_proto);
- if ((servent_test_correctness(serv, NULL) != 0) ||
+ if ((servent_test_correctness(serv, NULL) != 0) ||
((compare_servent(serv, serv_model, NULL) != 0) &&
(servent_check_ambiguity((struct servent_test_data *)mdata, serv)
!= 0))) {
@@ -419,7 +419,7 @@ servent_test_getservbyport(struct servent *serv_model, void *mdata)
}
}
-static int
+static int
servent_test_getservent(struct servent *serv, void *mdata)
{
/* Only correctness can be checked when doing 1-pass test for
@@ -443,10 +443,10 @@ main(int argc, char **argv)
char *snapshot_file;
int rv;
int c;
-
+
if (argc < 2)
usage();
-
+
snapshot_file = NULL;
while ((c = getopt(argc, argv, "npe2ds:")) != -1)
switch (c) {
@@ -471,18 +471,18 @@ main(int argc, char **argv)
default:
usage();
}
-
+
TEST_DATA_INIT(servent, &td, clone_servent, free_servent);
TEST_DATA_INIT(servent, &td_snap, clone_servent, free_servent);
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT)
method = TEST_BUILD_SNAPSHOT;
else {
if (debug)
printf("can't access the file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -491,12 +491,12 @@ main(int argc, char **argv)
rv = 0;
goto fin;
}
-
+
TEST_SNAPSHOT_FILE_READ(servent, snapshot_file,
&td_snap, servent_read_snapshot_func);
}
}
-
+
rv = servent_fill_test_data(&td);
if (rv == -1)
return (-1);
@@ -506,7 +506,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(servent, &td,
servent_test_getservbyname, (void *)&td);
else
- rv = DO_1PASS_TEST(servent, &td_snap,
+ rv = DO_1PASS_TEST(servent, &td_snap,
servent_test_getservbyname, (void *)&td_snap);
break;
case TEST_GETSERVBYPORT:
@@ -514,7 +514,7 @@ main(int argc, char **argv)
rv = DO_1PASS_TEST(servent, &td,
servent_test_getservbyport, (void *)&td);
else
- rv = DO_1PASS_TEST(servent, &td_snap,
+ rv = DO_1PASS_TEST(servent, &td_snap,
servent_test_getservbyport, (void *)&td_snap);
break;
case TEST_GETSERVENT:
@@ -527,7 +527,7 @@ main(int argc, char **argv)
break;
case TEST_GETSERVENT_2PASS:
TEST_DATA_INIT(servent, &td_2pass, clone_servent, free_servent);
- rv = servent_fill_test_data(&td_2pass);
+ rv = servent_fill_test_data(&td_2pass);
if (rv != -1)
rv = DO_2PASS_TEST(servent, &td, &td_2pass,
compare_servent, NULL);
@@ -535,7 +535,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL)
- rv = TEST_SNAPSHOT_FILE_WRITE(servent, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(servent, snapshot_file, &td,
sdump_servent);
break;
default:
@@ -546,6 +546,6 @@ main(int argc, char **argv)
fin:
TEST_DATA_DESTROY(servent, &td_snap);
TEST_DATA_DESTROY(servent, &td);
- free(snapshot_file);
+ free(snapshot_file);
return (rv);
}
diff --git a/tools/regression/lib/libc/nss/test-getusershell.c b/tools/regression/lib/libc/nss/test-getusershell.c
index 8682591..b7b835f 100644
--- a/tools/regression/lib/libc/nss/test-getusershell.c
+++ b/tools/regression/lib/libc/nss/test-getusershell.c
@@ -67,29 +67,29 @@ IMPLEMENT_TEST_DATA(usershell)
IMPLEMENT_TEST_FILE_SNAPSHOT(usershell)
IMPLEMENT_2PASS_TEST(usershell)
-static void
+static void
clone_usershell(struct usershell *dest, struct usershell const *src)
{
assert(dest != NULL);
assert(src != NULL);
-
+
if (src->path != NULL) {
dest->path = strdup(src->path);
assert(dest->path != NULL);
}
}
-static int
+static int
compare_usershell(struct usershell *us1, struct usershell *us2, void *mdata)
{
int rv;
-
+
assert(us1 != NULL);
assert(us2 != NULL);
-
+
dump_usershell(us1);
dump_usershell(us2);
-
+
if (us1 == us2)
return (0);
@@ -99,17 +99,17 @@ compare_usershell(struct usershell *us1, struct usershell *us2, void *mdata)
dump_usershell(us1);
dump_usershell(us2);
}
-
+
return (rv);
}
-static void
+static void
free_usershell(struct usershell *us)
{
free(us->path);
}
-static void
+static void
sdump_usershell(struct usershell *us, char *buffer, size_t buflen)
{
snprintf(buffer, buflen, "%s", us->path);
@@ -126,12 +126,12 @@ dump_usershell(struct usershell *us)
printf("(null)\n");
}
-static int
+static int
usershell_read_snapshot_func(struct usershell *us, char *line)
{
us->path = strdup(line);
assert(us->path != NULL);
-
+
return (0);
}
@@ -152,7 +152,7 @@ main(int argc, char **argv)
char *snapshot_file;
int rv;
int c;
-
+
if (argc < 2)
usage();
@@ -170,10 +170,10 @@ main(int argc, char **argv)
usage();
}
}
-
+
TEST_DATA_INIT(usershell, &td, clone_usershell, free_usershell);
TEST_DATA_INIT(usershell, &td_snap, clone_usershell, free_usershell);
-
+
setusershell();
while ((ushell.path = getusershell()) != NULL) {
if (debug) {
@@ -183,17 +183,17 @@ main(int argc, char **argv)
TEST_DATA_APPEND(usershell, &td, &ushell);
}
endusershell();
-
-
+
+
if (snapshot_file != NULL) {
- if (access(snapshot_file, W_OK | R_OK) != 0) {
+ if (access(snapshot_file, W_OK | R_OK) != 0) {
if (errno == ENOENT)
method = TEST_BUILD_SNAPSHOT;
else {
if (debug)
printf("can't access the snapshot file %s\n",
snapshot_file);
-
+
rv = -1;
goto fin;
}
@@ -207,7 +207,7 @@ main(int argc, char **argv)
}
}
}
-
+
switch (method) {
case TEST_GETUSERSHELL:
if (snapshot_file != NULL) {
@@ -217,7 +217,7 @@ main(int argc, char **argv)
break;
case TEST_BUILD_SNAPSHOT:
if (snapshot_file != NULL) {
- rv = TEST_SNAPSHOT_FILE_WRITE(usershell, snapshot_file, &td,
+ rv = TEST_SNAPSHOT_FILE_WRITE(usershell, snapshot_file, &td,
sdump_usershell);
}
break;
diff --git a/tools/regression/lib/libc/nss/testutil.h b/tools/regression/lib/libc/nss/testutil.h
index acd69ac..711c49f 100644
--- a/tools/regression/lib/libc/nss/testutil.h
+++ b/tools/regression/lib/libc/nss/testutil.h
@@ -53,8 +53,8 @@ int __##ent##_test_data_compare(struct ent##_test_data *, \
void *), void *); \
struct ent *__##ent##_test_data_find(struct ent##_test_data *, struct ent *,\
int (*)(struct ent *, struct ent *, void *), void *); \
-void __##ent##_test_data_clear(struct ent##_test_data *);
-
+void __##ent##_test_data_clear(struct ent##_test_data *);
+
#define TEST_DATA_INIT(ent, td, clonef, freef)\
__##ent##_test_data_init(td, clonef, freef)
#define TEST_DATA_DESTROY(ent, td) __##ent##_test_data_destroy(td)
@@ -191,9 +191,8 @@ __##ent##_test_data_clear(struct ent##_test_data *td) \
td->free_func(&e->data); \
free(e); \
} \
-}
+}
- \
#define DECLARE_TEST_FILE_SNAPSHOT(ent) \
struct ent##_snp_param { \
FILE *fp; \
@@ -204,8 +203,8 @@ int __##ent##_snapshot_write_func(struct ent *, void *); \
int __##ent##_snapshot_write(char const *, struct ent##_test_data *, \
void (*)(struct ent *, char *, size_t)); \
int __##ent##_snapshot_read(char const *, struct ent##_test_data *, \
- int (*)(struct ent *, char *));
-
+ int (*)(struct ent *, char *));
+
#define TEST_SNAPSHOT_FILE_WRITE(ent, fname, td, f) \
__##ent##_snapshot_write(fname, td, f)
#define TEST_SNAPSHOT_FILE_READ(ent, fname, td, f) \
@@ -294,8 +293,8 @@ fin: \
#define DECLARE_1PASS_TEST(ent) \
int __##ent##_1pass_test(struct ent##_test_data *, \
int (*)(struct ent *, void *), \
- void *);
-
+ void *);
+
#define DO_1PASS_TEST(ent, td, f, mdata) \
__##ent##_1pass_test(td, f, mdata)
@@ -318,7 +317,7 @@ int __##ent##_2pass_test(struct ent##_test_data *, \
#define DO_2PASS_TEST(ent, td1, td2, f, mdata) \
__##ent##_2pass_test(td1, td2, f, mdata)
-
+
#define IMPLEMENT_2PASS_TEST(ent) \
int \
__##ent##_2pass_test(struct ent##_test_data *td1, \
diff --git a/tools/regression/lib/libc/resolv/Makefile b/tools/regression/lib/libc/resolv/Makefile
index fa91ac3..18a71bc 100644
--- a/tools/regression/lib/libc/resolv/Makefile
+++ b/tools/regression/lib/libc/resolv/Makefile
@@ -6,8 +6,7 @@ MAN=
# Note: this test relies on being dynamically linked. You will get a
# spurious PASS for a statically linked test.
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
+LIBADD+= pthread
regress: ${PROG}
./${PROG} -r ${.CURDIR}/mach
diff --git a/tools/regression/mac/mac_bsdextended/Makefile b/tools/regression/mac/mac_bsdextended/Makefile
index 36464ba..aaa060a 100644
--- a/tools/regression/mac/mac_bsdextended/Makefile
+++ b/tools/regression/mac/mac_bsdextended/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= test_ugidfw
-DPADD= ${LIBUGIDFW}
-LDADD= -lugidfw
+LIBADD= ugidfw
MAN=
.include <bsd.prog.mk>
diff --git a/tools/regression/posixsem/Makefile b/tools/regression/posixsem/Makefile
index 3120313..5f73a72 100644
--- a/tools/regression/posixsem/Makefile
+++ b/tools/regression/posixsem/Makefile
@@ -2,8 +2,7 @@
PROG= posixsem
SRCS= posixsem.c test.c
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD= kvm
MAN=
WARNS?= 3
diff --git a/tools/regression/priv/Makefile b/tools/regression/priv/Makefile
index a1fbcc6..32a4a74 100644
--- a/tools/regression/priv/Makefile
+++ b/tools/regression/priv/Makefile
@@ -48,8 +48,7 @@ SRCS= main.c \
MAN=
WARNS?= 3
-DPADD+= ${LIBIPSEC}
-LDADD+= -lipsec
+LIBADD+= ipsec
.if ${MK_INET6_SUPPORT} != "no"
CFLAGS+= -DINET6
diff --git a/tools/regression/pthread/cv_cancel1/Makefile b/tools/regression/pthread/cv_cancel1/Makefile
index bedca56..be2ffaa 100644
--- a/tools/regression/pthread/cv_cancel1/Makefile
+++ b/tools/regression/pthread/cv_cancel1/Makefile
@@ -2,7 +2,6 @@
PROG= cv_cancel1
MAN=
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/regression/pthread/mutex_isowned_np/Makefile b/tools/regression/pthread/mutex_isowned_np/Makefile
index f7a8984..8827053 100644
--- a/tools/regression/pthread/mutex_isowned_np/Makefile
+++ b/tools/regression/pthread/mutex_isowned_np/Makefile
@@ -2,7 +2,6 @@
PROG= mutex_isowned_np
MAN=
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/regression/rpcsec_gss/Makefile b/tools/regression/rpcsec_gss/Makefile
index 5db4b79..bea9d9c 100644
--- a/tools/regression/rpcsec_gss/Makefile
+++ b/tools/regression/rpcsec_gss/Makefile
@@ -3,8 +3,7 @@
PROG= rpctest
MAN=
WARNS?= 6
-DPADD= ${LIBRPCSEC_GSS}
-LDADD= -lrpcsec_gss
+LIBADD= rpcsec_gss
DEBUG_FLAGS= -g -O0
.include <bsd.prog.mk>
diff --git a/tools/regression/sockets/sendfile/Makefile b/tools/regression/sockets/sendfile/Makefile
index 9d6f185..6e9c1ab 100644
--- a/tools/regression/sockets/sendfile/Makefile
+++ b/tools/regression/sockets/sendfile/Makefile
@@ -5,7 +5,6 @@
PROG= sendfile
MAN=
WARNS?= 6
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD= md
.include <bsd.prog.mk>
diff --git a/tools/regression/tls/ttls2/Makefile b/tools/regression/tls/ttls2/Makefile
index 643040f..cbebbe7 100644
--- a/tools/regression/tls/ttls2/Makefile
+++ b/tools/regression/tls/ttls2/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= ttls2
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
MAN=
DEBUG_FLAGS= -g
diff --git a/tools/regression/tls/ttls4/Makefile b/tools/regression/tls/ttls4/Makefile
index 2d1e501..ab6ca6f 100644
--- a/tools/regression/tls/ttls4/Makefile
+++ b/tools/regression/tls/ttls4/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= ttls4
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
MAN=
DEBUG_FLAGS= -g
diff --git a/tools/tools/ath/athratestats/Makefile b/tools/tools/ath/athratestats/Makefile
index 87cd0f8..938f0cb 100644
--- a/tools/tools/ath/athratestats/Makefile
+++ b/tools/tools/ath/athratestats/Makefile
@@ -7,7 +7,7 @@ PROG= athratestats
SRCS= main.c opt_ah.h ah_osdep.h
-LDADD+= -lcurses
+LIBADD+= curses
CLEANFILES+= opt_ah.h ah_osdep.h
diff --git a/tools/tools/atsectl/Makefile b/tools/tools/atsectl/Makefile
index 3f3a8c4..afe79a9 100644
--- a/tools/tools/atsectl/Makefile
+++ b/tools/tools/atsectl/Makefile
@@ -2,8 +2,7 @@
PROG= atsectl
-DPADD= ${LIBMD}
-LDADD= -lmd
+LIBADD= md
BINDIR?= /usr/sbin
diff --git a/tools/tools/ether_reflect/Makefile b/tools/tools/ether_reflect/Makefile
index 0d20f39..040a5bd 100644
--- a/tools/tools/ether_reflect/Makefile
+++ b/tools/tools/ether_reflect/Makefile
@@ -4,8 +4,7 @@
# A Makefile that builds both the ether_reflect program and its manual page.
PROG= ether_reflect
-DPADD= ${LIBPCAP}
-LDADD= -lpcap
+LIBADD= pcap
CFLAGS+=-DHAVE_SNPRINTF
.include <bsd.prog.mk>
diff --git a/tools/tools/ifpifa/Makefile b/tools/tools/ifpifa/Makefile
index 0c09ecc..d381792 100644
--- a/tools/tools/ifpifa/Makefile
+++ b/tools/tools/ifpifa/Makefile
@@ -4,7 +4,6 @@ PROG= ifpifa
MAN=
WARNS?=6
BINDIR?=/usr/local/bin
-DPADD=${LIBKVM}
-LDADD=-lkvm
+LIBADD=kvm
.include <bsd.prog.mk>
diff --git a/tools/tools/mctest/Makefile b/tools/tools/mctest/Makefile
index 6edaf89..dc583e5 100644
--- a/tools/tools/mctest/Makefile
+++ b/tools/tools/mctest/Makefile
@@ -1,7 +1,6 @@
# $FreeBSD$
PROG_CXX= mctest
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index 59a6a5d..067d306 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -164,7 +164,6 @@ NANO_SLICE_DATA=s4
# conflates the two, so architectures where TARGET != TARGET_ARCH and
# TARGET can't be guessed from TARGET_ARCH do not work. This defaults
# to the arch of the current machine.
-
NANO_ARCH=`uname -p`
# CPUTYPE defaults to "" which is the default when CPUTYPE isn't
@@ -177,9 +176,12 @@ NANO_CFGDIR=""
# Directory to populate /data from
NANO_DATADIR=""
-# src.conf to use when building the image. Defaults to /dev/null for the sake
-# of determinism.
-SRCCONF=${SRCCONF:=/dev/null}
+# We don't need SRCCONF or SRC_ENV_CONF. NanoBSD puts everything we
+# need for the build in files included with __MAKE_CONF. Override in your
+# config file if you really must. We set them unconditionally here, though
+# in case they are stray in the build environment
+SRCCONF=/dev/null
+SRC_ENV_CONF=/dev/null
#######################################################################
#
@@ -188,6 +190,46 @@ SRCCONF=${SRCCONF:=/dev/null}
#
#######################################################################
+# Export values into the shell. Must use { } instead of ( ) like
+# other functions to avoid a subshell.
+# We set __MAKE_CONF as a global since it is easier to get quoting
+# right for paths with spaces in them.
+make_export ( ) {
+ # Similar to export_var, except puts the data out to stdout
+ var=$1
+ eval val=\$$var
+ echo "Setting variable: $var=\"$val\""
+ export $1
+}
+
+nano_make_build_env ( ) {
+ __MAKE_CONF="${NANO_MAKE_CONF_BUILD}"
+ make_export __MAKE_CONF
+}
+
+nano_make_install_env ( ) {
+ __MAKE_CONF="${NANO_MAKE_CONF_INSTALL}"
+ make_export __MAKE_CONF
+}
+
+# Extra environment variables for kernel builds
+nano_make_kernel_env ( ) {
+ if [ -f ${NANO_KERNEL} ] ; then
+ KERNCONFDIR="$(realpath $(dirname ${NANO_KERNEL}))"
+ KERNCONF="$(basename ${NANO_KERNEL})"
+ make_export KERNCONFDIR
+ make_export KERNCONF
+ else
+ export KERNCONF="${NANO_KERNEL}"
+ make_export KERNCONF
+ fi
+}
+
+nano_global_make_env ( ) (
+ [ ! -z "${NANO_ARCH}" ] && echo TARGET_ARCH="${NANO_ARCH}" || true
+ [ ! -z "${NANO_CPUTYPE}" ] && echo TARGET_CPUTYPE="${NANO_CPUTYPE}" || true
+)
+
# rm doesn't know -x prior to FreeBSD 10, so cope with a variety of build
# hosts for now.
nano_rm ( ) {
@@ -198,15 +240,13 @@ nano_rm ( ) {
}
# run in the world chroot, errors fatal
-CR()
-{
- chroot ${NANO_WORLDDIR} /bin/sh -exc "$*"
+CR ( ) {
+ chroot "${NANO_WORLDDIR}" /bin/sh -exc "$*"
}
# run in the world chroot, errors not fatal
-CR0()
-{
- chroot ${NANO_WORLDDIR} /bin/sh -c "$*" || true
+CR0 ( ) {
+ chroot "${NANO_WORLDDIR}" /bin/sh -c "$*" || true
}
nano_cleanup ( ) (
@@ -231,19 +271,25 @@ make_conf_build ( ) (
mkdir -p ${MAKEOBJDIRPREFIX}
printenv > ${MAKEOBJDIRPREFIX}/_.env
- echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD}
- echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD}
+ # Make sure we get all the global settings that NanoBSD wants
+ # in addition to the user's global settings
+ (
+ nano_global_make_env
+ echo "${CONF_WORLD}"
+ echo "${CONF_BUILD}"
+ ) > ${NANO_MAKE_CONF_BUILD}
)
build_world ( ) (
pprint 2 "run buildworld"
pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bw"
- cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} ${NANO_PMAKE} \
- SRCCONF=${SRCCONF} \
- __MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \
- > ${MAKEOBJDIRPREFIX}/_.bw 2>&1
+ (
+ nano_make_build_env
+ set -o xtrace
+ cd "${NANO_SRC}"
+ ${NANO_PMAKE} buildworld
+ ) > ${MAKEOBJDIRPREFIX}/_.bw 2>&1
)
build_kernel ( ) (
@@ -253,20 +299,16 @@ build_kernel ( ) (
pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.bk"
(
- if [ -f ${NANO_KERNEL} ] ; then
- kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'"
- kernconf=$(basename ${NANO_KERNEL})
- else
- kernconf=${NANO_KERNEL}
- fi
+ nano_make_build_env
+ nano_make_kernel_env
- cd ${NANO_SRC};
# Note: We intentionally build all modules, not only the ones in
# NANO_MODULES so the built world can be reused by multiple images.
- eval "TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \
- SRCCONF='${SRCCONF}' \
- __MAKE_CONF='${NANO_MAKE_CONF_BUILD}' \
- ${kernconfdir_arg} KERNCONF=${kernconf}"
+ # Although MODULES_OVERRIDE can be defined in the kenrel config
+ # file to override this behavior. Just set NANO_MODULES=default.
+ set -o xtrace
+ cd "${NANO_SRC}"
+ ${NANO_PMAKE} buildkernel
) > ${MAKEOBJDIRPREFIX}/_.bk 2>&1
)
@@ -277,36 +319,45 @@ clean_world ( ) (
chflags -R noschg ${NANO_OBJ}
nano_rm -r ${NANO_OBJ}/
fi
- mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR}
+ mkdir -p "${NANO_OBJ}" "${NANO_WORLDDIR}"
printenv > ${NANO_OBJ}/_.env
else
pprint 2 "Clean and create world directory (${NANO_WORLDDIR})"
- if ! nano_rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then
- chflags -R noschg ${NANO_WORLDDIR}
- nano_rm -rf ${NANO_WORLDDIR}/
+ if ! nano_rm -rf "${NANO_WORLDDIR}/" > /dev/null 2>&1 ; then
+ chflags -R noschg "${NANO_WORLDDIR}"
+ nano_rm -rf "${NANO_WORLDDIR}/"
fi
- mkdir -p ${NANO_WORLDDIR}
+ mkdir -p "${NANO_WORLDDIR}"
fi
)
make_conf_install ( ) (
pprint 2 "Construct install make.conf ($NANO_MAKE_CONF_INSTALL)"
- echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL}
- echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL}
+ # Make sure we get all the global settings that NanoBSD wants
+ # in addition to the user's global settings
+ (
+ nano_global_make_env
+ echo "${CONF_WORLD}"
+ echo "${CONF_INSTALL}"
+ if [ ! -z "${NANO_NOPRIV_BUILD}" ]; then
+ echo NO_ROOT=t
+ echo METALOG=${NANO_METALOG}
+ fi
+ ) > ${NANO_MAKE_CONF_INSTALL}
)
install_world ( ) (
pprint 2 "installworld"
pprint 3 "log: ${NANO_OBJ}/_.iw"
- cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
- ${NANO_MAKE} SRCCONF=${SRCCONF} \
- __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \
- DESTDIR=${NANO_WORLDDIR} \
- > ${NANO_OBJ}/_.iw 2>&1
- chflags -R noschg ${NANO_WORLDDIR}
+ (
+ nano_make_install_env
+ set -o xtrace
+ cd "${NANO_SRC}"
+ ${NANO_MAKE} installworld DESTDIR="${NANO_WORLDDIR}"
+ chflags -R noschg "${NANO_WORLDDIR}"
+ ) > ${NANO_OBJ}/_.iw 2>&1
)
install_etc ( ) (
@@ -314,15 +365,15 @@ install_etc ( ) (
pprint 2 "install /etc"
pprint 3 "log: ${NANO_OBJ}/_.etc"
- cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
- ${NANO_MAKE} SRCCONF=${SRCCONF} \
- __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \
- DESTDIR=${NANO_WORLDDIR} \
- > ${NANO_OBJ}/_.etc 2>&1
+ (
+ nano_make_install_env
+ set -o xtrace
+ cd "${NANO_SRC}"
+ ${NANO_MAKE} distribution DESTDIR="${NANO_WORLDDIR}"
# make.conf doesn't get created by default, but some ports need it
# so they can spam it.
- cp /dev/null ${NANO_WORLDDIR}/etc/make.conf
+ cp /dev/null "${NANO_WORLDDIR}"/etc/make.conf
+ ) > ${NANO_OBJ}/_.etc 2>&1
)
install_kernel ( ) (
@@ -332,27 +383,19 @@ install_kernel ( ) (
pprint 3 "log: ${NANO_OBJ}/_.ik"
(
- if [ -f ${NANO_KERNEL} ] ; then
- kernconfdir_arg="KERNCONFDIR='$(realpath $(dirname ${NANO_KERNEL}))'"
- kernconf=$(basename ${NANO_KERNEL})
- else
- kernconf=${NANO_KERNEL}
- fi
- # Install all built modules if NANO_MODULES=default,
- # else install only listed modules (none if NANO_MODULES is empty).
+ nano_make_install_env
+ nano_make_kernel_env
+
if [ "${NANO_MODULES}" != "default" ]; then
- modules_override_arg="MODULES_OVERRIDE='${NANO_MODULES}'"
+ MODULES_OVERRIDE="${NANO_MODULES}"
+ make_export MODULES_OVERRIDE
fi
- cd ${NANO_SRC}
- eval "TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
- ${NANO_MAKE} installkernel \
- DESTDIR='${NANO_WORLDDIR}' \
- SRCCONF='${SRCCONF}' \
- __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \
- ${kernconfdir_arg} KERNCONF=${kernconf} \
- ${modules_override_arg}"
+ set -o xtrace
+ cd "${NANO_SRC}"
+ ${NANO_MAKE} installkernel DESTDIR="${NANO_WORLDDIR}"
+
) > ${NANO_OBJ}/_.ik 2>&1
)
@@ -360,15 +403,17 @@ native_xtools ( ) (
print 2 "Installing the optimized native build tools for cross env"
pprint 3 "log: ${NANO_OBJ}/_.native_xtools"
- cd ${NANO_SRC}
- env TARGET_ARCH=${NANO_ARCH} TARGET_CPUTYPE=${NANO_CPUTYPE} \
- ${NANO_MAKE} SRCCONF=${SRCCONF} \
- __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} native-xtools \
- DESTDIR=${NANO_WORLDDIR} \
- > ${NANO_OBJ}/_.native_xtools 2>&1
+ (
+
+ nano_make_install_env
+ set -o xtrace
+ cd "${NANO_SRC}"
+ ${NANO_MAKE} native-xtools DESTDIR="${NANO_WORLDDIR}"
+
+ ) > ${NANO_OBJ}/_.native_xtools 2>&1
)
-run_customize() (
+run_customize ( ) (
pprint 2 "run customize scripts"
for c in $NANO_CUSTOMIZE
@@ -380,7 +425,7 @@ run_customize() (
done
)
-run_late_customize() (
+run_late_customize ( ) (
pprint 2 "run late customize scripts"
for c in $NANO_LATE_CUSTOMIZE
@@ -397,7 +442,7 @@ setup_nanobsd ( ) (
pprint 3 "log: ${NANO_OBJ}/_.dl"
(
- cd ${NANO_WORLDDIR}
+ cd "${NANO_WORLDDIR}"
# Move /usr/local/etc to /etc/local so that the /cfg stuff
# can stomp on it. Otherwise packages like ipsec-tools which
@@ -439,13 +484,15 @@ setup_nanobsd_etc ( ) (
pprint 2 "configure nanobsd /etc"
(
- cd ${NANO_WORLDDIR}
+ cd "${NANO_WORLDDIR}"
# create diskless marker file
touch etc/diskless
# Make root filesystem R/O by default
+ [ ! -z "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf
echo "root_rw_mount=NO" >> etc/defaults/rc.conf
+ [ ! -z "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf
# save config file for scripts
echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf
@@ -456,10 +503,10 @@ setup_nanobsd_etc ( ) (
)
)
-prune_usr() (
+prune_usr ( ) (
# Remove all empty directories in /usr
- find ${NANO_WORLDDIR}/usr -type d -depth -print |
+ find "${NANO_WORLDDIR}"/usr -type d -depth -print |
while read d
do
rmdir $d > /dev/null 2>&1 || true
@@ -478,7 +525,7 @@ newfs_part ( ) (
# Convenient spot to work around any umount issues that your build environment
# hits by overriding this method.
-nano_umount () (
+nano_umount ( ) (
umount ${1}
)
@@ -492,7 +539,7 @@ populate_slice ( ) (
newfs_part ${dev} ${mnt} ${lbl}
if [ -n "${dir}" -a -d "${dir}" ]; then
echo "Populating ${lbl} from ${dir}"
- cd ${dir}
+ cd "${dir}"
find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${mnt}
fi
df -i ${mnt}
@@ -615,9 +662,9 @@ create_diskimage ( ) (
populate_slice /dev/${MD}${NANO_SLICE_ROOT}a ${NANO_WORLDDIR} ${MNT} "${NANO_SLICE_ROOT}a"
mount /dev/${MD}${NANO_SLICE_ROOT}a ${MNT}
echo "Generating mtree..."
- ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree
- ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du
- nano_umount ${MNT}
+ ( cd "${MNT}" && mtree -c ) > ${NANO_OBJ}/_.mtree
+ ( cd "${MNT}" && du -k ) > ${NANO_OBJ}/_.du
+ nano_umount "${MNT}"
if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then
# Duplicate to second image (if present)
@@ -674,7 +721,7 @@ create_diskimage ( ) (
) > ${NANO_OBJ}/_.di 2>&1
)
-last_orders () (
+last_orders ( ) (
# Redefine this function with any last orders you may have
# after the build completed, for instance to copy the finished
# image to a more convenient place:
@@ -692,7 +739,7 @@ last_orders () (
# Common Flash device geometries
#
-FlashDevice () {
+FlashDevice ( ) {
if [ -d ${NANO_TOOLS} ] ; then
. ${NANO_TOOLS}/FlashDevice.sub
else
@@ -721,7 +768,7 @@ FlashDevice () {
# The generic-hdd device is preferred for flash devices larger than 1GB.
#
-UsbDevice () {
+UsbDevice ( ) {
a1=`echo $1 | tr '[:upper:]' '[:lower:]'`
case $a1 in
generic-fdd)
@@ -744,7 +791,7 @@ UsbDevice () {
#######################################################################
# Setup serial console
-cust_comconsole () (
+cust_comconsole ( ) (
# Enable getty on console
sed -i "" -e /tty[du]0/s/off/on/ ${NANO_WORLDDIR}/etc/ttys
@@ -758,7 +805,7 @@ cust_comconsole () (
#######################################################################
# Allow root login via ssh
-cust_allow_ssh_root () (
+cust_allow_ssh_root ( ) (
sed -i "" -e '/PermitRootLogin/s/.*/PermitRootLogin yes/' \
${NANO_WORLDDIR}/etc/ssh/sshd_config
)
@@ -766,15 +813,15 @@ cust_allow_ssh_root () (
#######################################################################
# Install the stuff under ./Files
-cust_install_files () (
- cd ${NANO_TOOLS}/Files
+cust_install_files ( ) (
+ cd "${NANO_TOOLS}/Files"
find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -Ldumpv ${NANO_WORLDDIR}
)
#######################################################################
# Install packages from ${NANO_PACKAGE_DIR}
-cust_pkgng () (
+cust_pkgng ( ) (
# If the package directory doesn't exist, we're done.
if [ ! -d ${NANO_PACKAGE_DIR} ]; then
@@ -794,8 +841,8 @@ cust_pkgng () (
# Copy packages into chroot
mkdir -p ${NANO_WORLDDIR}/Pkg
(
- cd ${NANO_PACKAGE_DIR}
- find ${NANO_PACKAGE_LIST} -print |
+ cd "${NANO_PACKAGE_DIR}"
+ find "${NANO_PACKAGE_LIST}" -print |
cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
)
@@ -842,7 +889,7 @@ cust_pkgng () (
# Convenience function:
# Register all args as customize function.
-customize_cmd () {
+customize_cmd ( ) {
NANO_CUSTOMIZE="$NANO_CUSTOMIZE $*"
}
@@ -851,7 +898,7 @@ customize_cmd () {
# Register all args as late customize function to run just before
# image creation.
-late_customize_cmd () {
+late_customize_cmd ( ) {
NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $*"
}
@@ -863,14 +910,14 @@ late_customize_cmd () {
# Progress Print
# Print $2 at level $1.
-pprint() (
+pprint ( ) (
if [ "$1" -le $PPLEVEL ]; then
runtime=$(( `date +%s` - $NANO_STARTTIME ))
printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3
fi
)
-usage () {
+usage ( ) {
(
echo "Usage: $0 [-bfiKknqvw] [-c config_file]"
echo " -b suppress builds (both kernel and world)"
@@ -891,7 +938,7 @@ usage () {
# Setup and Export Internal variables
#
-export_var() {
+export_var ( ) { # Don't wawnt a subshell
var=$1
# Lookup value of the variable.
eval val=\$$var
@@ -900,7 +947,8 @@ export_var() {
}
# Call this function to set defaults _after_ parsing options.
-set_defaults_and_export() {
+# dont want a subshell otherwise variable setting is thrown away.
+set_defaults_and_export ( ) {
test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME}
test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=${NANO_OBJ}
test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=${NANO_OBJ}
@@ -909,11 +957,14 @@ set_defaults_and_export() {
NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install
# Override user's NANO_DRIVE if they specified a NANO_LABEL
- [ ! -z "${NANO_LABEL}" ] && NANO_DRIVE="ufs/${NANO_LABEL}"
+ [ ! -z "${NANO_LABEL}" ] && NANO_DRIVE="ufs/${NANO_LABEL}" || true
# Set a default NANO_TOOLS to NANO_SRC/NANO_TOOLS if it exists.
[ ! -d "${NANO_TOOLS}" ] && [ -d "${NANO_SRC}/${NANO_TOOLS}" ] && \
- NANO_TOOLS="${NANO_SRC}/${NANO_TOOLS}"
+ NANO_TOOLS="${NANO_SRC}/${NANO_TOOLS}" || true
+
+ [ ! -z "${NANO_NOPRIV_BUILD}" ] && [ -z "${NANO_METALOG}" ] && \
+ NANO_METALOG=${NANO_OBJ}/_.metalog || true
NANO_STARTTIME=`date +%s`
pprint 3 "Exporting NanoBSD variables"
@@ -943,4 +994,8 @@ set_defaults_and_export() {
export_var NANO_BOOTLOADER
export_var NANO_LABEL
export_var NANO_MODULES
+ export_var NANO_NOPRIV_BUILD
+ export_var NANO_METALOG
+ export_var SRCCONF
+ export_var SRC_ENV_CONF
}
diff --git a/tools/tools/nanobsd/embedded/README b/tools/tools/nanobsd/embedded/README
new file mode 100644
index 0000000..7be7978
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/README
@@ -0,0 +1,14 @@
+$FreeBSD$
+
+Example for creating many different builds (including different
+arch) from a common set of files, as well as building natively
+using qemu user space emulation.
+
+This creates a simple appliance that uses dnsmasq to serve DNS
+and DHCPd.
+
+This is a work in progress. Generally, to build this you should
+ cd tools/tools/nanobsd/embedded
+ sudo sh ../nanobsd.sh -c foo.cfg
+but do be careful if things are interrupted. There may still be
+bugs lurking that cause your entire FreeBSD tree to disappear.
diff --git a/tools/tools/nanobsd/embedded/beaglebone.cfg b/tools/tools/nanobsd/embedded/beaglebone.cfg
new file mode 100644
index 0000000..3f28feb
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/beaglebone.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=armv6
+NANO_KERNEL=BEAGLEBONE
+NANO_DRIVE=mmcsd0
+NANO_NAME=rpi2
+NANO_BOOT_PKG=u-boot-beaglebone
+NANO_CPUTYPE=cortex-a8
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/common b/tools/tools/nanobsd/embedded/common
new file mode 100644
index 0000000..a4635f0
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/common
@@ -0,0 +1,567 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc 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.
+#
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project (an early version) and
+# simplified to meet the needs of the example.
+#
+
+# NB: You want the other file as the command line arg :)
+
+# Missing in base:
+# o mkimg setting active partition
+# o mkimg starting at arbitrary offset (needed for A10, et al)
+# o mtools still needed becuase we have no makefs -t msdos
+# o nanobsd doesn't record changes to WORLDTEMP in customization
+# scripts yet, so we have kludge to pick up all files
+# o easy way for pkg to grab files from other repos and put that
+# data on the image
+# o Need to have some way to create / resize the s4 slice to do ping
+# pong bouncing between s3 and s4 for an arbitrary image. we can resize
+# one slice, not two
+# o hints in the uboot ports for how to create the image
+#
+# Missing here
+# o documentation for how to run the qemu images
+# o msdos mtools fallback
+# o special boot for !x86 !arm platforms
+# o qemu image for arm
+# o qemu image for aarch64
+# o qemu image for armv6/armv7
+# o easy support for different image / vm formats
+# o need to promote much of this to nanobsd.sh and friends
+# o uses old kludge to build image w/o ownership being right
+# for many files. Should move to mtree-dedup.awk.
+# o support for EFI images
+# o support for GPT partitioning
+#
+# Long Term
+# o common tooling for creating images for odd-ball platforms
+# o support for boot loaders other than uboot in the image
+# or via special insturctions
+# o No pony support. Sadly, you cannot have a pony.
+#
+
+if [ -z $NANO_NAME ]; then
+ echo "NANO_NAME not defined. Use foo.cfg instead."
+fi
+
+# Slice 1: FAT for ROM loading bootstrap
+# Slice 2: Config partition
+# Slice 3: FreeBSD partition (sized exactly)
+# Slice 4: FreeBSD partition (empty)
+# on first boot, we resize slice 3 & 4 to be 1/2 of what's
+# left over on the SD card after slice 1 and 2 are taken
+# off the top. We also resize the 'a' partion on first boot
+# to the size of the partition for the ping/pong upgrade.
+if [ -z "$EMBED_OMIT_FAT" ]; then
+ NANO_SLICE_FAT=s1
+ NANO_SLICE_CFG=s2
+ NANO_SLICE_ROOT=s3
+ NANO_SLICE_ALTROOT=s4
+else
+ NANO_SLICE_CFG=s1
+ NANO_SLICE_ROOT=s2
+ NANO_SLICE_ALTROOT=s3
+fi
+NANO_SLICE_DATA= # Not included
+
+NANO_SLICE_FAT_SIZE=32m
+NANO_SLICE_CFG_SIZE=32m
+
+NANO_RAM_ETCSIZE=8192
+NANO_RAM_TMPVARSIZE=8192
+NANO_IMAGES=2
+
+NANO_PMAKE="make -j $(sysctl -n hw.ncpu)"
+
+NANO_CFG_BASE=$(pwd)
+NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..)
+NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..)
+#### XXX share obj
+NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj
+# Where cust_pkg() finds packages to install
+#XXX: Is this the right place?
+#NANO_PORTS=$(realpath ${NANO_SRC}/../ports)
+NANO_PORTS=/usr/ports
+NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg
+NANO_INIT_IMG2=0
+NANO_NOPRIV_BUILD=t
+unset MAKEOBJDIRPREFIX
+
+# this to go into nanobsd.sh
+NANO_PORTS=${NANO_PORTS:-/usr/ports}
+
+mkdir -p ${NANO_OBJ}
+
+customize_cmd cust_allow_ssh_root
+
+add_etc_make_conf()
+{
+ touch ${NANO_WORLDDIR}/etc/make.conf
+}
+customize_cmd add_etc_make_conf
+
+cust_install_machine_files()
+{
+ echo "cd ${NANO_CFG_BASE}/Files"
+ cd ${NANO_CFG_BASE}/Files
+ find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${NANO_WORLDDIR}
+}
+customize_cmd cust_install_files
+customize_cmd cust_install_machine_files
+
+buildenv()
+{
+ cd ${NANO_SRC}
+ env __MAKE_CONF=${NANO_MAKE_CONF_BUILD} DESTDIR=${NANO_WORLDDIR} make buildenv
+}
+
+NANO_MAKEFS="makefs -B big \
+ -o bsize=4096,fsize=512,density=8192,optimization=space"
+export NANO_MAKEFS
+
+# NB: leave c++ enabled so devd can be built
+CONF_BUILD="
+WITHOUT_ACPI=true
+WITHOUT_ATM=true
+WITHOUT_AUDIT=true
+WITHOUT_BIND_DNSSEC=true
+WITHOUT_BIND_ETC=true
+WITHOUT_BIND_LIBS_LWRES=true
+WITHOUT_BLUETOOTH=true
+WITHOUT_CALENDAR=true
+WITHOUT_CVS=true
+WITHOUT_DICT=true
+WITHOUT_EXAMPLES=true
+WITHOUT_FORTRAN=true
+WITHOUT_GAMES=true
+WITHOUT_GCOV=true
+WITHOUT_GPIB=true
+WITHOUT_HTML=true
+WITHOUT_I4B=true
+WITHOUT_IPFILTER=true
+WITHOUT_IPX=true
+WITHOUT_LIBKSE=true
+WITHOUT_LOCALES=true
+WITHOUT_LPR=true
+WITHOUT_MAN=true
+WITHOUT_NETCAT=true
+WITHOUT_NIS=true
+WITHOUT_NLS=true
+WITHOUT_NS_CACHING=true
+WITHOUT_OBJC=true
+WITHOUT_PROFILE=true
+WITHOUT_RCMDS=true
+WITHOUT_SENDMAIL=true
+WITHOUT_SHAREDOCS=true
+WITHOUT_SYSCONS=true
+WITHOUT_LIB32=true
+"
+CONF_INSTALL="$CONF_BUILD
+INSTALL_NODEBUG=t
+NOPORTDOCS=t
+NO_INSTALL_MANPAGES=t
+"
+# The following would help...
+# WITHOUT_TOOLCHAIN=true can't build ports
+# WITHOUT_INSTALLLIB=true libgcc.a
+#
+# from the build
+# WITHOUT_INFO=true makeinfo
+# WITHOUT_RCS=true
+PKG_ONLY_MAKE_CONF="
+WITHOUT_TOOLCHAIN=true
+WITHOUT_INSTALLLIB=true
+WITHOUT_INFO=true
+WITHOUT_RCS=true
+"
+
+NANO_PACKAGE_ONLY=1
+
+# install a package from a pre-built binary
+do_add_pkg ()
+{
+ # Need to create ${NANO_OBJ}/ports in this add_pkg_${port} function
+ set -x
+ mkdir -p ${NANO_OBJ}/ports/distfiles
+ mkdir -p ${NANO_OBJ}/ports/packages
+ mkdir -p ${NANO_WORLDDIR}/usr/ports/packages
+ mkdir -p ${NANO_WORLDDIR}/usr/ports/distfiles
+ mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \
+ ${NANO_WORLDDIR}/usr/ports/packages
+ mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \
+ ${NANO_WORLDDIR}/usr/ports/distfiles
+ CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /usr/ports/packages/All/$1.txz
+ umount ${NANO_WORLDDIR}/usr/ports/distfiles
+ umount ${NANO_WORLDDIR}/usr/ports/packages
+ rmdir ${NANO_WORLDDIR}/usr/ports/packages
+ rmdir ${NANO_WORLDDIR}/usr/ports/distfiles
+ rmdir ${NANO_WORLDDIR}/usr/ports
+ set +x
+}
+
+# Build a port (with the side effect of creating a package)
+do_add_port ()
+{
+ local port_path
+ port_path=$1
+ shift
+ set -x
+ # Need to create ${NANO_OBJ}/ports in this add_port_${port} function
+ mkdir -p ${NANO_OBJ}/ports/distfiles
+ mkdir -p ${NANO_OBJ}/ports/packages
+ mkdir -p ${NANO_PORTS}/packages
+ mkdir -p ${NANO_PORTS}/distfiles
+ mkdir -p ${NANO_WORLDDIR}/usr/src
+ mkdir -p ${NANO_WORLDDIR}/usr/ports
+ mount -t nullfs -o noatime ${NANO_SRC} ${NANO_WORLDDIR}/usr/src
+ mount -t nullfs -o noatime ${NANO_PORTS} ${NANO_WORLDDIR}/usr/ports
+ mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \
+ ${NANO_WORLDDIR}/usr/ports/packages
+ mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \
+ ${NANO_WORLDDIR}/usr/ports/distfiles
+ mkdir -p ${NANO_WORLDDIR}/dev
+ mount -t devfs devfs ${NANO_WORLDDIR}/dev
+ mkdir -p ${NANO_WORLDDIR}/usr/workdir
+ cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf
+ # OK, a little inefficient, but likely not enough to worry about.
+ CR ldconfig /lib /usr/lib /usr/local/lib
+ CR ldconfig -R
+ CR ldconfig -r
+# Improvement: Don't know why package-recursive don't works here
+ CR "env UNAME_p=${NANO_ARCH} TARGET=${NANO_ARCH} \
+ TARGET_ARCH=${NANO_ARCH} PORTSDIR=${NANO_PORTS} make \
+ __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \
+ WRKDIRPREFIX=/usr/workdir -C /usr/ports/$port_path \
+ package-recursive BATCH=yes $* clean FORCE_PKG_REGISTER=t"
+ rm ${NANO_WORLDDIR}/etc/resolv.conf
+ rm -rf ${NANO_WORLDDIR}/usr/obj
+ rm -rf ${NANO_WORLDDIR}/usr/workdir
+ umount ${NANO_WORLDDIR}/dev
+ umount ${NANO_WORLDDIR}/usr/ports/packages
+ umount ${NANO_WORLDDIR}/usr/ports/distfiles
+ umount ${NANO_WORLDDIR}/usr/ports
+ umount ${NANO_WORLDDIR}/usr/src
+ set +x
+}
+
+# Need to check if this function works with cross-compiling architecture!!!!
+# Recursive complex fonction: Generate one function for each ports
+add_port () {
+ local port_path=$1
+ local port=`echo $1 | sed -e 's/\//_/'`
+ shift
+ # Check if package allready exist
+ # Need to:
+ # 1. check ARCH of this package!
+ # 2. Add a trap
+ cd ${NANO_PORTS}/${port_path}
+ PKG_NAME=`env PORTSDIR=${NANO_PORTS} make __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name`
+ if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.txz ]; then
+ # Pkg file found: Generate add_pkg_NAME function
+ eval "
+ add_pkg_${port} () {
+ do_add_pkg ${PKG_NAME}
+ }
+ customize_cmd add_pkg_${port}
+ "
+ else
+ # No pkg file: Generate add_port_NAME function
+ eval "
+ add_port_${port} () {
+ do_add_port ${port_path} $*
+ }
+ customize_cmd add_port_${port}
+ "
+ NANO_PACKAGE_ONLY=0
+ fi
+}
+
+create_diskimage ( ) (
+ local extra
+
+ pprint 2 "build diskimage ${NANO_NAME}"
+ pprint 3 "log: ${NANO_OBJ}/_.di"
+
+ (
+ if [ ! -z ${NANO_NOPRIV_BUILD} ]; then
+ extra="-F ${NANO_OBJ}/_.metalog"
+ fi
+
+ for i in s1 s2 s3 s4 empty; do
+ rm -fr ${NANO_OBJ}/_.${i}*
+ done
+
+ if [ ! -z "${NANO_SLICE_FAT}" ]; then
+ echo Creating MSDOS partition for kernel
+ newfs_msdos -C ${NANO_SLICE_FAT_SIZE:-100m} -F 16 -L ${NANO_NAME} \
+ ${NANO_OBJ}/_.${NANO_SLICE_FAT}
+ fi
+ echo Creating main partition
+ sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}}
+ makefs ${extra} -B little $sz -t ffs ${NANO_OBJ}/_.${NANO_SLICE_ROOT}a "${NANO_WORLDDIR}"
+ if [ -z "${NANO_CFGDIR}" ]; then
+ echo "Faking cfg dir, it's empty"
+ NANO_CFGDIR=${NANO_OBJ}/_.empty
+ mkdir ${NANO_CFGDIR}
+ fi
+ echo Creating cfg parittion
+# XXX -F cfg-mtree
+ makefs -B little -t ffs -s ${NANO_SLICE_CFG_SIZE:-100m} \
+ ${NANO_OBJ}/_.${NANO_SLICE_CFG} "${NANO_CFGDIR}"
+ # data slice not supported since we need the part for FAT for
+ # booting
+ echo Slicing up the main partition into a full bsd part
+ mkimg -s bsd -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \
+ -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT}
+ echo Making the whole shooting match
+ if [ ! -z $NANO_SLICE_FAT ]; then
+ eval $NANO_SLICE_FAT=fat16b
+ fi
+ eval $NANO_SLICE_CFG=freebsd
+ eval $NANO_SLICE_ROOT=freebsd
+ if [ ! -z "${NANO_SLICE_FAT}" ]; then
+ mkimg -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \
+ -p ${s2}:=${NANO_OBJ}/_.s2 \
+ -p ${s3}:=${NANO_OBJ}/_.s3 \
+ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}
+ else
+ # s1 is cfg, s2 is /, not sure how to make that
+ # boot (marked as active) with mkimg yet
+ mkimg -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \
+ -p ${s2}:=${NANO_OBJ}/_.s2 \
+ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}
+ fi
+ ) > ${NANO_OBJ}/_.di 2>&1
+)
+
+die()
+{
+ echo "$*"
+ exit 1
+}
+
+# Automatically include the packaging port here so it is always first so it
+# builds the port and adds the package so we can add other packages.
+#XXX Not sure this works for cross build, so punting for the moment
+#add_port ports-mgmt/pkg
+#add_port security/sudo
+#add_port ftp/curl
+
+rp=$(realpath ${NANO_OBJ}/)
+__a=`mount | grep ${rp} | awk '{print length($3), $3;}' | sort -rn | awk '{$1=""; print;}'`
+if [ -n "$__a" ]; then
+ echo "unmounting $__a"
+ umount $__a
+fi
+
+NANO_BOOTLOADER="boot/boot0"
+
+if [ "$DEBUG" = 1 ]; then
+ DEBUG_BUILD="
+DEBUG_FLAGS= -g
+"
+else
+ DEBUG_INSTALL="
+INSTALL_NODEBUG= t
+"
+fi
+
+CONF_INSTALL="$CONF_BUILD
+${DEBUG_BUILD}
+"
+CONF_INSTALL="$CONF_INSTALL
+${DEBUG_INSTALL}
+"
+
+if [ "${NANO_PACKAGE_ONLY}" -eq 1 ]; then
+ CONF_INSTALL="${CONF_INSTALL}
+${PKG_ONLY_MAKE_CONF}
+"
+ echo "Automatically building a thin image with packages"
+else
+ echo "Automatically building a * * F A T * * image so we can build ports"
+fi
+
+VARS="MASTER_SITE_BACKUP MASTER_SITE_OVERRIDE PACKAGEROOT PACKAGESITE"
+
+for var in $VARS; do
+ val=$(eval echo "\$$var")
+ if [ -n "$val" ]; then
+ CONF_INSTALL="${CONF_INSTALL}
+$var=$val"
+ fi
+done
+
+hack_nsswitch_conf ( )
+{
+ # Remove all references to NIS in the nsswitch.conf file
+ # Not sure this is still needed, but FreeNAS has it...
+ sed -i.bak -es/nis/files/g ${NANO_WORLDDIR}/etc/nsswitch.conf
+ rm -f ${NANO_WORLDDIR}/etc/nsswitch.conf.bak
+}
+customize_cmd hack_nsswitch_conf
+
+save_build ( )
+{
+ VERSION_FILE=${NANO_WORLDDIR}/etc/version
+ if [ "${SVNREVISION}" = "${REVISION}" ]; then
+ echo "${NANO_NAME}" > "${VERSION_FILE}"
+ else
+ echo "${NANO_NAME} (${SVNREVISION})" > "${VERSION_FILE}"
+ fi
+}
+customize_cmd save_build
+
+remove_patch_divots ( )
+{
+ find ${NANO_WORLDDIR} -name \*.orig -or -name \*.rej -delete
+}
+customize_cmd remove_patch_divots
+
+shrink_md_fbsize()
+{
+ # We have a lot of little files on our memory disks. Let's decrease
+ # the block and frag size to fit more little files on them (this
+ # halves our space requirement by ~50% on /etc and /var on 8.x --
+ # and gives us more back on 9.x as the default block and frag size
+ # are 4 times larger).
+ sed -i '' -e 's,-S -i 4096,-S -i 4096 -b 4096 -f 512,' \
+ ${NANO_WORLDDIR}/etc/rc.initdiskless
+}
+customize_cmd shrink_md_fbsize
+
+if [ "${DEBUG}" = 1 ]; then
+
+unmute_console_logging()
+{
+ # /var is small. Don't fill it up with messages from console.log
+ # because it's a chatty log.
+ sed -i '' -e 's/#console.info/console.info/' \
+ "${NANO_WORLDDIR}/etc/syslog.conf"
+}
+customize_cmd unmute_console_logging
+
+fi
+
+product_custom()
+{
+ if [ -z ${NANO_NOPRIV_BUILD} ]; then
+ # Last second tweaks -- generally not needed
+ chown -R root:wheel ${NANO_WORLDDIR}/root
+ chmod 0755 ${NANO_WORLDDIR}/root/*
+ chmod 0755 ${NANO_WORLDDIR}/*
+ chown -R root:wheel ${NANO_WORLDDIR}/etc
+ chown -R root:wheel ${NANO_WORLDDIR}/boot
+ chown root:wheel ${NANO_WORLDDIR}/
+ chown root:wheel ${NANO_WORLDDIR}/usr
+ else
+ # Construct an mtree after our messing around with the tree
+ # Trim out all the uid / gid stuff, since for new files it
+ # is likely wrong, and for other files it doesn't matter.
+ mtree -p ${NANO_WORLDDIR} -c | \
+ mtree -C | \
+ sed -e 's/ uid=[0-9][0-9]* / /g;s/ gid=[0-9][0-9]* / /' \
+ > ${NANO_OBJ}/_.mtree.post
+
+ # Sort the metalog, and save the original. Sadly, this
+ # seems to expand the uname= and gname= to uid= and gid=
+ # which is lame and likely a bug in mtree. The man page
+ # is just vague enough to be infuriating as to the proper
+ # behavior. Happily, it removes all the // that can confound
+ # things.
+ mtree -C -S -f ${NANO_OBJ}/_.metalog > ${NANO_OBJ}/_.mtree.pre
+ mv ${NANO_OBJ}/_.metalog ${NANO_OBJ}/_.metalog.install
+
+ # mtree -f -f produces a comm-like output. The first column will
+ # be the files we deleted, so we ignore it. The second column is
+ # the same in both, so we pass it through. The third column is
+ # listed twice, so we ignore the second one. We also trim out
+ # the size, because size just doesn't matter as nanobsd and
+ # customizations often tweak files changing their size. We also
+ # add 'optional' to every file in case something slipped through
+ # that's gone from the tree, though maybe that's a real bug.
+ #
+ # To make matters worse, currently mtree in freebsd uses the
+ # old 'file' keyword rather than the newer type=file. Ditto
+ # dir and link. Also, nlinks is output, which is lame. And
+ # there's a bloatload of extra flags=none, which I remove too.
+ #
+ # Even worse is that all the uid / gid stuff is also tossed
+ # into the scrap heap. Hope they weren't important.
+ #
+ # And somewhere along the way, flags seem to have gone missing.
+ #
+ # Oh, and we have to add back in ./ to keep makefs happy.
+ #
+ # And then we have to sort the damn hing so directories come
+ # before subdirectories
+ #
+ # Note: For reasons unknown, all the directories are changing
+ # from 755 to 775, so that's why we ignore the second line.
+ # We also get repeats for all the files whose size changed.
+ # Perhaps we should filter those going into the pre/post files
+ # and not here.
+ mtree -f ${NANO_OBJ}/_.mtree.pre -f ${NANO_OBJ}/_.mtree.post | \
+ awk '
+ function frob_bogus_mtree_line(old) {
+ line = "./" old " gid=0 uid=0"
+ # XXX make this a damn function
+ sub(/^\.\/\./, ".", line);
+ sub(/ file /, " type=file ", line);
+ sub(/ dir /, " type=dir ", line);
+ sub(/ link /, " type=link ", line);
+ sub(/ size=[0-9][0-9]*/, "", line);
+ sub(/ nlinks=[0-9][0-9]*/, "", line);
+ sub(/ flags=none*/, "", line);
+ return line;
+ }
+ BEGIN {
+ x = 0;
+ FS="\t";
+ print "#mtree 2.0";
+ }
+ $1 != "" {}
+ $2 != "" {
+ print frob_bogus_mtree_line($2);
+ }
+ $3 != "" {
+ if (x == 0) {
+ print frob_bogus_mtree_line($3);
+ x = 1;
+ } else {
+ x = 0;
+ }
+ }
+ ' | sort > ${NANO_OBJ}/_.metalog
+ fi
+}
+late_customize_cmd product_custom
diff --git a/tools/tools/nanobsd/embedded/qemu-amd64.cfg b/tools/tools/nanobsd/embedded/qemu-amd64.cfg
new file mode 100644
index 0000000..5ca6837
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/qemu-amd64.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=amd64
+NANO_KERNEL=GENERIC
+NANO_DRIVE=ada0
+NANO_NAME=qemu-amd64
+
+export EMBED_OMIT_FAT=t
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/qemu-i386.cfg b/tools/tools/nanobsd/embedded/qemu-i386.cfg
new file mode 100644
index 0000000..856f61f
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/qemu-i386.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=i386
+NANO_KERNEL=GENERIC
+NANO_DRIVE=ada0
+NANO_NAME=qemu-i386
+
+export EMBED_OMIT_FAT=t
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/qemu-mips.cfg b/tools/tools/nanobsd/embedded/qemu-mips.cfg
new file mode 100644
index 0000000..9b9581d
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/qemu-mips.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=mips
+NANO_KERNEL=MALTA
+NANO_DRIVE=ada0
+NANO_NAME=qemu-mips
+
+export EMBED_OMIT_FAT=t
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/qemu-mips64.cfg b/tools/tools/nanobsd/embedded/qemu-mips64.cfg
new file mode 100644
index 0000000..9ac22cd
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/qemu-mips64.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=mips
+NANO_KERNEL=MALTA64
+NANO_DRIVE=ada0
+NANO_NAME=qemu-mips64
+
+export EMBED_OMIT_FAT=t
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/qemu-powerpc.cfg b/tools/tools/nanobsd/embedded/qemu-powerpc.cfg
new file mode 100644
index 0000000..8c588b1
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/qemu-powerpc.cfg
@@ -0,0 +1,43 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+# Open question: do we have one for MAC G4 and one for Book-E?
+NANO_ARCH=powerpc
+NANO_KERNEL=GENERIC
+NANO_DRIVE=ada0
+NANO_NAME=qemu-powerpc
+
+export EMBED_OMIT_FAT=t
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg b/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg
new file mode 100644
index 0000000..1563472
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=powerpc64
+NANO_KERNEL=GENERIC64
+NANO_DRIVE=ada0
+NANO_NAME=qemu-powerpc64
+
+export EMBED_OMIT_FAT=t
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/qemu-sparc64.cfg b/tools/tools/nanobsd/embedded/qemu-sparc64.cfg
new file mode 100644
index 0000000..656fcef
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/qemu-sparc64.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=sparc64
+NANO_KERNEL=GENERIC
+NANO_DRIVE=ada0
+NANO_NAME=qemu-sparc64
+
+export EMBED_OMIT_FAT=t
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/rpi.cfg b/tools/tools/nanobsd/embedded/rpi.cfg
new file mode 100644
index 0000000..598de19
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/rpi.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=armv6
+NANO_KERNEL=RPI-B
+NANO_DRIVE=mmcsd0
+NANO_NAME=rpi-b
+NANO_BOOT_PKG=u-boot-rpi
+NANO_CPUTYPE=arm1176jzf-s
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/rpi2.cfg b/tools/tools/nanobsd/embedded/rpi2.cfg
new file mode 100644
index 0000000..043874c
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/rpi2.cfg
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=armv6
+NANO_KERNEL=RPI2
+NANO_DRIVE=mmcsd0
+NANO_NAME=rpi2
+NANO_BOOT_PKG=u-boot-rpi2
+NANO_CPUTYPE=cortex-a7
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/sam9260ek.cfg b/tools/tools/nanobsd/embedded/sam9260ek.cfg
new file mode 100644
index 0000000..fec892a
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/sam9260ek.cfg
@@ -0,0 +1,41 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=arm
+NANO_KERNEL=SAM9260EK
+NANO_DRIVE=mmcsd0
+NANO_NAME=sam9260ek
+NANO_CPUTYPE=arm926ej-s
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/embedded/sam9g20ek.cfg b/tools/tools/nanobsd/embedded/sam9g20ek.cfg
new file mode 100644
index 0000000..8fe67d4
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/sam9g20ek.cfg
@@ -0,0 +1,41 @@
+# $FreeBSD$
+
+#-
+# Copyright (c) 2015 Warner Losh. All Rights Reserved.
+# Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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.
+#
+# This file is heavily derived from both Sam Leffler's Avilia config,
+# as well as the BSDRP project's config file. Neither of these have
+# an explicit copyright/license statement, but are implicitly BSDL. This
+# example has been taken from the FreeNAS project and simplified to meet
+# the needs of the example.
+#
+
+NANO_ARCH=arm
+NANO_KERNEL=SAM9G20EK
+NANO_DRIVE=mmcsd0
+NANO_NAME=sam9g20ek
+NANO_CPUTYPE=arm926ej-s
+
+. common # Pull in common definitions, keep last
diff --git a/tools/tools/nanobsd/mtree-dedup.awk b/tools/tools/nanobsd/mtree-dedup.awk
new file mode 100755
index 0000000..17aa5e2
--- /dev/null
+++ b/tools/tools/nanobsd/mtree-dedup.awk
@@ -0,0 +1,197 @@
+#!/usr/bin/awk -f
+
+#
+# Copyright (c) 2015 M. Warner Losh.
+# 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$
+#
+
+#
+# Takes a meta-log created by installworld and friends, plus
+# additions from NanoBSD to augment its build to communicate when
+# files move around after installworld / installkernel phase of
+# NanoBSD.
+#
+# All mtree lines from the metafile have a path, followed by
+# a number of keywords.
+#
+# This script recognizes the following new keywords
+#
+# unlink[=x] remove the path from the output.
+# copy_from=x create new entry for path copied from
+# the keywords from x.
+# move_from=x create new entry for path copied from
+# the keywords from x. Remove path from
+# the output.
+#
+# In addition, when path matches a previous entry, the
+# new entry and previous entry are merged.
+#
+# Special note: when uid and uname are both present,
+# uid is ignored. Ditto gid/gname.
+#
+# Also, the paths above have to match exactly, so X
+# should start with "./".
+#
+
+function die(str)
+{
+ print str > "/dev/stderr";
+ exit 1;
+}
+
+function kv(str)
+{
+ if (split(str, xxx, "=") == 2) {
+ kv_key = xxx[1];
+ kv_value = xxx[2];
+ } else {
+ kv_key = str;
+ kv_value = nv;
+ }
+}
+
+# Output the mtree for path based on the kvs.
+function mtree_from_kvs(path, kvs)
+{
+ lv = path " ";
+ for (k in kvs) {
+ if (kvs[k] == nv)
+ lv = lv k " ";
+ else
+ lv = lv k "=" kvs[k] " ";
+ }
+ return lv;
+}
+
+# Parse the mtree line into path + KVs. Use a sentinal value
+# for a bare keyword, which is extremely unlikely to be used
+# for real.
+function line2kv(kvs, str)
+{
+ delete kvs;
+
+ n = split(str, yyy, " ");
+ for (i = 2; i <= n; i++) {
+ s = yyy[i];
+ if (split(s, xxx, "=") == 2)
+ kvs[xxx[1]] = xxx[2];
+ else
+ kvs[s] = nv;
+ }
+}
+
+
+# old += new
+function merge_kvs(old, new)
+{
+ for (k in new) {
+ # uname / uid -- last one wins.
+ if (k == "uid" && "uname" in old)
+ delete old["uname"]
+ if (k == "uname" && "uid" in old)
+ delete old["uid"];
+ # gname / gid -- last one wins.
+ if (k == "gid" && "gname" in old)
+ delete old["gname"]
+ if (k == "gname" && "gid" in old)
+ delete old["gid"];
+ # Otherwise newest value wins
+ old[k] = new[k];
+ }
+}
+
+# Process the line we've read in, per the comments below
+function process_line(path, new)
+{
+ # Clear kvs
+ line2kv(new_kvs, new);
+
+ if ("unlink" in new_kvs) {
+ # A file removed
+ # Sanity check to see if tree[path] exists?
+ # Makes sure when foo/bar/baz exists and foo/bar
+ # unlinked, baz is gone (for all baz).
+ if (path !~ "^\./")
+ die("bad path in : " new);
+ delete tree[path]; # unlink
+ return;
+ # } else if (new_kvs["append_from"]) { # not implemented
+ } else if ("copy_from" in new_kvs) {
+ # A file copied from another location, preserve its
+ # attribute for new file.
+ # Also merge any new attributes from this line.
+ from = new_kvs["copy_from"];
+ if (from !~ "^\./")
+ die("bad path in : " new);
+ delete new_kvs["copy_from"];
+ line2kv(old_kvs, tree[from]); # old_kvs = kv's in entry
+ merge_kvs(old_kvs, new_kvs); # old_kvs += new_kvs
+ tree[path] = mtree_from_kvs(path, old_kvs);
+ } else if ("move_from" in new_kvs) {
+ # A file moved from another location, preserve its
+ # attribute for new file, and scrag old location
+ # Also merge any new attributes from this line.
+ from = new_kvs["move_from"];
+ if (from !~ "^\./")
+ die("bad path in : " new);
+ delete new_kvs["move_from"];
+ line2kv(old_kvs, tree[from]); # old_kvs = kv's in entry
+ merge_kvs(old_kvs, new_kvs); # old_kvs += new_kvs
+ tree[path] = mtree_from_kvs(path, old_kvs);
+ delete tree[from]; # unlink
+ } else if (tree[path]) { # Update existing entry with new line
+ line2kv(old_kvs, tree[path]); # old_kvs = kv's in entry
+ merge_kvs(old_kvs, new_kvs); # old_kvs += new_kvs
+ tree[path] = mtree_from_kvs(path, old_kvs);
+ } else { # Add entry plus defaults
+ delete old_kvs;
+ merge_kvs(old_kvs, defaults);
+ merge_kvs(old_kvs, new_kvs);
+ tree[path] = mtree_from_kvs(path, old_kvs);
+ }
+}
+
+BEGIN {
+ nv = "___NO__VALUE___";
+
+ while ((getline < "/dev/stdin") > 0) {
+ if ($1 == "/set") {
+ for (i = 2; i <= NF; i++) {
+ kv($i);
+ defaults[kv_key] = kv_value;
+ }
+ } else if ($1 == "/unset") {
+ for (i = 2; i <= NF; i++) {
+ kv($i);
+ delete defaults[kv_key];
+ }
+ } else
+ process_line($1, $0);
+ }
+
+ for (x in tree)
+ print tree[x];
+}
diff --git a/tools/tools/nanobsd/pcengines/ALIX_NFS b/tools/tools/nanobsd/pcengines/ALIX_NFS
index 6555ed5..ca7f57b 100644
--- a/tools/tools/nanobsd/pcengines/ALIX_NFS
+++ b/tools/tools/nanobsd/pcengines/ALIX_NFS
@@ -2,119 +2,8 @@
# $FreeBSD$
#
-cpu I586_CPU
-ident ALIX_DSK
-makeoptions DEBUG=-g
-options CPU_GEODE
-options SCHED_ULE
-options PREEMPTION
-options INET
-options INET6
-options FFS
-options SOFTUPDATES
-options UFS_ACL
-options UFS_DIRHASH
-options NFSCL # Network Filesystem Client
-options NFSLOCKD
-options MSDOSFS
-options CD9660
-options PROCFS
-options PSEUDOFS
-options GEOM_PART_GPT
-options GEOM_LABEL
-options COMPAT_43TTY
-options COMPAT_FREEBSD4 # Compatible with FreeBSD4
-options COMPAT_FREEBSD5 # Compatible with FreeBSD5
-options COMPAT_FREEBSD6 # Compatible with FreeBSD6
-options COMPAT_FREEBSD7 # Compatible with FreeBSD7
-options COMPAT_FREEBSD9 # Compatible with FreeBSD9
-options COMPAT_FREEBSD10 # Compatible with FreeBSD10
-options SCSI_DELAY=5000
-options SYSVSHM
-options SYSVMSG
-options SYSVSEM
-options P1003_1B_SEMAPHORES
-options _KPOSIX_PRIORITY_SCHEDULING
-options PRINTF_BUFR_SIZE=128
-device apic
-device pci
-device fdc
-device ata
-device atadisk
-device atapicd
-device atapist
-options ATA_STATIC_ID
-device scbus
-device da
-device sa
-device cd
-device pass
-device uart
-device em
-device miibus
-device vr
-device wlan
-options IEEE80211_DEBUG
-options IEEE80211_AMPDU_AGE
-options IEEE80211_SUPPORT_MESH
-device wlan_wep
-device wlan_ccmp
-device wlan_tkip
-device wlan_amrr
-device an
-device ath
-device ath_hal
-options AH_SUPPORT_AR5416
-device ath_rate_sample
-device wi
-device loop
-device random
-device ether
-device tun
-device pty
-device md
-device gif
-device firmware
-device bpf
-device uhci
-device ohci
-device ehci
-device usb
-device ulpt
-device umass
-device u3g
-device ubsa
-device uftdi
-
-options INCLUDE_CONFIG_FILE
-
-options ALTQ
-options ALTQ_CBQ
-options ALTQ_RED
-options ALTQ_RIO
-options ALTQ_HFSC
-options ALTQ_CDNR
-options ALTQ_PRIQ
-
-device pf
-device pflog
-device pfsync
-device carp
-device if_bridge
-
-options DEVICE_POLLING
-
-options NETGRAPH
-options NETGRAPH_BPF
-options NETGRAPH_ETHER
-options NETGRAPH_IFACE
-options NETGRAPH_PPP
-options NETGRAPH_PPPOE
-options NETGRAPH_PPTPGRE
-options NETGRAPH_MPPC_ENCRYPTION
-options NETGRAPH_SOCKET
-options NETGRAPH_KSOCKET
-options NETGRAPH_VJC
+include ALIX_DSK
+ident ALIX_NFS
options NFS_ROOT
options BOOTP
diff --git a/tools/tools/nanobsd/pcengines/common.conf b/tools/tools/nanobsd/pcengines/common.conf
index 40275dd..687fd74 100644
--- a/tools/tools/nanobsd/pcengines/common.conf
+++ b/tools/tools/nanobsd/pcengines/common.conf
@@ -13,9 +13,6 @@ NANO_RAM_TMPVARSIZE=40960
NANO_PMAKE="make -j 8"
NANO_MD_BACKING="swap"
-#NANO_MAKEFS="makefs \
-# -o bsize=4096,fsize=512,density=8192,optimization=space"
-#export NANO_MAKEFS
# Options to put in make.conf during buildworld only
CONF_BUILD='
@@ -26,7 +23,6 @@ CONF_INSTALL='
'
# Options to put in make.conf during both build- & installworld.
CONF_WORLD='
-#TARGET_ARCH=i386
CFLAGS=-O -pipe
WITHOUT_ACPI=
WITHOUT_TESTS=
diff --git a/tools/tools/ncpus/Makefile b/tools/tools/ncpus/Makefile
index 011f49e..b2683e1 100644
--- a/tools/tools/ncpus/Makefile
+++ b/tools/tools/ncpus/Makefile
@@ -9,7 +9,6 @@ SRCS+= biosmptable.c
BINDIR= /usr/local/bin
WARNS?= 6
-DPADD= ${LIBDEVINFO}
-LDADD= -ldevinfo
+LIBADD= devinfo
.include <bsd.prog.mk>
diff --git a/tools/tools/net80211/stumbler/Makefile b/tools/tools/net80211/stumbler/Makefile
index e7ea87c..e840be7 100644
--- a/tools/tools/net80211/stumbler/Makefile
+++ b/tools/tools/net80211/stumbler/Makefile
@@ -2,8 +2,7 @@
PROG= stumbler
BINDIR= /usr/local/bin
-DPADD= ${LIBPCAP} ${LIBNCURSESW}
-LDADD= -lpcap -lncursesw
+LIBADD= pcap ncursesw
CFLAGS=-g
MAN=
diff --git a/tools/tools/net80211/wesside/dics/Makefile b/tools/tools/net80211/wesside/dics/Makefile
index 4f368e3..96583cf 100644
--- a/tools/tools/net80211/wesside/dics/Makefile
+++ b/tools/tools/net80211/wesside/dics/Makefile
@@ -2,8 +2,7 @@
PROG= dics
BINDIR= /usr/local/bin
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD= z
CFLAGS=-g
MAN=
diff --git a/tools/tools/net80211/wesside/udps/Makefile b/tools/tools/net80211/wesside/udps/Makefile
index caa2fc0..b4dd203 100644
--- a/tools/tools/net80211/wesside/udps/Makefile
+++ b/tools/tools/net80211/wesside/udps/Makefile
@@ -2,8 +2,7 @@
PROG= udps
BINDIR= /usr/local/bin
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD= z
CFLAGS=-g
MAN=
diff --git a/tools/tools/net80211/wesside/wesside/Makefile b/tools/tools/net80211/wesside/wesside/Makefile
index 5c39407..65942e5 100644
--- a/tools/tools/net80211/wesside/wesside/Makefile
+++ b/tools/tools/net80211/wesside/wesside/Makefile
@@ -2,8 +2,7 @@
PROG= wesside
BINDIR= /usr/local/bin
-DPADD= ${LIBZ}
-LDADD= -lz
+LIBADD= z
CFLAGS=-g
MAN=
SRCS=wesside.c aircrack-ptw-lib.c
diff --git a/tools/tools/netrate/http/Makefile b/tools/tools/netrate/http/Makefile
index d501e61..bd144b5 100644
--- a/tools/tools/netrate/http/Makefile
+++ b/tools/tools/netrate/http/Makefile
@@ -3,7 +3,6 @@
PROG= http
MAN=
WARNS?= 3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/netrate/httpd/Makefile b/tools/tools/netrate/httpd/Makefile
index 2318dae..6acbe64 100644
--- a/tools/tools/netrate/httpd/Makefile
+++ b/tools/tools/netrate/httpd/Makefile
@@ -3,7 +3,6 @@
PROG= httpd
MAN=
WARNS?= 3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/netrate/juggle/Makefile b/tools/tools/netrate/juggle/Makefile
index 751bbb5..f7b7afd 100644
--- a/tools/tools/netrate/juggle/Makefile
+++ b/tools/tools/netrate/juggle/Makefile
@@ -3,7 +3,6 @@
PROG= juggle
MAN=
WARNS?= 3
-DPADD= ${LIBPTHREAD}
-LDADD= -lpthread
+LIBADD= pthread
.include <bsd.prog.mk>
diff --git a/tools/tools/tscdrift/Makefile b/tools/tools/tscdrift/Makefile
index 0b5c8ac..fad714d 100644
--- a/tools/tools/tscdrift/Makefile
+++ b/tools/tools/tscdrift/Makefile
@@ -4,7 +4,6 @@ PROG= tscdrift
MAN=
WARNS?= 6
-LDADD= -lpthread -lm
-DPADD= ${LIBPTHREAD} ${LIBM}
+LIBADD= pthread m
.include <bsd.prog.mk>
diff --git a/tools/tools/umastat/Makefile b/tools/tools/umastat/Makefile
index 8160936..92cd50e 100644
--- a/tools/tools/umastat/Makefile
+++ b/tools/tools/umastat/Makefile
@@ -4,7 +4,6 @@ PROG= umastat
MAN=
WARNS?= 3
-DPADD= ${LIBKVM}
-LDADD= -lkvm
+LIBADD= kvm
.include <bsd.prog.mk>
diff --git a/tools/tools/usbtest/Makefile b/tools/tools/usbtest/Makefile
index f9b16bc..b535f52 100644
--- a/tools/tools/usbtest/Makefile
+++ b/tools/tools/usbtest/Makefile
@@ -33,8 +33,7 @@ SRCS+= usb_modem_test.c
SRCS+= usb_control_ep_test.c
SYSDIR?= ${.CURDIR}/../../../sys
-DPADD+= ${LIBUSB}
-LDADD+= -lusb
+LIBADD+= usb
WARNS= 3
diff --git a/tools/tools/vimage/Makefile b/tools/tools/vimage/Makefile
index 76c7617..262e3c6 100644
--- a/tools/tools/vimage/Makefile
+++ b/tools/tools/vimage/Makefile
@@ -1,8 +1,7 @@
# $FreeBSD$
PROG= vimage
-LDADD= -ljail
-DPADD= ${LIBJAIL}
+LIBADD= jail
WARNS?= 2
CFLAGS+= -I../../../sys
diff --git a/tools/tools/zfsboottest/Makefile b/tools/tools/zfsboottest/Makefile
index 7362073..4b08a2d 100644
--- a/tools/tools/zfsboottest/Makefile
+++ b/tools/tools/zfsboottest/Makefile
@@ -17,7 +17,7 @@ CFLAGS= -O1 \
-fdiagnostics-show-option \
-W -Wextra -Wno-sign-compare -Wno-unused-parameter
CFLAGS+=-m32
-LDADD+= -lmd
+LIBADD+= md
.if ${MACHINE_CPUARCH} == "amd64"
beforedepend zfsboottest.o: machine
diff --git a/usr.bin/bluetooth/btsockstat/Makefile.depend b/usr.bin/bluetooth/btsockstat/Makefile.depend
index 0929154..0ea1c90 100644
--- a/usr.bin/bluetooth/btsockstat/Makefile.depend
+++ b/usr.bin/bluetooth/btsockstat/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/libbluetooth \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.bin/caesar/Makefile b/usr.bin/caesar/Makefile
index 88b79ee..2ad96b7 100644
--- a/usr.bin/caesar/Makefile
+++ b/usr.bin/caesar/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PROG= caesar
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
SCRIPTS=rot13.sh
MAN= caesar.6
MLINKS= caesar.6 rot13.6
diff --git a/usr.bin/clang/clang-tblgen/Makefile.depend b/usr.bin/clang/clang-tblgen/Makefile.depend
index 0e9e94c..58ed9a7 100644
--- a/usr.bin/clang/clang-tblgen/Makefile.depend
+++ b/usr.bin/clang/clang-tblgen/Makefile.depend
@@ -12,6 +12,7 @@ DIRDEPS = \
lib/libc \
lib/libc++ \
lib/libcompiler_rt \
+ lib/libthr \
lib/msun \
lib/ncurses/ncursesw \
diff --git a/usr.bin/clang/clang.prog.mk b/usr.bin/clang/clang.prog.mk
index 9e929c4..912f678 100644
--- a/usr.bin/clang/clang.prog.mk
+++ b/usr.bin/clang/clang.prog.mk
@@ -9,11 +9,7 @@ DPADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a
LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a
.endfor
-DPADD+= ${LIBNCURSESW}
-LDADD+= -lncursesw
-
-DPADD+= ${LIBPTHREAD}
-LDADD+= -lpthread
+LIBADD+= ncursesw pthread
BINDIR?= /usr/bin
diff --git a/usr.bin/clang/clang/Makefile b/usr.bin/clang/clang/Makefile
index 7ee3ad8..18ee730 100644
--- a/usr.bin/clang/clang/Makefile
+++ b/usr.bin/clang/clang/Makefile
@@ -121,7 +121,6 @@ LIBDEPS=clangfrontendtool \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD+= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/clang/Makefile.depend b/usr.bin/clang/clang/Makefile.depend
index 9d31380..bee00f5 100644
--- a/usr.bin/clang/clang/Makefile.depend
+++ b/usr.bin/clang/clang/Makefile.depend
@@ -28,7 +28,6 @@ DIRDEPS = \
lib/clang/libllvmaarch64asmparser \
lib/clang/libllvmaarch64codegen \
lib/clang/libllvmaarch64desc \
- lib/clang/libllvmaarch64disassembler \
lib/clang/libllvmaarch64info \
lib/clang/libllvmaarch64instprinter \
lib/clang/libllvmaarch64utils \
@@ -57,7 +56,6 @@ DIRDEPS = \
lib/clang/libllvmmipsasmparser \
lib/clang/libllvmmipscodegen \
lib/clang/libllvmmipsdesc \
- lib/clang/libllvmmipsdisassembler \
lib/clang/libllvmmipsinfo \
lib/clang/libllvmmipsinstprinter \
lib/clang/libllvmobjcarcopts \
@@ -75,7 +73,6 @@ DIRDEPS = \
lib/clang/libllvmsparcasmparser \
lib/clang/libllvmsparccodegen \
lib/clang/libllvmsparcdesc \
- lib/clang/libllvmsparcdisassembler \
lib/clang/libllvmsparcinfo \
lib/clang/libllvmsparcinstprinter \
lib/clang/libllvmsupport \
@@ -85,13 +82,13 @@ DIRDEPS = \
lib/clang/libllvmx86asmparser \
lib/clang/libllvmx86codegen \
lib/clang/libllvmx86desc \
- lib/clang/libllvmx86disassembler \
lib/clang/libllvmx86info \
lib/clang/libllvmx86instprinter \
lib/clang/libllvmx86utils \
lib/libc \
lib/libc++ \
lib/libcompiler_rt \
+ lib/libthr \
lib/libz \
lib/msun \
lib/ncurses/ncursesw \
diff --git a/usr.bin/clang/llc/Makefile b/usr.bin/clang/llc/Makefile
index 75d8337..d54a3ce 100644
--- a/usr.bin/clang/llc/Makefile
+++ b/usr.bin/clang/llc/Makefile
@@ -68,7 +68,6 @@ LIBDEPS=llvmmirparser \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD+= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/lldb/Makefile.depend b/usr.bin/clang/lldb/Makefile.depend
index 17b44d8..d615d32 100644
--- a/usr.bin/clang/lldb/Makefile.depend
+++ b/usr.bin/clang/lldb/Makefile.depend
@@ -28,7 +28,13 @@ DIRDEPS = \
lib/clang/liblldbHostCommon \
lib/clang/liblldbHostFreeBSD \
lib/clang/liblldbHostPOSIX \
+ lib/clang/liblldbInitialization \
lib/clang/liblldbInterpreter \
+ lib/clang/liblldbPluginABISysV_arm \
+ lib/clang/liblldbPluginABISysV_arm64 \
+ lib/clang/liblldbPluginABISysV_i386 \
+ lib/clang/liblldbPluginABISysV_mips \
+ lib/clang/liblldbPluginABISysV_mips64 \
lib/clang/liblldbPluginABISysV_ppc \
lib/clang/liblldbPluginABISysV_ppc64 \
lib/clang/liblldbPluginABISysV_x86_64 \
@@ -38,6 +44,8 @@ DIRDEPS = \
lib/clang/liblldbPluginDynamicLoaderStatic \
lib/clang/liblldbPluginInstructionARM \
lib/clang/liblldbPluginInstructionARM64 \
+ lib/clang/liblldbPluginInstructionMIPS \
+ lib/clang/liblldbPluginInstructionMIPS64 \
lib/clang/liblldbPluginInstrumentationRuntimeAddressSanitizer \
lib/clang/liblldbPluginJITLoaderGDB \
lib/clang/liblldbPluginMemoryHistoryASan \
diff --git a/usr.bin/clang/lli/Makefile b/usr.bin/clang/lli/Makefile
index 33aa71f..7852095 100644
--- a/usr.bin/clang/lli/Makefile
+++ b/usr.bin/clang/lli/Makefile
@@ -44,7 +44,6 @@ LIBDEPS=llvmx86disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-ar/Makefile b/usr.bin/clang/llvm-ar/Makefile
index 9165773..5126257 100644
--- a/usr.bin/clang/llvm-ar/Makefile
+++ b/usr.bin/clang/llvm-ar/Makefile
@@ -66,7 +66,6 @@ LIBDEPS=llvmlibdriver \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-cxxdump/Makefile b/usr.bin/clang/llvm-cxxdump/Makefile
index 34af239..b483930 100644
--- a/usr.bin/clang/llvm-cxxdump/Makefile
+++ b/usr.bin/clang/llvm-cxxdump/Makefile
@@ -66,7 +66,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-dwarfdump/Makefile b/usr.bin/clang/llvm-dwarfdump/Makefile
index d27a91e..dab8e37 100644
--- a/usr.bin/clang/llvm-dwarfdump/Makefile
+++ b/usr.bin/clang/llvm-dwarfdump/Makefile
@@ -15,7 +15,6 @@ LIBDEPS=llvmdebuginfodwarf \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-lto/Makefile b/usr.bin/clang/llvm-lto/Makefile
index 98d673b..abda951 100644
--- a/usr.bin/clang/llvm-lto/Makefile
+++ b/usr.bin/clang/llvm-lto/Makefile
@@ -72,7 +72,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-mc/Makefile b/usr.bin/clang/llvm-mc/Makefile
index f0c2367..0fe37c1 100644
--- a/usr.bin/clang/llvm-mc/Makefile
+++ b/usr.bin/clang/llvm-mc/Makefile
@@ -66,7 +66,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile
index 76dfa62..38dd871 100644
--- a/usr.bin/clang/llvm-nm/Makefile
+++ b/usr.bin/clang/llvm-nm/Makefile
@@ -64,7 +64,6 @@ LIBDEPS=llvmaarch64disassembler \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-objdump/Makefile b/usr.bin/clang/llvm-objdump/Makefile
index 4e87913..49123a5 100644
--- a/usr.bin/clang/llvm-objdump/Makefile
+++ b/usr.bin/clang/llvm-objdump/Makefile
@@ -69,7 +69,6 @@ LIBDEPS=llvmdebuginfodwarf \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-pdbdump/Makefile b/usr.bin/clang/llvm-pdbdump/Makefile
index f557ccf..5487490 100644
--- a/usr.bin/clang/llvm-pdbdump/Makefile
+++ b/usr.bin/clang/llvm-pdbdump/Makefile
@@ -26,7 +26,6 @@ LIBDEPS=llvmdebuginfopdb \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-rtdyld/Makefile b/usr.bin/clang/llvm-rtdyld/Makefile
index 7656543..ee386b4 100644
--- a/usr.bin/clang/llvm-rtdyld/Makefile
+++ b/usr.bin/clang/llvm-rtdyld/Makefile
@@ -69,7 +69,6 @@ LIBDEPS=llvmdebuginfodwarf \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/llvm-symbolizer/Makefile b/usr.bin/clang/llvm-symbolizer/Makefile
index 0c3c974d..c6281fd 100644
--- a/usr.bin/clang/llvm-symbolizer/Makefile
+++ b/usr.bin/clang/llvm-symbolizer/Makefile
@@ -17,7 +17,6 @@ LIBDEPS=llvmdebuginfopdb \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/opt/Makefile b/usr.bin/clang/opt/Makefile
index 1931393..e855759 100644
--- a/usr.bin/clang/opt/Makefile
+++ b/usr.bin/clang/opt/Makefile
@@ -78,7 +78,6 @@ LIBDEPS=llvmpasses \
llvmcore \
llvmsupport
-.include "../clang.prog.mk"
+LIBADD= z
-DPADD+= ${LIBZ}
-LDADD+= -lz
+.include "../clang.prog.mk"
diff --git a/usr.bin/clang/tblgen/Makefile.depend b/usr.bin/clang/tblgen/Makefile.depend
index 0e9e94c..58ed9a7 100644
--- a/usr.bin/clang/tblgen/Makefile.depend
+++ b/usr.bin/clang/tblgen/Makefile.depend
@@ -12,6 +12,7 @@ DIRDEPS = \
lib/libc \
lib/libc++ \
lib/libcompiler_rt \
+ lib/libthr \
lib/msun \
lib/ncurses/ncursesw \
diff --git a/usr.bin/cpio/Makefile b/usr.bin/cpio/Makefile
index 3b50742..a057822 100644
--- a/usr.bin/cpio/Makefile
+++ b/usr.bin/cpio/Makefile
@@ -2,21 +2,21 @@
.include <src.opts.mk>
-LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
-LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive
+_LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
+_LIBARCHIVECONFDIR= ${.CURDIR}/../../lib/libarchive
PROG= bsdcpio
BSDCPIO_VERSION_STRING= 3.1.2
-.PATH: ${LIBARCHIVEDIR}/cpio
+.PATH: ${_LIBARCHIVEDIR}/cpio
SRCS= cpio.c cmdline.c
-.PATH: ${LIBARCHIVEDIR}/libarchive_fe
+.PATH: ${_LIBARCHIVEDIR}/libarchive_fe
SRCS+= err.c line_reader.c
CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\"
-CFLAGS+= -DPLATFORM_CONFIG_H=\"${LIBARCHIVECONFDIR}/config_freebsd.h\"
-CFLAGS+= -I${LIBARCHIVEDIR}/cpio -I${LIBARCHIVEDIR}/libarchive_fe
+CFLAGS+= -DPLATFORM_CONFIG_H=\"${_LIBARCHIVECONFDIR}/config_freebsd.h\"
+CFLAGS+= -I${_LIBARCHIVEDIR}/cpio -I${_LIBARCHIVEDIR}/libarchive_fe
.ifdef RELEASE_CRUNCH
# FreeBSD's installer uses cpio in crunched binaries that are
diff --git a/usr.bin/cpio/tests/Makefile b/usr.bin/cpio/tests/Makefile
index d633abd..532e2ec 100644
--- a/usr.bin/cpio/tests/Makefile
+++ b/usr.bin/cpio/tests/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
+_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
ATF_TESTS_SH+= functional_test
@@ -12,20 +12,20 @@ CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
CFLAGS+= -I${.OBJDIR}
-CFLAGS+= -I${LIBARCHIVEDIR}/cpio -I${LIBARCHIVEDIR}/libarchive_fe
-CFLAGS+= -I${LIBARCHIVEDIR}/test_utils
+CFLAGS+= -I${_LIBARCHIVEDIR}/cpio -I${_LIBARCHIVEDIR}/libarchive_fe
+CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils
# Uncomment to link against dmalloc
#LDADD+= -L/usr/local/lib -ldmalloc
#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC
-.PATH: ${LIBARCHIVEDIR}/cpio
+.PATH: ${_LIBARCHIVEDIR}/cpio
CPIO_SRCS= cmdline.c
-.PATH: ${LIBARCHIVEDIR}/libarchive_fe
+.PATH: ${_LIBARCHIVEDIR}/libarchive_fe
CPIO_SRCS+= err.c
-.PATH: ${LIBARCHIVEDIR}/cpio/test
+.PATH: ${_LIBARCHIVEDIR}/cpio/test
TESTS_SRCS= \
test_0.c \
test_basic.c \
@@ -75,13 +75,13 @@ SRCS.bsdcpio_test= list.h \
${TESTS_SRCS} \
main.c
-.PATH: ${LIBARCHIVEDIR}/test_utils
+.PATH: ${_LIBARCHIVEDIR}/test_utils
SRCS.bsdcpio_test+= test_utils.c
LIBADD.bsdcpio_test= archive
list.h: ${TESTS_SRCS} Makefile
- @(cd ${LIBARCHIVEDIR}/tar/test && \
+ @(cd ${_LIBARCHIVEDIR}/tar/test && \
grep -h DEFINE_TEST ${.ALLSRC:N*Makefile}) > ${.TARGET}.tmp
@mv ${.TARGET}.tmp ${.TARGET}
diff --git a/usr.bin/dpv/Makefile.depend b/usr.bin/dpv/Makefile.depend
new file mode 100644
index 0000000..849ebfc
--- /dev/null
+++ b/usr.bin/dpv/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libdialog \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libdpv \
+ lib/libfigpar \
+ lib/libutil \
+ lib/msun \
+ lib/ncurses/ncursesw \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/drill/Makefile.depend b/usr.bin/drill/Makefile.depend
new file mode 100644
index 0000000..750a0a3
--- /dev/null
+++ b/usr.bin/drill/Makefile.depend
@@ -0,0 +1,22 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libldns \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/dtc/Makefile.depend b/usr.bin/dtc/Makefile.depend
new file mode 100644
index 0000000..b602708
--- /dev/null
+++ b/usr.bin/dtc/Makefile.depend
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libc++ \
+ lib/libcompiler_rt \
+ lib/libcxxrt \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/factor/Makefile b/usr.bin/factor/Makefile
index afc9510..58da816 100644
--- a/usr.bin/factor/Makefile
+++ b/usr.bin/factor/Makefile
@@ -9,8 +9,7 @@ CFLAGS+=-I${.CURDIR}/../primes
.if ${MK_OPENSSL} != "no"
CFLAGS+=-DHAVE_OPENSSL
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+LIBADD+=crypto
.endif
MAN= factor.6
diff --git a/usr.bin/grdc/Makefile b/usr.bin/grdc/Makefile
index 73d395a..be8c4b2 100644
--- a/usr.bin/grdc/Makefile
+++ b/usr.bin/grdc/Makefile
@@ -3,6 +3,6 @@
PROG= grdc
MAN= grdc.6
DPADD= ${LIBNCURSESW}
-LDADD= -lncursesw
+LIBADD= ncursesw
.include <bsd.prog.mk>
diff --git a/usr.bin/iconv/Makefile.depend b/usr.bin/iconv/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/usr.bin/iconv/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/ident/Makefile.depend b/usr.bin/ident/Makefile.depend
new file mode 100644
index 0000000..6002005
--- /dev/null
+++ b/usr.bin/ident/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libsbuf \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/ipcrm/Makefile.depend b/usr.bin/ipcrm/Makefile.depend
index a1ac545..34582cd 100644
--- a/usr.bin/ipcrm/Makefile.depend
+++ b/usr.bin/ipcrm/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.bin/ipcs/Makefile.depend b/usr.bin/ipcs/Makefile.depend
index a1ac545..34582cd 100644
--- a/usr.bin/ipcs/Makefile.depend
+++ b/usr.bin/ipcs/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.bin/iscsictl/Makefile.depend b/usr.bin/iscsictl/Makefile.depend
new file mode 100644
index 0000000..05df091
--- /dev/null
+++ b/usr.bin/iscsictl/Makefile.depend
@@ -0,0 +1,28 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcam \
+ lib/libcompiler_rt \
+ lib/libutil \
+ lib/libxo \
+ usr.bin/yacc.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+parse.o: parse.c
+parse.po: parse.c
+token.o: token.c
+token.o: y.tab.h
+token.po: token.c
+token.po: y.tab.h
+.endif
diff --git a/usr.bin/iscsictl/iscsictl.8 b/usr.bin/iscsictl/iscsictl.8
index ffa2e15..d31e1703 100644
--- a/usr.bin/iscsictl/iscsictl.8
+++ b/usr.bin/iscsictl/iscsictl.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 17, 2015
+.Dd December 1, 2015
.Dt ISCSICTL 8
.Os
.Sh NAME
@@ -80,6 +80,13 @@ utility is used to configure the iSCSI initiator.
.Pp
The following options are available:
.Bl -tag -width ".Fl A"
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl A
Add session.
.It Fl M
@@ -182,7 +189,9 @@ Disconnect all iSCSI sessions:
.Sh SEE ALSO
.Xr iscsi 4 ,
.Xr iscsi.conf 5 ,
-.Xr iscsid 8
+.Xr iscsid 8 ,
+.Xr libxo 3 ,
+.Xr xo_parse_args 3
.Sh HISTORY
The
.Nm
diff --git a/usr.bin/ktrdump/Makefile.depend b/usr.bin/ktrdump/Makefile.depend
index a1ac545..34582cd 100644
--- a/usr.bin/ktrdump/Makefile.depend
+++ b/usr.bin/ktrdump/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.bin/lex/Makefile.depend b/usr.bin/lex/Makefile.depend
index b5b8043..ae5191b 100644
--- a/usr.bin/lex/Makefile.depend
+++ b/usr.bin/lex/Makefile.depend
@@ -2,11 +2,14 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/yacc.host \
.include <dirdeps.mk>
diff --git a/usr.bin/mkcsmapper/Makefile.depend b/usr.bin/mkcsmapper/Makefile.depend
new file mode 100644
index 0000000..b0cb3ac
--- /dev/null
+++ b/usr.bin/mkcsmapper/Makefile.depend
@@ -0,0 +1,26 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/yacc.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+lex.o: lex.c
+lex.o: yacc.h
+lex.po: lex.c
+lex.po: yacc.h
+yacc.o: yacc.c
+yacc.po: yacc.c
+.endif
diff --git a/usr.bin/mkesdb/Makefile.depend b/usr.bin/mkesdb/Makefile.depend
new file mode 100644
index 0000000..091f950
--- /dev/null
+++ b/usr.bin/mkesdb/Makefile.depend
@@ -0,0 +1,25 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/yacc.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+lex.o: lex.c
+lex.o: yacc.h
+lex.po: lex.c
+lex.po: yacc.h
+yacc.o: yacc.c
+yacc.po: yacc.c
+.endif
diff --git a/usr.bin/mkimg/Makefile.depend b/usr.bin/mkimg/Makefile.depend
new file mode 100644
index 0000000..58f9a33
--- /dev/null
+++ b/usr.bin/mkimg/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/netstat/Makefile.depend b/usr.bin/netstat/Makefile.depend
index 76ce708..2abbfbf 100644
--- a/usr.bin/netstat/Makefile.depend
+++ b/usr.bin/netstat/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
lib/libmemstat \
lib/libnetgraph \
diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1
index 33eb216..a7e5291 100644
--- a/usr.bin/netstat/netstat.1
+++ b/usr.bin/netstat/netstat.1
@@ -28,7 +28,7 @@
.\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd August 27, 2015
+.Dd December 1, 2015
.Dt NETSTAT 1
.Os
.Sh NAME
@@ -151,6 +151,13 @@ or
addresses and ports appear as
.Dq Li * .
.Bl -tag -width indent
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl 4
Show IPv4 only.
See
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index aed3093..77487df 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -107,7 +107,7 @@ static const char *netname4(in_addr_t, in_addr_t);
static const char *netname6(struct sockaddr_in6 *, struct sockaddr_in6 *);
static void p_rtable_sysctl(int, int);
static void p_rtentry_sysctl(const char *name, struct rt_msghdr *);
-static void p_sockaddr(const char *name, struct sockaddr *, struct sockaddr *,
+static int p_sockaddr(const char *name, struct sockaddr *, struct sockaddr *,
int, int);
static const char *fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask,
int flags);
@@ -352,7 +352,7 @@ p_rtentry_sysctl(const char *name, struct rt_msghdr *rtm)
struct sockaddr *sa, *addr[RTAX_MAX];
char buffer[128];
char prettyname[128];
- int i;
+ int i, protrusion;
xo_open_instance(name);
sa = (struct sockaddr *)(rtm + 1);
@@ -362,11 +362,13 @@ p_rtentry_sysctl(const char *name, struct rt_msghdr *rtm)
sa = (struct sockaddr *)((char *)sa + SA_SIZE(sa));
}
- p_sockaddr("destination", addr[RTAX_DST], addr[RTAX_NETMASK],
+ protrusion = p_sockaddr("destination", addr[RTAX_DST],
+ addr[RTAX_NETMASK],
rtm->rtm_flags, wid_dst);
- p_sockaddr("gateway", addr[RTAX_GATEWAY], NULL, RTF_HOST, wid_gw);
+ protrusion = p_sockaddr("gateway", addr[RTAX_GATEWAY], NULL, RTF_HOST,
+ wid_gw - protrusion);
snprintf(buffer, sizeof(buffer), "{[:-%d}{:flags/%%s}{]:} ",
- wid_flags);
+ wid_flags - protrusion);
p_flags(rtm->rtm_flags, buffer);
if (Wflag) {
xo_emit("{t:use/%*lu} ", wid_pksent, rtm->rtm_rmx.rmx_pksent);
@@ -402,12 +404,13 @@ p_rtentry_sysctl(const char *name, struct rt_msghdr *rtm)
xo_close_instance(name);
}
-static void
+static int
p_sockaddr(const char *name, struct sockaddr *sa, struct sockaddr *mask,
int flags, int width)
{
const char *cp;
char buf[128];
+ int protrusion;
cp = fmt_sockaddr(sa, mask, flags);
@@ -419,12 +422,17 @@ p_sockaddr(const char *name, struct sockaddr *sa, struct sockaddr *mask,
snprintf(buf, sizeof(buf), "{[:%d}{:%s/%%s}{]:} ",
-width, name);
xo_emit(buf, cp);
+ protrusion = strlen(cp) - width;
+ if (protrusion < 0)
+ protrusion = 0;
} else {
snprintf(buf, sizeof(buf), "{[:%d}{:%s/%%-.*s}{]:} ",
-width, name);
xo_emit(buf, width, cp);
+ protrusion = 0;
}
}
+ return (protrusion);
}
static const char *
diff --git a/usr.bin/nfsstat/Makefile.depend b/usr.bin/nfsstat/Makefile.depend
index a1ac545..34582cd 100644
--- a/usr.bin/nfsstat/Makefile.depend
+++ b/usr.bin/nfsstat/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.bin/patch/Makefile.depend b/usr.bin/patch/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/usr.bin/patch/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/pom/Makefile b/usr.bin/pom/Makefile
index 9a74204..b7d4b00 100644
--- a/usr.bin/pom/Makefile
+++ b/usr.bin/pom/Makefile
@@ -3,7 +3,6 @@
PROG= pom
MAN= pom.6
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.prog.mk>
diff --git a/usr.bin/primes/Makefile b/usr.bin/primes/Makefile
index bfc4147..1f762a3 100644
--- a/usr.bin/primes/Makefile
+++ b/usr.bin/primes/Makefile
@@ -4,7 +4,6 @@
PROG= primes
SRCS= pattern.c pr_tbl.c primes.c spsp.c
MAN=
-DPADD= ${LIBM}
-LDADD= -lm
+LIBADD= m
.include <bsd.prog.mk>
diff --git a/usr.bin/protect/Makefile.depend b/usr.bin/protect/Makefile.depend
new file mode 100644
index 0000000..9cb890b
--- /dev/null
+++ b/usr.bin/protect/Makefile.depend
@@ -0,0 +1,17 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/rctl/rctl.8 b/usr.bin/rctl/rctl.8
index c9aa6f43..ec97623 100644
--- a/usr.bin/rctl/rctl.8
+++ b/usr.bin/rctl/rctl.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 5, 2015
+.Dd November 29, 2015
.Dt RCTL 8
.Os
.Sh NAME
@@ -35,22 +35,22 @@
.Nm
.Op Fl h
.Op Fl n
-.Op Ar filter
+.Op Ar filter Ar ...
.Nm
.Fl a
-.Ar rule
+.Ar rule Ar ...
.Nm
.Fl l
.Op Fl h
.Op Fl n
-.Ar filter
+.Ar filter Ar ...
.Nm
.Fl r
-.Ar filter
+.Ar filter Ar ...
.Nm
.Fl u
.Op Fl h
-.Ar filter
+.Ar filter Ar ...
.Pp
.Nm
requires the kernel to be compiled with:
diff --git a/usr.bin/rctl/rctl.c b/usr.bin/rctl/rctl.c
index 9153036..4b3b8e1 100644
--- a/usr.bin/rctl/rctl.c
+++ b/usr.bin/rctl/rctl.c
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <grp.h>
#include <libutil.h>
#include <pwd.h>
+#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -50,64 +51,152 @@ __FBSDID("$FreeBSD$");
#define RCTL_DEFAULT_BUFSIZE 128 * 1024
-static id_t
-parse_user(const char *s)
+static int
+parse_user(const char *s, id_t *uidp, const char *unexpanded_rule)
{
- id_t id;
char *end;
struct passwd *pwd;
pwd = getpwnam(s);
- if (pwd != NULL)
- return (pwd->pw_uid);
+ if (pwd != NULL) {
+ *uidp = pwd->pw_uid;
+ return (0);
+ }
- if (!isnumber(s[0]))
- errx(1, "uknown user '%s'", s);
+ if (!isnumber(s[0])) {
+ warnx("malformed rule '%s': unknown user '%s'",
+ unexpanded_rule, s);
+ return (1);
+ }
- id = strtod(s, &end);
- if ((size_t)(end - s) != strlen(s))
- errx(1, "trailing characters after numerical id");
+ *uidp = strtod(s, &end);
+ if ((size_t)(end - s) != strlen(s)) {
+ warnx("malformed rule '%s': trailing characters "
+ "after numerical id", unexpanded_rule);
+ return (1);
+ }
- return (id);
+ return (0);
}
-static id_t
-parse_group(const char *s)
+static int
+parse_group(const char *s, id_t *gidp, const char *unexpanded_rule)
{
- id_t id;
char *end;
struct group *grp;
grp = getgrnam(s);
- if (grp != NULL)
- return (grp->gr_gid);
+ if (grp != NULL) {
+ *gidp = grp->gr_gid;
+ return (0);
+ }
- if (!isnumber(s[0]))
- errx(1, "uknown group '%s'", s);
+ if (!isnumber(s[0])) {
+ warnx("malformed rule '%s': unknown group '%s'",
+ unexpanded_rule, s);
+ return (1);
+ }
- id = strtod(s, &end);
- if ((size_t)(end - s) != strlen(s))
- errx(1, "trailing characters after numerical id");
+ *gidp = strtod(s, &end);
+ if ((size_t)(end - s) != strlen(s)) {
+ warnx("malformed rule '%s': trailing characters "
+ "after numerical id", unexpanded_rule);
+ return (1);
+ }
- return (id);
+ return (0);
}
/*
- * This routine replaces user/group name with numeric id.
+ * Replace human-readable number with its expanded form.
*/
static char *
-resolve_ids(char *rule)
+expand_amount(const char *rule, const char *unexpanded_rule)
+{
+ uint64_t num;
+ const char *subject, *subject_id, *resource, *action, *amount, *per;
+ char *copy, *expanded, *tofree;
+ int ret;
+
+ tofree = copy = strdup(rule);
+ if (copy == NULL) {
+ warn("strdup");
+ return (NULL);
+ }
+
+ subject = strsep(&copy, ":");
+ subject_id = strsep(&copy, ":");
+ resource = strsep(&copy, ":");
+ action = strsep(&copy, "=/");
+ amount = strsep(&copy, "/");
+ per = copy;
+
+ if (amount == NULL || strlen(amount) == 0) {
+ /*
+ * The "copy" has already been tinkered with by strsep().
+ */
+ free(tofree);
+ copy = strdup(rule);
+ if (copy == NULL) {
+ warn("strdup");
+ return (NULL);
+ }
+ return (copy);
+ }
+
+ assert(subject != NULL);
+ assert(subject_id != NULL);
+ assert(resource != NULL);
+ assert(action != NULL);
+
+ if (expand_number(amount, &num)) {
+ warnx("malformed rule '%s': invalid numeric value '%s'",
+ unexpanded_rule, amount);
+ free(tofree);
+ return (NULL);
+ }
+
+ if (per == NULL) {
+ ret = asprintf(&expanded, "%s:%s:%s:%s=%ju",
+ subject, subject_id, resource, action, (uintmax_t)num);
+ } else {
+ ret = asprintf(&expanded, "%s:%s:%s:%s=%ju/%s",
+ subject, subject_id, resource, action, (uintmax_t)num, per);
+ }
+
+ if (ret <= 0) {
+ warn("asprintf");
+ free(tofree);
+ return (NULL);
+ }
+
+ free(tofree);
+
+ return (expanded);
+}
+
+static char *
+expand_rule(const char *rule, bool resolve_ids)
{
id_t id;
const char *subject, *textid, *rest;
- char *resolved;
+ char *copy, *expanded, *resolved, *tofree;
+ int error, ret;
- subject = strsep(&rule, ":");
- textid = strsep(&rule, ":");
- if (textid == NULL)
- errx(1, "error in rule specification -- no subject");
- if (rule != NULL)
- rest = rule;
+ tofree = copy = strdup(rule);
+ if (copy == NULL) {
+ warn("strdup");
+ return (NULL);
+ }
+
+ subject = strsep(&copy, ":");
+ textid = strsep(&copy, ":");
+ if (textid == NULL) {
+ warnx("malformed rule '%s': missing subject", rule);
+ return (NULL);
+ }
+ if (copy != NULL)
+ rest = copy;
else
rest = "";
@@ -124,64 +213,36 @@ resolve_ids(char *rule)
else if (strcasecmp(subject, "j") == 0)
subject = "jail";
- if (strcasecmp(subject, "user") == 0 && strlen(textid) > 0) {
- id = parse_user(textid);
- asprintf(&resolved, "%s:%d:%s", subject, (int)id, rest);
- } else if (strcasecmp(subject, "group") == 0 && strlen(textid) > 0) {
- id = parse_group(textid);
- asprintf(&resolved, "%s:%d:%s", subject, (int)id, rest);
- } else
- asprintf(&resolved, "%s:%s:%s", subject, textid, rest);
-
- if (resolved == NULL)
- err(1, "asprintf");
-
- return (resolved);
-}
-
-/*
- * This routine replaces "human-readable" number with its expanded form.
- */
-static char *
-expand_amount(char *rule)
-{
- uint64_t num;
- const char *subject, *subject_id, *resource, *action, *amount, *per;
- char *copy, *expanded;
-
- copy = strdup(rule);
- if (copy == NULL)
- err(1, "strdup");
-
- subject = strsep(&copy, ":");
- subject_id = strsep(&copy, ":");
- resource = strsep(&copy, ":");
- action = strsep(&copy, "=/");
- amount = strsep(&copy, "/");
- per = copy;
-
- if (amount == NULL || strlen(amount) == 0) {
- free(copy);
- return (rule);
+ if (resolve_ids &&
+ strcasecmp(subject, "user") == 0 && strlen(textid) > 0) {
+ error = parse_user(textid, &id, rule);
+ if (error != 0) {
+ free(tofree);
+ return (NULL);
+ }
+ ret = asprintf(&resolved, "%s:%d:%s", subject, (int)id, rest);
+ } else if (resolve_ids &&
+ strcasecmp(subject, "group") == 0 && strlen(textid) > 0) {
+ error = parse_group(textid, &id, rule);
+ if (error != 0) {
+ free(tofree);
+ return (NULL);
+ }
+ ret = asprintf(&resolved, "%s:%d:%s", subject, (int)id, rest);
+ } else {
+ ret = asprintf(&resolved, "%s:%s:%s", subject, textid, rest);
}
- assert(subject != NULL);
- assert(subject_id != NULL);
- assert(resource != NULL);
- assert(action != NULL);
-
- if (expand_number(amount, &num))
- err(1, "expand_number");
+ if (ret <= 0) {
+ warn("asprintf");
+ free(tofree);
+ return (NULL);
+ }
- if (per == NULL)
- asprintf(&expanded, "%s:%s:%s:%s=%ju", subject, subject_id,
- resource, action, (uintmax_t)num);
- else
- asprintf(&expanded, "%s:%s:%s:%s=%ju/%s", subject, subject_id,
- resource, action, (uintmax_t)num, per);
+ free(tofree);
- if (expanded == NULL)
- err(1, "asprintf");
+ expanded = expand_amount(resolved, rule);
+ free(resolved);
return (expanded);
}
@@ -193,7 +254,8 @@ humanize_ids(char *rule)
struct passwd *pwd;
struct group *grp;
const char *subject, *textid, *rest;
- char *humanized;
+ char *end, *humanized;
+ int ret;
subject = strsep(&rule, ":");
textid = strsep(&rule, ":");
@@ -206,20 +268,23 @@ humanize_ids(char *rule)
/* Replace numerical user and group ids with names. */
if (strcasecmp(subject, "user") == 0) {
- id = parse_user(textid);
+ id = strtod(textid, &end);
+ if ((size_t)(end - textid) != strlen(textid))
+ errx(1, "malformed uid '%s'", textid);
pwd = getpwuid(id);
if (pwd != NULL)
textid = pwd->pw_name;
} else if (strcasecmp(subject, "group") == 0) {
- id = parse_group(textid);
+ id = strtod(textid, &end);
+ if ((size_t)(end - textid) != strlen(textid))
+ errx(1, "malformed gid '%s'", textid);
grp = getgrgid(id);
if (grp != NULL)
textid = grp->gr_name;
}
- asprintf(&humanized, "%s:%s:%s", subject, textid, rest);
-
- if (humanized == NULL)
+ ret = asprintf(&humanized, "%s:%s:%s", subject, textid, rest);
+ if (ret <= 0)
err(1, "asprintf");
return (humanized);
@@ -245,9 +310,10 @@ humanize_amount(char *rule)
{
int64_t num;
const char *subject, *subject_id, *resource, *action, *amount, *per;
- char *copy, *humanized, buf[6];
+ char *copy, *humanized, buf[6], *tofree;
+ int ret;
- copy = strdup(rule);
+ tofree = copy = strdup(rule);
if (copy == NULL)
err(1, "strdup");
@@ -260,7 +326,7 @@ humanize_amount(char *rule)
if (amount == NULL || strlen(amount) == 0 ||
str2int64(amount, &num) != 0) {
- free(copy);
+ free(tofree);
return (rule);
}
@@ -273,16 +339,18 @@ humanize_amount(char *rule)
HN_DECIMAL | HN_NOSPACE) == -1)
err(1, "humanize_number");
- if (per == NULL)
- asprintf(&humanized, "%s:%s:%s:%s=%s", subject, subject_id,
- resource, action, buf);
- else
- asprintf(&humanized, "%s:%s:%s:%s=%s/%s", subject, subject_id,
- resource, action, buf, per);
+ if (per == NULL) {
+ ret = asprintf(&humanized, "%s:%s:%s:%s=%s",
+ subject, subject_id, resource, action, buf);
+ } else {
+ ret = asprintf(&humanized, "%s:%s:%s:%s=%s/%s",
+ subject, subject_id, resource, action, buf, per);
+ }
- if (humanized == NULL)
+ if (ret <= 0)
err(1, "asprintf");
+ free(tofree);
return (humanized);
}
@@ -326,8 +394,8 @@ enosys(void)
errx(1, "RACCT/RCTL present, but disabled; enable using kern.racct.enable=1 tunable");
}
-static void
-add_rule(char *rule)
+static int
+add_rule(const char *rule, const char *unexpanded_rule)
{
int error;
@@ -335,40 +403,47 @@ add_rule(char *rule)
if (error != 0) {
if (errno == ENOSYS)
enosys();
- err(1, "rctl_add_rule");
+ warn("failed to add rule '%s'", unexpanded_rule);
}
- free(rule);
+
+ return (error);
}
-static void
-show_limits(char *filter, int hflag, int nflag)
+static int
+show_limits(const char *filter, const char *unexpanded_rule,
+ int hflag, int nflag)
{
int error;
char *outbuf = NULL;
size_t outbuflen = RCTL_DEFAULT_BUFSIZE / 4;
- do {
+ for (;;) {
outbuflen *= 4;
outbuf = realloc(outbuf, outbuflen);
if (outbuf == NULL)
err(1, "realloc");
+ error = rctl_get_limits(filter, strlen(filter) + 1,
+ outbuf, outbuflen);
+ if (error == 0)
+ break;
+ if (errno == ERANGE)
+ continue;
+ if (errno == ENOSYS)
+ enosys();
+ warn("failed to get limits for '%s'", unexpanded_rule);
+ free(outbuf);
- error = rctl_get_limits(filter, strlen(filter) + 1, outbuf,
- outbuflen);
- if (error && errno != ERANGE) {
- if (errno == ENOSYS)
- enosys();
- err(1, "rctl_get_limits");
- }
- } while (error && errno == ERANGE);
+ return (error);
+ }
print_rules(outbuf, hflag, nflag);
- free(filter);
free(outbuf);
+
+ return (error);
}
-static void
-remove_rule(char *filter)
+static int
+remove_rule(const char *filter, const char *unexpanded_rule)
{
int error;
@@ -376,9 +451,10 @@ remove_rule(char *filter)
if (error != 0) {
if (errno == ENOSYS)
enosys();
- err(1, "rctl_remove_rule");
+ warn("failed to remove rule '%s'", unexpanded_rule);
}
- free(filter);
+
+ return (error);
}
static char *
@@ -386,9 +462,10 @@ humanize_usage_amount(char *usage)
{
int64_t num;
const char *resource, *amount;
- char *copy, *humanized, buf[6];
+ char *copy, *humanized, buf[6], *tofree;
+ int ret;
- copy = strdup(usage);
+ tofree = copy = strdup(usage);
if (copy == NULL)
err(1, "strdup");
@@ -401,43 +478,50 @@ humanize_usage_amount(char *usage)
if (str2int64(amount, &num) != 0 ||
humanize_number(buf, sizeof(buf), num, "", HN_AUTOSCALE,
HN_DECIMAL | HN_NOSPACE) == -1) {
- free(copy);
+ free(tofree);
return (usage);
}
- asprintf(&humanized, "%s=%s", resource, buf);
- if (humanized == NULL)
+ ret = asprintf(&humanized, "%s=%s", resource, buf);
+ if (ret <= 0)
err(1, "asprintf");
+ free(tofree);
return (humanized);
}
/*
* Query the kernel about a resource usage and print it out.
*/
-static void
-show_usage(char *filter, int hflag)
+static int
+show_usage(const char *filter, const char *unexpanded_rule, int hflag)
{
int error;
- char *outbuf = NULL, *tmp;
+ char *copy, *outbuf = NULL, *tmp;
size_t outbuflen = RCTL_DEFAULT_BUFSIZE / 4;
- do {
+ for (;;) {
outbuflen *= 4;
outbuf = realloc(outbuf, outbuflen);
if (outbuf == NULL)
err(1, "realloc");
+ error = rctl_get_racct(filter, strlen(filter) + 1,
+ outbuf, outbuflen);
+ if (error == 0)
+ break;
+ if (errno == ERANGE)
+ continue;
+ if (errno == ENOSYS)
+ enosys();
+ warn("failed to show resource consumption for '%s'",
+ unexpanded_rule);
+ free(outbuf);
- error = rctl_get_racct(filter, strlen(filter) + 1, outbuf,
- outbuflen);
- if (error && errno != ERANGE) {
- if (errno == ENOSYS)
- enosys();
- err(1, "rctl_get_racct");
- }
- } while (error && errno == ERANGE);
+ return (error);
+ }
- while ((tmp = strsep(&outbuf, ",")) != NULL) {
+ copy = outbuf;
+ while ((tmp = strsep(&copy, ",")) != NULL) {
if (tmp[0] == '\0')
break; /* XXX */
@@ -447,15 +531,17 @@ show_usage(char *filter, int hflag)
printf("%s\n", tmp);
}
- free(filter);
free(outbuf);
+
+ return (error);
}
/*
* Query the kernel about resource limit rules and print them out.
*/
-static void
-show_rules(char *filter, int hflag, int nflag)
+static int
+show_rules(const char *filter, const char *unexpanded_rule,
+ int hflag, int nflag)
{
int error;
char *outbuf = NULL;
@@ -466,22 +552,28 @@ show_rules(char *filter, int hflag, int nflag)
else
filterlen = 0;
- do {
+ for (;;) {
outbuflen *= 4;
outbuf = realloc(outbuf, outbuflen);
if (outbuf == NULL)
err(1, "realloc");
-
error = rctl_get_rules(filter, filterlen, outbuf, outbuflen);
- if (error && errno != ERANGE) {
- if (errno == ENOSYS)
- enosys();
- err(1, "rctl_get_rules");
- }
- } while (error && errno == ERANGE);
+ if (error == 0)
+ break;
+ if (errno == ERANGE)
+ continue;
+ if (errno == ENOSYS)
+ enosys();
+ warn("failed to show rules for '%s'", unexpanded_rule);
+ free(outbuf);
+
+ return (error);
+ }
print_rules(outbuf, hflag, nflag);
free(outbuf);
+
+ return (error);
}
static void
@@ -498,31 +590,28 @@ main(int argc __unused, char **argv __unused)
{
int ch, aflag = 0, hflag = 0, nflag = 0, lflag = 0, rflag = 0,
uflag = 0;
- char *rule = NULL;
+ char *rule = NULL, *unexpanded_rule;
+ int i, cumulated_error, error;
- while ((ch = getopt(argc, argv, "a:hl:nr:u:")) != -1) {
+ while ((ch = getopt(argc, argv, "ahlnru")) != -1) {
switch (ch) {
case 'a':
aflag = 1;
- rule = strdup(optarg);
break;
case 'h':
hflag = 1;
break;
case 'l':
lflag = 1;
- rule = strdup(optarg);
break;
case 'n':
nflag = 1;
break;
case 'r':
rflag = 1;
- rule = strdup(optarg);
break;
case 'u':
uflag = 1;
- rule = strdup(optarg);
break;
case '?':
@@ -533,44 +622,65 @@ main(int argc __unused, char **argv __unused)
argc -= optind;
argv += optind;
+
+ if (aflag + lflag + rflag + uflag > 1)
+ errx(1, "at most one of -a, -l, -r, or -u may be specified");
- if (argc > 1)
- usage();
-
- if (rule == NULL) {
- if (argc == 1)
- rule = strdup(argv[0]);
- else
+ if (argc == 0) {
+ if (aflag + lflag + rflag + uflag == 0) {
rule = strdup("::");
+ show_rules(rule, rule, hflag, nflag);
+
+ return (0);
+ }
+
+ usage();
}
- if (aflag + lflag + rflag + uflag + argc > 1)
- errx(1, "only one flag or argument may be specified "
- "at the same time");
+ cumulated_error = 0;
- rule = resolve_ids(rule);
- rule = expand_amount(rule);
+ for (i = 0; i < argc; i++) {
+ unexpanded_rule = argv[i];
- if (aflag) {
- add_rule(rule);
- return (0);
- }
+ /*
+ * Skip resolving if passed -n _and_ -a. Ignore -n otherwise,
+ * so we can still do "rctl -n u:root" and see the rules without
+ * resolving the UID.
+ */
+ if (aflag != 0 && nflag != 0)
+ rule = expand_rule(unexpanded_rule, false);
+ else
+ rule = expand_rule(unexpanded_rule, true);
- if (lflag) {
- show_limits(rule, hflag, nflag);
- return (0);
- }
+ if (rule == NULL) {
+ cumulated_error++;
+ continue;
+ }
- if (rflag) {
- remove_rule(rule);
- return (0);
- }
+ /*
+ * The reason for passing the unexpanded_rule is to make
+ * it easier for the user to search for the problematic
+ * rule in the passed input.
+ */
+ if (aflag) {
+ error = add_rule(rule, unexpanded_rule);
+ } else if (lflag) {
+ error = show_limits(rule, unexpanded_rule,
+ hflag, nflag);
+ } else if (rflag) {
+ error = remove_rule(rule, unexpanded_rule);
+ } else if (uflag) {
+ error = show_usage(rule, unexpanded_rule, hflag);
+ } else {
+ error = show_rules(rule, unexpanded_rule,
+ hflag, nflag);
+ }
- if (uflag) {
- show_usage(rule, hflag);
- return (0);
+ if (error != 0)
+ cumulated_error++;
+
+ free(rule);
}
- show_rules(rule, hflag, nflag);
- return (0);
+ return (cumulated_error);
}
diff --git a/usr.bin/send-pr/Makefile.depend b/usr.bin/send-pr/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.bin/send-pr/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/smbutil/Makefile.depend b/usr.bin/smbutil/Makefile.depend
index 989cc64..4db7ad3 100644
--- a/usr.bin/smbutil/Makefile.depend
+++ b/usr.bin/smbutil/Makefile.depend
@@ -2,13 +2,16 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/arpa \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
lib/libkiconv \
+ lib/libsmb \
.include <dirdeps.mk>
diff --git a/usr.bin/soelim/Makefile.depend b/usr.bin/soelim/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/usr.bin/soelim/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/svn/lib/libsvn_delta/Makefile.depend b/usr.bin/svn/lib/libsvn_delta/Makefile.depend
index b38b34e..18be76b 100644
--- a/usr.bin/svn/lib/libsvn_delta/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_delta/Makefile.depend
@@ -4,7 +4,6 @@
DIRDEPS = \
include \
include/xlocale \
- lib/libz \
.include <dirdeps.mk>
diff --git a/usr.bin/svn/lib/libsvn_subr/Makefile.depend b/usr.bin/svn/lib/libsvn_subr/Makefile.depend
index 10c0748..d0ebf97 100644
--- a/usr.bin/svn/lib/libsvn_subr/Makefile.depend
+++ b/usr.bin/svn/lib/libsvn_subr/Makefile.depend
@@ -3,6 +3,7 @@
DIRDEPS = \
include \
+ include/arpa \
include/xlocale \
lib/libexpat \
lib/libmagic \
diff --git a/usr.bin/svn/svn/Makefile.depend b/usr.bin/svn/svn/Makefile.depend
index da1efbd..979ea0b 100644
--- a/usr.bin/svn/svn/Makefile.depend
+++ b/usr.bin/svn/svn/Makefile.depend
@@ -2,15 +2,16 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
lib/libmagic \
+ lib/libsqlite3 \
lib/libthr \
lib/libz \
secure/lib/libcrypto \
@@ -18,13 +19,13 @@ DIRDEPS = \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
usr.bin/svn/lib/libserf \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_client \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_diff \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_ra \
usr.bin/svn/lib/libsvn_ra_local \
usr.bin/svn/lib/libsvn_ra_serf \
diff --git a/usr.bin/svn/svnadmin/Makefile.depend b/usr.bin/svn/svnadmin/Makefile.depend
index ae47f0b..1f7a760 100644
--- a/usr.bin/svn/svnadmin/Makefile.depend
+++ b/usr.bin/svn/svnadmin/Makefile.depend
@@ -2,22 +2,24 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
+ lib/libsqlite3 \
+ lib/libthr \
lib/libz \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_repos \
usr.bin/svn/lib/libsvn_subr \
diff --git a/usr.bin/svn/svnbench/Makefile.depend b/usr.bin/svn/svnbench/Makefile.depend
index da1efbd..979ea0b 100644
--- a/usr.bin/svn/svnbench/Makefile.depend
+++ b/usr.bin/svn/svnbench/Makefile.depend
@@ -2,15 +2,16 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
lib/libmagic \
+ lib/libsqlite3 \
lib/libthr \
lib/libz \
secure/lib/libcrypto \
@@ -18,13 +19,13 @@ DIRDEPS = \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
usr.bin/svn/lib/libserf \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_client \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_diff \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_ra \
usr.bin/svn/lib/libsvn_ra_local \
usr.bin/svn/lib/libsvn_ra_serf \
diff --git a/usr.bin/svn/svndumpfilter/Makefile.depend b/usr.bin/svn/svndumpfilter/Makefile.depend
index ae47f0b..8495fb3 100644
--- a/usr.bin/svn/svndumpfilter/Makefile.depend
+++ b/usr.bin/svn/svndumpfilter/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
@@ -10,14 +11,16 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libcrypt \
lib/libexpat \
+ lib/libsqlite3 \
+ lib/libthr \
lib/libz \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_repos \
usr.bin/svn/lib/libsvn_subr \
diff --git a/usr.bin/svn/svnfsfs/Makefile.depend b/usr.bin/svn/svnfsfs/Makefile.depend
index ae47f0b..0b846ba 100644
--- a/usr.bin/svn/svnfsfs/Makefile.depend
+++ b/usr.bin/svn/svnfsfs/Makefile.depend
@@ -2,22 +2,25 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
+ include/arpa \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
+ lib/libsqlite3 \
+ lib/libthr \
lib/libz \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_repos \
usr.bin/svn/lib/libsvn_subr \
diff --git a/usr.bin/svn/svnlook/Makefile.depend b/usr.bin/svn/svnlook/Makefile.depend
index d0f5866..aa8be0e 100644
--- a/usr.bin/svn/svnlook/Makefile.depend
+++ b/usr.bin/svn/svnlook/Makefile.depend
@@ -2,23 +2,25 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
+ lib/libsqlite3 \
+ lib/libthr \
lib/libz \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_diff \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_repos \
usr.bin/svn/lib/libsvn_subr \
diff --git a/usr.bin/svn/svnmucc/Makefile.depend b/usr.bin/svn/svnmucc/Makefile.depend
index 798e4f3..c510cb3 100644
--- a/usr.bin/svn/svnmucc/Makefile.depend
+++ b/usr.bin/svn/svnmucc/Makefile.depend
@@ -2,15 +2,15 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
- lib/libmagic \
+ lib/libsqlite3 \
lib/libthr \
lib/libz \
secure/lib/libcrypto \
@@ -18,18 +18,20 @@ DIRDEPS = \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
usr.bin/svn/lib/libserf \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_client \
usr.bin/svn/lib/libsvn_delta \
+ usr.bin/svn/lib/libsvn_diff \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_ra \
usr.bin/svn/lib/libsvn_ra_local \
usr.bin/svn/lib/libsvn_ra_serf \
usr.bin/svn/lib/libsvn_ra_svn \
usr.bin/svn/lib/libsvn_repos \
usr.bin/svn/lib/libsvn_subr \
+ usr.bin/svn/lib/libsvn_wc \
.include <dirdeps.mk>
diff --git a/usr.bin/svn/svnrdump/Makefile.depend b/usr.bin/svn/svnrdump/Makefile.depend
index da1efbd..c510cb3 100644
--- a/usr.bin/svn/svnrdump/Makefile.depend
+++ b/usr.bin/svn/svnrdump/Makefile.depend
@@ -2,15 +2,15 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
- lib/libmagic \
+ lib/libsqlite3 \
lib/libthr \
lib/libz \
secure/lib/libcrypto \
@@ -18,13 +18,13 @@ DIRDEPS = \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
usr.bin/svn/lib/libserf \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_client \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_diff \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_ra \
usr.bin/svn/lib/libsvn_ra_local \
usr.bin/svn/lib/libsvn_ra_serf \
diff --git a/usr.bin/svn/svnserve/Makefile.depend b/usr.bin/svn/svnserve/Makefile.depend
index 550cd65..edbca2e 100644
--- a/usr.bin/svn/svnserve/Makefile.depend
+++ b/usr.bin/svn/svnserve/Makefile.depend
@@ -2,27 +2,25 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
- lib/libmagic \
+ lib/libsqlite3 \
lib/libthr \
lib/libz \
- secure/lib/libcrypto \
- secure/lib/libssl \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
usr.bin/svn/lib/libserf \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_ra \
usr.bin/svn/lib/libsvn_ra_local \
usr.bin/svn/lib/libsvn_ra_serf \
diff --git a/usr.bin/svn/svnsync/Makefile.depend b/usr.bin/svn/svnsync/Makefile.depend
index 550cd65..2e39f66 100644
--- a/usr.bin/svn/svnsync/Makefile.depend
+++ b/usr.bin/svn/svnsync/Makefile.depend
@@ -2,15 +2,15 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
- lib/libmagic \
+ lib/libsqlite3 \
lib/libthr \
lib/libz \
secure/lib/libcrypto \
@@ -18,11 +18,11 @@ DIRDEPS = \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
usr.bin/svn/lib/libserf \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_fs \
usr.bin/svn/lib/libsvn_fs_fs \
usr.bin/svn/lib/libsvn_fs_util \
+ usr.bin/svn/lib/libsvn_fs_x \
usr.bin/svn/lib/libsvn_ra \
usr.bin/svn/lib/libsvn_ra_local \
usr.bin/svn/lib/libsvn_ra_serf \
diff --git a/usr.bin/svn/svnversion/Makefile.depend b/usr.bin/svn/svnversion/Makefile.depend
index 12d0cc3..65b3e9a 100644
--- a/usr.bin/svn/svnversion/Makefile.depend
+++ b/usr.bin/svn/svnversion/Makefile.depend
@@ -2,18 +2,19 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- lib/libcrypt \
lib/libexpat \
+ lib/libsqlite3 \
+ lib/libthr \
lib/libz \
usr.bin/svn/lib/libapr \
usr.bin/svn/lib/libapr_util \
- usr.bin/svn/lib/libsqlite3 \
usr.bin/svn/lib/libsvn_delta \
usr.bin/svn/lib/libsvn_diff \
usr.bin/svn/lib/libsvn_subr \
diff --git a/usr.bin/systat/Makefile.depend b/usr.bin/systat/Makefile.depend
index 3e4daea..f0f4602 100644
--- a/usr.bin/systat/Makefile.depend
+++ b/usr.bin/systat/Makefile.depend
@@ -11,6 +11,7 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libdevstat \
+ lib/libelf \
lib/libkvm \
lib/msun \
lib/ncurses/ncursesw \
diff --git a/usr.bin/tar/Makefile b/usr.bin/tar/Makefile
index 47416f8..8ac2005 100644
--- a/usr.bin/tar/Makefile
+++ b/usr.bin/tar/Makefile
@@ -1,12 +1,12 @@
# $FreeBSD$
.include <src.opts.mk>
-LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
+_LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
PROG= bsdtar
BSDTAR_VERSION_STRING= 3.1.2
-.PATH: ${LIBARCHIVEDIR}/tar
+.PATH: ${_LIBARCHIVEDIR}/tar
SRCS= bsdtar.c \
cmdline.c \
creation_set.c \
@@ -15,7 +15,7 @@ SRCS= bsdtar.c \
util.c \
write.c
-.PATH: ${LIBARCHIVEDIR}/libarchive_fe
+.PATH: ${_LIBARCHIVEDIR}/libarchive_fe
SRCS+= err.c \
line_reader.c
@@ -27,8 +27,8 @@ CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const
CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\"
CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/../../lib/libarchive/config_freebsd.h\"
-CFLAGS+= -I${LIBARCHIVEDIR}/tar -I${LIBARCHIVEDIR}/libarchive
-CFLAGS+= -I${LIBARCHIVEDIR}/libarchive_fe
+CFLAGS+= -I${_LIBARCHIVEDIR}/tar -I${_LIBARCHIVEDIR}/libarchive
+CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive_fe
SYMLINKS= bsdtar ${BINDIR}/tar
MLINKS= bsdtar.1 tar.1
diff --git a/usr.bin/tar/tests/Makefile b/usr.bin/tar/tests/Makefile
index 02918b3..96800a5 100644
--- a/usr.bin/tar/tests/Makefile
+++ b/usr.bin/tar/tests/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
+_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive
ATF_TESTS_SH+= functional_test
@@ -9,7 +9,7 @@ BINDIR= ${TESTSDIR}
CFLAGS+= -DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
CFLAGS+= -static
CFLAGS+= -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
-CFLAGS+= -I${LIBARCHIVEDIR}/tar -I${LIBARCHIVEDIR}/test_utils
+CFLAGS+= -I${_LIBARCHIVEDIR}/tar -I${_LIBARCHIVEDIR}/test_utils
# Uncomment to link against dmalloc
#LDADD+= -L/usr/local/lib -ldmalloc
@@ -17,7 +17,7 @@ CFLAGS+= -I${LIBARCHIVEDIR}/tar -I${LIBARCHIVEDIR}/test_utils
PROGS+= bsdtar_test
-.PATH: ${LIBARCHIVEDIR}/tar/test
+.PATH: ${_LIBARCHIVEDIR}/tar/test
TESTS_SRCS= \
test_0.c \
test_basic.c \
@@ -75,13 +75,13 @@ SRCS.bsdtar_test= \
list.h \
main.c
-.PATH: ${LIBARCHIVEDIR}/test_utils
+.PATH: ${_LIBARCHIVEDIR}/test_utils
SRCS.bsdtar_test+= test_utils.c
LIBADD.bsdtar_test= archive
list.h: ${TESTS_SRCS} Makefile
- @(cd ${LIBARCHIVEDIR}/tar/test && \
+ @(cd ${_LIBARCHIVEDIR}/tar/test && \
grep -h DEFINE_TEST ${.ALLSRC:N*Makefile}) > ${.TARGET}.tmp
@mv ${.TARGET}.tmp ${.TARGET}
diff --git a/usr.bin/top/Makefile.depend b/usr.bin/top/Makefile.depend
index 4a6d98d..accbe52 100644
--- a/usr.bin/top/Makefile.depend
+++ b/usr.bin/top/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libjail \
lib/libkvm \
lib/msun \
diff --git a/usr.bin/unifdef/unifdef.1 b/usr.bin/unifdef/unifdef.1
index 24a9205..430f743 100644
--- a/usr.bin/unifdef/unifdef.1
+++ b/usr.bin/unifdef/unifdef.1
@@ -1,6 +1,6 @@
.\" Copyright (c) 1985, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
-.\" Copyright (c) 2002 - 2013 Tony Finch <dot@dotat.at>. All rights reserved.
+.\" Copyright (c) 2002 - 2015 Tony Finch <dot@dotat.at>. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Dave Yost. It was rewritten to support ANSI C by Tony Finch.
@@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 7, 2014
+.Dd December 3, 2015
.Dt UNIFDEF 1 PRM
.Os " "
.Sh NAME
@@ -122,10 +122,13 @@ the
.Fn defined
operator,
the operators
-.Ic \&! , < , > ,
-.Ic <= , >= , == , != ,
+.Ic \&! , ~ , -
+(unary),
+.Ic * , / , % , + , - ,
+.Ic < , <= , > , >= , == , != , & , ^ , \&| ,
.Ic && , || ,
and parenthesized expressions.
+Division by zero is treated as an unknown value.
A kind of
.Dq "short circuit"
evaluation is used for the
@@ -253,6 +256,11 @@ are set to the given value.
Function-like macro definitions (with arguments)
are treated as if they are set to 1.
.Pp
+.Em Warning:
+string literals and character constants are not parsed correctly in
+.Fl f
+files.
+.Pp
.It Fl b
Replace removed lines with blank lines
instead of deleting them.
@@ -325,12 +333,19 @@ It would be rude to strip them out, just as it would be for normal comments.
.Pp
.It Fl m
Modify one or more input files in place.
+If an input file is not modified,
+the original is preserved instead of being overwritten with an identical copy.
.Pp
.It Fl M Ar backext
Modify input files in place, and keep backups of the original files by
appending the
.Ar backext
to the input filenames.
+A zero length
+.Ar backext
+behaves the same as the
+.Fl m
+option.
.Pp
.It Fl n
Add
@@ -433,23 +448,29 @@ command line options are given.
.Sh DIAGNOSTICS
.Bl -item
.It
-Too many levels of nesting.
+.Tn EOF
+in comment
.It
Inappropriate
.Ic #elif ,
.Ic #else
or
-.Ic #endif .
+.Ic #endif
+.It
+Missing macro name in #define or #undef
.It
-Obfuscated preprocessor control line.
+Obfuscated preprocessor control line
.It
Premature
.Tn EOF
(with the line number of the most recent unterminated
-.Ic #if ) .
+.Ic #if )
.It
-.Tn EOF
-in comment.
+Too many levels of nesting
+.It
+Unrecognized preprocessor directive
+.It
+Unterminated char or string literal
.El
.Sh SEE ALSO
.Xr cpp 1 ,
@@ -475,6 +496,12 @@ rewrote it to support
.Sh BUGS
Expression evaluation is very limited.
.Pp
+Character constants are not evaluated.
+String literals and character constants in
+.Fl f
+definition files are ignored rather than parsed as
+part of a macro's replacement tokens.
+.Pp
Handling one line at a time means
preprocessor directives split across more than one physical line
(because of comments or backslash-newline)
diff --git a/usr.bin/unifdef/unifdef.c b/usr.bin/unifdef/unifdef.c
index fd378a1..4a28ed4 100644
--- a/usr.bin/unifdef/unifdef.c
+++ b/usr.bin/unifdef/unifdef.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002 - 2014 Tony Finch <dot@dotat.at>
+ * Copyright (c) 2002 - 2015 Tony Finch <dot@dotat.at>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -46,7 +46,7 @@
#include "unifdef.h"
static const char copyright[] =
- "@(#) $Version: unifdef-2.10 $\n"
+ "@(#) $Version: unifdef-2.11 $\n"
"@(#) $FreeBSD$\n"
"@(#) $Author: Tony Finch (dot@dotat.at) $\n"
"@(#) $URL: http://dotat.at/prog/unifdef $\n"
@@ -208,6 +208,7 @@ static bool firstsym; /* ditto */
static int exitmode; /* exit status mode */
static int exitstat; /* program exit status */
+static bool altered; /* was this file modified? */
static void addsym1(bool, bool, char *);
static void addsym2(bool, const char *, const char *);
@@ -312,7 +313,8 @@ main(int argc, char *argv[])
break;
case 'M': /* modify in place and keep backup */
inplace = true;
- backext = optarg;
+ if (strlen(optarg) > 0)
+ backext = optarg;
break;
case 'n': /* add #line directive after deleted lines */
lnnum = true;
@@ -350,6 +352,8 @@ main(int argc, char *argv[])
errx(2, "-o cannot be used with multiple input files");
if (argc > 1 && !inplace)
errx(2, "multiple input files require -m or -M");
+ if (argc == 0 && inplace)
+ errx(2, "-m requires an input file");
if (argc == 0)
argc = 1;
if (argc == 1 && !inplace && ofilename == NULL)
@@ -416,7 +420,11 @@ processinout(const char *ifn, const char *ofn)
err(2, "can't rename \"%s\" to \"%s\"", ofn, backname);
free(backname);
}
- if (replace(tempname, ofn) < 0)
+ /* leave file unmodified if unifdef made no changes */
+ if (!altered && backext == NULL) {
+ if (remove(tempname) < 0)
+ warn("can't remove \"%s\"", tempname);
+ } else if (replace(tempname, ofn) < 0)
err(2, "can't rename \"%s\" to \"%s\"", tempname, ofn);
free(tempname);
tempname = NULL;
@@ -638,6 +646,7 @@ keywordedit(const char *replacement)
{
snprintf(keyword, tline + sizeof(tline) - keyword,
"%s%s", replacement, newline);
+ altered = true;
print();
}
static void
@@ -700,7 +709,7 @@ flushline(bool keep)
} else {
if (lnblank && fputs(newline, output) == EOF)
closeio();
- exitstat = 1;
+ altered = true;
delcount += 1;
blankcount = 0;
}
@@ -752,6 +761,7 @@ process(void)
zerosyms = true;
newline = NULL;
linenum = 0;
+ altered = false;
while (lineval != LT_EOF) {
lineval = parseline();
trans_table[ifstate[depth]][lineval]();
@@ -759,6 +769,7 @@ process(void)
linenum, linetype_name[lineval],
ifstate_name[ifstate[depth]], depth);
}
+ exitstat |= altered;
}
/*
@@ -892,6 +903,40 @@ static Linetype op_and(long *p, Linetype at, long a, Linetype bt, long b) {
return (*p = 0, LT_FALSE);
return op_strict(p, a && b, at, bt);
}
+static Linetype op_blsh(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a << b, at, bt);
+}
+static Linetype op_brsh(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a >> b, at, bt);
+}
+static Linetype op_add(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a + b, at, bt);
+}
+static Linetype op_sub(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a - b, at, bt);
+}
+static Linetype op_mul(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a * b, at, bt);
+}
+static Linetype op_div(long *p, Linetype at, long a, Linetype bt, long b) {
+ if (bt != LT_TRUE) {
+ debug("eval division by zero");
+ return (LT_ERROR);
+ }
+ return op_strict(p, a / b, at, bt);
+}
+static Linetype op_mod(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a % b, at, bt);
+}
+static Linetype op_bor(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a | b, at, bt);
+}
+static Linetype op_bxor(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a ^ b, at, bt);
+}
+static Linetype op_band(long *p, Linetype at, long a, Linetype bt, long b) {
+ return op_strict(p, a & b, at, bt);
+}
/*
* An evaluation function takes three arguments, as follows: (1) a pointer to
@@ -915,24 +960,39 @@ static eval_fn eval_table, eval_unary;
* calls the inner function with its first argument pointing to the next
* element of the table. Innermost expressions have special non-table-driven
* handling.
+ *
+ * The stop characters help with lexical analysis: an operator is not
+ * recognized if it is followed by one of the stop characters because
+ * that would make it a different operator.
*/
struct op {
const char *str;
Linetype (*fn)(long *, Linetype, long, Linetype, long);
+ const char *stop;
};
struct ops {
eval_fn *inner;
struct op op[5];
};
static const struct ops eval_ops[] = {
- { eval_table, { { "||", op_or } } },
- { eval_table, { { "&&", op_and } } },
- { eval_table, { { "==", op_eq },
- { "!=", op_ne } } },
- { eval_unary, { { "<=", op_le },
- { ">=", op_ge },
- { "<", op_lt },
- { ">", op_gt } } }
+ { eval_table, { { "||", op_or, NULL } } },
+ { eval_table, { { "&&", op_and, NULL } } },
+ { eval_table, { { "|", op_bor, "|" } } },
+ { eval_table, { { "^", op_bxor, NULL } } },
+ { eval_table, { { "&", op_band, "&" } } },
+ { eval_table, { { "==", op_eq, NULL },
+ { "!=", op_ne, NULL } } },
+ { eval_table, { { "<=", op_le, NULL },
+ { ">=", op_ge, NULL },
+ { "<", op_lt, "<=" },
+ { ">", op_gt, ">=" } } },
+ { eval_table, { { "<<", op_blsh, NULL },
+ { ">>", op_brsh, NULL } } },
+ { eval_table, { { "+", op_add, NULL },
+ { "-", op_sub, NULL } } },
+ { eval_unary, { { "*", op_mul, NULL },
+ { "/", op_div, NULL },
+ { "%", op_mod, NULL } } },
};
/* Current operator precedence level */
@@ -966,6 +1026,26 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
*valp = !*valp;
lt = *valp ? LT_TRUE : LT_FALSE;
}
+ } else if (*cp == '~') {
+ debug("eval%d ~", prec(ops));
+ cp++;
+ lt = eval_unary(ops, valp, &cp);
+ if (lt == LT_ERROR)
+ return (LT_ERROR);
+ if (lt != LT_IF) {
+ *valp = ~(*valp);
+ lt = *valp ? LT_TRUE : LT_FALSE;
+ }
+ } else if (*cp == '-') {
+ debug("eval%d -", prec(ops));
+ cp++;
+ lt = eval_unary(ops, valp, &cp);
+ if (lt == LT_ERROR)
+ return (LT_ERROR);
+ if (lt != LT_IF) {
+ *valp = -(*valp);
+ lt = *valp ? LT_TRUE : LT_FALSE;
+ }
} else if (*cp == '(') {
cp++;
debug("eval%d (", prec(ops));
@@ -1040,7 +1120,7 @@ eval_table(const struct ops *ops, long *valp, const char **cpp)
{
const struct op *op;
const char *cp;
- long val;
+ long val = 0;
Linetype lt, rt;
debug("eval%d", prec(ops));
@@ -1050,9 +1130,16 @@ eval_table(const struct ops *ops, long *valp, const char **cpp)
return (LT_ERROR);
for (;;) {
cp = skipcomment(cp);
- for (op = ops->op; op->str != NULL; op++)
- if (strncmp(cp, op->str, strlen(op->str)) == 0)
- break;
+ for (op = ops->op; op->str != NULL; op++) {
+ if (strncmp(cp, op->str, strlen(op->str)) == 0) {
+ /* assume only one-char operators have stop chars */
+ if (op->stop != NULL && cp[1] != '\0' &&
+ strchr(op->stop, cp[1]) != NULL)
+ continue;
+ else
+ break;
+ }
+ }
if (op->str == NULL)
break;
cp += strlen(op->str);
@@ -1123,10 +1210,14 @@ skiphash(void)
static const char *
skipline(const char *cp)
{
+ const char *pcp;
if (*cp != '\0')
linestate = LS_DIRTY;
- while (*cp != '\0')
- cp = skipcomment(cp + 1);
+ while (*cp != '\0') {
+ cp = skipcomment(pcp = cp);
+ if (pcp == cp)
+ cp++;
+ }
return (cp);
}
@@ -1202,9 +1293,9 @@ skipcomment(const char *cp)
cp += 2;
} else if (strncmp(cp, "\n", 1) == 0) {
if (incomment == CHAR_LITERAL)
- error("unterminated char literal");
+ error("Unterminated char literal");
else
- error("unterminated string literal");
+ error("Unterminated string literal");
} else
cp += 1;
continue;
@@ -1478,7 +1569,7 @@ defundef(void)
if ((cp = matchsym("define", kw)) != NULL) {
sym = getsym(&cp);
if (sym == NULL)
- error("missing macro name in #define");
+ error("Missing macro name in #define");
if (*cp == '(') {
val = "1";
} else {
@@ -1490,12 +1581,12 @@ defundef(void)
} else if ((cp = matchsym("undef", kw)) != NULL) {
sym = getsym(&cp);
if (sym == NULL)
- error("missing macro name in #undef");
+ error("Missing macro name in #undef");
cp = skipcomment(cp);
debug("#undef");
addsym2(false, sym, NULL);
} else {
- error("unrecognized preprocessor directive");
+ error("Unrecognized preprocessor directive");
}
skipline(cp);
done:
@@ -1567,5 +1658,5 @@ error(const char *msg)
warnx("%s: %d: %s (#if line %d depth %d)",
filename, linenum, msg, stifline[depth], depth);
closeio();
- errx(2, "output may be truncated");
+ errx(2, "Output may be truncated");
}
diff --git a/usr.bin/unifdef/unifdef.h b/usr.bin/unifdef/unifdef.h
index e2e0bd8..6e58e4f 100644
--- a/usr.bin/unifdef/unifdef.h
+++ b/usr.bin/unifdef/unifdef.h
@@ -36,7 +36,7 @@
#include <string.h>
#include <unistd.h>
-/* portabiity stubs */
+/* portability stubs */
#define fbinmode(fp) (fp)
diff --git a/usr.bin/vgrind/RETEST/Makefile b/usr.bin/vgrind/RETEST/Makefile
deleted file mode 100644
index 4d931de..0000000
--- a/usr.bin/vgrind/RETEST/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $FreeBSD$
-
-PROG= retest
-SRCS= regexp.c retest.c
-.PATH: ${.CURDIR}/..
-MAN=
-
-install:
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/vgrind/RETEST/retest.c b/usr.bin/vgrind/RETEST/retest.c
deleted file mode 100644
index 22ece12..0000000
--- a/usr.bin/vgrind/RETEST/retest.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1980, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef lint
-static char copyright[] =
-"@(#) Copyright (c) 1980, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
-#endif /* not lint */
-
-#ifndef lint
-static char sccsid[] = "@(#)retest.c 8.1 (Berkeley) 6/6/93";
-#endif /* not lint */
-
-#include <ctype.h>
-
-int l_onecase = 0;
-char * _start;
-char * _escaped;
-char * convexp();
-char * expmatch();
-main()
-{
- char reg[132];
- char *ireg;
- char str[132];
- char *match;
- char matstr[132];
- char c;
-
- while (1) {
- printf ("\nexpr: ");
- scanf ("%s", reg);
- ireg = convexp(reg);
- match = ireg;
- while(*match) {
- switch (*match) {
-
- case '\\':
- case '(':
- case ')':
- case '|':
- printf ("%c", *match);
- break;
-
- default:
- if (isalnum(*match))
- printf("%c", *match);
- else
- printf ("<%03o>", *match);
- break;
- }
- match++;
- }
- printf("\n");
- getchar();
- while(1) {
- printf ("string: ");
- match = str;
- while ((c = getchar()) != '\n')
- *match++ = c;
- *match = 0;
- if (str[0] == '#')
- break;
- matstr[0] = 0;
- _start = str;
- _escaped = 0;
- match = expmatch (str, ireg, matstr);
- if (match == 0)
- printf ("FAILED\n");
- else
- printf ("match\nmatstr = %s\n", matstr);
- }
-
- }
-}
diff --git a/usr.bin/vi/catalog/Makefile.depend b/usr.bin/vi/catalog/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.bin/vi/catalog/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/vmstat/Makefile.depend b/usr.bin/vmstat/Makefile.depend
index 2322cbf..742f642 100644
--- a/usr.bin/vmstat/Makefile.depend
+++ b/usr.bin/vmstat/Makefile.depend
@@ -10,9 +10,11 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libdevstat \
+ lib/libelf \
lib/libkvm \
lib/libmemstat \
lib/libutil \
+ lib/libxo \
.include <dirdeps.mk>
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index f0044d2..67b5c0c 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -1318,8 +1318,6 @@ print_intrcnts(unsigned long *intrcnts, unsigned long *old_intrcnts,
inttotal = 0;
old_inttotal = 0;
intrname = intrnames;
- xo_emit("{T:/%-*s} {T:/%20s} {T:/%10s}\n",
- (int)istrnamlen, "interrupt", "total", "rate");
xo_open_list("interrupt");
for (i = 0, intrcnt=intrcnts, old_intrcnt=old_intrcnts; i < nintr; i++) {
if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) {
@@ -1328,8 +1326,10 @@ print_intrcnts(unsigned long *intrcnts, unsigned long *old_intrcnts,
count = *intrcnt - *old_intrcnt;
rate = (count * 1000 + period_ms / 2) / period_ms;
xo_open_instance("interrupt");
- xo_emit("{k:name/%-*s} {:total/%20lu} {:rate/%10lu}\n",
- (int)istrnamlen, intrname, count, rate);
+ xo_emit("{d:name/%-*s}{ket:name/%s} "
+ "{:total/%20lu} {:rate/%10lu}\n",
+ (int)istrnamlen, intrname,
+ intrname, count, rate);
xo_close_instance("interrupt");
}
intrname += strlen(intrname) + 1;
@@ -1380,13 +1380,15 @@ dointr(unsigned int interval, int reps)
istrnamlen = clen;
intrname += strlen(intrname) + 1;
}
- xo_emit("%{T:/%-%s} {T:/%20s} {T:/%10s\n",
+ xo_emit("{T:/%-*s} {T:/%20s} {T:/%10s}\n",
(int)istrnamlen, "interrupt", "total", "rate");
/*
* Loop reps times printing differential interrupt counts. If reps is
* zero, then run just once, printing total counts
*/
+ xo_open_container("interrupt-statistics");
+
period_ms = uptime / 1000000;
while(1) {
unsigned int nintr;
@@ -1405,6 +1407,7 @@ dointr(unsigned int interval, int reps)
print_intrcnts(intrcnts, old_intrcnts, intrnames, nintr,
istrnamlen, period_ms);
+ xo_flush();
free(old_intrcnts);
old_intrcnts = intrcnts;
@@ -1415,6 +1418,8 @@ dointr(unsigned int interval, int reps)
uptime = getuptime();
period_ms = (uptime - old_uptime) / 1000000;
}
+
+ xo_close_container("interrupt-statistics");
}
static void
@@ -1446,6 +1451,7 @@ domemstat_malloc(void)
memstat_strerror(error));
}
}
+ xo_open_container("malloc-statistics");
xo_emit("{T:/%13s} {T:/%5s} {T:/%6s} {T:/%7s} {T:/%8s} {T:Size(s)}\n",
"Type", "InUse", "MemUse", "HighUse", "Requests");
xo_open_list("memory");
@@ -1455,7 +1461,7 @@ domemstat_malloc(void)
memstat_get_count(mtp) == 0)
continue;
xo_open_instance("memory");
- xo_emit("{k:type/%13s} {:in-use/%5" PRIu64 "} "
+ xo_emit("{k:type/%13s/%s} {:in-use/%5" PRIu64 "} "
"{:memory-use/%5" PRIu64 "}{U:K} {:high-use/%7s} "
"{:requests/%8" PRIu64 "} ",
memstat_get_name(mtp), memstat_get_count(mtp),
@@ -1476,6 +1482,7 @@ domemstat_malloc(void)
xo_emit("\n");
}
xo_close_list("memory");
+ xo_close_container("malloc-statistics");
memstat_mtl_free(mtlp);
}
@@ -1509,6 +1516,7 @@ domemstat_zone(void)
memstat_strerror(error));
}
}
+ xo_open_container("memory-zone-statistics");
xo_emit("{T:/%-20s} {T:/%6s} {T:/%6s} {T:/%8s} {T:/%8s} {T:/%8s} "
"{T:/%4s} {T:/%4s}\n\n", "ITEM", "SIZE",
"LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP");
@@ -1518,10 +1526,11 @@ domemstat_zone(void)
strlcpy(name, memstat_get_name(mtp), MEMTYPE_MAXNAME);
strcat(name, ":");
xo_open_instance("zone");
- xo_emit("{k:name/%-20s} {:size/%6" PRIu64 "}, "
+ xo_emit("{d:name/%-20s}{ke:name/%s} {:size/%6" PRIu64 "}, "
"{:limit/%6" PRIu64 "},{:used/%8" PRIu64 "},"
"{:free/%8" PRIu64 "},{:requests/%8" PRIu64 "},"
"{:fail/%4" PRIu64 "},{:sleep/%4" PRIu64 "}\n", name,
+ memstat_get_name(mtp),
memstat_get_size(mtp), memstat_get_countlimit(mtp),
memstat_get_count(mtp), memstat_get_free(mtp),
memstat_get_numallocs(mtp), memstat_get_failures(mtp),
@@ -1530,6 +1539,7 @@ domemstat_zone(void)
}
memstat_mtl_free(mtlp);
xo_close_list("zone");
+ xo_close_container("memory-zone-statistics");
xo_emit("\n");
}
diff --git a/usr.bin/w/Makefile.depend b/usr.bin/w/Makefile.depend
index e03ca69..fd7546e 100644
--- a/usr.bin/w/Makefile.depend
+++ b/usr.bin/w/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
lib/libsbuf \
lib/libutil \
diff --git a/usr.bin/w/w.1 b/usr.bin/w/w.1
index 445462b..a8c30be 100644
--- a/usr.bin/w/w.1
+++ b/usr.bin/w/w.1
@@ -28,7 +28,7 @@
.\" @(#)w.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd November 5, 2014
+.Dd December 1, 2015
.Dt W 1
.Os
.Sh NAME
@@ -59,6 +59,13 @@ and the name and arguments of the current process.
.Pp
The options are as follows:
.Bl -tag -width indent
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl d
dumps out the entire process list on a per controlling
tty basis, instead of just the top level process.
diff --git a/usr.bin/wc/wc.1 b/usr.bin/wc/wc.1
index cda737b..8f78fad 100644
--- a/usr.bin/wc/wc.1
+++ b/usr.bin/wc/wc.1
@@ -31,7 +31,7 @@
.\" @(#)wc.1 8.2 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd August 24, 2015
+.Dd December 1, 2015
.Dt WC 1
.Os
.Sh NAME
@@ -68,6 +68,13 @@ the last file.
.Pp
The following options are available:
.Bl -tag -width indent
+.It Fl -libxo
+Generate output via
+.Xr libxo 3
+in a selection of different human and machine readable formats.
+See
+.Xr xo_parse_args 3
+for details on command line arguments.
.It Fl L
The number of characters in the longest input line
is written to the standard output.
diff --git a/usr.bin/xo/Makefile.depend b/usr.bin/xo/Makefile.depend
new file mode 100644
index 0000000..137678c
--- /dev/null
+++ b/usr.bin/xo/Makefile.depend
@@ -0,0 +1,20 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+ lib/libxo \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index 8cebd61..3bec616 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -7,6 +7,7 @@ SUBDIR= adduser \
arp \
binmiscctl \
bsdconfig \
+ camdd \
cdcontrol \
chkgrp \
chown \
diff --git a/usr.sbin/asf/Makefile.depend b/usr.sbin/asf/Makefile.depend
index a1ac545..34582cd 100644
--- a/usr.sbin/asf/Makefile.depend
+++ b/usr.sbin/asf/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.sbin/auditdistd/Makefile.depend b/usr.sbin/auditdistd/Makefile.depend
new file mode 100644
index 0000000..b939d66
--- /dev/null
+++ b/usr.sbin/auditdistd/Makefile.depend
@@ -0,0 +1,31 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ lib/libutil \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+ usr.bin/lex/lib \
+ usr.bin/yacc.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+parse.o: parse.c
+parse.po: parse.c
+token.o: parse.h
+token.o: token.c
+token.po: parse.h
+token.po: token.c
+.endif
diff --git a/usr.sbin/autofs/Makefile.depend b/usr.sbin/autofs/Makefile.depend
new file mode 100644
index 0000000..61f3b2b
--- /dev/null
+++ b/usr.sbin/autofs/Makefile.depend
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+token.o: token.c
+token.po: token.c
+.endif
diff --git a/usr.sbin/bhyvectl/Makefile.depend b/usr.sbin/bhyvectl/Makefile.depend
new file mode 100644
index 0000000..2d0f324
--- /dev/null
+++ b/usr.sbin/bhyvectl/Makefile.depend
@@ -0,0 +1,20 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+ lib/libvmmapi \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bhyveload/Makefile.depend b/usr.sbin/bhyveload/Makefile.depend
new file mode 100644
index 0000000..2d0f324
--- /dev/null
+++ b/usr.sbin/bhyveload/Makefile.depend
@@ -0,0 +1,20 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libutil \
+ lib/libvmmapi \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/binmiscctl/Makefile.depend b/usr.sbin/binmiscctl/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/usr.sbin/binmiscctl/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/Makefile.depend b/usr.sbin/bsdconfig/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/console/Makefile.depend b/usr.sbin/bsdconfig/console/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/console/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/console/include/Makefile.depend b/usr.sbin/bsdconfig/console/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/console/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/diskmgmt/Makefile.depend b/usr.sbin/bsdconfig/diskmgmt/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/diskmgmt/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/diskmgmt/include/Makefile.depend b/usr.sbin/bsdconfig/diskmgmt/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/diskmgmt/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/docsinstall/Makefile.depend b/usr.sbin/bsdconfig/docsinstall/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/docsinstall/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/docsinstall/include/Makefile.depend b/usr.sbin/bsdconfig/docsinstall/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/docsinstall/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/dot/Makefile.depend b/usr.sbin/bsdconfig/dot/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/dot/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/dot/include/Makefile.depend b/usr.sbin/bsdconfig/dot/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/dot/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/examples/Makefile.depend b/usr.sbin/bsdconfig/examples/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/examples/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/include/Makefile.depend b/usr.sbin/bsdconfig/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/includes/Makefile.depend b/usr.sbin/bsdconfig/includes/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/includes/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/includes/include/Makefile.depend b/usr.sbin/bsdconfig/includes/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/includes/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/mouse/Makefile.depend b/usr.sbin/bsdconfig/mouse/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/mouse/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/mouse/include/Makefile.depend b/usr.sbin/bsdconfig/mouse/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/mouse/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/networking/Makefile.depend b/usr.sbin/bsdconfig/networking/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/networking/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/networking/include/Makefile.depend b/usr.sbin/bsdconfig/networking/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/networking/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/networking/share/Makefile.depend b/usr.sbin/bsdconfig/networking/share/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/networking/share/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/password/Makefile.depend b/usr.sbin/bsdconfig/password/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/password/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/password/include/Makefile.depend b/usr.sbin/bsdconfig/password/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/password/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/password/share/Makefile.depend b/usr.sbin/bsdconfig/password/share/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/password/share/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/security/Makefile.depend b/usr.sbin/bsdconfig/security/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/security/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/security/include/Makefile.depend b/usr.sbin/bsdconfig/security/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/security/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/share/Makefile.depend b/usr.sbin/bsdconfig/share/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/share/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/share/media/Makefile.depend b/usr.sbin/bsdconfig/share/media/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/share/media/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/startup/Makefile.depend b/usr.sbin/bsdconfig/startup/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/startup/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/startup/include/Makefile.depend b/usr.sbin/bsdconfig/startup/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/startup/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/startup/share/Makefile.depend b/usr.sbin/bsdconfig/startup/share/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/startup/share/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/timezone/Makefile.depend b/usr.sbin/bsdconfig/timezone/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/timezone/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/timezone/include/Makefile.depend b/usr.sbin/bsdconfig/timezone/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/timezone/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/timezone/share/Makefile.depend b/usr.sbin/bsdconfig/timezone/share/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/timezone/share/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/ttys/Makefile.depend b/usr.sbin/bsdconfig/ttys/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/ttys/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/ttys/include/Makefile.depend b/usr.sbin/bsdconfig/ttys/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/ttys/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/usermgmt/Makefile.depend b/usr.sbin/bsdconfig/usermgmt/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/usermgmt/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/usermgmt/include/Makefile.depend b/usr.sbin/bsdconfig/usermgmt/include/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/usermgmt/include/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdconfig/usermgmt/share/Makefile.depend b/usr.sbin/bsdconfig/usermgmt/share/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/bsdconfig/usermgmt/share/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig
index d5a14ce..f9913c3 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig
+++ b/usr.sbin/bsdinstall/scripts/netconfig
@@ -41,19 +41,24 @@ DIALOG_TAGS=""
: ${DIALOG_ITEM_HELP=4}
: ${DIALOG_ESC=255}
-# Do a dirty check to see if this a wireless interface -- there should be a
-# better way
-is_wireless_if() {
- ifconfig $1 | grep -q 'media: IEEE 802.11 Wireless'
-}
-
for IF in `ifconfig -l`; do
test "$IF" = "lo0" && continue
(ifconfig -g wlan | egrep -wq $IF) && continue
INTERFACES="$INTERFACES $IF"
+done
+
+INTERFACES="$INTERFACES $(sysctl -in net.wlan.devices)"
+is_wireless_if() {
+ for IF in $(sysctl -in net.wlan.devices); do
+ if [ $IF = $1 ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+for IF in $INTERFACES; do
DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc`
- is_wireless_if $IF && echo $DESC |
- grep -iqv wireless && DESC="Wireless $DESC"
DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\""
done
diff --git a/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend
index ccb3d83..140fffb 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_hast/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/arpa \
@@ -11,6 +12,7 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libutil \
+ usr.bin/yacc.host \
usr.sbin/bsnmpd/modules \
diff --git a/usr.sbin/camdd/Makefile b/usr.sbin/camdd/Makefile
new file mode 100644
index 0000000..4007ca7
--- /dev/null
+++ b/usr.sbin/camdd/Makefile
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+PROG= camdd
+SRCS= camdd.c
+SDIR= ${.CURDIR}/../../sys
+LIBADD= cam mt sbuf bsdxml util pthread
+NO_WTHREAD_SAFETY= 1
+MAN= camdd.8
+
+.include <bsd.prog.mk>
diff --git a/usr.sbin/camdd/Makefile.depend b/usr.sbin/camdd/Makefile.depend
new file mode 100644
index 0000000..17ca2bc
--- /dev/null
+++ b/usr.sbin/camdd/Makefile.depend
@@ -0,0 +1,25 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcam \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/libmt \
+ lib/libsbuf \
+ lib/libthr \
+ lib/libutil \
+ lib/libz \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/camdd/camdd.8 b/usr.sbin/camdd/camdd.8
new file mode 100644
index 0000000..af556bb
--- /dev/null
+++ b/usr.sbin/camdd/camdd.8
@@ -0,0 +1,283 @@
+.\"
+.\" Copyright (c) 2015 Spectra Logic Corporation
+.\" 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,
+.\" without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\" substantially similar to the "NO WARRANTY" disclaimer below
+.\" ("Disclaimer") and any redistribution must be conditioned upon
+.\" including a substantially similar Disclaimer requirement for further
+.\" binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+.\"
+.\" Authors: Ken Merry (Spectra Logic Corporation)
+.\"
+.\" $FreeBSD$
+.\"
+.Dd November 11, 2015
+.Dt CAMDD 8
+.Os
+.Sh NAME
+.Nm camdd
+.Nd CAM data transfer utility
+.Sh SYNOPSIS
+.Nm
+.Aq Fl i|o Ar pass=pass_dev|file=filename,bs=blocksize,[...]
+.Op Fl C Ar retry_count
+.Op Fl E
+.Op Fl m Ar max_io
+.Op Fl t Ar timeout
+.Op Fl v
+.Op Fl h
+.Sh DESCRIPTION
+The
+.Nm
+utility is a sequential data transfer utility that offers standard
+.Xr read 2
+and
+.Xr write 2
+operation in addition to a mode that uses the asynchronous
+.Xr pass 4
+API.
+The asynchronous
+.Xr pass 4
+API allows multiple requests to be queued to a device simultaneously.
+.Pp
+.Nm
+collects performance information and will display it when the transfer
+completes, when
+.Nm
+is terminated or when it receives a SIGINFO signal.
+.Pp
+The following options are available:
+.Bl -tag -width 12n
+.It Fl i | o Ar args
+Specify the input and output device or file.
+Both
+.Fl i
+and
+.Fl o
+must be specified.
+There are a number of parameters that can be specified.
+One of the first two (file or pass) MUST be specified to indicate which I/O
+method to use on the device in question.
+.Bl -tag -width 9n
+.It pass=dev
+Specify a
+.Xr pass 4
+device to operate on.
+This requests that
+.Nm
+access the device in question be accessed via the asynchronous
+.Xr pass 4
+interface.
+.Pp
+The device name can be a
+.Xr pass 4
+name and unit number, for instance
+.Dq pass0 ,
+or a regular peripheral driver name and unit number, for instance
+.Dq da5 .
+It can also be the path of a
+.Xr pass 4
+or other disk device, like
+.Dq /dev/da5 .
+It may also be a bus:target:lun, for example:
+.Dq 0:5:0 .
+.Pp
+Only
+.Xr pass 4
+devices for
+.Tn SCSI
+disk-like devices are supported.
+.Tn ATA
+devices are not currently supported, but support could be added later.
+Specifically,
+.Tn SCSI
+Direct Access (type 0), WORM (type 4), CDROM (type 5), and RBC (Reduced
+Block Command, type 14) devices are supported.
+Tape drives, medium changers, enclosures etc. are not supported.
+.It file=path
+Specify a file or device to operate on.
+This requests that the file or device in question be accessed using the
+standard
+.Xr read 2
+and
+.Xr write 2
+system calls.
+The file interface does not support queueing multiple commands at a time.
+It does support probing disk sector size and capacity information, and tape
+blocksize and maximum transfer size information.
+The file interface supports standard files, disks, tape drives, special
+devices, pipes and standard input and output.
+If the file is specified as a
+.Dq - ,
+standard input or standard output are used.
+For tape devices, the specified blocksize will be the size that
+.Nm
+attempts to use to write to or read from the tape.
+When writing to a tape device, the blocksize is treated like a disk sector
+size.
+So, that means
+.Nm
+will not write anything smaller than the sector size.
+At the end of a transfer, if there isn't sufficient data from the reader
+to yield a full block,
+.Nm
+will add zeros on the end of the data from the reader to make up a full
+block.
+.It bs=N
+Specify the blocksize to use for transfers.
+.Nm
+will attempt to read or write using the requested blocksize.
+.Pp
+Note that the blocksize given only applies to either the input or the
+output path.
+To use the same blocksize for the input and output transfers, you must
+specify that blocksize with both the
+.Fl i
+and
+.Fl o
+arguments.
+.Pp
+The blocksize may be specified in bytes, or using any suffix (e.g. k, M, G)
+supported by
+.Xr expand_number 3 .
+.It offset=N
+Specify the starting offset for the input or output device or file.
+The offset may be specified in bytes, or by using any suffix (e.g. k, M, G)
+supported by
+.Xr expand_number 3 .
+.It depth=N
+Specify a desired queue depth for the input or output path.
+.Nm
+will attempt to keep the requested number of requests of the specified
+blocksize queued to the input or output device.
+Queue depths greater than 1 are only supported for the asynchronous
+.Xr pass 4
+output method.
+The queue depth is maintained on a best effort basis, and may not be
+possible to maintain for especially fast devices.
+For writes, maintaining the queue depth also depends on a sufficiently
+fast reading device.
+.It mcs=N
+Specify the minimum command size to use for
+.Xr pass 4
+devices.
+Some devices do not support 6 byte
+.Tn SCSI
+commands.
+The
+.Xr da 4
+device handles this restriction automatically, but the
+.Xr pass 4
+device allows the user to specify the
+.Tn SCSI
+command used.
+If a device does not accept 6 byte
+.Tn SCSI
+READ/WRITE commands (which is the default at lower LBAs), it will generally
+accept 10 byte
+.Tn SCSI
+commands instead.
+.It debug=N
+Specify the debug level for this device.
+There is currently only one debug level setting, so setting this to any
+non-zero value will turn on debugging.
+The debug facility may be expanded in the future.
+.El
+.It Fl C Ar count
+Specify the retry count for commands sent via the asynchronous
+.Xr pass 4
+interface.
+This does not apply to commands sent via the file interface.
+.It Fl E
+Enable kernel error recovery for the
+.Xr pass 4
+driver.
+If error recovery is not enabled, unit attention conditions and other
+transient failures may cause the transfer to fail.
+.It Fl m Ar size
+Specify the maximum amount of data to be transferred.
+This may be specified in bytes, or by using any suffix (e.g. K, M, G)
+supported by
+.Xr expand_number 3 .
+.It Fl t Ar timeout
+Specify the command timeout in seconds to use for commands sent via the
+.Xr pass 4
+driver.
+.It Fl v
+Enable verbose reporting of errors.
+This is recommended to aid in debugging any
+.Tn SCSI
+issues that come up.
+.It Fl h
+Display the
+.Nm
+usage message.
+.El
+.Pp
+If
+.Nm
+receives a SIGINFO signal, it will print the current input and output byte
+counts, elapsed runtime and average throughput.
+If
+.Nm
+receives a SIGINT signal, it will print the current input and output byte
+counts, elapsed runtime and average throughput and then exit.
+.Sh EXAMPLES
+.Dl camdd -i pass=da8,bs=512k,depth=4 -o pass=da3,bs=512k,depth=4
+.Pp
+Copy all data from da8 to da3 using a blocksize of 512k for both drives,
+and attempt to maintain a queue depth of 4 on both the input and output
+devices.
+The transfer will stop when the end of either device is reached.
+.Pp
+.Dl camdd -i file=/dev/zero,bs=1M -o pass=da5,bs=1M,depth=4 -m 100M
+.Pp
+Read 1MB blocks of zeros from /dev/zero, and write them to da5 with a
+desired queue depth of 4.
+Stop the transfer after 100MB has been written.
+.Pp
+.Dl camdd -i pass=da8,bs=1M,depth=3 -o file=disk.img
+.Pp
+Copy disk da8 using a 1MB blocksize and desired queue depth of 3 to the
+file disk.img.
+.Pp
+.Dl camdd -i file=/etc/rc -o file=-
+.Pp
+Read the file /etc/rc and write it to standard output.
+.Pp
+.Dl camdd -i pass=da10,bs=64k,depth=16 -o file=/dev/nsa0,bs=128k
+.Pp
+Copy 64K blocks from the disk da10 with a queue depth of 16, and write
+to the tape drive sa0 with a 128k blocksize.
+The copy will stop when either the end of the disk or tape is reached.
+.Sh SEE ALSO
+.Xr cam 3 ,
+.Xr cam 4 ,
+.Xr pass 4 ,
+.Xr camcontrol 8
+.Sh HISTORY
+.Nm
+first appeared in
+.Fx 10.2
+.Sh AUTHORS
+.An Kenneth Merry Aq Mt ken@FreeBSD.org
diff --git a/usr.sbin/camdd/camdd.c b/usr.sbin/camdd/camdd.c
new file mode 100644
index 0000000..573214e
--- /dev/null
+++ b/usr.sbin/camdd/camdd.c
@@ -0,0 +1,3428 @@
+/*-
+ * Copyright (c) 1997-2007 Kenneth D. Merry
+ * Copyright (c) 2013, 2014, 2015 Spectra Logic Corporation
+ * 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,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+ *
+ * Authors: Ken Merry (Spectra Logic Corporation)
+ */
+
+/*
+ * This is eventually intended to be:
+ * - A basic data transfer/copy utility
+ * - A simple benchmark utility
+ * - An example of how to use the asynchronous pass(4) driver interface.
+ */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/ioctl.h>
+#include <sys/stdint.h>
+#include <sys/types.h>
+#include <sys/endian.h>
+#include <sys/param.h>
+#include <sys/sbuf.h>
+#include <sys/stat.h>
+#include <sys/event.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <vm/vm.h>
+#include <machine/bus.h>
+#include <sys/bus.h>
+#include <sys/bus_dma.h>
+#include <sys/mtio.h>
+#include <sys/conf.h>
+#include <sys/disk.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <semaphore.h>
+#include <string.h>
+#include <unistd.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <err.h>
+#include <libutil.h>
+#include <pthread.h>
+#include <assert.h>
+#include <bsdxml.h>
+
+#include <cam/cam.h>
+#include <cam/cam_debug.h>
+#include <cam/cam_ccb.h>
+#include <cam/scsi/scsi_all.h>
+#include <cam/scsi/scsi_da.h>
+#include <cam/scsi/scsi_pass.h>
+#include <cam/scsi/scsi_message.h>
+#include <cam/scsi/smp_all.h>
+#include <camlib.h>
+#include <mtlib.h>
+#include <zlib.h>
+
+typedef enum {
+ CAMDD_CMD_NONE = 0x00000000,
+ CAMDD_CMD_HELP = 0x00000001,
+ CAMDD_CMD_WRITE = 0x00000002,
+ CAMDD_CMD_READ = 0x00000003
+} camdd_cmdmask;
+
+typedef enum {
+ CAMDD_ARG_NONE = 0x00000000,
+ CAMDD_ARG_VERBOSE = 0x00000001,
+ CAMDD_ARG_DEVICE = 0x00000002,
+ CAMDD_ARG_BUS = 0x00000004,
+ CAMDD_ARG_TARGET = 0x00000008,
+ CAMDD_ARG_LUN = 0x00000010,
+ CAMDD_ARG_UNIT = 0x00000020,
+ CAMDD_ARG_TIMEOUT = 0x00000040,
+ CAMDD_ARG_ERR_RECOVER = 0x00000080,
+ CAMDD_ARG_RETRIES = 0x00000100
+} camdd_argmask;
+
+typedef enum {
+ CAMDD_DEV_NONE = 0x00,
+ CAMDD_DEV_PASS = 0x01,
+ CAMDD_DEV_FILE = 0x02
+} camdd_dev_type;
+
+struct camdd_io_opts {
+ camdd_dev_type dev_type;
+ char *dev_name;
+ uint64_t blocksize;
+ uint64_t queue_depth;
+ uint64_t offset;
+ int min_cmd_size;
+ int write_dev;
+ uint64_t debug;
+};
+
+typedef enum {
+ CAMDD_BUF_NONE,
+ CAMDD_BUF_DATA,
+ CAMDD_BUF_INDIRECT
+} camdd_buf_type;
+
+struct camdd_buf_indirect {
+ /*
+ * Pointer to the source buffer.
+ */
+ struct camdd_buf *src_buf;
+
+ /*
+ * Offset into the source buffer, in bytes.
+ */
+ uint64_t offset;
+ /*
+ * Pointer to the starting point in the source buffer.
+ */
+ uint8_t *start_ptr;
+
+ /*
+ * Length of this chunk in bytes.
+ */
+ size_t len;
+};
+
+struct camdd_buf_data {
+ /*
+ * Buffer allocated when we allocate this camdd_buf. This should
+ * be the size of the blocksize for this device.
+ */
+ uint8_t *buf;
+
+ /*
+ * The amount of backing store allocated in buf. Generally this
+ * will be the blocksize of the device.
+ */
+ uint32_t alloc_len;
+
+ /*
+ * The amount of data that was put into the buffer (on reads) or
+ * the amount of data we have put onto the src_list so far (on
+ * writes).
+ */
+ uint32_t fill_len;
+
+ /*
+ * The amount of data that was not transferred.
+ */
+ uint32_t resid;
+
+ /*
+ * Starting byte offset on the reader.
+ */
+ uint64_t src_start_offset;
+
+ /*
+ * CCB used for pass(4) device targets.
+ */
+ union ccb ccb;
+
+ /*
+ * Number of scatter/gather segments.
+ */
+ int sg_count;
+
+ /*
+ * Set if we had to tack on an extra buffer to round the transfer
+ * up to a sector size.
+ */
+ int extra_buf;
+
+ /*
+ * Scatter/gather list used generally when we're the writer for a
+ * pass(4) device.
+ */
+ bus_dma_segment_t *segs;
+
+ /*
+ * Scatter/gather list used generally when we're the writer for a
+ * file or block device;
+ */
+ struct iovec *iovec;
+};
+
+union camdd_buf_types {
+ struct camdd_buf_indirect indirect;
+ struct camdd_buf_data data;
+};
+
+typedef enum {
+ CAMDD_STATUS_NONE,
+ CAMDD_STATUS_OK,
+ CAMDD_STATUS_SHORT_IO,
+ CAMDD_STATUS_EOF,
+ CAMDD_STATUS_ERROR
+} camdd_buf_status;
+
+struct camdd_buf {
+ camdd_buf_type buf_type;
+ union camdd_buf_types buf_type_spec;
+
+ camdd_buf_status status;
+
+ uint64_t lba;
+ size_t len;
+
+ /*
+ * A reference count of how many indirect buffers point to this
+ * buffer.
+ */
+ int refcount;
+
+ /*
+ * A link back to our parent device.
+ */
+ struct camdd_dev *dev;
+ STAILQ_ENTRY(camdd_buf) links;
+ STAILQ_ENTRY(camdd_buf) work_links;
+
+ /*
+ * A count of the buffers on the src_list.
+ */
+ int src_count;
+
+ /*
+ * List of buffers from our partner thread that are the components
+ * of this buffer for the I/O. Uses src_links.
+ */
+ STAILQ_HEAD(,camdd_buf) src_list;
+ STAILQ_ENTRY(camdd_buf) src_links;
+};
+
+#define NUM_DEV_TYPES 2
+
+struct camdd_dev_pass {
+ int scsi_dev_type;
+ struct cam_device *dev;
+ uint64_t max_sector;
+ uint32_t block_len;
+ uint32_t cpi_maxio;
+};
+
+typedef enum {
+ CAMDD_FILE_NONE,
+ CAMDD_FILE_REG,
+ CAMDD_FILE_STD,
+ CAMDD_FILE_PIPE,
+ CAMDD_FILE_DISK,
+ CAMDD_FILE_TAPE,
+ CAMDD_FILE_TTY,
+ CAMDD_FILE_MEM
+} camdd_file_type;
+
+typedef enum {
+ CAMDD_FF_NONE = 0x00,
+ CAMDD_FF_CAN_SEEK = 0x01
+} camdd_file_flags;
+
+struct camdd_dev_file {
+ int fd;
+ struct stat sb;
+ char filename[MAXPATHLEN + 1];
+ camdd_file_type file_type;
+ camdd_file_flags file_flags;
+ uint8_t *tmp_buf;
+};
+
+struct camdd_dev_block {
+ int fd;
+ uint64_t size_bytes;
+ uint32_t block_len;
+};
+
+union camdd_dev_spec {
+ struct camdd_dev_pass pass;
+ struct camdd_dev_file file;
+ struct camdd_dev_block block;
+};
+
+typedef enum {
+ CAMDD_DEV_FLAG_NONE = 0x00,
+ CAMDD_DEV_FLAG_EOF = 0x01,
+ CAMDD_DEV_FLAG_PEER_EOF = 0x02,
+ CAMDD_DEV_FLAG_ACTIVE = 0x04,
+ CAMDD_DEV_FLAG_EOF_SENT = 0x08,
+ CAMDD_DEV_FLAG_EOF_QUEUED = 0x10
+} camdd_dev_flags;
+
+struct camdd_dev {
+ camdd_dev_type dev_type;
+ union camdd_dev_spec dev_spec;
+ camdd_dev_flags flags;
+ char device_name[MAXPATHLEN+1];
+ uint32_t blocksize;
+ uint32_t sector_size;
+ uint64_t max_sector;
+ uint64_t sector_io_limit;
+ int min_cmd_size;
+ int write_dev;
+ int retry_count;
+ int io_timeout;
+ int debug;
+ uint64_t start_offset_bytes;
+ uint64_t next_io_pos_bytes;
+ uint64_t next_peer_pos_bytes;
+ uint64_t next_completion_pos_bytes;
+ uint64_t peer_bytes_queued;
+ uint64_t bytes_transferred;
+ uint32_t target_queue_depth;
+ uint32_t cur_active_io;
+ uint8_t *extra_buf;
+ uint32_t extra_buf_len;
+ struct camdd_dev *peer_dev;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ int kq;
+
+ int (*run)(struct camdd_dev *dev);
+ int (*fetch)(struct camdd_dev *dev);
+
+ /*
+ * Buffers that are available for I/O. Uses links.
+ */
+ STAILQ_HEAD(,camdd_buf) free_queue;
+
+ /*
+ * Free indirect buffers. These are used for breaking a large
+ * buffer into multiple pieces.
+ */
+ STAILQ_HEAD(,camdd_buf) free_indirect_queue;
+
+ /*
+ * Buffers that have been queued to the kernel. Uses links.
+ */
+ STAILQ_HEAD(,camdd_buf) active_queue;
+
+ /*
+ * Will generally contain one of our buffers that is waiting for enough
+ * I/O from our partner thread to be able to execute. This will
+ * generally happen when our per-I/O-size is larger than the
+ * partner thread's per-I/O-size. Uses links.
+ */
+ STAILQ_HEAD(,camdd_buf) pending_queue;
+
+ /*
+ * Number of buffers on the pending queue
+ */
+ int num_pending_queue;
+
+ /*
+ * Buffers that are filled and ready to execute. This is used when
+ * our partner (reader) thread sends us blocks that are larger than
+ * our blocksize, and so we have to split them into multiple pieces.
+ */
+ STAILQ_HEAD(,camdd_buf) run_queue;
+
+ /*
+ * Number of buffers on the run queue.
+ */
+ int num_run_queue;
+
+ STAILQ_HEAD(,camdd_buf) reorder_queue;
+
+ int num_reorder_queue;
+
+ /*
+ * Buffers that have been queued to us by our partner thread
+ * (generally the reader thread) to be written out. Uses
+ * work_links.
+ */
+ STAILQ_HEAD(,camdd_buf) work_queue;
+
+ /*
+ * Buffers that have been completed by our partner thread. Uses
+ * work_links.
+ */
+ STAILQ_HEAD(,camdd_buf) peer_done_queue;
+
+ /*
+ * Number of buffers on the peer done queue.
+ */
+ uint32_t num_peer_done_queue;
+
+ /*
+ * A list of buffers that we have queued to our peer thread. Uses
+ * links.
+ */
+ STAILQ_HEAD(,camdd_buf) peer_work_queue;
+
+ /*
+ * Number of buffers on the peer work queue.
+ */
+ uint32_t num_peer_work_queue;
+};
+
+static sem_t camdd_sem;
+static int need_exit = 0;
+static int error_exit = 0;
+static int need_status = 0;
+
+#ifndef min
+#define min(a, b) (a < b) ? a : b
+#endif
+
+/*
+ * XXX KDM private copy of timespecsub(). This is normally defined in
+ * sys/time.h, but is only enabled in the kernel. If that definition is
+ * enabled in userland, it breaks the build of libnetbsd.
+ */
+#ifndef timespecsub
+#define timespecsub(vvp, uvp) \
+ do { \
+ (vvp)->tv_sec -= (uvp)->tv_sec; \
+ (vvp)->tv_nsec -= (uvp)->tv_nsec; \
+ if ((vvp)->tv_nsec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_nsec += 1000000000; \
+ } \
+ } while (0)
+#endif
+
+
+/* Generically usefull offsets into the peripheral private area */
+#define ppriv_ptr0 periph_priv.entries[0].ptr
+#define ppriv_ptr1 periph_priv.entries[1].ptr
+#define ppriv_field0 periph_priv.entries[0].field
+#define ppriv_field1 periph_priv.entries[1].field
+
+#define ccb_buf ppriv_ptr0
+
+#define CAMDD_FILE_DEFAULT_BLOCK 524288
+#define CAMDD_FILE_DEFAULT_DEPTH 1
+#define CAMDD_PASS_MAX_BLOCK 1048576
+#define CAMDD_PASS_DEFAULT_DEPTH 6
+#define CAMDD_PASS_RW_TIMEOUT 60 * 1000
+
+static int parse_btl(char *tstr, int *bus, int *target, int *lun,
+ camdd_argmask *arglst);
+void camdd_free_dev(struct camdd_dev *dev);
+struct camdd_dev *camdd_alloc_dev(camdd_dev_type dev_type,
+ struct kevent *new_ke, int num_ke,
+ int retry_count, int timeout);
+static struct camdd_buf *camdd_alloc_buf(struct camdd_dev *dev,
+ camdd_buf_type buf_type);
+void camdd_release_buf(struct camdd_buf *buf);
+struct camdd_buf *camdd_get_buf(struct camdd_dev *dev, camdd_buf_type buf_type);
+int camdd_buf_sg_create(struct camdd_buf *buf, int iovec,
+ uint32_t sector_size, uint32_t *num_sectors_used,
+ int *double_buf_needed);
+uint32_t camdd_buf_get_len(struct camdd_buf *buf);
+void camdd_buf_add_child(struct camdd_buf *buf, struct camdd_buf *child_buf);
+int camdd_probe_tape(int fd, char *filename, uint64_t *max_iosize,
+ uint64_t *max_blk, uint64_t *min_blk, uint64_t *blk_gran);
+struct camdd_dev *camdd_probe_file(int fd, struct camdd_io_opts *io_opts,
+ int retry_count, int timeout);
+struct camdd_dev *camdd_probe_pass(struct cam_device *cam_dev,
+ struct camdd_io_opts *io_opts,
+ camdd_argmask arglist, int probe_retry_count,
+ int probe_timeout, int io_retry_count,
+ int io_timeout);
+void *camdd_file_worker(void *arg);
+camdd_buf_status camdd_ccb_status(union ccb *ccb);
+int camdd_queue_peer_buf(struct camdd_dev *dev, struct camdd_buf *buf);
+int camdd_complete_peer_buf(struct camdd_dev *dev, struct camdd_buf *peer_buf);
+void camdd_peer_done(struct camdd_buf *buf);
+void camdd_complete_buf(struct camdd_dev *dev, struct camdd_buf *buf,
+ int *error_count);
+int camdd_pass_fetch(struct camdd_dev *dev);
+int camdd_file_run(struct camdd_dev *dev);
+int camdd_pass_run(struct camdd_dev *dev);
+int camdd_get_next_lba_len(struct camdd_dev *dev, uint64_t *lba, ssize_t *len);
+int camdd_queue(struct camdd_dev *dev, struct camdd_buf *read_buf);
+void camdd_get_depth(struct camdd_dev *dev, uint32_t *our_depth,
+ uint32_t *peer_depth, uint32_t *our_bytes,
+ uint32_t *peer_bytes);
+void *camdd_worker(void *arg);
+void camdd_sig_handler(int sig);
+void camdd_print_status(struct camdd_dev *camdd_dev,
+ struct camdd_dev *other_dev,
+ struct timespec *start_time);
+int camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts,
+ uint64_t max_io, int retry_count, int timeout);
+int camdd_parse_io_opts(char *args, int is_write,
+ struct camdd_io_opts *io_opts);
+void usage(void);
+
+/*
+ * Parse out a bus, or a bus, target and lun in the following
+ * format:
+ * bus
+ * bus:target
+ * bus:target:lun
+ *
+ * Returns the number of parsed components, or 0.
+ */
+static int
+parse_btl(char *tstr, int *bus, int *target, int *lun, camdd_argmask *arglst)
+{
+ char *tmpstr;
+ int convs = 0;
+
+ while (isspace(*tstr) && (*tstr != '\0'))
+ tstr++;
+
+ tmpstr = (char *)strtok(tstr, ":");
+ if ((tmpstr != NULL) && (*tmpstr != '\0')) {
+ *bus = strtol(tmpstr, NULL, 0);
+ *arglst |= CAMDD_ARG_BUS;
+ convs++;
+ tmpstr = (char *)strtok(NULL, ":");
+ if ((tmpstr != NULL) && (*tmpstr != '\0')) {
+ *target = strtol(tmpstr, NULL, 0);
+ *arglst |= CAMDD_ARG_TARGET;
+ convs++;
+ tmpstr = (char *)strtok(NULL, ":");
+ if ((tmpstr != NULL) && (*tmpstr != '\0')) {
+ *lun = strtol(tmpstr, NULL, 0);
+ *arglst |= CAMDD_ARG_LUN;
+ convs++;
+ }
+ }
+ }
+
+ return convs;
+}
+
+/*
+ * XXX KDM clean up and free all of the buffers on the queue!
+ */
+void
+camdd_free_dev(struct camdd_dev *dev)
+{
+ if (dev == NULL)
+ return;
+
+ switch (dev->dev_type) {
+ case CAMDD_DEV_FILE: {
+ struct camdd_dev_file *file_dev = &dev->dev_spec.file;
+
+ if (file_dev->fd != -1)
+ close(file_dev->fd);
+ free(file_dev->tmp_buf);
+ break;
+ }
+ case CAMDD_DEV_PASS: {
+ struct camdd_dev_pass *pass_dev = &dev->dev_spec.pass;
+
+ if (pass_dev->dev != NULL)
+ cam_close_device(pass_dev->dev);
+ break;
+ }
+ default:
+ break;
+ }
+
+ free(dev);
+}
+
+struct camdd_dev *
+camdd_alloc_dev(camdd_dev_type dev_type, struct kevent *new_ke, int num_ke,
+ int retry_count, int timeout)
+{
+ struct camdd_dev *dev = NULL;
+ struct kevent *ke;
+ size_t ke_size;
+ int retval = 0;
+
+ dev = malloc(sizeof(*dev));
+ if (dev == NULL) {
+ warn("%s: unable to malloc %zu bytes", __func__, sizeof(*dev));
+ goto bailout;
+ }
+
+ bzero(dev, sizeof(*dev));
+
+ dev->dev_type = dev_type;
+ dev->io_timeout = timeout;
+ dev->retry_count = retry_count;
+ STAILQ_INIT(&dev->free_queue);
+ STAILQ_INIT(&dev->free_indirect_queue);
+ STAILQ_INIT(&dev->active_queue);
+ STAILQ_INIT(&dev->pending_queue);
+ STAILQ_INIT(&dev->run_queue);
+ STAILQ_INIT(&dev->reorder_queue);
+ STAILQ_INIT(&dev->work_queue);
+ STAILQ_INIT(&dev->peer_done_queue);
+ STAILQ_INIT(&dev->peer_work_queue);
+ retval = pthread_mutex_init(&dev->mutex, NULL);
+ if (retval != 0) {
+ warnc(retval, "%s: failed to initialize mutex", __func__);
+ goto bailout;
+ }
+
+ retval = pthread_cond_init(&dev->cond, NULL);
+ if (retval != 0) {
+ warnc(retval, "%s: failed to initialize condition variable",
+ __func__);
+ goto bailout;
+ }
+
+ dev->kq = kqueue();
+ if (dev->kq == -1) {
+ warn("%s: Unable to create kqueue", __func__);
+ goto bailout;
+ }
+
+ ke_size = sizeof(struct kevent) * (num_ke + 4);
+ ke = malloc(ke_size);
+ if (ke == NULL) {
+ warn("%s: unable to malloc %zu bytes", __func__, ke_size);
+ goto bailout;
+ }
+ bzero(ke, ke_size);
+ if (num_ke > 0)
+ bcopy(new_ke, ke, num_ke * sizeof(struct kevent));
+
+ EV_SET(&ke[num_ke++], (uintptr_t)&dev->work_queue, EVFILT_USER,
+ EV_ADD|EV_ENABLE|EV_CLEAR, 0,0, 0);
+ EV_SET(&ke[num_ke++], (uintptr_t)&dev->peer_done_queue, EVFILT_USER,
+ EV_ADD|EV_ENABLE|EV_CLEAR, 0,0, 0);
+ EV_SET(&ke[num_ke++], SIGINFO, EVFILT_SIGNAL, EV_ADD|EV_ENABLE, 0,0,0);
+ EV_SET(&ke[num_ke++], SIGINT, EVFILT_SIGNAL, EV_ADD|EV_ENABLE, 0,0,0);
+
+ retval = kevent(dev->kq, ke, num_ke, NULL, 0, NULL);
+ if (retval == -1) {
+ warn("%s: Unable to register kevents", __func__);
+ goto bailout;
+ }
+
+
+ return (dev);
+
+bailout:
+ free(dev);
+
+ return (NULL);
+}
+
+static struct camdd_buf *
+camdd_alloc_buf(struct camdd_dev *dev, camdd_buf_type buf_type)
+{
+ struct camdd_buf *buf = NULL;
+ uint8_t *data_ptr = NULL;
+
+ /*
+ * We only need to allocate data space for data buffers.
+ */
+ switch (buf_type) {
+ case CAMDD_BUF_DATA:
+ data_ptr = malloc(dev->blocksize);
+ if (data_ptr == NULL) {
+ warn("unable to allocate %u bytes", dev->blocksize);
+ goto bailout_error;
+ }
+ break;
+ default:
+ break;
+ }
+
+ buf = malloc(sizeof(*buf));
+ if (buf == NULL) {
+ warn("unable to allocate %zu bytes", sizeof(*buf));
+ goto bailout_error;
+ }
+
+ bzero(buf, sizeof(*buf));
+ buf->buf_type = buf_type;
+ buf->dev = dev;
+ switch (buf_type) {
+ case CAMDD_BUF_DATA: {
+ struct camdd_buf_data *data;
+
+ data = &buf->buf_type_spec.data;
+
+ data->alloc_len = dev->blocksize;
+ data->buf = data_ptr;
+ break;
+ }
+ case CAMDD_BUF_INDIRECT:
+ break;
+ default:
+ break;
+ }
+ STAILQ_INIT(&buf->src_list);
+
+ return (buf);
+
+bailout_error:
+ if (data_ptr != NULL)
+ free(data_ptr);
+
+ if (buf != NULL)
+ free(buf);
+
+ return (NULL);
+}
+
+void
+camdd_release_buf(struct camdd_buf *buf)
+{
+ struct camdd_dev *dev;
+
+ dev = buf->dev;
+
+ switch (buf->buf_type) {
+ case CAMDD_BUF_DATA: {
+ struct camdd_buf_data *data;
+
+ data = &buf->buf_type_spec.data;
+
+ if (data->segs != NULL) {
+ if (data->extra_buf != 0) {
+ void *extra_buf;
+
+ extra_buf = (void *)
+ data->segs[data->sg_count - 1].ds_addr;
+ free(extra_buf);
+ data->extra_buf = 0;
+ }
+ free(data->segs);
+ data->segs = NULL;
+ data->sg_count = 0;
+ } else if (data->iovec != NULL) {
+ if (data->extra_buf != 0) {
+ free(data->iovec[data->sg_count - 1].iov_base);
+ data->extra_buf = 0;
+ }
+ free(data->iovec);
+ data->iovec = NULL;
+ data->sg_count = 0;
+ }
+ STAILQ_INSERT_TAIL(&dev->free_queue, buf, links);
+ break;
+ }
+ case CAMDD_BUF_INDIRECT:
+ STAILQ_INSERT_TAIL(&dev->free_indirect_queue, buf, links);
+ break;
+ default:
+ err(1, "%s: Invalid buffer type %d for released buffer",
+ __func__, buf->buf_type);
+ break;
+ }
+}
+
+struct camdd_buf *
+camdd_get_buf(struct camdd_dev *dev, camdd_buf_type buf_type)
+{
+ struct camdd_buf *buf = NULL;
+
+ switch (buf_type) {
+ case CAMDD_BUF_DATA:
+ buf = STAILQ_FIRST(&dev->free_queue);
+ if (buf != NULL) {
+ struct camdd_buf_data *data;
+ uint8_t *data_ptr;
+ uint32_t alloc_len;
+
+ STAILQ_REMOVE_HEAD(&dev->free_queue, links);
+ data = &buf->buf_type_spec.data;
+ data_ptr = data->buf;
+ alloc_len = data->alloc_len;
+ bzero(buf, sizeof(*buf));
+ data->buf = data_ptr;
+ data->alloc_len = alloc_len;
+ }
+ break;
+ case CAMDD_BUF_INDIRECT:
+ buf = STAILQ_FIRST(&dev->free_indirect_queue);
+ if (buf != NULL) {
+ STAILQ_REMOVE_HEAD(&dev->free_indirect_queue, links);
+
+ bzero(buf, sizeof(*buf));
+ }
+ break;
+ default:
+ warnx("Unknown buffer type %d requested", buf_type);
+ break;
+ }
+
+
+ if (buf == NULL)
+ return (camdd_alloc_buf(dev, buf_type));
+ else {
+ STAILQ_INIT(&buf->src_list);
+ buf->dev = dev;
+ buf->buf_type = buf_type;
+
+ return (buf);
+ }
+}
+
+int
+camdd_buf_sg_create(struct camdd_buf *buf, int iovec, uint32_t sector_size,
+ uint32_t *num_sectors_used, int *double_buf_needed)
+{
+ struct camdd_buf *tmp_buf;
+ struct camdd_buf_data *data;
+ uint8_t *extra_buf = NULL;
+ size_t extra_buf_len = 0;
+ int i, retval = 0;
+
+ data = &buf->buf_type_spec.data;
+
+ data->sg_count = buf->src_count;
+ /*
+ * Compose a scatter/gather list from all of the buffers in the list.
+ * If the length of the buffer isn't a multiple of the sector size,
+ * we'll have to add an extra buffer. This should only happen
+ * at the end of a transfer.
+ */
+ if ((data->fill_len % sector_size) != 0) {
+ extra_buf_len = sector_size - (data->fill_len % sector_size);
+ extra_buf = calloc(extra_buf_len, 1);
+ if (extra_buf == NULL) {
+ warn("%s: unable to allocate %zu bytes for extra "
+ "buffer space", __func__, extra_buf_len);
+ retval = 1;
+ goto bailout;
+ }
+ data->extra_buf = 1;
+ data->sg_count++;
+ }
+ if (iovec == 0) {
+ data->segs = calloc(data->sg_count, sizeof(bus_dma_segment_t));
+ if (data->segs == NULL) {
+ warn("%s: unable to allocate %zu bytes for S/G list",
+ __func__, sizeof(bus_dma_segment_t) *
+ data->sg_count);
+ retval = 1;
+ goto bailout;
+ }
+
+ } else {
+ data->iovec = calloc(data->sg_count, sizeof(struct iovec));
+ if (data->iovec == NULL) {
+ warn("%s: unable to allocate %zu bytes for S/G list",
+ __func__, sizeof(struct iovec) * data->sg_count);
+ retval = 1;
+ goto bailout;
+ }
+ }
+
+ for (i = 0, tmp_buf = STAILQ_FIRST(&buf->src_list);
+ i < buf->src_count && tmp_buf != NULL; i++,
+ tmp_buf = STAILQ_NEXT(tmp_buf, src_links)) {
+
+ if (tmp_buf->buf_type == CAMDD_BUF_DATA) {
+ struct camdd_buf_data *tmp_data;
+
+ tmp_data = &tmp_buf->buf_type_spec.data;
+ if (iovec == 0) {
+ data->segs[i].ds_addr =
+ (bus_addr_t) tmp_data->buf;
+ data->segs[i].ds_len = tmp_data->fill_len -
+ tmp_data->resid;
+ } else {
+ data->iovec[i].iov_base = tmp_data->buf;
+ data->iovec[i].iov_len = tmp_data->fill_len -
+ tmp_data->resid;
+ }
+ if (((tmp_data->fill_len - tmp_data->resid) %
+ sector_size) != 0)
+ *double_buf_needed = 1;
+ } else {
+ struct camdd_buf_indirect *tmp_ind;
+
+ tmp_ind = &tmp_buf->buf_type_spec.indirect;
+ if (iovec == 0) {
+ data->segs[i].ds_addr =
+ (bus_addr_t)tmp_ind->start_ptr;
+ data->segs[i].ds_len = tmp_ind->len;
+ } else {
+ data->iovec[i].iov_base = tmp_ind->start_ptr;
+ data->iovec[i].iov_len = tmp_ind->len;
+ }
+ if ((tmp_ind->len % sector_size) != 0)
+ *double_buf_needed = 1;
+ }
+ }
+
+ if (extra_buf != NULL) {
+ if (iovec == 0) {
+ data->segs[i].ds_addr = (bus_addr_t)extra_buf;
+ data->segs[i].ds_len = extra_buf_len;
+ } else {
+ data->iovec[i].iov_base = extra_buf;
+ data->iovec[i].iov_len = extra_buf_len;
+ }
+ i++;
+ }
+ if ((tmp_buf != NULL) || (i != data->sg_count)) {
+ warnx("buffer source count does not match "
+ "number of buffers in list!");
+ retval = 1;
+ goto bailout;
+ }
+
+bailout:
+ if (retval == 0) {
+ *num_sectors_used = (data->fill_len + extra_buf_len) /
+ sector_size;
+ }
+ return (retval);
+}
+
+uint32_t
+camdd_buf_get_len(struct camdd_buf *buf)
+{
+ uint32_t len = 0;
+
+ if (buf->buf_type != CAMDD_BUF_DATA) {
+ struct camdd_buf_indirect *indirect;
+
+ indirect = &buf->buf_type_spec.indirect;
+ len = indirect->len;
+ } else {
+ struct camdd_buf_data *data;
+
+ data = &buf->buf_type_spec.data;
+ len = data->fill_len;
+ }
+
+ return (len);
+}
+
+void
+camdd_buf_add_child(struct camdd_buf *buf, struct camdd_buf *child_buf)
+{
+ struct camdd_buf_data *data;
+
+ assert(buf->buf_type == CAMDD_BUF_DATA);
+
+ data = &buf->buf_type_spec.data;
+
+ STAILQ_INSERT_TAIL(&buf->src_list, child_buf, src_links);
+ buf->src_count++;
+
+ data->fill_len += camdd_buf_get_len(child_buf);
+}
+
+typedef enum {
+ CAMDD_TS_MAX_BLK,
+ CAMDD_TS_MIN_BLK,
+ CAMDD_TS_BLK_GRAN,
+ CAMDD_TS_EFF_IOSIZE
+} camdd_status_item_index;
+
+static struct camdd_status_items {
+ const char *name;
+ struct mt_status_entry *entry;
+} req_status_items[] = {
+ { "max_blk", NULL },
+ { "min_blk", NULL },
+ { "blk_gran", NULL },
+ { "max_effective_iosize", NULL }
+};
+
+int
+camdd_probe_tape(int fd, char *filename, uint64_t *max_iosize,
+ uint64_t *max_blk, uint64_t *min_blk, uint64_t *blk_gran)
+{
+ struct mt_status_data status_data;
+ char *xml_str = NULL;
+ unsigned int i;
+ int retval = 0;
+
+ retval = mt_get_xml_str(fd, MTIOCEXTGET, &xml_str);
+ if (retval != 0)
+ err(1, "Couldn't get XML string from %s", filename);
+
+ retval = mt_get_status(xml_str, &status_data);
+ if (retval != XML_STATUS_OK) {
+ warn("couldn't get status for %s", filename);
+ retval = 1;
+ goto bailout;
+ } else
+ retval = 0;
+
+ if (status_data.error != 0) {
+ warnx("%s", status_data.error_str);
+ retval = 1;
+ goto bailout;
+ }
+
+ for (i = 0; i < sizeof(req_status_items) /
+ sizeof(req_status_items[0]); i++) {
+ char *name;
+
+ name = __DECONST(char *, req_status_items[i].name);
+ req_status_items[i].entry = mt_status_entry_find(&status_data,
+ name);
+ if (req_status_items[i].entry == NULL) {
+ errx(1, "Cannot find status entry %s",
+ req_status_items[i].name);
+ }
+ }
+
+ *max_iosize = req_status_items[CAMDD_TS_EFF_IOSIZE].entry->value_unsigned;
+ *max_blk= req_status_items[CAMDD_TS_MAX_BLK].entry->value_unsigned;
+ *min_blk= req_status_items[CAMDD_TS_MIN_BLK].entry->value_unsigned;
+ *blk_gran = req_status_items[CAMDD_TS_BLK_GRAN].entry->value_unsigned;
+bailout:
+
+ free(xml_str);
+ mt_status_free(&status_data);
+
+ return (retval);
+}
+
+struct camdd_dev *
+camdd_probe_file(int fd, struct camdd_io_opts *io_opts, int retry_count,
+ int timeout)
+{
+ struct camdd_dev *dev = NULL;
+ struct camdd_dev_file *file_dev;
+ uint64_t blocksize = io_opts->blocksize;
+
+ dev = camdd_alloc_dev(CAMDD_DEV_FILE, NULL, 0, retry_count, timeout);
+ if (dev == NULL)
+ goto bailout;
+
+ file_dev = &dev->dev_spec.file;
+ file_dev->fd = fd;
+ strlcpy(file_dev->filename, io_opts->dev_name,
+ sizeof(file_dev->filename));
+ strlcpy(dev->device_name, io_opts->dev_name, sizeof(dev->device_name));
+ if (blocksize == 0)
+ dev->blocksize = CAMDD_FILE_DEFAULT_BLOCK;
+ else
+ dev->blocksize = blocksize;
+
+ if ((io_opts->queue_depth != 0)
+ && (io_opts->queue_depth != 1)) {
+ warnx("Queue depth %ju for %s ignored, only 1 outstanding "
+ "command supported", (uintmax_t)io_opts->queue_depth,
+ io_opts->dev_name);
+ }
+ dev->target_queue_depth = CAMDD_FILE_DEFAULT_DEPTH;
+ dev->run = camdd_file_run;
+ dev->fetch = NULL;
+
+ /*
+ * We can effectively access files on byte boundaries. We'll reset
+ * this for devices like disks that can be accessed on sector
+ * boundaries.
+ */
+ dev->sector_size = 1;
+
+ if ((fd != STDIN_FILENO)
+ && (fd != STDOUT_FILENO)) {
+ int retval;
+
+ retval = fstat(fd, &file_dev->sb);
+ if (retval != 0) {
+ warn("Cannot stat %s", dev->device_name);
+ goto bailout;
+ camdd_free_dev(dev);
+ dev = NULL;
+ }
+ if (S_ISREG(file_dev->sb.st_mode)) {
+ file_dev->file_type = CAMDD_FILE_REG;
+ } else if (S_ISCHR(file_dev->sb.st_mode)) {
+ int type;
+
+ if (ioctl(fd, FIODTYPE, &type) == -1)
+ err(1, "FIODTYPE ioctl failed on %s",
+ dev->device_name);
+ else {
+ if (type & D_TAPE)
+ file_dev->file_type = CAMDD_FILE_TAPE;
+ else if (type & D_DISK)
+ file_dev->file_type = CAMDD_FILE_DISK;
+ else if (type & D_MEM)
+ file_dev->file_type = CAMDD_FILE_MEM;
+ else if (type & D_TTY)
+ file_dev->file_type = CAMDD_FILE_TTY;
+ }
+ } else if (S_ISDIR(file_dev->sb.st_mode)) {
+ errx(1, "cannot operate on directory %s",
+ dev->device_name);
+ } else if (S_ISFIFO(file_dev->sb.st_mode)) {
+ file_dev->file_type = CAMDD_FILE_PIPE;
+ } else
+ errx(1, "Cannot determine file type for %s",
+ dev->device_name);
+
+ switch (file_dev->file_type) {
+ case CAMDD_FILE_REG:
+ if (file_dev->sb.st_size != 0)
+ dev->max_sector = file_dev->sb.st_size - 1;
+ else
+ dev->max_sector = 0;
+ file_dev->file_flags |= CAMDD_FF_CAN_SEEK;
+ break;
+ case CAMDD_FILE_TAPE: {
+ uint64_t max_iosize, max_blk, min_blk, blk_gran;
+ /*
+ * Check block limits and maximum effective iosize.
+ * Make sure the blocksize is within the block
+ * limits (and a multiple of the minimum blocksize)
+ * and that the blocksize is <= maximum effective
+ * iosize.
+ */
+ retval = camdd_probe_tape(fd, dev->device_name,
+ &max_iosize, &max_blk, &min_blk, &blk_gran);
+ if (retval != 0)
+ errx(1, "Unable to probe tape %s",
+ dev->device_name);
+
+ /*
+ * The blocksize needs to be <= the maximum
+ * effective I/O size of the tape device. Note
+ * that this also takes into account the maximum
+ * blocksize reported by READ BLOCK LIMITS.
+ */
+ if (dev->blocksize > max_iosize) {
+ warnx("Blocksize %u too big for %s, limiting "
+ "to %ju", dev->blocksize, dev->device_name,
+ max_iosize);
+ dev->blocksize = max_iosize;
+ }
+
+ /*
+ * The blocksize needs to be at least min_blk;
+ */
+ if (dev->blocksize < min_blk) {
+ warnx("Blocksize %u too small for %s, "
+ "increasing to %ju", dev->blocksize,
+ dev->device_name, min_blk);
+ dev->blocksize = min_blk;
+ }
+
+ /*
+ * And the blocksize needs to be a multiple of
+ * the block granularity.
+ */
+ if ((blk_gran != 0)
+ && (dev->blocksize % (1 << blk_gran))) {
+ warnx("Blocksize %u for %s not a multiple of "
+ "%d, adjusting to %d", dev->blocksize,
+ dev->device_name, (1 << blk_gran),
+ dev->blocksize & ~((1 << blk_gran) - 1));
+ dev->blocksize &= ~((1 << blk_gran) - 1);
+ }
+
+ if (dev->blocksize == 0) {
+ errx(1, "Unable to derive valid blocksize for "
+ "%s", dev->device_name);
+ }
+
+ /*
+ * For tape drives, set the sector size to the
+ * blocksize so that we make sure not to write
+ * less than the blocksize out to the drive.
+ */
+ dev->sector_size = dev->blocksize;
+ break;
+ }
+ case CAMDD_FILE_DISK: {
+ off_t media_size;
+ unsigned int sector_size;
+
+ file_dev->file_flags |= CAMDD_FF_CAN_SEEK;
+
+ if (ioctl(fd, DIOCGSECTORSIZE, &sector_size) == -1) {
+ err(1, "DIOCGSECTORSIZE ioctl failed on %s",
+ dev->device_name);
+ }
+
+ if (sector_size == 0) {
+ errx(1, "DIOCGSECTORSIZE ioctl returned "
+ "invalid sector size %u for %s",
+ sector_size, dev->device_name);
+ }
+
+ if (ioctl(fd, DIOCGMEDIASIZE, &media_size) == -1) {
+ err(1, "DIOCGMEDIASIZE ioctl failed on %s",
+ dev->device_name);
+ }
+
+ if (media_size == 0) {
+ errx(1, "DIOCGMEDIASIZE ioctl returned "
+ "invalid media size %ju for %s",
+ (uintmax_t)media_size, dev->device_name);
+ }
+
+ if (dev->blocksize % sector_size) {
+ errx(1, "%s blocksize %u not a multiple of "
+ "sector size %u", dev->device_name,
+ dev->blocksize, sector_size);
+ }
+
+ dev->sector_size = sector_size;
+ dev->max_sector = (media_size / sector_size) - 1;
+ break;
+ }
+ case CAMDD_FILE_MEM:
+ file_dev->file_flags |= CAMDD_FF_CAN_SEEK;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ((io_opts->offset != 0)
+ && ((file_dev->file_flags & CAMDD_FF_CAN_SEEK) == 0)) {
+ warnx("Offset %ju specified for %s, but we cannot seek on %s",
+ io_opts->offset, io_opts->dev_name, io_opts->dev_name);
+ goto bailout_error;
+ }
+#if 0
+ else if ((io_opts->offset != 0)
+ && ((io_opts->offset % dev->sector_size) != 0)) {
+ warnx("Offset %ju for %s is not a multiple of the "
+ "sector size %u", io_opts->offset,
+ io_opts->dev_name, dev->sector_size);
+ goto bailout_error;
+ } else {
+ dev->start_offset_bytes = io_opts->offset;
+ }
+#endif
+
+bailout:
+ return (dev);
+
+bailout_error:
+ camdd_free_dev(dev);
+ return (NULL);
+}
+
+/*
+ * Need to implement this. Do a basic probe:
+ * - Check the inquiry data, make sure we're talking to a device that we
+ * can reasonably expect to talk to -- direct, RBC, CD, WORM.
+ * - Send a test unit ready, make sure the device is available.
+ * - Get the capacity and block size.
+ */
+struct camdd_dev *
+camdd_probe_pass(struct cam_device *cam_dev, struct camdd_io_opts *io_opts,
+ camdd_argmask arglist, int probe_retry_count,
+ int probe_timeout, int io_retry_count, int io_timeout)
+{
+ union ccb *ccb;
+ uint64_t maxsector;
+ uint32_t cpi_maxio, max_iosize, pass_numblocks;
+ uint32_t block_len;
+ struct scsi_read_capacity_data rcap;
+ struct scsi_read_capacity_data_long rcaplong;
+ struct camdd_dev *dev;
+ struct camdd_dev_pass *pass_dev;
+ struct kevent ke;
+ int scsi_dev_type;
+ int retval;
+
+ dev = NULL;
+
+ scsi_dev_type = SID_TYPE(&cam_dev->inq_data);
+ maxsector = 0;
+ block_len = 0;
+
+ /*
+ * For devices that support READ CAPACITY, we'll attempt to get the
+ * capacity. Otherwise, we really don't support tape or other
+ * devices via SCSI passthrough, so just return an error in that case.
+ */
+ switch (scsi_dev_type) {
+ case T_DIRECT:
+ case T_WORM:
+ case T_CDROM:
+ case T_OPTICAL:
+ case T_RBC:
+ break;
+ default:
+ errx(1, "Unsupported SCSI device type %d", scsi_dev_type);
+ break; /*NOTREACHED*/
+ }
+
+ ccb = cam_getccb(cam_dev);
+
+ if (ccb == NULL) {
+ warnx("%s: error allocating ccb", __func__);
+ goto bailout;
+ }
+
+ bzero(&(&ccb->ccb_h)[1],
+ sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr));
+
+ scsi_read_capacity(&ccb->csio,
+ /*retries*/ probe_retry_count,
+ /*cbfcnp*/ NULL,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ &rcap,
+ SSD_FULL_SIZE,
+ /*timeout*/ probe_timeout ? probe_timeout : 5000);
+
+ /* Disable freezing the device queue */
+ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS;
+
+ if (arglist & CAMDD_ARG_ERR_RECOVER)
+ ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
+
+ if (cam_send_ccb(cam_dev, ccb) < 0) {
+ warn("error sending READ CAPACITY command");
+
+ cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+
+ goto bailout;
+ }
+
+ if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
+ retval = 1;
+ goto bailout;
+ }
+
+ maxsector = scsi_4btoul(rcap.addr);
+ block_len = scsi_4btoul(rcap.length);
+
+ /*
+ * A last block of 2^32-1 means that the true capacity is over 2TB,
+ * and we need to issue the long READ CAPACITY to get the real
+ * capacity. Otherwise, we're all set.
+ */
+ if (maxsector != 0xffffffff)
+ goto rcap_done;
+
+ scsi_read_capacity_16(&ccb->csio,
+ /*retries*/ probe_retry_count,
+ /*cbfcnp*/ NULL,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*lba*/ 0,
+ /*reladdr*/ 0,
+ /*pmi*/ 0,
+ (uint8_t *)&rcaplong,
+ sizeof(rcaplong),
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ probe_timeout ? probe_timeout : 5000);
+
+ /* Disable freezing the device queue */
+ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS;
+
+ if (arglist & CAMDD_ARG_ERR_RECOVER)
+ ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
+
+ if (cam_send_ccb(cam_dev, ccb) < 0) {
+ warn("error sending READ CAPACITY (16) command");
+
+ cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+
+ retval = 1;
+ goto bailout;
+ }
+
+ if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+ cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
+ goto bailout;
+ }
+
+ maxsector = scsi_8btou64(rcaplong.addr);
+ block_len = scsi_4btoul(rcaplong.length);
+
+rcap_done:
+
+ bzero(&(&ccb->ccb_h)[1],
+ sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr));
+
+ ccb->ccb_h.func_code = XPT_PATH_INQ;
+ ccb->ccb_h.flags = CAM_DIR_NONE;
+ ccb->ccb_h.retry_count = 1;
+
+ if (cam_send_ccb(cam_dev, ccb) < 0) {
+ warn("error sending XPT_PATH_INQ CCB");
+
+ cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+ goto bailout;
+ }
+
+ EV_SET(&ke, cam_dev->fd, EVFILT_READ, EV_ADD|EV_ENABLE, 0, 0, 0);
+
+ dev = camdd_alloc_dev(CAMDD_DEV_PASS, &ke, 1, io_retry_count,
+ io_timeout);
+ if (dev == NULL)
+ goto bailout;
+
+ pass_dev = &dev->dev_spec.pass;
+ pass_dev->scsi_dev_type = scsi_dev_type;
+ pass_dev->dev = cam_dev;
+ pass_dev->max_sector = maxsector;
+ pass_dev->block_len = block_len;
+ pass_dev->cpi_maxio = ccb->cpi.maxio;
+ snprintf(dev->device_name, sizeof(dev->device_name), "%s%u",
+ pass_dev->dev->device_name, pass_dev->dev->dev_unit_num);
+ dev->sector_size = block_len;
+ dev->max_sector = maxsector;
+
+
+ /*
+ * Determine the optimal blocksize to use for this device.
+ */
+
+ /*
+ * If the controller has not specified a maximum I/O size,
+ * just go with 128K as a somewhat conservative value.
+ */
+ if (pass_dev->cpi_maxio == 0)
+ cpi_maxio = 131072;
+ else
+ cpi_maxio = pass_dev->cpi_maxio;
+
+ /*
+ * If the controller has a large maximum I/O size, limit it
+ * to something smaller so that the kernel doesn't have trouble
+ * allocating buffers to copy data in and out for us.
+ * XXX KDM this is until we have unmapped I/O support in the kernel.
+ */
+ max_iosize = min(cpi_maxio, CAMDD_PASS_MAX_BLOCK);
+
+ /*
+ * If we weren't able to get a block size for some reason,
+ * default to 512 bytes.
+ */
+ block_len = pass_dev->block_len;
+ if (block_len == 0)
+ block_len = 512;
+
+ /*
+ * Figure out how many blocksize chunks will fit in the
+ * maximum I/O size.
+ */
+ pass_numblocks = max_iosize / block_len;
+
+ /*
+ * And finally, multiple the number of blocks by the LBA
+ * length to get our maximum block size;
+ */
+ dev->blocksize = pass_numblocks * block_len;
+
+ if (io_opts->blocksize != 0) {
+ if ((io_opts->blocksize % dev->sector_size) != 0) {
+ warnx("Blocksize %ju for %s is not a multiple of "
+ "sector size %u", (uintmax_t)io_opts->blocksize,
+ dev->device_name, dev->sector_size);
+ goto bailout_error;
+ }
+ dev->blocksize = io_opts->blocksize;
+ }
+ dev->target_queue_depth = CAMDD_PASS_DEFAULT_DEPTH;
+ if (io_opts->queue_depth != 0)
+ dev->target_queue_depth = io_opts->queue_depth;
+
+ if (io_opts->offset != 0) {
+ if (io_opts->offset > (dev->max_sector * dev->sector_size)) {
+ warnx("Offset %ju is past the end of device %s",
+ io_opts->offset, dev->device_name);
+ goto bailout_error;
+ }
+#if 0
+ else if ((io_opts->offset % dev->sector_size) != 0) {
+ warnx("Offset %ju for %s is not a multiple of the "
+ "sector size %u", io_opts->offset,
+ dev->device_name, dev->sector_size);
+ goto bailout_error;
+ }
+ dev->start_offset_bytes = io_opts->offset;
+#endif
+ }
+
+ dev->min_cmd_size = io_opts->min_cmd_size;
+
+ dev->run = camdd_pass_run;
+ dev->fetch = camdd_pass_fetch;
+
+bailout:
+ cam_freeccb(ccb);
+
+ return (dev);
+
+bailout_error:
+ cam_freeccb(ccb);
+
+ camdd_free_dev(dev);
+
+ return (NULL);
+}
+
+void *
+camdd_worker(void *arg)
+{
+ struct camdd_dev *dev = arg;
+ struct camdd_buf *buf;
+ struct timespec ts, *kq_ts;
+
+ ts.tv_sec = 0;
+ ts.tv_nsec = 0;
+
+ pthread_mutex_lock(&dev->mutex);
+
+ dev->flags |= CAMDD_DEV_FLAG_ACTIVE;
+
+ for (;;) {
+ struct kevent ke;
+ int retval = 0;
+
+ /*
+ * XXX KDM check the reorder queue depth?
+ */
+ if (dev->write_dev == 0) {
+ uint32_t our_depth, peer_depth, peer_bytes, our_bytes;
+ uint32_t target_depth = dev->target_queue_depth;
+ uint32_t peer_target_depth =
+ dev->peer_dev->target_queue_depth;
+ uint32_t peer_blocksize = dev->peer_dev->blocksize;
+
+ camdd_get_depth(dev, &our_depth, &peer_depth,
+ &our_bytes, &peer_bytes);
+
+#if 0
+ while (((our_depth < target_depth)
+ && (peer_depth < peer_target_depth))
+ || ((peer_bytes + our_bytes) <
+ (peer_blocksize * 2))) {
+#endif
+ while (((our_depth + peer_depth) <
+ (target_depth + peer_target_depth))
+ || ((peer_bytes + our_bytes) <
+ (peer_blocksize * 3))) {
+
+ retval = camdd_queue(dev, NULL);
+ if (retval == 1)
+ break;
+ else if (retval != 0) {
+ error_exit = 1;
+ goto bailout;
+ }
+
+ camdd_get_depth(dev, &our_depth, &peer_depth,
+ &our_bytes, &peer_bytes);
+ }
+ }
+ /*
+ * See if we have any I/O that is ready to execute.
+ */
+ buf = STAILQ_FIRST(&dev->run_queue);
+ if (buf != NULL) {
+ while (dev->target_queue_depth > dev->cur_active_io) {
+ retval = dev->run(dev);
+ if (retval == -1) {
+ dev->flags |= CAMDD_DEV_FLAG_EOF;
+ error_exit = 1;
+ break;
+ } else if (retval != 0) {
+ break;
+ }
+ }
+ }
+
+ /*
+ * We've reached EOF, or our partner has reached EOF.
+ */
+ if ((dev->flags & CAMDD_DEV_FLAG_EOF)
+ || (dev->flags & CAMDD_DEV_FLAG_PEER_EOF)) {
+ if (dev->write_dev != 0) {
+ if ((STAILQ_EMPTY(&dev->work_queue))
+ && (dev->num_run_queue == 0)
+ && (dev->cur_active_io == 0)) {
+ goto bailout;
+ }
+ } else {
+ /*
+ * If we're the reader, and the writer
+ * got EOF, he is already done. If we got
+ * the EOF, then we need to wait until
+ * everything is flushed out for the writer.
+ */
+ if (dev->flags & CAMDD_DEV_FLAG_PEER_EOF) {
+ goto bailout;
+ } else if ((dev->num_peer_work_queue == 0)
+ && (dev->num_peer_done_queue == 0)
+ && (dev->cur_active_io == 0)
+ && (dev->num_run_queue == 0)) {
+ goto bailout;
+ }
+ }
+ /*
+ * XXX KDM need to do something about the pending
+ * queue and cleanup resources.
+ */
+ }
+
+ if ((dev->write_dev == 0)
+ && (dev->cur_active_io == 0)
+ && (dev->peer_bytes_queued < dev->peer_dev->blocksize))
+ kq_ts = &ts;
+ else
+ kq_ts = NULL;
+
+ /*
+ * Run kevent to see if there are events to process.
+ */
+ pthread_mutex_unlock(&dev->mutex);
+ retval = kevent(dev->kq, NULL, 0, &ke, 1, kq_ts);
+ pthread_mutex_lock(&dev->mutex);
+ if (retval == -1) {
+ warn("%s: error returned from kevent",__func__);
+ goto bailout;
+ } else if (retval != 0) {
+ switch (ke.filter) {
+ case EVFILT_READ:
+ if (dev->fetch != NULL) {
+ retval = dev->fetch(dev);
+ if (retval == -1) {
+ error_exit = 1;
+ goto bailout;
+ }
+ }
+ break;
+ case EVFILT_SIGNAL:
+ /*
+ * We register for this so we don't get
+ * an error as a result of a SIGINFO or a
+ * SIGINT. It will actually get handled
+ * by the signal handler. If we get a
+ * SIGINT, bail out without printing an
+ * error message. Any other signals
+ * will result in the error message above.
+ */
+ if (ke.ident == SIGINT)
+ goto bailout;
+ break;
+ case EVFILT_USER:
+ retval = 0;
+ /*
+ * Check to see if the other thread has
+ * queued any I/O for us to do. (In this
+ * case we're the writer.)
+ */
+ for (buf = STAILQ_FIRST(&dev->work_queue);
+ buf != NULL;
+ buf = STAILQ_FIRST(&dev->work_queue)) {
+ STAILQ_REMOVE_HEAD(&dev->work_queue,
+ work_links);
+ retval = camdd_queue(dev, buf);
+ /*
+ * We keep going unless we get an
+ * actual error. If we get EOF, we
+ * still want to remove the buffers
+ * from the queue and send the back
+ * to the reader thread.
+ */
+ if (retval == -1) {
+ error_exit = 1;
+ goto bailout;
+ } else
+ retval = 0;
+ }
+
+ /*
+ * Next check to see if the other thread has
+ * queued any completed buffers back to us.
+ * (In this case we're the reader.)
+ */
+ for (buf = STAILQ_FIRST(&dev->peer_done_queue);
+ buf != NULL;
+ buf = STAILQ_FIRST(&dev->peer_done_queue)){
+ STAILQ_REMOVE_HEAD(
+ &dev->peer_done_queue, work_links);
+ dev->num_peer_done_queue--;
+ camdd_peer_done(buf);
+ }
+ break;
+ default:
+ warnx("%s: unknown kevent filter %d",
+ __func__, ke.filter);
+ break;
+ }
+ }
+ }
+
+bailout:
+
+ dev->flags &= ~CAMDD_DEV_FLAG_ACTIVE;
+
+ /* XXX KDM cleanup resources here? */
+
+ pthread_mutex_unlock(&dev->mutex);
+
+ need_exit = 1;
+ sem_post(&camdd_sem);
+
+ return (NULL);
+}
+
+/*
+ * Simplistic translation of CCB status to our local status.
+ */
+camdd_buf_status
+camdd_ccb_status(union ccb *ccb)
+{
+ camdd_buf_status status = CAMDD_STATUS_NONE;
+ cam_status ccb_status;
+
+ ccb_status = ccb->ccb_h.status & CAM_STATUS_MASK;
+
+ switch (ccb_status) {
+ case CAM_REQ_CMP: {
+ if (ccb->csio.resid == 0) {
+ status = CAMDD_STATUS_OK;
+ } else if (ccb->csio.dxfer_len > ccb->csio.resid) {
+ status = CAMDD_STATUS_SHORT_IO;
+ } else {
+ status = CAMDD_STATUS_EOF;
+ }
+ break;
+ }
+ case CAM_SCSI_STATUS_ERROR: {
+ switch (ccb->csio.scsi_status) {
+ case SCSI_STATUS_OK:
+ case SCSI_STATUS_COND_MET:
+ case SCSI_STATUS_INTERMED:
+ case SCSI_STATUS_INTERMED_COND_MET:
+ status = CAMDD_STATUS_OK;
+ break;
+ case SCSI_STATUS_CMD_TERMINATED:
+ case SCSI_STATUS_CHECK_COND:
+ case SCSI_STATUS_QUEUE_FULL:
+ case SCSI_STATUS_BUSY:
+ case SCSI_STATUS_RESERV_CONFLICT:
+ default:
+ status = CAMDD_STATUS_ERROR;
+ break;
+ }
+ break;
+ }
+ default:
+ status = CAMDD_STATUS_ERROR;
+ break;
+ }
+
+ return (status);
+}
+
+/*
+ * Queue a buffer to our peer's work thread for writing.
+ *
+ * Returns 0 for success, -1 for failure, 1 if the other thread exited.
+ */
+int
+camdd_queue_peer_buf(struct camdd_dev *dev, struct camdd_buf *buf)
+{
+ struct kevent ke;
+ STAILQ_HEAD(, camdd_buf) local_queue;
+ struct camdd_buf *buf1, *buf2;
+ struct camdd_buf_data *data = NULL;
+ uint64_t peer_bytes_queued = 0;
+ int active = 1;
+ int retval = 0;
+
+ STAILQ_INIT(&local_queue);
+
+ /*
+ * Since we're the reader, we need to queue our I/O to the writer
+ * in sequential order in order to make sure it gets written out
+ * in sequential order.
+ *
+ * Check the next expected I/O starting offset. If this doesn't
+ * match, put it on the reorder queue.
+ */
+ if ((buf->lba * dev->sector_size) != dev->next_completion_pos_bytes) {
+
+ /*
+ * If there is nothing on the queue, there is no sorting
+ * needed.
+ */
+ if (STAILQ_EMPTY(&dev->reorder_queue)) {
+ STAILQ_INSERT_TAIL(&dev->reorder_queue, buf, links);
+ dev->num_reorder_queue++;
+ goto bailout;
+ }
+
+ /*
+ * Sort in ascending order by starting LBA. There should
+ * be no identical LBAs.
+ */
+ for (buf1 = STAILQ_FIRST(&dev->reorder_queue); buf1 != NULL;
+ buf1 = buf2) {
+ buf2 = STAILQ_NEXT(buf1, links);
+ if (buf->lba < buf1->lba) {
+ /*
+ * If we're less than the first one, then
+ * we insert at the head of the list
+ * because this has to be the first element
+ * on the list.
+ */
+ STAILQ_INSERT_HEAD(&dev->reorder_queue,
+ buf, links);
+ dev->num_reorder_queue++;
+ break;
+ } else if (buf->lba > buf1->lba) {
+ if (buf2 == NULL) {
+ STAILQ_INSERT_TAIL(&dev->reorder_queue,
+ buf, links);
+ dev->num_reorder_queue++;
+ break;
+ } else if (buf->lba < buf2->lba) {
+ STAILQ_INSERT_AFTER(&dev->reorder_queue,
+ buf1, buf, links);
+ dev->num_reorder_queue++;
+ break;
+ }
+ } else {
+ errx(1, "Found buffers with duplicate LBA %ju!",
+ buf->lba);
+ }
+ }
+ goto bailout;
+ } else {
+
+ /*
+ * We're the next expected I/O completion, so put ourselves
+ * on the local queue to be sent to the writer. We use
+ * work_links here so that we can queue this to the
+ * peer_work_queue before taking the buffer off of the
+ * local_queue.
+ */
+ dev->next_completion_pos_bytes += buf->len;
+ STAILQ_INSERT_TAIL(&local_queue, buf, work_links);
+
+ /*
+ * Go through the reorder queue looking for more sequential
+ * I/O and add it to the local queue.
+ */
+ for (buf1 = STAILQ_FIRST(&dev->reorder_queue); buf1 != NULL;
+ buf1 = STAILQ_FIRST(&dev->reorder_queue)) {
+ /*
+ * As soon as we see an I/O that is out of sequence,
+ * we're done.
+ */
+ if ((buf1->lba * dev->sector_size) !=
+ dev->next_completion_pos_bytes)
+ break;
+
+ STAILQ_REMOVE_HEAD(&dev->reorder_queue, links);
+ dev->num_reorder_queue--;
+ STAILQ_INSERT_TAIL(&local_queue, buf1, work_links);
+ dev->next_completion_pos_bytes += buf1->len;
+ }
+ }
+
+ /*
+ * Setup the event to let the other thread know that it has work
+ * pending.
+ */
+ EV_SET(&ke, (uintptr_t)&dev->peer_dev->work_queue, EVFILT_USER, 0,
+ NOTE_TRIGGER, 0, NULL);
+
+ /*
+ * Put this on our shadow queue so that we know what we've queued
+ * to the other thread.
+ */
+ STAILQ_FOREACH_SAFE(buf1, &local_queue, work_links, buf2) {
+ if (buf1->buf_type != CAMDD_BUF_DATA) {
+ errx(1, "%s: should have a data buffer, not an "
+ "indirect buffer", __func__);
+ }
+ data = &buf1->buf_type_spec.data;
+
+ /*
+ * We only need to send one EOF to the writer, and don't
+ * need to continue sending EOFs after that.
+ */
+ if (buf1->status == CAMDD_STATUS_EOF) {
+ if (dev->flags & CAMDD_DEV_FLAG_EOF_SENT) {
+ STAILQ_REMOVE(&local_queue, buf1, camdd_buf,
+ work_links);
+ camdd_release_buf(buf1);
+ retval = 1;
+ continue;
+ }
+ dev->flags |= CAMDD_DEV_FLAG_EOF_SENT;
+ }
+
+
+ STAILQ_INSERT_TAIL(&dev->peer_work_queue, buf1, links);
+ peer_bytes_queued += (data->fill_len - data->resid);
+ dev->peer_bytes_queued += (data->fill_len - data->resid);
+ dev->num_peer_work_queue++;
+ }
+
+ if (STAILQ_FIRST(&local_queue) == NULL)
+ goto bailout;
+
+ /*
+ * Drop our mutex and pick up the other thread's mutex. We need to
+ * do this to avoid deadlocks.
+ */
+ pthread_mutex_unlock(&dev->mutex);
+ pthread_mutex_lock(&dev->peer_dev->mutex);
+
+ if (dev->peer_dev->flags & CAMDD_DEV_FLAG_ACTIVE) {
+ /*
+ * Put the buffers on the other thread's incoming work queue.
+ */
+ for (buf1 = STAILQ_FIRST(&local_queue); buf1 != NULL;
+ buf1 = STAILQ_FIRST(&local_queue)) {
+ STAILQ_REMOVE_HEAD(&local_queue, work_links);
+ STAILQ_INSERT_TAIL(&dev->peer_dev->work_queue, buf1,
+ work_links);
+ }
+ /*
+ * Send an event to the other thread's kqueue to let it know
+ * that there is something on the work queue.
+ */
+ retval = kevent(dev->peer_dev->kq, &ke, 1, NULL, 0, NULL);
+ if (retval == -1)
+ warn("%s: unable to add peer work_queue kevent",
+ __func__);
+ else
+ retval = 0;
+ } else
+ active = 0;
+
+ pthread_mutex_unlock(&dev->peer_dev->mutex);
+ pthread_mutex_lock(&dev->mutex);
+
+ /*
+ * If the other side isn't active, run through the queue and
+ * release all of the buffers.
+ */
+ if (active == 0) {
+ for (buf1 = STAILQ_FIRST(&local_queue); buf1 != NULL;
+ buf1 = STAILQ_FIRST(&local_queue)) {
+ STAILQ_REMOVE_HEAD(&local_queue, work_links);
+ STAILQ_REMOVE(&dev->peer_work_queue, buf1, camdd_buf,
+ links);
+ dev->num_peer_work_queue--;
+ camdd_release_buf(buf1);
+ }
+ dev->peer_bytes_queued -= peer_bytes_queued;
+ retval = 1;
+ }
+
+bailout:
+ return (retval);
+}
+
+/*
+ * Return a buffer to the reader thread when we have completed writing it.
+ */
+int
+camdd_complete_peer_buf(struct camdd_dev *dev, struct camdd_buf *peer_buf)
+{
+ struct kevent ke;
+ int retval = 0;
+
+ /*
+ * Setup the event to let the other thread know that we have
+ * completed a buffer.
+ */
+ EV_SET(&ke, (uintptr_t)&dev->peer_dev->peer_done_queue, EVFILT_USER, 0,
+ NOTE_TRIGGER, 0, NULL);
+
+ /*
+ * Drop our lock and acquire the other thread's lock before
+ * manipulating
+ */
+ pthread_mutex_unlock(&dev->mutex);
+ pthread_mutex_lock(&dev->peer_dev->mutex);
+
+ /*
+ * Put the buffer on the reader thread's peer done queue now that
+ * we have completed it.
+ */
+ STAILQ_INSERT_TAIL(&dev->peer_dev->peer_done_queue, peer_buf,
+ work_links);
+ dev->peer_dev->num_peer_done_queue++;
+
+ /*
+ * Send an event to the peer thread to let it know that we've added
+ * something to its peer done queue.
+ */
+ retval = kevent(dev->peer_dev->kq, &ke, 1, NULL, 0, NULL);
+ if (retval == -1)
+ warn("%s: unable to add peer_done_queue kevent", __func__);
+ else
+ retval = 0;
+
+ /*
+ * Drop the other thread's lock and reacquire ours.
+ */
+ pthread_mutex_unlock(&dev->peer_dev->mutex);
+ pthread_mutex_lock(&dev->mutex);
+
+ return (retval);
+}
+
+/*
+ * Free a buffer that was written out by the writer thread and returned to
+ * the reader thread.
+ */
+void
+camdd_peer_done(struct camdd_buf *buf)
+{
+ struct camdd_dev *dev;
+ struct camdd_buf_data *data;
+
+ dev = buf->dev;
+ if (buf->buf_type != CAMDD_BUF_DATA) {
+ errx(1, "%s: should have a data buffer, not an "
+ "indirect buffer", __func__);
+ }
+
+ data = &buf->buf_type_spec.data;
+
+ STAILQ_REMOVE(&dev->peer_work_queue, buf, camdd_buf, links);
+ dev->num_peer_work_queue--;
+ dev->peer_bytes_queued -= (data->fill_len - data->resid);
+
+ if (buf->status == CAMDD_STATUS_EOF)
+ dev->flags |= CAMDD_DEV_FLAG_PEER_EOF;
+
+ STAILQ_INSERT_TAIL(&dev->free_queue, buf, links);
+}
+
+/*
+ * Assumes caller holds the lock for this device.
+ */
+void
+camdd_complete_buf(struct camdd_dev *dev, struct camdd_buf *buf,
+ int *error_count)
+{
+ int retval = 0;
+
+ /*
+ * If we're the reader, we need to send the completed I/O
+ * to the writer. If we're the writer, we need to just
+ * free up resources, or let the reader know if we've
+ * encountered an error.
+ */
+ if (dev->write_dev == 0) {
+ retval = camdd_queue_peer_buf(dev, buf);
+ if (retval != 0)
+ (*error_count)++;
+ } else {
+ struct camdd_buf *tmp_buf, *next_buf;
+
+ STAILQ_FOREACH_SAFE(tmp_buf, &buf->src_list, src_links,
+ next_buf) {
+ struct camdd_buf *src_buf;
+ struct camdd_buf_indirect *indirect;
+
+ STAILQ_REMOVE(&buf->src_list, tmp_buf,
+ camdd_buf, src_links);
+
+ tmp_buf->status = buf->status;
+
+ if (tmp_buf->buf_type == CAMDD_BUF_DATA) {
+ camdd_complete_peer_buf(dev, tmp_buf);
+ continue;
+ }
+
+ indirect = &tmp_buf->buf_type_spec.indirect;
+ src_buf = indirect->src_buf;
+ src_buf->refcount--;
+ /*
+ * XXX KDM we probably need to account for
+ * exactly how many bytes we were able to
+ * write. Allocate the residual to the
+ * first N buffers? Or just track the
+ * number of bytes written? Right now the reader
+ * doesn't do anything with a residual.
+ */
+ src_buf->status = buf->status;
+ if (src_buf->refcount <= 0)
+ camdd_complete_peer_buf(dev, src_buf);
+ STAILQ_INSERT_TAIL(&dev->free_indirect_queue,
+ tmp_buf, links);
+ }
+
+ STAILQ_INSERT_TAIL(&dev->free_queue, buf, links);
+ }
+}
+
+/*
+ * Fetch all completed commands from the pass(4) device.
+ *
+ * Returns the number of commands received, or -1 if any of the commands
+ * completed with an error. Returns 0 if no commands are available.
+ */
+int
+camdd_pass_fetch(struct camdd_dev *dev)
+{
+ struct camdd_dev_pass *pass_dev = &dev->dev_spec.pass;
+ union ccb ccb;
+ int retval = 0, num_fetched = 0, error_count = 0;
+
+ pthread_mutex_unlock(&dev->mutex);
+ /*
+ * XXX KDM we don't distinguish between EFAULT and ENOENT.
+ */
+ while ((retval = ioctl(pass_dev->dev->fd, CAMIOGET, &ccb)) != -1) {
+ struct camdd_buf *buf;
+ struct camdd_buf_data *data;
+ cam_status ccb_status;
+ union ccb *buf_ccb;
+
+ buf = ccb.ccb_h.ccb_buf;
+ data = &buf->buf_type_spec.data;
+ buf_ccb = &data->ccb;
+
+ num_fetched++;
+
+ /*
+ * Copy the CCB back out so we get status, sense data, etc.
+ */
+ bcopy(&ccb, buf_ccb, sizeof(ccb));
+
+ pthread_mutex_lock(&dev->mutex);
+
+ /*
+ * We're now done, so take this off the active queue.
+ */
+ STAILQ_REMOVE(&dev->active_queue, buf, camdd_buf, links);
+ dev->cur_active_io--;
+
+ ccb_status = ccb.ccb_h.status & CAM_STATUS_MASK;
+ if (ccb_status != CAM_REQ_CMP) {
+ cam_error_print(pass_dev->dev, &ccb, CAM_ESF_ALL,
+ CAM_EPF_ALL, stderr);
+ }
+
+ data->resid = ccb.csio.resid;
+ dev->bytes_transferred += (ccb.csio.dxfer_len - ccb.csio.resid);
+
+ if (buf->status == CAMDD_STATUS_NONE)
+ buf->status = camdd_ccb_status(&ccb);
+ if (buf->status == CAMDD_STATUS_ERROR)
+ error_count++;
+ else if (buf->status == CAMDD_STATUS_EOF) {
+ /*
+ * Once we queue this buffer to our partner thread,
+ * he will know that we've hit EOF.
+ */
+ dev->flags |= CAMDD_DEV_FLAG_EOF;
+ }
+
+ camdd_complete_buf(dev, buf, &error_count);
+
+ /*
+ * Unlock in preparation for the ioctl call.
+ */
+ pthread_mutex_unlock(&dev->mutex);
+ }
+
+ pthread_mutex_lock(&dev->mutex);
+
+ if (error_count > 0)
+ return (-1);
+ else
+ return (num_fetched);
+}
+
+/*
+ * Returns -1 for error, 0 for success/continue, and 1 for resource
+ * shortage/stop processing.
+ */
+int
+camdd_file_run(struct camdd_dev *dev)
+{
+ struct camdd_dev_file *file_dev = &dev->dev_spec.file;
+ struct camdd_buf_data *data;
+ struct camdd_buf *buf;
+ off_t io_offset;
+ int retval = 0, write_dev = dev->write_dev;
+ int error_count = 0, no_resources = 0, double_buf_needed = 0;
+ uint32_t num_sectors = 0, db_len = 0;
+
+ buf = STAILQ_FIRST(&dev->run_queue);
+ if (buf == NULL) {
+ no_resources = 1;
+ goto bailout;
+ } else if ((dev->write_dev == 0)
+ && (dev->flags & (CAMDD_DEV_FLAG_EOF |
+ CAMDD_DEV_FLAG_EOF_SENT))) {
+ STAILQ_REMOVE(&dev->run_queue, buf, camdd_buf, links);
+ dev->num_run_queue--;
+ buf->status = CAMDD_STATUS_EOF;
+ error_count++;
+ goto bailout;
+ }
+
+ /*
+ * If we're writing, we need to go through the source buffer list
+ * and create an S/G list.
+ */
+ if (write_dev != 0) {
+ retval = camdd_buf_sg_create(buf, /*iovec*/ 1,
+ dev->sector_size, &num_sectors, &double_buf_needed);
+ if (retval != 0) {
+ no_resources = 1;
+ goto bailout;
+ }
+ }
+
+ STAILQ_REMOVE(&dev->run_queue, buf, camdd_buf, links);
+ dev->num_run_queue--;
+
+ data = &buf->buf_type_spec.data;
+
+ /*
+ * pread(2) and pwrite(2) offsets are byte offsets.
+ */
+ io_offset = buf->lba * dev->sector_size;
+
+ /*
+ * Unlock the mutex while we read or write.
+ */
+ pthread_mutex_unlock(&dev->mutex);
+
+ /*
+ * Note that we don't need to double buffer if we're the reader
+ * because in that case, we have allocated a single buffer of
+ * sufficient size to do the read. This copy is necessary on
+ * writes because if one of the components of the S/G list is not
+ * a sector size multiple, the kernel will reject the write. This
+ * is unfortunate but not surprising. So this will make sure that
+ * we're using a single buffer that is a multiple of the sector size.
+ */
+ if ((double_buf_needed != 0)
+ && (data->sg_count > 1)
+ && (write_dev != 0)) {
+ uint32_t cur_offset;
+ int i;
+
+ if (file_dev->tmp_buf == NULL)
+ file_dev->tmp_buf = calloc(dev->blocksize, 1);
+ if (file_dev->tmp_buf == NULL) {
+ buf->status = CAMDD_STATUS_ERROR;
+ error_count++;
+ goto bailout;
+ }
+ for (i = 0, cur_offset = 0; i < data->sg_count; i++) {
+ bcopy(data->iovec[i].iov_base,
+ &file_dev->tmp_buf[cur_offset],
+ data->iovec[i].iov_len);
+ cur_offset += data->iovec[i].iov_len;
+ }
+ db_len = cur_offset;
+ }
+
+ if (file_dev->file_flags & CAMDD_FF_CAN_SEEK) {
+ if (write_dev == 0) {
+ /*
+ * XXX KDM is there any way we would need a S/G
+ * list here?
+ */
+ retval = pread(file_dev->fd, data->buf,
+ buf->len, io_offset);
+ } else {
+ if (double_buf_needed != 0) {
+ retval = pwrite(file_dev->fd, file_dev->tmp_buf,
+ db_len, io_offset);
+ } else if (data->sg_count == 0) {
+ retval = pwrite(file_dev->fd, data->buf,
+ data->fill_len, io_offset);
+ } else {
+ retval = pwritev(file_dev->fd, data->iovec,
+ data->sg_count, io_offset);
+ }
+ }
+ } else {
+ if (write_dev == 0) {
+ /*
+ * XXX KDM is there any way we would need a S/G
+ * list here?
+ */
+ retval = read(file_dev->fd, data->buf, buf->len);
+ } else {
+ if (double_buf_needed != 0) {
+ retval = write(file_dev->fd, file_dev->tmp_buf,
+ db_len);
+ } else if (data->sg_count == 0) {
+ retval = write(file_dev->fd, data->buf,
+ data->fill_len);
+ } else {
+ retval = writev(file_dev->fd, data->iovec,
+ data->sg_count);
+ }
+ }
+ }
+
+ /* We're done, re-acquire the lock */
+ pthread_mutex_lock(&dev->mutex);
+
+ if (retval >= (ssize_t)data->fill_len) {
+ /*
+ * If the bytes transferred is more than the request size,
+ * that indicates an overrun, which should only happen at
+ * the end of a transfer if we have to round up to a sector
+ * boundary.
+ */
+ if (buf->status == CAMDD_STATUS_NONE)
+ buf->status = CAMDD_STATUS_OK;
+ data->resid = 0;
+ dev->bytes_transferred += retval;
+ } else if (retval == -1) {
+ warn("Error %s %s", (write_dev) ? "writing to" :
+ "reading from", file_dev->filename);
+
+ buf->status = CAMDD_STATUS_ERROR;
+ data->resid = data->fill_len;
+ error_count++;
+
+ if (dev->debug == 0)
+ goto bailout;
+
+ if ((double_buf_needed != 0)
+ && (write_dev != 0)) {
+ fprintf(stderr, "%s: fd %d, DB buf %p, len %u lba %ju "
+ "offset %ju\n", __func__, file_dev->fd,
+ file_dev->tmp_buf, db_len, (uintmax_t)buf->lba,
+ (uintmax_t)io_offset);
+ } else if (data->sg_count == 0) {
+ fprintf(stderr, "%s: fd %d, buf %p, len %u, lba %ju "
+ "offset %ju\n", __func__, file_dev->fd, data->buf,
+ data->fill_len, (uintmax_t)buf->lba,
+ (uintmax_t)io_offset);
+ } else {
+ int i;
+
+ fprintf(stderr, "%s: fd %d, len %u, lba %ju "
+ "offset %ju\n", __func__, file_dev->fd,
+ data->fill_len, (uintmax_t)buf->lba,
+ (uintmax_t)io_offset);
+
+ for (i = 0; i < data->sg_count; i++) {
+ fprintf(stderr, "index %d ptr %p len %zu\n",
+ i, data->iovec[i].iov_base,
+ data->iovec[i].iov_len);
+ }
+ }
+ } else if (retval == 0) {
+ buf->status = CAMDD_STATUS_EOF;
+ if (dev->debug != 0)
+ printf("%s: got EOF from %s!\n", __func__,
+ file_dev->filename);
+ data->resid = data->fill_len;
+ error_count++;
+ } else if (retval < (ssize_t)data->fill_len) {
+ if (buf->status == CAMDD_STATUS_NONE)
+ buf->status = CAMDD_STATUS_SHORT_IO;
+ data->resid = data->fill_len - retval;
+ dev->bytes_transferred += retval;
+ }
+
+bailout:
+ if (buf != NULL) {
+ if (buf->status == CAMDD_STATUS_EOF) {
+ struct camdd_buf *buf2;
+ dev->flags |= CAMDD_DEV_FLAG_EOF;
+ STAILQ_FOREACH(buf2, &dev->run_queue, links)
+ buf2->status = CAMDD_STATUS_EOF;
+ }
+
+ camdd_complete_buf(dev, buf, &error_count);
+ }
+
+ if (error_count != 0)
+ return (-1);
+ else if (no_resources != 0)
+ return (1);
+ else
+ return (0);
+}
+
+/*
+ * Execute one command from the run queue. Returns 0 for success, 1 for
+ * stop processing, and -1 for error.
+ */
+int
+camdd_pass_run(struct camdd_dev *dev)
+{
+ struct camdd_buf *buf = NULL;
+ struct camdd_dev_pass *pass_dev = &dev->dev_spec.pass;
+ struct camdd_buf_data *data;
+ uint32_t num_blocks, sectors_used = 0;
+ union ccb *ccb;
+ int retval = 0, is_write = dev->write_dev;
+ int double_buf_needed = 0;
+
+ buf = STAILQ_FIRST(&dev->run_queue);
+ if (buf == NULL) {
+ retval = 1;
+ goto bailout;
+ }
+
+ /*
+ * If we're writing, we need to go through the source buffer list
+ * and create an S/G list.
+ */
+ if (is_write != 0) {
+ retval = camdd_buf_sg_create(buf, /*iovec*/ 0,dev->sector_size,
+ &sectors_used, &double_buf_needed);
+ if (retval != 0) {
+ retval = -1;
+ goto bailout;
+ }
+ }
+
+ STAILQ_REMOVE(&dev->run_queue, buf, camdd_buf, links);
+ dev->num_run_queue--;
+
+ data = &buf->buf_type_spec.data;
+
+ ccb = &data->ccb;
+ bzero(&(&ccb->ccb_h)[1],
+ sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr));
+
+ /*
+ * In almost every case the number of blocks should be the device
+ * block size. The exception may be at the end of an I/O stream
+ * for a partial block or at the end of a device.
+ */
+ if (is_write != 0)
+ num_blocks = sectors_used;
+ else
+ num_blocks = data->fill_len / pass_dev->block_len;
+
+ scsi_read_write(&ccb->csio,
+ /*retries*/ dev->retry_count,
+ /*cbfcnp*/ NULL,
+ /*tag_action*/ MSG_SIMPLE_Q_TAG,
+ /*readop*/ (dev->write_dev == 0) ? SCSI_RW_READ :
+ SCSI_RW_WRITE,
+ /*byte2*/ 0,
+ /*minimum_cmd_size*/ dev->min_cmd_size,
+ /*lba*/ buf->lba,
+ /*block_count*/ num_blocks,
+ /*data_ptr*/ (data->sg_count != 0) ?
+ (uint8_t *)data->segs : data->buf,
+ /*dxfer_len*/ (num_blocks * pass_dev->block_len),
+ /*sense_len*/ SSD_FULL_SIZE,
+ /*timeout*/ dev->io_timeout);
+
+ /* Disable freezing the device queue */
+ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS;
+
+ if (dev->retry_count != 0)
+ ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER;
+
+ if (data->sg_count != 0) {
+ ccb->csio.sglist_cnt = data->sg_count;
+ ccb->ccb_h.flags |= CAM_DATA_SG;
+ }
+
+ /*
+ * Store a pointer to the buffer in the CCB. The kernel will
+ * restore this when we get it back, and we'll use it to identify
+ * the buffer this CCB came from.
+ */
+ ccb->ccb_h.ccb_buf = buf;
+
+ /*
+ * Unlock our mutex in preparation for issuing the ioctl.
+ */
+ pthread_mutex_unlock(&dev->mutex);
+ /*
+ * Queue the CCB to the pass(4) driver.
+ */
+ if (ioctl(pass_dev->dev->fd, CAMIOQUEUE, ccb) == -1) {
+ pthread_mutex_lock(&dev->mutex);
+
+ warn("%s: error sending CAMIOQUEUE ioctl to %s%u", __func__,
+ pass_dev->dev->device_name, pass_dev->dev->dev_unit_num);
+ warn("%s: CCB address is %p", __func__, ccb);
+ retval = -1;
+
+ STAILQ_INSERT_TAIL(&dev->free_queue, buf, links);
+ } else {
+ pthread_mutex_lock(&dev->mutex);
+
+ dev->cur_active_io++;
+ STAILQ_INSERT_TAIL(&dev->active_queue, buf, links);
+ }
+
+bailout:
+ return (retval);
+}
+
+int
+camdd_get_next_lba_len(struct camdd_dev *dev, uint64_t *lba, ssize_t *len)
+{
+ struct camdd_dev_pass *pass_dev;
+ uint32_t num_blocks;
+ int retval = 0;
+
+ pass_dev = &dev->dev_spec.pass;
+
+ *lba = dev->next_io_pos_bytes / dev->sector_size;
+ *len = dev->blocksize;
+ num_blocks = *len / dev->sector_size;
+
+ /*
+ * If max_sector is 0, then we have no set limit. This can happen
+ * if we're writing to a file in a filesystem, or reading from
+ * something like /dev/zero.
+ */
+ if ((dev->max_sector != 0)
+ || (dev->sector_io_limit != 0)) {
+ uint64_t max_sector;
+
+ if ((dev->max_sector != 0)
+ && (dev->sector_io_limit != 0))
+ max_sector = min(dev->sector_io_limit, dev->max_sector);
+ else if (dev->max_sector != 0)
+ max_sector = dev->max_sector;
+ else
+ max_sector = dev->sector_io_limit;
+
+
+ /*
+ * Check to see whether we're starting off past the end of
+ * the device. If so, we need to just send an EOF
+ * notification to the writer.
+ */
+ if (*lba > max_sector) {
+ *len = 0;
+ retval = 1;
+ } else if (((*lba + num_blocks) > max_sector + 1)
+ || ((*lba + num_blocks) < *lba)) {
+ /*
+ * If we get here (but pass the first check), we
+ * can trim the request length down to go to the
+ * end of the device.
+ */
+ num_blocks = (max_sector + 1) - *lba;
+ *len = num_blocks * dev->sector_size;
+ retval = 1;
+ }
+ }
+
+ dev->next_io_pos_bytes += *len;
+
+ return (retval);
+}
+
+/*
+ * Returns 0 for success, 1 for EOF detected, and -1 for failure.
+ */
+int
+camdd_queue(struct camdd_dev *dev, struct camdd_buf *read_buf)
+{
+ struct camdd_buf *buf = NULL;
+ struct camdd_buf_data *data;
+ struct camdd_dev_pass *pass_dev;
+ size_t new_len;
+ struct camdd_buf_data *rb_data;
+ int is_write = dev->write_dev;
+ int eof_flush_needed = 0;
+ int retval = 0;
+ int error;
+
+ pass_dev = &dev->dev_spec.pass;
+
+ /*
+ * If we've gotten EOF or our partner has, we should not continue
+ * queueing I/O. If we're a writer, though, we should continue
+ * to write any buffers that don't have EOF status.
+ */
+ if ((dev->flags & CAMDD_DEV_FLAG_EOF)
+ || ((dev->flags & CAMDD_DEV_FLAG_PEER_EOF)
+ && (is_write == 0))) {
+ /*
+ * Tell the worker thread that we have seen EOF.
+ */
+ retval = 1;
+
+ /*
+ * If we're the writer, send the buffer back with EOF status.
+ */
+ if (is_write) {
+ read_buf->status = CAMDD_STATUS_EOF;
+
+ error = camdd_complete_peer_buf(dev, read_buf);
+ }
+ goto bailout;
+ }
+
+ if (is_write == 0) {
+ buf = camdd_get_buf(dev, CAMDD_BUF_DATA);
+ if (buf == NULL) {
+ retval = -1;
+ goto bailout;
+ }
+ data = &buf->buf_type_spec.data;
+
+ retval = camdd_get_next_lba_len(dev, &buf->lba, &buf->len);
+ if (retval != 0) {
+ buf->status = CAMDD_STATUS_EOF;
+
+ if ((buf->len == 0)
+ && ((dev->flags & (CAMDD_DEV_FLAG_EOF_SENT |
+ CAMDD_DEV_FLAG_EOF_QUEUED)) != 0)) {
+ camdd_release_buf(buf);
+ goto bailout;
+ }
+ dev->flags |= CAMDD_DEV_FLAG_EOF_QUEUED;
+ }
+
+ data->fill_len = buf->len;
+ data->src_start_offset = buf->lba * dev->sector_size;
+
+ /*
+ * Put this on the run queue.
+ */
+ STAILQ_INSERT_TAIL(&dev->run_queue, buf, links);
+ dev->num_run_queue++;
+
+ /* We're done. */
+ goto bailout;
+ }
+
+ /*
+ * Check for new EOF status from the reader.
+ */
+ if ((read_buf->status == CAMDD_STATUS_EOF)
+ || (read_buf->status == CAMDD_STATUS_ERROR)) {
+ dev->flags |= CAMDD_DEV_FLAG_PEER_EOF;
+ if ((STAILQ_FIRST(&dev->pending_queue) == NULL)
+ && (read_buf->len == 0)) {
+ camdd_complete_peer_buf(dev, read_buf);
+ retval = 1;
+ goto bailout;
+ } else
+ eof_flush_needed = 1;
+ }
+
+ /*
+ * See if we have a buffer we're composing with pieces from our
+ * partner thread.
+ */
+ buf = STAILQ_FIRST(&dev->pending_queue);
+ if (buf == NULL) {
+ uint64_t lba;
+ ssize_t len;
+
+ retval = camdd_get_next_lba_len(dev, &lba, &len);
+ if (retval != 0) {
+ read_buf->status = CAMDD_STATUS_EOF;
+
+ if (len == 0) {
+ dev->flags |= CAMDD_DEV_FLAG_EOF;
+ error = camdd_complete_peer_buf(dev, read_buf);
+ goto bailout;
+ }
+ }
+
+ /*
+ * If we don't have a pending buffer, we need to grab a new
+ * one from the free list or allocate another one.
+ */
+ buf = camdd_get_buf(dev, CAMDD_BUF_DATA);
+ if (buf == NULL) {
+ retval = 1;
+ goto bailout;
+ }
+
+ buf->lba = lba;
+ buf->len = len;
+
+ STAILQ_INSERT_TAIL(&dev->pending_queue, buf, links);
+ dev->num_pending_queue++;
+ }
+
+ data = &buf->buf_type_spec.data;
+
+ rb_data = &read_buf->buf_type_spec.data;
+
+ if ((rb_data->src_start_offset != dev->next_peer_pos_bytes)
+ && (dev->debug != 0)) {
+ printf("%s: WARNING: reader offset %#jx != expected offset "
+ "%#jx\n", __func__, (uintmax_t)rb_data->src_start_offset,
+ (uintmax_t)dev->next_peer_pos_bytes);
+ }
+ dev->next_peer_pos_bytes = rb_data->src_start_offset +
+ (rb_data->fill_len - rb_data->resid);
+
+ new_len = (rb_data->fill_len - rb_data->resid) + data->fill_len;
+ if (new_len < buf->len) {
+ /*
+ * There are three cases here:
+ * 1. We need more data to fill up a block, so we put
+ * this I/O on the queue and wait for more I/O.
+ * 2. We have a pending buffer in the queue that is
+ * smaller than our blocksize, but we got an EOF. So we
+ * need to go ahead and flush the write out.
+ * 3. We got an error.
+ */
+
+ /*
+ * Increment our fill length.
+ */
+ data->fill_len += (rb_data->fill_len - rb_data->resid);
+
+ /*
+ * Add the new read buffer to the list for writing.
+ */
+ STAILQ_INSERT_TAIL(&buf->src_list, read_buf, src_links);
+
+ /* Increment the count */
+ buf->src_count++;
+
+ if (eof_flush_needed == 0) {
+ /*
+ * We need to exit, because we don't have enough
+ * data yet.
+ */
+ goto bailout;
+ } else {
+ /*
+ * Take the buffer off of the pending queue.
+ */
+ STAILQ_REMOVE(&dev->pending_queue, buf, camdd_buf,
+ links);
+ dev->num_pending_queue--;
+
+ /*
+ * If we need an EOF flush, but there is no data
+ * to flush, go ahead and return this buffer.
+ */
+ if (data->fill_len == 0) {
+ camdd_complete_buf(dev, buf, /*error_count*/0);
+ retval = 1;
+ goto bailout;
+ }
+
+ /*
+ * Put this on the next queue for execution.
+ */
+ STAILQ_INSERT_TAIL(&dev->run_queue, buf, links);
+ dev->num_run_queue++;
+ }
+ } else if (new_len == buf->len) {
+ /*
+ * We have enough data to completey fill one block,
+ * so we're ready to issue the I/O.
+ */
+
+ /*
+ * Take the buffer off of the pending queue.
+ */
+ STAILQ_REMOVE(&dev->pending_queue, buf, camdd_buf, links);
+ dev->num_pending_queue--;
+
+ /*
+ * Add the new read buffer to the list for writing.
+ */
+ STAILQ_INSERT_TAIL(&buf->src_list, read_buf, src_links);
+
+ /* Increment the count */
+ buf->src_count++;
+
+ /*
+ * Increment our fill length.
+ */
+ data->fill_len += (rb_data->fill_len - rb_data->resid);
+
+ /*
+ * Put this on the next queue for execution.
+ */
+ STAILQ_INSERT_TAIL(&dev->run_queue, buf, links);
+ dev->num_run_queue++;
+ } else {
+ struct camdd_buf *idb;
+ struct camdd_buf_indirect *indirect;
+ uint32_t len_to_go, cur_offset;
+
+
+ idb = camdd_get_buf(dev, CAMDD_BUF_INDIRECT);
+ if (idb == NULL) {
+ retval = 1;
+ goto bailout;
+ }
+ indirect = &idb->buf_type_spec.indirect;
+ indirect->src_buf = read_buf;
+ read_buf->refcount++;
+ indirect->offset = 0;
+ indirect->start_ptr = rb_data->buf;
+ /*
+ * We've already established that there is more
+ * data in read_buf than we have room for in our
+ * current write request. So this particular chunk
+ * of the request should just be the remainder
+ * needed to fill up a block.
+ */
+ indirect->len = buf->len - (data->fill_len - data->resid);
+
+ camdd_buf_add_child(buf, idb);
+
+ /*
+ * This buffer is ready to execute, so we can take
+ * it off the pending queue and put it on the run
+ * queue.
+ */
+ STAILQ_REMOVE(&dev->pending_queue, buf, camdd_buf,
+ links);
+ dev->num_pending_queue--;
+ STAILQ_INSERT_TAIL(&dev->run_queue, buf, links);
+ dev->num_run_queue++;
+
+ cur_offset = indirect->offset + indirect->len;
+
+ /*
+ * The resulting I/O would be too large to fit in
+ * one block. We need to split this I/O into
+ * multiple pieces. Allocate as many buffers as needed.
+ */
+ for (len_to_go = rb_data->fill_len - rb_data->resid -
+ indirect->len; len_to_go > 0;) {
+ struct camdd_buf *new_buf;
+ struct camdd_buf_data *new_data;
+ uint64_t lba;
+ ssize_t len;
+
+ retval = camdd_get_next_lba_len(dev, &lba, &len);
+ if ((retval != 0)
+ && (len == 0)) {
+ /*
+ * The device has already been marked
+ * as EOF, and there is no space left.
+ */
+ goto bailout;
+ }
+
+ new_buf = camdd_get_buf(dev, CAMDD_BUF_DATA);
+ if (new_buf == NULL) {
+ retval = 1;
+ goto bailout;
+ }
+
+ new_buf->lba = lba;
+ new_buf->len = len;
+
+ idb = camdd_get_buf(dev, CAMDD_BUF_INDIRECT);
+ if (idb == NULL) {
+ retval = 1;
+ goto bailout;
+ }
+
+ indirect = &idb->buf_type_spec.indirect;
+
+ indirect->src_buf = read_buf;
+ read_buf->refcount++;
+ indirect->offset = cur_offset;
+ indirect->start_ptr = rb_data->buf + cur_offset;
+ indirect->len = min(len_to_go, new_buf->len);
+#if 0
+ if (((indirect->len % dev->sector_size) != 0)
+ || ((indirect->offset % dev->sector_size) != 0)) {
+ warnx("offset %ju len %ju not aligned with "
+ "sector size %u", indirect->offset,
+ (uintmax_t)indirect->len, dev->sector_size);
+ }
+#endif
+ cur_offset += indirect->len;
+ len_to_go -= indirect->len;
+
+ camdd_buf_add_child(new_buf, idb);
+
+ new_data = &new_buf->buf_type_spec.data;
+
+ if ((new_data->fill_len == new_buf->len)
+ || (eof_flush_needed != 0)) {
+ STAILQ_INSERT_TAIL(&dev->run_queue,
+ new_buf, links);
+ dev->num_run_queue++;
+ } else if (new_data->fill_len < buf->len) {
+ STAILQ_INSERT_TAIL(&dev->pending_queue,
+ new_buf, links);
+ dev->num_pending_queue++;
+ } else {
+ warnx("%s: too much data in new "
+ "buffer!", __func__);
+ retval = 1;
+ goto bailout;
+ }
+ }
+ }
+
+bailout:
+ return (retval);
+}
+
+void
+camdd_get_depth(struct camdd_dev *dev, uint32_t *our_depth,
+ uint32_t *peer_depth, uint32_t *our_bytes, uint32_t *peer_bytes)
+{
+ *our_depth = dev->cur_active_io + dev->num_run_queue;
+ if (dev->num_peer_work_queue >
+ dev->num_peer_done_queue)
+ *peer_depth = dev->num_peer_work_queue -
+ dev->num_peer_done_queue;
+ else
+ *peer_depth = 0;
+ *our_bytes = *our_depth * dev->blocksize;
+ *peer_bytes = dev->peer_bytes_queued;
+}
+
+void
+camdd_sig_handler(int sig)
+{
+ if (sig == SIGINFO)
+ need_status = 1;
+ else {
+ need_exit = 1;
+ error_exit = 1;
+ }
+
+ sem_post(&camdd_sem);
+}
+
+void
+camdd_print_status(struct camdd_dev *camdd_dev, struct camdd_dev *other_dev,
+ struct timespec *start_time)
+{
+ struct timespec done_time;
+ uint64_t total_ns;
+ long double mb_sec, total_sec;
+ int error = 0;
+
+ error = clock_gettime(CLOCK_MONOTONIC_PRECISE, &done_time);
+ if (error != 0) {
+ warn("Unable to get done time");
+ return;
+ }
+
+ timespecsub(&done_time, start_time);
+
+ total_ns = done_time.tv_nsec + (done_time.tv_sec * 1000000000);
+ total_sec = total_ns;
+ total_sec /= 1000000000;
+
+ fprintf(stderr, "%ju bytes %s %s\n%ju bytes %s %s\n"
+ "%.4Lf seconds elapsed\n",
+ (uintmax_t)camdd_dev->bytes_transferred,
+ (camdd_dev->write_dev == 0) ? "read from" : "written to",
+ camdd_dev->device_name,
+ (uintmax_t)other_dev->bytes_transferred,
+ (other_dev->write_dev == 0) ? "read from" : "written to",
+ other_dev->device_name, total_sec);
+
+ mb_sec = min(other_dev->bytes_transferred,camdd_dev->bytes_transferred);
+ mb_sec /= 1024 * 1024;
+ mb_sec *= 1000000000;
+ mb_sec /= total_ns;
+ fprintf(stderr, "%.2Lf MB/sec\n", mb_sec);
+}
+
+int
+camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io,
+ int retry_count, int timeout)
+{
+ char *device = NULL;
+ struct cam_device *new_cam_dev = NULL;
+ struct camdd_dev *devs[2];
+ struct timespec start_time;
+ pthread_t threads[2];
+ int unit = 0;
+ int error = 0;
+ int i;
+
+ if (num_io_opts != 2) {
+ warnx("Must have one input and one output path");
+ error = 1;
+ goto bailout;
+ }
+
+ bzero(devs, sizeof(devs));
+
+ for (i = 0; i < num_io_opts; i++) {
+ switch (io_opts[i].dev_type) {
+ case CAMDD_DEV_PASS: {
+ camdd_argmask new_arglist = CAMDD_ARG_NONE;
+ int bus = 0, target = 0, lun = 0;
+ char name[30];
+ int rv;
+
+ if (isdigit(io_opts[i].dev_name[0])) {
+ /* device specified as bus:target[:lun] */
+ rv = parse_btl(io_opts[i].dev_name, &bus,
+ &target, &lun, &new_arglist);
+ if (rv < 2) {
+ warnx("numeric device specification "
+ "must be either bus:target, or "
+ "bus:target:lun");
+ error = 1;
+ goto bailout;
+ }
+ /* default to 0 if lun was not specified */
+ if ((new_arglist & CAMDD_ARG_LUN) == 0) {
+ lun = 0;
+ new_arglist |= CAMDD_ARG_LUN;
+ }
+ } else {
+ if (cam_get_device(io_opts[i].dev_name, name,
+ sizeof name, &unit) == -1) {
+ warnx("%s", cam_errbuf);
+ error = 1;
+ goto bailout;
+ }
+ device = strdup(name);
+ new_arglist |= CAMDD_ARG_DEVICE |CAMDD_ARG_UNIT;
+ }
+
+ if (new_arglist & (CAMDD_ARG_BUS | CAMDD_ARG_TARGET))
+ new_cam_dev = cam_open_btl(bus, target, lun,
+ O_RDWR, NULL);
+ else
+ new_cam_dev = cam_open_spec_device(device, unit,
+ O_RDWR, NULL);
+ if (new_cam_dev == NULL) {
+ warnx("%s", cam_errbuf);
+ error = 1;
+ goto bailout;
+ }
+
+ devs[i] = camdd_probe_pass(new_cam_dev,
+ /*io_opts*/ &io_opts[i],
+ CAMDD_ARG_ERR_RECOVER,
+ /*probe_retry_count*/ 3,
+ /*probe_timeout*/ 5000,
+ /*io_retry_count*/ retry_count,
+ /*io_timeout*/ timeout);
+ if (devs[i] == NULL) {
+ warn("Unable to probe device %s%u",
+ new_cam_dev->device_name,
+ new_cam_dev->dev_unit_num);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ }
+ case CAMDD_DEV_FILE: {
+ int fd = -1;
+
+ if (io_opts[i].dev_name[0] == '-') {
+ if (io_opts[i].write_dev != 0)
+ fd = STDOUT_FILENO;
+ else
+ fd = STDIN_FILENO;
+ } else {
+ if (io_opts[i].write_dev != 0) {
+ fd = open(io_opts[i].dev_name,
+ O_RDWR | O_CREAT, S_IWUSR |S_IRUSR);
+ } else {
+ fd = open(io_opts[i].dev_name,
+ O_RDONLY);
+ }
+ }
+ if (fd == -1) {
+ warn("error opening file %s",
+ io_opts[i].dev_name);
+ error = 1;
+ goto bailout;
+ }
+
+ devs[i] = camdd_probe_file(fd, &io_opts[i],
+ retry_count, timeout);
+ if (devs[i] == NULL) {
+ error = 1;
+ goto bailout;
+ }
+
+ break;
+ }
+ default:
+ warnx("Unknown device type %d (%s)",
+ io_opts[i].dev_type, io_opts[i].dev_name);
+ error = 1;
+ goto bailout;
+ break; /*NOTREACHED */
+ }
+
+ devs[i]->write_dev = io_opts[i].write_dev;
+
+ devs[i]->start_offset_bytes = io_opts[i].offset;
+
+ if (max_io != 0) {
+ devs[i]->sector_io_limit =
+ (devs[i]->start_offset_bytes /
+ devs[i]->sector_size) +
+ (max_io / devs[i]->sector_size) - 1;
+ devs[i]->sector_io_limit =
+ (devs[i]->start_offset_bytes /
+ devs[i]->sector_size) +
+ (max_io / devs[i]->sector_size) - 1;
+ }
+
+ devs[i]->next_io_pos_bytes = devs[i]->start_offset_bytes;
+ devs[i]->next_completion_pos_bytes =devs[i]->start_offset_bytes;
+ }
+
+ devs[0]->peer_dev = devs[1];
+ devs[1]->peer_dev = devs[0];
+ devs[0]->next_peer_pos_bytes = devs[0]->peer_dev->next_io_pos_bytes;
+ devs[1]->next_peer_pos_bytes = devs[1]->peer_dev->next_io_pos_bytes;
+
+ sem_init(&camdd_sem, /*pshared*/ 0, 0);
+
+ signal(SIGINFO, camdd_sig_handler);
+ signal(SIGINT, camdd_sig_handler);
+
+ error = clock_gettime(CLOCK_MONOTONIC_PRECISE, &start_time);
+ if (error != 0) {
+ warn("Unable to get start time");
+ goto bailout;
+ }
+
+ for (i = 0; i < num_io_opts; i++) {
+ error = pthread_create(&threads[i], NULL, camdd_worker,
+ (void *)devs[i]);
+ if (error != 0) {
+ warnc(error, "pthread_create() failed");
+ goto bailout;
+ }
+ }
+
+ for (;;) {
+ if ((sem_wait(&camdd_sem) == -1)
+ || (need_exit != 0)) {
+ struct kevent ke;
+
+ for (i = 0; i < num_io_opts; i++) {
+ EV_SET(&ke, (uintptr_t)&devs[i]->work_queue,
+ EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
+
+ devs[i]->flags |= CAMDD_DEV_FLAG_EOF;
+
+ error = kevent(devs[i]->kq, &ke, 1, NULL, 0,
+ NULL);
+ if (error == -1)
+ warn("%s: unable to wake up thread",
+ __func__);
+ error = 0;
+ }
+ break;
+ } else if (need_status != 0) {
+ camdd_print_status(devs[0], devs[1], &start_time);
+ need_status = 0;
+ }
+ }
+ for (i = 0; i < num_io_opts; i++) {
+ pthread_join(threads[i], NULL);
+ }
+
+ camdd_print_status(devs[0], devs[1], &start_time);
+
+bailout:
+
+ for (i = 0; i < num_io_opts; i++)
+ camdd_free_dev(devs[i]);
+
+ return (error + error_exit);
+}
+
+void
+usage(void)
+{
+ fprintf(stderr,
+"usage: camdd <-i|-o pass=pass0,bs=1M,offset=1M,depth=4>\n"
+" <-i|-o file=/tmp/file,bs=512K,offset=1M>\n"
+" <-i|-o file=/dev/da0,bs=512K,offset=1M>\n"
+" <-i|-o file=/dev/nsa0,bs=512K>\n"
+" [-C retry_count][-E][-m max_io_amt][-t timeout_secs][-v][-h]\n"
+"Option description\n"
+"-i <arg=val> Specify input device/file and parameters\n"
+"-o <arg=val> Specify output device/file and parameters\n"
+"Input and Output parameters\n"
+"pass=name Specify a pass(4) device like pass0 or /dev/pass0\n"
+"file=name Specify a file or device, /tmp/foo, /dev/da0, /dev/null\n"
+" or - for stdin/stdout\n"
+"bs=blocksize Specify blocksize in bytes, or using K, M, G, etc. suffix\n"
+"offset=len Specify starting offset in bytes or using K, M, G suffix\n"
+" NOTE: offset cannot be specified on tapes, pipes, stdin/out\n"
+"depth=N Specify a numeric queue depth. This only applies to pass(4)\n"
+"mcs=N Specify a minimum cmd size for pass(4) read/write commands\n"
+"Optional arguments\n"
+"-C retry_cnt Specify a retry count for pass(4) devices\n"
+"-E Enable CAM error recovery for pass(4) devices\n"
+"-m max_io Specify the maximum amount to be transferred in bytes or\n"
+" using K, G, M, etc. suffixes\n"
+"-t timeout Specify the I/O timeout to use with pass(4) devices\n"
+"-v Enable verbose error recovery\n"
+"-h Print this message\n");
+}
+
+
+int
+camdd_parse_io_opts(char *args, int is_write, struct camdd_io_opts *io_opts)
+{
+ char *tmpstr, *tmpstr2;
+ char *orig_tmpstr = NULL;
+ int retval = 0;
+
+ io_opts->write_dev = is_write;
+
+ tmpstr = strdup(args);
+ if (tmpstr == NULL) {
+ warn("strdup failed");
+ retval = 1;
+ goto bailout;
+ }
+ orig_tmpstr = tmpstr;
+ while ((tmpstr2 = strsep(&tmpstr, ",")) != NULL) {
+ char *name, *value;
+
+ /*
+ * If the user creates an empty parameter by putting in two
+ * commas, skip over it and look for the next field.
+ */
+ if (*tmpstr2 == '\0')
+ continue;
+
+ name = strsep(&tmpstr2, "=");
+ if (*name == '\0') {
+ warnx("Got empty I/O parameter name");
+ retval = 1;
+ goto bailout;
+ }
+ value = strsep(&tmpstr2, "=");
+ if ((value == NULL)
+ || (*value == '\0')) {
+ warnx("Empty I/O parameter value for %s", name);
+ retval = 1;
+ goto bailout;
+ }
+ if (strncasecmp(name, "file", 4) == 0) {
+ io_opts->dev_type = CAMDD_DEV_FILE;
+ io_opts->dev_name = strdup(value);
+ if (io_opts->dev_name == NULL) {
+ warn("Error allocating memory");
+ retval = 1;
+ goto bailout;
+ }
+ } else if (strncasecmp(name, "pass", 4) == 0) {
+ io_opts->dev_type = CAMDD_DEV_PASS;
+ io_opts->dev_name = strdup(value);
+ if (io_opts->dev_name == NULL) {
+ warn("Error allocating memory");
+ retval = 1;
+ goto bailout;
+ }
+ } else if ((strncasecmp(name, "bs", 2) == 0)
+ || (strncasecmp(name, "blocksize", 9) == 0)) {
+ retval = expand_number(value, &io_opts->blocksize);
+ if (retval == -1) {
+ warn("expand_number(3) failed on %s=%s", name,
+ value);
+ retval = 1;
+ goto bailout;
+ }
+ } else if (strncasecmp(name, "depth", 5) == 0) {
+ char *endptr;
+
+ io_opts->queue_depth = strtoull(value, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("invalid queue depth %s", value);
+ retval = 1;
+ goto bailout;
+ }
+ } else if (strncasecmp(name, "mcs", 3) == 0) {
+ char *endptr;
+
+ io_opts->min_cmd_size = strtol(value, &endptr, 0);
+ if ((*endptr != '\0')
+ || ((io_opts->min_cmd_size > 16)
+ || (io_opts->min_cmd_size < 0))) {
+ warnx("invalid minimum cmd size %s", value);
+ retval = 1;
+ goto bailout;
+ }
+ } else if (strncasecmp(name, "offset", 6) == 0) {
+ retval = expand_number(value, &io_opts->offset);
+ if (retval == -1) {
+ warn("expand_number(3) failed on %s=%s", name,
+ value);
+ retval = 1;
+ goto bailout;
+ }
+ } else if (strncasecmp(name, "debug", 5) == 0) {
+ char *endptr;
+
+ io_opts->debug = strtoull(value, &endptr, 0);
+ if (*endptr != '\0') {
+ warnx("invalid debug level %s", value);
+ retval = 1;
+ goto bailout;
+ }
+ } else {
+ warnx("Unrecognized parameter %s=%s", name, value);
+ }
+ }
+bailout:
+ free(orig_tmpstr);
+
+ return (retval);
+}
+
+int
+main(int argc, char **argv)
+{
+ int c;
+ camdd_argmask arglist = CAMDD_ARG_NONE;
+ int timeout = 0, retry_count = 1;
+ int error = 0;
+ uint64_t max_io = 0;
+ struct camdd_io_opts *opt_list = NULL;
+
+ if (argc == 1) {
+ usage();
+ exit(1);
+ }
+
+ opt_list = calloc(2, sizeof(struct camdd_io_opts));
+ if (opt_list == NULL) {
+ warn("Unable to allocate option list");
+ error = 1;
+ goto bailout;
+ }
+
+ while ((c = getopt(argc, argv, "C:Ehi:m:o:t:v")) != -1){
+ switch (c) {
+ case 'C':
+ retry_count = strtol(optarg, NULL, 0);
+ if (retry_count < 0)
+ errx(1, "retry count %d is < 0",
+ retry_count);
+ arglist |= CAMDD_ARG_RETRIES;
+ break;
+ case 'E':
+ arglist |= CAMDD_ARG_ERR_RECOVER;
+ break;
+ case 'i':
+ case 'o':
+ if (((c == 'i')
+ && (opt_list[0].dev_type != CAMDD_DEV_NONE))
+ || ((c == 'o')
+ && (opt_list[1].dev_type != CAMDD_DEV_NONE))) {
+ errx(1, "Only one input and output path "
+ "allowed");
+ }
+ error = camdd_parse_io_opts(optarg, (c == 'o') ? 1 : 0,
+ (c == 'o') ? &opt_list[1] : &opt_list[0]);
+ if (error != 0)
+ goto bailout;
+ break;
+ case 'm':
+ error = expand_number(optarg, &max_io);
+ if (error == -1) {
+ warn("invalid maximum I/O amount %s", optarg);
+ error = 1;
+ goto bailout;
+ }
+ break;
+ case 't':
+ timeout = strtol(optarg, NULL, 0);
+ if (timeout < 0)
+ errx(1, "invalid timeout %d", timeout);
+ /* Convert the timeout from seconds to ms */
+ timeout *= 1000;
+ arglist |= CAMDD_ARG_TIMEOUT;
+ break;
+ case 'v':
+ arglist |= CAMDD_ARG_VERBOSE;
+ break;
+ case 'h':
+ default:
+ usage();
+ exit(1);
+ break; /*NOTREACHED*/
+ }
+ }
+
+ if ((opt_list[0].dev_type == CAMDD_DEV_NONE)
+ || (opt_list[1].dev_type == CAMDD_DEV_NONE))
+ errx(1, "Must specify both -i and -o");
+
+ /*
+ * Set the timeout if the user hasn't specified one.
+ */
+ if (timeout == 0)
+ timeout = CAMDD_PASS_RW_TIMEOUT;
+
+ error = camdd_rw(opt_list, 2, max_io, retry_count, timeout);
+
+bailout:
+ free(opt_list);
+
+ exit(error);
+}
diff --git a/usr.sbin/ctld/Makefile.depend b/usr.sbin/ctld/Makefile.depend
new file mode 100644
index 0000000..ece2325
--- /dev/null
+++ b/usr.sbin/ctld/Makefile.depend
@@ -0,0 +1,31 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/libmd \
+ lib/libsbuf \
+ lib/libutil \
+ usr.bin/lex/lib \
+ usr.bin/yacc.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+parse.o: parse.c
+parse.po: parse.c
+token.o: token.c
+token.o: y.tab.h
+token.po: token.c
+token.po: y.tab.h
+.endif
diff --git a/usr.sbin/dconschat/Makefile.depend b/usr.sbin/dconschat/Makefile.depend
index e2e70c8..442e3ca8 100644
--- a/usr.sbin/dconschat/Makefile.depend
+++ b/usr.sbin/dconschat/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.sbin/devctl/Makefile.depend b/usr.sbin/devctl/Makefile.depend
new file mode 100644
index 0000000..34e1a91
--- /dev/null
+++ b/usr.sbin/devctl/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libdevctl \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/fifolog/lib/Makefile b/usr.sbin/fifolog/lib/Makefile
index fc8e6d2..f60529f 100644
--- a/usr.sbin/fifolog/lib/Makefile
+++ b/usr.sbin/fifolog/lib/Makefile
@@ -7,6 +7,7 @@ SRCS= fifolog_int.c fifolog_create.c fifolog_write_poll.c fifolog_reader.c
SRCS+= getdate.y
CFLAGS+= -I${.CURDIR}
+LIBADD= z
NO_WMISSING_VARIABLE_DECLARATIONS=
diff --git a/usr.sbin/fstyp/Makefile b/usr.sbin/fstyp/Makefile
index bd981df..e82dd04 100644
--- a/usr.sbin/fstyp/Makefile
+++ b/usr.sbin/fstyp/Makefile
@@ -36,12 +36,10 @@ CFLAGS+= -I${.CURDIR}/../../cddl/contrib/opensolaris/head
CFLAGS+=-I${.CURDIR}/../../sys
-DPADD= ${LIBGEOM} ${LIBMD}
-LDADD= -lgeom -lmd
+LIBADD= geom md
.if ${MK_ZFS} != "no"
-DPADD += ${LIBNVPAIR} ${LIBZFS}
-LDADD += -lnvpair -lzfs
+LIBADD+=nvpair zfs
.endif
.include <bsd.prog.mk>
diff --git a/usr.sbin/fstyp/Makefile.depend b/usr.sbin/fstyp/Makefile.depend
new file mode 100644
index 0000000..b1a2eff
--- /dev/null
+++ b/usr.sbin/fstyp/Makefile.depend
@@ -0,0 +1,32 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ cddl/lib/libavl \
+ cddl/lib/libnvpair \
+ cddl/lib/libumem \
+ cddl/lib/libuutil \
+ cddl/lib/libzfs \
+ cddl/lib/libzfs_core \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/libgeom \
+ lib/libmd \
+ lib/libsbuf \
+ lib/libthr \
+ lib/libutil \
+ lib/libz \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/ftp-proxy/Makefile.depend b/usr.sbin/ftp-proxy/Makefile.depend
new file mode 100644
index 0000000..c02eb2d
--- /dev/null
+++ b/usr.sbin/ftp-proxy/Makefile.depend
@@ -0,0 +1,20 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libevent \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/gstat/Makefile.depend b/usr.sbin/gstat/Makefile.depend
index c24e161..c8fd534 100644
--- a/usr.sbin/gstat/Makefile.depend
+++ b/usr.sbin/gstat/Makefile.depend
@@ -11,6 +11,7 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libdevstat \
lib/libedit \
+ lib/libelf \
lib/libexpat \
lib/libgeom \
lib/libkvm \
diff --git a/usr.sbin/hyperv/tools/Makefile.depend b/usr.sbin/hyperv/tools/Makefile.depend
new file mode 100644
index 0000000..54c1f6f
--- /dev/null
+++ b/usr.sbin/hyperv/tools/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/iostat/Makefile.depend b/usr.sbin/iostat/Makefile.depend
index bfcafb7..ca404f2 100644
--- a/usr.sbin/iostat/Makefile.depend
+++ b/usr.sbin/iostat/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libdevstat \
+ lib/libelf \
lib/libkvm \
lib/msun \
diff --git a/usr.sbin/iovctl/Makefile.depend b/usr.sbin/iovctl/Makefile.depend
new file mode 100644
index 0000000..d883529
--- /dev/null
+++ b/usr.sbin/iovctl/Makefile.depend
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libnv \
+ lib/libucl \
+ lib/msun \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/iscsid/Makefile.depend b/usr.sbin/iscsid/Makefile.depend
new file mode 100644
index 0000000..023ec43
--- /dev/null
+++ b/usr.sbin/iscsid/Makefile.depend
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libmd \
+ lib/libutil \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/jail/Makefile.depend b/usr.sbin/jail/Makefile.depend
index 28c1ed0..b24d6ea4 100644
--- a/usr.sbin/jail/Makefile.depend
+++ b/usr.sbin/jail/Makefile.depend
@@ -10,6 +10,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libjail \
lib/libkvm \
lib/libutil \
diff --git a/usr.sbin/kbdmap/kbdmap.c b/usr.sbin/kbdmap/kbdmap.c
index 08c0d77..0670d1b 100644
--- a/usr.sbin/kbdmap/kbdmap.c
+++ b/usr.sbin/kbdmap/kbdmap.c
@@ -57,6 +57,7 @@ static const char *dir;
static const char *menu = "";
static int x11;
+static int using_vt;
static int show;
static int verbose;
static int print;
@@ -150,7 +151,7 @@ add_keymap(const char *desc, int mark, const char *keym)
* Return 0 if syscons is in use (to select legacy defaults).
*/
static int
-check_newcons(void)
+check_vt(void)
{
size_t len;
char term[3];
@@ -159,7 +160,7 @@ check_newcons(void)
if (sysctlbyname("kern.vty", &term, &len, NULL, 0) != 0 ||
strcmp(term, "vt") != 0)
return 0;
- return -1;
+ return 1;
}
/*
@@ -256,7 +257,7 @@ get_font(void)
static void
vidcontrol(const char *fnt)
{
- char *tmp, *p, *q;
+ char *tmp, *p, *q, *cmd;
char ch;
int i;
@@ -264,6 +265,13 @@ vidcontrol(const char *fnt)
if (x11)
return;
+ if (using_vt) {
+ asprintf(&cmd, "vidcontrol -f %s", fnt);
+ system(cmd);
+ free(cmd);
+ return;
+ }
+
tmp = strdup(fnt);
/* Extract font size */
@@ -281,7 +289,6 @@ vidcontrol(const char *fnt)
if (sscanf(p, "%dx%d%c", &i, &i, &ch) != 2)
fprintf(stderr, "Which font size? %s\n", fnt);
else {
- char *cmd;
asprintf(&cmd, "vidcontrol -f %s %s", p, fnt);
if (verbose)
fprintf(stderr, "%s\n", cmd);
@@ -685,7 +692,7 @@ menu_read(void)
fclose(fp);
} else
- printf("Could not open file\n");
+ fprintf(stderr, "Could not open %s for reading\n", filename);
if (show) {
qsort(lang_list->sl_str, lang_list->sl_cur, sizeof(char*),
@@ -832,7 +839,8 @@ main(int argc, char **argv)
sleep(2);
}
- if (check_newcons() == 0) {
+ using_vt = check_vt();
+ if (using_vt == 0) {
keymapdir = DEFAULT_SC_KEYMAP_DIR;
fontdir = DEFAULT_SC_FONT_DIR;
font_default = DEFAULT_SC_FONT;
diff --git a/usr.sbin/kgmon/Makefile.depend b/usr.sbin/kgmon/Makefile.depend
index a1ac545..34582cd 100644
--- a/usr.sbin/kgmon/Makefile.depend
+++ b/usr.sbin/kgmon/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
diff --git a/usr.sbin/mount_smbfs/Makefile.depend b/usr.sbin/mount_smbfs/Makefile.depend
index 4e37118..9c676a0 100644
--- a/usr.sbin/mount_smbfs/Makefile.depend
+++ b/usr.sbin/mount_smbfs/Makefile.depend
@@ -2,12 +2,15 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ gnu/lib/csu \
gnu/lib/libgcc \
include \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
+ lib/libcompiler_rt \
lib/libkiconv \
+ lib/libsmb \
.include <dirdeps.mk>
diff --git a/usr.sbin/nandsim/Makefile.depend b/usr.sbin/nandsim/Makefile.depend
new file mode 100644
index 0000000..3646e2e
--- /dev/null
+++ b/usr.sbin/nandsim/Makefile.depend
@@ -0,0 +1,18 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/nandtool/Makefile.depend b/usr.sbin/nandtool/Makefile.depend
new file mode 100644
index 0000000..851372c
--- /dev/null
+++ b/usr.sbin/nandtool/Makefile.depend
@@ -0,0 +1,21 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/libgeom \
+ lib/libsbuf \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/nfsuserd/nfsuserd.8 b/usr.sbin/nfsuserd/nfsuserd.8
index 6e170db..84f4a22 100644
--- a/usr.sbin/nfsuserd/nfsuserd.8
+++ b/usr.sbin/nfsuserd/nfsuserd.8
@@ -24,14 +24,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 25, 2009
+.Dd November 1, 2015
.Dt NFSUSERD 8
.Os
.Sh NAME
.Nm nfsuserd
.Nd load user and group information into the kernel for
.Tn NFSv4
-services
+services plus support manage-gids for all NFS versions
.Sh SYNOPSIS
.Nm nfsuserd
.Op Fl domain Ar domain_name
@@ -39,11 +39,14 @@ services
.Op Fl usermax Ar max_cache_size
.Op Fl verbose
.Op Fl force
+.Op Fl manage-gids
.Op Ar num_servers
.Sh DESCRIPTION
.Nm
loads user and group information into the kernel for NFSv4.
It must be running for NFSv4 to function correctly, either client or server.
+It also provides support for manage-gids and must be running on the server if
+this is being used for any version of NFS.
.Pp
Upon startup, it loads the machines DNS domain name, plus timeout and
cache size limit into the kernel. It then preloads the cache with group
@@ -79,6 +82,15 @@ When set, the server logs a bunch of information to syslog.
This flag option must be set to restart the daemon after it has gone away
abnormally and refuses to start, because it thinks nfsuserd is already
running.
+.It Fl manage-gids
+This flag enables manage-gids for the NFS server
+.Xr nfsd 8 .
+When this is enabled, all NFS requests using
+AUTH_SYS authentication take the uid from the RPC request
+and uses the group list for that uid provided by
+.Xr getgrouplist 3
+on the server instead of the list of groups provided in the RPC authenticator.
+This can be used to avoid the 16 group limit for AUTH_SYS.
.It Ar num_servers
Specifies how many servers to create (max 20).
The default of 4 may be sufficient. You should run enough servers, so that
@@ -90,6 +102,7 @@ such as a process table entry and swap space.
.El
.Sh SEE ALSO
.Xr getgrent 3 ,
+.Xr getgrouplist 3 ,
.Xr getpwent 3 ,
.Xr nfsv4 4 ,
.Xr group 5 ,
@@ -103,7 +116,8 @@ utility was introduced with the NFSv4 experimental subsystem in 2009.
The
.Nm
use
-.Xr getgrent 3
+.Xr getgrent 3 ,
+.Xr getgrouplist 3
and
.Xr getpwent 3
library calls to resolve requests and will hang if the servers handling
diff --git a/usr.sbin/nfsuserd/nfsuserd.c b/usr.sbin/nfsuserd/nfsuserd.c
index 35e2849..293da71 100644
--- a/usr.sbin/nfsuserd/nfsuserd.c
+++ b/usr.sbin/nfsuserd/nfsuserd.c
@@ -92,7 +92,7 @@ uid_t defaultuid = (uid_t)32767;
u_char *defaultgroup = "nogroup";
gid_t defaultgid = (gid_t)32767;
int verbose = 0, im_a_slave = 0, nfsuserdcnt = -1, forcestart = 0;
-int defusertimeout = DEFUSERTIMEOUT;
+int defusertimeout = DEFUSERTIMEOUT, manage_gids = 0;
pid_t slaves[MAXNFSUSERD];
int
@@ -110,6 +110,8 @@ main(int argc, char *argv[])
char hostname[MAXHOSTNAMELEN + 1], *cp;
struct addrinfo *aip, hints;
static uid_t check_dups[MAXUSERMAX];
+ gid_t grps[NGROUPS];
+ int ngroup;
if (modfind("nfscommon") < 0) {
/* Not present in kernel, try loading it */
@@ -160,6 +162,8 @@ main(int argc, char *argv[])
verbose = 1;
} else if (!strcmp(*argv, "-force")) {
forcestart = 1;
+ } else if (!strcmp(*argv, "-manage-gids")) {
+ manage_gids = 1;
} else if (!strcmp(*argv, "-usermax")) {
if (argc == 1)
usage();
@@ -297,12 +301,14 @@ main(int argc, char *argv[])
nid.nid_gid = defaultgid;
nid.nid_name = dnsname;
nid.nid_namelen = strlen(nid.nid_name);
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
nid.nid_flag = NFSID_INITIALIZE;
#ifdef DEBUG
printf("Initialize uid=%d gid=%d dns=%s\n", nid.nid_uid, nid.nid_gid,
nid.nid_name);
#else
- error = nfssvc(NFSSVC_IDNAME, &nid);
+ error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid);
if (error)
errx(1, "Can't initialize nfs user/groups");
#endif
@@ -316,11 +322,13 @@ main(int argc, char *argv[])
nid.nid_gid = grp->gr_gid;
nid.nid_name = grp->gr_name;
nid.nid_namelen = strlen(grp->gr_name);
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
nid.nid_flag = NFSID_ADDGID;
#ifdef DEBUG
printf("add gid=%d name=%s\n", nid.nid_gid, nid.nid_name);
#else
- error = nfssvc(NFSSVC_IDNAME, &nid);
+ error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid);
if (error)
errx(1, "Can't add group %s", grp->gr_name);
#endif
@@ -352,11 +360,23 @@ main(int argc, char *argv[])
nid.nid_uid = pwd->pw_uid;
nid.nid_name = pwd->pw_name;
nid.nid_namelen = strlen(pwd->pw_name);
+ if (manage_gids != 0) {
+ /* Get the group list for this user. */
+ ngroup = NGROUPS;
+ if (getgrouplist(pwd->pw_name, pwd->pw_gid, grps,
+ &ngroup) < 0)
+ syslog(LOG_ERR, "Group list too small");
+ nid.nid_ngroup = ngroup;
+ nid.nid_grps = grps;
+ } else {
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
+ }
nid.nid_flag = NFSID_ADDUID;
#ifdef DEBUG
printf("add uid=%d name=%s\n", nid.nid_uid, nid.nid_name);
#else
- error = nfssvc(NFSSVC_IDNAME, &nid);
+ error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid);
if (error)
errx(1, "Can't add user %s", pwd->pw_name);
#endif
@@ -439,6 +459,8 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
struct info info;
struct nfsd_idargs nid;
u_int32_t saddr;
+ gid_t grps[NGROUPS];
+ int ngroup;
/*
* Only handle requests from 127.0.0.1 on a reserved port number.
@@ -472,14 +494,28 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
nid.nid_usertimeout = defusertimeout;
nid.nid_uid = pwd->pw_uid;
nid.nid_name = pwd->pw_name;
+ if (manage_gids != 0) {
+ /* Get the group list for this user. */
+ ngroup = NGROUPS;
+ if (getgrouplist(pwd->pw_name, pwd->pw_gid,
+ grps, &ngroup) < 0)
+ syslog(LOG_ERR, "Group list too small");
+ nid.nid_ngroup = ngroup;
+ nid.nid_grps = grps;
+ } else {
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
+ }
} else {
nid.nid_usertimeout = 5;
nid.nid_uid = (uid_t)info.id;
nid.nid_name = defaultuser;
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
}
nid.nid_namelen = strlen(nid.nid_name);
nid.nid_flag = NFSID_ADDUID;
- error = nfssvc(NFSSVC_IDNAME, &nid);
+ error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid);
if (error) {
info.retval = error;
syslog(LOG_ERR, "Can't add user %s\n", pwd->pw_name);
@@ -509,8 +545,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
nid.nid_name = defaultgroup;
}
nid.nid_namelen = strlen(nid.nid_name);
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
nid.nid_flag = NFSID_ADDGID;
- error = nfssvc(NFSSVC_IDNAME, &nid);
+ error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid);
if (error) {
info.retval = error;
syslog(LOG_ERR, "Can't add group %s\n",
@@ -541,8 +579,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
nid.nid_name = info.name;
}
nid.nid_namelen = strlen(nid.nid_name);
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
nid.nid_flag = NFSID_ADDUSERNAME;
- error = nfssvc(NFSSVC_IDNAME, &nid);
+ error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid);
if (error) {
info.retval = error;
syslog(LOG_ERR, "Can't add user %s\n", pwd->pw_name);
@@ -572,8 +612,10 @@ nfsuserdsrv(struct svc_req *rqstp, SVCXPRT *transp)
nid.nid_name = info.name;
}
nid.nid_namelen = strlen(nid.nid_name);
+ nid.nid_ngroup = 0;
+ nid.nid_grps = NULL;
nid.nid_flag = NFSID_ADDGROUPNAME;
- error = nfssvc(NFSSVC_IDNAME, &nid);
+ error = nfssvc(NFSSVC_IDNAME | NFSSVC_NEWSTRUCT, &nid);
if (error) {
info.retval = error;
syslog(LOG_ERR, "Can't add group %s\n",
@@ -679,5 +721,5 @@ usage(void)
{
errx(1,
- "usage: nfsuserd [-usermax cache_size] [-usertimeout minutes] [-verbose] [-domain domain_name] [n]");
+ "usage: nfsuserd [-usermax cache_size] [-usertimeout minutes] [-verbose] [-manage-gids] [-domain domain_name] [n]");
}
diff --git a/usr.sbin/ntp/doc/drivers/Makefile.depend b/usr.sbin/ntp/doc/drivers/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/ntp/doc/drivers/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/ntp/doc/drivers/icons/Makefile.depend b/usr.sbin/ntp/doc/drivers/icons/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/ntp/doc/drivers/icons/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/ntp/doc/drivers/scripts/Makefile.depend b/usr.sbin/ntp/doc/drivers/scripts/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/ntp/doc/drivers/scripts/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/ntp/doc/hints/Makefile.depend b/usr.sbin/ntp/doc/hints/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/ntp/doc/hints/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/ntp/doc/icons/Makefile.depend b/usr.sbin/ntp/doc/icons/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/ntp/doc/icons/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/ntp/doc/pic/Makefile.depend b/usr.sbin/ntp/doc/pic/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/ntp/doc/pic/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/ntp/doc/scripts/Makefile.depend b/usr.sbin/ntp/doc/scripts/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/ntp/doc/scripts/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/pstat/Makefile.depend b/usr.sbin/pstat/Makefile.depend
index e01f8c7..7c356c9 100644
--- a/usr.sbin/pstat/Makefile.depend
+++ b/usr.sbin/pstat/Makefile.depend
@@ -9,6 +9,7 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
+ lib/libelf \
lib/libkvm \
lib/libutil \
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index 5c168ab..30a2749 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -274,7 +274,7 @@ pw_userlock(char *arg1, int mode)
char *passtmp = NULL;
char *name;
bool locked = false;
- uid_t id;
+ uid_t id = (uid_t)-1;
if (geteuid() != 0)
errx(EX_NOPERM, "you must be root");
@@ -282,16 +282,19 @@ pw_userlock(char *arg1, int mode)
if (arg1 == NULL)
errx(EX_DATAERR, "username or id required");
- if (arg1[strspn(arg1, "0123456789")] == '\0') {
- id = pw_checkid(arg1, UID_MAX);
- name = NULL;
- } else
- name = arg1;
+ name = arg1;
+ if (arg1[strspn(name, "0123456789")] == '\0')
+ id = pw_checkid(name, UID_MAX);
- pwd = (name != NULL) ? GETPWNAM(pw_checkname(name, 0)) : GETPWUID(id);
+ pwd = GETPWNAM(pw_checkname(name, 0));
+ if (pwd == NULL && id != (uid_t)-1) {
+ pwd = GETPWUID(id);
+ if (pwd != NULL)
+ name = pwd->pw_name;
+ }
if (pwd == NULL) {
- if (name == NULL)
- errx(EX_NOUSER, "no such uid `%ju'", (uintmax_t) id);
+ if (id == (uid_t)-1)
+ errx(EX_NOUSER, "no such name or uid `%ju'", (uintmax_t) id);
errx(EX_NOUSER, "no such user `%s'", name);
}
@@ -639,7 +642,8 @@ pw_checkname(char *name, int gecos)
}
if (!reject) {
while (*ch) {
- if (strchr(badchars, *ch) != NULL || *ch < ' ' ||
+ if (strchr(badchars, *ch) != NULL ||
+ (!gecos && *ch < ' ') ||
*ch == 127) {
reject = 1;
break;
diff --git a/usr.sbin/pw/tests/pw_lock.sh b/usr.sbin/pw/tests/pw_lock.sh
index 9f14e24..5ec1b09 100755
--- a/usr.sbin/pw/tests/pw_lock.sh
+++ b/usr.sbin/pw/tests/pw_lock.sh
@@ -16,7 +16,27 @@ user_locking_body() {
grep "^test:\*:1001:" $HOME/master.passwd
}
+atf_test_case numeric_locking cleanup
+numeric_locking_body() {
+ populate_etc_skel
+ ${PW} useradd test || atf_fail "Creating test user"
+ ${PW} lock 1001 || atf_fail "Locking the user"
+ atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \
+ grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd
+ ${PW} unlock 1001 || atf_fail "Unlocking the user"
+ atf_check -s exit:0 -o match:"^test:\*:1001:" \
+ grep "^test:\*:1001:" $HOME/master.passwd
+ # Now numeric names
+ ${PW} useradd -n 1001 || atf_fail "Creating test user"
+ ${PW} lock 1001 || atf_fail "Locking the user"
+ atf_check -s exit:0 -o match:"^1001:\*LOCKED\*\*:1002:" \
+ grep "^1001:\*LOCKED\*\*:1002:" $HOME/master.passwd
+ ${PW} unlock 1001 || atf_fail "Unlocking the user"
+ atf_check -s exit:0 -o match:"^1001:\*:1002:" \
+ grep "^1001:\*:1002:" $HOME/master.passwd
+}
atf_init_test_cases() {
atf_add_test_case user_locking
+ atf_add_test_case numeric_locking
}
diff --git a/usr.sbin/sysrc/Makefile.depend b/usr.sbin/sysrc/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/sysrc/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/uefisign/Makefile.depend b/usr.sbin/uefisign/Makefile.depend
new file mode 100644
index 0000000..fc0b633
--- /dev/null
+++ b/usr.sbin/uefisign/Makefile.depend
@@ -0,0 +1,19 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ secure/lib/libcrypto \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/unbound/anchor/Makefile.depend b/usr.sbin/unbound/anchor/Makefile.depend
new file mode 100644
index 0000000..399b8c2
--- /dev/null
+++ b/usr.sbin/unbound/anchor/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libexpat \
+ lib/libthr \
+ lib/libunbound \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/unbound/checkconf/Makefile.depend b/usr.sbin/unbound/checkconf/Makefile.depend
new file mode 100644
index 0000000..36ffed0
--- /dev/null
+++ b/usr.sbin/unbound/checkconf/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ lib/libunbound \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/unbound/control/Makefile.depend b/usr.sbin/unbound/control/Makefile.depend
new file mode 100644
index 0000000..36ffed0
--- /dev/null
+++ b/usr.sbin/unbound/control/Makefile.depend
@@ -0,0 +1,23 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ lib/libunbound \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/unbound/daemon/Makefile.depend b/usr.sbin/unbound/daemon/Makefile.depend
new file mode 100644
index 0000000..06c0c16
--- /dev/null
+++ b/usr.sbin/unbound/daemon/Makefile.depend
@@ -0,0 +1,24 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/arpa \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libthr \
+ lib/libunbound \
+ lib/libutil \
+ secure/lib/libcrypto \
+ secure/lib/libssl \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/unbound/local-setup/Makefile.depend b/usr.sbin/unbound/local-setup/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/unbound/local-setup/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.sbin/vigr/Makefile.depend b/usr.sbin/vigr/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/usr.sbin/vigr/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
OpenPOWER on IntegriCloud