Blame src/amd.h

Packit 7e09eb
/*
Packit 7e09eb
 * AMD LED control
Packit 7e09eb
 * Copyright (C) 2019, Advanced Micro Devices, Inc.
Packit 7e09eb
 *
Packit 7e09eb
 * This program is free software; you can redistribute it and/or modify it
Packit 7e09eb
 * under the terms and conditions of the GNU General Public License,
Packit 7e09eb
 * version 2, as published by the Free Software Foundation.
Packit 7e09eb
 *
Packit 7e09eb
 * This program is distributed in the hope it will be useful, but WITHOUT
Packit 7e09eb
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit 7e09eb
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
Packit 7e09eb
 * more details.
Packit 7e09eb
 *
Packit 7e09eb
 * You should have received a copy of the GNU General Public License along with
Packit 7e09eb
 * this program; if not, write to the Free Software Foundation, Inc.,
Packit 7e09eb
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
Packit 7e09eb
 *
Packit 7e09eb
 */
Packit 7e09eb
Packit 7e09eb
#include "block.h"
Packit 7e09eb
Packit 7e09eb
enum amd_device_type {AMD_NO_DEVICE, AMD_SATA_DEVICE, AMD_NVME_DEVICE};
Packit 7e09eb
Packit 7e09eb
struct amd_drive {
Packit 7e09eb
	int		ata_port;
Packit 7e09eb
	int		port;
Packit 7e09eb
	int		drive_bay;
Packit 7e09eb
	int		initiator;
Packit 7e09eb
	uint8_t		channel;
Packit 7e09eb
	uint8_t		slave_addr;
Packit 7e09eb
	enum amd_device_type dev;
Packit 7e09eb
};
Packit 7e09eb
Packit 7e09eb
enum amd_led_interfaces {
Packit 7e09eb
	AMD_INTF_UNSET,
Packit 7e09eb
	AMD_INTF_SGPIO,
Packit 7e09eb
	AMD_INTF_IPMI,
Packit 7e09eb
};
Packit 7e09eb
Packit 7e09eb
extern enum amd_led_interfaces amd_interface;
Packit 7e09eb
Packit 7e09eb
enum amd_platforms {
Packit 7e09eb
	AMD_PLATFORM_UNSET,
Packit 7e09eb
	AMD_PLATFORM_ETHANOL_X,
Packit 7e09eb
	AMD_PLATFORM_DAYTONA_X,
Packit 7e09eb
	AMD_PLATFORM_GRANDSTAND,
Packit 7e09eb
	AMD_PLATFORM_SPEEDWAY,
Packit 7e09eb
};
Packit 7e09eb
Packit 7e09eb
extern enum amd_platforms amd_platform;
Packit 7e09eb
Packit 7e09eb
int amd_em_enabled(const char *path);
Packit 7e09eb
int amd_write(struct block_device *device, enum ibpi_pattern ibpi);
Packit 7e09eb
char *amd_get_path(const char *cntrl_path, const char *sysfs_path);
Packit 7e09eb
Packit 7e09eb
int _find_file_path(const char *start_path, const char *filename,
Packit 7e09eb
		    char *path, size_t path_len);
Packit 7e09eb
Packit 7e09eb
/* Register dump formats used for debug output */
Packit 7e09eb
#define REG_FMT_2	"%23s: %-4x%23s: %-4x\n"
Packit 7e09eb
#define REG_FMT_1	"%23s: %-4x\n"