// SPDX-License-Identifier: GPL-2.0
/*
* Stream data over Thunderbolt/USB4 cable
*
* Copyright (C) 2026, Intel Corporation
* Authors: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>
* Mika Westerberg <mika.westerberg@linux.intel.com>
*/
#define pr_fmt(fmt) "tbstream: " fmt
#include <linux/configfs.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/idr.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/poll.h>
#include <linux/sizes.h>
#include <linux/thunderbolt.h>
#include <linux/uaccess.h>
#include <linux/uio.h>
#include <linux/uuid.h>
#include <linux/wait.h>
/*
* USB4STREAM - Stream data directly over Thunderbolt/USB4 cable
*
* HopIDs are configured by the user. In Linux this is done through
* ConfigFS. Once that is done paths are be established the first time
* the stream is opened. Typically the read side is opened first to make
* sure all the data will be received.
*
* End-to-end flow control is mandatory on both sides.
*
* Data is sent to the other side as tunneled DATA packets. All the data
* is owned by the user and passed as-is from the writer to the reader.
*
* Once the stream device is closed, a CLOSE pac