Further changes to smb(4) API

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Further changes to smb(4) API

Michael Gmelin-2
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
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Further changes to smb(4) API

Adrian Chadd-2
Yes, please do create a library.


-a


On 3 May 2015 at 07:49, Michael Gmelin <[hidden email]> 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
> _______________________________________________
> [hidden email] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "[hidden email]"
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "[hidden email]"