From owner-freebsd-arch@FreeBSD.ORG Sun May 3 14:50:04 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DCDE662 for ; Sun, 3 May 2015 14:50:04 +0000 (UTC) Received: from mail.grem.de (outcast.grem.de [213.239.217.27]) by mx1.freebsd.org (Postfix) with SMTP id C974A149D for ; Sun, 3 May 2015 14:50:03 +0000 (UTC) Received: (qmail 91526 invoked by uid 89); 3 May 2015 14:49:55 -0000 Received: from unknown (HELO bsd64.grem.de) (mg@grem.de@185.17.207.96) by mail.grem.de with ESMTPA; 3 May 2015 14:49:55 -0000 Date: Sun, 3 May 2015 16:49:49 +0200 From: Michael Gmelin To: arch@freebsd.org Cc: Juli Mallett Subject: Further changes to smb(4) API Message-ID: <20150503164949.5095447e@bsd64.grem.de> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; amd64-portbld-freebsd10.0) X-Face: $wrgCtfdVw_H9WAY?S&9+/F"!41z'L$uo*WzT8miX?kZ~W~Lr5W7v?j0Sde\mwB&/ypo^}> +a'4xMc^^KroE~+v^&^#[B">soBo1y6(TW6#UZiC]o>C6`ej+i Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWJBwe5BQDl LASZU0/LTEWEfHbyj0Txi32+sKrp1Mv944X8/fm1rS+cAAAACXBIWXMAAAsTAAAL EwEAmpwYAAAAB3RJTUUH3wESCxwC7OBhbgAAACFpVFh0Q29tbWVudAAAAAAAQ3Jl YXRlZCB3aXRoIFRoZSBHSU1QbbCXAAAAAghJREFUOMu11DFvEzEUAGCfEhBVFzuq AKkLd0O6VrIQsLXVSZXoWE5N1K3DobBBA9fQpRWc8OkWouaIjedWKiyREOKs+3PY fvalCNjgLVHeF7/3bMtBzV8C/VsQ8tecEgCcDgrzjekwKZ7TwsJZd/ywEKwwP+ZM 8P3drTsAwWn2mpWuDDuYiK1bFs6De0KUUFw0tWxm+D4AIhuuvZqtyWYeO7jQ4Aea 7jUqI+ixhQoHex4WshEvSXdood7stlv4oSuFOC4tqGcr0NjEqXgV4mMJO38nld4+ xKNxRDon7khyKVqY7YR4d+Cg0OMrkWXZOM7YDkEfKiilCn1qYv4mighZiynuHHOA Wq9QJq+BIES7lMFUtcikMnkDGHUoncA+uHgrP0ctIEqfwLHzeSo+eUA66AqzwN6n 2ZHJhw6Qh/PoyC/QENyEyC/AyNjq74Bs+3UH0xYwzDUC4B97HgLocg1QLYgDDO1v f3UX9Y307Ew4AHh67YAFFsxEpkXwpXY3eIgMhAAE3R19L919nNnuD2wlPcDE3UeT L2ytEICQib9BXgS2fU8PrD82ToYO1OEmMSnYTjSqSv9wdC0tPYC+rQRQD9ESnldF CyqfmiYW+tlALt8gH2xrMdC/youbjzPXEun+/ReXsMCDyve3dZc09fn2Oas8oXGc Jj6/fOeK5UmSMPmf/jL+GD8BEj0k/Fn6IO4AAAAASUVORK5CYII= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2015 14:50:04 -0000 Porting some interesting features, r281985 also introduced a breaking ABI/API change to the smbus interface. As Juli pointed out, since this is not backwards compatible anyway, we might as well go the whole nine yards and try to make the interface as good as possible. There's still plenty of time to 11-RELEASE and I'm willing to incorporate further changes, assuming there is enough feedback. As there are only a few ports using this interface and they're all very similar in the way it is used, it would be really good to get some feedback from actual users of this interface in real world projects. Juli suggested as a first step to change rbuf and wbuf in smbcmd from char* to void* to avoid casting in case of SMB_READW and SMB_WRITEW. Based on what I've seen in ports using this API, they all seem to create wrapper functions around these ioctl commands anyway, so I'm curious if it wouldn't make sense to provide functions that wrap the smb interface in a library (either in base or as a port): sysutils/bsdhwmon: uint8_t read_byte(int fd, int slave, const char idxreg); void write_byte(int fd, int slave, const char idxreg, const char value); sysutils/consolehm: int ReadByte(u_char *return_value, int addr); int WriteByte(int addr, int value); sysutils/gkrellm2: static gint get_data(int iodev, u_char command, int interface, u_char *ret); sysutils/healthd: static int WriteByte(int addr,int value); static int ReadByte(int addr); sysutils/xmbmon: int smbioctl_readB(int slave, int addr); void smbioctl_writeB(int slave, int addr, int value); int smbioctl_readW(int smb_slave, int addr); void smbioctl_writeW(int slave, int addr, int value); Cheers, Michael -- Michael Gmelin