hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/thunderbolt.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Thunderbolt service API
34 *
....@@ -5,10 +6,6 @@
56 * Copyright (C) 2017, Intel Corporation
67 * Authors: Michael Jamet <michael.jamet@intel.com>
78 * Mika Westerberg <mika.westerberg@linux.intel.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #ifndef THUNDERBOLT_H_
....@@ -83,7 +80,7 @@
8380 int index;
8481 enum tb_security_level security_level;
8582 size_t nboot_acl;
86
- unsigned long privdata[0];
83
+ unsigned long privdata[];
8784 };
8885
8986 extern struct bus_type tb_bus_type;
....@@ -184,6 +181,8 @@
184181 * @device_name: Name of the device (or %NULL if not known)
185182 * @is_unplugged: The XDomain is unplugged
186183 * @resume: The XDomain is being resumed
184
+ * @needs_uuid: If the XDomain does not have @remote_uuid it will be
185
+ * queried first
187186 * @transmit_path: HopID which the remote end expects us to transmit
188187 * @transmit_ring: Local ring (hop) where outgoing packets are pushed
189188 * @receive_path: HopID which we expect the remote end to transmit
....@@ -192,6 +191,9 @@
192191 * @properties: Properties exported by the remote domain
193192 * @property_block_gen: Generation of @properties
194193 * @properties_lock: Lock protecting @properties.
194
+ * @get_uuid_work: Work used to retrieve @remote_uuid
195
+ * @uuid_retries: Number of times left @remote_uuid is requested before
196
+ * giving up
195197 * @get_properties_work: Work used to get remote domain properties
196198 * @properties_retries: Number of times left to read properties
197199 * @properties_changed_work: Work used to notify the remote domain that
....@@ -223,6 +225,7 @@
223225 const char *device_name;
224226 bool is_unplugged;
225227 bool resume;
228
+ bool needs_uuid;
226229 u16 transmit_path;
227230 u16 transmit_ring;
228231 u16 receive_path;
....@@ -230,6 +233,8 @@
230233 struct ida service_ids;
231234 struct tb_property_dir *properties;
232235 u32 property_block_gen;
236
+ struct delayed_work get_uuid_work;
237
+ int uuid_retries;
233238 struct delayed_work get_properties_work;
234239 int properties_retries;
235240 struct delayed_work properties_changed_work;
....@@ -424,6 +429,7 @@
424429 * @lock: Must be held during ring creation/destruction. Is acquired by
425430 * interrupt_work when dispatching interrupts to individual rings.
426431 * @pdev: Pointer to the PCI device
432
+ * @ops: NHI specific optional ops
427433 * @iobase: MMIO space of the NHI
428434 * @tx_rings: All Tx rings available on this host controller
429435 * @rx_rings: All Rx rings available on this host controller
....@@ -437,6 +443,7 @@
437443 struct tb_nhi {
438444 spinlock_t lock;
439445 struct pci_dev *pdev;
446
+ const struct tb_nhi_ops *ops;
440447 void __iomem *iobase;
441448 struct tb_ring **tx_rings;
442449 struct tb_ring **rx_rings;
....@@ -497,8 +504,6 @@
497504 #define RING_FLAG_NO_SUSPEND BIT(0)
498505 /* Configure the ring to be in frame mode */
499506 #define RING_FLAG_FRAME BIT(1)
500
-/* Enable end-to-end flow control */
501
-#define RING_FLAG_E2E BIT(2)
502507
503508 struct ring_frame;
504509 typedef void (*ring_cb)(struct tb_ring *, struct ring_frame *, bool canceled);