From nobody Mon Apr 29 10:04:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1641913577; cv=none; d=zohomail.com; s=zohoarc; b=GoZnQiWgisF92mUUFKxPUPO1Dp96hMVapHshjEBg4ksU6ZhU/YNotJ73JomAni3dwcK8lDQ+y1af9YYHjxU40ttt54/3xtfZ2qNCaKhIZLKNlzpU7HpglzSh4UInUzediHAnyW6x9tsEzZodIjZpqhPS2NcxXVJxbw2rgcFUVA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641913577; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=xYgBi7meUDrNQiQckDrzllyCUb0ZOwkj0uY1sKNF5mU=; b=Tz9jRYc+9k2dJ2P5WTRSUgRVB+vaxlutVReIoSHgTjbxhxM3bcSVHzyJUFMzoDVuZ606HbFao+iU+lzYFhKJIIeKN724R4DZdAnWYKFN0nY/PAfHojSnxZEu/k7HvuW8jQnDR5Mlw6CiQkSwBcznPCfUODPP4h+iWxLYmIFJCtE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641913577584593.7508311233531; Tue, 11 Jan 2022 07:06:17 -0800 (PST) Received: from localhost ([::1]:51222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7Ij2-0000mo-1g for importer@patchew.org; Tue, 11 Jan 2022 10:06:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7IbX-0000Qy-ER for qemu-devel@nongnu.org; Tue, 11 Jan 2022 09:58:31 -0500 Received: from [2607:f8b0:4864:20::1036] (port=39593 helo=mail-pj1-x1036.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7IbV-0002mp-SQ for qemu-devel@nongnu.org; Tue, 11 Jan 2022 09:58:31 -0500 Received: by mail-pj1-x1036.google.com with SMTP id c14-20020a17090a674e00b001b31e16749cso5691700pjm.4 for ; Tue, 11 Jan 2022 06:58:28 -0800 (PST) Received: from localhost ([122.171.221.63]) by smtp.gmail.com with ESMTPSA id m19sm11226568pfk.218.2022.01.11.06.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 06:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xYgBi7meUDrNQiQckDrzllyCUb0ZOwkj0uY1sKNF5mU=; b=wZKHI4Pmj+50AP6AezBv3SGJmh+BgXKGVs6pf683imI/FvWlssZVMzPTrGyfiDpsAW ErCvdLWW3lgb4AZArk0CfHhYK3f3M+0MFNWy7mmZ5m3X+xUXM/7yzKCdn7SDl1IlE9Xv ZWqkyq3CByelNrqm5QIIiUMh0KmfmhTMd7b2f+1SAOCvF0/vSeKsWpqLuG1ctkAjLuw+ z4EKIMaNGO6WAvJQJt4EMAqBH4EDxIuQ94syd7j1M/smGyDaKe/s7bSYr/pY82DmBpsD JI1I4BmdTKHnHTF6/FdFfvSqm/exHgNpX9DPsYdP5bjcuaMTQ2wQentpU6CPfgT1N/5j N1YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xYgBi7meUDrNQiQckDrzllyCUb0ZOwkj0uY1sKNF5mU=; b=bViiJXymOiOSJS/Q5Gpn1Is5xyCKExhrW2A34Xo5x3uegCYHeAXmBb5iEwuHk9QvQe Tbtx8SxNeweeS3XJcs4EEMQJOLwMTWDnXDwLk/zJ6qcGHKgBLZLNXThSIp7CjDFjNQWI S5xJn5P5il7goV4fxDgm+SbJT7+NpcBC6B3MQm4GcGOkGAIXuFV/+1FIS/bfhQaKc+/A HUp5Wus3TlaOhmiH2NGv5uHg6HahFjffgU1iQBTle8DeTSUqyT294GWJPWj2n+3SDJkp HzHYu8znOqRxHd1yyTF8BDrQZa76PlmtXREv9VnQWzKz8PIKHuUjvwedQ6wPVRj8Al3M Z6WQ== X-Gm-Message-State: AOAM5333GzM1hVcOakysnV0m5rsFzYML/8+ujHr6XN7crz4cdugrvZrL bLKtsDtvClDjhtL5egG/1oyRtQ0jTl6T1Q== X-Google-Smtp-Source: ABdhPJzRZO57PGLo1tmNAEI0a6OH7UulEgMONte1qpV61PSamv/aHmugTyxoJFvLL2DjuKKF+LmzZQ== X-Received: by 2002:a05:6a00:114e:b0:4bc:b9f1:7215 with SMTP id b14-20020a056a00114e00b004bcb9f17215mr4764407pfm.13.1641913107801; Tue, 11 Jan 2022 06:58:27 -0800 (PST) From: Viresh Kumar To: qemu-devel@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , "Michael S. Tsirkin" Subject: [PATCH] hw/vhost-user-i2c: Add support for VIRTIO_I2C_F_ZERO_LENGTH_REQUEST Date: Tue, 11 Jan 2022 20:28:24 +0530 Message-Id: <4f8de2059fc963bb67920a1a2f8481f969a35eec.1641912994.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1036 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=viresh.kumar@linaro.org; helo=mail-pj1-x1036.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viresh Kumar , Vincent Guittot , stratos-dev@op-lists.linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1641913578957100001 Content-Type: text/plain; charset="utf-8" VIRTIO_I2C_F_ZERO_LENGTH_REQUEST is a mandatory feature, that must be implemented by everyone. Add its support. Signed-off-by: Viresh Kumar Reviewed-by: Alex Benn=C3=A9e --- hw/virtio/vhost-user-i2c.c | 10 ++++++++-- include/hw/virtio/vhost-user-i2c.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-user-i2c.c b/hw/virtio/vhost-user-i2c.c index d172632bb0cd..6323a7203ae4 100644 --- a/hw/virtio/vhost-user-i2c.c +++ b/hw/virtio/vhost-user-i2c.c @@ -19,6 +19,10 @@ #define VIRTIO_ID_I2C_ADAPTER 34 #endif =20 +static const int feature_bits[] =3D { + VIRTIO_I2C_F_ZERO_LENGTH_REQUEST +}; + static void vu_i2c_start(VirtIODevice *vdev) { BusState *qbus =3D BUS(qdev_get_parent_bus(DEVICE(vdev))); @@ -113,8 +117,10 @@ static void vu_i2c_set_status(VirtIODevice *vdev, uint= 8_t status) static uint64_t vu_i2c_get_features(VirtIODevice *vdev, uint64_t requested_features, Error **e= rrp) { - /* No feature bits used yet */ - return requested_features; + VHostUserI2C *i2c =3D VHOST_USER_I2C(vdev); + + virtio_add_feature(&requested_features, VIRTIO_I2C_F_ZERO_LENGTH_REQUE= ST); + return vhost_get_features(&i2c->vhost_dev, feature_bits, requested_fea= tures); } =20 static void vu_i2c_handle_output(VirtIODevice *vdev, VirtQueue *vq) diff --git a/include/hw/virtio/vhost-user-i2c.h b/include/hw/virtio/vhost-u= ser-i2c.h index deae47a76d55..d8372f3b43ea 100644 --- a/include/hw/virtio/vhost-user-i2c.h +++ b/include/hw/virtio/vhost-user-i2c.h @@ -25,4 +25,7 @@ struct VHostUserI2C { bool connected; }; =20 +/* Virtio Feature bits */ +#define VIRTIO_I2C_F_ZERO_LENGTH_REQUEST 0 + #endif /* _QEMU_VHOST_USER_I2C_H */ --=20 2.31.1.272.g89b43f80a514