| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Thunderbolt service API |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright (C) 2017, Intel Corporation |
|---|
| 6 | 7 | * Authors: Michael Jamet <michael.jamet@intel.com> |
|---|
| 7 | 8 | * 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. |
|---|
| 12 | 9 | */ |
|---|
| 13 | 10 | |
|---|
| 14 | 11 | #ifndef THUNDERBOLT_H_ |
|---|
| .. | .. |
|---|
| 83 | 80 | int index; |
|---|
| 84 | 81 | enum tb_security_level security_level; |
|---|
| 85 | 82 | size_t nboot_acl; |
|---|
| 86 | | - unsigned long privdata[0]; |
|---|
| 83 | + unsigned long privdata[]; |
|---|
| 87 | 84 | }; |
|---|
| 88 | 85 | |
|---|
| 89 | 86 | extern struct bus_type tb_bus_type; |
|---|
| .. | .. |
|---|
| 184 | 181 | * @device_name: Name of the device (or %NULL if not known) |
|---|
| 185 | 182 | * @is_unplugged: The XDomain is unplugged |
|---|
| 186 | 183 | * @resume: The XDomain is being resumed |
|---|
| 184 | + * @needs_uuid: If the XDomain does not have @remote_uuid it will be |
|---|
| 185 | + * queried first |
|---|
| 187 | 186 | * @transmit_path: HopID which the remote end expects us to transmit |
|---|
| 188 | 187 | * @transmit_ring: Local ring (hop) where outgoing packets are pushed |
|---|
| 189 | 188 | * @receive_path: HopID which we expect the remote end to transmit |
|---|
| .. | .. |
|---|
| 192 | 191 | * @properties: Properties exported by the remote domain |
|---|
| 193 | 192 | * @property_block_gen: Generation of @properties |
|---|
| 194 | 193 | * @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 |
|---|
| 195 | 197 | * @get_properties_work: Work used to get remote domain properties |
|---|
| 196 | 198 | * @properties_retries: Number of times left to read properties |
|---|
| 197 | 199 | * @properties_changed_work: Work used to notify the remote domain that |
|---|
| .. | .. |
|---|
| 223 | 225 | const char *device_name; |
|---|
| 224 | 226 | bool is_unplugged; |
|---|
| 225 | 227 | bool resume; |
|---|
| 228 | + bool needs_uuid; |
|---|
| 226 | 229 | u16 transmit_path; |
|---|
| 227 | 230 | u16 transmit_ring; |
|---|
| 228 | 231 | u16 receive_path; |
|---|
| .. | .. |
|---|
| 230 | 233 | struct ida service_ids; |
|---|
| 231 | 234 | struct tb_property_dir *properties; |
|---|
| 232 | 235 | u32 property_block_gen; |
|---|
| 236 | + struct delayed_work get_uuid_work; |
|---|
| 237 | + int uuid_retries; |
|---|
| 233 | 238 | struct delayed_work get_properties_work; |
|---|
| 234 | 239 | int properties_retries; |
|---|
| 235 | 240 | struct delayed_work properties_changed_work; |
|---|
| .. | .. |
|---|
| 424 | 429 | * @lock: Must be held during ring creation/destruction. Is acquired by |
|---|
| 425 | 430 | * interrupt_work when dispatching interrupts to individual rings. |
|---|
| 426 | 431 | * @pdev: Pointer to the PCI device |
|---|
| 432 | + * @ops: NHI specific optional ops |
|---|
| 427 | 433 | * @iobase: MMIO space of the NHI |
|---|
| 428 | 434 | * @tx_rings: All Tx rings available on this host controller |
|---|
| 429 | 435 | * @rx_rings: All Rx rings available on this host controller |
|---|
| .. | .. |
|---|
| 437 | 443 | struct tb_nhi { |
|---|
| 438 | 444 | spinlock_t lock; |
|---|
| 439 | 445 | struct pci_dev *pdev; |
|---|
| 446 | + const struct tb_nhi_ops *ops; |
|---|
| 440 | 447 | void __iomem *iobase; |
|---|
| 441 | 448 | struct tb_ring **tx_rings; |
|---|
| 442 | 449 | struct tb_ring **rx_rings; |
|---|
| .. | .. |
|---|
| 497 | 504 | #define RING_FLAG_NO_SUSPEND BIT(0) |
|---|
| 498 | 505 | /* Configure the ring to be in frame mode */ |
|---|
| 499 | 506 | #define RING_FLAG_FRAME BIT(1) |
|---|
| 500 | | -/* Enable end-to-end flow control */ |
|---|
| 501 | | -#define RING_FLAG_E2E BIT(2) |
|---|
| 502 | 507 | |
|---|
| 503 | 508 | struct ring_frame; |
|---|
| 504 | 509 | typedef void (*ring_cb)(struct tb_ring *, struct ring_frame *, bool canceled); |
|---|