Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 May 2015 16:49:49 +0200
From:      Michael Gmelin <freebsd@grem.de>
To:        arch@freebsd.org
Cc:        Juli Mallett <jmallett@freebsd.org>
Subject:   Further changes to smb(4) API
Message-ID:  <20150503164949.5095447e@bsd64.grem.de>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150503164949.5095447e>