From owner-freebsd-arch@FreeBSD.ORG Tue Jan 13 12:56:57 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 818A51065672 for ; Tue, 13 Jan 2009 12:56:57 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B35A58FC16 for ; Tue, 13 Jan 2009 12:56:56 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA16135 for ; Tue, 13 Jan 2009 14:43:23 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <496C8C6A.2030708@icyb.net.ua> Date: Tue, 13 Jan 2009 14:43:22 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.18 (X11/20081124) MIME-Version: 1.0 To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: smb(4): address format X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2009 12:56:57 -0000 Maybe this is not sufficiently suitable for arch@, but I couldn't think of a more relevant list. smb(4) conveniently omits specifying what SMBus slave address is. Ditto for iic(4). As you know the address itself is 7 bit but how to align those bits within a byte is somewhat ambiguous. Even the SMBus Specification sometimes refers to a 7-bit value as to a slave address, but sometimes uses phrases like "Slave Address Bits 7-1". The confusion seems to come from how the address is actually transmitted on the wire where the least significant bit of an address byte is used to indicate direction of an operation (read or write). So, in practice, there two conventions of specifying a slave address: either as 0XXXXXXXb or XXXXXXX0b. On FreeBSD we have a situation where smb/smbus doesn't insist on any convention nor try to enforce it, and specific hardware drivers have differing ideas. E.g. please see PR 100513: http://www.freebsd.org/cgi/query-pr.cgi?pr=100513 This inconsistency can not be a good thing. Maybe we should pick one format, document it and enforce it? >From FreeBSD-centric point of view XXXXXXX0b format seems to be preferable - IMHO, of course. Majority hardware drivers already expect this format, userland programs like mbmon and smbmsg(8) also seem to use it. In wider world 0XXXXXXXb format seems to be preferred, Linux also sticks to it. Of course, choosing one format means changes for those using the other one, but I think that having current inconsistency is worse. P.S. I hope this won't trigger a bikeshed discussion. -- Andriy Gapon