From owner-svn-src-all@FreeBSD.ORG Fri Nov 15 12:23:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CABC038E; Fri, 15 Nov 2013 12:23:36 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 445DC25CA; Fri, 15 Nov 2013 12:23:36 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 9A0781A1AB6; Fri, 15 Nov 2013 23:23:26 +1100 (EST) Date: Fri, 15 Nov 2013 23:23:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: George Neville-Neil Subject: Re: svn commit: r258142 - head/sys/net In-Reply-To: Message-ID: <20131115223304.R2093@besplex.bde.org> References: <201311142007.rAEK7InH068095@svn.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=jYXWtoyz2w8A:10 a=JzwRw_2MAAAA:8 a=N3VrZbfzcpQA:10 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=6I5d2MoRAAAA:8 a=IaFa5-d4mvo-bWcg8YwA:9 a=45ClL6m2LaAA:10 a=SV7veod9ZcQA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Sergey Kandaurov , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 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: Fri, 15 Nov 2013 12:23:36 -0000 On Thu, 14 Nov 2013, George Neville-Neil wrote: > On Nov 14, 2013, at 16:03 , Sergey Kandaurov wrote: > >> On 15 November 2013 00:07, George V. Neville-Neil wrot= e: >>> Log: >>> Shift our OUI correctly. >>> >>> Pointed out by: emaste >>> >>> Modified: >>> head/sys/net/ieee_oui.h >>> >>> Modified: head/sys/net/ieee_oui.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/net/ieee_oui.h Thu Nov 14 19:53:35 2013 (r25814= 1) >>> +++ head/sys/net/ieee_oui.h Thu Nov 14 20:07:17 2013 (r25814= 2) >>> @@ -62,5 +62,5 @@ >>> */ >>> >>> /* Allocate 64K to bhyve */ >>> -#define OUI_FREEBSD_BHYVE_LOW OUI_FREEBSD + 0x000001 >>> -#define OUI_FREEBSD_BHYVE_HIGH OUI_FREEBSD + 0x00ffff >>> +#define OUI_FREEBSD_BHYVE_LOW ((OUI_FREEBSD << 3) + 0x000001) >>> +#define OUI_FREEBSD_BHYVE_HIGH ((OUI_FREEBSD << 3) + 0x00ffff) This also fixes the syntax bugs (missing parentheses). >> Shouldn't it be rather shifted with 24 (3 x 8bits)? > > Correct, and it should really be an | not a +. I=92ll commit a fix. Any chance of also fixing the style bugs? The most obvious ones are spaces instead of tabs after #define's. From=20the next commit: % Modified: head/sys/net/ieee_oui.h % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D % --- head/sys/net/ieee_oui.h=09Thu Nov 14 21:31:58 2013=09(r258146) % +++ head/sys/net/ieee_oui.h=09Thu Nov 14 21:57:37 2013=09(r258147) % ... % @@ -62,5 +62,5 @@ % */ %=20 % /* Allocate 64K to bhyve */ % -#define OUI_FREEBSD_BHYVE_LOW=09((OUI_FREEBSD << 3) + 0x000001) % -#define OUI_FREEBSD_BHYVE_HIGH=09((OUI_FREEBSD << 3) + 0x00ffff) % +#define OUI_FREEBSD_BHYVE_LOW=09(((uint64_t)OUI_FREEBSD << 24) | 0x00000= 1) % +#define OUI_FREEBSD_BHYVE_HIGH=09(((uint64_t)OUI_FREEBSD << 24) | 0x00ff= ff) % This introduces a new bug: uint64_t is used but isn't defined. To avoid all of the following design errors/style bugs: - requiring applications to include to use the BHYVE part of thi= s header - polluting this header for all applications by declaring uint64_t unconditionally in case the BHIVE parts are used - same as previous, but without (user-visible) pollution by using __uint64_= t instead of uint64_t - breaking use of the definitions in cpp expressions by using any typedefed type in them - using the long long abomination instead of uint64_t in the cast to avoid the pollution and make the definition possibly useable in cpp expressions, though it may still have the wrong type - using the long long abomination as a type suffix for OUI_FREEBSD instead of casting OUI_FREEEBSD, I suggest #defining OUI_FREEBSD as some literal constant shifted right by 24. Its type is then determined by the C rules for types of literals combined with the rules for right shifts. Shifting OUI_FREEBSD back gives the same type as the original literal (this is not obvious) the same value as the original literal, and the same value as the left shift expressions above. (Except in cpp expressions types don't work normally.) Does the API require defining OUI_FREEBSD as a value that needs to be shifted left by 24 to use? It would be more useful to define it as the left-shifted value. Then it gives the base for the FreeBSD range. Values that aren't left shifted have the advantage of fitting in 32 bits, so that their natural type is always int the type needed to hold the left-shifted value can be implementation-defined (it should be int64_t on 32-bit systems and long on 64-bit systems). Bruce From owner-svn-src-all@FreeBSD.ORG Fri Nov 15 13:12:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85E5DFFB; Fri, 15 Nov 2013 13:12:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 74EBC281A; Fri, 15 Nov 2013 13:12:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAFDCs3Q016769; Fri, 15 Nov 2013 13:12:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAFDCsH3016766; Fri, 15 Nov 2013 13:12:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311151312.rAFDCsH3016766@svn.freebsd.org> From: Alexander Motin Date: Fri, 15 Nov 2013 13:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258168 - head/sys/dev/sound/pci/hda 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.16 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: Fri, 15 Nov 2013 13:12:54 -0000 Author: mav Date: Fri Nov 15 13:12:53 2013 New Revision: 258168 URL: http://svnweb.freebsd.org/changeset/base/258168 Log: Add ID for Intel Lynx Point HDMI CODEC. Submitted by: Dmitry Luhtionov Modified: head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Fri Nov 15 12:12:50 2013 (r258167) +++ head/sys/dev/sound/pci/hda/hdac.h Fri Nov 15 13:12:53 2013 (r258168) @@ -605,6 +605,7 @@ #define HDA_CODEC_INTELIP2 HDA_CODEC_CONSTRUCT(INTEL, 0x2804) #define HDA_CODEC_INTELCPT HDA_CODEC_CONSTRUCT(INTEL, 0x2805) #define HDA_CODEC_INTELPPT HDA_CODEC_CONSTRUCT(INTEL, 0x2806) +#define HDA_CODEC_INTELLP HDA_CODEC_CONSTRUCT(INTEL, 0x2807) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Fri Nov 15 12:12:50 2013 (r258167) +++ head/sys/dev/sound/pci/hda/hdacc.c Fri Nov 15 13:12:53 2013 (r258168) @@ -318,6 +318,7 @@ static const struct { { HDA_CODEC_INTELIP2, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELCPT, 0, "Intel Cougar Point" }, { HDA_CODEC_INTELPPT, 0, "Intel Panther Point" }, + { HDA_CODEC_INTELLP, 0, "Intel Lynx Point" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" },