linux/drivers/peci/request.c

// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2021 Intel Corporation

#include <linux/bug.h>
#include <linux/export.h>
#include <linux/pci.h>
#include <linux/peci.h>
#include <linux/slab.h>
#include <linux/types.h>

#include <asm/unaligned.h>

#include "internal.h"

#define PECI_GET_DIB_CMD
#define PECI_GET_DIB_WR_LEN
#define PECI_GET_DIB_RD_LEN

#define PECI_GET_TEMP_CMD
#define PECI_GET_TEMP_WR_LEN
#define PECI_GET_TEMP_RD_LEN

#define PECI_RDPKGCFG_CMD
#define PECI_RDPKGCFG_WR_LEN
#define PECI_RDPKGCFG_RD_LEN_BASE
#define PECI_WRPKGCFG_CMD
#define PECI_WRPKGCFG_WR_LEN_BASE
#define PECI_WRPKGCFG_RD_LEN

#define PECI_RDIAMSR_CMD
#define PECI_RDIAMSR_WR_LEN
#define PECI_RDIAMSR_RD_LEN
#define PECI_WRIAMSR_CMD
#define PECI_RDIAMSREX_CMD
#define PECI_RDIAMSREX_WR_LEN
#define PECI_RDIAMSREX_RD_LEN

#define PECI_RDPCICFG_CMD
#define PECI_RDPCICFG_WR_LEN
#define PECI_RDPCICFG_RD_LEN
#define PECI_RDPCICFG_RD_LEN_MAX
#define PECI_WRPCICFG_CMD

#define PECI_RDPCICFGLOCAL_CMD
#define PECI_RDPCICFGLOCAL_WR_LEN
#define PECI_RDPCICFGLOCAL_RD_LEN_BASE
#define PECI_WRPCICFGLOCAL_CMD
#define PECI_WRPCICFGLOCAL_WR_LEN_BASE
#define PECI_WRPCICFGLOCAL_RD_LEN

#define PECI_ENDPTCFG_TYPE_LOCAL_PCI
#define PECI_ENDPTCFG_TYPE_PCI
#define PECI_ENDPTCFG_TYPE_MMIO
#define PECI_ENDPTCFG_ADDR_TYPE_PCI
#define PECI_ENDPTCFG_ADDR_TYPE_MMIO_D
#define PECI_ENDPTCFG_ADDR_TYPE_MMIO_Q
#define PECI_RDENDPTCFG_CMD
#define PECI_RDENDPTCFG_PCI_WR_LEN
#define PECI_RDENDPTCFG_MMIO_WR_LEN_BASE
#define PECI_RDENDPTCFG_MMIO_D_WR_LEN
#define PECI_RDENDPTCFG_MMIO_Q_WR_LEN
#define PECI_RDENDPTCFG_RD_LEN_BASE
#define PECI_WRENDPTCFG_CMD
#define PECI_WRENDPTCFG_PCI_WR_LEN_BASE
#define PECI_WRENDPTCFG_MMIO_D_WR_LEN_BASE
#define PECI_WRENDPTCFG_MMIO_Q_WR_LEN_BASE
#define PECI_WRENDPTCFG_RD_LEN

/* Device Specific Completion Code (CC) Definition */
#define PECI_CC_SUCCESS
#define PECI_CC_NEED_RETRY
#define PECI_CC_OUT_OF_RESOURCE
#define PECI_CC_UNAVAIL_RESOURCE
#define PECI_CC_INVALID_REQ
#define PECI_CC_MCA_ERROR
#define PECI_CC_CATASTROPHIC_MCA_ERROR
#define PECI_CC_FATAL_MCA_ERROR
#define PECI_CC_PARITY_ERR_GPSB_OR_PMSB
#define PECI_CC_PARITY_ERR_GPSB_OR_PMSB_IERR
#define PECI_CC_PARITY_ERR_GPSB_OR_PMSB_MCA

#define PECI_RETRY_BIT

#define PECI_RETRY_TIMEOUT
#define PECI_RETRY_INTERVAL_MIN
#define PECI_RETRY_INTERVAL_MAX

static u8 peci_request_data_cc(struct peci_request *req)
{}

/**
 * peci_request_status() - return -errno based on PECI completion code
 * @req: the PECI request that contains response data with completion code
 *
 * It can't be used for Ping(), GetDIB() and GetTemp() - for those commands we
 * don't expect completion code in the response.
 *
 * Return: -errno
 */
int peci_request_status(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

static int peci_request_xfer(struct peci_request *req)
{}

static int peci_request_xfer_retry(struct peci_request *req)
{}

/**
 * peci_request_alloc() - allocate &struct peci_requests
 * @device: PECI device to which request is going to be sent
 * @tx_len: TX length
 * @rx_len: RX length
 *
 * Return: A pointer to a newly allocated &struct peci_request on success or NULL otherwise.
 */
struct peci_request *peci_request_alloc(struct peci_device *device, u8 tx_len, u8 rx_len)
{}
EXPORT_SYMBOL_NS_GPL();

/**
 * peci_request_free() - free peci_request
 * @req: the PECI request to be freed
 */
void peci_request_free(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

struct peci_request *peci_xfer_get_dib(struct peci_device *device)
{}
EXPORT_SYMBOL_NS_GPL();

struct peci_request *peci_xfer_get_temp(struct peci_device *device)
{}
EXPORT_SYMBOL_NS_GPL();

static struct peci_request *
__pkg_cfg_read(struct peci_device *device, u8 index, u16 param, u8 len)
{}

static u32 __get_pci_addr(u8 bus, u8 dev, u8 func, u16 reg)
{}

static struct peci_request *
__pci_cfg_local_read(struct peci_device *device, u8 bus, u8 dev, u8 func, u16 reg, u8 len)
{}

static struct peci_request *
__ep_pci_cfg_read(struct peci_device *device, u8 msg_type, u8 seg,
		  u8 bus, u8 dev, u8 func, u16 reg, u8 len)
{}

static struct peci_request *
__ep_mmio_read(struct peci_device *device, u8 bar, u8 addr_type, u8 seg,
	       u8 bus, u8 dev, u8 func, u64 offset, u8 tx_len, u8 len)
{}

u8 peci_request_data_readb(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

u16 peci_request_data_readw(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

u32 peci_request_data_readl(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

u64 peci_request_data_readq(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

u64 peci_request_dib_read(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

s16 peci_request_temp_read(struct peci_request *req)
{}
EXPORT_SYMBOL_NS_GPL();

#define __read_pkg_config(x, type)

__read_pkg_config();
__read_pkg_config();
__read_pkg_config();
__read_pkg_config();

#define __read_pci_config_local(x, type)

__read_pci_config_local();
__read_pci_config_local();
__read_pci_config_local();

#define __read_ep_pci_config(x, msg_type, type)

__read_ep_pci_config();
__read_ep_pci_config();
__read_ep_pci_config();
__read_ep_pci_config();
__read_ep_pci_config();
__read_ep_pci_config();

#define __read_ep_mmio(x, y, addr_type, type1, type2)

__read_ep_mmio();
__read_ep_mmio();