linux/drivers/thunderbolt/dma_test.c

// SPDX-License-Identifier: GPL-2.0
/*
 * DMA traffic test driver
 *
 * Copyright (C) 2020, Intel Corporation
 * Authors: Isaac Hazan <[email protected]>
 *	    Mika Westerberg <[email protected]>
 */

#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 - DMA test device driver private data
 * @svc: XDomain service the driver is bound to
 * @xd: XDomain the service belongs to
 * @rx_ring: Software ring holding RX frames
 * @rx_hopid: HopID used for receiving frames
 * @tx_ring: Software ring holding TX frames
 * @tx_hopid: HopID used for sending fames
 * @packets_to_send: Number of packets to send
 * @packets_to_receive: Number of packets to receive
 * @packets_sent: Actual number of packets sent
 * @packets_received: Actual number of packets received
 * @link_speed: Expected link speed (Gb/s), %0 to use whatever is negotiated
 * @link_width: Expected link width (Gb/s), %0 to use whatever is negotiated
 * @crc_errors: Number of CRC errors during the test run
 * @buffer_overflow_errors: Number of buffer overflow errors during the test
 *			    run
 * @result: Result of the last run
 * @error_code: Error code of the last run
 * @complete: Used to wait for the Rx to complete
 * @lock: Lock serializing access to this structure
 * @debugfs_dir: dentry of this dma_test
 */
struct dma_test {};

/* DMA test property directory UUID: 3188cd10-6523-4a5a-a682-fdca07a248d8 */
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();