linux/drivers/accel/habanalabs/common/debugfs.c

// SPDX-License-Identifier: GPL-2.0

/*
 * Copyright 2016-2021 HabanaLabs, Ltd.
 * All Rights Reserved.
 */

#include "habanalabs.h"
#include "../include/hw_ip/mmu/mmu_general.h"

#include <linux/pci.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/iommu.h>

#define MMU_ADDR_BUF_SIZE
#define MMU_ASID_BUF_SIZE
#define MMU_KBUF_SIZE
#define I2C_MAX_TRANSACTION_LEN

static int hl_debugfs_i2c_read(struct hl_device *hdev, u8 i2c_bus, u8 i2c_addr,
				u8 i2c_reg, u8 i2c_len, u64 *val)
{}

static int hl_debugfs_i2c_write(struct hl_device *hdev, u8 i2c_bus, u8 i2c_addr,
				u8 i2c_reg, u8 i2c_len, u64 val)
{}

static void hl_debugfs_led_set(struct hl_device *hdev, u8 led, u8 state)
{}

static int command_buffers_show(struct seq_file *s, void *data)
{}

static int command_submission_show(struct seq_file *s, void *data)
{}

static int command_submission_jobs_show(struct seq_file *s, void *data)
{}

static int userptr_show(struct seq_file *s, void *data)
{}

static int vm_show(struct seq_file *s, void *data)
{}

static int userptr_lookup_show(struct seq_file *s, void *data)
{}

static ssize_t userptr_lookup_write(struct file *file, const char __user *buf,
		size_t count, loff_t *f_pos)
{}

static int mmu_show(struct seq_file *s, void *data)
{}

static ssize_t mmu_asid_va_write(struct file *file, const char __user *buf,
		size_t count, loff_t *f_pos)
{}

static int mmu_ack_error(struct seq_file *s, void *data)
{}

static ssize_t mmu_ack_error_value_write(struct file *file,
		const char __user *buf,
		size_t count, loff_t *f_pos)
{}

static int engines_show(struct seq_file *s, void *data)
{}

static ssize_t hl_memory_scrub(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static bool hl_is_device_va(struct hl_device *hdev, u64 addr)
{}

static bool hl_is_device_internal_memory_va(struct hl_device *hdev, u64 addr,
						u32 size)
{}

static int device_va_to_pa(struct hl_device *hdev, u64 virt_addr, u32 size,
			u64 *phys_addr)
{}

static int hl_access_dev_mem_by_region(struct hl_device *hdev, u64 addr,
		u64 *val, enum debugfs_access_type acc_type, bool *found)
{}

static void hl_access_host_mem(struct hl_device *hdev, u64 addr, u64 *val,
		enum debugfs_access_type acc_type)
{}

static int hl_access_mem(struct hl_device *hdev, u64 addr, u64 *val,
				enum debugfs_access_type acc_type)
{}

static ssize_t hl_data_read32(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_data_write32(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_data_read64(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_data_write64(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_dma_size_write(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_monitor_dump_trigger(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_get_power_state(struct file *f, char __user *buf,
		size_t count, loff_t *ppos)
{}

static ssize_t hl_set_power_state(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_i2c_data_read(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_i2c_data_write(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_led0_write(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_led1_write(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_led2_write(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_device_read(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_device_write(struct file *f, const char __user *buf,
				     size_t count, loff_t *ppos)
{}

static ssize_t hl_clk_gate_read(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_clk_gate_write(struct file *f, const char __user *buf,
				     size_t count, loff_t *ppos)
{}

static ssize_t hl_stop_on_err_read(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_stop_on_err_write(struct file *f, const char __user *buf,
				     size_t count, loff_t *ppos)
{}

static ssize_t hl_security_violations_read(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_state_dump_read(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_state_dump_write(struct file *f, const char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_timeout_locked_read(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static ssize_t hl_timeout_locked_write(struct file *f, const char __user *buf,
				     size_t count, loff_t *ppos)
{}

static ssize_t hl_check_razwi_happened(struct file *f, char __user *buf,
					size_t count, loff_t *ppos)
{}

static const struct file_operations hl_mem_scrub_fops =;

static const struct file_operations hl_data32b_fops =;

static const struct file_operations hl_data64b_fops =;

static const struct file_operations hl_dma_size_fops =;

static const struct file_operations hl_monitor_dump_fops =;

static const struct file_operations hl_i2c_data_fops =;

static const struct file_operations hl_power_fops =;

static const struct file_operations hl_led0_fops =;

static const struct file_operations hl_led1_fops =;

static const struct file_operations hl_led2_fops =;

static const struct file_operations hl_device_fops =;

static const struct file_operations hl_clk_gate_fops =;

static const struct file_operations hl_stop_on_err_fops =;

static const struct file_operations hl_security_violations_fops =;

static const struct file_operations hl_state_dump_fops =;

static const struct file_operations hl_timeout_locked_fops =;

static const struct file_operations hl_razwi_check_fops =;

static const struct hl_info_list hl_debugfs_list[] =;

static int hl_debugfs_open(struct inode *inode, struct file *file)
{}

static ssize_t hl_debugfs_write(struct file *file, const char __user *buf,
		size_t count, loff_t *f_pos)
{}

static const struct file_operations hl_debugfs_fops =;

static void add_secured_nodes(struct hl_dbg_device_entry *dev_entry, struct dentry *root)
{}

static void add_files_to_device(struct hl_device *hdev, struct hl_dbg_device_entry *dev_entry,
				struct dentry *root)
{}

int hl_debugfs_device_init(struct hl_device *hdev)
{}

void hl_debugfs_device_fini(struct hl_device *hdev)
{}

void hl_debugfs_add_device(struct hl_device *hdev)
{}

void hl_debugfs_add_file(struct hl_fpriv *hpriv)
{}

void hl_debugfs_remove_file(struct hl_fpriv *hpriv)
{}

void hl_debugfs_add_cb(struct hl_cb *cb)
{}

void hl_debugfs_remove_cb(struct hl_cb *cb)
{}

void hl_debugfs_add_cs(struct hl_cs *cs)
{}

void hl_debugfs_remove_cs(struct hl_cs *cs)
{}

void hl_debugfs_add_job(struct hl_device *hdev, struct hl_cs_job *job)
{}

void hl_debugfs_remove_job(struct hl_device *hdev, struct hl_cs_job *job)
{}

void hl_debugfs_add_userptr(struct hl_device *hdev, struct hl_userptr *userptr)
{}

void hl_debugfs_remove_userptr(struct hl_device *hdev,
				struct hl_userptr *userptr)
{}

void hl_debugfs_add_ctx_mem_hash(struct hl_device *hdev, struct hl_ctx *ctx)
{}

void hl_debugfs_remove_ctx_mem_hash(struct hl_device *hdev, struct hl_ctx *ctx)
{}

/**
 * hl_debugfs_set_state_dump - register state dump making it accessible via
 *                             debugfs
 * @hdev: pointer to the device structure
 * @data: the actual dump data
 * @length: the length of the data
 */
void hl_debugfs_set_state_dump(struct hl_device *hdev, char *data,
					unsigned long length)
{}