From owner-svn-src-all@freebsd.org Tue May 17 19:34:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14094B3ED6D; Tue, 17 May 2016 19:34:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B257E18A4; Tue, 17 May 2016 19:34:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HJY7Of059505; Tue, 17 May 2016 19:34:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HJY7ol059504; Tue, 17 May 2016 19:34:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201605171934.u4HJY7ol059504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 17 May 2016 19:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300073 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 19:34:09 -0000 Author: jhb Date: Tue May 17 19:34:07 2016 New Revision: 300073 URL: https://svnweb.freebsd.org/changeset/base/300073 Log: Document the formatting requirements of location and pnpinfo strings. devd requires location and pnpinfo strings generated by bus drivers to be formatted as a list of name=value keypairs. Non-conforming bus drivers cause devd to mis-parse device events for these buses. Note that this documents the desired requirements. devctl_safe_quote() doesn't yet escape backslash characters, and devd doesn't handle escaped characters in quoted values. Differential Revision: https://reviews.freebsd.org/D6252 Modified: head/sys/kern/bus_if.m Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Tue May 17 19:00:09 2016 (r300072) +++ head/sys/kern/bus_if.m Tue May 17 19:34:07 2016 (r300073) @@ -532,6 +532,13 @@ METHOD int child_present { * * Return it as a string. If the string is insufficient for the * storage, then return EOVERFLOW. + * + * The string must be formatted as a space-separated list of + * name=value pairs. Names may only contain alphanumeric characters, + * underscores ('_') and hyphens ('-'). Values can contain any + * non-whitespace characters. Values containing whitespace can be + * quoted with double quotes ('"'). Double quotes and backslashes in + * quoted values can be escaped with backslashes ('\'). * * @param _dev the parent device of @p _child * @param _child the device which is being examined @@ -551,7 +558,14 @@ METHOD int child_pnpinfo_str { * * Return it as a string. If the string is insufficient for the * storage, then return EOVERFLOW. - * + * + * The string must be formatted as a space-separated list of + * name=value pairs. Names may only contain alphanumeric characters, + * underscores ('_') and hyphens ('-'). Values can contain any + * non-whitespace characters. Values containing whitespace can be + * quoted with double quotes ('"'). Double quotes and backslashes in + * quoted values can be escaped with backslashes ('\'). + * * @param _dev the parent device of @p _child * @param _child the device which is being examined * @param _buf the address of a buffer to receive the location