From cde9070d9970eef1f7ec2360586c802a16230ad8 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:43:50 +0000 Subject: [PATCH] rtl88x2CE_WiFi_linux driver --- kernel/drivers/vfio/mdev/mdev_private.h | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/kernel/drivers/vfio/mdev/mdev_private.h b/kernel/drivers/vfio/mdev/mdev_private.h index b5819b7..74c2e54 100644 --- a/kernel/drivers/vfio/mdev/mdev_private.h +++ b/kernel/drivers/vfio/mdev/mdev_private.h @@ -1,13 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Mediated device interal definitions * * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. * Author: Neo Jia <cjia@nvidia.com> * Kirti Wankhede <kwankhede@nvidia.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #ifndef MDEV_PRIVATE_H @@ -23,20 +20,25 @@ struct list_head next; struct kset *mdev_types_kset; struct list_head type_list; + /* Synchronize device creation/removal with parent unregistration */ + struct rw_semaphore unreg_sem; }; struct mdev_device { struct device dev; struct mdev_parent *parent; - uuid_le uuid; + guid_t uuid; void *driver_data; - struct kref ref; struct list_head next; struct kobject *type_kobj; + struct device *iommu_device; bool active; }; -#define to_mdev_device(dev) container_of(dev, struct mdev_device, dev) +static inline struct mdev_device *to_mdev_device(struct device *dev) +{ + return container_of(dev, struct mdev_device, dev); +} #define dev_is_mdev(d) ((d)->bus == &mdev_bus_type) struct mdev_type { @@ -58,7 +60,8 @@ int mdev_create_sysfs_files(struct device *dev, struct mdev_type *type); void mdev_remove_sysfs_files(struct device *dev, struct mdev_type *type); -int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid); -int mdev_device_remove(struct device *dev, bool force_remove); +int mdev_device_create(struct kobject *kobj, + struct device *dev, const guid_t *uuid); +int mdev_device_remove(struct device *dev); #endif /* MDEV_PRIVATE_H */ -- Gitblit v1.6.2