From owner-freebsd-arch@FreeBSD.ORG Sun May 3 17:26:50 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 7B21F93B; Sun, 3 May 2015 17:26:50 +0000 (UTC) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46AF9134D; Sun, 3 May 2015 17:26:50 +0000 (UTC) Received: by iecrt8 with SMTP id rt8so116726262iec.0; Sun, 03 May 2015 10:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ytRMXFZagxE6Kjvb8Lpl8UCd9pj56vzrZ+LZzJSQvH8=; b=rgifB/WCNoLVgx5BoAqkxcQ04pVe1OzpPJ1TozJPeLRovUzuS8RafWoM4510ia0Miq uwIs2cUrpIIWVHfxw9YUWnp6MvYF5OMQhaRtksFeLOCU4PZ7f2XmItI/CfPGagZUHtL1 e9V8UjLS9YkegsUcV/lAdfu+6e0g4iRjik0qegVTPvftxyHOr4QdCnM1qME//PSuM43J REkMCHx2SmzH6/vXEv2rPeL6dlEq3O9/7leGq+YigG4nGSFGRYJXMmvklCJLK7SQ3mpi hThL3to++FruRAUdI1VIy6NtEIYeHw+tcgI3nesCkWCSJ5tQRL6iEeGGyITxh2zg7tSl HUhA== MIME-Version: 1.0 X-Received: by 10.107.155.81 with SMTP id d78mr23443271ioe.29.1430674009614; Sun, 03 May 2015 10:26:49 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Sun, 3 May 2015 10:26:49 -0700 (PDT) In-Reply-To: <20150503164949.5095447e@bsd64.grem.de> References: <20150503164949.5095447e@bsd64.grem.de> Date: Sun, 3 May 2015 10:26:49 -0700 X-Google-Sender-Auth: Vx2inGUwj73Z-uFpiwLJeCrlbn4 Message-ID: Subject: Re: Further changes to smb(4) API From: Adrian Chadd To: Michael Gmelin Cc: "freebsd-arch@freebsd.org" , Juli Mallett Content-Type: text/plain; charset=UTF-8 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 17:26:50 -0000 Yes, please do create a library. -a On 3 May 2015 at 07:49, Michael Gmelin wrote: > 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 > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"