#include <linux/completion.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/sizes.h>
#include <linux/thunderbolt.h>
#define DMA_TEST_TX_RING_SIZE …
#define DMA_TEST_RX_RING_SIZE …
#define DMA_TEST_FRAME_SIZE …
#define DMA_TEST_DATA_PATTERN …
#define DMA_TEST_MAX_PACKETS …
enum dma_test_frame_pdf { … };
struct dma_test_frame { … };
enum dma_test_test_error { … };
static const char * const dma_test_error_names[] = …;
enum dma_test_result { … };
static const char * const dma_test_result_names[] = …;
struct dma_test { … };
static const uuid_t dma_test_dir_uuid = …;
static struct tb_property_dir *dma_test_dir;
static void *dma_test_pattern;
static void dma_test_free_rings(struct dma_test *dt)
{ … }
static int dma_test_start_rings(struct dma_test *dt)
{ … }
static void dma_test_stop_rings(struct dma_test *dt)
{ … }
static void dma_test_rx_callback(struct tb_ring *ring, struct ring_frame *frame,
bool canceled)
{ … }
static int dma_test_submit_rx(struct dma_test *dt, size_t npackets)
{ … }
static void dma_test_tx_callback(struct tb_ring *ring, struct ring_frame *frame,
bool canceled)
{ … }
static int dma_test_submit_tx(struct dma_test *dt, size_t npackets)
{ … }
#define DMA_TEST_DEBUGFS_ATTR(__fops, __get, __validate, __set) …
static void lanes_get(const struct dma_test *dt, u64 *val)
{ … }
static int lanes_validate(u64 val)
{ … }
static void lanes_set(struct dma_test *dt, u64 val)
{ … }
DMA_TEST_DEBUGFS_ATTR(…);
static void speed_get(const struct dma_test *dt, u64 *val)
{ … }
static int speed_validate(u64 val)
{ … }
static void speed_set(struct dma_test *dt, u64 val)
{ … }
DMA_TEST_DEBUGFS_ATTR(…);
static void packets_to_receive_get(const struct dma_test *dt, u64 *val)
{ … }
static int packets_to_receive_validate(u64 val)
{ … }
static void packets_to_receive_set(struct dma_test *dt, u64 val)
{ … }
DMA_TEST_DEBUGFS_ATTR(…);
static void packets_to_send_get(const struct dma_test *dt, u64 *val)
{ … }
static int packets_to_send_validate(u64 val)
{ … }
static void packets_to_send_set(struct dma_test *dt, u64 val)
{ … }
DMA_TEST_DEBUGFS_ATTR(…);
static int dma_test_set_bonding(struct dma_test *dt)
{ … }
static bool dma_test_validate_config(struct dma_test *dt)
{ … }
static void dma_test_check_errors(struct dma_test *dt, int ret)
{ … }
static int test_store(void *data, u64 val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int status_show(struct seq_file *s, void *not_used)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static void dma_test_debugfs_init(struct tb_service *svc)
{ … }
static int dma_test_probe(struct tb_service *svc, const struct tb_service_id *id)
{ … }
static void dma_test_remove(struct tb_service *svc)
{ … }
static int __maybe_unused dma_test_suspend(struct device *dev)
{ … }
static int __maybe_unused dma_test_resume(struct device *dev)
{ … }
static const struct dev_pm_ops dma_test_pm_ops = …;
static const struct tb_service_id dma_test_ids[] = …;
MODULE_DEVICE_TABLE(tbsvc, dma_test_ids);
static struct tb_service_driver dma_test_driver = …;
static int __init dma_test_init(void)
{ … }
module_init(…) …;
static void __exit dma_test_exit(void)
{ … }
module_exit(dma_test_exit);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;