From nobody Wed Nov 29 23:22:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sgb2r4lb2z52Q7B for ; Wed, 29 Nov 2023 23:22:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sgb2r2srRz3FBd for ; Wed, 29 Nov 2023 23:22:44 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40859dee28cso2474255e9.0 for ; Wed, 29 Nov 2023 15:22:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701300162; x=1701904962; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ST3NP6Aby+ir0T66VWD3RMsKGhlnQpXRacV4a4NyGgw=; b=BYpFJ3YUEH0gKlJuDtZFJKbGtJa/8JWyGM0D185ZljOka1+4gCqDAq2nd3MQoSawAU +aYalUiOJ1PmsxnOSFGCYpti1pAw/8Zm7O/H56FKfMT5VFn0mNmrbq5I0d5sdO7AL/g3 eUIfzfxUMfU1TR9uIDbNjP/0MYImzQYJ5zGgFvarlcvbuzM0dz8qzbkk+D5MWkLMeS16 4d6Dqwi+gqbi3OMCoMD+prpdVe4nthKJfHOsA8UjqfqPywPhhpkKREnjz2vQGj28wx47 u9yenEfjhX85t23fRHijM/vBKfbbl6dIMe3eipCnnskRbGEnkhduRLmmXyyfHuYLdadg F6mQ== X-Gm-Message-State: AOJu0Yww+jIVyU6wYFdY1wWayRgF0w0XV+i1JLmWPOEIG8A7JNkf++ld YavgaKxzG0SzZ+t2rga0vxOX2A== X-Google-Smtp-Source: AGHT+IGojsNKLbbyXTnbizy2/hetd0KGQM4NLAkB1STuFl1V39z/XRL9CYjDb0SVINjmGj7nlvhgog== X-Received: by 2002:a05:600c:1384:b0:40b:41c8:f414 with SMTP id u4-20020a05600c138400b0040b41c8f414mr10468610wmf.31.1701300162478; Wed, 29 Nov 2023 15:22:42 -0800 (PST) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id v13-20020a05600c444d00b0040b3867a297sm3655913wmn.36.2023.11.29.15.22.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2023 15:22:42 -0800 (PST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Subject: Re: git: 376330aca184 - main - smbus: add compat32 support for SMB ioctls From: Jessica Clarke In-Reply-To: <202311292316.3ATNGAwd017745@gitrepo.freebsd.org> Date: Wed, 29 Nov 2023 23:22:31 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202311292316.3ATNGAwd017745@gitrepo.freebsd.org> To: "Stephen J. Kiernan" X-Mailer: Apple Mail (2.3774.200.91.1.1) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4Sgb2r2srRz3FBd On 29 Nov 2023, at 23:16, Stephen J. Kiernan wrote: >=20 > The branch main has been updated by stevek: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D376330aca1846d0f7771c16604b41bd7= f6f1f14c >=20 > commit 376330aca1846d0f7771c16604b41bd7f6f1f14c > Author: Stephen J. Kiernan > AuthorDate: 2023-11-29 19:33:59 +0000 > Commit: Stephen J. Kiernan > CommitDate: 2023-11-29 23:15:09 +0000 >=20 > smbus: add compat32 support for SMB ioctls >=20 > Some of the SMB ioctl request structures contain pointers and need = to > handle requests from 32-bit applications on 64-bit kernels. >=20 > Obtained from: Juniper Networks, Inc. > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D42837 > --- > sys/dev/smbus/smb.c | 142 = ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 142 insertions(+) >=20 > diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c > index f47fc753bbdc..ee323c835f10 100644 > --- a/sys/dev/smbus/smb.c > +++ b/sys/dev/smbus/smb.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 > @@ -29,6 +30,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -41,6 +43,44 @@ >=20 > #include "smbus_if.h" >=20 > +#ifdef COMPAT_FREEBSD32 > +struct smbcmd32 { > + u_char cmd; > + u_char reserved; > + u_short op; > + union { > + char byte; > + char buf[2]; > + short word; > + } wdata; > + union { > + char byte; > + char buf[2]; > + short word; > + } rdata; > + int slave; > + uint32_t wbuf; > + int wcount; > + uint32_t rbuf; > + int rcount; > +}; > + > +#define SMB_QUICK_WRITE32 _IOW('i', 1, struct smbcmd32) > +#define SMB_QUICK_READ32 _IOW('i', 2, struct smbcmd32) > +#define SMB_SENDB32 _IOW('i', 3, struct smbcmd32) > +#define SMB_RECVB32 _IOWR('i', 4, struct smbcmd32) > +#define SMB_WRITEB32 _IOW('i', 5, struct smbcmd32) > +#define SMB_WRITEW32 _IOW('i', 6, struct smbcmd32) > +#define SMB_READB32 _IOWR('i', 7, struct smbcmd32) > +#define SMB_READW32 _IOWR('i', 8, struct smbcmd32) > +#define SMB_PCALL32 _IOWR('i', 9, struct smbcmd32) > +#define SMB_BWRITE32 _IOW('i', 10, struct smbcmd32) > +#define SMB_BREAD32 _IOWR('i', 11, struct smbcmd32) > +#define SMB_OLD_READB32 _IOW('i', 7, struct smbcmd32) > +#define SMB_OLD_READW32 _IOW('i', 8, struct smbcmd32) > +#define SMB_OLD_PCALL32 _IOW('i', 9, struct smbcmd32) You can use _IOC_NEWTYPE to avoid duplicating the encodings. Jess