Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Dec 2023 02:01:12 +0000
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        "Stephen J. Kiernan" <stevek@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: 682b069c5c56 - main - iicbus: add compat32 support for I2C ioctls
Message-ID:  <40E00B2E-E8C1-4980-896D-D9620E685108@freebsd.org>
In-Reply-To: <202312010133.3B11XtOU057326@gitrepo.freebsd.org>
References:  <202312010133.3B11XtOU057326@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1 Dec 2023, at 01:33, Stephen J. Kiernan <stevek@FreeBSD.org> wrote:
>=20
> The branch main has been updated by stevek:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D682b069c5c5643d26199cc1b65717f99=
c98bce9d
>=20
> commit 682b069c5c5643d26199cc1b65717f99c98bce9d
> Author:     Stephen J. Kiernan <stevek@FreeBSD.org>
> AuthorDate: 2023-11-29 19:20:45 +0000
> Commit:     Stephen J. Kiernan <stevek@FreeBSD.org>
> CommitDate: 2023-12-01 01:33:46 +0000
>=20
>    iicbus: add compat32 support for I2C ioctls
>=20
>    Some of the I2C ioctl request structures contain pointers and need =
to
>    handle requests from 32-bit applications on 64-bit kernels.
>=20
>    Obtained from:  Juniper Networks, Inc.
>    Differential Revision:  https://reviews.freebsd.org/D42836
> ---
> sys/dev/iicbus/iic.c | 111 =
+++++++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 108 insertions(+), 3 deletions(-)
>=20
> diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
> index baaa7a096a14..8c9dbb6bc145 100644
> --- a/sys/dev/iicbus/iic.c
> +++ b/sys/dev/iicbus/iic.c
> @@ -2,6 +2,7 @@
>  * SPDX-License-Identifier: BSD-2-Clause
>  *
>  * Copyright (c) 1998, 2001 Nicolas Souchu
> + * Copyright (c) 2023 Juniper Networks, Inc.
>  * All rights reserved.
>  *
>  * Redistribution and use in source and binary forms, with or without
> @@ -27,6 +28,7 @@
>  *
>  */
> #include <sys/param.h>
> +#include <sys/abi_compat.h>
> #include <sys/bus.h>
> #include <sys/conf.h>
> #include <sys/fcntl.h>
> @@ -57,6 +59,30 @@ struct iic_cdevpriv {
> uint8_t addr;
> };
>=20
> +#ifdef COMPAT_FREEBSD32
> +struct iic_msg32 {
> + uint16_t slave;
> + uint16_t flags;
> + uint16_t len;
> + uint32_t buf;
> +};
> +
> +struct iiccmd32 {
> + u_char slave;
> + uint32_t count;
> + uint32_t last;
> + uint32_t buf;
> +};
> +
> +struct iic_rdwr_data32 {
> + uint32_t msgs;
> + uint32_t nmsgs;
> +};
> +
> +#define I2CWRITE32 _IOW('i', 4, struct iiccmd32)
> +#define I2CREAD32 _IOW('i', 5, struct iiccmd32)
> +#define I2CRDWR32 _IOW('i', 6, struct iic_rdwr_data32)
> +#endif

Like I said for smbus, please use _IOC_NEWTYPE.

Jess




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40E00B2E-E8C1-4980-896D-D9620E685108>